|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.DefaultListSelectionModel
リスト選択のデフォルトデータモデルです。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
ListSelectionModel
, 直列化された形式フィールドの概要 | |
protected boolean |
leadAnchorNotificationEnabled
|
protected EventListenerList |
listenerList
|
コンストラクタの概要 | |
DefaultListSelectionModel()
|
メソッドの概要 | |
void |
addListSelectionListener(ListSelectionListener l)
|
void |
addSelectionInterval(int index0,
int 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()
|
int |
getLeadSelectionIndex()
|
int |
getMaxSelectionIndex()
|
int |
getMinSelectionIndex()
|
int |
getSelectionMode()
|
boolean |
getValueIsAdjusting()
|
void |
insertIndexInterval(int index,
int length,
boolean before)
インデックスの前または後で始まる length インデックスを挿入します。 |
boolean |
isLeadAnchorNotificationEnabled()
leadAnchorNotificationEnabled フラグの値を返します。 |
boolean |
isSelectedIndex(int index)
|
boolean |
isSelectionEmpty()
|
void |
removeIndexInterval(int index0,
int index1)
index0、index1 (上下限値を含む) 間のインデックスを選択モデルから削除します。 |
void |
removeListSelectionListener(ListSelectionListener l)
|
void |
removeSelectionInterval(int index0,
int index1)
|
void |
setAnchorSelectionIndex(int anchorIndex)
アンカー選択インデックスを設定して、すべての選択値を変更しないままにします。 |
void |
setLeadAnchorNotificationEnabled(boolean flag)
leadAnchorNotificationEnabled フラグの値を設定します。 |
void |
setLeadSelectionIndex(int leadIndex)
先頭の選択インデックスを設定し、アンカーと新しい先頭の間の値が、すべて選択またはすべて選択解除のどちらかであることを保証します。 |
void |
setSelectionInterval(int index0,
int index1)
|
void |
setSelectionMode(int selectionMode)
|
void |
setValueIsAdjusting(boolean isAdjusting)
|
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()
public int getMaxSelectionIndex()
public boolean getValueIsAdjusting()
public int getSelectionMode()
public void setSelectionMode(int selectionMode)
public boolean isSelectedIndex(int index)
public boolean isSelectionEmpty()
public void addListSelectionListener(ListSelectionListener l)
public void removeListSelectionListener(ListSelectionListener l)
protected void fireValueChanged(boolean isAdjusting)
protected void fireValueChanged(int firstIndex, int lastIndex)
protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
firstIndex
- 先頭のインデックスindex1
- 末尾のインデックスisAdjusting
- 一連の変更の最後の変更である場合は trueEventListenerList
public void setLeadAnchorNotificationEnabled(boolean flag)
isLeadAnchorNotificationEnabled()
public boolean isLeadAnchorNotificationEnabled()
setLeadAnchorNotificationEnabled(boolean)
public void clearSelection()
public void setSelectionInterval(int index0, int index1)
public void addSelectionInterval(int index0, int index1)
public void removeSelectionInterval(int index0, int index1)
public void insertIndexInterval(int index, int length, boolean before)
public void removeIndexInterval(int index0, int index1)
public void setValueIsAdjusting(boolean isAdjusting)
public String toString()
public Object clone() throws CloneNotSupportedException
clone
メソッドを定義しない場合public int getAnchorSelectionIndex()
public int getLeadSelectionIndex()
public void setAnchorSelectionIndex(int anchorIndex)
getAnchorSelectionIndex()
,
setLeadSelectionIndex(int)
public void setLeadSelectionIndex(int leadIndex)
アンカーインデックスの値が選択されていない場合、同じことを逆に行い、古い範囲の値を選択してから新しい範囲の値を選択解除します。
この変更のイベントを 1 つ生成し、すべてのリスナーに通知します。このイベント内で最小限の境界を生成することを目的に、1 回のパスで操作を行います。この方法では、ブロードキャストされた ListSelectionEvent 内の先頭と末尾のインデックスは、このメソッドによって実際に値が変更されたセルを参照します。しかし、この操作を 2 回のステップで処理すると、選択状態の効果は同じでも、2 つのイベントが生成される上に、設定のためにクリアされたセルを含んでしまい、変更された値の境界が広くなります。
このメソッドを UI クラスの mouseDragged() メソッドで使うと、選択を拡張できます。
getLeadSelectionIndex()
,
setAnchorSelectionIndex(int)
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |