com.esri.arcgis.controls
Class IEngineSnapAgentProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.controls.IEngineSnapAgentProxy
All Implemented Interfaces:
IEngineSnapAgent, Externalizable, Serializable

public class IEngineSnapAgentProxy
extends com.esri.arcgis.interop.Dispatch
implements IEngineSnapAgent, Serializable

Provides access to members that snap point locations using a tolerance.

Description

The IEngineSnapAgent interface is typically used when creating new custom snap agents and when accessing properties of an existing snap agent. Implement this interface when creating a custom snap agent.

Tools that work with snapping typically call the IEngineSnapEnvironment::SnapPoint method every time the mouse moves. SnapPoint in turn calls each snap agents Snap method in succession until one of them returns true. True means a new point has been found that meets the qualifications set within a particular snap agents Snap method. For example, is the passed in point representing the sketch tools current location, within 10 meters of a parcel vertex. The first snap agent to return true, modifies the passed in points x,y location to reflect that of the new snap point location and no other snap agents are called.

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, E
 
Constructor Summary
  IEngineSnapAgentProxy()
           
  IEngineSnapAgentProxy(Object obj)
           
protected IEngineSnapAgentProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 String getName()
          The name of the engine snap agent.
 void readExternal(ObjectInput in)
           
 void removeListener(String iidStr, Object theListener)
           
 boolean snap(IGeometry geom, IPoint point, double tolerance)
          Fired by the Engine Editor to perform the actual snapping logic.
 void writeExternal(ObjectOutput out)
           
 
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, queryInterface, release, setNativeMode, setPropertyByName, toString, vtblInvoke
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IEngineSnapAgentProxy

public IEngineSnapAgentProxy()

IEngineSnapAgentProxy

public IEngineSnapAgentProxy(Object obj)
                      throws IOException
Throws:
IOException

IEngineSnapAgentProxy

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

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the engine snap agent.

Description

To find a particular snap agent to cycle through all of the loaded snap agents using the Name property.
For Feature Snap Agents, the name is that of their feature class. When creating a custom snap agent, make sure to give it a unique name.

Product Availability

Available with ArcGIS Engine.

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

snap

public boolean snap(IGeometry geom,
                    IPoint point,
                    double tolerance)
             throws IOException,
                    AutomationException
Fired by the Engine Editor to perform the actual snapping logic.

Description

Each snap agent uniquely implements the Snap method. Although each snap agent's Snap method can be called directly, typically the IEngineSnapEnvironment::SnapPoint method is used to call this function for each loaded snap agent until one of them reports it has modified the passed in point's properties. To facilitate this behavior, each snap agent's Snap method must return a boolean variable indicating whether or not it has modified the passed in points coordinates.

Snapping the passed in point means changing its x,y location properties. Because an IPoint interface pointer is passed into this function ByValue, direct edits of the point's parameters are possible. Resetting the IPoint interface to a different Point object will have no effect after leaving the scope of the function.

Product Availability

Available with ArcGIS Engine.

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

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException
ClassNotFoundException