JavaTM Platform
Standard Ed. 6

javax.swing.event
クラス TreeSelectionEvent

java.lang.Object
  上位を拡張 java.util.EventObject
      上位を拡張 javax.swing.event.TreeSelectionEvent
すべての実装されたインタフェース:
Serializable

public class TreeSelectionEvent
extends EventObject

現在の選択範囲での変更を記述するイベントです。変更はパスの数に基づきます。TreeSelectionListener は、通常、イベントのソースに対して、変更された可能性のある各行の新しく選択された状態を問い合わせます。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK Version 1.4 以降、すべての JavaBeans の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。

関連項目:
TreeSelectionListener, TreeSelectionModel

フィールドの概要
protected  boolean[] areNew
          各パスについて、そのパスが実際に新しいパスかどうかを示します。
protected  TreePath newLeadSelectionPath
          パスが変更されたあとの leadSelectionPath です。
protected  TreePath oldLeadSelectionPath
          パスが変更される前の leadSelectionPath です。
protected  TreePath[] paths
          このイベントが表すパスです。
 
クラス java.util.EventObject から継承されたフィールド
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)
          レシーバのコピーを返します。
 TreePath getNewLeadSelectionPath()
          現在のリードパスを返します。
 TreePath getOldLeadSelectionPath()
          以前にリードパスだったパスを返します。
 TreePath getPath()
          最初のパス要素を返します。
 TreePath[] getPaths()
          選択範囲で追加または削除されたパスを返します。
 boolean isAddedPath()
          最初のパス要素が選択範囲に追加された場合は true を返します。
 boolean isAddedPath(int index)
          index で指定されるパスが選択範囲に追加された場合は true を返します。
 boolean isAddedPath(TreePath path)
          path で指定されるパスが選択範囲に追加された場合は true を返します。
 
クラス java.util.EventObject から継承されたメソッド
getSource, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

paths

protected TreePath[] paths
このイベントが表すパスです。


areNew

protected boolean[] areNew
各パスについて、そのパスが実際に新しいパスかどうかを示します。


oldLeadSelectionPath

protected TreePath oldLeadSelectionPath
パスが変更される前の leadSelectionPath です。null の場合もあります。


newLeadSelectionPath

protected TreePath newLeadSelectionPath
パスが変更されたあとの leadSelectionPath です。null の場合もあります。

コンストラクタの詳細

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          TreePath[] paths,
                          boolean[] areNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
TreeSelectionModel の選択範囲内での変更を表します。paths は、選択範囲で追加または削除されたパスを示します。

パラメータ:
source - イベントのソース
paths - 選択範囲で変更されたパス

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          TreePath path,
                          boolean isNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
TreeSelectionModel の選択範囲内での変更を表します。path は、選択範囲で追加または削除されたパスを示します。

パラメータ:
source - イベントのソース
path - 選択範囲で変更されたパス
isNew - パスが選択範囲にとって新しいかどうか。 パスが選択範囲から削除された場合は false
メソッドの詳細

getPaths

public TreePath[] getPaths()
選択範囲で追加または削除されたパスを返します。


getPath

public TreePath getPath()
最初のパス要素を返します。


isAddedPath

public boolean isAddedPath()
最初のパス要素が選択範囲に追加された場合は true を返します。戻り値 false は、最初のパスが選択範囲から削除されたことを意味します。


isAddedPath

public boolean isAddedPath(TreePath path)
path で指定されるパスが選択範囲に追加された場合は true を返します。戻り値 false は、そのパスが以前は選択範囲内にあったが、現在はないことを意味します。このイベントは、path がこのイベントによって指定されるパスのどれでもない場合に生成されます。


isAddedPath

public boolean isAddedPath(int index)
index で指定されるパスが選択範囲に追加された場合は true を返します。戻り値 false は、そのパスが以前は選択範囲内にあったが、現在はないことを意味します。このイベントは、index < 0 または >= getPaths.length の場合に生成されます。

導入されたバージョン:
1.3

getOldLeadSelectionPath

public TreePath getOldLeadSelectionPath()
以前にリードパスだったパスを返します。


getNewLeadSelectionPath

public TreePath getNewLeadSelectionPath()
現在のリードパスを返します。


cloneWithSource

public Object cloneWithSource(Object newSource)
レシーバのコピーを返します。ただし、ソースは newSource です。


JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。