|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--javax.swing.DefaultListSelectionModel
リスト選択のデフォルトデータモデルです。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
ListSelectionModel, 直列化された形式| フィールドの概要 | |
protected boolean |
leadAnchorNotificationEnabled
|
protected EventListenerList |
listenerList
|
| インタフェース javax.swing.ListSelectionModel から継承したフィールド |
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION |
| コンストラクタの概要 | |
DefaultListSelectionModel()
|
|
| メソッドの概要 | |
void |
addListSelectionListener(ListSelectionListener l)
選択範囲の変更が通知されるリスナーをリストに追加します。 |
void |
addSelectionInterval(int index0,
int index1)
選択範囲を、現在の選択範囲と index0 以上 index1 以下のインデックスの示す範囲との和集合に変更します。 |
void |
clearSelection()
選択範囲を空のセットに変更します。 |
Object |
clone()
この選択モデルの複製を、選択状態を同じにして返します。 |
protected void |
fireValueChanged(boolean isAdjusting)
一連の調整が終了したことをリスナーに通知します。 |
protected void |
fireValueChanged(int firstIndex,
int lastIndex)
firstIndex、lastIndex 間で選択の値が変更されたことを ListSelectionListeners に通知します。 |
protected void |
fireValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
|
int |
getAnchorSelectionIndex()
setSelectionInterval()、addSelectionInterval()、または removeSelectionInterval() の直前の呼び出しから、最初のインデックス引数を返します。 |
int |
getLeadSelectionIndex()
setSelectionInterval()、addSelectionInterval()、または removeSelectionInterval() の直前の呼び出しから、2 番目のインデックス引数を返します。 |
EventListener[] |
getListeners(Class listenerType)
このモデルに追加された、指定されたタイプのリスナーすべての配列を返します。 |
int |
getMaxSelectionIndex()
最後に選択されたインデックスを返すか、選択範囲が空の場合に -1 を返します。 |
int |
getMinSelectionIndex()
最初に選択されたインデックスを返すか、選択範囲が空の場合に -1 を返します。 |
int |
getSelectionMode()
選択モードを返します。 |
boolean |
getValueIsAdjusting()
値が一連の変更を受けている場合に true を返します。 |
void |
insertIndexInterval(int index,
int length,
boolean before)
インデックスの前または後で始まる length インデックスを挿入します。 |
boolean |
isLeadAnchorNotificationEnabled()
leadAnchorNotificationEnabled フラグの値を返します。 |
boolean |
isSelectedIndex(int index)
指定のインデックスが選択されている場合に true を返します。 |
boolean |
isSelectionEmpty()
インデックスが選択されていない場合に true を返します。 |
void |
removeIndexInterval(int index0,
int index1)
index0、index1 (上下限値を含む) 間のインデックスを選択モデルから削除します。 |
void |
removeListSelectionListener(ListSelectionListener l)
選択範囲の変更が通知されるリスナーをリストから削除します。 |
void |
removeSelectionInterval(int index0,
int index1)
選択範囲を、現在の選択範囲と index0 以上 index1 以下のインデックスの示す範囲との差集合に変更します。 |
void |
setAnchorSelectionIndex(int anchorIndex)
アンカー選択インデックスを設定して、すべての選択値を変更しないままにします。 |
void |
setLeadAnchorNotificationEnabled(boolean flag)
leadAnchorNotificationEnabled フラグの値を設定します。 |
void |
setLeadSelectionIndex(int leadIndex)
先頭の選択インデックスを設定し、アンカーと新しい先頭の間の値が、すべて選択またはすべて選択解除のどちらかであることを保証します。 |
void |
setSelectionInterval(int index0,
int index1)
選択範囲を index0 以上 index1 以下に変更します。 |
void |
setSelectionMode(int selectionMode)
選択モードを設定します。 |
void |
setValueIsAdjusting(boolean isAdjusting)
このプロパティは、モデルの値に適用されつつある変更が単一のイベントと考えられる場合に true になります。 |
String |
toString()
このオブジェクトのプロパティを表示および識別する文字列を返します。 |
| クラス java.lang.Object から継承したメソッド |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
protected EventListenerList listenerList
protected boolean leadAnchorNotificationEnabled
| コンストラクタの詳細 |
public DefaultListSelectionModel()
| メソッドの詳細 |
public int getMinSelectionIndex()
ListSelectionModel の記述: ListSelectionModel 内の getMinSelectionIndexpublic int getMaxSelectionIndex()
ListSelectionModel の記述: ListSelectionModel 内の getMaxSelectionIndexpublic boolean getValueIsAdjusting()
ListSelectionModel の記述: ListSelectionModel 内の getValueIsAdjustingjavax.swing.ListSelectionModel からコピーされたタグ:ListSelectionModel.setValueIsAdjusting(boolean)public int getSelectionMode()
ListSelectionModel 内の getSelectionModegetSelectionMode()public void setSelectionMode(int selectionMode)
ListSelectionModel 内の setSelectionModeselectionMode - 次の値の 1 つ。IllegalArgumentException - selectionMode が上記の正当な値のリストにない場合setSelectionMode(int)public boolean isSelectedIndex(int index)
ListSelectionModel の記述: ListSelectionModel 内の isSelectedIndexpublic boolean isSelectionEmpty()
ListSelectionModel の記述: ListSelectionModel 内の isSelectionEmptypublic void addListSelectionListener(ListSelectionListener l)
ListSelectionModel の記述: ListSelectionModel 内の addListSelectionListenerjavax.swing.ListSelectionModel からコピーされたタグ:l - ListSelectionListenerListSelectionModel.removeListSelectionListener(javax.swing.event.ListSelectionListener),
ListSelectionModel.setSelectionInterval(int, int),
ListSelectionModel.addSelectionInterval(int, int),
ListSelectionModel.removeSelectionInterval(int, int),
ListSelectionModel.clearSelection(),
ListSelectionModel.insertIndexInterval(int, int, boolean),
ListSelectionModel.removeIndexInterval(int, int)public void removeListSelectionListener(ListSelectionListener l)
ListSelectionModel の記述: ListSelectionModel 内の removeListSelectionListenerjavax.swing.ListSelectionModel からコピーされたタグ:l - ListSelectionListenerListSelectionModel.addListSelectionListener(javax.swing.event.ListSelectionListener)protected void fireValueChanged(boolean isAdjusting)
protected void fireValueChanged(int firstIndex,
int lastIndex)
firstIndex、lastIndex 間で選択の値が変更されたことを ListSelectionListeners に通知します。
protected void fireValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
firstIndex - 先頭のインデックスlastIndex - 最後のインデックスisAdjusting - 一連の調整の最後の変更である場合は trueEventListenerListpublic EventListener[] getListeners(Class listenerType)
public void setLeadAnchorNotificationEnabled(boolean flag)
isLeadAnchorNotificationEnabled()public boolean isLeadAnchorNotificationEnabled()
leadAnchorNotificationEnabled フラグの値を返します。leadAnchorNotificationEnabled が true の場合、選択領域のすべての変更に加えて、先頭インデックスとアンカーインデックスへの変更を網羅する境界を使って、モデルは通知イベントを生成します。フラグを false に設定すると、最後の変更後に選択または選択解除された要素のみを含むように、イベントの境界を限定できます。どの方法でも、モデルは先頭変数とアンカー変数を内部的に管理し続けます。デフォルトは true です。leadAnchorNotificationEnabled フラグの値setLeadAnchorNotificationEnabled(boolean)public void clearSelection()
ListSelectionModel の記述: ListSelectionModel 内の clearSelectionjavax.swing.ListSelectionModel からコピーされたタグ:ListSelectionModel.addListSelectionListener(javax.swing.event.ListSelectionListener)
public void setSelectionInterval(int index0,
int index1)
ListSelectionModel の記述: ListSelectionModel 内の setSelectionIntervaljavax.swing.ListSelectionModel からコピーされたタグ:index0 - 区間の一方の端の値index1 - 区間の他方の端の値ListSelectionModel.addListSelectionListener(javax.swing.event.ListSelectionListener)
public void addSelectionInterval(int index0,
int index1)
ListSelectionModel の記述: ListSelectionModel 内の addSelectionIntervaljavax.swing.ListSelectionModel からコピーされたタグ:index0 - 区間の一方の端の値index1 - 区間の他方の端の値ListSelectionModel.addListSelectionListener(javax.swing.event.ListSelectionListener)
public void removeSelectionInterval(int index0,
int index1)
ListSelectionModel の記述: ListSelectionModel 内の removeSelectionIntervaljavax.swing.ListSelectionModel からコピーされたタグ:index0 - 区間の一方の端の値index1 - 区間の他方の端の値ListSelectionModel.addListSelectionListener(javax.swing.event.ListSelectionListener)
public void insertIndexInterval(int index,
int length,
boolean before)
ListSelectionModel 内の insertIndexInterval
public void removeIndexInterval(int index0,
int index1)
ListSelectionModel 内の removeIndexIntervalpublic void setValueIsAdjusting(boolean isAdjusting)
ListSelectionModel の記述: ListSelectionModel 内の setValueIsAdjustingjavax.swing.ListSelectionModel からコピーされたタグ:valueIsAdjusting - プロパティの新しい値ListSelectionModel.getValueIsAdjusting()public String toString()
Object 内の toStringString 表現
public Object clone()
throws CloneNotSupportedException
listenerList は複製されません。Object 内の cloneCloneNotSupportedException - 選択モデルが、(a) Cloneable インタフェースを実装せず、(b) clone メソッドを定義しない場合public int getAnchorSelectionIndex()
ListSelectionModel の記述: ListSelectionModel 内の getAnchorSelectionIndexjavax.swing.ListSelectionModel からコピーされたタグ:ListSelectionModel.getLeadSelectionIndex(),
ListSelectionModel.setSelectionInterval(int, int),
ListSelectionModel.addSelectionInterval(int, int)public int getLeadSelectionIndex()
ListSelectionModel の記述: ListSelectionModel 内の getLeadSelectionIndexjavax.swing.ListSelectionModel からコピーされたタグ:ListSelectionModel.getAnchorSelectionIndex(),
ListSelectionModel.setSelectionInterval(int, int),
ListSelectionModel.addSelectionInterval(int, int)public void setAnchorSelectionIndex(int anchorIndex)
ListSelectionModel 内の setAnchorSelectionIndexgetAnchorSelectionIndex(),
setLeadSelectionIndex(int)public void setLeadSelectionIndex(int leadIndex)
アンカーインデックスの値が選択されていない場合、同じことを逆に行い、古い範囲の値を選択してから新しい範囲の値を選択解除します。
この変更のイベントを 1 つ生成し、すべてのリスナーに通知します。このイベント内で最小限の境界を生成することを目的に、1 回のパスで操作を行います。この方法では、ブロードキャストされた ListSelectionEvent 内の先頭と末尾のインデックスは、このメソッドによって実際に値が変更されたセルを参照します。しかし、この操作を 2 回のステップで処理すると、選択状態の効果は同じでも、2 つのイベントが生成される上に、設定のためにクリアされたセルを含んでしまい、変更された値の境界が広くなります。
このメソッドを UI クラスの mouseDragged メソッドで使うと、選択を拡張できます。
ListSelectionModel 内の setLeadSelectionIndexgetLeadSelectionIndex(),
setAnchorSelectionIndex(int)
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.