|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jtreemap.swing.SplitStrategy
public abstract class SplitStrategy
Abtract class with the method which split the elements of a JTreeMap.
The split is done by dichotomy. We split the elements in 2 groups with a defined strategy (for example : take care of the weight of the elements)
Constructor Summary | |
---|---|
SplitStrategy()
|
Method Summary | |
---|---|
void |
calculatePositions(TreeMapNode root)
calculate the positions for all the elements of the root. |
protected void |
calculatePositionsRec(int x0,
int y0,
int w0,
int h0,
double weight0,
Vector<TreeMapNode> v)
|
protected void |
sortVector(Vector<TreeMapNode> v)
Sort the elements by descending weight. |
abstract void |
splitElements(Vector<TreeMapNode> v,
Vector<TreeMapNode> v1,
Vector<TreeMapNode> v2)
split the elements of a JTreeMap. |
double |
sumWeight(Vector<TreeMapNode> v)
Sum the weight of elements. |
protected void |
workOutWeight(Vector<TreeMapNode> v1,
Vector<TreeMapNode> v2,
Vector<TreeMapNode> vClone,
double sumWeight)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SplitStrategy()
Method Detail |
---|
public void calculatePositions(TreeMapNode root)
root
- the root to calculatepublic abstract void splitElements(Vector<TreeMapNode> v, Vector<TreeMapNode> v1, Vector<TreeMapNode> v2)
v
- Vector with the elements to split (arg IN)v1
- first Vector of the split (arg OUT)v2
- second Vector of the split (arg OUT)public double sumWeight(Vector<TreeMapNode> v)
v
- Vector with the elements to sum
protected void calculatePositionsRec(int x0, int y0, int w0, int h0, double weight0, Vector<TreeMapNode> v)
protected void sortVector(Vector<TreeMapNode> v)
v
- Vector with the elements to be sortedprotected void workOutWeight(Vector<TreeMapNode> v1, Vector<TreeMapNode> v2, Vector<TreeMapNode> vClone, double sumWeight)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |