public abstract class Node extends Column implements View, Comparable<Node>
© Copyright 2007 Sans Pareil Technologies, Inc.
| Modifier and Type | Field and Description |
|---|---|
protected AddComponent |
add
The component that is used to display the components that are used
to capture user input about new child to be added.
|
protected DisplayComponent |
display
The component that is used to display the title of the node and
the controls to add/remove.
|
protected String |
displayName
The
Treeable.getDisplayName() value stored to
allow access to value when the treeable instance is no
longer accessible (deleted). |
protected String |
objectId
The
ObjectId for the treeable object that is
currently displayed in the node. |
protected Treeable |
treeable
The treeable object that is represented by this node.
|
PROPERTY_BORDER, PROPERTY_CELL_SPACING, PROPERTY_INSETSCHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY| Constructor and Description |
|---|
Node()
Create a new instance with no value for
treeable. |
Node(Treeable treeable)
Create a new instance using the specified model object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Treeable treeable)
Add a new child node to this node using the specified model object.
|
protected void |
addChild(Treeable treeable,
DefaultMutableTreeNode node)
Add a new child node to this node.
|
int |
compareTo(Node node)
Compare the specified node with this.
|
protected abstract DisplayComponent |
createDisplayComponent()
Abstract method to initialise
display with the appropriate
subclass. |
protected abstract DisplayComponent |
createDisplayComponent(Treeable treeable)
Abstract method to initialise
display with the appropriate
subclass. |
boolean |
equals(Object object)
Check the specified object with this for equality.
|
AddComponent |
getAdd()
Returns
add. |
DisplayComponent |
getDisplay()
Returns
display. |
String |
getName()
Get the value displayed in the
DisplayComponent.name component. |
String |
getObjectId()
Returns
objectId. |
Treeable |
getTreeable()
Returns
treeable. |
int |
hashCode()
Computes a hash code for this object.
|
void |
setAdd(AddComponent add)
Set
add. |
void |
setName(String name)
Set the value displayed in the
DisplayComponent.name component. |
String |
toString()
Return a string representation of this object.
|
getBorder, getCellSpacing, getInsets, setBorder, setCellSpacing, setInsetsadd, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, processInput, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOfprotected Treeable treeable
protected String objectId
ObjectId for the treeable object that is
currently displayed in the node.protected String displayName
Treeable.getDisplayName() value stored to
allow access to value when the treeable instance is no
longer accessible (deleted).protected DisplayComponent display
protected AddComponent add
public Node()
treeable.public Node(Treeable treeable)
treeable - The model object for this node.public void addChild(Treeable treeable)
treeable - The model object to use to create the child.protected void addChild(Treeable treeable, DefaultMutableTreeNode node)
treeable - The model object to use to create the child.node - The TreeNode to which the new child node is
to be added.public String toString()
displayName.public int hashCode()
treeable.public boolean equals(Object object)
treeable.public int compareTo(Node node)
treeable.compareTo in interface Comparable<Node>treeable instances compare.public String getName()
DisplayComponent.name component.public void setName(String name)
DisplayComponent.name component.name - The text to display in the component.public DisplayComponent getDisplay()
display.public AddComponent getAdd()
add.public void setAdd(AddComponent add)
add.add - The value to set.public String getObjectId()
objectId.public Treeable getTreeable()
treeable. Please note that accessing the fields
of this object may result in RuntimeException
thrown depending upon the persistant state.protected abstract DisplayComponent createDisplayComponent()
display with the appropriate
subclass.DisplayComponent.protected abstract DisplayComponent createDisplayComponent(Treeable treeable)
display with the appropriate
subclass.treeable - The model object to use to initialise the display
component.DisplayComponent.