Java プラットフォーム 1.2

クラス
javax.swing.tree.TreePath の使用

TreePath を使用するパッケージ
javax.swing 可能な限りすべてのプラットフォームで同じように機能する「軽量」コンポーネント (Java 言語全体で共通) のセットを提供します。 
javax.swing.event Swing コンポーネントによってトリガーされるイベントを提供します。 
javax.swing.plaf 1 つのインタフェースおよび多くの抽象クラスを提供しており、Swing は、プラグイン可能な Look & Feel 機能を実現するためにこれらのクラスを利用します。 
javax.swing.plaf.basic Basic 仕様 Look & Feel に従って作成されたユーザインタフェースオブジェクトを提供します。 
javax.swing.plaf.metal このパッケージは、Metal の Look & Feel に従って構築されるユーザインタフェースオブジェクトを提供します。  
javax.swing.plaf.multi 多重 Look & Feel を利用すると、デフォルトの Look & Feel に補助的な Look & Feel を結合できます。 
javax.swing.tree java.awt.swing.JTree を処理するためのクラスとインタフェースを提供します。 
 

javax.swing における TreePath の使用方法
 

TreePath を返す javax.swing におけるメソッド
 TreePath JTree.getSelectionPath()
          選択された最初のノードのパスを返します。
 TreePath[] JTree.getSelectionPaths()
          選択されたすべての値のパスを返します。
 TreePath JTree.getLeadSelectionPath()
          選択に追加された最後のノードのパスを返します。
 TreePath JTree.getPathForRow(int row)
          指定された行のパスを返します。
 TreePath JTree.getPathForLocation(int x, int y)
          指定された位置にあるノードのパスを返します。
 TreePath JTree.getClosestPathForLocation(int x, int y)
          x、y にもっとも近いノードのパスを返します。
 TreePath JTree.getEditingPath()
          現在編集されている要素のパスを返します。
protected  TreePath[] JTree.getPathBetweenRows(int index0, int index1)
          index0 から index1 までのパスを表す JTreePath のインスタンスを返します。
 

TreePath のパラメータを持つ javax.swing におけるメソッド
 boolean JTree.isPathEditable(TreePath path)
          isEditable を返します。
 void JTree.setSelectionPath(TreePath path)
          指定されたパスで識別されるノードを選択します。
 void JTree.setSelectionPaths(TreePath[] paths)
          指定されたパスの配列によって識別されるノードを選択します。
 void JTree.addSelectionPath(TreePath path)
          指定された TreePath によって識別されるノードを現在の選択に追加します。
 void JTree.addSelectionPaths(TreePath[] paths)
          パスの配列の各パスを現在の選択に追加します。
 boolean JTree.isPathSelected(TreePath path)
          パスによって識別される項目が現在選択されている場合に true を返します。
 Enumeration JTree.getExpandedDescendants(TreePath parent)
          現在展開されている path の子孫から成る Enumeration を返します。
 boolean JTree.hasBeenExpanded(TreePath path)
          パスによって識別されるノードが今までに展開されたことがある場合に true を返します。
 boolean JTree.isExpanded(TreePath path)
          パスによって識別されるノードが現在展開されている場合に true を返します。
 boolean JTree.isCollapsed(TreePath path)
          パスによって識別される値が現在折りたたまれている場合に true を返します。
 void JTree.makeVisible(TreePath path)
          パスによって識別されるノードが現在表示可能であるようにします。
 boolean JTree.isVisible(TreePath path)
          パスによって識別される値が現在表示可能である場合、つまりそれがルートであるか、そのすべての親が展開されている場合に true を返します。
 Rectangle JTree.getPathBounds(TreePath path)
          指定されたノードが描画される Rectangle を返します。
 void JTree.scrollPathToVisible(TreePath path)
          パスにあるすべてのパスコンポーネント (最後のパスコンポーネントは除く) を展開し、パスによって指定されるノードが表示されるようにスクロールします。
 int JTree.getRowForPath(TreePath path)
          指定されたパスによって識別されるノードを表示する行を返します。
 void JTree.expandPath(TreePath path)
          指定されたパスによって識別されるノードが展開され、表示可能であるようにします。
 void JTree.collapsePath(TreePath path)
          指定されたパスによって識別されるノードが折りたたまれ、表示可能であるようにします。
 void JTree.startEditingAtPath(TreePath path)
          指定されたパスによって識別されるノードを選択し、編集を開始します。
 void JTree.removeSelectionPath(TreePath path)
          指定されたパスによって識別されるノードを現在の選択から削除します。
 void JTree.removeSelectionPaths(TreePath[] paths)
          指定されたパスによって識別されるノードを現在の選択から削除します。
 void JTree.fireTreeExpanded(TreePath path)
          このイベントタイプへの通知を配信対象に登録しているリスナーをすべて通知します。
 void JTree.fireTreeCollapsed(TreePath path)
          このイベントタイプへの通知を配信対象に登録しているリスナーをすべて通知します。
 void JTree.fireTreeWillExpand(TreePath path)
          このイベントタイプへの通知を配信対象に登録しているリスナーをすべて通知します。
 void JTree.fireTreeWillCollapse(TreePath path)
          このイベントタイプへの通知を配信対象に登録しているリスナーをすべて通知します。
protected  void JTree.setExpandedState(TreePath path, boolean state)
          レシーバの展開状態を設定します。
protected  Enumeration JTree.getDescendantToggledPaths(TreePath parent)
          parent の子孫であり、展開されている TreePath の Enumeration を返します。
 void JTree.EmptySelectionModel.setSelectionPaths(TreePath[] pPaths)
          何も選択しない null 実装です。
 void JTree.EmptySelectionModel.addSelectionPaths(TreePath[] paths)
          何も追加しない null 実装です。
 void JTree.EmptySelectionModel.removeSelectionPaths(TreePath[] paths)
          何も削除しない null 実装です。
 

TreePath のパラメータを持つ javax.swing におけるコンストラクタ
JTree.AccessibleJTree.AccessibleJTreeNode.JTree.AccessibleJTree.AccessibleJTreeNode(JTree t, TreePath p, Accessible ap)
          AccessibleJTreeNode を構築します。
 

javax.swing.event における TreePath の使用方法
 

TreePath として宣言される javax.swing.event におけるフィールド
protected  TreePath TreeExpansionEvent.path
          このイベントが表す値へのパスです。
protected  TreePath TreeModelEvent.path
          変更されたノードの親へのパスです。
protected  TreePath[] TreeSelectionEvent.paths
          このイベントが表すパスです。
protected  TreePath TreeSelectionEvent.oldLeadSelectionPath
          パスが変更される前の leadSelectionPath です。
protected  TreePath TreeSelectionEvent.newLeadSelectionPath
          パスが変更されたあとの leadSelectionPath です。
 

TreePath を返す javax.swing.event におけるメソッド
 TreePath TreeExpansionEvent.getPath()
          展開または折りたたみが行われている値へのパスを返します。
 TreePath TreeModelEvent.getTreePath()
          変更されたノードを指定する TreePath オブジェクトを返します。
 TreePath[] TreeSelectionEvent.getPaths()
          選択範囲で追加または削除されたパスを返します。
 TreePath TreeSelectionEvent.getPath()
          最初のパス要素を返します。
 TreePath TreeSelectionEvent.getOldLeadSelectionPath()
          以前にリードパスだったパスを返します。
 TreePath TreeSelectionEvent.getNewLeadSelectionPath()
          現在のリードパスを返します。
 

TreePath のパラメータを持つ javax.swing.event におけるメソッド
 boolean TreeSelectionEvent.isAddedPath(TreePath path)
          path で指定されるパスが選択範囲に追加された場合は true を返します。
 

TreePath のパラメータを持つ javax.swing.event におけるコンストラクタ
TreeExpansionEvent.TreeExpansionEvent(Object source, TreePath path)
          TreeExpansionEvent オブジェクトを構築します。
TreeModelEvent.TreeModelEvent(Object source, TreePath path, int[] childIndices, Object[] children)
          ノードが変更、挿入、または削除されたときに、イベントを生成するために使用します。
TreeModelEvent.TreeModelEvent(Object source, TreePath path)
          ノード構造がなんらかの方法で変更されたときに、イベントを生成するために使用します。
TreeSelectionEvent.TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
          TreeSelectionModel の選択範囲内での変更を表します。
TreeSelectionEvent.TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
          TreeSelectionModel の選択範囲内での変更を表します。
 

javax.swing.plaf における TreePath の使用方法
 

TreePath を返す javax.swing.plaf におけるメソッド
abstract  TreePath TreeUI.getPathForRow(JTree tree, int row)
          渡された行に対する木の経路を返します。
abstract  TreePath TreeUI.getClosestPathForLocation(JTree tree, int x, int y)
          x、y にもっとも近いノードに対する木の経路を返します。
abstract  TreePath TreeUI.getEditingPath(JTree tree)
          編集中の要素に対する木の経路を返します。
 

TreePath のパラメータを持つ javax.swing.plaf におけるメソッド
abstract  Rectangle TreeUI.getPathBounds(JTree tree, TreePath path)
          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 の使用方法
 

TreePath として宣言される javax.swing.plaf.basic におけるフィールド
protected  TreePath BasicTreeUI.editingPath
          編集中のパスです。
 

TreePath を返す javax.swing.plaf.basic におけるメソッド
 TreePath BasicTreeUI.getPathForRow(JTree tree, int row)
          渡された行のパスを返します。
 TreePath BasicTreeUI.getClosestPathForLocation(JTree tree, int x, int y)
          x、y にもっとも近いノードのパスを返します。
 TreePath BasicTreeUI.getEditingPath(JTree tree)
          編集中の要素のパスを返します。
protected  TreePath BasicTreeUI.getLastChildPath(TreePath parent)
          parent の最後の子のパスを返します。
 

TreePath のパラメータを持つ javax.swing.plaf.basic におけるメソッド
 Rectangle BasicTreeUI.getPathBounds(JTree tree, TreePath path)
          path の最後の項目が描画されるラベル部分を囲む Rectangle を返します。
 int BasicTreeUI.getRowForPath(JTree tree, TreePath path)
          path で識別される最後の可視項目の行を返します。
 void BasicTreeUI.startEditingAtPath(JTree tree, TreePath path)
          path の最後の項目を選択し、その項目の編集を試みます。
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.paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
          脚の垂直部分をペイントします。
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.paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
          行のレンダリング部分をペイントします。
protected  boolean BasicTreeUI.shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
          指定された行で展開 (切り替え) コントロールが描画されなければならない場合に true を返します。
protected  void BasicTreeUI.updateExpandedDescendants(TreePath path)
          ツリーから展開されている下位ノードを取得し、ツリー状態に転送することで、path 内のすべての下位ノードの展開状態を更新します。
protected  TreePath BasicTreeUI.getLastChildPath(TreePath parent)
          parent の最後の子のパスを返します。
protected  void BasicTreeUI.pathWasExpanded(TreePath path)
          VisibleTreeNode が展開されたあとに、VisibleTreeNode からメッセージとして送られます。
protected  void BasicTreeUI.pathWasCollapsed(TreePath path)
          VisibleTreeNode が折りたたまれたあとに、VisibleTreeNode からメッセージとして送られます。
protected  boolean BasicTreeUI.startEditing(TreePath path, MouseEvent event)
          cellEditor がある場合に、shouldSelectCell が true を返したときにノードの編集を開始します。
protected  void BasicTreeUI.checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
          mouseX および mouseYrow の展開または折りたたみに使われる領域にある場合、このメソッドは行の展開状態を切り替えます。
protected  boolean BasicTreeUI.isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
          mouseX および mouseY がノードの展開または折りたたみに使われる行の領域にあり、row にあるノードが葉を表さない場合に true を返します。
protected  void BasicTreeUI.handleExpandControlClick(TreePath path, int mouseX, int mouseY)
          ユーザが特定の行をクリックしたときにメッセージとして送られ、toggleExpandState を呼び出します。
protected  void BasicTreeUI.toggleExpandState(TreePath path)
          path が展開されてない場合にそれを展開します。
protected  void BasicTreeUI.selectPathForEvent(TreePath path, MouseEvent event)
          特定の行での MouseEvent に基づいて選択を更新するためにメッセージとして送られます。
 

javax.swing.plaf.metal における TreePath の使用方法
 

TreePath のパラメータを持つ javax.swing.plaf.metal におけるメソッド
protected  void MetalTreeUI.paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
           
protected  void MetalTreeUI.paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
           
 

javax.swing.plaf.multi における TreePath の使用方法
 

TreePath を返す javax.swing.plaf.multi におけるメソッド
 TreePath MultiTreeUI.getPathForRow(JTree a, int b)
          この MultiUI が扱う各 UI で、getPathForRow を呼び出します。
 TreePath MultiTreeUI.getClosestPathForLocation(JTree a, int b, int c)
          この MultiUI が扱う各 UI で、getClosestPathForLocation を呼び出します。
 TreePath MultiTreeUI.getEditingPath(JTree a)
          この MultiUI が扱う各 UI で、getEditingPath を呼び出します。
 

TreePath のパラメータを持つ javax.swing.plaf.multi におけるメソッド
 Rectangle MultiTreeUI.getPathBounds(JTree a, TreePath b)
          この MultiUI が扱う各 UI で、getPathBounds を呼び出します。
 int MultiTreeUI.getRowForPath(JTree a, TreePath b)
          この MultiUI が扱う各 UI で、getRowForPath を呼び出します。
 void MultiTreeUI.startEditingAtPath(JTree a, TreePath b)
          この MultiUI が扱う各 UI で、startEditingAtPath を呼び出します。
 

javax.swing.tree における TreePath の使用方法
 

TreePath として宣言される javax.swing.tree におけるフィールド
protected  TreePath[] DefaultTreeSelectionModel.selection
          現在選択されているパスです。
protected  TreePath DefaultTreeSelectionModel.leadPath
          追加された最後のパスです。
protected  TreePath DefaultTreeCellEditor.lastPath
          選択された最後のパスです。
 

TreePath を返す javax.swing.tree におけるメソッド
 TreePath DefaultTreeSelectionModel.getSelectionPath()
          選択範囲の最初のパスを返します。
 TreePath[] DefaultTreeSelectionModel.getSelectionPaths()
          選択範囲のすべてのパスを返します。
 TreePath DefaultTreeSelectionModel.getLeadSelectionPath()
          追加された最後のパスを返します。
 TreePath TreePath.pathByAddingChild(Object child)
          このレシーバのすべての要素に加えて child の要素を格納する新しいパスを返します。
 TreePath TreePath.getParentPath()
          レシーバのすべての要素を通るパスを返します。
 TreePath TreeSelectionModel.getSelectionPath()
          選択範囲の最初のパスを返します。
 TreePath[] TreeSelectionModel.getSelectionPaths()
          選択範囲の複数のパスを返します。
 TreePath TreeSelectionModel.getLeadSelectionPath()
          追加された最後のパスを返します。
abstract  TreePath AbstractLayoutCache.getPathForRow(int row)
          渡された row のパスを返します。
abstract  TreePath AbstractLayoutCache.getPathClosestTo(int x, int y)
          x, y にもっとも近いノードへのパスを返します。
 TreePath FixedHeightLayoutCache.getPathForRow(int row)
          渡された row のパスを返します。
 TreePath FixedHeightLayoutCache.getPathClosestTo(int x, int y)
          x, y にもっとも近いノードへのパスを返します。
 TreePath VariableHeightLayoutCache.getPathForRow(int row)
          渡された row のパスを返します。
 TreePath VariableHeightLayoutCache.getPathClosestTo(int x, int y)
          x, y にもっとも近いノードへのパスを返します。
 

TreePath のパラメータを持つ javax.swing.tree におけるメソッド
 void DefaultTreeSelectionModel.setSelectionPath(TreePath path)
          選択範囲を path に設定します。
 void DefaultTreeSelectionModel.setSelectionPaths(TreePath[] pPaths)
          選択範囲を pPaths のパスに設定します。
 void DefaultTreeSelectionModel.addSelectionPath(TreePath path)
          現在の選択範囲に path を追加します。
 void DefaultTreeSelectionModel.addSelectionPaths(TreePath[] paths)
          現在の選択範囲に paths を追加します。
 void DefaultTreeSelectionModel.removeSelectionPath(TreePath path)
          選択範囲から path を削除します。
 void DefaultTreeSelectionModel.removeSelectionPaths(TreePath[] paths)
          選択範囲から paths を削除します。
 boolean DefaultTreeSelectionModel.isPathSelected(TreePath path)
          パス path が現在の選択範囲にある場合に true を返します。
protected  boolean DefaultTreeSelectionModel.arePathsContiguous(TreePath[] paths)
          指定された複数のパスが連続している場合に true を返します。
protected  boolean DefaultTreeSelectionModel.canPathsBeAdded(TreePath[] paths)
          モデルの連続性を壊さずにパスを追加できる場合に true を返します。
protected  boolean DefaultTreeSelectionModel.canPathsBeRemoved(TreePath[] paths)
          モデルの連続性を壊さずにパスを削除できる場合に true を返します。
protected  void DefaultTreeSelectionModel.notifyPathChange(Vector changedPaths, TreePath oldLeadSelection)
          path 内の変更をリスナーに通知します。
 int[] RowMapper.getRowsForPaths(TreePath[] path)
          path 内で TreePath のインスタンスが表示されている行を返します。
 void DefaultTreeModel.valueForPathChanged(TreePath path, Object newValue)
          パスで識別される TreeNode のユーザオブジェクトを設定し、変更済みのノードを送ります。
 boolean TreePath.isDescendant(TreePath aTreePath)
          指定されたノードがこの TreePath の子孫の場合に true を返します。
 void TreeSelectionModel.setSelectionPath(TreePath path)
          選択範囲をパスに設定します。
 void TreeSelectionModel.setSelectionPaths(TreePath[] paths)
          選択範囲を複数のパスに設定します。
 void TreeSelectionModel.addSelectionPath(TreePath path)
          現在の選択範囲にパスを追加します。
 void TreeSelectionModel.addSelectionPaths(TreePath[] paths)
          現在の選択範囲に複数のパスを追加します。
 void TreeSelectionModel.removeSelectionPath(TreePath path)
          選択範囲からパスを削除します。
 void TreeSelectionModel.removeSelectionPaths(TreePath[] paths)
          選択範囲から複数のパスを削除します。
 boolean TreeSelectionModel.isPathSelected(TreePath path)
          パス path が現在の選択範囲にある場合に true を返します。
 void TreeModel.valueForPathChanged(TreePath path, Object newValue)
          newValue への path によって識別される項目の値をユーザが変更すると、メッセージで送信されます。
abstract  boolean AbstractLayoutCache.isExpanded(TreePath path)
          row で識別される値が現在展開されている場合に true を返します。
abstract  Rectangle AbstractLayoutCache.getBounds(TreePath path, Rectangle placeIn)
          パスを描画するのに必要な境界を指定する矩形を返します。
abstract  int AbstractLayoutCache.getRowForPath(TreePath path)
          path で識別される最後の項目が可視である行を返します。
abstract  Enumeration AbstractLayoutCache.getVisiblePathsFrom(TreePath path)
          渡された位置から開始される可視のパスを次々に列挙する Enumerator を返します。
abstract  int AbstractLayoutCache.getVisibleChildCount(TreePath path)
          行について可視の子の数を返します。
abstract  void AbstractLayoutCache.setExpandedState(TreePath path, boolean isExpanded)
          パス path の展開状態を isExpanded としてマーク付けします。
abstract  boolean AbstractLayoutCache.getExpandedState(TreePath path)
          パスが展開されて可視の場合に true を返します。
abstract  void AbstractLayoutCache.invalidatePathBounds(TreePath path)
          path の矩形は無効で更新される必要があることを LayoutCache に通知します。
 int[] AbstractLayoutCache.getRowsForPaths(TreePath[] paths)
          path 内の TreePath のインスタンスが表示されている行を返します。
 void FixedHeightLayoutCache.invalidatePathBounds(TreePath path)
          処理は行いません。
 boolean FixedHeightLayoutCache.isExpanded(TreePath path)
          行で識別される値が現在展開されている場合に true を返します。
 Rectangle FixedHeightLayoutCache.getBounds(TreePath path, Rectangle placeIn)
          パスを描画するのに必要な境界を指定する矩形を返します。
 int FixedHeightLayoutCache.getRowForPath(TreePath path)
          path で識別される最後の項目が可視である行を返します。
 int FixedHeightLayoutCache.getVisibleChildCount(TreePath path)
          行について可視の子の数を返します。
 Enumeration FixedHeightLayoutCache.getVisiblePathsFrom(TreePath path)
          渡された位置から開始される可視のパスを次々に列挙する Enumerator を返します。
 void FixedHeightLayoutCache.setExpandedState(TreePath path, boolean isExpanded)
          パス path の展開状態を isExpanded としてマーク付けします。
 boolean FixedHeightLayoutCache.getExpandedState(TreePath path)
          パスが展開されて可視の場合に true を返します。
 void VariableHeightLayoutCache.setExpandedState(TreePath path, boolean isExpanded)
          パス path の展開状態を isExpanded としてマーク付けします。
 boolean VariableHeightLayoutCache.getExpandedState(TreePath path)
          パスが展開されて可視の場合に true を返します。
 Rectangle VariableHeightLayoutCache.getBounds(TreePath path, Rectangle placeIn)
          行で識別される項目を描画する、ラベル部分を囲む Rectangle を返します。
 int VariableHeightLayoutCache.getRowForPath(TreePath path)
          path で識別される最後の項目が可視である行を返します。
 void VariableHeightLayoutCache.invalidatePathBounds(TreePath path)
          path の矩形は無効で、更新される必要があることを LayoutCache に通知します。
 Enumeration VariableHeightLayoutCache.getVisiblePathsFrom(TreePath path)
          渡された位置から開始される可視のパスを次々に列挙する Enumerator を返します。
 int VariableHeightLayoutCache.getVisibleChildCount(TreePath path)
          行について可視の子の数を返します。
 boolean VariableHeightLayoutCache.isExpanded(TreePath path)
          行で識別される値が現在展開されている場合に true を返します。
 

TreePath のパラメータを持つ javax.swing.tree におけるコンストラクタ
TreePath.TreePath(TreePath parent, Object lastElement)
          TreePath を構築します。
 


Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.