public class TreeSelectionEvent extends EventObject
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースとの互換性がなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが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, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。