com.esri.arcgis.controls
Class Snapping

java.lang.Object
  extended by com.esri.arcgis.controls.Snapping
All Implemented Interfaces:
ISnappingEnvironment, ISnappingEnvironment2, com.esri.arcgis.interop.RemoteObjRef, IExtension, Serializable

public class Snapping
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ISnappingEnvironment, ISnappingEnvironment2, IExtension

Provides the snapping environment for tools to use.

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IExtension
IID, IID7f657ec9_dbf1_11d2_9f2f_00c04f6bc69e, xxDummy
 
Constructor Summary
Snapping()
          Constructs a Snapping using ArcGIS Engine.
Snapping(Object obj)
          Construct a Snapping using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 String getName()
          The name of the extension.
 IPointSnapper getPointSnapper()
          Returns the point snapper.
 int getSnappingType()
          The types of snapping currently being considered.
 IColor getSnapSymbolColor()
          The color of the snapping symbol.
 ITextSymbol getSnapTipSymbol()
          The symbol that displays the snap tip.
 int getSnapTipType()
          The types of snapping tip to be displayed.
 int getTolerance()
          Sets the snap tolerance in pixels.
 int hashCode()
          the hashcode for this object
 boolean isEnabled()
          Toggles snapping on/off.
 boolean isIgnoreBasemapLayers()
          Ignores basemap layers.
 boolean isIgnoreIMSLayers()
          Ignores layers with slow response times.
 boolean isShowSnapTipBackground()
          Toggles snap tip background on/off.
 boolean isShowSnapTips()
          Toggles snap tips on/off.
 boolean isTextSnapping()
          Toggles snapping to text on/off.
 void setEnabled(boolean snapping)
          Toggles snapping on/off.
 void setIgnoreBasemapLayers(boolean flag)
          Ignores basemap layers.
 void setIgnoreIMSLayers(boolean flag)
          Ignores layers with slow response times.
 void setPointSnapperByRef(IPointSnapper snapper)
          Returns the point snapper.
 void setShowSnapTipBackground(boolean show)
          Toggles snap tip background on/off.
 void setShowSnapTips(boolean show)
          Toggles snap tips on/off.
 void setSnappingType(int options)
          The types of snapping currently being considered.
 void setSnapSymbolColorByRef(IColor color)
          The color of the snapping symbol.
 void setSnapTipSymbolByRef(ITextSymbol symbol)
          The symbol that displays the snap tip.
 void setSnapTipType(int options)
          The types of snapping tip to be displayed.
 void setTextSnapping(boolean snapping)
          Toggles snapping to text on/off.
 void setTolerance(int tol)
          Sets the snap tolerance in pixels.
 void shutdown()
          Shuts down the extension.
 void startup(Object initializationData)
          Starts up the extension with the given initialization data.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

Snapping

public Snapping()
         throws IOException,
                UnknownHostException
Constructs a Snapping using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

Snapping

public Snapping(Object obj)
         throws IOException
Construct a Snapping using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Snapping.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems Snapping theSnapping = (Snapping) obj;
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

isEnabled

public boolean isEnabled()
                  throws IOException,
                         AutomationException
Toggles snapping on/off.

Remarks

The Enabled property determines whether the snapping environment is active. If enabled, tools that utilize the mouse movement will return valid ISnappingResult references. Because this is setting is shared across all tools and applications, it is not recommended that individual tools modify this setting.

Product Availability

Available with ArcGIS Engine.

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

setEnabled

public void setEnabled(boolean snapping)
                throws IOException,
                       AutomationException
Toggles snapping on/off.

Product Availability

Available with ArcGIS Engine.

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

isTextSnapping

public boolean isTextSnapping()
                       throws IOException,
                              AutomationException
Toggles snapping to text on/off.

Product Availability

Available with ArcGIS Engine.

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

setTextSnapping

public void setTextSnapping(boolean snapping)
                     throws IOException,
                            AutomationException
Toggles snapping to text on/off.

Product Availability

Available with ArcGIS Engine.

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

getSnappingType

public int getSnappingType()
                    throws IOException,
                           AutomationException
The types of snapping currently being considered.

Remarks

Use the esriSnappingType enumeration to define which snapping types should be evaluated when IPointSnapper.Snap is called. An individual snapping type can be specified, or a combination of snapping types may be used. The combination of snapping types is accomplished using a bit mask.

Snapping Types are evaluated in a fixed order defined below:

  1. esriSnappingTypePoint
  2. esriSnappingTypeIntersection
  3. esriSnappingTypeEndpoint
  4. esriSnappingTypeVertex
  5. esriSnappingTypeMidpoint
  6. esriSnappingTypeTangent
  7. esriSnappingTypeEdge

SnappingType is an application-level setting.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSnappingType in interface ISnappingEnvironment
Returns:
A com.esri.arcgis.controls.esriSnappingType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnappingType

public void setSnappingType(int options)
                     throws IOException,
                            AutomationException
The types of snapping currently being considered.

Product Availability

Available with ArcGIS Engine.

Specified by:
setSnappingType in interface ISnappingEnvironment
Parameters:
options - A com.esri.arcgis.controls.esriSnappingType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowSnapTips

public boolean isShowSnapTips()
                       throws IOException,
                              AutomationException
Toggles snap tips on/off.

Remarks

Determines whether snap tips are shown when a snapping type is satisfied. By default, snap tips are shown. The information displayed in the snap tip is determined by ISnappingEnvironment.SnapTipType.

ShowSnapTips is an application-level setting.

Product Availability

Available with ArcGIS Engine.

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

setShowSnapTips

public void setShowSnapTips(boolean show)
                     throws IOException,
                            AutomationException
Toggles snap tips on/off.

Product Availability

Available with ArcGIS Engine.

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

getSnapTipType

public int getSnapTipType()
                   throws IOException,
                          AutomationException
The types of snapping tip to be displayed.

Remarks

The snapping tip type can contain the layer name of the feature layer that was snapped to, or the snapping type that was satisfied. The default is to show both the layer name and the snapping type as part of the snap tip.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSnapTipType in interface ISnappingEnvironment
Returns:
A com.esri.arcgis.controls.esriSnappingTipType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapTipType

public void setSnapTipType(int options)
                    throws IOException,
                           AutomationException
The types of snapping tip to be displayed.

Product Availability

Available with ArcGIS Engine.

Specified by:
setSnapTipType in interface ISnappingEnvironment
Parameters:
options - A com.esri.arcgis.controls.esriSnappingTipType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSnapTipSymbol

public ITextSymbol getSnapTipSymbol()
                             throws IOException,
                                    AutomationException
The symbol that displays the snap tip.

Remarks

The SnapTipSymbol defines the textsymbol that is used to display information provided in the snap result’s description after a valid snap location was found. If ISnappingEnvironment.SnapTipType = 0 (no snap tip) this setting had no effect.


You have a number of options to customize the tip symbol, including advanced text capabilities provided by IFormattedTextSymbol to provide options for backgrounds, offsets, or right-to-left text capabilities.
The location of the tip is not customizable; the application will display the snap tip above and to the right of the snap location, unless at the extreme top or right bounds of the display.
SnapTipSymbol is an application-level setting.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSnapTipSymbol in interface ISnappingEnvironment
Returns:
A reference to a com.esri.arcgis.display.ITextSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapTipSymbolByRef

public void setSnapTipSymbolByRef(ITextSymbol symbol)
                           throws IOException,
                                  AutomationException
The symbol that displays the snap tip.

Product Availability

Available with ArcGIS Engine.

Specified by:
setSnapTipSymbolByRef in interface ISnappingEnvironment
Parameters:
symbol - A reference to a com.esri.arcgis.display.ITextSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowSnapTipBackground

public boolean isShowSnapTipBackground()
                                throws IOException,
                                       AutomationException
Toggles snap tip background on/off.

Remarks

The snapping tip uses XOR to display the snapping tip text. If you are snapping against an orthophoto or other imagery data source, the text may be difficult to see. By setting ShowTipBackground to true, a solid color is displayed so the snap tip text may be clearly seen.

This is an application-level setting, and is false by default.

Product Availability

Available with ArcGIS Engine.

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

setShowSnapTipBackground

public void setShowSnapTipBackground(boolean show)
                              throws IOException,
                                     AutomationException
Toggles snap tip background on/off.

Product Availability

Available with ArcGIS Engine.

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

getSnapSymbolColor

public IColor getSnapSymbolColor()
                          throws IOException,
                                 AutomationException
The color of the snapping symbol.

Remarks

Specifies the color of the snapping symbol displayed when a valid snap result was found. The default color is black. Changing the color to a high contrast value such as yellow or cyan is particularly useful in situations where you are working against imagery or other layers symbolized using grayscale. The snap symbol itself cannot be altered.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSnapSymbolColor in interface ISnappingEnvironment
Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSnapSymbolColorByRef

public void setSnapSymbolColorByRef(IColor color)
                             throws IOException,
                                    AutomationException
The color of the snapping symbol.

Product Availability

Available with ArcGIS Engine.

Specified by:
setSnapSymbolColorByRef in interface ISnappingEnvironment
Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTolerance

public void setTolerance(int tol)
                  throws IOException,
                         AutomationException
Sets the snap tolerance in pixels.

Product Availability

Available with ArcGIS Engine.

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

getTolerance

public int getTolerance()
                 throws IOException,
                        AutomationException
Sets the snap tolerance in pixels.

Remarks

The tolerance defines the distance used to determine whether a given snapping type is satisfied. The tolerance is defined in pixels; the default is 7 pixels.


The tolerance is an application-level setting.

Product Availability

Available with ArcGIS Engine.

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

getPointSnapper

public IPointSnapper getPointSnapper()
                              throws IOException,
                                     AutomationException
Returns the point snapper.

Remarks

The PointSnapper property returns a reference to the engine that is responsible for performing snapping operations.

Product Availability

Available with ArcGIS Engine.

Specified by:
getPointSnapper in interface ISnappingEnvironment
Returns:
A reference to a com.esri.arcgis.controls.IPointSnapper
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPointSnapperByRef

public void setPointSnapperByRef(IPointSnapper snapper)
                          throws IOException,
                                 AutomationException
Returns the point snapper.

Product Availability

Available with ArcGIS Engine.

Specified by:
setPointSnapperByRef in interface ISnappingEnvironment
Parameters:
snapper - A reference to a com.esri.arcgis.controls.IPointSnapper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isIgnoreIMSLayers

public boolean isIgnoreIMSLayers()
                          throws IOException,
                                 AutomationException
Ignores layers with slow response times.

Remarks

The IgnoreIMSLayers setting excludes IMS feature service layers from participating in the snapping cache. In most cases, the time required to build the snapping cache against IMS layers is not fast enough, so they are automatically excluded from the snapping cache. In certain situations, the IMS layer response time is reasonable (such as an IMS service on an intranet) setting this property to false will include these layers in the snapping cache. IgnoreIMSLayers is set to true by default.

Product Availability

Available with ArcGIS Engine.

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

setIgnoreIMSLayers

public void setIgnoreIMSLayers(boolean flag)
                        throws IOException,
                               AutomationException
Ignores layers with slow response times.

Product Availability

Available with ArcGIS Engine.

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

isIgnoreBasemapLayers

public boolean isIgnoreBasemapLayers()
                              throws IOException,
                                     AutomationException
Ignores basemap layers.

Product Availability

Available with ArcGIS Engine.

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

setIgnoreBasemapLayers

public void setIgnoreBasemapLayers(boolean flag)
                            throws IOException,
                                   AutomationException
Ignores basemap layers.

Product Availability

Available with ArcGIS Engine.

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

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the extension.

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

startup

public void startup(Object initializationData)
             throws IOException,
                    AutomationException
Starts up the extension with the given initialization data.

Specified by:
startup in interface IExtension
Parameters:
initializationData - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

shutdown

public void shutdown()
              throws IOException,
                     AutomationException
Shuts down the extension.

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