net.sf.taverna.zaria
Interface ZTreeNode

All Known Implementing Classes:
WorkbenchZBasePane, ZBasePane, ZBlankComponent, ZPane, ZRavenComponent, ZSplitPane, ZTabbedPane

public interface ZTreeNode

Tree structure over a nested set of Zaria components, yes, this is almost an exact duplicate of TreeNode but as ZPane is a subclass of JComponent we can't have a getParent method (JComponent already contains this) so, annoyingly, we have to invent a duplicate interface avoiding the name collisions. D'oh. This interface also defines that ZTreeNode implementations must be able to serialize their current state to XML and restore from the same.

Author:
Tom Oinn

Method Summary
 void configure(org.jdom.Element e)
          Set current state of this node, including construction of nested containers, from the specified JDOM Element
 void discard()
          Indicates that the component is about to be discarded, and any cleaning up should be carried out here.
 java.util.List<javax.swing.Action> getActions()
          Return a list of Action objects that can act on this ZTreeNode, implemented largely by subclasses.
 org.jdom.Element getElement()
          Build current state of this node in the form of a JDOM element
 ZBasePane getRoot()
          Get the ZBasePane at the root of the component heirarchy or null if there isn't one (there will be for all cases where the component is visible)
 java.util.List<java.awt.Component> getToolbarComponents()
          Return a list of JComponent items that should be added on the left hand side of the toolbar when in edit mode
 int getZChildCount()
          Get number of immediate children
 java.util.List<ZTreeNode> getZChildren()
          Immediate children
 ZTreeNode getZParent()
          Parent ZTreeNode
 boolean isZLeaf()
          Is this a leaf node?
 boolean isZRoot()
          Is this a root node?
 void setEditable(boolean editable)
          Set editable status on this node, implementations will recursively set the status on all children
 void swap(ZTreeNode oldComponent, ZTreeNode newComponent)
          Swap out the given child for the new one
 

Method Detail

configure

void configure(org.jdom.Element e)
Set current state of this node, including construction of nested containers, from the specified JDOM Element


discard

void discard()
Indicates that the component is about to be discarded, and any cleaning up should be carried out here.


getActions

java.util.List<javax.swing.Action> getActions()
Return a list of Action objects that can act on this ZTreeNode, implemented largely by subclasses.


getElement

org.jdom.Element getElement()
Build current state of this node in the form of a JDOM element


getRoot

ZBasePane getRoot()
Get the ZBasePane at the root of the component heirarchy or null if there isn't one (there will be for all cases where the component is visible)


getToolbarComponents

java.util.List<java.awt.Component> getToolbarComponents()
Return a list of JComponent items that should be added on the left hand side of the toolbar when in edit mode


getZChildCount

int getZChildCount()
Get number of immediate children

Returns:
int count of immediate ZTreeNode children

getZChildren

java.util.List<ZTreeNode> getZChildren()
Immediate children

Returns:
List of child nodes

getZParent

ZTreeNode getZParent()
Parent ZTreeNode

Returns:
parent node or null if this is a root

isZLeaf

boolean isZLeaf()
Is this a leaf node?

Returns:
whether the node is a leaf

isZRoot

boolean isZRoot()
Is this a root node?

Returns:
whether the node is a root

setEditable

void setEditable(boolean editable)
Set editable status on this node, implementations will recursively set the status on all children


swap

void swap(ZTreeNode oldComponent,
          ZTreeNode newComponent)
Swap out the given child for the new one

Parameters:
oldComponent - the ZTreeNode to remove as a child
newComponent - the ZTreeNode to insert in its place