|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
net.sf.jtreemap.swing.JTreeMap
public class JTreeMap
JComponent who represents each element of a tree in a rectangle of more or less big size according to its importance in the tree.
A tree structure may includes more or less important elements. For example, in a tree structure of files, there can be files of big size. Then it can be interesting to know which repertory is the most important on a hard disk.
Moreover, we can add a code color which makes it possible to introduce new information into the representation of the tree structure.
So, in a JTreeMap, you can see the size and the value of an element in a tree.
TreeMapNode
,
Serialized FormNested Class Summary | |
---|---|
protected class |
JTreeMap.HandleMouseClick
Listener which listens for double click to navigate one level down. |
protected class |
JTreeMap.HandleMouseMotion
Listener who define the active leaf and set the tooltip text. |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JTreeMap(TreeMapNode root)
Constructor of JTreeMap. |
|
JTreeMap(TreeMapNode root,
JTree treeView)
Constructor of JTreeMap. |
|
JTreeMap(TreeMapNode root,
SplitStrategy strategy,
JTree treeView,
String weightPrefix,
String valuePrefix,
boolean showWeight)
Constructor of JTreeMap. |
|
JTreeMap(TreeMapNode root,
SplitStrategy strategy,
String weightPrefix,
String valuePrefix,
boolean showWeight)
Constructor of JTreeMap. |
Method Summary | |
---|---|
void |
calculatePositions()
calculate the postitions for the displayed root. |
JToolTip |
createToolTip()
|
void |
draw(Graphics g)
|
protected void |
draw(Graphics g,
TreeMapNode item)
draw the item. |
protected void |
drawLabel(Graphics g,
TreeMapNode item)
write the label in the middle of the item. |
protected void |
drawLabels(Graphics g,
TreeMapNode item)
Draw all the labels to draw. |
TreeMapNode |
getActiveLeaf()
get the active leaf (the one under the mouse). |
ColorProvider |
getColorProvider()
get the ColorProvider. |
TreeMapNode |
getDisplayedRoot()
get the displayed root. |
TreeMapNode |
getRoot()
get the root. |
SplitStrategy |
getStrategy()
get the SplitStrategy. |
Point |
getToolTipLocation(MouseEvent event)
|
JTree |
getTreeView()
|
protected void |
paintComponent(Graphics g)
|
protected void |
reveal(Graphics g,
TreeMapNode item)
reveal the item. |
void |
setActiveLeaf(TreeMapNode newActiveLeaf)
set the active leaf. |
void |
setBorder(Border border)
|
void |
setColorProvider(ColorProvider newColorProvider)
set the ColorProvider. |
void |
setDisplayedRoot(TreeMapNode newDisplayedRoot)
set the displayed root. |
void |
setRoot(TreeMapNode newRoot)
set the new root. |
void |
setStrategy(SplitStrategy newStrat)
set the new strategy. |
void |
setToolTipBuilder(IToolTipBuilder toolTipBuilder)
Set the builder of the toolTip. |
void |
setTreeView(JTree treeView)
|
void |
setZoomKeepProportion(boolean keepProportion)
When you zoom the jTreeMap, you have the choice to keep proportions or not. |
void |
unzoom()
Undo the zoom to display the root. |
void |
zoom(TreeMapNode dest)
Zoom the JTreeMap to the dest node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JTreeMap(TreeMapNode root)
root
- the root of the tree to displaySplitSquarified
,
UniqueColorProvider
public JTreeMap(TreeMapNode root, JTree treeView)
root
- the root of the tree to displaytreeView
- The tree representation of the hierarchical data.SplitSquarified
,
UniqueColorProvider
public JTreeMap(TreeMapNode root, SplitStrategy strategy, JTree treeView, String weightPrefix, String valuePrefix, boolean showWeight)
root
- the root of the tree to displaystrategy
- the split strategytreeView
- The tree representation of the hierarchical data.UniqueColorProvider
public JTreeMap(TreeMapNode root, SplitStrategy strategy, String weightPrefix, String valuePrefix, boolean showWeight)
root
- the root of the tree to displaystrategy
- the split strategyUniqueColorProvider
Method Detail |
---|
public void calculatePositions()
public JToolTip createToolTip()
createToolTip
in class JComponent
public void draw(Graphics g)
protected void draw(Graphics g, TreeMapNode item)
g
- Graphics where you have to drawitem
- item to drawprotected void drawLabel(Graphics g, TreeMapNode item)
g
- Graphics where you have to drawitem
- TreeMapNode to drawprotected void drawLabels(Graphics g, TreeMapNode item)
g
- Graphics where you have to drawitem
- TreeMapNode to drawpublic TreeMapNode getActiveLeaf()
public ColorProvider getColorProvider()
public TreeMapNode getDisplayedRoot()
This may be not the root of the jTreeMap. After a zoom, the displayed root can be the root of an under-tree.
public TreeMapNode getRoot()
public SplitStrategy getStrategy()
public Point getToolTipLocation(MouseEvent event)
getToolTipLocation
in class JComponent
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
protected void reveal(Graphics g, TreeMapNode item)
g
- Graphics where you have to drawitem
- TreeMapNode to revealpublic void setActiveLeaf(TreeMapNode newActiveLeaf)
newActiveLeaf
- the new active leafpublic void setBorder(Border border)
setBorder
in class JComponent
public void setColorProvider(ColorProvider newColorProvider)
newColorProvider
- the new ColorPorviderpublic void setDisplayedRoot(TreeMapNode newDisplayedRoot)
This may be not the root of the jTreeMap. After a zoom, the displayed root can be the root of an under-tree.
newDisplayedRoot
- new DiplayedRootpublic void setRoot(TreeMapNode newRoot)
newRoot
- the new root to setpublic void setStrategy(SplitStrategy newStrat)
newStrat
- the new strategy to setpublic void setToolTipBuilder(IToolTipBuilder toolTipBuilder)
toolTipBuilder
- The toolTipBuilder to set.public void setZoomKeepProportion(boolean keepProportion)
keepProportion
- true if you want to keep proportions, else falsepublic void unzoom()
public void zoom(TreeMapNode dest)
dest
- node we want to zoompublic JTree getTreeView()
public void setTreeView(JTree treeView)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |