|
|||||||||
| 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 Form
![]() |
![]() |
| Nested 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 |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.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,
javax.swing.JTree treeView)
Constructor of JTreeMap. |
|
JTreeMap(TreeMapNode root,
SplitStrategy strategy,
javax.swing.JTree treeView,
java.lang.String weightPrefix,
java.lang.String valuePrefix,
boolean showWeight)
Constructor of JTreeMap. |
|
JTreeMap(TreeMapNode root,
SplitStrategy strategy,
java.lang.String weightPrefix,
java.lang.String valuePrefix,
boolean showWeight)
Constructor of JTreeMap. |
|
| Method Summary | |
|---|---|
void |
calculatePositions()
calculate the postitions for the displayed root. |
javax.swing.JToolTip |
createToolTip()
|
protected void |
draw(java.awt.Graphics g,
TreeMapNode item)
draw the item. |
protected void |
drawLabel(java.awt.Graphics g,
TreeMapNode item)
write the label in the middle of the item. |
protected void |
drawLabels(java.awt.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. |
java.awt.Point |
getToolTipLocation(java.awt.event.MouseEvent event)
|
javax.swing.JTree |
getTreeView()
|
protected void |
paintComponent(java.awt.Graphics g)
|
protected void |
reveal(java.awt.Graphics g,
TreeMapNode item)
reveal the item. |
void |
setActiveLeaf(TreeMapNode newActiveLeaf)
set the active leaf. |
void |
setBorder(javax.swing.border.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(javax.swing.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 javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| 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,
javax.swing.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,
javax.swing.JTree treeView,
java.lang.String weightPrefix,
java.lang.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,
java.lang.String weightPrefix,
java.lang.String valuePrefix,
boolean showWeight)
root - the root of the tree to displaystrategy - the split strategyUniqueColorProvider| Method Detail |
|---|
public void calculatePositions()
public javax.swing.JToolTip createToolTip()
createToolTip in class javax.swing.JComponent
protected void draw(java.awt.Graphics g,
TreeMapNode item)
g - Graphics where you have to drawitem - item to draw
protected void drawLabel(java.awt.Graphics g,
TreeMapNode item)
g - Graphics where you have to drawitem - TreeMapNode to draw
protected void drawLabels(java.awt.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 java.awt.Point getToolTipLocation(java.awt.event.MouseEvent event)
getToolTipLocation in class javax.swing.JComponentprotected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponent
protected void reveal(java.awt.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(javax.swing.border.Border border)
setBorder in class javax.swing.JComponentpublic 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 javax.swing.JTree getTreeView()
public void setTreeView(javax.swing.JTree treeView)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||