- 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
TreeUIのMetal Look & Feel実装です。MetalTreeUIがノード間の間隔と輪郭を可視的に描画する方法を構成できるようにします。 次のヒントをサポートします。サポートされているヒント(斜線、水平線、なし)の説明 斜線 子と親を結ぶ線が描かれる。 ルート・ノードの処理については、 JTree.setRootVisible(boolean)およびJTree.setShowsRootHandles(boolean)を参照。水平線 ルート・ノードの子を区分する水平線が描かれる なし ノード間に視覚的な指示を与える線を描かない 通常、
JTreeからTreeUIを取得してMetalTreeUIのインスタンスにキャストするのは実際的な方法ではないので、クライアント・プロパティJTree.lineStyleを使用してこのプロパティを有効にします。 たとえば、Horizontalスタイルに切り替えるには、tree.putClientProperty("JTree.lineStyle", "Horizontal");を実行します。デフォルトは
Angledです。
-
-
ネストされたクラスのサマリー
-
クラス 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()MetalTreeUIを構築します。
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 static ComponentUIcreateUI(JComponent x)MetalTreeUIを構築します。protected voiddecodeLineStyle(Object lineStyleFlag)クライアント・プロパティに渡された文字列と内部表現の間の変換(現在およびint)protected intgetHorizontalLegBuffer()ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。voidinstallUI(JComponent c)指定されたコンポーネントをLook & Feelに応じて適切に構成します。protected booleanisLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)X座標mouseXとY座標mouseYの点が拡大制御されている場合は、trueを返します。voidpaint(Graphics g, JComponent c)指定されたコンポーネントをLook & Feelに合わせてペイントします。protected voidpaintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)脚の水平部分をペイントします。protected voidpaintHorizontalSeparators(Graphics g, JComponent c)水平の区切り線をペイントします。protected voidpaintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)脚の垂直部分をペイントします。voiduninstallUI(JComponent c)installUI時に、指定されたコンポーネントに対して行われた構成を取り消します。-
クラス 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, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getDropLineRect, getEditingPath, getExpandedIcon, getHashColor, 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, paintDropLine, 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, updateLeadSelectionRow, updateRenderer, updateSize
-
クラス javax.swing.plaf.ComponentUIから継承されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
-
-
-
メソッドの詳細
-
createUI
public static ComponentUI createUI(JComponent x)
MetalTreeUIを構築します。- パラメータ:
x- コンポーネント- 戻り値:
MetalTreeUIのインスタンス
-
getHorizontalLegBuffer
protected int getHorizontalLegBuffer()
クラスからコピーされた説明:BasicTreeUIノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。 このメソッドは、脚がそれより前で終わるようにします。- オーバーライド:
getHorizontalLegBuffer、クラス:BasicTreeUI- 戻り値:
- 水平バッファ
-
installUI
public void installUI(JComponent c)
クラスからコピーされた説明:ComponentUI指定されたコンポーネントをLook & Feelに応じて適切に構成します。 このメソッドは、ComponentUIインスタンスが、指定されたコンポーネントのUI委譲としてインストールされているときに呼び出されます。 このメソッドは、次を含むLook & Feel用のコンポーネントを完全に構成するべきです。- カラー、フォント、ボーダー、アイコン、不透明さなどのデフォルト・プロパティ値をコンポーネントにインストールする。 可能な場合は常に、クライアント・プログラムによって初期化されたプロパティの値をオーバーライドするべきではない。
- 必要に応じて、コンポーネントに
LayoutManagerをインストールする。 - 必要なサブコンポーネントを作成して、コンポーネントに追加する。
- イベント・リスナーを作成して、コンポーネントにインストールする。
- コンポーネントのプロパティの変更を適切に検出し、応答するために、
PropertyChangeListenerを作成してコンポーネントにインストールする。 - キーボードUI (ニーモニック、トラバーサルなど)を、コンポーネントにインストールする。
- 適切なインスタンスのデータを初期化する。
- オーバーライド:
installUI、クラス:BasicTreeUI- パラメータ:
c- UI委譲がインストールされるコンポーネント- 関連項目:
ComponentUI.uninstallUI(javax.swing.JComponent),JComponent.setUI(javax.swing.plaf.ComponentUI),JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)
クラスからコピーされた説明:ComponentUIinstallUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 このメソッドは、このUIComponentインスタンスが、指定されたコンポーネントのUI委譲として削除されているときに呼び出されます。 このメソッドは、installUIによって実行された構成を元に戻すべきです。この場合、JComponentインスタンスをクリーンな状態(余分なリスナーや、Look & Feel固有のプロパティ・オブジェクトが残らないように)にするよう十分注意してください。 手順には次のものが含まれるべきです。- UIとして設定されたすべてのボーダーを、コンポーネントから削除する。
- UIとして設定されたすべてのレイアウト・マネージャを、コンポーネントから削除する。
- UIとして追加されたすべてのサブコンポーネントを、コンポーネントから削除する。
- UIとして追加されたすべてのイベント/プロパティ・リスナーを、コンポーネントから削除する。
- UIとしてインストールされたすべてのキーボードUIを、コンポーネントから削除する。
- GCの対象になるように、割り当てられたすべてのインスタンス・データ・オブジェクトをnullに設定する。
- オーバーライド:
uninstallUI、クラス:BasicTreeUI- パラメータ:
c- このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある- 関連項目:
ComponentUI.installUI(javax.swing.JComponent),JComponent.updateUI()
-
decodeLineStyle
protected void decodeLineStyle(Object lineStyleFlag)
クライアント・プロパティに渡された文字列と内部表現の間の変換(現在およびint)- パラメータ:
lineStyleFlag- フラグ
-
isLocationInExpandControl
protected boolean isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)X座標mouseXとY座標mouseYの点が拡大制御されている場合は、trueを返します。- パラメータ:
row- 行rowLevel- 行レベルmouseX- X座標mouseY- Y座標- 戻り値:
trueX座標がmouseXで、Y座標がmouseYの点が拡大制御されている場合。
-
paint
public void paint(Graphics g, JComponent c)
クラスからコピーされた説明:ComponentUI指定されたコンポーネントをLook & Feelに合わせてペイントします。 このメソッドは、指定されたコンポーネントがペイントされるときにComponentUI.updateメソッドから呼び出されます。 サブクラスは、このメソッドをオーバーライドして、指定されたGraphicsオブジェクトを使ってコンポーネントの内容を描画するべきです。- オーバーライド:
paint、クラス:BasicTreeUI- パラメータ:
g- ペイント対象のGraphicsコンテキストc- ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある- 関連項目:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
-
paintHorizontalSeparators
protected void paintHorizontalSeparators(Graphics g, JComponent c)
水平の区切り線をペイントします。- パラメータ:
g-Graphicsのインスタンスc- コンポーネント
-
paintVerticalPartOfLeg
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
クラスからコピーされた説明:BasicTreeUI脚の垂直部分をペイントします。 レシーバは、clipBoundsやinsetsを変更しないでください。- オーバーライド:
paintVerticalPartOfLeg、クラス:BasicTreeUI- パラメータ:
g- グラフィック・スコンテキストclipBounds- クリップされた矩形insets- insetspath- ツリー・パス
-
paintHorizontalPartOfLeg
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
クラスからコピーされた説明:BasicTreeUI脚の水平部分をペイントします。 レシーバは、clipBoundsやinsetsを変更しないでください。注: ルートが可視でない場合、
parentRowは -1になることがあります。- オーバーライド:
paintHorizontalPartOfLeg、クラス:BasicTreeUI- パラメータ:
g- グラフィック・スコンテキストclipBounds- クリップされた矩形insets- insetsbounds- 外接する矩形path- ツリー・パスrow- 行isExpanded- パスが展開されている場合はtruehasBeenExpanded- パスが展開されている場合はtrueisLeaf- パスがリーフの場合はtrue
-
-