Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.plaf.ComponentUI | +--javax.swing.plaf.TreeUI | +--javax.swing.plaf.basic.BasicTreeUI | +--javax.swing.plaf.metal.MetalTreeUI
MetalTreeUI supports the client property "value-add" system of customization It uses it to determine what style of line to draw. There are three choices. The default choice is to draw no lines. Also available is a more variant with angled legs running from parent to child. Lastly you can choose an option with horizonl lines be lines at all. Here is some code to turn on angled legs. tree.putClientProperty("JTree.lineStyle", "Angled"); Here is some code to turn on horizontal lines between root nodes. tree.putClientProperty("JTree.lineStyle", "Horizontal"); Here is some code to turn off lines all together (which is the default). tree.putClientProperty("JTree.lineStyle", "None");
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 | |
MetalTreeUI()
|
Method Summary | |
static ComponentUI |
createUI(JComponent x)
|
protected void |
decodeLineStyle(Object lineStyleFlag)
this function converts between the string passed into the client property and the internal representation (currently and int) |
protected int |
getHorizontalLegBuffer()
The horizontal element of legs between nodes starts at the right of the left-hand side of the child node by default. |
void |
installUI(JComponent c)
|
protected boolean |
isLocationInExpandControl(int row,
int rowLevel,
int mouseX,
int mouseY)
|
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintHorizontalPartOfLeg(Graphics g,
Rectangle clipBounds,
Insets insets,
Rectangle bounds,
TreePath path,
int row,
boolean isExpanded,
boolean hasBeenExpanded,
boolean isLeaf)
Paints the horizontal part of the leg. |
protected void |
paintHorizontalSeparators(Graphics g,
JComponent c)
|
protected void |
paintVerticalPartOfLeg(Graphics g,
Rectangle clipBounds,
Insets insets,
TreePath path)
Paints the vertical part of the leg. |
void |
uninstallUI(JComponent c)
|
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MetalTreeUI()
Method Detail |
public static ComponentUI createUI(JComponent x)
protected int getHorizontalLegBuffer()
BasicTreeUI
getHorizontalLegBuffer
in class BasicTreeUI
public void installUI(JComponent c)
installUI
in class BasicTreeUI
public void uninstallUI(JComponent c)
uninstallUI
in class BasicTreeUI
protected void decodeLineStyle(Object lineStyleFlag)
protected boolean isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)
public void paint(Graphics g, JComponent c)
paint
in class BasicTreeUI
protected void paintHorizontalSeparators(Graphics g, JComponent c)
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
BasicTreeUI
clipBounds
, insets
.paintVerticalPartOfLeg
in class BasicTreeUI
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
BasicTreeUI
clipBounds
, or insets
.
NOTE: parentRow
can be -1 if the root is not visible.
paintHorizontalPartOfLeg
in class BasicTreeUI
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.