net.refractions.udig.project.command.factory
Class EditCommandFactory

java.lang.Object
  extended by net.refractions.udig.project.command.EditCommandFactory
      extended by net.refractions.udig.project.command.factory.EditCommandFactory

public class EditCommandFactory
extends EditCommandFactory

Creates Edit commands which must be used to modify editable feature data. API internal classes are in the returned API

Since:
0.3
Author:
jeichar

Constructor Summary
protected EditCommandFactory()
           
 
Method Summary
 UndoableMapCommand createAddFeatureCommand(Feature feature, ILayer layer)
           
 MapCommand createCommitCommand()
          Create a Commit command
 UndoableMapCommand createCopyFeaturesCommand(ILayer sourceLayer, Filter filter, ILayer destinationLayer)
           
 UndoableMapCommand createCreateLayerCommand(java.net.URL resourceId)
          Create a CreateLayerCommand
 UndoableMapCommand createDeleteFeature(Feature feature, ILayer layer)
          Create a Delete Feature command
 MapCommand createDeleteFeatures(ILayer selectedLayer, Filter filter)
           
 UndoableMapCommand createDeleteLayer(ILayer layer)
          Deprecated. use optimized createDeleteLayers(ILayer[]) method.
 UndoableMapCommand createDeleteLayers(ILayer[] layers)
          Create a delete multiple layers command
 UndoableMapCommand createFeature(Coordinate[] coordinates)
           
 UndoableMapCommand createNullEditFeatureCommand()
          Creates a SetEditFeatureCommandobject that sets the current editable Feature to null.
 UndoableMapCommand createResetEditFeatureCommand()
          Create a ResetEditFeatureCommand command
 MapCommand createRollbackCommand()
          Create a Commit command
 UndoableMapCommand createSetAttributeCommand(Feature feature, ILayer layer, java.lang.String xpath, java.lang.Object value)
          Creates a SetAttributeCommandobject.
 UndoableMapCommand createSetAttributeCommand(java.lang.String xpath, java.lang.Object value)
          Creates a SetAttributeCommandobject.
 UndoableMapCommand createSetEditFeatureCommand(Feature feature)
          Creates a SetEditFeatureCommandobject that sets the current editable Feature.
 UndoableMapCommand createSetEditFeatureCommand(Feature feature, ILayer layer)
          Creates a SetEditFeatureCommandobject that sets the current editVictim victim.
 UndoableMapCommand createSetGeometryCommand(Geometry geom)
          Creates a SetGeometryCommandobject that sets the default geometry.
 UndoableMapCommand createSetGeometryCommand(java.lang.String xpath, Geometry geom)
          Creates a SetGeometryCommandobject.
 UndoableMapCommand createSetGeomteryCommand(Feature feature, ILayer layer, Geometry geom)
          Creates a SetGeometryCommandobject that sets the default geometry.
 UndoableMapCommand createSetGeomteryCommand(Feature feature, ILayer layer, java.lang.String xpath, Geometry geom)
          Creates a SetGeometryCommandobject.
 UndoableMapCommand createWriteEditFeatureCommand()
          Create a WriteEditFeatureCommand command
static EditCommandFactory getInstance()
          Creates a new EditCommandFactory object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditCommandFactory

protected EditCommandFactory()
Method Detail

getInstance

public static EditCommandFactory getInstance()
Creates a new EditCommandFactory object

Returns:
a new EditCommandFactory object

createSetAttributeCommand

public UndoableMapCommand createSetAttributeCommand(java.lang.String xpath,
                                                    java.lang.Object value)
Creates a SetAttributeCommandobject.

Overrides:
createSetAttributeCommand in class EditCommandFactory
Parameters:
xpath - xpath that identifies an attribute in the current editable Feature
value - the value that the attribute will be set to.
Returns:
a new SetAttributeCommandobject
See Also:
EditCommand

createSetGeometryCommand

public UndoableMapCommand createSetGeometryCommand(java.lang.String xpath,
                                                   Geometry geom)
Creates a SetGeometryCommandobject.

Overrides:
createSetGeometryCommand in class EditCommandFactory
Parameters:
xpath - xpath that identifies an attribute in the current editable Feature
geom - the geom (in layer CRS) that the geometry will be set to.
Returns:
a new SetGeometryCommandobject
See Also:
EditCommand, Geometry

createSetGeometryCommand

public UndoableMapCommand createSetGeometryCommand(Geometry geom)
Creates a SetGeometryCommandobject that sets the default geometry.

Overrides:
createSetGeometryCommand in class EditCommandFactory
Parameters:
geom - the geom (in layer CRS) that the geometry will be set to.
Returns:
a new SetGeometryCommandobject.
See Also:
EditCommand, Geometry

createSetAttributeCommand

public UndoableMapCommand createSetAttributeCommand(Feature feature,
                                                    ILayer layer,
                                                    java.lang.String xpath,
                                                    java.lang.Object value)
Creates a SetAttributeCommandobject.

Parameters:
xpath - xpath that identifies an attribute in the current editable Feature
value - the value that the attribute will be set to.
Returns:
a new SetAttributeCommandobject
See Also:
EditCommand

createSetGeomteryCommand

public UndoableMapCommand createSetGeomteryCommand(Feature feature,
                                                   ILayer layer,
                                                   java.lang.String xpath,
                                                   Geometry geom)
Creates a SetGeometryCommandobject.

Parameters:
xpath - xpath that identifies an attribute in the current editable Feature
geom - the geom (in layer CRS) that the geometry will be set to.
Returns:
a new SetGeometryCommandobject
See Also:
EditCommand, Geometry

createSetGeomteryCommand

public UndoableMapCommand createSetGeomteryCommand(Feature feature,
                                                   ILayer layer,
                                                   Geometry geom)
Creates a SetGeometryCommandobject that sets the default geometry.

Parameters:
feature - a feature that has a default feature type that will accept the geometry type.
layer - the layer containing the feature.
geom - the geom (in layer CRS) that the geometry will be set to.
Returns:
a new SetGeometryCommandobject.
See Also:
EditCommand, Geometry

createSetEditFeatureCommand

public UndoableMapCommand createSetEditFeatureCommand(Feature feature,
                                                      ILayer layer)
Creates a SetEditFeatureCommandobject that sets the current editVictim victim.

Overrides:
createSetEditFeatureCommand in class EditCommandFactory
Parameters:
feature - the feature that will be the new editable Feature.
layer - A victim Store that contains the editable Feature.
Returns:
a new SetEditFeatureCommandobject.
See Also:
Feature, Layer, UndoableMapCommand

createCommitCommand

public MapCommand createCommitCommand()
Create a Commit command

Overrides:
createCommitCommand in class EditCommandFactory
Returns:
a new CommitCommand object that deletes the feature.
See Also:
CommitCommand

createRollbackCommand

public MapCommand createRollbackCommand()
Create a Commit command

Overrides:
createRollbackCommand in class EditCommandFactory
Returns:
a new RollbackCommand object that deletes the feature.
See Also:
RollbackCommand

createSetEditFeatureCommand

public UndoableMapCommand createSetEditFeatureCommand(Feature feature)
Creates a SetEditFeatureCommandobject that sets the current editable Feature.

Overrides:
createSetEditFeatureCommand in class EditCommandFactory
Parameters:
feature - the feature that will be the new editable Feature.
Returns:
a new SetEditFeatureCommandobject.
See Also:
UndoableMapCommand, Feature

createNullEditFeatureCommand

public UndoableMapCommand createNullEditFeatureCommand()
Creates a SetEditFeatureCommandobject that sets the current editable Feature to null.

Overrides:
createNullEditFeatureCommand in class EditCommandFactory
Returns:
a new SetEditFeatureCommandobject that sets the current editable Feature to null..
See Also:
UndoableMapCommand

createFeature

public UndoableMapCommand createFeature(Coordinate[] coordinates)
Overrides:
createFeature in class EditCommandFactory
Parameters:
coordinates - the coordinates of the new feature in Map CRS.
Returns:
a new CreateFeatureCommandobject creates the feature.
See Also:
CreateFeatureCommand

createDeleteLayers

public UndoableMapCommand createDeleteLayers(ILayer[] layers)
Create a delete multiple layers command

Parameters:
map - the map containing the layer
evaluationObject - the layer to delete
Returns:
a new DeleteLayerCommandobject that deletes the layer.
See Also:
DeleteLayerCommand

createDeleteLayer

public UndoableMapCommand createDeleteLayer(ILayer layer)
Deprecated. use optimized createDeleteLayers(ILayer[]) method.

Create a delete layer command

Overrides:
createDeleteLayer in class EditCommandFactory
Parameters:
map - the map containing the layer
layer - the layer to delete
Returns:
a new DeleteLayerCommandobject that deletes the layer.
See Also:
DeleteLayerCommand

createDeleteFeature

public UndoableMapCommand createDeleteFeature(Feature feature,
                                              ILayer layer)
Create a Delete Feature command

Overrides:
createDeleteFeature in class EditCommandFactory
Parameters:
layer - the layer containing the feature
feature - the feature to delete
Returns:
a new DeleteFeatureCommandobject that deletes the feature.
See Also:
DeleteFeatureCommand

createWriteEditFeatureCommand

public UndoableMapCommand createWriteEditFeatureCommand()
Create a WriteEditFeatureCommand command

Overrides:
createWriteEditFeatureCommand in class EditCommandFactory
Returns:
a new WriteEditFeatureCommand object that deletes the feature.
See Also:
WriteEditFeatureCommand

createCreateLayerCommand

public UndoableMapCommand createCreateLayerCommand(java.net.URL resourceId)
Create a CreateLayerCommand

Overrides:
createCreateLayerCommand in class EditCommandFactory
See Also:
CreateLayerCommand

createResetEditFeatureCommand

public UndoableMapCommand createResetEditFeatureCommand()
Create a ResetEditFeatureCommand command

Overrides:
createResetEditFeatureCommand in class EditCommandFactory
Returns:
a new ResetEditFeatureCommand object that deletes the feature.
See Also:
ResetEditFeatureCommand

createDeleteFeatures

public MapCommand createDeleteFeatures(ILayer selectedLayer,
                                       Filter filter)

createCopyFeaturesCommand

public UndoableMapCommand createCopyFeaturesCommand(ILayer sourceLayer,
                                                    Filter filter,
                                                    ILayer destinationLayer)

createAddFeatureCommand

public UndoableMapCommand createAddFeatureCommand(Feature feature,
                                                  ILayer layer)