|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode net.sf.jtreemap.swing.TreeMapNode
public class TreeMapNode
Node of a JTreeMap.
If the node is a branch, only the label is set.
If the node is a leaf, we need a label, a weight and a value.
You can also use a TreeMapNode in a JTree.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
TreeMapNode(java.lang.String label)
Constructor for a branch. |
|
TreeMapNode(java.lang.String label,
double weight,
Value value)
Constructor for a leaf. |
Method Summary | |
---|---|
void |
add(TreeMapNode newChild)
add a new child to the node. |
TreeMapNode |
getActiveLeaf(int xParam,
int yParam)
get the active leaf. |
static int |
getBorder()
Get the max border between two nodes of the same level. |
TreeMapNode |
getChild(int xParam,
int yParam)
get the first child which fits the position. |
java.util.Vector<TreeMapNode> |
getChildren()
get a Vector with the children. |
double |
getDoubleValue()
get the double Value. |
int |
getHeight()
get the height. |
java.lang.String |
getLabel()
get the label. |
java.lang.String |
getLabelValue()
get the label of the Value. |
Value |
getValue()
get the Value. |
double |
getWeight()
get the weight. |
int |
getWidth()
get the width. |
int |
getX()
get the x-coordinate. |
int |
getY()
get the y-coordinate. |
static void |
setBorder(int border)
Set the max border between two nodes of the same level. |
void |
setDimension(int xParam,
int yParam,
int widthParam,
int heightParam)
set the position and the size. |
void |
setHeight(int height)
set the height. |
void |
setLabel(java.lang.String label)
set the label. |
void |
setPosition(int xParam,
int yParam)
set the position. |
void |
setSize(int widthParam,
int heightParam)
set size. |
void |
setValue(Value value)
set the Value. |
void |
setWeight(double weight)
set the weight of the node and update the parents. |
void |
setWidth(int width)
set the width. |
void |
setX(int x)
set the x-coordinate. |
void |
setY(int y)
set the y-coordinate. |
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, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TreeMapNode(java.lang.String label)
label
- label of the branch.public TreeMapNode(java.lang.String label, double weight, Value value)
label
- label of the leaf.weight
- weight of the leaf (if negative, we take the absolute value).value
- Value associée à la feuilleMethod Detail |
---|
public static int getBorder()
public static void setBorder(int border)
border
- The border to set.public void add(TreeMapNode newChild)
newChild
- new childpublic TreeMapNode getActiveLeaf(int xParam, int yParam)
xParam
- x-coordinateyParam
- y-coordinate
public TreeMapNode getChild(int xParam, int yParam)
xParam
- x-coordinateyParam
- y-coordinate
public java.util.Vector<TreeMapNode> getChildren()
public int getHeight()
public java.lang.String getLabel()
public java.lang.String getLabelValue()
public Value getValue()
public double getDoubleValue()
public double getWeight()
public int getWidth()
public int getX()
public int getY()
public void setDimension(int xParam, int yParam, int widthParam, int heightParam)
xParam
- x-coordinateyParam
- y-coordinatewidthParam
- the new widthheightParam
- the new heightpublic void setHeight(int height)
height
- la nouvelle valeur de heightpublic void setLabel(java.lang.String label)
label
- the new labelpublic void setPosition(int xParam, int yParam)
xParam
- x-coordinateyParam
- y-coordinatepublic void setSize(int widthParam, int heightParam)
widthParam
- the new widthheightParam
- the new heightpublic void setValue(Value value)
value
- the new Valuepublic void setWeight(double weight)
weight
- the new weightpublic void setWidth(int width)
width
- la nouvelle valeur de widthpublic void setX(int x)
x
- the new x-coordinatepublic void setY(int y)
y
- the new y-coordinate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |