Package org.gvsig.fmap.dal.feature.impl
Class DefaultFeatureReferenceSelection
java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.fmap.dal.feature.impl.DefaultFeatureReferenceSelection
- All Implemented Interfaces:
org.gvsig.fmap.dal.DataSelection,org.gvsig.fmap.dal.DataSet,org.gvsig.fmap.dal.feature.FeatureReferenceSelection,org.gvsig.tools.dispose.Disposable,org.gvsig.tools.observer.ComplexObservable,org.gvsig.tools.observer.Observable,org.gvsig.tools.observer.Observer,org.gvsig.tools.observer.WeakReferencingObservable,org.gvsig.tools.persistence.Persistent,org.gvsig.tools.visitor.Visitable
public class DefaultFeatureReferenceSelection
extends org.gvsig.tools.dispose.impl.AbstractDisposable
implements org.gvsig.fmap.dal.feature.FeatureReferenceSelection
Default implementation of a FeatureReferenceSelection, based on the usage of
a java.util.Set to store individual selected or not selected
FeatureReferences, depending on the usage of the
reverse() method.- Author:
- gvSIG Team
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor used by the persistence manager.DefaultFeatureReferenceSelection(org.gvsig.fmap.dal.feature.FeatureStore featureStore, FeatureSelectionHelper helper) Creates a new Selection with the total size of Features from which the selection will be performed.DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore) Creates a new Selection with the total size of Features from which the selection will be performed. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.gvsig.tools.visitor.Visitor visitor) voidaddObserver(org.gvsig.tools.observer.Observer observer) voidprotected voidRemoves all the stored FeatureRefence objects.clone()voiddeleteObserver(org.gvsig.tools.observer.Observer observer) voidbooleandeselect(org.gvsig.fmap.dal.feature.FeatureReference reference) booleandeselect(org.gvsig.fmap.dal.feature.FeatureReference reference, boolean undoable) voidvoiddeselectAll(boolean undoable) voidprotected voidvoidvoidprotected FeatureCommandsStackReturns the reference to the commands record.getData()org.gvsig.fmap.dal.feature.FeatureStoreReturns the FeatureStore of the selected FeatureReferences.longbooleanbooleanbooleanisEmpty()booleanbooleanisFromStore(org.gvsig.fmap.dal.DataStore store) protected booleanbooleanisSelected(org.gvsig.fmap.dal.feature.FeatureReference reference) voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidvoidnotifyObservers(Object arg) Iterable<org.gvsig.fmap.dal.feature.FeatureReference> org.gvsig.fmap.dal.feature.FeatureReferenceIteratorstatic voidvoidreverse()voidreverse(boolean undoable) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) booleanselect(org.gvsig.fmap.dal.feature.FeatureReference reference) booleanselect(org.gvsig.fmap.dal.feature.FeatureReference reference, boolean undoable) voidvoidselectAll(boolean undoable) voidsetData(DefaultFeatureReferenceSelection.SelectionData selectionData) toString()voidMethods inherited from class org.gvsig.tools.dispose.impl.AbstractDisposable
dispose, disposeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gvsig.tools.dispose.Disposable
dispose
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
DYNCLASS_PERSISTENT_NAME
- See Also:
-
selectionData
-
-
Constructor Details
-
DefaultFeatureReferenceSelection
public DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException Creates a new Selection with the total size of Features from which the selection will be performed.- Parameters:
featureStore- the FeatureStore of the selected FeatureReferences- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error while getting the total number of Features of the Store.
-
DefaultFeatureReferenceSelection
public DefaultFeatureReferenceSelection(org.gvsig.fmap.dal.feature.FeatureStore featureStore, FeatureSelectionHelper helper) throws org.gvsig.fmap.dal.exception.DataException Creates a new Selection with the total size of Features from which the selection will be performed.- Parameters:
featureStore- the FeatureStore of the selected FeatureReferenceshelper- to get some information of the Store- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error while getting the total number of Features of the Store.
-
DefaultFeatureReferenceSelection
public DefaultFeatureReferenceSelection()Constructor used by the persistence manager. Don't use directly. After to invoke this method, the persistence manager calls the the methodloadFromState(PersistentState)to set the values of the internal attributes that this class needs to work.
-
-
Method Details
-
select
public boolean select(org.gvsig.fmap.dal.feature.FeatureReference reference) - Specified by:
selectin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
select
public boolean select(org.gvsig.fmap.dal.feature.FeatureReference reference, boolean undoable) - Parameters:
reference-undoable- if the action must be undoable- Returns:
- See Also:
-
deselect
public boolean deselect(org.gvsig.fmap.dal.feature.FeatureReference reference) - Specified by:
deselectin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
deselect
public boolean deselect(org.gvsig.fmap.dal.feature.FeatureReference reference, boolean undoable) - Parameters:
reference-undoable- if the action must be undoable- Returns:
- See Also:
-
selectAll
public void selectAll() throws org.gvsig.fmap.dal.exception.DataException- Specified by:
selectAllin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection- Throws:
org.gvsig.fmap.dal.exception.DataException
-
selectAll
public void selectAll(boolean undoable) throws org.gvsig.fmap.dal.exception.DataException - Parameters:
undoable- if the action must be undoable- Throws:
org.gvsig.fmap.dal.exception.DataException- See Also:
-
deselectAll
public void deselectAll() throws org.gvsig.fmap.dal.exception.DataException- Specified by:
deselectAllin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection- Throws:
org.gvsig.fmap.dal.exception.DataException
-
deselectAll
public void deselectAll(boolean undoable) throws org.gvsig.fmap.dal.exception.DataException - Parameters:
undoable- if the action must be undoable- Throws:
org.gvsig.fmap.dal.exception.DataException- See Also:
-
isSelected
public boolean isSelected(org.gvsig.fmap.dal.feature.FeatureReference reference) - Specified by:
isSelectedin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
reverse
public void reverse()- Specified by:
reversein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
reverse
public void reverse(boolean undoable) - Parameters:
undoable- if the action must be undoable- See Also:
-
isEmpty
public boolean isEmpty() -
getSelectedCount
public long getSelectedCount()- Specified by:
getSelectedCountin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
referenceIterator
public org.gvsig.fmap.dal.feature.FeatureReferenceIterator referenceIterator()- Specified by:
referenceIteratorin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
referenceIterable
- Specified by:
referenceIterablein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
doDispose
protected void doDispose() throws org.gvsig.tools.exception.BaseException- Specified by:
doDisposein classorg.gvsig.tools.dispose.impl.AbstractDisposable- Throws:
org.gvsig.tools.exception.BaseException
-
isFromStore
public boolean isFromStore(org.gvsig.fmap.dal.DataStore store) - Specified by:
isFromStorein interfaceorg.gvsig.fmap.dal.DataSet
-
accept
public void accept(org.gvsig.tools.visitor.Visitor visitor) throws org.gvsig.tools.exception.BaseException - Specified by:
acceptin interfaceorg.gvsig.fmap.dal.DataSet- Specified by:
acceptin interfaceorg.gvsig.tools.visitor.Visitable- Throws:
org.gvsig.tools.exception.BaseException
-
update
- Specified by:
updatein interfaceorg.gvsig.tools.observer.Observer
-
getData
-
setData
-
toString
-
isReversed
protected boolean isReversed() -
clearFeatureReferences
protected void clearFeatureReferences()Removes all the stored FeatureRefence objects. -
getFeatureStore
public org.gvsig.fmap.dal.feature.FeatureStore getFeatureStore()Returns the FeatureStore of the selected FeatureReferences.- Returns:
- the featureStore
-
getCommands
Returns the reference to the commands record.- Returns:
- the reference to the commands record
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
registerPersistent
public static void registerPersistent() -
addObserver
public void addObserver(org.gvsig.tools.observer.Observer observer) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
beginComplexNotification
public void beginComplexNotification()- Specified by:
beginComplexNotificationin interfaceorg.gvsig.tools.observer.ComplexObservable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer observer) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-
disableNotifications
public void disableNotifications()- Specified by:
disableNotificationsin interfaceorg.gvsig.tools.observer.ComplexObservable
-
enableNotifications
public void enableNotifications()- Specified by:
enableNotificationsin interfaceorg.gvsig.tools.observer.ComplexObservable
-
endComplexNotification
public void endComplexNotification()- Specified by:
endComplexNotificationin interfaceorg.gvsig.tools.observer.ComplexObservable
-
inComplex
public boolean inComplex() -
isEnabledNotifications
public boolean isEnabledNotifications() -
notifyObservers
public void notifyObservers() -
notifyObservers
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-