public class TreeSelectionEvent extends EventObject
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースとの互換性がなくなる予定です。現在の直列化のサポートは、短期間の格納や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。1.4 以降、すべての JavaBeansTM 用の長期間の格納サポートが java.beans パッケージに追加されています。XMLEncoder を参照してください。
| 修飾子と型 | フィールドと説明 |
|---|---|
protected boolean[] |
areNew
各パスについて、そのパスが実際に新しいパスかどうかを示します。
|
protected TreePath |
newLeadSelectionPath
パスが変更されたあとの leadSelectionPath です。null の場合もあります。
|
protected TreePath |
oldLeadSelectionPath
パスが変更される前の leadSelectionPath です。null の場合もあります。
|
protected TreePath[] |
paths
このイベントが表すパスです。
|
source| コンストラクタと説明 |
|---|
TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
TreeSelectionModel の選択範囲内での変更を表します。
|
TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
TreeSelectionModel の選択範囲内での変更を表します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
Object |
cloneWithSource(Object newSource)
レシーバのコピーを返します。ただし、ソースは newSource です。
|
TreePath |
getNewLeadSelectionPath()
現在のリードパスを返します。
|
TreePath |
getOldLeadSelectionPath()
以前にリードパスだったパスを返します。
|
TreePath |
getPath()
最初のパス要素を返します。
|
TreePath[] |
getPaths()
選択範囲で追加または削除されたパスを返します。
|
boolean |
isAddedPath()
getPath で指定されるパスが選択範囲に追加されたかどうかを返します。 |
boolean |
isAddedPath(int index)
getPaths()[index] のパスが選択範囲に追加されたかどうかを返します。 |
boolean |
isAddedPath(TreePath path)
指定されたパスが選択範囲に追加されたかどうかを返します。
|
getSource, toStringprotected TreePath[] paths
protected boolean[] areNew
protected TreePath oldLeadSelectionPath
protected TreePath newLeadSelectionPath
public TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
source - イベントのソースpaths - 選択範囲で変更されたパスpublic TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
source - イベントのソースpath - 選択範囲で変更されたパスisNew - パスが選択範囲にとって新しいかどうか。パスが選択範囲から削除された場合は false。public TreePath[] getPaths()
public TreePath getPath()
public boolean isAddedPath()
getPath で指定されるパスが選択範囲に追加されたかどうかを返します。戻り値 true は、getPath で指定されるパスが選択範囲に追加されたことを示します。戻り値 false は、getPath が選択されたが、現在は選択されていないことを示します。getPath が選択範囲に追加された場合は true、それ以外の場合は falsepublic boolean isAddedPath(TreePath path)
true は、path で指定されるパスが選択範囲に追加されたことを示します。戻り値 false は、path が現在は選択されていないことを示します。このメソッドは、getPaths() から返されたパスに対してのみ有効です。getPaths() に含まれないパスを使用して呼び出すと、IllegalArgumentException がスローされます。path - テストするパスpath が選択範囲に追加された場合は true、それ以外の場合は falseIllegalArgumentException - path が getPaths に含まれない場合getPaths()public boolean isAddedPath(int index)
getPaths()[index] のパスが選択範囲に追加されたかどうかを返します。戻り値 true は、パスが選択範囲に追加されたことを示します。戻り値 false は、パスが現在は選択されていないことを示します。index - テストするパスのインデックスtrue、それ以外の場合は falseIllegalArgumentException - インデックスが getPaths の範囲外にある場合getPaths()public TreePath getOldLeadSelectionPath()
public TreePath getNewLeadSelectionPath()
バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.