Package com.jgoodies.looks.plastic
Class PlasticTreeUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TreeUI
-
- javax.swing.plaf.basic.BasicTreeUI
-
- com.jgoodies.looks.plastic.PlasticTreeUI
-
public final class PlasticTreeUI extends javax.swing.plaf.basic.BasicTreeUIThe JGoodies Plastic Look&Feel implementation ofTreeUI. It provides two line styles: angled dashed lines, or no lines at all. By default, lines are drawn.You can change the line style by setting a client property. The property key and values are a subset of the values used by the Metal L&F tree. To hide lines use one of the following:
JTree tree1 = new JTree(); tree1.putClientProperty("JTree.lineStyle", "None"); JTree tree2 = new JTree(); tree1.putClientProperty(Options.TREE_LINE_STYLE_KEY, Options.TREE_LINE_STYLE_NONE_VALUE);Although lines are shown by default, you could code:JTree tree1 = new JTree(); tree1.putClientProperty("JTree.lineStyle", "Angled"); JTree tree2 = new JTree(); tree1.putClientProperty(Options.TREE_LINE_STYLE_KEY, Options.TREE_LINE_STYLE_ANGLED_VALUE);- Version:
- $Revision: 1.9 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classPlasticTreeUI.LineStyleHandler-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI
javax.swing.plaf.basic.BasicTreeUI.CellEditorHandler, javax.swing.plaf.basic.BasicTreeUI.ComponentHandler, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.KeyHandler, javax.swing.plaf.basic.BasicTreeUI.MouseHandler, javax.swing.plaf.basic.BasicTreeUI.MouseInputHandler, javax.swing.plaf.basic.BasicTreeUI.NodeDimensionsHandler, javax.swing.plaf.basic.BasicTreeUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.SelectionModelPropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction, javax.swing.plaf.basic.BasicTreeUI.TreeExpansionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeHomeAction, javax.swing.plaf.basic.BasicTreeUI.TreeIncrementAction, javax.swing.plaf.basic.BasicTreeUI.TreeModelHandler, javax.swing.plaf.basic.BasicTreeUI.TreePageAction, javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeToggleAction, javax.swing.plaf.basic.BasicTreeUI.TreeTraverseAction
-
-
Field Summary
Fields Modifier and Type Field Description private booleanlinesEnabledprivate java.beans.PropertyChangeListenerlineStyleHandler-
Fields inherited from class javax.swing.plaf.basic.BasicTreeUI
cellEditor, collapsedIcon, createdCellEditor, createdRenderer, currentCellRenderer, depthOffset, drawingCache, editingComponent, editingPath, editingRow, editorHasDifferentSize, expandedIcon, largeModel, lastSelectedRow, leftChildIndent, nodeDimensions, preferredMinSize, preferredSize, rendererPane, rightChildIndent, stopEditingInCompleteEditing, totalChildIndent, tree, treeModel, treeSelectionModel, treeState, validCachedPreferredSize
-
-
Constructor Summary
Constructors Constructor Description PlasticTreeUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent b)protected voiddrawCentered(java.awt.Component c, java.awt.Graphics graphics, javax.swing.Icon icon, int x, int y)voidinstallUI(javax.swing.JComponent c)protected voidpaintHorizontalLine(java.awt.Graphics g, javax.swing.JComponent c, int y, int left, int right)protected voidpaintVerticalLine(java.awt.Graphics g, javax.swing.JComponent c, int x, int top, int bottom)voiduninstallUI(javax.swing.JComponent c)private voidupdateLineStyle(java.lang.Object lineStyle)-
Methods inherited from class javax.swing.plaf.basic.BasicTreeUI
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, createFocusListener, createKeyListener, createLayoutCache, createMouseListener, createNodeDimensions, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getDropLineRect, getEditingPath, getExpandedIcon, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeadSelectionRow, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, installListeners, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paint, paintDropLine, paintExpandControl, paintHorizontalPartOfLeg, paintRow, paintVerticalPartOfLeg, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, selectPathForEvent, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateRenderer, updateSize
-
-
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.basic.BasicTreeUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.basic.BasicTreeUI
-
paintVerticalLine
protected void paintVerticalLine(java.awt.Graphics g, javax.swing.JComponent c, int x, int top, int bottom)- Overrides:
paintVerticalLinein classjavax.swing.plaf.basic.BasicTreeUI
-
paintHorizontalLine
protected void paintHorizontalLine(java.awt.Graphics g, javax.swing.JComponent c, int y, int left, int right)- Overrides:
paintHorizontalLinein classjavax.swing.plaf.basic.BasicTreeUI
-
drawCentered
protected void drawCentered(java.awt.Component c, java.awt.Graphics graphics, javax.swing.Icon icon, int x, int y)- Overrides:
drawCenteredin classjavax.swing.plaf.basic.BasicTreeUI
-
updateLineStyle
private void updateLineStyle(java.lang.Object lineStyle)
-
-