com.esri.arcgis.editor
Class ISketchToolProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.editor.ISketchToolProxy
All Implemented Interfaces:
ISketchTool, Externalizable, Serializable

public class ISketchToolProxy
extends com.esri.arcgis.interop.Dispatch
implements ISketchTool, Serializable

Provides access to members that control the main sketch tool.

Remarks

The SketchTool object is the default sketch tool on the Editor toolbar. This sketch tool has its own context menu with commands such as Direction, Distance, and Parallel. Add your own custom commands or macros to the Sketch Tool context menu using the Customize dialog box.

Use ISketchTool when you want to set and get specific information about the Sketch tool. For example, when creating a custom Sketch tool menu item, you may need to get the Sketch tool’s current location or the edit sketch anchor point. For example, the Parallel command uses the Location property to find the feature on which the sketch tool was rightclicked before the command was selected.

When To Use

Use ISketchTool when you want to set and get specific information about the sketch tool.

Product Availability

Available with ArcGIS Desktop.

See Also:
IPoint, IEditProperties, IEditAttributeProperties, IEditSketch, Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  ISketchToolProxy()
           
  ISketchToolProxy(Object obj)
           
protected ISketchToolProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void addPoint(IPoint point, boolean esri_clone, boolean allowUndo)
          Adds a point to the sketch.
 IPoint getAnchor()
          The anchor of the sketch.
 double getAngleConstraint()
          The sketch's angular constraint.
 int getConstraint()
          The sketch constraint.
 double getDistanceConstraint()
          The sketch's distance constraint.
 IPoint getLocation()
          The current location of the mouse.
 boolean isStreaming()
          Indicates whether stream mode digitizing is enabled.
 void removeListener(String iidStr, Object theListener)
           
 void setAngleConstraint(double val)
          The sketch's angular constraint.
 void setConstraint(int constraint)
          The sketch constraint.
 void setDistanceConstraint(double val)
          The sketch's distance constraint.
 void setIsStreaming(boolean isStreaming)
          Indicates whether stream mode digitizing is enabled.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ISketchToolProxy

public ISketchToolProxy()

ISketchToolProxy

public ISketchToolProxy(Object obj)
                 throws IOException
Throws:
IOException

ISketchToolProxy

protected ISketchToolProxy(Object obj,
                           String iid)
                    throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getAnchor

public IPoint getAnchor()
                 throws IOException,
                        AutomationException
The anchor of the sketch.

Description

Read-only property. Returns the point location for the sketch anchor .

Remarks

The anchor point is the pivot point for the rubberband feedback used in sketching polylines and polygons. It is also the last point added to the edit sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getAnchor in interface ISketchTool
Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLocation

public IPoint getLocation()
                   throws IOException,
                          AutomationException
The current location of the mouse.

Description

Read-only property. Returns the point location of the mouse.

Remarks

The Location Property can be used to determine whether the current location of the mouse is suitable for adding a point to the edit sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getLocation in interface ISketchTool
Returns:
A reference to a com.esri.arcgis.geometry.IPoint
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConstraint

public int getConstraint()
                  throws IOException,
                         AutomationException
The sketch constraint.

Description

Gets/sets the esriSketchConstraint type applied to the sketch tool.

Remarks

The Constraint property gets/sets the current sketch constraint type applied to the sketch tool. The default constraint is esriConstraintNone.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getConstraint in interface ISketchTool
Returns:
A com.esri.arcgis.editor.esriSketchConstraint constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setConstraint

public void setConstraint(int constraint)
                   throws IOException,
                          AutomationException
The sketch constraint.

Description

Gets/sets the esriSketchConstraint type applied to the sketch tool.

Remarks

The Constraint property gets/sets the current sketch constraint type applied to the sketch tool. The default constraint is esriConstraintNone.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setConstraint in interface ISketchTool
Parameters:
constraint - A com.esri.arcgis.editor.esriSketchConstraint constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAngleConstraint

public double getAngleConstraint()
                          throws IOException,
                                 AutomationException
The sketch's angular constraint.

Description

Gets/Sets angular constraints applied to the sketch tool.

Remarks

The AngleConstraint property can be used to retrieve angular constraints applied to the sketch tool using the 'Angle' sketch tool context menu choices or can be used to set angular constraints to the sketch directly. This property sets/gets angle values measured in radians. To convert radians to degrees use the following formula: degrees = radians * (pi/180)

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getAngleConstraint in interface ISketchTool
Returns:
The val
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAngleConstraint

public void setAngleConstraint(double val)
                        throws IOException,
                               AutomationException
The sketch's angular constraint.

Description

Gets/Sets angular constraints applied to the sketch tool.

Remarks

The AngleConstraint property can be used to retrieve angular constraints applied to the sketch tool using the 'Angle' sketch tool context menu choices or can be used to set angular constraints to the sketch directly. This property sets/gets angle values measured in radians. To convert radians to degrees use the following formula: degrees = radians * (pi/180)

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getDistanceConstraint

public double getDistanceConstraint()
                             throws IOException,
                                    AutomationException
The sketch's distance constraint.

Description

Gets/sets length constraints applied to the sketch tool.

Remarks

This returns the current distance constraint that may have been established, for example, through the Sketch Tool context menu item 'Length'. This property can also be set, and in order to activate the distance constraint the Constraint property must be set to esriConstraintDistance. (see example code, where esriConstraintAngle is used )

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getDistanceConstraint in interface ISketchTool
Returns:
The val
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDistanceConstraint

public void setDistanceConstraint(double val)
                           throws IOException,
                                  AutomationException
The sketch's distance constraint.

Description

Gets/sets length constraints applied to the sketch tool.

Remarks

The DistanceConstraint property can be used to retreieve length constraints applied to the sketch tool using the 'Length' sketch tool context menu choice or can be used to set distance constraints directly.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

isStreaming

public boolean isStreaming()
                    throws IOException,
                           AutomationException
Indicates whether stream mode digitizing is enabled.

Remarks

Use IsStreaming to start and stop stream mode digitizing when using the Sketch Tool.

If you set the value of IsStreaming equal to TRUE, the Sketch Tool will add points to the sketch as you move the mouse around the map. You can get/set the StreamTolerance value using the IEditProperties interface.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

setIsStreaming

public void setIsStreaming(boolean isStreaming)
                    throws IOException,
                           AutomationException
Indicates whether stream mode digitizing is enabled.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

addPoint

public void addPoint(IPoint point,
                     boolean esri_clone,
                     boolean allowUndo)
              throws IOException,
                     AutomationException
Adds a point to the sketch.

Description

Adds a new point to the edit sketch.

Remarks

Same as calling IEditSketch::AddPoint, this method adds a new point to the sketch geometry. The optional clone argument will create a copy of the point object before adding it to the sketch.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
addPoint in interface ISketchTool
Parameters:
point - A reference to a com.esri.arcgis.geometry.IPoint (in)
esri_clone - The esri_clone (in)
allowUndo - The allowUndo (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.