public class OdsxFilteredTreeNode extends FwkPersistence implements java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, OdsxSelectorTreeNodeInterface
OdsxFilteredTreeNode
is a node in a tree data
structure that is able to filter its children.
A tree node may have at most one parent and 0 or more children.
OdsxFilteredTreeNode
provides operations for examining and modifying a
node's parent and children and also operations for examining the tree that
the node is a part of. A node's tree is the set of all nodes that can be
reached by starting at the node and following all the possible links to
parents and children. A node with no parent is the root of its tree; a
node with no children is a leaf. A tree may consist of many subtrees,
each node acting as the root for its own subtree.
This class provides enumerations for efficiently traversing a tree or
subtree in various orders or for following the path between two nodes.
A OdsxFilteredTreeNode
may also hold a reference to a user object, the
use of which is left to the user. Asking a OdsxFilteredTreeNode
for its
string representation with toString()
returns the string
representation of its user object.
javax.swing.tree.OdsxFilteredTreeNode
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected boolean |
allowsChildren
true if the node is able to have children
|
protected java.util.Vector |
children
array of children, may be null if this node has no children
|
static java.util.Enumeration |
EMPTY_ENUMERATION
An enumeration that is always empty.
|
protected boolean |
isLeaf |
protected boolean |
isLoaded |
protected OdsxFilterInterface |
odsFilter
The optional filter.
|
protected OdsxSelectorInterface |
odsSelector
The ods selector.
|
protected OdsxSelectorTreeNodeInterface |
parent
This node's parent, or null if this node has no parent
|
protected OdsxPresentableElementInterface |
presentable
the presetable element.
|
protected java.lang.Object |
userObject
The optional user value.
|
static java.lang.String |
version |
protected OdsxSelectorTreeNodeInterface[] |
visibleChildren
The array containing the visible children.
|
source
author, buildnr, className, company, copyright, creationDate, dateFormatString, description, eMail, FWK_ICON, FWK_ICON_ARRAY, FWK_ICON_BG, FWK_ICON_BG_ARRAY, FWK_ICON_BG_LARGE, FWK_ICON_BG_LARGE_ARRAY, FWK_ICON_LARGE, FWK_ICON_LARGE_ARRAY, icon, ICON, iconCount, iconKey, internetAddress, name, titleName
AUTHOR, BUILDNR, COMPANY, COPYRIGHT, DATE_FORMAT, DEFAULT_ICON, DESCRIPTION, INTERNET, LARGE_ICON, LARGE_KEY_EXT, LARGE_OPAQUE_ICON, LARGE_OPAQUE_KEY_EXT, OPAQUE_ICON, OPAQUE_KEY_EXT, RCS_DATE_FORMAT, SUPPORT_EMAIL, TITLE_NAME
Constructor and Description |
---|
OdsxFilteredTreeNode()
Creates a tree node that has no parent and no children, but which
allows children.
|
OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable)
Creates a tree node with no parent, no children, but which allows
children, and initializes it with the specified user object.
|
OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable,
OdsxFilterInterface odsFilter)
Creates a tree node with no parent, no children, but which allows
children, and initializes it with the specified user object.
|
OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable,
OdsxFilterInterface odsFilter,
OdsxSelectorInterface odsSelector)
Creates a tree node with no parent, no children, but which allows
children, and initializes it with the specified user object.
|
OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable,
OdsxFilterInterface odsFilter,
OdsxSelectorInterface odsSelector,
boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with
the specified user object, and that allows children only if
specified.
|
Modifier and Type | Method and Description |
---|---|
void |
add(OdsxFilteredTreeNode newChild)
Removes
newChild from its parent and makes it a child of
this node by adding it to the end of this node's child array. |
void |
addCommand(FwkCommandInterface command)
Add the command to the command array.
|
void |
addCommand(int index,
FwkCommandInterface command)
Insert a command at the specified position.
|
void |
addToGroup(int index,
java.lang.String groupIdent,
java.lang.String commandName)
Add a command to a group.
|
void |
addToGroup(java.lang.String groupIdent,
java.lang.String commandName)
Add a command to a group.
|
java.util.Enumeration |
breadthFirstEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at
this node in breadth-first order.
|
java.util.Enumeration |
children()
Creates and returns a forward-order enumeration of this node's
children.
|
java.lang.Object |
clone()
Overridden to make clone public.
|
boolean |
commandsAvailable()
This method returns a boolean that indicates whether
the command array is initialized.
|
int |
compareTo(java.lang.Object obj)
Compare object.
|
void |
delete(boolean flag)
Delete a node.
|
void |
deleteGroup(java.lang.String groupIdent)
Delete command group.
|
java.util.Enumeration |
depthFirstEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at
this node in depth-first order.
|
boolean |
equals(java.lang.Object o) |
void |
firePropertyChange(java.lang.String propName)
Fire a property change using the root node.
|
boolean |
getAllowsChildren()
Returns true if this node is allowed to have children.
|
java.lang.String |
getAuthor()
Get the author name.
|
java.lang.String |
getBuild()
Get the build number.
|
javax.swing.tree.TreeNode |
getChildAfter(javax.swing.tree.TreeNode aChild)
Returns the child in this node's child array that immediately
follows
aChild , which must be a child of this node. |
javax.swing.tree.TreeNode |
getChildAt(int index)
Returns the child at the specified index in this node's child array.
|
javax.swing.tree.TreeNode |
getChildBefore(javax.swing.tree.TreeNode aChild)
Returns the child in this node's child array that immediately
precedes
aChild , which must be a child of this node. |
int |
getChildCount()
Returns the number of children of this node.
|
int |
getChildIndexByPath(javax.swing.tree.TreePath path)
Get child index by path
|
java.awt.Color |
getColor()
Get the color of the item.
|
FwkCommandInterface |
getCommand(java.lang.String commandName)
Return the command that matches the given command name.
|
FwkCommandInterface[] |
getCommands()
Retrieve the command array of the component.
|
java.lang.String |
getCompany()
Get the company name.
|
java.lang.String |
getCompanyInternetAddress()
Get the internet address of the company.
|
java.lang.String |
getCopyright()
Get the copyright.
|
java.lang.String |
getCreationDate()
Get the creation date.
|
java.lang.String |
getCreationDate(java.lang.String formatString)
Get the creation date.
|
java.lang.String |
getDateFormatString()
Get the date format string.
|
int |
getDepth()
Returns the depth of the tree rooted at this node -- the longest
distance from this node to a leaf.
|
java.lang.String |
getDescription()
Get the description.
|
OdsxFilterInterface |
getFilter()
Returns this node's filter.
|
javax.swing.tree.TreeNode |
getFirstChild()
Returns this node's first child.
|
OdsxFilteredTreeNode |
getFirstLeaf()
Finds and returns the first leaf that is a descendant of this node --
either this node or its first child's first leaf.
|
FwkCommandInterface[] |
getGroup(java.lang.String groupIdent)
Retrieve the command group.
|
FwkIconInterface |
getIcon()
Get the icon image.
|
FwkIconInterface |
getIcon(int type)
Get the image icon of the application
|
java.lang.String |
getIconKey()
Get the property keyword of the icon.
|
java.lang.String |
getIconKey(int type)
Get the property keyword of the icon.
|
int |
getIndex(javax.swing.tree.TreeNode aChild)
Returns the index of the specified child in this node's child array.
|
javax.swing.tree.TreeNode |
getLastChild()
Returns this node's last child.
|
OdsxFilteredTreeNode |
getLastLeaf()
Finds and returns the last leaf that is a descendant of this node --
either this node or its last child's last leaf.
|
int |
getLeafCount()
Returns the total number of leaves that are descendants of this node.
|
int |
getLevel()
Returns the number of levels above this node -- the distance from
the root to this node.
|
java.lang.String |
getName()
Return the name of the ASAM-FWK object.
|
OdsxFilteredTreeNode |
getNextLeaf()
Returns the leaf after this node or null if this node is the
last leaf in the tree.
|
OdsxFilteredTreeNode |
getNextNode()
Returns the node that follows this node in a preorder traversal of this
node's tree.
|
OdsxFilteredTreeNode |
getNextSibling()
Returns the next sibling of this node in the parent's children array.
|
javax.swing.tree.TreeNode |
getParent()
Returns this node's parent or null if this node has no parent.
|
javax.swing.tree.TreeNode[] |
getPath()
Returns the path from the root, to get to this node.
|
protected javax.swing.tree.TreeNode[] |
getPathToRoot(javax.swing.tree.TreeNode aNode,
int depth)
Builds the parents of node up to and including the root node,
where the original node is the last element in the returned array.
|
OdsxPresentableElementInterface |
getPresentableElement()
Returns this node's presentable element.
|
java.lang.Object[] |
getPresentablePath()
Returns the presentable path, from the root, to get to this node.
|
java.lang.String |
getPresentationString()
Retrieves the representation string.
|
java.lang.String |
getPresentationString(java.util.Locale locale)
Retrieves the representation string.
|
OdsxFilteredTreeNode |
getPreviousLeaf()
Returns the leaf before this node or null if this node is the
first leaf in the tree.
|
OdsxFilteredTreeNode |
getPreviousNode()
Returns the node that precedes this node in a preorder traversal of
this node's tree.
|
OdsxFilteredTreeNode |
getPreviousSibling()
Returns the previous sibling of this node in the parent's children
array.
|
javax.swing.tree.TreeNode |
getRoot()
Returns the root of the tree that contains this node.
|
javax.swing.tree.TreeNode |
getSharedAncestor(OdsxFilteredTreeNode aNode)
Returns the nearest common ancestor to this node and
aNode . |
int |
getSiblingCount()
Returns the number of siblings of this node.
|
java.lang.String |
getSupportEMail()
Get the support e-mail.
|
java.lang.String |
getTitle()
Get the title.
|
java.lang.String |
getTitleName()
Get the title name.
|
java.lang.String |
getTranslatedName()
Returns the filtered name of the element.
|
java.lang.Object |
getUserObject()
Returns this node's userObject.
|
java.lang.Object[] |
getUserObjectPath()
Returns the user object path, from the root, to get to this node.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
boolean |
groupExists(java.lang.String groupIdent)
Check whether a group exists.
|
void |
insert(javax.swing.tree.MutableTreeNode newChild,
int childIndex)
Inserts
newChild to its present parent (if it has a
parent), sets the child's parent to this node, and then adds the child
to this node's child array at index childIndex . |
boolean |
isApplicationElement()
Return a boolean whether the node implements OdsxApplicationElementInterface.
|
boolean |
isColumn()
Return a boolean whether the node implements OdsxColumnInterface.
|
boolean |
isEnabled()
Check if the element is enabled
by this filter.
|
boolean |
isInstanceElement()
Return a boolean whether the node implements OdsxInstanceElementInterface.
|
boolean |
isLeaf()
Return whether the current node is a leaf.
|
boolean |
isLoaded()
Return whether the current node is already loaded.
|
boolean |
isNodeAncestor(javax.swing.tree.TreeNode anotherNode)
Returns true if
anotherNode is an ancestor of this node
-- if it is this node, this node's parent, or an ancestor of this
node's parent. |
boolean |
isNodeChild(javax.swing.tree.TreeNode aNode)
Returns true if
aNode is a child of this node. |
boolean |
isNodeDescendant(OdsxFilteredTreeNode anotherNode)
Returns true if
anotherNode is a descendant of this node
-- if it is this node, one of this node's children, or a descendant of
one of this node's children. |
boolean |
isNodeRelated(OdsxFilteredTreeNode aNode)
Returns true if and only if
aNode is in the same tree
as this node. |
boolean |
isNodeSibling(javax.swing.tree.TreeNode anotherNode)
Returns true if
anotherNode is a sibling of (has the
same parent as) this node. |
boolean |
isRoot()
Returns true if this node is the root of the tree.
|
boolean |
isSessionElement()
Return a boolean whether the node implements OdsxSessionElementInterface.
|
boolean |
isVisible()
Check if the element is visible
by this filter.
|
protected void |
loadChildren()
Messaged the first time getChildCount is messaged.
|
protected void |
loadVisibleChildren()
The private method to determine the list of visible children.
|
static void |
main(java.lang.String[] args)
The Main body to test the class.
|
java.util.Enumeration |
pathFromAncestorEnumeration(javax.swing.tree.TreeNode ancestor)
Creates and returns an enumeration that follows the path from
ancestor to this node. |
java.util.Enumeration |
postorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at
this node in postorder.
|
java.util.Enumeration |
preorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at
this node in preorder.
|
void |
propertyChange(java.beans.PropertyChangeEvent ev)
The propertyChange clallback.
|
void |
reloadChildren()
Reload the children.
|
void |
reloadChildren(boolean enforce)
Reload the children.
|
void |
remove(int childIndex)
Removes the child at the specified index from this node's children
and sets that node's parent to null.
|
void |
remove(javax.swing.tree.MutableTreeNode aChild)
Removes
aChild from this node's child array, giving it a
null parent. |
void |
removeAllChildren()
Removes all of this node's children, setting their parents to null.
|
void |
removeCommand(FwkCommandInterface command)
Remove a sub-command.
|
void |
removeFromGroup(java.lang.String groupIdent,
java.lang.String commandName)
Remove a command from a group.
|
void |
removeFromParent()
Removes the subtree rooted at this node from the tree, giving this
node a null parent.
|
void |
setAllowsChildren(boolean allows)
Determines whether or not this node is allowed to have children.
|
void |
setAuthor(java.lang.String author)
Set the author name.
|
void |
setBuild(java.lang.String buildnr)
Set the build number.
|
void |
setColor(java.awt.Color color)
Set the color of the item.
|
protected void |
setCommandProperties(FwkCommandInterface[] commands)
Set the command properties.
|
void |
setCommands(FwkCommandInterface[] commands)
Set the sub-commands of the command.
|
void |
setCompany(java.lang.String company)
Set the company name.
|
void |
setCompanyInternetAddress(java.lang.String address)
Set the internet address of the company.
|
void |
setCopyright(java.lang.String copyright)
Set the copyright.
|
void |
setCreationDate(java.lang.String dateString,
java.lang.String formatString)
Set the Date of the application.
|
void |
setDateFormatString(java.lang.String formatString)
Set the Date format string.
|
void |
setDescription(java.lang.String description)
Set the description of the application.
|
void |
setDescriptor(FwkDescriptionInterface descriptor)
Initialize the object with values of the given FwkDescription.
|
void |
setFilter(OdsxFilterInterface odsFilter)
Sets the ods filter for this node.
|
void |
setFilter(OdsxFilterInterface odsFilter,
boolean flag)
Sets the ods filter for this node.
|
void |
setIcon(FwkIconInterface icon)
Set the icon image.
|
void |
setIcon(FwkIconInterface icon,
int type)
Set the image icon of the application
|
void |
setIconKey(java.lang.String key)
Set the property keyword of the icon.
|
void |
setIconKey(java.lang.String key,
int type)
Set the property keyword of the icon.
|
void |
setName(java.lang.String name)
Set the name of the ASAM-FWK object.
|
void |
setParent(javax.swing.tree.MutableTreeNode newParent)
Sets this node's parent to
newParent but does not
change the parent's child array. |
void |
setPresentableElement(OdsxPresentableElementInterface presentable)
Sets the presentable element for this node to
presentable . |
void |
setSupportEMail(java.lang.String eMail)
Get the support e-mail.
|
void |
setTitleName(java.lang.String titlename)
Set the title name of the application.
|
void |
setTranslatedName(java.lang.String value)
Returns the filtered name of the element.
|
void |
setUserObject(java.lang.Object userObject)
Sets the user object for this node to
userObject . |
void |
setVisible(boolean flag)
Set the visibility of the node.
|
java.lang.String |
toString()
Returns the result of sending
toString() to this node's
user object, or null if this node has no user object. |
void |
updateNode()
Update node
|
addVetoableChangeListener, addVetoableChangeListener, clearCommands, destroyController, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getCommands, getFwkMimeTypes, getPersistentObjectNames, getVetoableChangeArray, getVetoableChangeListenerArray, getVetoableChangeListenerArray, removeVetoableChangeListener, removeVetoableChangeListener, setDescriptor, setSource
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, suspendPropertyChangeEvents
getClassName, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setClassName, setCreationDate
getNiceVersion, release
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearCommands
release
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEvents
getClassName, setClassName, setCreationDate
public static final java.lang.String version
public static final java.util.Enumeration EMPTY_ENUMERATION
protected OdsxSelectorTreeNodeInterface parent
protected java.util.Vector children
protected OdsxSelectorTreeNodeInterface[] visibleChildren
protected transient OdsxPresentableElementInterface presentable
protected OdsxSelectorInterface odsSelector
protected java.lang.Object userObject
protected OdsxFilterInterface odsFilter
protected boolean allowsChildren
protected boolean isLeaf
protected boolean isLoaded
public OdsxFilteredTreeNode()
public OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable)
presentable
- the presentable element.public OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable, OdsxFilterInterface odsFilter)
presentable
- the presentable element.odsFilter
- the filterpublic OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable, OdsxFilterInterface odsFilter, OdsxSelectorInterface odsSelector)
presentable
- the presentable element.odsFilter
- the filterodsSelector
- the ods selectorpublic OdsxFilteredTreeNode(OdsxPresentableElementInterface presentable, OdsxFilterInterface odsFilter, OdsxSelectorInterface odsSelector, boolean allowsChildren)
presentable
- the presentable elementodsFilter
- the filterodsSelector
- the ods selectorallowsChildren
- if true, the node is allowed to have child
nodes -- otherwise, it is always a leaf nodepublic java.lang.String getVersion()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class FwkPersistence
public void firePropertyChange(java.lang.String propName)
the
- property name.public void setColor(java.awt.Color color)
setColor
in interface OdsxSelectorTreeNodeInterface
color
- The new color of the element.public java.awt.Color getColor()
getColor
in interface OdsxSelectorTreeNodeInterface
public boolean isEnabled()
isEnabled
in interface OdsxSelectorTreeNodeInterface
public boolean isVisible()
isVisible
in interface OdsxSelectorTreeNodeInterface
public void setVisible(boolean flag)
setVisible
in interface OdsxSelectorTreeNodeInterface
flag
- true if the node should be visible.public java.lang.String getTranslatedName()
getTranslatedName
in interface OdsxSelectorTreeNodeInterface
public void setTranslatedName(java.lang.String value)
setTranslatedName
in interface OdsxSelectorTreeNodeInterface
value
- The new translated name of the element.public boolean isInstanceElement()
isInstanceElement
in interface OdsxSelectorTreeNodeInterface
public boolean isColumn()
isColumn
in interface OdsxSelectorTreeNodeInterface
public boolean isApplicationElement()
isApplicationElement
in interface OdsxSelectorTreeNodeInterface
public boolean isSessionElement()
isSessionElement
in interface OdsxSelectorTreeNodeInterface
public void delete(boolean flag)
delete
in interface OdsxSelectorTreeNodeInterface
flag
- true if the element should be deleted with references.public boolean isLeaf()
isLeaf
in interface OdsxSelectorTreeNodeInterface
isLeaf
in interface javax.swing.tree.TreeNode
public boolean isLoaded()
protected void loadChildren()
public void insert(javax.swing.tree.MutableTreeNode newChild, int childIndex)
newChild
to its present parent (if it has a
parent), sets the child's parent to this node, and then adds the child
to this node's child array at index childIndex
.
newChild
must not be null and must not be an ancestor of
this node.insert
in interface javax.swing.tree.MutableTreeNode
newChild
- the OdsxFilteredTreeNode to insert under this nodechildIndex
- the index in this node's child array
where this node is to be insertedjava.lang.ArrayIndexOutOfBoundsException
- if
childIndex
is out of boundsjava.lang.IllegalArgumentException
- if
newChild
is null or is an
ancestor of this nodejava.lang.IllegalStateException
- if this node does not allow
childrenisNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
public void remove(int childIndex)
OdsxFilteredTreeNode
.remove
in interface javax.swing.tree.MutableTreeNode
childIndex
- the index in this node's child array
of the child to removejava.lang.ArrayIndexOutOfBoundsException
- if
childIndex
is out of boundspublic void setParent(javax.swing.tree.MutableTreeNode newParent)
newParent
but does not
change the parent's child array. This method is called from
insert()
and remove()
to
reassign a child's parent, it should not be messaged from anywhere
else.setParent
in interface javax.swing.tree.MutableTreeNode
newParent
- this node's new parentpublic javax.swing.tree.TreeNode getParent()
getParent
in interface javax.swing.tree.TreeNode
protected void loadVisibleChildren()
public void updateNode()
updateNode
in interface OdsxSelectorTreeNodeInterface
public void reloadChildren()
reloadChildren
in interface OdsxSelectorTreeNodeInterface
public void reloadChildren(boolean enforce)
reloadChildren
in interface OdsxSelectorTreeNodeInterface
force
- if true force the loading.public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
index
- an index into this node's child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index
is out of boundspublic int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
public int getIndex(javax.swing.tree.TreeNode aChild)
-1
. This method performs a linear search and is O(n)
where n is the number of children.getIndex
in interface javax.swing.tree.TreeNode
aChild
- the TreeNode to search for among this node's children-1
if the specified node is a not
a child of this nodejava.lang.IllegalArgumentException
- if aChild
is nullpublic java.util.Enumeration children()
children
in interface javax.swing.tree.TreeNode
public void setAllowsChildren(boolean allows)
allows
is false, all of this node's children are
removed.
Note: By default, a node allows children.
allows
- true if this node is allowed to have childrenpublic boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
public void setPresentableElement(OdsxPresentableElementInterface presentable)
presentable
.setPresentableElement
in interface OdsxSelectorTreeNodeInterface
presentable
- the presentable element.#getPresentable
,
toString()
public OdsxPresentableElementInterface getPresentableElement()
getPresentableElement
in interface OdsxSelectorTreeNodeInterface
#setPresentable
,
toString()
public void setFilter(OdsxFilterInterface odsFilter)
setFilter
in interface OdsxSelectorTreeNodeInterface
filter
- the ods filter.getFilter()
public void setFilter(OdsxFilterInterface odsFilter, boolean flag)
setFilter
in interface OdsxSelectorTreeNodeInterface
filter
- the ods filter.flag
- if true the filter will be set recurtsivly.getFilter()
public OdsxFilterInterface getFilter()
getFilter
in interface OdsxSelectorTreeNodeInterface
setFilter(com.highqsoft.interfaces.odsx.OdsxFilterInterface)
public void setUserObject(java.lang.Object userObject)
userObject
.setUserObject
in interface javax.swing.tree.MutableTreeNode
userObject
- the user value.getUserObject()
public java.lang.Object getUserObject()
setUserObject(java.lang.Object)
public void removeFromParent()
removeFromParent
in interface javax.swing.tree.MutableTreeNode
public void remove(javax.swing.tree.MutableTreeNode aChild)
aChild
from this node's child array, giving it a
null parent.remove
in interface javax.swing.tree.MutableTreeNode
aChild
- a child of this node to removejava.lang.IllegalArgumentException
- if aChild
is null or is not a child of this nodepublic void removeAllChildren()
public void add(OdsxFilteredTreeNode newChild)
newChild
from its parent and makes it a child of
this node by adding it to the end of this node's child array.newChild
- node to add as a child of this nodejava.lang.IllegalArgumentException
- if newChild
is nulljava.lang.IllegalStateException
- if this node does not allow
childreninsert(javax.swing.tree.MutableTreeNode, int)
public boolean isNodeAncestor(javax.swing.tree.TreeNode anotherNode)
anotherNode
is an ancestor of this node
-- if it is this node, this node's parent, or an ancestor of this
node's parent. (Note that a node is considered an ancestor of itself.)
If anotherNode
is null, this method returns false. This
operation is at worst O(h) where h is the distance from the root to
this node.anotherNode
- node to test as an ancestor of this nodeanotherNode
isNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
,
getSharedAncestor(com.highqsoft.odsx.OdsxFilteredTreeNode)
public boolean isNodeDescendant(OdsxFilteredTreeNode anotherNode)
anotherNode
is a descendant of this node
-- if it is this node, one of this node's children, or a descendant of
one of this node's children. Note that a node is considered a
descendant of itself. If anotherNode
is null, returns
false. This operation is at worst O(h) where h is the distance from the
root to anotherNode
.anotherNode
- node to test as descendant of this nodeanotherNode
isNodeAncestor(javax.swing.tree.TreeNode)
,
getSharedAncestor(com.highqsoft.odsx.OdsxFilteredTreeNode)
public javax.swing.tree.TreeNode getSharedAncestor(OdsxFilteredTreeNode aNode)
aNode
.
Returns null, if no such ancestor exists -- if this node and
aNode
are in different trees or if aNode
is
null. A node is considered an ancestor of itself.aNode
- node to find common ancestor withaNode
,
or null if noneisNodeAncestor(javax.swing.tree.TreeNode)
,
isNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
public boolean isNodeRelated(OdsxFilteredTreeNode aNode)
aNode
is in the same tree
as this node. Returns false if aNode
is null.aNode
is in the same tree as this node;
false if aNode
is nullgetSharedAncestor(com.highqsoft.odsx.OdsxFilteredTreeNode)
,
getRoot()
public int getDepth()
getLevel()
because it must effectively traverse the entire
tree rooted at this node.getLevel()
public int getLevel()
getDepth()
public javax.swing.tree.TreeNode[] getPath()
protected javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.TreeNode aNode, int depth)
aNode
- the TreeNode to get the path fordepth
- an int giving the number of steps already taken towards
the root (on recursive calls), used to size the returned arraypublic java.lang.Object[] getPresentablePath()
public int getChildIndexByPath(javax.swing.tree.TreePath path)
getChildIndexByPath
in interface OdsxSelectorTreeNodeInterface
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.Object[] getUserObjectPath()
public javax.swing.tree.TreeNode getRoot()
isNodeAncestor(javax.swing.tree.TreeNode)
public boolean isRoot()
public OdsxFilteredTreeNode getNextNode()
preorderEnumeration()
public OdsxFilteredTreeNode getPreviousNode()
preorderEnumeration()
public java.util.Enumeration preorderEnumeration()
nextElement()
method is this node.Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.
postorderEnumeration()
public java.util.Enumeration postorderEnumeration()
nextElement()
method is the leftmost leaf. This is the
same as a depth-first traversal.Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.
depthFirstEnumeration()
,
preorderEnumeration()
public java.util.Enumeration breadthFirstEnumeration()
nextElement()
method is this node.Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.
depthFirstEnumeration()
public java.util.Enumeration depthFirstEnumeration()
nextElement()
method is the leftmost leaf.
This is the same as a postorder traversal.Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.
breadthFirstEnumeration()
,
postorderEnumeration()
public java.util.Enumeration pathFromAncestorEnumeration(javax.swing.tree.TreeNode ancestor)
ancestor
to this node. The enumeration's
nextElement()
method first returns ancestor
,
then the child of ancestor
that is an ancestor of this
node, and so on, and finally returns this node. Creation of the
enumeration is O(m) where m is the number of nodes between this node
and ancestor
, inclusive. Each nextElement()
message is O(1).Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.
java.lang.IllegalArgumentException
- if ancestor
is
not an ancestor of this nodeisNodeAncestor(javax.swing.tree.TreeNode)
,
isNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
public boolean isNodeChild(javax.swing.tree.TreeNode aNode)
aNode
is a child of this node. If
aNode
is null, this method returns false.aNode
is a child of this node; false if
aNode
is nullpublic javax.swing.tree.TreeNode getFirstChild()
java.util.NoSuchElementException
- if this node has no childrenpublic javax.swing.tree.TreeNode getLastChild()
java.util.NoSuchElementException
- if this node has no childrenpublic javax.swing.tree.TreeNode getChildAfter(javax.swing.tree.TreeNode aChild)
aChild
, which must be a child of this node. If
aChild
is the last child, returns null. This method
performs a linear search of this node's children for
aChild
and is O(n) where n is the number of children; to
traverse the entire array of children, use an enumeration instead.aChild
java.lang.IllegalArgumentException
- if aChild
is
null or is not a child of this nodechildren
public javax.swing.tree.TreeNode getChildBefore(javax.swing.tree.TreeNode aChild)
aChild
, which must be a child of this node. If
aChild
is the first child, returns null. This method
performs a linear search of this node's children for aChild
and is O(n) where n is the number of children.aChild
java.lang.IllegalArgumentException
- if aChild
is null
or is not a child of this nodepublic boolean isNodeSibling(javax.swing.tree.TreeNode anotherNode)
anotherNode
is a sibling of (has the
same parent as) this node. A node is its own sibling. If
anotherNode
is null, returns false.anotherNode
- node to test as sibling of this nodeanotherNode
is a sibling of this nodepublic int getSiblingCount()
1
).public OdsxFilteredTreeNode getNextSibling()
children
public OdsxFilteredTreeNode getPreviousSibling()
public OdsxFilteredTreeNode getFirstLeaf()
isLeaf
,
isNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
public OdsxFilteredTreeNode getLastLeaf()
isLeaf
,
isNodeDescendant(com.highqsoft.odsx.OdsxFilteredTreeNode)
public OdsxFilteredTreeNode getNextLeaf()
In this implementation of the MutableNode
interface,
this operation is very inefficient. In order to determine the
next node, this method first performs a linear search in the
parent's child-list in order to find the current node.
That implementation makes the operation suitable for short
traversals from a known position. But to traverse all of the
leaves in the tree, you should use depthFirstEnumeration
to enumerate the nodes in the tree and use isLeaf
on each node to determine which are leaves.
depthFirstEnumeration()
,
isLeaf
public OdsxFilteredTreeNode getPreviousLeaf()
In this implementation of the MutableNode
interface,
this operation is very inefficient. In order to determine the
previous node, this method first performs a linear search in the
parent's child-list in order to find the current node.
That implementation makes the operation suitable for short
traversals from a known position. But to traverse all of the
leaves in the tree, you should use depthFirstEnumeration
to enumerate the nodes in the tree and use isLeaf
on each node to determine which are leaves.
depthFirstEnumeration()
,
isLeaf
public int getLeafCount()
1
. This method is O(n)
where n is the number of descendants of this node.isNodeAncestor(javax.swing.tree.TreeNode)
public java.lang.String toString()
toString()
to this node's
user object, or null if this node has no user object.toString
in class FwkDescription
#getPresentable
public java.lang.Object clone()
clone
in class java.lang.Object
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange
in interface java.beans.PropertyChangeListener
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
compareTo
in class FwkPersistence
obj
- The object that should be compared with this.public java.lang.String getAuthor()
getAuthor
in interface FwkDescriptionInterface
getAuthor
in class FwkPersistence
setAuthor(String)
public java.lang.String getBuild()
getBuild
in interface FwkDescriptionInterface
getBuild
in class FwkPersistence
#setBuild(int)
public java.lang.String getCompany()
getCompany
in interface FwkDescriptionInterface
getCompany
in class FwkPersistence
setCompany(String)
public java.lang.String getCompanyInternetAddress()
getCompanyInternetAddress
in interface FwkDescriptionInterface
getCompanyInternetAddress
in class FwkPersistence
public java.lang.String getCopyright()
getCopyright
in interface FwkDescriptionInterface
getCopyright
in class FwkPersistence
setCopyright(String)
public java.lang.String getCreationDate()
getCreationDate
in interface FwkDescriptionInterface
getCreationDate
in class FwkPersistence
#setCreationDate(Date)
public java.lang.String getCreationDate(java.lang.String formatString)
getCreationDate
in interface FwkDescriptionInterface
getCreationDate
in class FwkPersistence
formatString
- The date format string#java.text.SimpleDateFormat
,
#setCreationDate(Date)
public java.lang.String getDateFormatString()
getDateFormatString
in interface FwkDescriptionInterface
getDateFormatString
in class FwkPersistence
public java.lang.String getDescription()
getDescription
in interface FwkDescriptionInterface
getDescription
in class FwkPersistence
setDescription(String)
public FwkIconInterface getIcon()
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkPersistence
setIcon(FwkIconInterface)
public FwkIconInterface getIcon(int type)
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkPersistence
type
- The type of the icon, use the predefined values (see above).#setIcon(Icon)
public java.lang.String getIconKey()
getIconKey
in interface FwkDescriptionInterface
getIconKey
in class FwkPersistence
public java.lang.String getIconKey(int type)
getIconKey
in interface FwkDescriptionInterface
getIconKey
in class FwkPersistence
type
- The type of the icon, use the predefined values (see above).public java.lang.String getName()
getName
in interface FwkDescriptionInterface
getName
in class FwkPersistence
FwkPersistence.setName(String)
public java.lang.String getPresentationString(java.util.Locale locale)
getPresentationString
in interface FwkDescriptionInterface
getPresentationString
in interface FwkPresentationInterface
getPresentationString
in class FwkDescription
locale
- The Locale object or null.public java.lang.String getPresentationString()
getPresentationString
in interface FwkDescriptionInterface
getPresentationString
in interface FwkPresentationInterface
getPresentationString
in class FwkDescription
public java.lang.String getSupportEMail()
getSupportEMail
in interface FwkDescriptionInterface
getSupportEMail
in class FwkPersistence
public java.lang.String getTitle()
getTitle
in interface FwkDescriptionInterface
getTitle
in class FwkPersistence
public java.lang.String getTitleName()
getTitleName
in interface FwkDescriptionInterface
getTitleName
in class FwkPersistence
setTitleName(String)
public void setAuthor(java.lang.String author)
There ist currently no functionality.
setAuthor
in interface FwkDescriptionInterface
setAuthor
in class FwkPersistence
author
- The name of the author.getAuthor()
public void setBuild(java.lang.String buildnr)
There ist currently no functionality.
setBuild
in interface FwkDescriptionInterface
setBuild
in class FwkPersistence
The
- string of the build number.getBuild()
public void setCompany(java.lang.String company)
There ist currently no functionality.
setCompany
in interface FwkDescriptionInterface
setCompany
in class FwkPersistence
company
- The name of the company.getCompany()
public void setCompanyInternetAddress(java.lang.String address)
There ist currently no functionality.
setCompanyInternetAddress
in interface FwkDescriptionInterface
setCompanyInternetAddress
in class FwkPersistence
public void setCopyright(java.lang.String copyright)
There ist currently no functionality.
setCopyright
in interface FwkDescriptionInterface
setCopyright
in class FwkPersistence
The
- copyright string.getCopyright()
public void setCreationDate(java.lang.String dateString, java.lang.String formatString)
There ist currently no functionality.
setCreationDate
in interface FwkDescriptionInterface
setCreationDate
in class FwkPersistence
dateString
- The Date of the application.formatString
- The format string.#java.text.SimpleDateFormat
,
getCreationDate()
public void setDateFormatString(java.lang.String formatString)
setDateFormatString
in interface FwkDescriptionInterface
setDateFormatString
in class FwkPersistence
formatString
- The format string.#java.text.SimpleDateFormat
,
getCreationDate()
public void setDescription(java.lang.String description)
There ist currently no functionality.
setDescription
in interface FwkDescriptionInterface
setDescription
in class FwkPersistence
description
- The description of the application.getDescription()
public void setDescriptor(FwkDescriptionInterface descriptor) throws FwkException
There ist currently no functionality.
setDescriptor
in interface FwkDescriptionInterface
setDescriptor
in class FwkPersistence
desciptor
- The FwkDescription from that the value should be copied.FwkException
public void setIcon(FwkIconInterface icon)
setIcon
in interface FwkDescriptionInterface
setIcon
in class FwkPersistence
The
- icon of the application.getIcon()
public void setIcon(FwkIconInterface icon, int type)
setIcon
in interface FwkDescriptionInterface
setIcon
in class FwkPersistence
icon
- The icon to be set.type
- The type of the icon, use predefined values defined above.
If this value is out of range, no icon will be set.getIcon()
public void setIconKey(java.lang.String key)
setIconKey
in interface FwkDescriptionInterface
setIconKey
in class FwkPersistence
key
- The keyword for the icon.public void setIconKey(java.lang.String key, int type)
setIconKey
in interface FwkDescriptionInterface
setIconKey
in class FwkPersistence
key
- The keyword for the icon.type
- The type of the icon, use predefined values defined above.public void setName(java.lang.String name)
setName
in interface FwkDescriptionInterface
setName
in class FwkPersistence
name
- The name of the object.getName()
public void setSupportEMail(java.lang.String eMail)
There ist currently no functionality.
setSupportEMail
in interface FwkDescriptionInterface
setSupportEMail
in class FwkPersistence
eMail
- A string containing the support e-mail.public void setTitleName(java.lang.String titlename)
There ist currently no functionality.
setTitleName
in interface FwkDescriptionInterface
setTitleName
in class FwkPersistence
titlename
- The title name of the application.getTitleName()
public void addCommand(FwkCommandInterface command)
addCommand
in interface FwkInstructionInterface
addCommand
in class FwkPersistence
command
- The command to be added.public void addCommand(int index, FwkCommandInterface command)
addCommand
in interface FwkInstructionInterface
addCommand
in class FwkPersistence
index
- The position where the command has to be inserted.command
- The command to be added.public FwkCommandInterface getCommand(java.lang.String commandName)
getCommand
in interface FwkInstructionInterface
getCommand
in class FwkPersistence
commandName
- The name of the requested command.public FwkCommandInterface[] getCommands()
getCommands
in interface FwkInstructionInterface
getCommands
in class FwkPersistence
protected void setCommandProperties(FwkCommandInterface[] commands)
the
- command array.public void removeCommand(FwkCommandInterface command)
removeCommand
in interface FwkInstructionInterface
removeCommand
in class FwkPersistence
command
- The sub-command to be removed.public void setCommands(FwkCommandInterface[] commands)
setCommands
in interface FwkInstructionInterface
setCommands
in class FwkPersistence
commands
- The array containing the sub-commands.FwkInstructionInterface.addCommand(FwkCommandInterface command)
public boolean commandsAvailable()
commandsAvailable
in interface FwkInstructionInterface
commandsAvailable
in class FwkPersistence
public void addToGroup(int index, java.lang.String groupIdent, java.lang.String commandName)
addToGroup
in interface FwkInstructionInterface
addToGroup
in class FwkPersistence
index
- Index where the command should be placed.groupIdent
- The string identified of the group.commandName
- The name of the command.public void addToGroup(java.lang.String groupIdent, java.lang.String commandName)
addToGroup
in interface FwkInstructionInterface
addToGroup
in class FwkPersistence
groupIdent
- The string identified of the group.commandName
- The name of the command.public void removeFromGroup(java.lang.String groupIdent, java.lang.String commandName)
removeFromGroup
in interface FwkInstructionInterface
removeFromGroup
in class FwkPersistence
groupIdent
- The string identified of the group.commandName
- The name of the command.public void deleteGroup(java.lang.String groupIdent)
deleteGroup
in interface FwkInstructionInterface
deleteGroup
in class FwkPersistence
groupIdent
- The string identified of the group.public FwkCommandInterface[] getGroup(java.lang.String groupIdent)
getGroup
in interface FwkInstructionInterface
getGroup
in class FwkPersistence
groupIdent
- The string identified of the group.public boolean groupExists(java.lang.String groupIdent)
groupExists
in interface FwkInstructionInterface
groupExists
in class FwkPersistence
public static void main(java.lang.String[] args)