com.esri.arcgis.carto
Interface IElement

All Superinterfaces:
Serializable
All Known Implementing Classes:
BmpPictureElement, CircleElement, DataGraphTElement, EllipseElement, EmfPictureElement, FrameElement, GifPictureElement, GroupElement, ImgPictureElement, InkGraphic, Jp2PictureElement, JpgPictureElement, LineElement, MapFrame, MapSurroundFrame, MarkerElement, MultiPatchElement, OleFrame, ParagraphTextElement, PictureElement, PMFTitleTextElement, PngPictureElement, PolygonElement, RectangleElement, SidPictureElement, Text3DElement, TextElement, TifPictureElement

public interface IElement
extends Serializable

Provides access to members that control the Element.

Remarks

IElement is the generic interface implemented by all Element objects (TextElement, PolygonElement, LineElement, MapSurroundFrame, etc). The interface provides access to the geometry of the element and contains methods for drawing and performing hit tests.
An IElement object gnerally obtained and manipulated by IGraphicsContainer and IGraphicsContainerSelect objects. IElement is most often used when the developer wants to manipulate the selected set of graphics.

The geometry type of objects implementing IElement varies widely depending on what the element does. The remarks of each object implementing IElement will list the geometry types that are valid for that specific element.

Product Availability

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

See Also:
IGraphicsContainerSelect, IGraphicsContainer

Method Summary
 void activate(IDisplay display)
          Prepare to display graphic on screen.
 void deactivate()
          ActiveView that graphics are displayed on is no longer visible.
 void draw(IDisplay display, ITrackCancel trackCancel)
          Draws the element into the given display object.
 IGeometry getGeometry()
          Shape of the element as a geometry.
 ISelectionTracker getSelectionTracker()
          Selection tracker used by this element.
 boolean hitTest(double x, double y, double tolerance)
          Indicates if the given x and y coordinates are contained by the element.
 boolean isLocked()
          Indicates if the element is in a read-only state.
 void queryBounds(IDisplay display, IEnvelope bounds)
          Bounds of the element taking symbology into consideration.
 void queryOutline(IDisplay display, IPolygon outline)
          Bounds of the element taking symbology into consideration.
 void setGeometry(IGeometry pGeometry)
          Shape of the element as a geometry.
 void setLocked(boolean pLocked)
          Indicates if the element is in a read-only state.
 

Method Detail

getGeometry

IGeometry getGeometry()
                      throws IOException,
                             AutomationException
Shape of the element as a geometry.

Description

Geometry is the shape assigned to this element.

Remarks

The Geometry property will return the shape associated with the element as an IGeometry. The geometry type of objects implementing IElement varies widely depending on what the element does. The remarks of each object implementing IElement will list the geometry types that are valid for that specific element.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setGeometry

void setGeometry(IGeometry pGeometry)
                 throws IOException,
                        AutomationException
Shape of the element as a geometry.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

queryBounds

void queryBounds(IDisplay display,
                 IEnvelope bounds)
                 throws IOException,
                        AutomationException
Bounds of the element taking symbology into consideration.

Remarks

QueryBounds returns an envelope representing the boundary of the element. A valid envelope object must be passed in to the method along with the current display. The method then updates the envelope object based on the minimum bounding rectangle of the element.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
bounds - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryOutline

void queryOutline(IDisplay display,
                  IPolygon outline)
                  throws IOException,
                         AutomationException
Bounds of the element taking symbology into consideration.

Remarks

QueryOutline returns a polygon representing the outline of the element. A valid polygon object must be passed in to the method along with the current display. The method then updates the polygon object. The results for point and line elements will be similar to the minimum bounding envelope returned by QueryBounds, while the results for polygon elements while be the actual outline of the element (not the bounding envelope).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
outline - A reference to a com.esri.arcgis.geometry.IPolygon (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectionTracker

ISelectionTracker getSelectionTracker()
                                      throws IOException,
                                             AutomationException
Selection tracker used by this element.

Remarks

SelectionTracker returns the ISelectionTracker used by the element. Elements have associated selection tracker objects which provide reshaping functionality. For example, in ArcMap after adding an element, the element is drawn with a selection tracker around it and users can then drag one of the selection handles on the selection tracker to modify the element's shape.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

hitTest

boolean hitTest(double x,
                double y,
                double tolerance)
                throws IOException,
                       AutomationException
Indicates if the given x and y coordinates are contained by the element.

Remarks

HitTest returns a boolean value indicating whether or not the current element is intersected by the specified coordinate pair and tolerance distance. For instance, if we have a line element selected, the HitTest is determining whether that line element is within the specified tolerance from the given X and Y. A value of TRUE is returned if the element is within the tolerance, while FALSE is returned if it is not.

The X,Y, and tolerance values should be specified in map units.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
x - The x (in)
y - The y (in)
tolerance - The tolerance (in)
Returns:
The hit
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

draw

void draw(IDisplay display,
          ITrackCancel trackCancel)
          throws IOException,
                 AutomationException
Draws the element into the given display object.

Remarks

Draw draws the element to the screen display specified. An ITrackerCancel object can be passed in to enable cancelation of the draw wit the ESC key.
Symbolization of the element during the draw is based on the symbol that is stored with it. For instance, Marker Elements are displayed based on the Symbol property on the IMarkerElement interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
trackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

void activate(IDisplay display)
              throws IOException,
                     AutomationException
Prepare to display graphic on screen.

Remarks

Activate prepares the screen display for output and orients the scale of the element to the specified display. Activate should be executed with the current display before execute the IElement::Draw method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

deactivate

void deactivate()
                throws IOException,
                       AutomationException
ActiveView that graphics are displayed on is no longer visible.

Remarks

Deactivate means the screen display associated with element output is no longer visible.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isLocked

boolean isLocked()
                 throws IOException,
                        AutomationException
Indicates if the element is in a read-only state.

Remarks

The Locked property indicates whether the specified element can be updated. This property can be set to TRUE to stop users from modifying a particular element.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setLocked

void setLocked(boolean pLocked)
               throws IOException,
                      AutomationException
Indicates if the element is in a read-only state.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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