public class JTreeMap extends JComponent
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| Modifier and Type | Class and Description |
|---|---|
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.
|
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculatePositions()
calculate the postitions for the displayed root.
|
JToolTip |
createToolTip() |
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.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateUIadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCyclepublic JTreeMap(TreeMapNode root)
root - the root of the tree to displaySplitSquarified,
UniqueColorProviderpublic JTreeMap(TreeMapNode root, JTree treeView)
root - the root of the tree to displaytreeView - The tree representation of the hierarchical data.SplitSquarified,
UniqueColorProviderpublic 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.UniqueColorProviderpublic JTreeMap(TreeMapNode root, SplitStrategy strategy, String weightPrefix, String valuePrefix, boolean showWeight)
root - the root of the tree to displaystrategy - the split strategyUniqueColorProviderpublic void calculatePositions()
public JToolTip createToolTip()
createToolTip in class JComponentprotected 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 JComponentprotected void paintComponent(Graphics g)
paintComponent in class JComponentprotected 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 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 JTree getTreeView()
public void setTreeView(JTree treeView)
Copyright © 2005–2019 Appendium - Portfolio Financing Platform. All rights reserved.