|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.tree.DefaultMutableTreeNode | +--javatools.swing.tree.IndexedTypedTreeNode
It is a node that is both typed (with a "type") and indexed (with an index).
Field Summary | |
protected boolean |
beingCut
true : the node is being cut;
false : otherwise. |
protected boolean |
deleteWhenCut
true : this node deletes itself (removes itself from its parent)
when cut;
false : the opposite. |
protected boolean |
dupWhenClipped
true : the node duplicates itself when clipped (cut or copied);
false : the node returns itself. |
protected boolean |
expanded
true : the node is expanded;
false : the node is not expanded. |
protected java.lang.Object[] |
ID
The ID of this node. |
protected javax.swing.JTree |
tree
The tree in which the node is contained. |
protected java.lang.String |
type
The type of this node. |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
IndexedTypedTreeNode()
Creates a new instance of IndexedTypedTreeNode |
|
IndexedTypedTreeNode(javax.swing.JTree pTree,
java.lang.Object userObject)
Creates a new IndexedTypedTreeNode. |
|
IndexedTypedTreeNode(javax.swing.JTree pTree,
java.lang.Object userObject,
boolean allowsChildren)
Creates a new IndexedTypedTreeNode. |
|
IndexedTypedTreeNode(java.lang.Object userObject)
Creates a new instance of IndexedTypedTreeNode |
|
IndexedTypedTreeNode(java.lang.Object userObject,
boolean allowsChildren)
Creates a new IndexedTypedTreeNode. |
Method Summary | |
void |
add(IndexedTypedTreeNode newChild)
Adds a child to the node. |
void |
attach(Clippable newSon)
Attaches an object to this one. |
boolean |
canBeAttached(Clippable newSon)
Checks whether an object can be attached to this one. |
boolean |
canBeCopied()
Checks whether this object can be copied or not. |
boolean |
canBeCut()
Checks whether this object can be cut or not. |
protected void |
conditionalSetPlace(javax.swing.tree.TreeNode node,
java.lang.Object place)
Sets a node's tree if it is really a JTree. |
Clippable |
copy()
Copies this object into the clipboard. |
Clippable |
cut()
Cuts this object into the clipboard. |
Clippable |
duplicate()
Duplicates (clones) this object. |
void |
expand()
Expands the node. |
boolean |
getDeleteWhenCut()
Checks whether the node will be deleted when cut. |
boolean |
getDuplicateWhenClipped()
Checks whether the node will be duplicated when clipped. |
java.lang.Object[] |
getID()
Returns the ID. |
java.lang.Object |
getPlace()
Returns the tree that contains the node. |
java.lang.String |
getType()
Returns the type of the node. |
java.lang.Object |
getValue()
Returns the value of this object. |
void |
insert(IndexedTypedTreeNode newChild,
int childIndex)
Inserts a child to the node. |
boolean |
isExpanded()
Returns the expanded flag. |
void |
paste(Clippable newFather)
Pastes this object into another. |
void |
reload()
Reloads the node. |
void |
remove(IndexedTypedTreeNode aChild)
Removes a specified child. |
void |
remove(int childIndex)
Removes a child. |
void |
removeAllChildren()
Removes all children from this node. |
void |
removeFromParent()
Removes this node from his parent node. |
void |
setDeleteWhenCut(boolean value)
Sets the property for "deleting when cut". |
void |
setDuplicateWhenClipped(boolean value)
Sets the "duplicate when clipped" property. |
void |
setExpanded(boolean value)
Sets the expanded flag. |
void |
setID(java.lang.Object[] pID)
Sets the ID for the node. |
void |
setPlace(java.lang.Object place)
Sets the tree that contains the node (and all of his subnodes). |
protected void |
setPlaceForChildren(java.lang.Object place)
Sets the tree for all children of this node. |
void |
setType(java.lang.String pType)
Sets the type of node. |
void |
unclip()
Resets the status of this object. |
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, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, setAllowsChildren, setParent, setUserObject, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean expanded
true
: the node is expanded;
false
: the node is not expanded.
protected boolean deleteWhenCut
true
: this node deletes itself (removes itself from its parent)
when cut;
false
: the opposite.
protected boolean dupWhenClipped
true
: the node duplicates itself when clipped (cut or copied);
false
: the node returns itself.
protected boolean beingCut
true
: the node is being cut;
false
: otherwise.
protected java.lang.Object[] ID
protected java.lang.String type
protected javax.swing.JTree tree
Constructor Detail |
public IndexedTypedTreeNode()
public IndexedTypedTreeNode(java.lang.Object userObject)
userObject
- The string to be displayed in the tree.public IndexedTypedTreeNode(java.lang.Object userObject, boolean allowsChildren)
userObject
- The object to use.allowsChildren
- true
: allows children;
false
: does not allow children.public IndexedTypedTreeNode(javax.swing.JTree pTree, java.lang.Object userObject)
pTree
- The tree that contains the node.userObject
- The string to be displayed in the tree.public IndexedTypedTreeNode(javax.swing.JTree pTree, java.lang.Object userObject, boolean allowsChildren)
pTree
- The tree that contains the node.userObject
- The string to be displayed in the tree.allowsChildren
- true
: allows children;
false
: does not allow children.Method Detail |
public void setExpanded(boolean value)
value
- The value.public boolean isExpanded()
public void setID(java.lang.Object[] pID)
pID
- An array of object representing the ID.public java.lang.Object[] getID()
public void setType(java.lang.String pType)
pType
- The type.public java.lang.String getType()
getType
in interface Clippable
public void attach(Clippable newSon)
attach
in interface Clippable
newSon
- The object to be attached.public Clippable copy()
copy
in interface Clippable
public Clippable cut()
cut
in interface Clippable
public java.lang.Object getValue()
getValue
in interface Clippable
public void paste(Clippable newFather)
paste
in interface Clippable
newFather
- The object to paste this object into.public boolean canBeAttached(Clippable newSon)
canBeAttached
in interface Clippable
newSon
- The object that is going to be attached to this one.
true
: the object can be attached;
false
: otherwise.public Clippable duplicate()
duplicate
in interface Clippable
public void unclip()
unclip
in interface Clippable
public boolean canBeCut()
canBeCut
in interface Clippable
true
: the object can be cut;
false
: otherwise.public boolean canBeCopied()
canBeCopied
in interface Clippable
true
: the object can be copied;
false
: otherwise.public void setDeleteWhenCut(boolean value)
value
- true
: this node deletes itself (removes itself from its parent)
when cut;
false
: the opposite.public boolean getDeleteWhenCut()
true
: this node deletes itself (removes itself from its parent)
when cut;
false
: the opposite.public void setDuplicateWhenClipped(boolean value)
value
- true
: the node duplicates itself when clipped (cut or copied);
false
: the node returns itself.public boolean getDuplicateWhenClipped()
true
: the node duplicates itself when clipped (cut or copied);
false
: the node returns itself.public java.lang.Object getPlace()
getPlace
in interface Clippable
public void setPlace(java.lang.Object place)
setPlace
in interface Clippable
place
- The tree that contains the node.public void add(IndexedTypedTreeNode newChild)
newChild
- The node to add.public void insert(IndexedTypedTreeNode newChild, int childIndex)
newChild
- The child to be added.childIndex
- The position in the child list.public void remove(int childIndex)
remove
in interface javax.swing.tree.MutableTreeNode
remove
in class javax.swing.tree.DefaultMutableTreeNode
childIndex
- The index of the child to remove.public void remove(IndexedTypedTreeNode aChild)
aChild
- The child to remove.public void removeAllChildren()
removeAllChildren
in class javax.swing.tree.DefaultMutableTreeNode
public void removeFromParent()
removeFromParent
in interface javax.swing.tree.MutableTreeNode
removeFromParent
in class javax.swing.tree.DefaultMutableTreeNode
public void reload()
public void expand()
protected void conditionalSetPlace(javax.swing.tree.TreeNode node, java.lang.Object place)
node
- The node to modify.place
- The new tree.protected void setPlaceForChildren(java.lang.Object place)
place
- The tree to be set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |