public class FeatureSelectionModel extends Object implements ListSelectionModel, Observer
Modifier and Type | Field and Description |
---|---|
protected EventListenerList |
listenerList |
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
Constructor and Description |
---|
FeatureSelectionModel(FeatureTableModel featureTableModel)
Creates a new
FeatureSelectionModel with a
FeatureTableModel used to get the Feature s by position in
the table. |
Modifier and Type | Method and Description |
---|---|
void |
addListSelectionListener(ListSelectionListener listener) |
void |
addSelectionInterval(int index0,
int index1) |
void |
clearSelection() |
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) |
boolean |
isSelectedIndex(int index) |
boolean |
isSelectionEmpty() |
void |
removeIndexInterval(int index0,
int index1) |
void |
removeListSelectionListener(ListSelectionListener listener) |
void |
removeSelectionInterval(int index0,
int index1) |
void |
setAnchorSelectionIndex(int index) |
void |
setLeadSelectionIndex(int index) |
void |
setSelectionInterval(int index0,
int index1) |
void |
setSelectionMode(int selectionMode) |
void |
setValueIsAdjusting(boolean valueIsAdjusting) |
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
protected EventListenerList listenerList
public FeatureSelectionModel(FeatureTableModel featureTableModel) throws DataException
FeatureSelectionModel
with a
FeatureTableModel
used to get the Feature
s by position in
the table.featureTableModel
- to get Features fromDataException
- if there is an error getting the store selectionpublic int getAnchorSelectionIndex()
getAnchorSelectionIndex
in interface ListSelectionModel
public int getLeadSelectionIndex()
getLeadSelectionIndex
in interface ListSelectionModel
public int getMaxSelectionIndex()
getMaxSelectionIndex
in interface ListSelectionModel
public int getMinSelectionIndex()
getMinSelectionIndex
in interface ListSelectionModel
public void insertIndexInterval(int index, int length, boolean before)
insertIndexInterval
in interface ListSelectionModel
public void removeIndexInterval(int index0, int index1)
removeIndexInterval
in interface ListSelectionModel
public void setAnchorSelectionIndex(int index)
setAnchorSelectionIndex
in interface ListSelectionModel
public void setLeadSelectionIndex(int index)
setLeadSelectionIndex
in interface ListSelectionModel
public void addSelectionInterval(int index0, int index1)
addSelectionInterval
in interface ListSelectionModel
public void setSelectionInterval(int index0, int index1)
setSelectionInterval
in interface ListSelectionModel
public void removeSelectionInterval(int index0, int index1)
removeSelectionInterval
in interface ListSelectionModel
public void clearSelection()
clearSelection
in interface ListSelectionModel
public boolean isSelectedIndex(int index)
isSelectedIndex
in interface ListSelectionModel
public boolean isSelectionEmpty()
isSelectionEmpty
in interface ListSelectionModel
public boolean getValueIsAdjusting()
getValueIsAdjusting
in interface ListSelectionModel
public void setValueIsAdjusting(boolean valueIsAdjusting)
setValueIsAdjusting
in interface ListSelectionModel
public int getSelectionMode()
getSelectionMode
in interface ListSelectionModel
public void setSelectionMode(int selectionMode)
setSelectionMode
in interface ListSelectionModel
public void addListSelectionListener(ListSelectionListener listener)
addListSelectionListener
in interface ListSelectionModel
public void removeListSelectionListener(ListSelectionListener listener)
removeListSelectionListener
in interface ListSelectionModel
public void update(Observable observable, Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
firstIndex
- the first index in the intervallastIndex
- the last index in the intervalisAdjusting
- true if this is the final change in a series of adjustmentsEventListenerList