Ulm.XML.GUI
Class XML_view

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--Ulm.XML.GUI.XML_view
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class XML_view
extends javax.swing.JPanel

XML view component bean, the central class of this project. This component is able to display the given XML document, specified as a Reader, InputStream, Node or clipboard content. The component also contains two additional panels, one for displaying the current path and the other for setting a filter. Filter, if set, makes only the document fragments, starting with the node with the given name, visible. These two additional panels can also be hidden if not required.


Constructor Summary
XML_view()
           

 

Method Summary
 void Expand(javax.swing.tree.DefaultMutableTreeNode n)
          Expand this node and all its children.
 java.lang.String getFilter()
          If set, the set of document fragments, starting from the node with the given name is displayed.
 org.w3c.dom.Node getTree()
          Get the XML currently being displayed
 boolean isAutoExpand()
          If set, the branch is expanded by clicking on its text.
 boolean isFilterVisible()
          If set, the filter panel is visible.
 boolean isStructureVisible()
          Checks if the structure tab is visible.
 boolean isPathVisible()
          If set to true, the path to the node from root is visible above the tree.
 boolean isSimplify()
          If set, the built - in specialised renderers are active.
 void setAutoExpand(boolean newAutoExpand)
          If set, the branch is expanded by clicking on its text.
 void setFilter(java.lang.String newFilter)
          If set, the set of document fragments, starting from the node with the given name is displayed.
 void setFilterVisible(boolean newFilterVisible)
          If set, the filter panel is visible.
 void setPathVisible(boolean newPathVisible)
          If set to true, the path to the node from root is visible above the tree.
 void setSimplify(boolean newSimplify)
          If set, the built - in specialised renderers are active.
 void setTree(org.w3c.dom.Node newTree)
          Set the XML document to display
 void setStructureVisible(boolean show)
          Shows/hides the document structure tab.
 void showStream(java.io.InputStream input)
          Reads and shows the XML document from the stream.
 void showStream(java.io.Reader input)
          Reads and shows the XML document from the reader.
 void paste()
          Reads and shows the XML document from the clipboard.

 

Constructor Detail

XML_view

public XML_view()
Method Detail

getTree

public org.w3c.dom.Node getTree()
Get the XML currently being displayed

setTree

public void setTree(org.w3c.dom.Node newTree)
Set the XML document to display

showStream

public void showStream(java.io.Reader input)
Reads and shows the XML document from the Reader.

showStream

public void showStream(java.io.InputStream input)
Reads and shows the XML document from the stream.

setPathVisible

public void setPathVisible(boolean newPathVisible)
If set to true, the path to the node from root is visible above the tree.

isPathVisible

public boolean isPathVisible()
If set to true, the path to the node from root is visible above the tree.

Expand

public void Expand(javax.swing.tree.DefaultMutableTreeNode n)
Expand this node and all its children.

setAutoExpand

public void setAutoExpand(boolean newAutoExpand)
If set, the branch is expanded by clicking on its text.

isAutoExpand

public boolean isAutoExpand()
If set, the branch is expanded by clicking on its text.

setFilter

public void setFilter(java.lang.String newFilter)
If set, the set of document fragments, starting from the node with the given name is displayed.

getFilter

public java.lang.String getFilter()
If set, the set of document fragments, starting from the node with the given name is displayed.

setSimplify

public void setSimplify(boolean newSimplify)
If set, the built - in specialised renderers are active.

isSimplify

public boolean isSimplify()
If set, the built - in specialised renderers are active.

setFilterVisible

public void setFilterVisible(boolean newFilterVisible)
If set, the filter panel is visible. The filter panel allows to show only subtrees, starting with the certain node, having the given name.

isFilterVisible

public boolean isFilterVisible()
If set, the filter panel is visible. The filter panel allows to show only subtrees, starting with the certain node, having the given name.

paste

public boolean paste()
Reads and shows the XML document from the cliboard. The clipboard must contain the text string, representing a valid XML document. Otherwise, the error message is displayed in the path window. Similary as with Swing classes, no automatic event handling is provided for this method, you should call it in response to some event, for example, after pressing a button somewhere inside your application.