|
TreeMap Java Library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
treemap.TMAlgorithm
public abstract class TMAlgorithm
The TMAlgorithm abstract class represent the algorithm of the TreeMap. It should be subclassed by every class that want to implement a particular treemap (classic treemap, squarified treemap, ...).
A subclass can also override the drawNode() method to have a customized drawing of a node.
And now with cushion treemap, thanks to Jarke J. van Wijk :-)
Field Summary | |
---|---|
protected boolean |
border
|
protected int |
borderLimit
|
protected int |
borderSize
|
protected boolean |
cushion
|
protected double |
f
|
protected double |
h
|
protected static short |
HORIZONTAL
|
protected int |
IS
|
protected double |
LX
|
protected double |
LY
|
protected double |
LZ
|
protected boolean |
nodesTitles
|
protected treemap.TMNodeModel |
root
|
protected static short |
VERTICAL
|
protected TMView |
view
|
Constructor Summary | |
---|---|
TMAlgorithm()
|
Method Summary | |
---|---|
protected treemap.TMCushionData |
computeCushionData(treemap.TMNodeModel father,
java.awt.Rectangle area,
short axis)
Compute node's cushion data. |
void |
dontDrawNodesTitles()
Don't draws the nodes titles. |
protected abstract void |
drawChildren(java.awt.Graphics2D g,
treemap.TMNodeModelComposite node,
short axis,
int level)
Draws the children of a node, by setting their drawing area first, dependant of the algorithm used. |
protected void |
drawNodes(java.awt.Graphics2D g,
treemap.TMNodeModel node,
short axis,
int level)
Draws the node and recurses the drawing on its children. |
void |
drawNodesTitles()
Draws the nodes titles. |
protected void |
fillCushionNode(java.awt.Graphics2D g,
treemap.TMNodeModel node,
int level,
treemap.TMCushionData data)
|
protected void |
fillNode(java.awt.Graphics2D g,
treemap.TMNodeModel node,
int level)
Fills the node. |
int |
getBorderSize()
Returns the border size. |
javax.swing.JPanel |
getConfiguringView()
Returns a view for configuring this algorithm. |
void |
initialize(treemap.TMNodeModel root,
TMView view)
Initialize the algorithm. |
boolean |
isDrawingTitles()
|
void |
setBorderSize(int size)
Sets the border size. |
protected short |
switchAxis(short axis)
Switch the axis and return the new axis. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double h
protected double f
protected boolean cushion
protected boolean border
protected int IS
protected final double LX
protected final double LY
protected final double LZ
protected static final short HORIZONTAL
protected static final short VERTICAL
protected treemap.TMNodeModel root
protected TMView view
protected int borderSize
protected int borderLimit
protected boolean nodesTitles
Constructor Detail |
---|
public TMAlgorithm()
Method Detail |
---|
public void initialize(treemap.TMNodeModel root, TMView view)
root
- the root of the TMNodeModel treeview
- the view using this algorithmpublic void drawNodesTitles()
public void dontDrawNodesTitles()
public boolean isDrawingTitles()
public void setBorderSize(int size)
size
- the border sizepublic int getBorderSize()
public javax.swing.JPanel getConfiguringView()
protected void drawNodes(java.awt.Graphics2D g, treemap.TMNodeModel node, short axis, int level)
g
- the graphic contextnode
- the node to drawaxis
- the axis of separationlevel
- the level of deepprotected short switchAxis(short axis)
axis
- the axis to switch
protected treemap.TMCushionData computeCushionData(treemap.TMNodeModel father, java.awt.Rectangle area, short axis)
protected void fillCushionNode(java.awt.Graphics2D g, treemap.TMNodeModel node, int level, treemap.TMCushionData data)
protected void fillNode(java.awt.Graphics2D g, treemap.TMNodeModel node, int level)
g
- the graphic contextnode
- the TMNodeModel to drawlevel
- the level of deepprotected abstract void drawChildren(java.awt.Graphics2D g, treemap.TMNodeModelComposite node, short axis, int level)
g
- the graphic contextnode
- the node whose children should be drawnaxis
- the axis of separationlevel
- the level of deep
|
TreeMap Java Library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |