All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.DefaultListSelectionModel

java.lang.Object
   |
   +----com.sun.java.swing.DefaultListSelectionModel

public class DefaultListSelectionModel
extends Object
implements ListSelectionModel, Cloneable, Serializable
Default data model for list selections.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:
ListSelectionModel

Variable Index

 o leadAnchorNotificationEnabled
 o listenerList
 o value

Constructor Index

 o DefaultListSelectionModel()

Method Index

 o addListSelectionListener(ListSelectionListener)
 o addSelectionInterval(int, int)
 o clearSelection()
 o clone()
Returns a clone of the reciever with the same selection.
 o fireValueChanged(boolean)
Notify listeners that we are beginning or ending a series of value changes
 o fireValueChanged(int, int)
Notify ListSelectionListeners that the value of the selection, in the closed interval firstIndex,lastIndex, has changed.
 o fireValueChanged(int, int, boolean)
 o getAnchorSelectionIndex()
 o getLeadSelectionIndex()
 o getMaxSelectionIndex()
 o getMinSelectionIndex()
 o getSelectionMode()
 o getValueIsAdjusting()
 o insertIndexInterval(int, int, boolean)
Insert length indices beginning before/after index.
 o isLeadAnchorNotificationEnabled()
Returns the value of the leadAnchorNotificationEnabled flag.
 o isSelectedIndex(int)
 o isSelectionEmpty()
 o removeIndexInterval(int, int)
Remove the indices in the interval index0,index1 (inclusive) from the selection model.
 o removeListSelectionListener(ListSelectionListener)
 o removeSelectionInterval(int, int)
 o setAnchorSelectionIndex(int)
 o setLeadAnchorNotificationEnabled(boolean)
Sets the value of the leadAnchorNotificationEnabled flag.
 o setLeadSelectionIndex(int)
 o setSelectionInterval(int, int)
 o setSelectionMode(int)
 o setValueIsAdjusting(boolean)
 o toString()

Variables

 o value
 protected BitSet value
 o listenerList
 protected EventListenerList listenerList
 o leadAnchorNotificationEnabled
 protected boolean leadAnchorNotificationEnabled

Constructors

 o DefaultListSelectionModel
 public DefaultListSelectionModel()

Methods

 o getMinSelectionIndex
 public int getMinSelectionIndex()
 o getMaxSelectionIndex
 public int getMaxSelectionIndex()
 o getValueIsAdjusting
 public boolean getValueIsAdjusting()
 o getSelectionMode
 public int getSelectionMode()
 o setSelectionMode
 public void setSelectionMode(int selectionMode)
 o isSelectedIndex
 public boolean isSelectedIndex(int index)
 o isSelectionEmpty
 public boolean isSelectionEmpty()
 o addListSelectionListener
 public void addListSelectionListener(ListSelectionListener l)
 o removeListSelectionListener
 public void removeListSelectionListener(ListSelectionListener l)
 o fireValueChanged
 protected void fireValueChanged(boolean isAdjusting)
Notify listeners that we are beginning or ending a series of value changes

 o fireValueChanged
 protected void fireValueChanged(int firstIndex,
                                 int lastIndex)
Notify ListSelectionListeners that the value of the selection, in the closed interval firstIndex,lastIndex, has changed.

 o fireValueChanged
 protected void fireValueChanged(int firstIndex,
                                 int lastIndex,
                                 boolean isAdjusting)
Parameters:
firstIndex - The first index in the interval.
index1 - The last index in the interval.
isAdjusting - True if this is the final change in a series of them.
See Also:
EventListenerList
 o clearSelection
 public void clearSelection()
 o setLeadAnchorNotificationEnabled
 public void setLeadAnchorNotificationEnabled(boolean flag)
Sets the value of the leadAnchorNotificationEnabled flag.

See Also:
isLeadAnchorNotificationEnabled
 o isLeadAnchorNotificationEnabled
 public boolean isLeadAnchorNotificationEnabled()
Returns the value of the leadAnchorNotificationEnabled flag. When leadAnchorNotificationEnabled is true the model generates notification events with bounds that cover all the changes to the selection plus the changes to the lead and anchor indices. Setting the flag to false causes a norrowing of the event's bounds to include only the elements that have been selected or deselected since the last change. Either way, the model continues to maintain the lead and anchor variables internally. The default is true.

Returns:
the value of the leadAnchorNotificationEnabled flag
See Also:
setLeadAnchorNotificationEnabled
 o setSelectionInterval
 public void setSelectionInterval(int index0,
                                  int index1)
 o addSelectionInterval
 public void addSelectionInterval(int index0,
                                  int index1)
 o removeSelectionInterval
 public void removeSelectionInterval(int index0,
                                     int index1)
 o insertIndexInterval
 public void insertIndexInterval(int index,
                                 int length,
                                 boolean before)
Insert length indices beginning before/after index. This is typically called to sync the selection model with a corresponding change in the data model.

 o removeIndexInterval
 public void removeIndexInterval(int index0,
                                 int index1)
Remove the indices in the interval index0,index1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model. Note that (as always) index0 need not be <= index1.

 o setValueIsAdjusting
 public void setValueIsAdjusting(boolean b)
 o toString
 public String toString()
Overrides:
toString in class Object
 o clone
 public Object clone() throws CloneNotSupportedException
Returns a clone of the reciever with the same selection. listenerLists are not duplicated.

Throws: CloneNotSupportedException
if the receiver does not both (a) implement the Cloneable interface and (b) define a clone method.
Overrides:
clone in class Object
 o getAnchorSelectionIndex
 public int getAnchorSelectionIndex()
 o getLeadSelectionIndex
 public int getLeadSelectionIndex()
 o setAnchorSelectionIndex
 public void setAnchorSelectionIndex(int index)
 o setLeadSelectionIndex
 public void setLeadSelectionIndex(int index)

All Packages  Class Hierarchy  This Package  Previous  Next  Index