JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.plaf.metal
クラス MetalTreeUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--javax.swing.plaf.TreeUI
              |
              +--javax.swing.plaf.basic.BasicTreeUI
                    |
                    +--javax.swing.plaf.metal.MetalTreeUI

public class MetalTreeUI
extends BasicTreeUI

MetalTreeUI は、カスタマイズに使用するクライアントプロパティの「値の追加」システムをサポートしています。MetalTreeUI は、このシステムを使用してライン描画のスタイルを決定します。ラインの描画スタイルには、3 つの選択肢があります。1 つ目は、ラインを描画しないデフォルトの描画スタイルです。2 つ目は、親から子へ延びる角度付きの脚を持つ描画スタイルです。3 つ目は、水平線だけを描画するオプションです。次に角度付きの脚をオンにするコードを示します。

        tree.putClientProperty("JTree.lineStyle", "Angled");

次にルートとノードの間の水平線をオンにするコードを示します。

        tree.putClientProperty("JTree.lineStyle", "Horizontal");

次にすべての線をオフにするコードを示します (デフォルト)。

        tree.putClientProperty("JTree.lineStyle", "None");


クラス javax.swing.plaf.basic.BasicTreeUI から継承した内部クラス
BasicTreeUI.CellEditorHandler, BasicTreeUI.ComponentHandler, BasicTreeUI.FocusHandler, BasicTreeUI.KeyHandler, BasicTreeUI.MouseHandler, BasicTreeUI.MouseInputHandler, BasicTreeUI.NodeDimensionsHandler, BasicTreeUI.PropertyChangeHandler, BasicTreeUI.SelectionModelPropertyChangeHandler, BasicTreeUI.TreeCancelEditingAction, BasicTreeUI.TreeExpansionHandler, BasicTreeUI.TreeHomeAction, BasicTreeUI.TreeIncrementAction, BasicTreeUI.TreeModelHandler, BasicTreeUI.TreePageAction, BasicTreeUI.TreeSelectionHandler, BasicTreeUI.TreeToggleAction, BasicTreeUI.TreeTraverseAction
 
クラス 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
 
コンストラクタの概要
MetalTreeUI()
           
 
メソッドの概要
static ComponentUI createUI(JComponent x)
           
protected  void decodeLineStyle(Object lineStyleFlag)
          クライアントプロパティに渡された文字列と内部表現 (currently および int) との間の変換を行います。
protected  int getHorizontalLegBuffer()
          ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。
 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)
          脚の水平部分をペイントします。
protected  void paintHorizontalSeparators(Graphics g, JComponent c)
           
protected  void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
          脚の垂直部分をペイントします。
 void uninstallUI(JComponent c)
           
 
クラス 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, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getEditingPath, getExpandedIcon, getHashColor, getLastChildPath, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, installListeners, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintExpandControl, paintHorizontalLine, paintRow, paintVerticalLine, 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, updateRenderer, updateSize
 
クラス javax.swing.plaf.ComponentUI から継承したメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

MetalTreeUI

public MetalTreeUI()
メソッドの詳細

createUI

public static ComponentUI createUI(JComponent x)

getHorizontalLegBuffer

protected int getHorizontalLegBuffer()
クラス BasicTreeUI の記述:
ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。このメソッドは、脚がそれより前で終わるようにします。
オーバーライド:
クラス BasicTreeUI 内の getHorizontalLegBuffer

installUI

public void installUI(JComponent c)
オーバーライド:
クラス BasicTreeUI 内の installUI

uninstallUI

public void uninstallUI(JComponent c)
オーバーライド:
クラス BasicTreeUI 内の uninstallUI

decodeLineStyle

protected void decodeLineStyle(Object lineStyleFlag)
クライアントプロパティに渡された文字列と内部表現 (currently および int) との間の変換を行います。

isLocationInExpandControl

protected boolean isLocationInExpandControl(int row,
                                            int rowLevel,
                                            int mouseX,
                                            int mouseY)

paint

public void paint(Graphics g,
                  JComponent c)
オーバーライド:
クラス BasicTreeUI 内の paint

paintHorizontalSeparators

protected void paintHorizontalSeparators(Graphics g,
                                         JComponent c)

paintVerticalPartOfLeg

protected void paintVerticalPartOfLeg(Graphics g,
                                      Rectangle clipBounds,
                                      Insets insets,
                                      TreePath path)
クラス BasicTreeUI の記述:
脚の垂直部分をペイントします。レシーバは、clipBoundsinsets を変更することは許されません。

オーバーライド:
クラス BasicTreeUI 内の paintVerticalPartOfLeg

paintHorizontalPartOfLeg

protected void paintHorizontalPartOfLeg(Graphics g,
                                        Rectangle clipBounds,
                                        Insets insets,
                                        Rectangle bounds,
                                        TreePath path,
                                        int row,
                                        boolean isExpanded,
                                        boolean hasBeenExpanded,
                                        boolean isLeaf)
クラス BasicTreeUI の記述:
脚の水平部分をペイントします。レシーバは、clipBoundsinsets を変更することは許されません。

注: ルートが可視でない場合、parentRow は -1 になることがあります。

オーバーライド:
クラス BasicTreeUI 内の paintHorizontalPartOfLeg

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.