edu.ucsb.nceas.metaedit
Class MetaDoc

edu.ucsb.nceas.metaedit.MetaDoc

public class MetaDoc
implements java.awt.event.ActionListener

A component used to store and display an XML document utilizing a JTree for hirearchichal storage of the nodes.

Version:
0.9Beta
Author:
Matthew Jones, Rudolf Nottrott, Zheng Wang

Constructor Summary
MetaDoc(java.lang.String URLName, java.lang.String rootName)
          Create a new MetaDoc and its principal components.
MetaDoc(java.lang.String openOrNew, java.lang.String URLName, java.lang.String rootName, MetaEditor editor)
          Create a new XML file, create a JTree to contain it, and load the root node and its immediate children into the tree.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Handle any events passed to the class.
 void buildMinimalLegalTree(ElementFactory.TreeElement selectedTreeElement, java.lang.String userString)
           
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 void endPrefixMapping(java.lang.String prefix)
           
 javax.swing.JTree getDocumentJTree()
           
 java.lang.String getSaveString()
          get the xml text
 void ignorableWhitespace(char[] cbuf, int start, int len)
           
 void internalFrameActivated(javax.swing.event.InternalFrameEvent event)
          handler method that is called when this document is selected and becomes the active frame in a set of JInternalFrames, part of the implementation of the InternalFrameListener interface
 void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent event)
           
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
           
 void previewXML()
          Display the XML text in the preview window.
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void reconstructEmptyTXElementInTree(ElementFactory.TreeElement selectedTreeElement)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String name)
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 java.lang.String toXML()
          Display the XML text in the preview window.
 

Constructor Detail

MetaDoc

public MetaDoc(java.lang.String URLName,
               java.lang.String rootName)
Create a new MetaDoc and its principal components.

MetaDoc

public MetaDoc(java.lang.String openOrNew,
               java.lang.String URLName,
               java.lang.String rootName,
               MetaEditor editor)
        throws java.lang.Exception
Create a new XML file, create a JTree to contain it, and load the root node and its immediate children into the tree.
Parameters:
URLName - name of the document type to use
rootName - name of the root element from which to build the tree
Method Detail

buildMinimalLegalTree

public void buildMinimalLegalTree(ElementFactory.TreeElement selectedTreeElement,
                                  java.lang.String userString)

reconstructEmptyTXElementInTree

public void reconstructEmptyTXElementInTree(ElementFactory.TreeElement selectedTreeElement)

toXML

public java.lang.String toXML()
Display the XML text in the preview window.

previewXML

public void previewXML()
Display the XML text in the preview window.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Handle any events passed to the class. This class acts as a listener to button pressed events generated from the ElementChoice window.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - the event to be handled

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent event)
handler method that is called when this document is selected and becomes the active frame in a set of JInternalFrames, part of the implementation of the InternalFrameListener interface
Parameters:
event - the InternalFrameEvent that is generated upon activation of this frame

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent event)

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)

getSaveString

public java.lang.String getSaveString()
get the xml text

getDocumentJTree

public javax.swing.JTree getDocumentJTree()

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] cbuf,
                                int start,
                                int len)

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.