public class DefaultFeatureReferenceSelection extends AbstractDisposable implements FeatureReferenceSelection
reverse()
method.Modifier and Type | Class and Description |
---|---|
static class |
DefaultFeatureReferenceSelection.SelectionData |
Modifier and Type | Field and Description |
---|---|
static String |
DYNCLASS_PERSISTENT_NAME |
protected DefaultFeatureReferenceSelection.SelectionData |
selectionData |
Constructor and Description |
---|
DefaultFeatureReferenceSelection()
Constructor used by the persistence manager.
|
DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore)
Creates a new Selection with the total size of Features from which the
selection will be performed.
|
DefaultFeatureReferenceSelection(FeatureStore featureStore,
FeatureSelectionHelper helper)
Creates a new Selection with the total size of Features from which the
selection will be performed.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Provides each value of this Store to the provided
Visitor . |
void |
addObserver(Observer observer) |
void |
addObserver(Reference ref) |
void |
addObservers(BaseWeakReferencingObservable observable) |
void |
beginComplexNotification()
Sets the Observable in complex notification mode.
|
protected void |
clearFeatureReferences()
Removes all the stored FeatureRefence objects.
|
Object |
clone() |
int |
countObservers() |
void |
deleteObserver(Observer observer) |
void |
deleteObserver(Reference ref) |
void |
deleteObservers() |
boolean |
deselect(FeatureReference reference)
Removes a feature from the selection.
|
boolean |
deselect(FeatureReference reference,
boolean undoable) |
void |
deselectAll()
Deselects all values.
|
void |
deselectAll(boolean undoable) |
void |
disableNotifications()
Disable the notification of events to registered Observers.
|
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
enableNotifications()
Enable (default) the notification of events to registered Observers.
|
void |
endComplexNotification()
Ends the complex notification mode.
|
protected FeatureCommandsStack |
getCommands()
Returns the reference to the commands record.
|
DefaultFeatureReferenceSelection.SelectionData |
getData() |
protected FeatureStore |
getFeatureStore()
Returns the FeatureStore of the selected FeatureReferences.
|
long |
getSelectedCount()
Returns the number of selected values.
|
boolean |
inComplex() |
boolean |
isEnabledNotifications() |
boolean |
isFromStore(DataStore store)
Indicates whether this DataSet belongs to a specific store
|
protected boolean |
isReversed() |
boolean |
isSelected(FeatureReference reference)
Returns if a feature is selected.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
notifyObservers() |
void |
notifyObservers(Object arg) |
Iterator |
referenceIterator()
Returns an unmodifiable Iterator of selected feature references.
|
static void |
registerPersistent() |
void |
reverse()
Reverses the selection.
|
void |
reverse(boolean undoable) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
boolean |
select(FeatureReference reference)
Adds a feature to the selection.
|
boolean |
select(FeatureReference reference,
boolean undoable) |
void |
selectAll()
Selects all values.
|
void |
selectAll(boolean undoable) |
void |
setData(DefaultFeatureReferenceSelection.SelectionData selectionData) |
String |
toString() |
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
dispose, dispose
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose
public static final String DYNCLASS_PERSISTENT_NAME
protected DefaultFeatureReferenceSelection.SelectionData selectionData
public DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore) throws DataException
featureStore
- the FeatureStore of the selected FeatureReferencesDataException
- if there is an error while getting the total number of
Features of the Store.public DefaultFeatureReferenceSelection(FeatureStore featureStore, FeatureSelectionHelper helper) throws DataException
featureStore
- the FeatureStore of the selected FeatureReferenceshelper
- to get some information of the StoreDataException
- if there is an error while getting the total number of
Features of the Store.public DefaultFeatureReferenceSelection()
loadFromState(PersistentState)
to set the values of the internal
attributes that this class needs to work.public boolean select(FeatureReference reference)
FeatureReferenceSelection
select
in interface FeatureReferenceSelection
reference
- the selected feature referencepublic boolean select(FeatureReference reference, boolean undoable)
undoable
- if the action must be undoableselect(FeatureReference)
public boolean deselect(FeatureReference reference)
FeatureReferenceSelection
deselect
in interface FeatureReferenceSelection
reference
- the deselected feature referencepublic boolean deselect(FeatureReference reference, boolean undoable)
undoable
- if the action must be undoabledeselect(FeatureReference)
public void selectAll() throws DataException
FeatureReferenceSelection
selectAll
in interface FeatureReferenceSelection
DataException
- if there is an error selecting all valuespublic void selectAll(boolean undoable) throws DataException
undoable
- if the action must be undoableDataException
selectAll()
public void deselectAll() throws DataException
FeatureReferenceSelection
deselectAll
in interface FeatureReferenceSelection
DataException
- if there is an error deselecting all valuespublic void deselectAll(boolean undoable) throws DataException
undoable
- if the action must be undoableDataException
deselectAll()
public boolean isSelected(FeatureReference reference)
FeatureReferenceSelection
isSelected
in interface FeatureReferenceSelection
reference
- to checkpublic void reverse()
FeatureReferenceSelection
reverse
in interface FeatureReferenceSelection
public void reverse(boolean undoable)
undoable
- if the action must be undoablereverse()
public long getSelectedCount()
FeatureReferenceSelection
getSelectedCount
in interface FeatureReferenceSelection
public Iterator referenceIterator()
FeatureReferenceSelection
referenceIterator
in interface FeatureReferenceSelection
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public boolean isFromStore(DataStore store)
DataSet
isFromStore
in interface DataSet
store
- a DataStorepublic void accept(Visitor visitor) throws BaseException
DataSet
Visitor
.
The values received through the Visitor.visit(Object)
method
may be transient, reused or externally modifiable, so they can't
be used to be stored in any external form out of the visit method.
If you need to store any of the values out of the
Visitor.visit(Object)
method execution, create a copy or clone
the received value in order to be stored.accept
in interface DataSet
accept
in interface Visitable
visitor
- the visitor to apply to each value.BaseException
- if there is an error while performing the visitpublic 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.
public DefaultFeatureReferenceSelection.SelectionData getData()
public void setData(DefaultFeatureReferenceSelection.SelectionData selectionData)
protected boolean isReversed()
protected void clearFeatureReferences()
protected FeatureStore getFeatureStore()
protected FeatureCommandsStack getCommands()
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public static void registerPersistent()
public void addObserver(Observer observer)
addObserver
in interface Observable
public void addObserver(Reference ref)
public void addObservers(BaseWeakReferencingObservable observable)
public void beginComplexNotification()
ComplexObservable
beginComplexNotification
in interface ComplexObservable
public int countObservers()
public void deleteObserver(Observer observer)
deleteObserver
in interface Observable
public void deleteObserver(Reference ref)
public void deleteObservers()
deleteObservers
in interface Observable
public void disableNotifications()
ComplexObservable
disableNotifications
in interface ComplexObservable
public void enableNotifications()
ComplexObservable
enableNotifications
in interface ComplexObservable
public void endComplexNotification()
ComplexObservable
If a observer is a ComplexObserver
, it will be notified with a
single DefaultComplexNotification
instead of each of the notifications.
Some important notes to take into account when calling this method.
Observer
is processing a notification another Observer
is
registered to the source Observable
, it won't get any of the
notifications currently being notified, but future ones.endComplexNotification
in interface ComplexObservable
public boolean inComplex()
public boolean isEnabledNotifications()
public void notifyObservers()
public void notifyObservers(Object arg)
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException