|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jtreemap.ktreemap.TreeMapNode
public class TreeMapNode
Node of a KTreeMap.
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.
Constructor Summary | |
---|---|
TreeMapNode(java.lang.Object value)
Constructor for a branch |
|
TreeMapNode(java.lang.Object value,
double weight)
Constructor for a leaf. |
Method Summary | |
---|---|
void |
add(TreeMapNode newChild)
add a new child to the node. |
TreeMapNode |
getActiveLeaf(int x,
int y)
get the active leaf. |
TreeMapNode |
getActiveLeaf(org.eclipse.swt.graphics.Point position)
get the active leaf. |
static int |
getBorder()
Get the max border between two nodes of the same level. |
org.eclipse.swt.graphics.Rectangle |
getBounds()
|
TreeMapNode |
getChild(int x,
int y)
get the first child which fits the position. |
TreeMapNode |
getChild(org.eclipse.swt.graphics.Point position)
get the first child which fits the position. |
java.util.List<TreeMapNode> |
getChildren()
get a List with the children. |
int |
getHeight()
get the height. |
TreeMapNode |
getParent()
|
java.lang.Object |
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. |
boolean |
isLeaf()
|
static void |
setBorder(int border)
Set the max border between two nodes of the same level. |
void |
setBounds(org.eclipse.swt.graphics.Rectangle bounds)
set the position and the size. |
void |
setHeight(int height)
set the height. |
protected void |
setParent(TreeMapNode parent)
|
void |
setPosition(int x,
int y)
set the position. |
void |
setSize(int width,
int height)
set size. |
void |
setValue(java.lang.Object 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeMapNode(java.lang.Object value)
value
- value of the TreeMapNodepublic TreeMapNode(java.lang.Object value, double weight)
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 x, int y)
x
- x-coordinatey
- y-coordinate
public TreeMapNode getActiveLeaf(org.eclipse.swt.graphics.Point position)
position
- position
public org.eclipse.swt.graphics.Rectangle getBounds()
public TreeMapNode getChild(int x, int y)
x
- x-coordinatey
- y-coordinate
public TreeMapNode getChild(org.eclipse.swt.graphics.Point position)
position
- position
public java.util.List<TreeMapNode> getChildren()
public int getHeight()
public java.lang.Object getValue()
public double getWeight()
public int getWidth()
public int getX()
public int getY()
public boolean isLeaf()
public void setBounds(org.eclipse.swt.graphics.Rectangle bounds)
bounds
- boundspublic void setHeight(int height)
height
- la nouvelle valeur de heightpublic void setPosition(int x, int y)
x
- x-coordinatey
- y-coordinatepublic void setSize(int width, int height)
width
- the new widthheight
- the new heightpublic void setValue(java.lang.Object 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-coordinatepublic TreeMapNode getParent()
protected void setParent(TreeMapNode parent)
parent
- the parent to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |