|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.swing.event.PropertyChangeEmitter<StyledLayerSelectionModelSynchronizer<StyledLayerSelectionModel<E>>>
skrueger.geotools.selection.StyledLayerSelectionModel<E>
public abstract class StyledLayerSelectionModel<E>
This manager holds a set of objects which are selected for a StyledLayerInterface
.
Several components can connect to this model to keep their selection synchronized.
#addSelectionListener(java.beans.PropertyChangeListener)
,
StyledLayerSelectionModelSynchronizer
Field Summary | |
---|---|
protected EventListenerList |
listenerList
Holds the connected listeners. |
protected Logger |
LOGGER
A static logger for this class |
static String |
SELECTION
Indicates that the selection has changed in PropertyChangeEvent . |
protected HashSet<E> |
selectionObjects
Holds the current selection (e.g. |
Fields inherited from class schmitzm.swing.event.PropertyChangeEmitter |
---|
eventFiringEnabled |
Constructor Summary | |
---|---|
StyledLayerSelectionModel(StyledLayerInterface<?> styledLayer)
Creates a new selection model. |
Method Summary | |
---|---|
boolean |
addSelection(Collection<E> selectedObjects)
Extends the current selection by individual objects. |
boolean |
addSelection(E selectedObject)
Extends the current selection by an individual object. |
void |
addSelectionListener(StyledLayerSelectionModelSynchronizer<StyledLayerSelectionModel<E>> listener)
Adds a listener to the listener list. |
void |
clearSelection()
Clears the selection and fires an event to every connected listener to update their selection. |
StyledLayerSelectionEvent |
createSelectionChangeEvent(Object respObject)
Creates a simple PropertyChangeEvent for property SELECTION
with no new and old value, just to inform the listeners THAT
some selection has changed. |
Vector<E> |
getSelection()
Returns all selected objects as list. |
StyledLayerInterface<?> |
getStyledLayer()
|
boolean |
getValueIsAdjusting()
Returns whether the current selection change is a part of multiple changes. |
void |
refreshSelection()
Fires an event to every connected listener to update their selection according to the selection of this model. |
boolean |
removeSelection(Collection<E> unselectedObjects)
Removes individual objects from the current selection. |
boolean |
removeSelection(E unselectedObject)
Removes an individual object from the current selection. |
boolean |
removeSelectionListener(StyledLayerSelectionModelSynchronizer<StyledLayerSelectionModel<E>> listener)
Removes a listener from the listener list. |
void |
setValueIsAdjusting(boolean valueIsAdjusting)
Sets whether the following selection changes are part of multiple changes. |
Methods inherited from class schmitzm.swing.event.PropertyChangeEmitter |
---|
addListener, firePropertyChangeEvent, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Logger LOGGER
public static final String SELECTION
PropertyChangeEvent
.
protected EventListenerList listenerList
protected final HashSet<E> selectionObjects
Features
).
Constructor Detail |
---|
public StyledLayerSelectionModel(StyledLayerInterface<?> styledLayer)
styledLayer
- styled layer the selection is controlled ofMethod Detail |
---|
public void refreshSelection()
true
.
public void clearSelection()
public StyledLayerSelectionEvent createSelectionChangeEvent(Object respObject)
PropertyChangeEvent
for property SELECTION
with no new and old value, just to inform the listeners THAT
some selection has changed.
Subclasses may overwrite this method to create more sophisticated
events.
respObject
- object which is responsible for the selection change; this
object should ignore this event to avoid event circles (can be null
in case of general refresh events; in this case all connected
components will refresh their selection)public boolean getValueIsAdjusting()
true
refreshSelection()
has no effect
and no StyledLayerSelectionEvent
is fired until
setValueIsAdjusting(false)
is called.
public void setValueIsAdjusting(boolean valueIsAdjusting)
true
refreshSelection()
has no effect
and no StyledLayerSelectionEvent
event is fired.
If the value is set from true
to false
an automatic
refresh is initiated.
refreshSelection()
public boolean addSelection(E selectedObject)
selectedObject
- defines the (new) selected object
true
if selection has changed by calling this methodpublic boolean removeSelection(E unselectedObject)
unselectedObject
- defines an object which will be unselected
true
if selection has changed by calling this methodpublic boolean addSelection(Collection<E> selectedObjects)
selectedObjects
- defines some objects which will be selected
true
if selection has changed by calling this methodpublic boolean removeSelection(Collection<E> unselectedObjects)
unselectedObjects
- defines some objects which will be unselected
true
if selection has changed by calling this methodpublic Vector<E> getSelection()
public void addSelectionListener(StyledLayerSelectionModelSynchronizer<StyledLayerSelectionModel<E>> listener)
PropertyChangeEmitter.addListener(PropertyChangeListener)
.
listener
- a listenerpublic boolean removeSelectionListener(StyledLayerSelectionModelSynchronizer<StyledLayerSelectionModel<E>> listener)
PropertyChangeEmitter.removeListener(PropertyChangeListener)
.
listener
- a listenerpublic StyledLayerInterface<?> getStyledLayer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |