com.esri.arcgis.carto
Interface IGraphicSnapEnvironment

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
GraphicSnapEnvironment, IGraphicSnapEnvironmentProxy, PageLayout

public interface IGraphicSnapEnvironment
extends java.io.Serializable

Provides access to members that control the Collection of snap agents used for snapping graphics.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Remarks

Use the IGraphicSnapEnvironment interface to manage the snap agents of the Pagelayout.

Methods are provided to count, add, delete and clear (delete all) the snap agents. This interface also provides access to the SnapTolerance.

Graphics are snapped into place by calling SnapShape. SnapShape in turn calls IGraphicSnap::SnapX and IGraphicSnap::SnapY on each active snap agent (in the order specified by IGraphicSnapEnvironment::SnapAgentOrder) until one of the snap agents returns True. SnapX and SnapY are separate calls because some agents, such as guides, may only act in one direction.

See also IGraphicSnap and IPageLayoutSnap.


Method Summary
 void addSnapAgent(IGraphicSnap snapAgent)
          Add a new snap agent to the environment.
 void clearSnapAgents()
          Remove all snap agents.
 void deleteSnapAgent(IGraphicSnap snapAgent)
          Remove specified snap agent from the environment.
 IGraphicSnap getSnapAgent(int index)
          The snap agent at the specified index.
 int getSnapAgentCount()
          The number of snap agents.
 IArray getSnapAgentOrder()
          An array of IDs indicating how agents should be ordered.
 double getSnapTolerance()
          The snap tolerance in page units.
 void setSnapAgentOrder(IArray guids)
          An array of IDs indicating how agents should be ordered.
 void setSnapTolerance(double tol)
          The snap tolerance in page units.
 void snapShape(IGeometry shape)
          Snap the shape using the agents in the environment.
 

Method Detail

snapShape

public void snapShape(IGeometry shape)
               throws java.io.IOException,
                      AutomationException
Snap the shape using the agents in the environment.

Supported Platforms

Windows, Solaris, Linux

Parameters:
shape - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapTolerance

public double getSnapTolerance()
                        throws java.io.IOException,
                               AutomationException
The snap tolerance in page units.

Supported Platforms

Windows, Solaris, Linux

Returns:
The tol
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapTolerance

public void setSnapTolerance(double tol)
                      throws java.io.IOException,
                             AutomationException
The snap tolerance in page units.

Supported Platforms

Windows, Solaris, Linux

Parameters:
tol - The tol (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapAgentOrder

public void setSnapAgentOrder(IArray guids)
                       throws java.io.IOException,
                              AutomationException
An array of IDs indicating how agents should be ordered.

Supported Platforms

Windows, Solaris, Linux

Parameters:
guids - A reference to a com.esri.arcgis.system.IArray (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapAgentOrder

public IArray getSnapAgentOrder()
                         throws java.io.IOException,
                                AutomationException
An array of IDs indicating how agents should be ordered.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.IArray
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapAgentCount

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapAgent

public IGraphicSnap getSnapAgent(int index)
                          throws java.io.IOException,
                                 AutomationException
The snap agent at the specified index. The index argument is zero based.

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.IGraphicSnap
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearSnapAgents

public void clearSnapAgents()
                     throws java.io.IOException,
                            AutomationException
Remove all snap agents.

Supported Platforms

Windows, Solaris, Linux

Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addSnapAgent

public void addSnapAgent(IGraphicSnap snapAgent)
                  throws java.io.IOException,
                         AutomationException
Add a new snap agent to the environment.

Supported Platforms

Windows, Solaris, Linux

Parameters:
snapAgent - A reference to a com.esri.arcgis.carto.IGraphicSnap (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteSnapAgent

public void deleteSnapAgent(IGraphicSnap snapAgent)
                     throws java.io.IOException,
                            AutomationException
Remove specified snap agent from the environment.

Supported Platforms

Windows, Solaris, Linux

Parameters:
snapAgent - A reference to a com.esri.arcgis.carto.IGraphicSnap (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.