net.sourceforge.nite.gui.textviewer
Class NTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by net.sourceforge.nite.gui.textviewer.NTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class NTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

Author:
judyr
See Also:
Serialized Form

Field Summary
 java.awt.Font font
           
 java.awt.Color highcolour
           
 java.awt.Color textcolour
           
 boolean timehighlit
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
NTreeNode()
          Create a simple tree node with no content.
NTreeNode(java.lang.Object userObject, boolean allowsChildren)
          Constructor for NTreeNode.
NTreeNode(java.lang.String s)
          Create a simple NTreeNode with the given string as its text
 
Method Summary
 void addNode(NTreeNode n)
          Add the specified node as a child of this node, thus expanding the tree Update indices of the parent NTree as necessary.
 java.lang.String getContent()
          Returns the textual content of this node.
 ObjectModelElement getDataElement()
          Returns the dataElement.
 javax.swing.JComponent getDisplaycomponent()
          Returns the displaycomponent.
 JComponentHandler getDisplayComponentHandler()
          Returns the displayComponentHandler.
 double getEndtime()
          Returns the endtime.
 java.lang.Double getEndTime(Element obj)
          return the end time of the given JDOM element (not required by user programs)
 java.awt.Color getHighlightColor()
          Returns the highlighting colour
 double getStarttime()
          Returns the starttime.
 java.awt.Color getTextColor()
          Returns the normal text colour
 boolean isHighlighted()
          Returns the highlighted-ness of the node.
 boolean isTimed()
          Returns true if the node is timed and false otherwise.
 void remove(NTreeNode child)
          Remove the specified child node from this one and update indices of the parent NTree as necessary.
 void setComponent(javax.swing.JComponent com)
          set the JComponent that displays this node
 void setContent(java.lang.String content)
          Sets the text content of this node.
 void setDataElement(ObjectModelElement dataElement)
          Sets the dataElement.
 void setDisplaycomponent(javax.swing.JComponent displaycomponent)
          Sets the displaycomponent.
 void setDisplayComponentHandler(JComponentHandler displayComponentHandler)
          Sets the displayComponentHandler.
 void setEndtime(double endtime)
          Sets the endtime.
 void setHighlightColor(java.awt.Color col)
          Set the highlighting colour
 void setHighlighted(boolean highed)
          Sets the highlighted-ness of the node.
 void setHighlighted(boolean highed, java.awt.Color col)
          Sets the highlighted-ness of the node.
 void setStarttime(double starttime)
          Sets the starttime.
 void setTextColor(java.awt.Color col)
          Set the normal text colour
 java.lang.String toString()
          return the currently displayed text for this node
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

font

public java.awt.Font font

textcolour

public java.awt.Color textcolour

highcolour

public java.awt.Color highcolour

timehighlit

public boolean timehighlit
Constructor Detail

NTreeNode

public NTreeNode()
Create a simple tree node with no content.


NTreeNode

public NTreeNode(java.lang.String s)
Create a simple NTreeNode with the given string as its text


NTreeNode

public NTreeNode(java.lang.Object userObject,
                 boolean allowsChildren)
Constructor for NTreeNode.

Parameters:
userObject -
allowsChildren -
Method Detail

addNode

public void addNode(NTreeNode n)
Add the specified node as a child of this node, thus expanding the tree Update indices of the parent NTree as necessary.


remove

public void remove(NTreeNode child)
Remove the specified child node from this one and update indices of the parent NTree as necessary.


setComponent

public void setComponent(javax.swing.JComponent com)
set the JComponent that displays this node


toString

public java.lang.String toString()
return the currently displayed text for this node

Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode

getEndTime

public java.lang.Double getEndTime(Element obj)
return the end time of the given JDOM element (not required by user programs)


getEndtime

public double getEndtime()
Returns the endtime.

Returns:
double

getStarttime

public double getStarttime()
Returns the starttime.

Returns:
double

setEndtime

public void setEndtime(double endtime)
Sets the endtime.

Parameters:
endtime - The endtime to set

setStarttime

public void setStarttime(double starttime)
Sets the starttime.

Parameters:
starttime - The starttime to set

getContent

public java.lang.String getContent()
Returns the textual content of this node.

Returns:
String

setContent

public void setContent(java.lang.String content)
Sets the text content of this node.

Parameters:
content - The content to set

getDisplaycomponent

public javax.swing.JComponent getDisplaycomponent()
Returns the displaycomponent.

Returns:
JComponent

setDisplaycomponent

public void setDisplaycomponent(javax.swing.JComponent displaycomponent)
Sets the displaycomponent.

Parameters:
displaycomponent - The displaycomponent to set

setHighlighted

public void setHighlighted(boolean highed)
Sets the highlighted-ness of the node.


setHighlighted

public void setHighlighted(boolean highed,
                           java.awt.Color col)
Sets the highlighted-ness of the node.


isHighlighted

public boolean isHighlighted()
Returns the highlighted-ness of the node.


isTimed

public boolean isTimed()
Returns true if the node is timed and false otherwise.


getDataElement

public ObjectModelElement getDataElement()
Returns the dataElement.

Returns:
ObjectModelElement

setDataElement

public void setDataElement(ObjectModelElement dataElement)
Sets the dataElement.

Parameters:
dataElement - The dataElement to set

getDisplayComponentHandler

public JComponentHandler getDisplayComponentHandler()
Returns the displayComponentHandler.

Returns:
JComponentHandler

setDisplayComponentHandler

public void setDisplayComponentHandler(JComponentHandler displayComponentHandler)
Sets the displayComponentHandler.

Parameters:
displayComponentHandler - The displayComponentHandler to set

getHighlightColor

public java.awt.Color getHighlightColor()
Returns the highlighting colour


setHighlightColor

public void setHighlightColor(java.awt.Color col)
Set the highlighting colour


getTextColor

public java.awt.Color getTextColor()
Returns the normal text colour


setTextColor

public void setTextColor(java.awt.Color col)
Set the normal text colour