- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TreeUI
-
- javax.swing.plaf.basic.BasicTreeUI
-
- 直系の既知のサブクラス:
MetalTreeUI
,SynthTreeUI
public class BasicTreeUI extends TreeUI
階層データ構造の基本L&Fです。
-
-
ネストされたクラスのサマリー
ネストされたクラス 修飾子と型 クラス 説明 class
BasicTreeUI.CellEditorHandler
セル編集イベントを取得し、それに応じてツリーを更新するリスナーです。class
BasicTreeUI.ComponentHandler
スクロール時に推奨サイズを更新します(必要に応じて)。class
BasicTreeUI.FocusHandler
フォーカスを喪失または取得したときにリード選択行を再ペイントします。class
BasicTreeUI.KeyHandler
これは、複数のキー押下イベントを取得して適切にイベントを生成するために使用されます。class
BasicTreeUI.MouseHandler
TreeMouseListenerはマウス・イベントに基づいて選択を更新します。class
BasicTreeUI.MouseInputHandler
MouseInputHandlerは、マウスが放されて構築済みの送信先に送られるまで、すべてのマウス・イベント(マウス・モーション・イベントなど)を渡します。class
BasicTreeUI.NodeDimensionsHandler
ノードのサイズを取得するクラス、メソッドはBasicTreeUIメソッドに転送されます。class
BasicTreeUI.PropertyChangeHandler
ツリーのPropertyChangeListenerです。class
BasicTreeUI.SelectionModelPropertyChangeHandler
TreeSelectionModelのリスナー、モデルのプロパティが変更された場合に行選択をリセットします。class
BasicTreeUI.TreeCancelEditingAction
アクションが実行されたときにcancelEditingを呼び出すActionListenerです。class
BasicTreeUI.TreeExpansionHandler
ノードの展開または折りたたみに応じてTreeStateを更新します。class
BasicTreeUI.TreeHomeAction
TreeHomeActionは、End/Homeアクションを処理するために使用されます。class
BasicTreeUI.TreeIncrementAction
TreeIncrementActionは、上下アクションを処理するために使用されます。class
BasicTreeUI.TreeModelHandler
すべてのTreeModelイベントをTreeStateに転送します。class
BasicTreeUI.TreePageAction
TreePageActionは、ページ・アップとページ・ダウンのイベントを処理します。class
BasicTreeUI.TreeSelectionHandler
選択モデルの変更を待機し、それに応じて表示を更新します。class
BasicTreeUI.TreeToggleAction
最初に選択された行で、展開状態が切り替えられます。class
BasicTreeUI.TreeTraverseAction
TreeTraverseAction
は、左または右キーのために使用されるアクションです。
-
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected TreeCellEditor
cellEditor
ツリーのエディタです。protected Icon
collapsedIcon
折りたたまれたアイコン。protected boolean
createdCellEditor
現在ツリーにあるエディタがこのインスタンスによって作成された場合にtrueに設定されます。protected boolean
createdRenderer
現在ツリーにあるレンダラがこのインスタンスによって作成された場合にtrueに設定されます。protected TreeCellRenderer
currentCellRenderer
実際のセルの描画を行うために使われているレンダラです。protected int
depthOffset
x位置を正確に計算するための深さのオフセットの量です。protected Hashtable<TreePath,Boolean>
drawingCache
垂直線の描画を最小化するために使われます。protected Component
editingComponent
これは編集時に、実際の編集を行うComponentになります。protected TreePath
editingPath
編集中のパスです。protected int
editingRow
編集中の行です。protected boolean
editorHasDifferentSize
エディタのサイズがレンダラと異なる場合にtrueに設定されます。protected Icon
expandedIcon
展開されたアイコン。protected boolean
largeModel
largeModelの最適化を行なっている場合はtrueです。protected int
lastSelectedRow
最後に選択された行のインデックスです。protected int
leftChildIndent
左マージンと垂直の破線が描画される位置の間の距離です。protected AbstractLayoutCache.NodeDimensions
nodeDimensions
TreeStateに対しノードに必要なサイズを通知します。protected Dimension
preferredMinSize
推奨される最小サイズです。protected Dimension
preferredSize
すべてのノードを完全に表示するために必要なサイズです。protected CellRendererPane
rendererPane
TreeCellRendererをペイントするために使われます。protected int
rightChildIndent
セルの内容が描画される位置を決定するためにleftChildIndentに加算される距離です。protected boolean
stopEditingInCompleteEditing
編集時に、shouldSelectCell()がtrueを返した場合にfalseに設定されます。これは、completeEditingで使用され、ノードが編集前に選択されなければならないことを意味しています。protected int
totalChildIndent
インデントされる総距離です。protected JTree
tree
描画先のコンポーネントです。protected TreeModel
treeModel
何を表示するかを決定するために使われます。protected TreeSelectionModel
treeSelectionModel
選択を維持するモデルです。protected AbstractLayoutCache
treeState
サイズ変更や展開されているかどうかを処理するオブジェクトです。protected boolean
validCachedPreferredSize
preferredSizeが有効かどうかを示します。
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 BasicTreeUI()
BasicTreeUI
の新しいインスタンスを構築します。
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 void
cancelEditing(JTree tree)
現在の編集セッションを取り消します。protected void
checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
およびmouseY
がrow
の展開または折りたたみの領域にある場合、このメソッドは行の展開状態を切り替えます。protected void
completeEditing()
編集中セッションを中止するメッセージを送ります。protected void
completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
編集中セッションを中止します。protected void
completeUIInstall()
すべてのデフォルトおよびリスナーがインストールされたあとにinstallUIから呼び出されます。protected void
completeUIUninstall()
UIをアンインストールします。protected void
configureLayoutCache()
Look & Feelを提供しているツリーに基づいてTreeStateのインスタンスをリセットします。protected CellEditorListener
createCellEditorListener()
現在のエディタからのイベントを処理するリスナーを作成します。protected CellRendererPane
createCellRendererPane()
レンダラ・コンポーネントが配置されているレンダラ・ペインを返します。protected ComponentListener
createComponentListener()
新しいComponentHandlerを作成し、それを返します。protected TreeCellEditor
createDefaultCellEditor()
デフォルトのセル・エディタを作成します。protected TreeCellRenderer
createDefaultCellRenderer()
各ノードをスタンプするために使われるデフォルトのセル・レンダラを返します。protected FocusListener
createFocusListener()
フォーカスを喪失または取得したときに表示を更新するリスナーを作成します。protected KeyListener
createKeyListener()
ツリーからキー・イベントを取得するリスナーを作成します。protected AbstractLayoutCache
createLayoutCache()
何が展開されているかおよびノードのサイズを管理するオブジェクトを作成します。protected MouseListener
createMouseListener()
マウス・イベントに基づいて選択を更新するリスナーを作成します。protected AbstractLayoutCache.NodeDimensions
createNodeDimensions()
ツリー内の指定されたノードのサイズを決定できるNodeDimensions
のインスタンスを作成します。protected PropertyChangeListener
createPropertyChangeListener()
ツリーの変更に基づいてUIを更新するリスナーを作成します。protected PropertyChangeListener
createSelectionModelPropertyChangeListener()
選択モデルからプロパティ変更イベントを取得するリスナーを作成します。protected TreeExpansionListener
createTreeExpansionListener()
ノードの展開状態が変更されたときにツリーの状態を更新するオブジェクトを作成し、それを返します。protected TreeModelListener
createTreeModelListener()
モデルが変更されたときにツリーを更新できるリスナーを返します。protected TreeSelectionListener
createTreeSelectionListener()
選択変更メソッドに基づいて表示を更新するリスナーを作成します。static ComponentUI
createUI(JComponent x)
BasicTreeUI
の新しいインスタンスを構築します。protected void
drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
(x,y)を中心とするicon
を描画します。protected void
drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
水平の破線を描画します。protected void
drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
垂直の破線を描画します。protected void
ensureRowsAreVisible(int beginRow, int endRow)
beginRow
〜endRow
によって識別される行が確実に表示されるようにします。int
getBaseline(JComponent c, int width, int height)
ベースラインを返します。Component.BaselineResizeBehavior
getBaselineResizeBehavior(JComponent c)
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。protected TreeCellEditor
getCellEditor()
TreeCellEditor
のインスタンスを返します。protected TreeCellRenderer
getCellRenderer()
currentCellRenderer
を返します。これはツリー・レンダラか、defaultCellRenderer
です。これはnullではありません。TreePath
getClosestPathForLocation(JTree tree, int x, int y)
x、yにもっとも近いノードへのパスを返します。Icon
getCollapsedIcon()
折りたたまれたアイコンを返します。protected Rectangle
getDropLineRect(JTree.DropLocation loc)
ドロップ・ラインのアンバウンディング・ボックスを返します。TreePath
getEditingPath(JTree tree)
編集中の要素へのパスを返します。Icon
getExpandedIcon()
展開されたアイコンを返します。protected Color
getHashColor()
ハッシュの色を返します。protected int
getHorizontalLegBuffer()
ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。protected TreePath
getLastChildPath(TreePath parent)
parent
の最後の子のパスを返します。protected int
getLeadSelectionRow()
選択のリード行を返します。int
getLeftChildIndent()
左の子インデントを返します。Dimension
getMaximumSize(JComponent c)
このコンポーネントの最大サイズを返します。インスタンスが現在JTreeにある場合は推奨サイズ、そうでない場合は0, 0です。Dimension
getMinimumSize(JComponent c)
このコンポーネントの最小サイズを返します。protected TreeModel
getModel()
ツリー・モデルを返します。Rectangle
getPathBounds(JTree tree, TreePath path)
パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。TreePath
getPathForRow(JTree tree, int row)
渡されたrowのパスを返します。Dimension
getPreferredMinSize()
推奨される最小サイズを返します。Dimension
getPreferredSize(JComponent c)
ツリーを適切に表示するための優先サイズを返します。これはgetPreferredSize(c, true)
のカバー・メソッドです。Dimension
getPreferredSize(JComponent c, boolean checkConsistency)
cでツリーを表すための推奨サイズを返します。int
getRightChildIndent()
右の子インデントを返します。int
getRowCount(JTree tree)
表示されている行数を返します。int
getRowForPath(JTree tree, TreePath path)
pathで識別される最後の項目が可視である行を返します。protected int
getRowHeight()
行の高さを返します。protected int
getRowX(int row, int depth)
x軸に沿って特定の行をレンダリングする位置を返します。protected TreeSelectionModel
getSelectionModel()
ツリー選択モデルを返します。protected boolean
getShowsRootHandles()
ルート・ハンドルが表示される場合はtrue
を返します。protected int
getVerticalLegBuffer()
ノード間の脚の垂直要素は、デフォルトでは親ノードの下端から始まります。protected void
handleExpandControlClick(TreePath path, int mouseX, int mouseY)
ユーザーが特定の行をクリックするとメッセージが送られ、toggleExpandState
が呼び出されます。protected void
installComponents()
レンダラ・ペインである、ツリーのサブコンポーネントをインストールします。protected void
installDefaults()
デフォルトのプロパティをインストールします。protected void
installKeyboardActions()
キーボード操作を登録します。protected void
installListeners()
リスナーを登録します。protected boolean
isDropLine(JTree.DropLocation loc)
DropLocation
をノード間のラインによって示すかどうかを通知します。protected boolean
isEditable()
ツリーが編集可能な場合はtrue
を返します。boolean
isEditing(JTree tree)
ツリーが編集中の場合にtrueを返します。protected boolean
isLargeModel()
大きなモデルが設定されている場合、true
を返します。protected boolean
isLeaf(int row)
row
のノードがリーフの場合、true
を返します。protected boolean
isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
とmouseY
が、ノードを展開/折りたたむために使用される行の領域に入る場合はtrue
を返し、row
のノードはリーフを表しません。protected boolean
isMultiSelectEvent(MouseEvent event)
true
を返すと、ノード上のマウス・イベントがアンカー・ポイントから選択されることを意味します。protected boolean
isRootVisible()
ツリー・ルートが表示されている場合はtrue
を返します。protected boolean
isToggleEvent(MouseEvent event)
true
を返すと、マウスの下の行がイベントに基づいてトグルされるべきであることが示されます。protected boolean
isToggleSelectionEvent(MouseEvent event)
true
を返すと、ノード上のマウス・イベントは、マウスの下の行のみの選択を切り替える必要があることを示します。protected void
paintDropLine(Graphics g)
ドロップ・ラインをペイントします。protected void
paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
行の展開(切り替え)部分をペイントします。protected void
paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
水平線をペイントします。protected void
paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
脚の水平部分をペイントします。protected void
paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
行のレンダラ部分をペイントします。protected void
paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
垂直線をペイントします。protected void
paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
脚の垂直部分をペイントします。protected void
pathWasCollapsed(TreePath path)
VisibleTreeNode
から折りたたまれた後にメッセージが送られます。protected void
pathWasExpanded(TreePath path)
VisibleTreeNode
から展開された後にメッセージが送られます。protected void
prepareForUIInstall()
tree
インスタンス変数の設定後、デフォルトおよびリスナーがインストールされる前に呼び出されます。protected void
prepareForUIUninstall()
UIをアンストールする前に呼び出されます。protected void
selectPathForEvent(TreePath path, MouseEvent event)
特定の行のMouseEvent
に基づいて選択を更新するようにメッセージを送りました。protected void
setCellEditor(TreeCellEditor editor)
セル・エディタを設定します。protected void
setCellRenderer(TreeCellRenderer tcr)
TreeCellRenderer
をtcr
に設定します。void
setCollapsedIcon(Icon newG)
折りたたまれたアイコンを設定します。protected void
setEditable(boolean newValue)
レシーバが編集を許可するかどうかを設定します。void
setExpandedIcon(Icon newG)
展開されたアイコンを設定します。protected void
setHashColor(Color color)
ハッシュ・カラーを設定します。protected void
setLargeModel(boolean largeModel)
必要な場合に、componentListenerを更新します。void
setLeftChildIndent(int newAmount)
左の子インデントを設定します。protected void
setModel(TreeModel model)
TreeModel
を設定します。void
setPreferredMinSize(Dimension newSize)
推奨される最小サイズを設定します。void
setRightChildIndent(int newAmount)
右の子インデントを設定します。protected void
setRootVisible(boolean newValue)
ルートを可視に設定します。protected void
setRowHeight(int rowHeight)
treeStateに転送される、行の高さを設定します。protected void
setSelectionModel(TreeSelectionModel newLSM)
選択モデルをリセットします。protected void
setShowsRootHandles(boolean newValue)
ノードのハンドルが表示されるかどうかを決めます。protected boolean
shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
(toggle)コントロールを展開して指定された行に描画する必要がある場合は、true
を返します。protected boolean
startEditing(TreePath path, MouseEvent event)
cellEditor
があり、shouldSelectCell
がtrue
を返した場合、ノードの編集を開始します。void
startEditingAtPath(JTree tree, TreePath path)
pathの最後の項目を選択し、その項目の編集を試みます。boolean
stopEditing(JTree tree)
現在の編集セッションを中止します。protected void
toggleExpandState(TreePath path)
パスが展開されてない場合は展開し、行が展開されている場合は折りたたみます。protected void
uninstallComponents()
レンダラ・ペインをアンインストールします。protected void
uninstallDefaults()
既定のプロパティをアンインストールします。protected void
uninstallKeyboardActions()
キーボード操作の登録を解除します。protected void
uninstallListeners()
リスナーを登録解除します。protected void
updateCachedPreferredSize()
getPreferredSize()
から返されるpreferredSize
インスタンス変数を更新します。protected void
updateCellEditor()
現在含まれているJTreeが編集できるかどうかに応じてcellEditorを更新します。protected void
updateDepthOffset()
各深さをどのくらいオフセットするべきかを更新します。protected void
updateExpandedDescendants(TreePath path)
ツリーから展開されている子孫を取得し、ツリー状態に転送することで、path
のすべての子孫の展開状態を更新します。protected void
updateLayoutCacheExpandedNodes()
JTreeで展開されているすべてのノードをLayoutCacheで展開します。protected void
updateLeadSelectionRow()
選択のリード行を更新します。protected void
updateRenderer()
レンダラが変更されたときにツリーからメッセージとして送られます。protected void
updateSize()
キャッシュされているサイズを無効とマークし、treeDidChange
でメッセージをツリーに送ります。-
クラス javax.swing.plaf.ComponentUIで宣言されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, installUI, paint, uninstallUI, update
-
-
-
-
フィールドの詳細
-
collapsedIcon
protected transient Icon collapsedIcon
折りたたまれたアイコン。
-
expandedIcon
protected transient Icon expandedIcon
展開されたアイコン。
-
leftChildIndent
protected int leftChildIndent
左マージンと垂直の破線が描画される位置の間の距離です。
-
rightChildIndent
protected int rightChildIndent
セルの内容が描画される位置を決定するためにleftChildIndentに加算される距離です。
-
totalChildIndent
protected int totalChildIndent
インデントされる総距離です。 leftChildIndentとrightChildIndentの合計です。
-
preferredMinSize
protected Dimension preferredMinSize
推奨される最小サイズです。
-
lastSelectedRow
protected int lastSelectedRow
最後に選択された行のインデックスです。
-
tree
protected JTree tree
描画先のコンポーネントです。
-
currentCellRenderer
protected transient TreeCellRenderer currentCellRenderer
実際のセルの描画を行うために使われているレンダラです。
-
createdRenderer
protected boolean createdRenderer
現在ツリーにあるレンダラがこのインスタンスによって作成された場合にtrueに設定されます。
-
cellEditor
protected transient TreeCellEditor cellEditor
ツリーのエディタです。
-
createdCellEditor
protected boolean createdCellEditor
現在ツリーにあるエディタがこのインスタンスによって作成された場合にtrueに設定されます。
-
stopEditingInCompleteEditing
protected boolean stopEditingInCompleteEditing
編集時に、shouldSelectCell()がtrueを返した場合にfalseに設定されます。これは、completeEditingで使用され、ノードが編集前に選択されなければならないことを意味しています。
-
rendererPane
protected CellRendererPane rendererPane
TreeCellRendererをペイントするために使われます。
-
preferredSize
protected Dimension preferredSize
すべてのノードを完全に表示するために必要なサイズです。
-
validCachedPreferredSize
protected boolean validCachedPreferredSize
preferredSizeが有効かどうかを示します。
-
treeState
protected AbstractLayoutCache treeState
サイズ変更や展開されているかどうかを処理するオブジェクトです。
-
largeModel
protected boolean largeModel
largeModelの最適化を行なっている場合はtrueです。 これをサポートしないサブクラスは、FixedHeightLayoutCacheのインスタンスを返さないようにcreateLayoutCacheをオーバーライドすることをお勧めします。
-
nodeDimensions
protected AbstractLayoutCache.NodeDimensions nodeDimensions
TreeStateに対しノードに必要なサイズを通知します。
-
treeModel
protected TreeModel treeModel
何を表示するかを決定するために使われます。
-
treeSelectionModel
protected TreeSelectionModel treeSelectionModel
選択を維持するモデルです。
-
depthOffset
protected int depthOffset
x位置を正確に計算するための深さのオフセットの量です。 これは、ルートが可視かどうか、ルート・ハンドルが可視どうかによって決まります。
-
editingComponent
protected Component editingComponent
これは編集時に、実際の編集を行うComponentになります。
-
editingPath
protected TreePath editingPath
編集中のパスです。
-
editingRow
protected int editingRow
編集中の行です。 editingComponentがnullではない場合だけ参照されます。
-
editorHasDifferentSize
protected boolean editorHasDifferentSize
エディタのサイズがレンダラと異なる場合にtrueに設定されます。
-
-
メソッドの詳細
-
createUI
public static ComponentUI createUI(JComponent x)
BasicTreeUI
の新しいインスタンスを構築します。- パラメータ:
x
- コンポーネント- 戻り値:
BasicTreeUI
の新しいインスタンス
-
getHashColor
protected Color getHashColor()
ハッシュの色を返します。- 戻り値:
- ハッシュ・カラー
-
setHashColor
protected void setHashColor(Color color)
ハッシュ・カラーを設定します。- パラメータ:
color
- ハッシュ・カラー
-
setLeftChildIndent
public void setLeftChildIndent(int newAmount)
左の子インデントを設定します。- パラメータ:
newAmount
- 左の子インデント
-
getLeftChildIndent
public int getLeftChildIndent()
左の子インデントを返します。- 戻り値:
- 左の子インデント
-
setRightChildIndent
public void setRightChildIndent(int newAmount)
右の子インデントを設定します。- パラメータ:
newAmount
- 右の子インデント
-
getRightChildIndent
public int getRightChildIndent()
右の子インデントを返します。- 戻り値:
- 右の子インデント
-
setExpandedIcon
public void setExpandedIcon(Icon newG)
展開されたアイコンを設定します。- パラメータ:
newG
- 展開されたアイコン
-
getExpandedIcon
public Icon getExpandedIcon()
展開されたアイコンを返します。- 戻り値:
- 展開されたアイコン
-
setCollapsedIcon
public void setCollapsedIcon(Icon newG)
折りたたまれたアイコンを設定します。- パラメータ:
newG
- 折りたたまれたアイコン
-
getCollapsedIcon
public Icon getCollapsedIcon()
折りたたまれたアイコンを返します。- 戻り値:
- 折りたたまれたアイコン
-
setLargeModel
protected void setLargeModel(boolean largeModel)
必要な場合に、componentListenerを更新します。- パラメータ:
largeModel
- 新しい価値
-
isLargeModel
protected boolean isLargeModel()
大きなモデルが設定されている場合、true
を返します。- 戻り値:
- 大型モデルが設定されている場合は
true
-
setRowHeight
protected void setRowHeight(int rowHeight)
treeStateに転送される、行の高さを設定します。- パラメータ:
rowHeight
- 行の高さ
-
getRowHeight
protected int getRowHeight()
行の高さを返します。- 戻り値:
- 行の高さ
-
setCellRenderer
protected void setCellRenderer(TreeCellRenderer tcr)
TreeCellRenderer
をtcr
に設定します。 これにより、updateRenderer
が呼び出されます。- パラメータ:
tcr
- 新しい価値
-
getCellRenderer
protected TreeCellRenderer getCellRenderer()
currentCellRenderer
を返します。これはツリー・レンダラか、defaultCellRenderer
です。これはnullではありません。- 戻り値:
TreeCellRenderer
のインスタンス
-
setModel
protected void setModel(TreeModel model)
TreeModel
を設定します。- パラメータ:
model
- 新しい価値
-
getModel
protected TreeModel getModel()
ツリー・モデルを返します。- 戻り値:
- ツリー・モデル
-
setRootVisible
protected void setRootVisible(boolean newValue)
ルートを可視に設定します。- パラメータ:
newValue
- 新しい値
-
isRootVisible
protected boolean isRootVisible()
ツリー・ルートが表示されている場合はtrue
を返します。- 戻り値:
true
、ツリー・ルートが表示されている場合
-
setShowsRootHandles
protected void setShowsRootHandles(boolean newValue)
ノードのハンドルが表示されるかどうかを決めます。- パラメータ:
newValue
- 新しい値
-
getShowsRootHandles
protected boolean getShowsRootHandles()
ルート・ハンドルが表示される場合はtrue
を返します。- 戻り値:
- ルート・ハンドルが表示される場合は
true
-
setCellEditor
protected void setCellEditor(TreeCellEditor editor)
セル・エディタを設定します。- パラメータ:
editor
- 新しいセル・エディタ
-
getCellEditor
protected TreeCellEditor getCellEditor()
TreeCellEditor
のインスタンスを返します。- 戻り値:
TreeCellEditor
のインスタンス
-
setEditable
protected void setEditable(boolean newValue)
レシーバが編集を許可するかどうかを設定します。- パラメータ:
newValue
- 新しい値
-
isEditable
protected boolean isEditable()
ツリーが編集可能な場合はtrue
を返します。- 戻り値:
- ツリーが編集可能な場合は
true
-
setSelectionModel
protected void setSelectionModel(TreeSelectionModel newLSM)
選択モデルをリセットします。 適切なリスナーがモデルでインストールされます。- パラメータ:
newLSM
- 新しい選択モデル
-
getSelectionModel
protected TreeSelectionModel getSelectionModel()
ツリー選択モデルを返します。- 戻り値:
- ツリー選択モデル
-
getPathBounds
public Rectangle getPathBounds(JTree tree, TreePath path)
パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。 パスのコンポーネントのどれかが現在有効な場合は、nullが返されます。- 定義:
getPathBounds
、クラスTreeUI
- パラメータ:
tree
-path
のJTree
path
- ノードを識別するTreePath
- 戻り値:
- パスの最後のアイテムが描画されるラベル部分を囲む
Rectangle
、パス内のコンポーネントが現在有効な場合はnull
。
-
getPathForRow
public TreePath getPathForRow(JTree tree, int row)
渡されたrowのパスを返します。 rowが可視でない場合は、nullが返されます。- 定義:
getPathForRow
、クラスTreeUI
- パラメータ:
tree
-JTree
オブジェクトrow
- 行を指定する整数- 戻り値:
row
が表示されない場合はrow
またはnull
のpath
-
getRowForPath
public int getRowForPath(JTree tree, TreePath path)
pathで識別される最後の項目が可視である行を返します。 path内のどの要素も現在は可視でない場合は、-1を返します。- 定義:
getRowForPath
、クラスTreeUI
- パラメータ:
tree
-path
のJTree
path
- 見るTreePath
オブジェクト- 戻り値:
path
の要素のどれかが現在可視でない場合は -1を返します。
-
getRowCount
public int getRowCount(JTree tree)
表示されている行数を返します。- 定義:
getRowCount
、クラスTreeUI
- パラメータ:
tree
- 行数をカウントするJTree
- 戻り値:
- 表示されている行の数を指定する整数
-
getClosestPathForLocation
public TreePath getClosestPathForLocation(JTree tree, int x, int y)
x、yにもっとも近いノードへのパスを返します。 現在可視のものがない場合は、nullを返します。そうでない場合は、常に有効なパスを返します。 返されたオブジェクトが正確にx, yにあるかどうかを判定する必要がある場合は、返されたパスの矩形を取得して、x, yと比較するようにしてください。- 定義:
getClosestPathForLocation
、クラスTreeUI
- パラメータ:
tree
-JTree
オブジェクトx
- 表示領域の左端から水平方向にピクセル数を与える整数。y
- 表示領域の上端からの垂直距離をピクセル単位で示す整数値(上マージンは除く)- 戻り値:
- 現在表示されているものがない場合は、
x,y
またはnull
に最も近いTreePath
ノード
-
isEditing
public boolean isEditing(JTree tree)
ツリーが編集中の場合にtrueを返します。 編集中の項目を取得するには、getEditingPath()を使います。
-
stopEditing
public boolean stopEditing(JTree tree)
現在の編集セッションを中止します。 ツリーが編集中でない場合は、このメソッドは何も行いません。 エディタが編集セッションの中止を許可した場合は、trueを返します。- 定義:
stopEditing
、クラスTreeUI
- パラメータ:
tree
-JTree
オブジェクト- 戻り値:
- エディタが編集セッションを停止できる場合はtrue
-
cancelEditing
public void cancelEditing(JTree tree)
現在の編集セッションを取り消します。- 定義:
cancelEditing
、クラスTreeUI
- パラメータ:
tree
-JTree
オブジェクト
-
startEditingAtPath
public void startEditingAtPath(JTree tree, TreePath path)
pathの最後の項目を選択し、その項目の編集を試みます。 CellEditorが選択された項目の編集を許可しない場合、編集は失敗します。- 定義:
startEditingAtPath
、クラスTreeUI
- パラメータ:
tree
- 編集中のJTree
path
- 編集するTreePath
-
getEditingPath
public TreePath getEditingPath(JTree tree)
編集中の要素へのパスを返します。- 定義:
getEditingPath
、クラスTreeUI
- パラメータ:
tree
- パスを返すJTree
- 戻り値:
tree
へのパスを含むTreePath
-
prepareForUIInstall
protected void prepareForUIInstall()
tree
インスタンス変数の設定後、デフォルトおよびリスナーがインストールされる前に呼び出されます。
-
completeUIInstall
protected void completeUIInstall()
すべてのデフォルトおよびリスナーがインストールされたあとにinstallUIから呼び出されます。
-
installDefaults
protected void installDefaults()
デフォルトのプロパティをインストールします。
-
installListeners
protected void installListeners()
リスナーを登録します。
-
installKeyboardActions
protected void installKeyboardActions()
キーボード操作を登録します。
-
installComponents
protected void installComponents()
レンダラ・ペインである、ツリーのサブコンポーネントをインストールします。
-
createNodeDimensions
protected AbstractLayoutCache.NodeDimensions createNodeDimensions()
ツリー内の指定されたノードのサイズを決定できるNodeDimensions
のインスタンスを作成します。- 戻り値:
NodeDimensions
のインスタンス
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
ツリーの変更に基づいてUIを更新するリスナーを作成します。- 戻り値:
PropertyChangeListener
のインスタンス
-
createMouseListener
protected MouseListener createMouseListener()
マウス・イベントに基づいて選択を更新するリスナーを作成します。- 戻り値:
MouseListener
のインスタンス
-
createFocusListener
protected FocusListener createFocusListener()
フォーカスを喪失または取得したときに表示を更新するリスナーを作成します。- 戻り値:
FocusListener
のインスタンス
-
createKeyListener
protected KeyListener createKeyListener()
ツリーからキー・イベントを取得するリスナーを作成します。- 戻り値:
KeyListener
のインスタンス
-
createSelectionModelPropertyChangeListener
protected PropertyChangeListener createSelectionModelPropertyChangeListener()
選択モデルからプロパティ変更イベントを取得するリスナーを作成します。- 戻り値:
PropertyChangeListener
のインスタンス
-
createTreeSelectionListener
protected TreeSelectionListener createTreeSelectionListener()
選択変更メソッドに基づいて表示を更新するリスナーを作成します。- 戻り値:
TreeSelectionListener
のインスタンス
-
createCellEditorListener
protected CellEditorListener createCellEditorListener()
現在のエディタからのイベントを処理するリスナーを作成します。- 戻り値:
CellEditorListener
のインスタンス
-
createComponentListener
protected ComponentListener createComponentListener()
新しいComponentHandlerを作成し、それを返します。 これは、大きなモデルで、コンポーネントが移動したときにvalidCachedPreferredSizeを無効にするために使用されます。- 戻り値:
ComponentListener
のインスタンス
-
createTreeExpansionListener
protected TreeExpansionListener createTreeExpansionListener()
ノードの展開状態が変更されたときにツリーの状態を更新するオブジェクトを作成し、それを返します。- 戻り値:
TreeExpansionListener
のインスタンス
-
createLayoutCache
protected AbstractLayoutCache createLayoutCache()
何が展開されているかおよびノードのサイズを管理するオブジェクトを作成します。- 戻り値:
- 拡張されたものを管理するオブジェクト
-
createCellRendererPane
protected CellRendererPane createCellRendererPane()
レンダラ・コンポーネントが配置されているレンダラ・ペインを返します。- 戻り値:
CellRendererPane
のインスタンス
-
createDefaultCellEditor
protected TreeCellEditor createDefaultCellEditor()
デフォルトのセル・エディタを作成します。- 戻り値:
- デフォルトのセル・エディタ
-
createDefaultCellRenderer
protected TreeCellRenderer createDefaultCellRenderer()
各ノードをスタンプするために使われるデフォルトのセル・レンダラを返します。- 戻り値:
TreeCellRenderer
のインスタンス
-
createTreeModelListener
protected TreeModelListener createTreeModelListener()
モデルが変更されたときにツリーを更新できるリスナーを返します。- 戻り値:
TreeModelListener
のインスタンス。
-
prepareForUIUninstall
protected void prepareForUIUninstall()
UIをアンストールする前に呼び出されます。
-
completeUIUninstall
protected void completeUIUninstall()
UIをアンインストールします。
-
uninstallDefaults
protected void uninstallDefaults()
既定のプロパティをアンインストールします。
-
uninstallListeners
protected void uninstallListeners()
リスナーを登録解除します。
-
uninstallKeyboardActions
protected void uninstallKeyboardActions()
キーボード操作の登録を解除します。
-
uninstallComponents
protected void uninstallComponents()
レンダラ・ペインをアンインストールします。
-
getBaseline
public int getBaseline(JComponent c, int width, int height)
ベースラインを返します。- オーバーライド:
getBaseline
、クラスComponentUI
- パラメータ:
c
- ベースラインが要求されるJComponent
width
- ベースラインを取得する幅height
- ベースラインを取得する高さ- 戻り値:
- ベースラインまたは0より小さい値(適切なベースラインがないことを示す)
- 例外:
NullPointerException
-c
がnull
である場合IllegalArgumentException
- 幅または高さが0より小さい場合- 導入されたバージョン:
- 1.6
- 関連項目:
JComponent.getBaseline(int, int)
-
getBaselineResizeBehavior
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。- オーバーライド:
getBaselineResizeBehavior
、クラスComponentUI
- パラメータ:
c
- ベースラインのサイズ変更の動作を返すJComponent
- 戻り値:
- コンポーネント・サイズの変化に合わせてベースラインがどのように変化するかを示す列挙
- 例外:
NullPointerException
-c
がnull
である場合- 導入されたバージョン:
- 1.6
- 関連項目:
JComponent.getBaseline(int, int)
-
isDropLine
protected boolean isDropLine(JTree.DropLocation loc)
DropLocation
をノード間のラインによって示すかどうかを通知します。 これはjavax.swing.DropMode.INSERT
およびjavax.swing.DropMode.ON_OR_INSERT
ドロップ・モードで使用されます。- パラメータ:
loc
-DropLocation
- 戻り値:
- ドロップ位置をラインとして示す場合は
true
- 導入されたバージョン:
- 1.7
-
paintDropLine
protected void paintDropLine(Graphics g)
ドロップ・ラインをペイントします。- パラメータ:
g
- 描画するGraphics
オブジェクト- 導入されたバージョン:
- 1.7
-
getDropLineRect
protected Rectangle getDropLineRect(JTree.DropLocation loc)
ドロップ・ラインのアンバウンディング・ボックスを返します。- パラメータ:
loc
-DropLocation
- 戻り値:
- ドロップ・ラインのバウンディング・ボックス
- 導入されたバージョン:
- 1.7
-
paintHorizontalPartOfLeg
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
脚の水平部分をペイントします。 レシーバは、clipBounds
やinsets
を変更しないでください。ノート: ルートが可視でない場合、
parentRow
は -1になることがあります。- パラメータ:
g
- グラフィックス・コンテキストclipBounds
- クリップされた矩形insets
- insetsbounds
- 外接する矩形path
- ツリー・パスrow
- 行isExpanded
- パスが展開されている場合はtrue
hasBeenExpanded
- パスが展開されている場合はtrue
isLeaf
- パスがリーフの場合はtrue
-
paintVerticalPartOfLeg
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
脚の垂直部分をペイントします。 レシーバは、clipBounds
やinsets
を変更しないでください。- パラメータ:
g
- グラフィックス・コンテキストclipBounds
- クリップされた矩形insets
- insetspath
- ツリー・パス
-
paintExpandControl
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
行の展開(切り替え)部分をペイントします。 レシーバは、clipBounds
やinsets
を変更しないでください。- パラメータ:
g
- グラフィックス・コンテキストclipBounds
- クリップされた矩形insets
- insetsbounds
- 外接する矩形path
- ツリー・パスrow
- 行isExpanded
- パスが展開されている場合はtrue
hasBeenExpanded
- パスが展開されている場合はtrue
isLeaf
- 行がリーフの場合はtrue
-
paintRow
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
行のレンダラ部分をペイントします。 レシーバは、clipBounds
やinsets
を変更しないでください。- パラメータ:
g
- グラフィックス・コンテキストclipBounds
- クリップされた矩形insets
- insetsbounds
- 外接する矩形path
- ツリー・パスrow
- 行isExpanded
- パスが展開されている場合はtrue
hasBeenExpanded
- パスが展開されている場合はtrue
isLeaf
- パスがリーフの場合はtrue
-
shouldPaintExpandControl
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
(toggle)コントロールを展開して指定された行に描画する必要がある場合は、true
を返します。- パラメータ:
path
- ツリー・パスrow
- 行isExpanded
- パスが展開されている場合はtrue
hasBeenExpanded
- パスが展開されている場合はtrue
isLeaf
- 行がリーフの場合はtrue
- 戻り値:
- 指定された行の(toggle)コントロールを展開する必要がある場合は
true
-
paintVerticalLine
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
垂直線をペイントします。- パラメータ:
g
- グラフィックス・コンテキストc
- コンポーネントx
- X座標top
- Y1座標bottom
- Y2座標
-
paintHorizontalLine
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
水平線をペイントします。- パラメータ:
g
- グラフィックス・コンテキストc
- コンポーネントy
- Y座標left
- X1座標right
- X2座標
-
getVerticalLegBuffer
protected int getVerticalLegBuffer()
ノード間の脚の垂直要素は、デフォルトでは親ノードの下端から始まります。 このメソッドは、脚がそれより下で始まるようにします。- 戻り値:
- 垂直バッファ
-
getHorizontalLegBuffer
protected int getHorizontalLegBuffer()
ノード間の脚の水平要素は、デフォルトでは子ノードの左側の右で始まります。 このメソッドは、脚がそれより前で終わるようにします。- 戻り値:
- 水平バッファ
-
drawCentered
protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
(x,y)を中心とするicon
を描画します。- パラメータ:
c
- コンポーネントgraphics
- グラフィックス・コンテキストicon
- アイコンx
- X座標y
- Y座標
-
drawDashedHorizontalLine
protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
水平の破線を描画します。x1
<=x2
とします。x1
がx2
より大きい場合、このメソッドは何も描画しません。- パラメータ:
g
-Graphics
のインスタンスy
- Y座標x1
- X1座標x2
- X2座標
-
drawDashedVerticalLine
protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
垂直の破線を描画します。y1
<=y2
とします。y1
がy2
より大きい場合、このメソッドは何も描画しません。- パラメータ:
g
-Graphics
のインスタンスx
- X座標y1
- Y1座標y2
- Y2座標
-
getRowX
protected int getRowX(int row, int depth)
x軸に沿って特定の行をレンダリングする位置を返します。 戻り値には、JTreeで指定されたイン・セット値は一切含まれません。 このメソッドでは、行または深さの有効性は確認しないため、行または深さがツリーのそれと一致しない場合でも、正しいと見なされて、例外をスローしません。- パラメータ:
row
- x位置を返す行depth
- 行の深さ- 戻り値:
- 指定された行をインデントする量。
- 導入されたバージョン:
- 1.5
-
updateLayoutCacheExpandedNodes
protected void updateLayoutCacheExpandedNodes()
JTreeで展開されているすべてのノードをLayoutCacheで展開します。 これにより、ルート・パスでupdateExpandedDescendantsが呼び出されます。
-
updateExpandedDescendants
protected void updateExpandedDescendants(TreePath path)
ツリーから展開されている子孫を取得し、ツリー状態に転送することで、path
のすべての子孫の展開状態を更新します。- パラメータ:
path
- ツリー・パス
-
getLastChildPath
protected TreePath getLastChildPath(TreePath parent)
parent
の最後の子のパスを返します。- パラメータ:
parent
- ツリー・パス- 戻り値:
parent
の最後の子へのパス
-
updateDepthOffset
protected void updateDepthOffset()
各深さをどのくらいオフセットするべきかを更新します。
-
updateCellEditor
protected void updateCellEditor()
JTreeが編集できるかどうかに応じてcellEditorを更新します。 ツリーが編集できるが、cellEditorがない場合、基本的なセル・エディタが使われます。
-
updateRenderer
protected void updateRenderer()
レンダラが変更されたときにツリーからメッセージとして送られます。
-
configureLayoutCache
protected void configureLayoutCache()
Look & Feelを提供しているツリーに基づいてTreeStateのインスタンスをリセットします。
-
updateSize
protected void updateSize()
キャッシュされているサイズを無効とマークし、treeDidChange
でメッセージをツリーに送ります。
-
updateCachedPreferredSize
protected void updateCachedPreferredSize()
getPreferredSize()
から返されるpreferredSize
インスタンス変数を更新します。左から右方向の場合、サイズは現在のAbstractLayoutCacheから決定されます。 右から左方向の場合、推奨サイズは幅から最小のx位置を引いた値になります。
-
pathWasExpanded
protected void pathWasExpanded(TreePath path)
VisibleTreeNode
から展開された後にメッセージが送られます。- パラメータ:
path
- ツリー・パス
-
pathWasCollapsed
protected void pathWasCollapsed(TreePath path)
VisibleTreeNode
から折りたたまれた後にメッセージが送られます。- パラメータ:
path
- ツリー・パス
-
ensureRowsAreVisible
protected void ensureRowsAreVisible(int beginRow, int endRow)
beginRow
〜endRow
によって識別される行が確実に表示されるようにします。- パラメータ:
beginRow
- 開始行endRow
- 最後の行
-
setPreferredMinSize
public void setPreferredMinSize(Dimension newSize)
推奨される最小サイズを設定します。- パラメータ:
newSize
- 新しい優先サイズ
-
getPreferredMinSize
public Dimension getPreferredMinSize()
推奨される最小サイズを返します。- 戻り値:
- 最小優先サイズ
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
ツリーを適切に表示するための優先サイズを返します。これはgetPreferredSize(c, true)
のカバー・メソッドです。- オーバーライド:
getPreferredSize
、クラスComponentUI
- パラメータ:
c
- コンポーネント- 戻り値:
- コンポーネント内のツリーを表すのに優先されるサイズ
- 関連項目:
JComponent.getPreferredSize()
,LayoutManager.preferredLayoutSize(java.awt.Container)
-
getPreferredSize
public Dimension getPreferredSize(JComponent c, boolean checkConsistency)
cでツリーを表すための推奨サイズを返します。 checkConsistencyがtrue
の場合、checkConsistencyが最初に送信されます。- パラメータ:
c
- コンポーネントcheckConsistency
-true
の整合性がチェックされている場合- 戻り値:
- コンポーネント内のツリーを表すのに優先されるサイズ
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
このコンポーネントの最小サイズを返します。 推奨される最小サイズまたは0, 0になります。- オーバーライド:
getMinimumSize
、クラスComponentUI
- パラメータ:
c
- 最小サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある- 戻り値:
Dimension
オブジェクトまたはnull
- 関連項目:
JComponent.getMinimumSize()
,LayoutManager.minimumLayoutSize(java.awt.Container)
,ComponentUI.getPreferredSize(javax.swing.JComponent)
-
getMaximumSize
public Dimension getMaximumSize(JComponent c)
このコンポーネントの最大サイズを返します。インスタンスが現在JTreeにある場合は推奨サイズ、そうでない場合は0, 0です。- オーバーライド:
getMaximumSize
、クラスComponentUI
- パラメータ:
c
- 最大サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある- 戻り値:
Dimension
オブジェクトまたはnull
- 関連項目:
JComponent.getMaximumSize()
,LayoutManager2.maximumLayoutSize(java.awt.Container)
-
completeEditing
protected void completeEditing()
編集中セッションを中止するメッセージを送ります。 レシーバがLook & Feelを提供しているUIがgetInvokesStopCellEditing
からtrueを返す場合、stopCellEditingが現在のエディタで呼び出されます。 次にcompleteEditingがfalseまたはtrueでメッセージとして送られます。falseは、中途の編集を取り消します。
-
completeEditing
protected void completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
編集中セッションを中止します。messageStop
がtrue
の場合、stopEditing
でエディタにメッセージが送信されます。messageCancel
がtrue
であれば、エディタはcancelEditing
でメッセージされます。messageTree
がtrue
の場合、treeModel
はvalueForPathChanged
でメッセージされます。- パラメータ:
messageStop
- 編集を中止するメッセージmessageCancel
- 編集を取消するメッセージmessageTree
- ツリーへのメッセージ
-
startEditing
protected boolean startEditing(TreePath path, MouseEvent event)
cellEditor
があり、shouldSelectCell
がtrue
を返した場合、ノードの編集を開始します。このメソッドは、パスが有効であり、可視であると見なします。
- パラメータ:
path
- ツリー・パスevent
- マウス・イベント- 戻り値:
true
編集が成功した場合
-
checkForClickInExpandControl
protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
およびmouseY
がrow
の展開または折りたたみの領域にある場合、このメソッドは行の展開状態を切り替えます。- パラメータ:
path
- ツリー・パスmouseX
- X座標mouseY
- Y座標
-
isLocationInExpandControl
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
とmouseY
が、ノードを展開/折りたたむために使用される行の領域に入る場合はtrue
を返し、row
のノードはリーフを表しません。- パラメータ:
path
- ツリー・パスmouseX
- X座標mouseY
- Y座標- 戻り値:
true
マウス・カーソルが、ノードを展開/折りたたむために使用される行の領域にあり、ノードがリーフでない場合。
-
handleExpandControlClick
protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY)
ユーザーが特定の行をクリックするとメッセージが送られ、toggleExpandState
が呼び出されます。- パラメータ:
path
- ツリー・パスmouseX
- X座標mouseY
- Y座標
-
toggleExpandState
protected void toggleExpandState(TreePath path)
パスが展開されてない場合は展開し、行が展開されている場合は折りたたみます。 パスを展開し、展開時にJTree
がスクロールすると、ensureRowsAreVisible
が呼び出され、できるだけ多くの子をスクロールして(パスの最後の子孫にスクロールしようとします。)として表示します。- パラメータ:
path
- ツリー・パス
-
isToggleSelectionEvent
protected boolean isToggleSelectionEvent(MouseEvent event)
true
を返すと、ノード上のマウス・イベントは、マウスの下の行のみの選択を切り替える必要があることを示します。- パラメータ:
event
- マウス・イベント- 戻り値:
true
ノード上のマウス・イベントで選択項目を切り替える必要がある場合
-
isMultiSelectEvent
protected boolean isMultiSelectEvent(MouseEvent event)
true
を返すと、ノード上のマウス・イベントがアンカー・ポイントから選択されることを意味します。- パラメータ:
event
- マウス・イベント- 戻り値:
- ノード上のマウス・イベントがアンカー・ポイントから選択する必要がある場合は
true
-
isToggleEvent
protected boolean isToggleEvent(MouseEvent event)
true
を返すと、マウスの下の行がイベントに基づいてトグルされるべきであることが示されます。 これはcheckForClickInExpandControl
の後に呼び出され、ロケーションがexpand (toggle)コントロールにないことを意味します。- パラメータ:
event
- マウス・イベント- 戻り値:
true
マウスの下の行をトグルする必要がある場合
-
selectPathForEvent
protected void selectPathForEvent(TreePath path, MouseEvent event)
特定の行のMouseEvent
に基づいて選択を更新するようにメッセージを送りました。 イベントが選択切替えイベントの場合、行が選択または選択解除されます。 イベントが複数選択イベントを示す場合、選択はアンカー・ポイントから更新されます。 そうでない場合は行が選択され、イベントが切替えイベントを示す場合は行の展開または折りたたみが行われます。- パラメータ:
path
- 選択されたパスevent
- マウス・イベント
-
isLeaf
protected boolean isLeaf(int row)
row
のノードがリーフの場合、true
を返します。- パラメータ:
row
- 行- 戻り値:
row
のノードがリーフの場合はtrue
-
updateLeadSelectionRow
protected void updateLeadSelectionRow()
選択のリード行を更新します。- 導入されたバージョン:
- 1.7
-
getLeadSelectionRow
protected int getLeadSelectionRow()
選択のリード行を返します。- 戻り値:
- 選択リード行
- 導入されたバージョン:
- 1.7
-
-