com.esri.arcgis.controls
Class EngineSketchOperation

java.lang.Object
  extended by com.esri.arcgis.controls.EngineSketchOperation
All Implemented Interfaces:
IEngineSketchOperation, com.esri.arcgis.interop.RemoteObjRef, IOperation, Serializable

public class EngineSketchOperation
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IEngineSketchOperation, IOperation

Provides undo/redo capabilities for edit sketch modifications.

Description

This object is new at ArcGIS 9.3.
Create a sketch operation whenever you need to provide undo/redo capabilities for modifications made to the edit sketch. For example, custom code that deletes one of the vertices in the edit sketch should use a sketch operation so the user can undo the edit sketch.

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Constructor Summary
EngineSketchOperation()
          Constructs a EngineSketchOperation using ArcGIS Engine.
EngineSketchOperation(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
EngineSketchOperation theEngineSketchOperation = (EngineSketchOperation) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 void esri_do()
          Performs the operation.
 void finish(IEnvelope invalEnv, int opType, Object data)
          Finishes the sketch operation and puts it into the operation stack.
static String getClsid()
          getClsid.
 String getMenuString()
          The menu string.
 int hashCode()
          the hashcode for this object
 boolean isCanRedo()
          Indicates if the operation can be redone.
 boolean isCanUndo()
          Indicates if the operation can be undone.
 void redo()
          Redoes the operation.
 void setMenuString(String menuString)
          Sets the text that appears in the undo menu choice.
 void start(IEngineEditor editor)
          Starts the sketch operation and caches the existing sketch.
 void undo()
          Undoes the operation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

EngineSketchOperation

public EngineSketchOperation()
                      throws IOException,
                             UnknownHostException
Constructs a EngineSketchOperation using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

EngineSketchOperation

public EngineSketchOperation(Object obj)
                      throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
EngineSketchOperation theEngineSketchOperation = (EngineSketchOperation) obj;

Construct a EngineSketchOperation using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to EngineSketchOperation.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setMenuString

public void setMenuString(String menuString)
                   throws IOException,
                          AutomationException
Sets the text that appears in the undo menu choice.

Product Availability

Available with ArcGIS Engine.

Specified by:
setMenuString in interface IEngineSketchOperation
Parameters:
menuString - The menuString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

start

public void start(IEngineEditor editor)
           throws IOException,
                  AutomationException
Starts the sketch operation and caches the existing sketch. Call this before modifying the sketch.

Description

Modifications made to an edit sketch should be contained between calls to Start and Finish. Start caches the edit sketch's geometry in case the sketch operation is undone; when this occurs, the modified geometry is replaced by the cached geometry.

Product Availability

Available with ArcGIS Engine.

Specified by:
start in interface IEngineSketchOperation
Parameters:
editor - A reference to a com.esri.arcgis.controls.IEngineEditor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

finish

public void finish(IEnvelope invalEnv,
                   int opType,
                   Object data)
            throws IOException,
                   AutomationException
Finishes the sketch operation and puts it into the operation stack. Call this after the sketch has been modified.

Description

The Finish method completes the sketch operation and adds the sketch operation to the top of the operations stack. The method allows tools to give more information about what they modified using the following parameters; InvalEnv, OpType and Data.

InvalEnv determines the envelope that will be invalidated (refreshed) when the sketch operation is completed. OpType determines which method on IEngineEditSketch will be fired to notify all listeners that the edit sketch has changed and give them appropriate information as to how the edit sketch was modified. Data is a variant value that can pass an IPoint as an argument to the appropriate method on IEngineEditSketch, such as OnVertexAdded.

Product Availability

Available with ArcGIS Engine.

Specified by:
finish in interface IEngineSketchOperation
Parameters:
invalEnv - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
opType - A com.esri.arcgis.controls.esriEngineSketchOperationType constant (in)
data - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMenuString

public String getMenuString()
                     throws IOException,
                            AutomationException
The menu string.

Description

The MenuString associated with the Operation. This is used by the application framework to populate the Edit menu in ArcMap. For example, adding a layer to ArcMap adds the menu string of the Operation "Undo Add Layers(s)" to the Edit menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMenuString in interface IOperation
Returns:
The text
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCanUndo

public boolean isCanUndo()
                  throws IOException,
                         AutomationException
Indicates if the operation can be undone.

Description

CanUndo indicates if the operation can be un-done. Use the property before using the Undo method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isCanUndo in interface IOperation
Returns:
The result
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCanRedo

public boolean isCanRedo()
                  throws IOException,
                         AutomationException
Indicates if the operation can be redone.

Description

CanRedo indicates if the operation can be re-done. Use the property before using the Redo method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isCanRedo in interface IOperation
Returns:
The result
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_do

public void esri_do()
             throws IOException,
                    AutomationException
Performs the operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
esri_do in interface IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

undo

public void undo()
          throws IOException,
                 AutomationException
Undoes the operation.

Description

Undo the operation to reset the action from the Do method. Use the CanUndo property to determine whether the operation can be un-done.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
undo in interface IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

redo

public void redo()
          throws IOException,
                 AutomationException
Redoes the operation.

Description

Redo the operation to redo the action from the Do method. Use the CanRedo property to determine whether the operation can be re-done.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
redo in interface IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.