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, 2013, Oracle and/or its affiliates. All rights reserved.