com.esri.arcgis.editor
Class ISnapEnvironmentProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.editor.ISnapEnvironmentProxy
All Implemented Interfaces:
ISnapEnvironment, Externalizable, Serializable
Direct Known Subclasses:
ISnapEnvironment2Proxy

public class ISnapEnvironmentProxy
extends com.esri.arcgis.interop.Dispatch
implements ISnapEnvironment, Serializable

Provides access to members that manage the snap agents used by the editor.

Superseded By

ISnapEnvironment3

Remarks

The ISnapEnvironment interface is on the Editor CoClass. You can access ISnapEnvironment from any other interface on the Editor CoClass.

When To Use

The ISnapEnvironment interface manages the collection of snap agents,
the snap tolerance, and the snap tolerance units

Product Availability

Available with ArcGIS Desktop.

See Also:
ISnapEnvironment, ISnapAgent, IEditProperties, IEditTask.activate(com.esri.arcgis.editor.IEditor, com.esri.arcgis.editor.IEditTask), IEditor, IEditLayers, IEditTask.deactivate(), IEditAttributeProperties, IEditEvents2, IEditTask.onFinishSketch(), IDatasetEdit, IDatasetEditInfo, IEditTask.onDeleteSketch(), IEditTask.getName(), IEditEvents, Editor, esriSnapToleranceUnits, 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
  ISnapEnvironmentProxy()
           
  ISnapEnvironmentProxy(Object obj)
           
protected ISnapEnvironmentProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void addSnapAgent(ISnapAgent snapAgent)
          Adds a new snap agent to the snap environment.
 void clearSnapAgents()
          Removes all snap agents.
 ISnapAgent getSnapAgent(int index)
          A snap agent at the given index.
 int getSnapAgentCount()
          The number of active snap agents.
 double getSnapTolerance()
          The snap tolerance, measured in pixels or map units.
 int getSnapToleranceUnits()
          The units used for the snap tolerance.
 void removeListener(String iidStr, Object theListener)
           
 void removeSnapAgent(int index)
          Removes the snap agent at the given index.
 void setSnapTolerance(double tol)
          The snap tolerance, measured in pixels or map units.
 void setSnapToleranceUnits(int units)
          The units used for the snap tolerance.
 boolean snapPoint(IPoint point)
          Attempts to snap the point using the current snap environment.
 
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

ISnapEnvironmentProxy

public ISnapEnvironmentProxy()

ISnapEnvironmentProxy

public ISnapEnvironmentProxy(Object obj)
                      throws IOException
Throws:
IOException

ISnapEnvironmentProxy

protected ISnapEnvironmentProxy(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

snapPoint

public boolean snapPoint(IPoint point)
                  throws IOException,
                         AutomationException
Attempts to snap the point using the current snap environment.

Description

SnapPoint passes the required point parameter to each of the added Snap Agents in the order that these agents were added. The agents attempt, in turn, to find point coordinates that fulfill its snap properties for the incoming point. If a new snap location is found, the relevant snap agent modifies the original point's coordinates to that of the new location. The same point is then returned to SnapPoint. Once a snap agent is found that satisfies the point subsequent snap agents are not tested.


Remarks

As an example: there may be several FeatureSnap agents present. Each receives a point from the current cursor location, which is passed to the agent via the SnapPoint method. If the conditions for a snap are met, the boolean value of the agent returns TRUE, the point's coordinates are updated based on the active FeatureSnap's conditions and the same point is returned to SnapPoint. In the Editor, the InvertAgent location is always set equal to this point. Thus, when snapping conditions are met, the InvertAgent (blue dot) is passed the point with altered coordinates, and the corresponding location shift is manifested as a "snap".

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getSnapToleranceUnits

public int getSnapToleranceUnits()
                          throws IOException,
                                 AutomationException
The units used for the snap tolerance.

Remarks

SnapToleranceUnits defines the method of type esriSnapToleranceUnits used to define the radius used by active snap agents. The default value is esriSnapTolerancePixels.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

setSnapToleranceUnits

public void setSnapToleranceUnits(int units)
                           throws IOException,
                                  AutomationException
The units used for the snap tolerance.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setSnapToleranceUnits in interface ISnapEnvironment
Parameters:
units - A com.esri.arcgis.editor.esriSnapToleranceUnits constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapTolerance

public double getSnapTolerance()
                        throws IOException,
                               AutomationException
The snap tolerance, measured in pixels or map units.

Remarks

SnapTolerance this property is the size of the region bounding the input point location. It is given as a radius, measured in pixels, and the search for a potential snap point candidate is made within this region.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

setSnapTolerance

public void setSnapTolerance(double tol)
                      throws IOException,
                             AutomationException
The snap tolerance, measured in pixels or map units.

Description

SnapTolerance this property is the size of the region bounding the input point location. It is given as a radius, measured in pixels, and the search for a potential snap point candidate is made within this region.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getSnapAgentCount

public int getSnapAgentCount()
                      throws IOException,
                             AutomationException
The number of active snap agents.

Description

SnapAgentCount returns the number of currently active snap agents.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getSnapAgent

public ISnapAgent getSnapAgent(int index)
                        throws IOException,
                               AutomationException
A snap agent at the given index.

Product Availability

Available with ArcGIS Desktop.

Specified by:
getSnapAgent in interface ISnapEnvironment
Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.editor.ISnapAgent
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearSnapAgents

public void clearSnapAgents()
                     throws IOException,
                            AutomationException
Removes all snap agents.

Remarks

ClearSnapAgents deactivates all snap agents and sets the SnapAgentCount to zero.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

removeSnapAgent

public void removeSnapAgent(int index)
                     throws IOException,
                            AutomationException
Removes the snap agent at the given index.

Remarks

RemoveSnapAgent removes the Snap Agent represented by the value of the index number passed to the method.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

addSnapAgent

public void addSnapAgent(ISnapAgent snapAgent)
                  throws IOException,
                         AutomationException
Adds a new snap agent to the snap environment.

Remarks

AddSnapAgent activates and adds to the snap environment any valid snap agent, such as FeatureSnap, AnchorSnap, or PerpendicularSnap.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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