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です。
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.TreeTraverseActioncellEditor, 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)
指定されたコンポーネントをLook & Feelに応じて適切に構成します。
|
protected boolean |
isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY) |
void |
paint(Graphics g, JComponent c)
指定されたコンポーネントをLook & Feelに合わせてペイントします。
|
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)
installUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 |
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, updateSizecontains, getAccessibleChild, getAccessibleChildrenCount, updatepublic static ComponentUI createUI(JComponent x)
protected int getHorizontalLegBuffer()
BasicTreeUIgetHorizontalLegBuffer、クラス: BasicTreeUIpublic void installUI(JComponent c)
ComponentUIComponentUIインスタンスが、指定されたコンポーネントのUI委譲としてインストールされているときに呼び出されます。このメソッドは、次を含むLook & Feel用のコンポーネントを完全に構成するべきです。
LayoutManagerをインストールする。
PropertyChangeListenerを作成してコンポーネントにインストールする。
installUI、クラス: BasicTreeUIc - UI委譲がインストールされるコンポーネントComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()public void uninstallUI(JComponent c)
ComponentUIinstallUI時に、指定されたコンポーネントに対して行われた構成を取り消します。このメソッドは、このUIComponentインスタンスが、指定されたコンポーネントのUI委譲として削除されているときに呼び出されます。このメソッドは、installUIによって実行された構成を元に戻すべきです。この場合、JComponentインスタンスをクリーンな状態(余分なリスナーや、Look & Feel固有のプロパティ・オブジェクトが残らないように)にするよう十分注意してください。手順には次のものが含まれるべきです。
uninstallUI、クラス: BasicTreeUIc - このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()protected void decodeLineStyle(Object lineStyleFlag)
protected boolean isLocationInExpandControl(int row,
int rowLevel,
int mouseX,
int mouseY)
public void paint(Graphics g, JComponent c)
ComponentUIComponentUI.updateメソッドから呼び出されます。サブクラスは、このメソッドをオーバーライドして、指定されたGraphicsオブジェクトを使ってコンポーネントの内容を描画するべきです。paint、クラス: BasicTreeUIg - ペイント対象のGraphicsコンテキストc - ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.update(java.awt.Graphics, javax.swing.JComponent)protected void paintHorizontalSeparators(Graphics g, JComponent c)
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
BasicTreeUIclipBoundsやinsetsを変更しないでください。paintVerticalPartOfLeg、クラス: BasicTreeUIprotected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
BasicTreeUIclipBoundsやinsetsを変更しないでください。
注: ルートが可視でない場合、parentRowは -1になることがあります。
paintHorizontalPartOfLeg、クラス: BasicTreeUI バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.