com.esri.arcgis.carto
Interface IGraphicSnap

All Superinterfaces:
Serializable
All Known Subinterfaces:
IPageLayoutSnap
All Known Implementing Classes:
GridSnap, GuideSnap, MarginSnap, RulerSnap

public interface IGraphicSnap
extends Serializable

Provides access to members that control snapping graphics.

Remarks

The graphic snap is used to create snap agents that snaps graphics to the grid, guides, margins and rulers of the page layout.

There are three different types of graphic snaps: the guide snap moves graphics to the horizontal and vertical guides. The margin snap snaps graphics to the layouts printable bounds. The ruler snap snaps graphics to the rulers. They all implement the IGraphicSnap interface.

Name is the name of the snap agent.

SnapX and SnapY are unique and are used to determine if a graphic can be snapped. For example, the GridSnap agentís implementation of SnapX for polygon graphics checks if either the Xmin or Xmax of the graphics bounding rectangle is within snap tolerance of the snap grid. If either is, the graphic is moved the calculated distance between the two. SnapX and SnapY always return a Boolean, indicating whether or not the graphic was snapped. If any snap agent returns True, no other snap agents are called.

See also IPageLayoutSnap.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux


Method Summary
 String getName()
          The name of the snap agent.
 boolean snapX(IGeometry shape, double tolerance)
          Indicates if the point is snapped in the horizontal direction.
 boolean snapY(IGeometry shape, double tolerance)
          Indicates if the point is snapped in the vertical direction.
 

Method Detail

getName

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

snapX

boolean snapX(IGeometry shape,
              double tolerance)
              throws IOException,
                     AutomationException
Indicates if the point is snapped in the horizontal direction.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

snapY

boolean snapY(IGeometry shape,
              double tolerance)
              throws IOException,
                     AutomationException
Indicates if the point is snapped in the vertical direction.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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