com.esri.adf.web.ags.tasks
Class EditingTask

java.lang.Object
  extended bycom.esri.adf.web.ags.tasks.EditingTask
All Implemented Interfaces:
WebContextInitialize

public class EditingTask
extends java.lang.Object
implements WebContextInitialize

The Editor Task boxes up all editing functionality for the web editor in the 9.2 release. The Editor Task is an addition to the WebMap and can be configured through manager. It is exposed in a WebApplication as a link on Task Bar.


Field Summary
protected  java.lang.String currentActionID
           
protected  EditingResource editingResource
          Editing map resource wrapper.
protected  EditingTaskInfo taskInfo
           
protected  EditingSettings taskSettings
          Snapping and selection settings
protected  EditingWorkspace workspace
          Editing workspace wrapper.
 
Constructor Summary
EditingTask()
           
 
Method Summary
 void addFeaturePoint(MapEvent event)
          A task action to add Point feature.
 void addFeaturePolygon(MapEvent event)
          A task action to add polygon feature.
 void addFeaturePolyline(MapEvent event)
          A task action to add line feature.
 void addVertex(MapEvent event)
          A task action to insert a vertex either along an existing segment, or between two existing vertices.
 boolean canAddFeatures()
          Returns true if add attributes function is enabled.
 boolean canEditAttributes()
          Returns true if edit attributes function is enabled.
 boolean canEditFeatures()
          Returns true if edit features function is enabled.
 boolean canEnterFinalXY()
          Returns true if can enter final XY value.
 boolean continueEnterXY()
          Returns true if can continue enter XY value.
 void copyFeature(MapEvent event)
          A task action to copy the feature by clicking anywhere on the map to locate the new feature.
 void deleteVertex(MapEvent event)
          A task action to delete the selected vertex.
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 void enterXY(MapEvent event)
          A task tool to build or modify geometry by entering XY values instead of using a Map Mouse click.
 void executeApplySettings()
          A task tool to apply snapping settings.
 void executeClearSelection()
          A task tool to clear all currently selected features.
 void executeCloseEditWindows()
          A task tool to stop editing, discard unsaved edits, and close editing window.
 void executeContinueEnterXY()
          A task action to add XY values.
 void executeDeleteFeature()
          A task tool to delete the selected feature.
 void executeEnterFinalXY()
          A task action to enter the last XY value.
 void executeEnterXY()
          A task action to build or modify geometry by entering XY values instead of using a Map Mouse click.
 void executeFirst()
          A task tool to move selection cursor to the first feature in queue.
 void executeHelp()
          Provides content sensitive help instruction.
 void executeLast()
          A task tool to move selection cursor to the last feature in queue.
 void executeMergeFeature()
          A task tool to operates on a selection set at least two features must be selected.
 void executeNext()
          A task tool to move selection cursor to the next feature in queue.
 void executePre()
          A task tool to move selection cursor to the previous feature in queue.
 void executeRedo()
          A task tool to redo edits
 void executeShowVertices()
          A task tool to show vertices on selected feature.
 void executeStartEditing()
          A task tool to turn the task to editing mode.
 void executeStopEditingDiscard()
          A task tool to stop editing and discard all the changes.
 void executeStopEditingSave()
          A task tool to stop and save all the edits.
 void executeUndo()
          A task too to undo previous edit.
 com.esri.adf.web.ags.tasks.EditingTask.EditingParamDescriptior[] getAttributesParms()
          Creates task parameters for attributes editing.
 java.lang.String getAttributIDTitle()
          A label property in the editing window.
 java.lang.String getCreateFeatureTitle()
          A label property in the editing window.
 java.lang.String getCurrentActionID()
          A hidden property getter.
 java.lang.String getDummy()
           
 java.util.Map getDummyList()
           
 java.lang.String getEdgeLabel()
          A label property in the settings window.
 java.lang.String getEditAttributesIndTitle()
          A label property in the editing window.
 java.lang.String getEditAttributesTitle()
          A label property in the editing window.
 java.lang.String getEditFeatureTitle()
          A label property in the editing window.
 java.lang.String getEndLabel()
          A label property in the settings window.
 java.lang.String getHelpInfo()
          Gets the help information of the EditingTask.
 java.lang.String getHighlightColor()
          Gets the highlight color, e.g.
 int getLayerId()
          A task property "layerID".
 java.util.Map getLayers()
          A task property "layerID".
 java.lang.String getMapVersionID()
          Gets user selected version.
 java.util.Map getMapVersionList()
          A task property "mapVersionID", a dropdown list.
 java.lang.String getShapeType()
          A task property "shapeType".
 java.lang.String getSnappingLabel()
          A label property in the settings window.
 java.lang.String getSnappingRulesLabel()
          A label property in the settings window.
 java.lang.String getSnapTipsColor()
          Gets the snapTipsColor of the EditingTask.
 int getSnapTolerance()
          Gets snapping tolerance in pixels.
 double getSnapToleranceInDistance(WebMap map)
          Gets snapping tolerance in map units.
 java.lang.String getStatusMessage()
          A task property "statusMessage" showing operation status.
 EditingConfig getTaskConfig()
          Gets the task configuration.
 SimpleTaskInfo getTaskInfo()
          Gets the task info of editing.
 java.lang.String getTaskName()
          Sets task window title.
 EditingSettings getTaskSettings()
          Gets settings for the snapping and feature selection.
 int getTolerance()
          Gets search tolerance in pixels.
 double getToleranceInDistance(WebMap map)
          Gets search tolerance in map units.
 java.lang.String getUnitLabel()
          A label property in the settings window.
 java.lang.String getValueX()
          Gets the valueX of the EditingTask.
 java.lang.String getValueY()
          Gets the valueY of the EditingTask.
 java.lang.String getVersionTitle()
          A label property in the editing window.
 java.lang.String getVertexLabel()
          A label property in the settings window.
 java.lang.String getVerticesColor()
          Gets the vertices color, e.g.
 java.lang.String getVerticesOutline()
          Gets the outline color of vertices, e.g."255,255,0"
 int getVerticesShape()
          Gets the shape of vertex.
 int getVerticesSize()
          Gets the size of vertex.
 WebContext getWebContext()
          Retrieves associated web context.
 java.lang.String getXyGeometyType()
          Gets the geomety type of the tool operation.
 java.lang.String getXyLastPoint()
          Gets the last entered point.
 boolean hasEdits()
          Returns true if there are edits available.
 boolean hasNext()
          Returns true when there are more selected features in the editing queue.
 boolean hasPre()
          Returns true when the index of the selected feature is greater than 0.
 boolean hasRedo()
          Returns true if redo is enabled.
 boolean hasSelection()
          Returns true if there are selected features.
 boolean hasUndo()
          Returns true if undo is enabled.
 boolean hasVertices()
          Returns true when showing vertices on selected features.
protected  void init()
          Initiated a Editing task.
 void init(WebContext context)
           The initialization chores of attributes of a WebContext should be performed in this method.
 boolean isEditableStatus()
          Returns true if task is in editing mode.
 boolean isSnapCircle()
          Returns true when snapping circle is enabled.
 boolean isSnapEnabled()
          Returns true is snapping is enabled.
 void moveFeature(MapEvent event)
          A task action to re-locate the feature by clicking anywhere on the map.
 void moveVertex(MapEvent event)
          A task tool to move an existing vertex.
 void selectFeature(MapEvent event)
          A task action.
 void setCurrentActionID(java.lang.String currentActionID)
          A hidden property setter.
 void setDummy(java.lang.String dummy)
           
 void setHelpInfo(java.lang.String helpInfo)
          Sets the helpInfo of the EditingTask.
 void setHighlightColor(java.lang.String highlightColor)
          Sets the highlight color, e.g.
 void setLayerId(int layerId)
          A task property "layerID".
 void setMapVersionID(java.lang.String mapVersionID)
          A task property "mapVersionID", a dropdown list.
 void setSnapCircle(boolean snapCircle)
          Sets to true to show a circle when snapping.
 void setSnapEnabled(boolean enabled)
          Only for GUI generation.
 void setSnapTipsColor(java.lang.String snapTipsColor)
          Sets the snapTipsColor of the EditingTask.
 void setSnapTolerance(int tol)
          Sets snapping tolerance in pixels.
 void setTaskConfig(EditingConfig config)
          Sets the task configuration.
 void setTaskName(java.lang.String taskName)
          Gets task window title.
 void setTolerance(int tolerance)
          Sets search tolerance in pixels.
 void setValueX(java.lang.String valueX)
          Sets the valueX of the EditingTask.
 void setValueY(java.lang.String valueY)
          Sets the valueY of the EditingTask.
 void setVerticesColor(java.lang.String verticesColor)
          Sets the vertices color, e.g.
 void setVerticesOutline(java.lang.String verticesOutline)
          Sets the outline color of vertices, e.g."255,255,0"
 void setVerticesShape(int verticesShape)
          Sets the shape of vertex.
 void setVerticesSize(int verticesSize)
          Sets the size of vertex.
 void setWebContext(WebContext wContext)
          Sets associated web context.
 java.lang.Object[] snapPoint(WebPoint point)
          Returns snap result of the given point in screen reference system.
 void splitLine(MapEvent event)
          A task tool allows the user to select a point along existing segment to split the line feature.
 void splitPolygon(MapEvent event)
          A task action to sketch a line to split the polygon feature.
 void toFirst()
          Sets the selection index to 0;
 void toLast()
          Sets the selection index to the last feature in queue.
 boolean xyMode()
          Returns true if it is in xy input mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workspace

protected EditingWorkspace workspace
Editing workspace wrapper.


editingResource

protected EditingResource editingResource
Editing map resource wrapper.


currentActionID

protected java.lang.String currentActionID

taskInfo

protected EditingTaskInfo taskInfo

taskSettings

protected EditingSettings taskSettings
Snapping and selection settings

Constructor Detail

EditingTask

public EditingTask()
Method Detail

init

public void init(WebContext context)
Description copied from interface: WebContextInitialize

The initialization chores of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is initialized. It is important to note that this method is again called by the context when a GISResource is dynamically added to or removed from the context. Classes that implement this method should keep this in mind and adapt the method to react to the callbacks in these circumstances as well.

A WebContext attribute is usable only after this method has been called.

Specified by:
init in interface WebContextInitialize
Parameters:
context - WebContext- the WebContext
See Also:
WebContext.init(WebContext), WebContext#addResource(GISResource, int), WebContext.removeResource(GISResource)

destroy

public void destroy()
Description copied from interface: WebContextInitialize

The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is destroyed.

The WebContext attribute is unusable after this method has been called.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

isSnapCircle

public boolean isSnapCircle()
Returns true when snapping circle is enabled.

Returns:
Returns true when snapping circle is enabled.

setSnapCircle

public void setSnapCircle(boolean snapCircle)
Sets to true to show a circle when snapping.

Parameters:
snapCircle - Sets to true to show a circle when snapping.

isSnapEnabled

public boolean isSnapEnabled()
Returns true is snapping is enabled.

Returns:
Returns true is snapping is enabled.

setSnapEnabled

public void setSnapEnabled(boolean enabled)
Only for GUI generation.

Parameters:
enabled -

getSnapTipsColor

public java.lang.String getSnapTipsColor()
Gets the snapTipsColor of the EditingTask.

Returns:
Returns the snapTipsColor.

setSnapTipsColor

public void setSnapTipsColor(java.lang.String snapTipsColor)
Sets the snapTipsColor of the EditingTask.

Parameters:
snapTipsColor - The snapTipsColor to set.

getTaskSettings

public EditingSettings getTaskSettings()
Gets settings for the snapping and feature selection.

Returns:

getTaskInfo

public SimpleTaskInfo getTaskInfo()
Gets the task info of editing.

Returns:

getWebContext

public WebContext getWebContext()
Retrieves associated web context.

Returns:

setWebContext

public void setWebContext(WebContext wContext)
Sets associated web context.

Parameters:
wContext -

getTaskName

public java.lang.String getTaskName()
Sets task window title.

Returns:

setTaskName

public void setTaskName(java.lang.String taskName)
Gets task window title.

Parameters:
taskName -

init

protected void init()
Initiated a Editing task.


getLayerId

public int getLayerId()
A task property "layerID". Current working layer.

Returns:
the ID

setLayerId

public void setLayerId(int layerId)
A task property "layerID". Current working layer.

Parameters:
layerId -

getLayers

public java.util.Map getLayers()
A task property "layerID". Available layer list.

Returns:
layer IDs and names.

getStatusMessage

public java.lang.String getStatusMessage()
A task property "statusMessage" showing operation status.

Returns:

getShapeType

public java.lang.String getShapeType()
A task property "shapeType". Available values are: "POLYGON", "POINT", "LINE"

Returns:

getXyGeometyType

public java.lang.String getXyGeometyType()
Gets the geomety type of the tool operation.

Returns:
Returns the geometry type.

getXyLastPoint

public java.lang.String getXyLastPoint()
Gets the last entered point.

Returns:
Returns the point.

getCreateFeatureTitle

public java.lang.String getCreateFeatureTitle()
A label property in the editing window.


getEditFeatureTitle

public java.lang.String getEditFeatureTitle()
A label property in the editing window.


getEditAttributesTitle

public java.lang.String getEditAttributesTitle()
A label property in the editing window.


getEditAttributesIndTitle

public java.lang.String getEditAttributesIndTitle()
A label property in the editing window.


getVersionTitle

public java.lang.String getVersionTitle()
A label property in the editing window.


getAttributIDTitle

public java.lang.String getAttributIDTitle()
A label property in the editing window.


getUnitLabel

public java.lang.String getUnitLabel()
A label property in the settings window.


getSnappingLabel

public java.lang.String getSnappingLabel()
A label property in the settings window.


getSnappingRulesLabel

public java.lang.String getSnappingRulesLabel()
A label property in the settings window.


getVertexLabel

public java.lang.String getVertexLabel()
A label property in the settings window.


getEdgeLabel

public java.lang.String getEdgeLabel()
A label property in the settings window.


getEndLabel

public java.lang.String getEndLabel()
A label property in the settings window.


getTolerance

public int getTolerance()
Gets search tolerance in pixels.

Returns:
search tolerance in pixels.

setTolerance

public void setTolerance(int tolerance)
Sets search tolerance in pixels.

Parameters:
tolerance - search tolerance in pixels.

getToleranceInDistance

public double getToleranceInDistance(WebMap map)
Gets search tolerance in map units.

Parameters:
map - web map reference from web context.
Returns:

getSnapTolerance

public int getSnapTolerance()
Gets snapping tolerance in pixels.

Returns:
snapping tolerance in pixels.

getSnapToleranceInDistance

public double getSnapToleranceInDistance(WebMap map)
Gets snapping tolerance in map units.

Parameters:
map -
Returns:

setSnapTolerance

public void setSnapTolerance(int tol)
Sets snapping tolerance in pixels.

Parameters:
tol -

getVerticesColor

public java.lang.String getVerticesColor()
Gets the vertices color, e.g. "255,0,0"

Returns:

setVerticesColor

public void setVerticesColor(java.lang.String verticesColor)
Sets the vertices color, e.g. "255,255,0"

Parameters:
verticesColor -

getVerticesOutline

public java.lang.String getVerticesOutline()
Gets the outline color of vertices, e.g."255,255,0"

Returns:

setVerticesOutline

public void setVerticesOutline(java.lang.String verticesOutline)
Sets the outline color of vertices, e.g."255,255,0"

Parameters:
verticesOutline -

getVerticesShape

public int getVerticesShape()
Gets the shape of vertex.

Returns:

setVerticesShape

public void setVerticesShape(int verticesShape)
Sets the shape of vertex. Check com.esri.adf.web.data.symbol.WebSimpleMarkerSymbol for supported values. The default value is WebSimpleMarkerSymbol.SQUARE.

Parameters:
verticesShape -

getVerticesSize

public int getVerticesSize()
Gets the size of vertex. Default value is 8.

Returns:

setVerticesSize

public void setVerticesSize(int verticesSize)
Sets the size of vertex. Default value is 8.

Parameters:
verticesSize -

getHighlightColor

public java.lang.String getHighlightColor()
Gets the highlight color, e.g. "255,0,0"

Returns:

getTaskConfig

public EditingConfig getTaskConfig()
Gets the task configuration. It can be defined through task manager.

Returns:

setTaskConfig

public void setTaskConfig(EditingConfig config)
Sets the task configuration. It can be defined through task manager.

Parameters:
config -

setHighlightColor

public void setHighlightColor(java.lang.String highlightColor)
Sets the highlight color, e.g. "255,0,0"

Parameters:
highlightColor -

hasNext

public boolean hasNext()
Returns true when there are more selected features in the editing queue.

Returns:

hasPre

public boolean hasPre()
Returns true when the index of the selected feature is greater than 0.

Returns:

toFirst

public void toFirst()
Sets the selection index to 0;


toLast

public void toLast()
Sets the selection index to the last feature in queue.


executeLast

public void executeLast()
A task tool to move selection cursor to the last feature in queue.


executeFirst

public void executeFirst()
A task tool to move selection cursor to the first feature in queue.


executeNext

public void executeNext()
A task tool to move selection cursor to the next feature in queue.


executePre

public void executePre()
A task tool to move selection cursor to the previous feature in queue.


executeHelp

public void executeHelp()
Provides content sensitive help instruction.


getMapVersionID

public java.lang.String getMapVersionID()
Gets user selected version.

Returns:

setMapVersionID

public void setMapVersionID(java.lang.String mapVersionID)
A task property "mapVersionID", a dropdown list.

Parameters:
mapVersionID -

getMapVersionList

public java.util.Map getMapVersionList()
A task property "mapVersionID", a dropdown list.

Returns:

executeStartEditing

public void executeStartEditing()
A task tool to turn the task to editing mode.


executeStopEditingSave

public void executeStopEditingSave()
A task tool to stop and save all the edits.


executeStopEditingDiscard

public void executeStopEditingDiscard()
A task tool to stop editing and discard all the changes.


executeUndo

public void executeUndo()
A task too to undo previous edit.


executeRedo

public void executeRedo()
A task tool to redo edits


executeDeleteFeature

public void executeDeleteFeature()
A task tool to delete the selected feature.


executeMergeFeature

public void executeMergeFeature()
A task tool to operates on a selection set at least two features must be selected.


snapPoint

public java.lang.Object[] snapPoint(WebPoint point)
Returns snap result of the given point in screen reference system.

Parameters:
point - the input point in screen reference system.
Returns:
Object[]{WebPoint, String};
 1. snap point in screen reference system or null.
 2. snap layers String or null.
 

addFeaturePolygon

public void addFeaturePolygon(MapEvent event)
A task action to add polygon feature.

Parameters:
event -

addFeaturePolyline

public void addFeaturePolyline(MapEvent event)
A task action to add line feature.

Parameters:
event -

addFeaturePoint

public void addFeaturePoint(MapEvent event)
A task action to add Point feature.

Parameters:
event -

selectFeature

public void selectFeature(MapEvent event)
A task action. Upon selection the feature or features are highlighted as selected and each individual vertex in the selection is highlighted. This sets the feature selection up for modification. Each possible vertex and segment that could be modified is highlighted to the editor. Any further operations on the geometry building blocks are dictated by the specific function of the edit existing tool that is selected.

Parameters:
event -

moveFeature

public void moveFeature(MapEvent event)
A task action to re-locate the feature by clicking anywhere on the map. The feature must first be selected then the user simply clicks on the Map. The feature is moved to that exact location.

Parameters:
event -

copyFeature

public void copyFeature(MapEvent event)
A task action to copy the feature by clicking anywhere on the map to locate the new feature. The feature must first be selected then the user simply clicks on the Map. The feature is copied to that exact location.

Parameters:
event -

splitLine

public void splitLine(MapEvent event)
A task tool allows the user to select a point along existing segment to split the line feature.

Parameters:
event -

splitPolygon

public void splitPolygon(MapEvent event)
A task action to sketch a line to split the polygon feature. It must cut a segment at least twice. The feature should be split into two.

Parameters:
event -

executeClearSelection

public void executeClearSelection()
A task tool to clear all currently selected features.


addVertex

public void addVertex(MapEvent event)
A task action to insert a vertex either along an existing segment, or between two existing vertices.

Parameters:
event -

moveVertex

public void moveVertex(MapEvent event)
A task tool to move an existing vertex. The tool allows the user to select the vertex of interest. To move the vertex the editor can click anywhere on the Map they wish to re-locate it.

Parameters:
event -

deleteVertex

public void deleteVertex(MapEvent event)
A task action to delete the selected vertex. The tool allows the user to select the vertex of interest. Upon selection of vertex it is deleted. If the editor deletes the wrong vertex they can undo their action with the Undo tool.

Parameters:
event -

executeShowVertices

public void executeShowVertices()
A task tool to show vertices on selected feature.


enterXY

public void enterXY(MapEvent event)
A task tool to build or modify geometry by entering XY values instead of using a Map Mouse click.


executeEnterXY

public void executeEnterXY()
A task action to build or modify geometry by entering XY values instead of using a Map Mouse click.


executeContinueEnterXY

public void executeContinueEnterXY()
A task action to add XY values.


executeEnterFinalXY

public void executeEnterFinalXY()
A task action to enter the last XY value.


getValueX

public java.lang.String getValueX()
Gets the valueX of the EditingTask.

Returns:
Returns the valueX.

setValueX

public void setValueX(java.lang.String valueX)
Sets the valueX of the EditingTask.

Parameters:
valueX - The valueX to set.

getValueY

public java.lang.String getValueY()
Gets the valueY of the EditingTask.

Returns:
Returns the valueY.

setValueY

public void setValueY(java.lang.String valueY)
Sets the valueY of the EditingTask.

Parameters:
valueY - The valueY to set.

isEditableStatus

public boolean isEditableStatus()
Returns true if task is in editing mode.

Returns:

hasSelection

public boolean hasSelection()
Returns true if there are selected features.

Returns:

continueEnterXY

public boolean continueEnterXY()
Returns true if can continue enter XY value.

Returns:

canEnterFinalXY

public boolean canEnterFinalXY()
Returns true if can enter final XY value.

Returns:

hasVertices

public boolean hasVertices()
Returns true when showing vertices on selected features.

Returns:

hasUndo

public boolean hasUndo()
Returns true if undo is enabled.

Returns:

hasRedo

public boolean hasRedo()
Returns true if redo is enabled.

Returns:

hasEdits

public boolean hasEdits()
Returns true if there are edits available.

Returns:

xyMode

public boolean xyMode()
Returns true if it is in xy input mode.

Returns:

executeCloseEditWindows

public void executeCloseEditWindows()
A task tool to stop editing, discard unsaved edits, and close editing window.


executeApplySettings

public void executeApplySettings()
A task tool to apply snapping settings.


canAddFeatures

public boolean canAddFeatures()
Returns true if add attributes function is enabled.

Returns:

canEditAttributes

public boolean canEditAttributes()
Returns true if edit attributes function is enabled.

Returns:

canEditFeatures

public boolean canEditFeatures()
Returns true if edit features function is enabled.

Returns:

getAttributesParms

public com.esri.adf.web.ags.tasks.EditingTask.EditingParamDescriptior[] getAttributesParms()
Creates task parameters for attributes editing.


getCurrentActionID

public java.lang.String getCurrentActionID()
A hidden property getter.

Returns:

setCurrentActionID

public void setCurrentActionID(java.lang.String currentActionID)
A hidden property setter.

Returns:

getHelpInfo

public java.lang.String getHelpInfo()
Gets the help information of the EditingTask.

Returns:
Returns the help information.

setHelpInfo

public void setHelpInfo(java.lang.String helpInfo)
Sets the helpInfo of the EditingTask.

Parameters:
helpInfo - The helpInfo to set.

setDummy

public void setDummy(java.lang.String dummy)

getDummy

public java.lang.String getDummy()

getDummyList

public java.util.Map getDummyList()