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
  • Field Details

  • 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 FeatureReferences
      helper - 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 method loadFromState(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:
      select in interface org.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:
      deselect in interface org.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:
      selectAll in interface org.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:
      deselectAll in interface org.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:
      isSelected in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • reverse

      public void reverse()
      Specified by:
      reverse in interface org.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:
      getSelectedCount in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • referenceIterator

      public org.gvsig.fmap.dal.feature.FeatureReferenceIterator referenceIterator()
      Specified by:
      referenceIterator in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • referenceIterable

      public Iterable<org.gvsig.fmap.dal.feature.FeatureReference> referenceIterable()
      Specified by:
      referenceIterable in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • doDispose

      protected void doDispose() throws org.gvsig.tools.exception.BaseException
      Specified by:
      doDispose in class org.gvsig.tools.dispose.impl.AbstractDisposable
      Throws:
      org.gvsig.tools.exception.BaseException
    • isFromStore

      public boolean isFromStore(org.gvsig.fmap.dal.DataStore store)
      Specified by:
      isFromStore in interface org.gvsig.fmap.dal.DataSet
    • accept

      public void accept(org.gvsig.tools.visitor.Visitor visitor) throws org.gvsig.tools.exception.BaseException
      Specified by:
      accept in interface org.gvsig.fmap.dal.DataSet
      Specified by:
      accept in interface org.gvsig.tools.visitor.Visitable
      Throws:
      org.gvsig.tools.exception.BaseException
    • update

      public void update(org.gvsig.tools.observer.Observable observable, Object notification)
      Specified by:
      update in interface org.gvsig.tools.observer.Observer
    • getData

    • setData

      public void setData(DefaultFeatureReferenceSelection.SelectionData selectionData)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      protected FeatureCommandsStack 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:
      saveToState in interface org.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:
      loadFromState in interface org.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:
      addObserver in interface org.gvsig.tools.observer.Observable
    • beginComplexNotification

      public void beginComplexNotification()
      Specified by:
      beginComplexNotification in interface org.gvsig.tools.observer.ComplexObservable
    • deleteObserver

      public void deleteObserver(org.gvsig.tools.observer.Observer observer)
      Specified by:
      deleteObserver in interface org.gvsig.tools.observer.Observable
    • deleteObservers

      public void deleteObservers()
      Specified by:
      deleteObservers in interface org.gvsig.tools.observer.Observable
    • disableNotifications

      public void disableNotifications()
      Specified by:
      disableNotifications in interface org.gvsig.tools.observer.ComplexObservable
    • enableNotifications

      public void enableNotifications()
      Specified by:
      enableNotifications in interface org.gvsig.tools.observer.ComplexObservable
    • endComplexNotification

      public void endComplexNotification()
      Specified by:
      endComplexNotification in interface org.gvsig.tools.observer.ComplexObservable
    • inComplex

      public boolean inComplex()
    • isEnabledNotifications

      public boolean isEnabledNotifications()
    • notifyObservers

      public void notifyObservers()
    • notifyObservers

      public void notifyObservers(Object arg)
    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • isAvailable

      public boolean isAvailable()
      Specified by:
      isAvailable in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection