クラス
javax.swing.tree.TreePathの使用
パッケージ
説明
すべてのプラットフォーム上で可能なかぎり同じように機能する「軽量」(Java共通言語)コンポーネントのセットを提供します。
Swingコンポーネントによってトリガーされるイベントを提供します。
1つのインタフェースおよび多くのabstractクラスを提供しており、Swingはプラグイン可能なLook & Feel機能を提供するためにこれらを利用します。
基本Look & Feelに従って構築されたユーザー・インタフェース・オブジェクトを提供します。
複数のLook & Feelを結合するユーザー・インタフェース・オブジェクトを提供します。
javax.swing.JTree
を処理するためのクラスとインタフェースを提供します。-
javax.swingでのTreePathの使用
修飾子と型メソッド説明JTree.getAnchorSelectionPath()
アンカーと識別されたパスを返します。JTree.getClosestPathForLocation
(int x, int y) x、yにもっとも近いノードへのパスを返します。JTree.getEditingPath()
現在編集されている要素のパスを返します。JTree.getLeadSelectionPath()
リードと識別されたパスを返します。JTree.getNextMatch
(String prefix, int startingRow, Position.Bias bias) prefixで始まる次のツリー要素へのTreePathを返します。JTree.DropLocation.getPath()
ドロップされたデータをツリー内のどこに配置するべきかを指定するパスを返します。protected TreePath[]
JTree.getPathBetweenRows
(int index0, int index1) 指定された行の間(この行を含む)のパスを返します。JTree.getPathForLocation
(int x, int y) 指定された位置にあるノードのパスを返します。JTree.getPathForRow
(int row) 指定された行のパスを返します。JTree.getSelectionPath()
選択された最初のノードのパスを返します。TreePath[]
JTree.getSelectionPaths()
選択されたすべての値のパスを返します。修飾子と型メソッド説明protected Enumeration
<TreePath> JTree.getDescendantToggledPaths
(TreePath parent) parent
の下位ノードであり、展開されているTreePaths
のEnumeration
を返します。JTree.getExpandedDescendants
(TreePath parent) 現在展開されているパスparent
の下位ノードから成るEnumeration
を返します。修飾子と型メソッド説明void
JTree.addSelectionPath
(TreePath path) 指定されたTreePath
によって識別されるノードを現在の選択に追加します。void
JTree.addSelectionPaths
(TreePath[] paths) パスの配列の各パスを現在の選択に追加します。void
JTree.EmptySelectionModel.addSelectionPaths
(TreePath[] paths) これは何も実行しないようにオーバーライドされます。EmptySelectionModel
では選択できません。void
JTree.collapsePath
(TreePath path) 指定されたパスによって識別されるノードが収納され、表示可能になるようにします。void
JTree.expandPath
(TreePath path) 指定されたパスによって識別されるノードが展開され、表示可能になるようにします。void
JTree.fireTreeCollapsed
(TreePath path) このイベント・タイプの通知対象として登録されているすべてのリスナーに通知します。void
JTree.fireTreeExpanded
(TreePath path) このイベント・タイプの通知対象として登録されているすべてのリスナーに通知します。void
JTree.fireTreeWillCollapse
(TreePath path) このイベント・タイプの通知対象として登録されているすべてのリスナーに通知します。void
JTree.fireTreeWillExpand
(TreePath path) このイベント・タイプの通知対象として登録されているすべてのリスナーに通知します。protected Enumeration
<TreePath> JTree.getDescendantToggledPaths
(TreePath parent) parent
の下位ノードであり、展開されているTreePaths
のEnumeration
を返します。JTree.getExpandedDescendants
(TreePath parent) 現在展開されているパスparent
の下位ノードから成るEnumeration
を返します。JTree.getPathBounds
(TreePath path) 指定されたノードが描画されるRectangle
を返します。int
JTree.getRowForPath
(TreePath path) 指定されたパスによって識別されるノードを表示する行を返します。boolean
JTree.hasBeenExpanded
(TreePath path) パスによって識別されるノードが今までに展開されたことがある場合にtrueを返します。boolean
JTree.isCollapsed
(TreePath path) パスによって識別される値が現在収納されている場合にtrueを返します。このメソッドは、パスにある値が現在表示されていない場合はfalseを返します。boolean
JTree.isExpanded
(TreePath path) パスによって識別されるノードが現在展開されている場合にtrueを返します。boolean
JTree.isPathEditable
(TreePath path) isEditable
を返します。boolean
JTree.isPathSelected
(TreePath path) パスによって識別される項目が現在選択されている場合にtrueを返します。boolean
パスによって識別される値が現在表示可能である場合、つまりそれがルートであるか、そのすべての親が展開されている場合にtrueを返します。void
JTree.makeVisible
(TreePath path) パスによって識別されるノードが現在表示可能であるようにします。protected boolean
JTree.removeDescendantSelectedPaths
(TreePath path, boolean includePath) path
の下位ノードである選択されたすべてのパスを削除します。void
JTree.removeSelectionPath
(TreePath path) 指定されたパスによって識別されるノードを現在の選択から削除します。void
JTree.EmptySelectionModel.removeSelectionPaths
(TreePath[] paths) これは何も実行しないようにオーバーライドされます。EmptySelectionModel
では選択できません。void
JTree.removeSelectionPaths
(TreePath[] paths) 指定されたパスによって識別されるノードを現在の選択から削除します。void
JTree.scrollPathToVisible
(TreePath path) パスにあるすべてのパス・コンポーネント(最後のパス・コンポーネントは除く)を展開し、パスによって指定されるノードが表示されるようにスクロールします。void
JTree.setAnchorSelectionPath
(TreePath newPath) アンカーと識別されたパスを設定します。protected void
JTree.setExpandedState
(TreePath path, boolean state) このJTree
の展開状態を設定します。void
JTree.setLeadSelectionPath
(TreePath newPath) リードとして識別するパスを設定します。void
JTree.setSelectionPath
(TreePath path) 指定されたパスによって識別されるノードを選択します。void
JTree.EmptySelectionModel.setSelectionPaths
(TreePath[] paths) これは何も実行しないようにオーバーライドされます。EmptySelectionModel
では選択できません。void
JTree.setSelectionPaths
(TreePath[] paths) 指定されたパスの配列によって識別されるノードを選択します。void
JTree.startEditingAtPath
(TreePath path) 指定されたパスによって識別されるノードを選択し、編集を開始します。修飾子と型メソッド説明protected void
JTree.removeDescendantToggledPaths
(Enumeration<TreePath> toRemove) toRemove
にある、展開されているTreePaths
の下位ノードを削除します。 -
javax.swing.eventでのTreePathの使用
修飾子と型フィールド説明protected TreePath
TreeSelectionEvent.newLeadSelectionPath
パスが変更されたあとのleadSelectionPathです。nullの場合もあります。protected TreePath
TreeSelectionEvent.oldLeadSelectionPath
パスが変更される前のleadSelectionPathです。nullの場合もあります。protected TreePath
TreeExpansionEvent.path
このイベントが表す値へのパスです。protected TreePath
TreeModelEvent.path
変更されたノードの親へのパスです。protected TreePath[]
TreeSelectionEvent.paths
このイベントが表すパスです。修飾子と型メソッド説明TreeSelectionEvent.getNewLeadSelectionPath()
現在のリード・パスを返します。TreeSelectionEvent.getOldLeadSelectionPath()
以前にリード・パスだったパスを返します。TreeExpansionEvent.getPath()
展開または折りたたみが行われている値へのパスを返します。TreeSelectionEvent.getPath()
最初のパス要素を返します。TreePath[]
TreeSelectionEvent.getPaths()
選択範囲で追加または削除されたパスを返します。TreeModelEvent.getTreePath()
treeStructureChangedを除くすべてのイベントに対して、変更されたノードの親を返します。修飾子コンストラクタ説明TreeExpansionEvent
(Object source, TreePath path) TreeExpansionEventオブジェクトを構築します。TreeModelEvent
(Object source, TreePath path) ノード構造が何らかの方法で変更されたときに、イベントを生成するために使用します。変更されたサブツリーのルートへのパスをTreePathオブジェクトとして指定します。TreeModelEvent
(Object source, TreePath path, int[] childIndices, Object[] children) ノードが変更、挿入、または削除されたときに、イベントを生成するために使用します。変更された項目の親へのパスをTreePathオブジェクトとして指定します。TreeSelectionEvent
(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) TreeSelectionModel
の選択の変更を表します。TreeSelectionEvent
(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) TreeSelectionModel
の選択の変更を表します。 -
javax.swing.plafでのTreePathの使用
修飾子と型メソッド説明abstract TreePath
TreeUI.getClosestPathForLocation
(JTree tree, int x, int y) x、yにもっとも近いノードへのパスを返します。abstract TreePath
TreeUI.getEditingPath
(JTree tree) 編集中の要素へのパスを返します。abstract TreePath
TreeUI.getPathForRow
(JTree tree, int row) 渡されたrowのパスを返します。修飾子と型メソッド説明abstract Rectangle
TreeUI.getPathBounds
(JTree tree, TreePath path) パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。abstract int
TreeUI.getRowForPath
(JTree tree, TreePath path) pathで識別される最後の項目が可視である行を返します。abstract void
TreeUI.startEditingAtPath
(JTree tree, TreePath path) pathの最後の項目を選択し、その項目の編集を試みます。 -
javax.swing.plaf.basicでのTreePathの使用
修飾子と型メソッド説明BasicTreeUI.getClosestPathForLocation
(JTree tree, int x, int y) x、yにもっとも近いノードへのパスを返します。BasicTreeUI.getEditingPath
(JTree tree) 編集中の要素へのパスを返します。protected TreePath
BasicTreeUI.getLastChildPath
(TreePath parent) parent
の最後の子のパスを返します。BasicTreeUI.getPathForRow
(JTree tree, int row) 渡されたrowのパスを返します。修飾子と型メソッド説明protected void
BasicTreeUI.checkForClickInExpandControl
(TreePath path, int mouseX, int mouseY) mouseX
およびmouseY
がrow
の展開または折りたたみの領域にある場合、このメソッドは行の展開状態を切り替えます。protected TreePath
BasicTreeUI.getLastChildPath
(TreePath parent) parent
の最後の子のパスを返します。BasicTreeUI.getPathBounds
(JTree tree, TreePath path) パスの最後の項目が描画されるラベル部分を囲むRectangleを返します。int
BasicTreeUI.getRowForPath
(JTree tree, TreePath path) pathで識別される最後の項目が可視である行を返します。protected void
BasicTreeUI.handleExpandControlClick
(TreePath path, int mouseX, int mouseY) ユーザーが特定の行をクリックすると、toggleExpandState
が呼び出されます。protected boolean
BasicTreeUI.isLocationInExpandControl
(TreePath path, int mouseX, int mouseY) mouseX
およびmouseY
がノードの展開/縮小に使用される行の領域にあり、row
のノードがリーフを表していない場合は、true
を返します。protected void
BasicTreeUI.paintExpandControl
(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) 行の展開(切り替え)部分をペイントします。protected void
BasicTreeUI.paintHorizontalPartOfLeg
(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) 脚の水平部分をペイントします。protected void
BasicTreeUI.paintRow
(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) 行のレンダラ部分をペイントします。protected void
BasicTreeUI.paintVerticalPartOfLeg
(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) 脚の垂直部分をペイントします。protected void
BasicTreeUI.pathWasCollapsed
(TreePath path) VisibleTreeNode
が縮小された後にメッセージを送信します。protected void
BasicTreeUI.pathWasExpanded
(TreePath path) VisibleTreeNode
が展開された後に、メッセージを送信します。protected void
BasicTreeUI.selectPathForEvent
(TreePath path, MouseEvent event) 特定の行に対するMouseEvent
に基づいて選択を更新するためにメッセージ化されます。protected boolean
BasicTreeUI.shouldPaintExpandControl
(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) 指定した行に対して展開(toggle)コントロールを描画する必要がある場合、true
を返します。protected boolean
BasicTreeUI.startEditing
(TreePath path, MouseEvent event) cellEditor
があり、shouldSelectCell
がtrue
を返した場合、ノードの編集を開始します。void
BasicTreeUI.startEditingAtPath
(JTree tree, TreePath path) pathの最後の項目を選択し、その項目の編集を試みます。protected void
BasicTreeUI.toggleExpandState
(TreePath path) パスが展開されてない場合は展開し、行が展開されている場合は折りたたみます。protected void
BasicTreeUI.updateExpandedDescendants
(TreePath path) ツリーから展開されている子孫を取得し、ツリー状態に転送することで、path
のすべての子孫の展開状態を更新します。 -
javax.swing.plaf.multiでのTreePathの使用
修飾子と型メソッド説明MultiTreeUI.getClosestPathForLocation
(JTree a, int b, int c) このオブジェクトで処理されている各UIでgetClosestPathForLocation
メソッドを呼び出します。MultiTreeUI.getEditingPath
(JTree a) このオブジェクトで処理されている各UIでgetEditingPath
メソッドを呼び出します。MultiTreeUI.getPathForRow
(JTree a, int b) このオブジェクトで処理されている各UIでgetPathForRow
メソッドを呼び出します。修飾子と型メソッド説明MultiTreeUI.getPathBounds
(JTree a, TreePath b) このオブジェクトで処理されている各UIでgetPathBounds
メソッドを呼び出します。int
MultiTreeUI.getRowForPath
(JTree a, TreePath b) このオブジェクトで処理されている各UIでgetRowForPath
メソッドを呼び出します。void
MultiTreeUI.startEditingAtPath
(JTree a, TreePath b) このオブジェクトで処理されている各UIでstartEditingAtPath
メソッドを呼び出します。 -
javax.swing.treeでのTreePathの使用
修飾子と型フィールド説明protected TreePath
DefaultTreeCellEditor.lastPath
選択された最後のパスです。protected TreePath
DefaultTreeSelectionModel.leadPath
追加された最後のパスです。protected TreePath[]
DefaultTreeSelectionModel.selection
現在選択されているパスです。修飾子と型メソッド説明DefaultTreeSelectionModel.getLeadSelectionPath()
追加された最後のパスを返します。TreeSelectionModel.getLeadSelectionPath()
追加された最後のパスを返します。TreePath.getParentPath()
親のTreePath
を返します。abstract TreePath
AbstractLayoutCache.getPathClosestTo
(int x, int y) x、yにもっとも近いノードへのパスを返します。FixedHeightLayoutCache.getPathClosestTo
(int x, int y) x、yにもっとも近いノードへのパスを返します。VariableHeightLayoutCache.getPathClosestTo
(int x, int y) x、yにもっとも近いノードへのパスを返します。abstract TreePath
AbstractLayoutCache.getPathForRow
(int row) 渡されたrowのパスを返します。FixedHeightLayoutCache.getPathForRow
(int row) 渡されたrowのパスを返します。VariableHeightLayoutCache.getPathForRow
(int row) row
のパスを返します。DefaultTreeSelectionModel.getSelectionPath()
選択範囲の先頭のパスを返します。TreeSelectionModel.getSelectionPath()
選択範囲の先頭のパスを返します。TreePath[]
DefaultTreeSelectionModel.getSelectionPaths()
選択範囲を返します。TreePath[]
TreeSelectionModel.getSelectionPaths()
選択範囲のパスを返します。TreePath.pathByAddingChild
(Object child) このパスのすべての要素に加えてchild
の要素を格納する新しいパスを返します。修飾子と型メソッド説明abstract Enumeration
<TreePath> AbstractLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumerator
を返します。FixedHeightLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumeratorを返します。VariableHeightLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumerator
を返します。修飾子と型メソッド説明void
DefaultTreeSelectionModel.addSelectionPath
(TreePath path) 現在の選択範囲にパスを追加します。void
TreeSelectionModel.addSelectionPath
(TreePath path) 現在の選択範囲にパスを追加します。void
DefaultTreeSelectionModel.addSelectionPaths
(TreePath[] paths) 現在の選択範囲にパスを追加します。void
TreeSelectionModel.addSelectionPaths
(TreePath[] paths) 現在の選択範囲にパスを追加します。protected boolean
DefaultTreeSelectionModel.arePathsContiguous
(TreePath[] paths) パスが連続しているか、このオブジェクトにRowMapperがない場合、trueを返します。protected boolean
DefaultTreeSelectionModel.canPathsBeAdded
(TreePath[] paths) TreePath
の特定のセットが追加できるかどうか判定するために使用します。protected boolean
DefaultTreeSelectionModel.canPathsBeRemoved
(TreePath[] paths) モデルの連続性を壊さずにパスを削除できる場合にtrueを返します。abstract Rectangle
パスを描画するのに必要な境界を指定する矩形を返します。パスを描画するのに必要な境界を指定する矩形を返します。path
で識別される項目が描画されるラベル部分を囲むRectangle
を返します。abstract boolean
AbstractLayoutCache.getExpandedState
(TreePath path) パスが展開されて可視の場合にtrueを返します。boolean
FixedHeightLayoutCache.getExpandedState
(TreePath path) パスが展開されて可視の場合にtrueを返します。boolean
VariableHeightLayoutCache.getExpandedState
(TreePath path) パスが展開されて可視の場合にtrueを返します。abstract int
AbstractLayoutCache.getRowForPath
(TreePath path) pathで識別される最後の項目が可視である行を返します。int
FixedHeightLayoutCache.getRowForPath
(TreePath path) pathで識別される最後の項目が可視である行を返します。int
VariableHeightLayoutCache.getRowForPath
(TreePath path) pathで識別される最後の項目が可視である行を返します。int[]
AbstractLayoutCache.getRowsForPaths
(TreePath[] paths) path
内でTreePath
のインスタンスが表示されている行を返します。int[]
RowMapper.getRowsForPaths
(TreePath[] path) path
内でTreePathのインスタンスが表示されている行を返します。abstract int
AbstractLayoutCache.getVisibleChildCount
(TreePath path) 行について可視の子の数を返します。int
FixedHeightLayoutCache.getVisibleChildCount
(TreePath path) 行について可視の子の数を返します。int
VariableHeightLayoutCache.getVisibleChildCount
(TreePath path) path
について可視の子の数を返します。abstract Enumeration
<TreePath> AbstractLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumerator
を返します。FixedHeightLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumeratorを返します。VariableHeightLayoutCache.getVisiblePathsFrom
(TreePath path) 渡された位置から開始される可視のパスを次々に列挙するEnumerator
を返します。abstract void
AbstractLayoutCache.invalidatePathBounds
(TreePath path) path
の矩形は無効で、更新される必要があることをLayoutCache
に通知します。void
FixedHeightLayoutCache.invalidatePathBounds
(TreePath path) 処理は行いません。FixedHeightLayoutCacheは幅をキャッシュに格納しません。したがって、変更はありません。void
VariableHeightLayoutCache.invalidatePathBounds
(TreePath path) path
の矩形は無効で、更新される必要があることをLayoutCache
に通知します。boolean
TreePath.isDescendant
(TreePath aTreePath) aTreePath
がこのTreePath
の下位オブジェクトである場合は、trueを返します。abstract boolean
AbstractLayoutCache.isExpanded
(TreePath path) 行で識別される値が現在展開されている場合にtrueを返します。boolean
FixedHeightLayoutCache.isExpanded
(TreePath path) 行で識別される値が現在展開されている場合にtrueを返します。boolean
VariableHeightLayoutCache.isExpanded
(TreePath path) path
で識別される値が現在展開されている場合にtrueを返します。boolean
DefaultTreeSelectionModel.isPathSelected
(TreePath path) パスpath
が現在の選択範囲にある場合にtrueを返します。boolean
TreeSelectionModel.isPathSelected
(TreePath path) パスpath
が現在の選択範囲にある場合にtrueを返します。protected void
DefaultTreeSelectionModel.notifyPathChange
(Vector<?> changedPaths, TreePath oldLeadSelection) 非推奨。JDK version 1.7以降void
DefaultTreeSelectionModel.removeSelectionPath
(TreePath path) 選択範囲からパスを削除します。void
TreeSelectionModel.removeSelectionPath
(TreePath path) 選択範囲からパスを削除します。void
DefaultTreeSelectionModel.removeSelectionPaths
(TreePath[] paths) 選択範囲からパスを削除します。void
TreeSelectionModel.removeSelectionPaths
(TreePath[] paths) 選択範囲からパスを削除します。abstract void
AbstractLayoutCache.setExpandedState
(TreePath path, boolean isExpanded) パスpath
の展開状態をisExpanded
としてマーク付けします。void
FixedHeightLayoutCache.setExpandedState
(TreePath path, boolean isExpanded) パスpath
の展開状態をisExpanded
としてマーク付けします。void
VariableHeightLayoutCache.setExpandedState
(TreePath path, boolean isExpanded) パスpath
の展開状態をisExpanded
としてマーク付けします。void
DefaultTreeSelectionModel.setSelectionPath
(TreePath path) 選択範囲をパスに設定します。void
TreeSelectionModel.setSelectionPath
(TreePath path) 選択範囲をパスに設定します。void
DefaultTreeSelectionModel.setSelectionPaths
(TreePath[] pPaths) 選択範囲を設定します。void
TreeSelectionModel.setSelectionPaths
(TreePath[] paths) 選択範囲をパスに設定します。void
DefaultTreeModel.valueForPathChanged
(TreePath path, Object newValue) パスで識別されるTreeNodeのユーザー・オブジェクトを設定し、変更済みのノードを送ります。void
TreeModel.valueForPathChanged
(TreePath path, Object newValue) newValue
へのpath
によって識別される項目の値をユーザーが変更すると、メッセージとして送信されます。