Class EditChangeManager
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.model.EditChangeManager
-
public class EditChangeManager extends java.lang.Object
Defines a class to keep history of edit changes. The main attributes are: cached fetures: current set of abstract features new features: contains keys (String) of new features removed features: contains keys (String) of removed features modified features: contains keys (String) of modified features change events: contains a list of change events update change list: contains the updates of each feature to allow identify which attributes have changed. This class is used by the data set edit classes, and in general the user does not create an instance of this class in its application.
-
-
Constructor Summary
Constructors Constructor Description EditChangeManager(java.util.Hashtable<java.lang.String,AbstractFeature> features, AbstractDataSet dataSet)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addFeature(java.lang.String key, AbstractFeature feature)
Registers the addition of a new feature.void
clearChanges()
Clears all changes.java.lang.String[]
getChangedAttributesOfModifiedFeature(java.lang.String key)
Returns the attribute names of modified features that have the values changed.AbstractFeature
getFeature(java.lang.String key)
Gets the abstract feature.java.lang.String[]
getModifiedFeatures()
java.lang.String[]
getNewFeatures()
java.lang.String[]
getRemovedFeatures()
boolean
hasChanges()
Returns if any feature has been modified or removed, or if new Geometries has been added.boolean
hasSpatialAttributeChanged(java.lang.String key)
Returns if spatial attribute of modified feature has changed.boolean
isHoldLayerUpdate()
boolean
isModifiedFeature(java.lang.String key)
boolean
isNewFeature(java.lang.String key)
boolean
isRemovedFeature(java.lang.String key)
void
redo(EditChangeEvent change)
Restores the last edit operation.boolean
removeFeature(java.lang.String key)
Registers that feature is removed.void
setFeatures(java.util.Hashtable<java.lang.String,AbstractFeature> features)
Set the current feature set.void
setHoldLayerUpdate(boolean holdLayerUpdate)
void
undo(EditChangeEvent change)
Restores the last edit operation.boolean
updateFeature(java.lang.String key, java.lang.Object newObject, int updateType)
Registers an update in the feature.
-
-
-
Constructor Detail
-
EditChangeManager
public EditChangeManager(java.util.Hashtable<java.lang.String,AbstractFeature> features, AbstractDataSet dataSet)
Constructor- Parameters:
features
- feature set from a edit data set
-
-
Method Detail
-
setFeatures
public void setFeatures(java.util.Hashtable<java.lang.String,AbstractFeature> features)
Set the current feature set.- Parameters:
features
-
-
clearChanges
public void clearChanges()
Clears all changes.
-
getFeature
public AbstractFeature getFeature(java.lang.String key)
Gets the abstract feature.- Parameters:
key
- feature key.- Returns:
-
removeFeature
public boolean removeFeature(java.lang.String key) throws java.lang.Exception
Registers that feature is removed.- Parameters:
key
- feature key- Returns:
- Throws:
java.lang.Exception
-
addFeature
public boolean addFeature(java.lang.String key, AbstractFeature feature) throws java.lang.Exception
Registers the addition of a new feature.- Parameters:
key
- feture key valuefeature
- abstract feature object- Throws:
java.lang.Exception
-
updateFeature
public boolean updateFeature(java.lang.String key, java.lang.Object newObject, int updateType) throws java.lang.Exception
Registers an update in the feature. The update may be a change on the spatial attribute, a change on a single non-spatial attribute, or a change in multiple non-spatial attributes. Spatial change: object type is of one spatial class (JGeometry, AnnotationText, ...). Attribute change: object type is of Field class. Multi attribute change: object type is of Field[] elements.- Parameters:
key
- feature key valuenewObject
- change objectupdateType
- defines the type of update change- Returns:
- Throws:
java.lang.Exception
-
isNewFeature
public boolean isNewFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
getNewFeatures
public java.lang.String[] getNewFeatures()
- Returns:
-
isRemovedFeature
public boolean isRemovedFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
getRemovedFeatures
public java.lang.String[] getRemovedFeatures()
- Returns:
-
getModifiedFeatures
public java.lang.String[] getModifiedFeatures()
- Returns:
-
isModifiedFeature
public boolean isModifiedFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
hasChanges
public boolean hasChanges()
Returns if any feature has been modified or removed, or if new Geometries has been added.- Returns:
-
undo
public void undo(EditChangeEvent change)
Restores the last edit operation.
-
redo
public void redo(EditChangeEvent change)
Restores the last edit operation.
-
hasSpatialAttributeChanged
public boolean hasSpatialAttributeChanged(java.lang.String key)
Returns if spatial attribute of modified feature has changed. For new and removed features this method returns false.- Parameters:
key
-- Returns:
-
getChangedAttributesOfModifiedFeature
public java.lang.String[] getChangedAttributesOfModifiedFeature(java.lang.String key)
Returns the attribute names of modified features that have the values changed. For new and removed features this method returns null.- Parameters:
key
-- Returns:
-
setHoldLayerUpdate
public void setHoldLayerUpdate(boolean holdLayerUpdate)
-
isHoldLayerUpdate
public boolean isHoldLayerUpdate()
-
-