public class FeatureCollectionAndListModel extends DefaultFeatureCollection implements ListSelectionModel
| Modifier and Type | Field and Description |
|---|---|
protected int |
anchorIndex |
protected int |
leadIndex |
protected Vector<ListSelectionListener> |
listSelectionListeners |
protected boolean |
valueIsAdjusting |
features, holdAll, holdFeatures, listeners, selectedFeaturesMULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTIONLAYER_DISABLED_INVISIBLE, LAYER_DISABLED_VISIBLE, LAYER_ENABLED_INVISIBLE, LAYER_ENABLED_VISIBLE| Constructor and Description |
|---|
FeatureCollectionAndListModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListSelectionListener(ListSelectionListener x)
Add a listener to the list that's notified each time a change to the selection occurs.
|
void |
addSelectionInterval(int index0,
int index1)
Change the selection to be the set union of the current selection and the indices between index0 and index1
inclusive.
|
void |
clearSelection()
Change the selection to the empty set.
|
protected void |
fireValueChanged(boolean isAdjusting)
Notifies listeners that we have ended a series of adjustments.
|
protected void |
fireValueChanged(int firstIndex,
int lastIndex)
Notifies
ListSelectionListeners that the value of the selection, in the closed interval
firstIndex, lastIndex, has changed. |
protected void |
fireValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
DOCUMENT ME!
|
int |
getAnchorSelectionIndex()
Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or
removeSelectionInterval().
|
int |
getLeadSelectionIndex()
Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or
removeSelectionInterval().
|
int |
getMaxSelectionIndex()
Returns the last selected index or -1 if the selection is empty.
|
int |
getMinSelectionIndex()
Returns the first selected index or -1 if the selection is empty.
|
int |
getSelectionMode()
Returns the current selection mode.
|
boolean |
getValueIsAdjusting()
Returns true if the value is undergoing a series of changes.
|
void |
insertIndexInterval(int index,
int length,
boolean before)
Insert length indices beginning before/after index.
|
boolean |
isSelectedIndex(int index)
Returns true if the specified index is selected.
|
boolean |
isSelectionEmpty()
Returns true if no indices are selected.
|
void |
removeIndexInterval(int index0,
int index1)
Remove the indices in the interval index0,index1 (inclusive) from the selection model.
|
void |
removeListSelectionListener(ListSelectionListener x)
Remove a listener from the list that's notified each time a change to the selection occurs.
|
void |
removeSelectionInterval(int index0,
int index1)
Change the selection to be the set difference of the current selection and the indices between index0 and index1
inclusive.
|
void |
setAnchorSelectionIndex(int index)
Set the anchor selection index.
|
void |
setLeadSelectionIndex(int index)
Set the lead selection index.
|
void |
setSelectionInterval(int index0,
int index1)
Change the selection to be between index0 and index1 inclusive.
|
void |
setSelectionMode(int selectionMode)
Set the selection mode.
|
void |
setValueIsAdjusting(boolean valueIsAdjusting)
This property is true if upcoming changes to the value of the model should be considered a single event.
|
addFeature, addFeatureCollectionListener, addFeatures, addToSelection, addToSelection, addVetoableSelectionListener, areFeaturesEditable, canBeDisabled, checkForAndCorrectDoubleNaming, clear, contains, featuresAddedToMap, fireAllFeaturesRemoved, fireFeaturesAdded, fireFeaturesChanged, fireFeaturesRemoved, fireSelectionChanged, fireSelectionChanged, fireSelectionChanged, getAllFeatures, getFeature, getFeatureCount, getHoldFeatures, getLayerPosition, getName, getSelectedFeatures, getTranslucency, holdFeature, isEnabled, isHoldFeature, isSelected, isSingleSelection, reconsiderFeature, removeAllFeatures, removeFeature, removeFeatureCollectionListener, removeFeatures, removeFeaturesByInstance, removeVetoableSelectionListener, select, select, setEnabled, setFeatureAt, setHoldAll, setLayerPosition, setName, setSingleSelection, setTranslucency, substituteFeatures, unholdFeature, unselect, unselect, unselectAll, unselectAllprotected Vector<ListSelectionListener> listSelectionListeners
protected int leadIndex
protected int anchorIndex
protected boolean valueIsAdjusting
public void setSelectionMode(int selectionMode)
SINGLE_SELECTION Only one list index can be selected at a time. In this mode the
setSelectionInterval and addSelectionInterval methods are equivalent, and only the second index argument (the
"lead index") is used.SINGLE_INTERVAL_SELECTION One contiguous index interval can be selected at a time. In this
mode setSelectionInterval and addSelectionInterval are equivalent.MULTIPLE_INTERVAL_SELECTION In this mode, there's no restriction on what can be selected.
setSelectionMode in interface ListSelectionModelselectionMode - DOCUMENT ME!IllegalArgumentException - DOCUMENT ME!getSelectionMode()public void setLeadSelectionIndex(int index)
setLeadSelectionIndex in interface ListSelectionModelindex - DOCUMENT ME!getLeadSelectionIndex()public void setAnchorSelectionIndex(int index)
setAnchorSelectionIndex in interface ListSelectionModelindex - DOCUMENT ME!getAnchorSelectionIndex()public boolean isSelectedIndex(int index)
isSelectedIndex in interface ListSelectionModelindex - DOCUMENT ME!public void setValueIsAdjusting(boolean valueIsAdjusting)
setValueIsAdjusting in interface ListSelectionModelvalueIsAdjusting - The new value of the property.getValueIsAdjusting()public void removeListSelectionListener(ListSelectionListener x)
removeListSelectionListener in interface ListSelectionModelx - the ListSelectionListeneraddListSelectionListener(javax.swing.event.ListSelectionListener)public void addListSelectionListener(ListSelectionListener x)
addListSelectionListener in interface ListSelectionModelx - the ListSelectionListenerremoveListSelectionListener(javax.swing.event.ListSelectionListener),
setSelectionInterval(int, int),
addSelectionInterval(int, int),
removeSelectionInterval(int, int),
clearSelection(),
insertIndexInterval(int, int, boolean),
removeIndexInterval(int, int)public void insertIndexInterval(int index,
int length,
boolean before)
insertIndexInterval in interface ListSelectionModelindex - DOCUMENT ME!length - DOCUMENT ME!before - DOCUMENT ME!public void setSelectionInterval(int index0,
int index1)
setSelectionInterval in interface ListSelectionModelindex0 - one end of the interval.index1 - other end of the intervaladdListSelectionListener(javax.swing.event.ListSelectionListener)public void removeSelectionInterval(int index0,
int index1)
removeSelectionInterval in interface ListSelectionModelindex0 - one end of the interval.index1 - other end of the intervaladdListSelectionListener(javax.swing.event.ListSelectionListener)public void addSelectionInterval(int index0,
int index1)
addSelectionInterval in interface ListSelectionModelindex0 - one end of the interval.index1 - other end of the intervaladdListSelectionListener(javax.swing.event.ListSelectionListener)public void clearSelection()
clearSelection in interface ListSelectionModeladdListSelectionListener(javax.swing.event.ListSelectionListener)public int getAnchorSelectionIndex()
getAnchorSelectionIndex in interface ListSelectionModelgetLeadSelectionIndex(),
setSelectionInterval(int, int),
addSelectionInterval(int, int)public int getLeadSelectionIndex()
getLeadSelectionIndex in interface ListSelectionModelgetAnchorSelectionIndex(),
setSelectionInterval(int, int),
addSelectionInterval(int, int)public int getMaxSelectionIndex()
getMaxSelectionIndex in interface ListSelectionModelpublic int getMinSelectionIndex()
getMinSelectionIndex in interface ListSelectionModelpublic int getSelectionMode()
getSelectionMode in interface ListSelectionModelsetSelectionMode(int)public boolean getValueIsAdjusting()
getValueIsAdjusting in interface ListSelectionModelsetValueIsAdjusting(boolean)public boolean isSelectionEmpty()
isSelectionEmpty in interface ListSelectionModelpublic void removeIndexInterval(int index0,
int index1)
removeIndexInterval in interface ListSelectionModelindex0 - DOCUMENT ME!index1 - DOCUMENT ME!protected void fireValueChanged(boolean isAdjusting)
isAdjusting - DOCUMENT ME!protected void fireValueChanged(int firstIndex,
int lastIndex)
ListSelectionListeners that the value of the selection, in the closed interval
firstIndex, lastIndex, has changed.firstIndex - DOCUMENT ME!lastIndex - DOCUMENT ME!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 adjustmentsEventListenerListCopyright © 2012–2026 cismet GmbH. All rights reserved.