com.esri.arcgis.geodatabase
Class Representation

java.lang.Object
  extended by com.esri.arcgis.geodatabase.Representation
All Implemented Interfaces:
IGraphicsOutline, IOverride, IRepresentation, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class Representation
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IRepresentation, IOverride, IGraphicsOutline, ISupportErrorInfo

A Feature Representation object.

Remarks

A feature Representation is a feature enabled with representation capabilities. When a new RepresentationClass is created, every feature in the feature class can be represented as individual representation using representation rules and override information present in the attribute fields RuleIDField and OverrideField. Since a single feature class can be asociated with multiple representation classes, a single feature can be rendered differently depending on the current representation class for drawing.

A representation is associated with a single feature in a representation class just like a feature represents a single row within a feature class.

Use IRepresentationClass.GetRepresentation method to get representation of features with respect to different map contexts.

Representations can be displayed using information from any of the following options:

  1. RepresentationRule stored in RuleID field.
  2. RepresentationRule along with Override information stored in Override field and
  3. Graphics known as free representation. This value of RuleID is -1 and the entire graphic is written into the Override field. So, a free representation can be considered as an override too.

Use IRepresentation interface to manage the properties of a feature representation including creating or modifying its shape overrides.

Use IOverride interface to manage the attribute overrides present for a feature representation. This interface cannot be used to set new attribute overrides. For this purpose, use IRepresentation::Value property along with the correct set of GraphicAttributes and index of the attribute you wish to alter.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
Representation(Object obj)
          Construct a Representation using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 IGeometry getAllOutlineParts(int type, int option, double buffer, IEnvelope clipEnvelope)
          Constructs the entire drawing outline of a graphics.
 IFeature getFeature()
          The feature associated with this representation.
 IRepresentationGraphics getGraphics()
          The Graphics object that describes the free representation.
 IMapContext getMapContext()
          Map context in which the representation is defined.
 IRepresentationClass getRepresentationClass()
          The representation class to which this representation belongs.
 int getRuleID()
          Rule ID.
 IGeometry getShape()
          Representation geometry.
 IGeometry getShapeCopy()
          Copy of the representation geometry.
 IGeometry getShapeEdit()
          Representation geometry.
 Object getValue(IGraphicAttributes attrs, int idx)
          The value of a representation property.
 int hashCode()
          the hashcode for this object
 boolean hitTest(IPoint point, double tolerance)
          Tests if a point is located on the graphics outline.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isHasAttributeOverride()
          Indicates if a graphical attribute is overriden.
 boolean isHasShapeOverride()
          Indicates if the shape is overriden.
 int isOverridenWithField(IGraphicAttributes attrs, int idx)
          Checks if the value of a graphical attribute comes from a feature field.
 IGeometry nextOutlinePart()
          Hands back the next drawing outline part.
 void removeOverride(IGraphicAttributes attrs, int idx)
          Removes a given override from the blob.
 void removeOverrides()
          Removes all attributes overrides from the representation.
 void removeShapeOverride()
          Removes the shape override.
 void reset(int type, int option, double buffer, IEnvelope clipEnvelope)
          Resets the collection of drawing outline parts to the beginning, before calling NextOutlinePart.
 void setGraphics(IRepresentationGraphics graphics)
          The Graphics object that describes the free representation.
 void setRuleID(int iD)
          Rule ID.
 void setShapeByRef(IGeometry shape)
          Representation geometry.
 void setValue(IGraphicAttributes attrs, int idx, Object val)
          The value of a representation property.
 void updateFeature()
          Updates the feature fields with the information contained in the representation.
 
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

Representation

public Representation(Object obj)
               throws IOException
Construct a Representation using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Representation.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
Representation o = (Representation)obj; // will not work

Representation o = new Representation(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems Representation theRepresentation = (Representation) obj;
Method Detail

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

getRepresentationClass

public IRepresentationClass getRepresentationClass()
                                            throws IOException,
                                                   AutomationException
The representation class to which this representation belongs.

Product Availability

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

Specified by:
getRepresentationClass in interface IRepresentation
Returns:
A reference to a com.esri.arcgis.geodatabase.IRepresentationClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeature

public IFeature getFeature()
                    throws IOException,
                           AutomationException
The feature associated with this representation.

Product Availability

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

Specified by:
getFeature in interface IRepresentation
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapContext

public IMapContext getMapContext()
                          throws IOException,
                                 AutomationException
Map context in which the representation is defined.

Product Availability

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

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

getRuleID

public int getRuleID()
              throws IOException,
                     AutomationException
Rule ID.

Remarks

Use RuleID property to change the representation rule for a feature representation. Setting this property to a different RuleID will not persist the change until UpdateFeature is called and the change for the feature is stored using IFeature::Store method.

If the RuleID does not exist in the collection of RepresentationRules object, then RuleID will return an esriRepresentationError (REP_E_INVALID_REP_RULE_ID).

Product Availability

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

Specified by:
getRuleID in interface IRepresentation
Returns:
The iD
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRuleID

public void setRuleID(int iD)
               throws IOException,
                      AutomationException
Rule ID.

Product Availability

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

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

getShape

public IGeometry getShape()
                   throws IOException,
                          AutomationException
Representation geometry.

Remarks

Shape property returns a reference to either the actual shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation.

Use Shape property to create shape override which gets stored into the Override field. UpdateFeature and IFeature::Store methods must be called after the shape is altered to persist the changes.

If IRepresentationClass::RequireShapeOverride returns False then altering the shape of the feature representation will directly alter the feature's shape.

Note: It is necessary to set IRepresentationClass::RequireShapeOverride property to True, if you wish to store the shape overrides into Override field rather than altering the actual feature's shape.

Product Availability

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

Specified by:
getShape in interface IRepresentation
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.

getShapeEdit

public IGeometry getShapeEdit()
                       throws IOException,
                              AutomationException
Representation geometry. This geometry can be a copy of the shape if the shape override option is active.

Remarks

ShapeEdit property returns a reference to the copy of either the shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation. Use this property when you wish to edit the attributes of this object.

Product Availability

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

Specified by:
getShapeEdit in interface IRepresentation
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.

getShapeCopy

public IGeometry getShapeCopy()
                       throws IOException,
                              AutomationException
Copy of the representation geometry.

Remarks

ShapeCopy property returns a reference to the clone of either the shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation. Use this property when you wish to edit the attributes of this object.

Product Availability

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

Specified by:
getShapeCopy in interface IRepresentation
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.

setShapeByRef

public void setShapeByRef(IGeometry shape)
                   throws IOException,
                          AutomationException
Representation geometry.

Product Availability

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

Specified by:
setShapeByRef in interface IRepresentation
Parameters:
shape - 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.

isHasShapeOverride

public boolean isHasShapeOverride()
                           throws IOException,
                                  AutomationException
Indicates if the shape is overriden.

Remarks

HasShapeOverride property will return True if the feature representation's shape property is overridden. To remove shape override, use RemoveShapeOverride property.

For removing other attribute overrides, use either IOverride::RemoveOverride or IOverride::RemoveOverrides method.

Product Availability

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

Specified by:
isHasShapeOverride in interface IRepresentation
Returns:
The hasShapeOverride
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeShapeOverride

public void removeShapeOverride()
                         throws IOException,
                                AutomationException
Removes the shape override.

Remarks

For removing other attribute overrides, use either IOverride::RemoveOverride or IOverride::RemoveOverrides method.

Product Availability

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

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

getGraphics

public IRepresentationGraphics getGraphics()
                                    throws IOException,
                                           AutomationException
The Graphics object that describes the free representation.

Remarks

Use Graphics property to get or set a reference to the graphic object when representation is based on free representation. A free representation (Graphics) has a RepresentationRuleID value equal to -1. For all other representations, the RuleID value is a valid value and always greater than or equal to 1.

Graphics property will return an empty object when the representation is not based on free representation.

How to convert a feature representation into a free representation which uses Graphics for drawing:

  1. Create a new RepresentationGraphics object. Use esriDisplay.IRepresentationGraphics interface for this.
  2. Set this representation graphics object to the feature representation using Graphics property. This process will assign a value of -1 to the RuleID property which is significant to a free representation.
  3. Update the feature representation using UpdateFeature.
  4. Store the changes using IFeature::Store method.

Product Availability

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

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

setGraphics

public void setGraphics(IRepresentationGraphics graphics)
                 throws IOException,
                        AutomationException
The Graphics object that describes the free representation.

Product Availability

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

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

updateFeature

public void updateFeature()
                   throws IOException,
                          AutomationException
Updates the feature fields with the information contained in the representation.

Remarks

UpdateFeature method must be called after a feature representation's attributes have been altered. In order to store and persist the changes into the feature, IFeature::Store method must be called.

Product Availability

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

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

getValue

public Object getValue(IGraphicAttributes attrs,
                       int idx)
                throws IOException,
                       AutomationException
The value of a representation property.

Product Availability

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

Specified by:
getValue in interface IRepresentation
Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValue

public void setValue(IGraphicAttributes attrs,
                     int idx,
                     Object val)
              throws IOException,
                     AutomationException
The value of a representation property.

Product Availability

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

Specified by:
setValue in interface IRepresentation
Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
val - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeOverride

public void removeOverride(IGraphicAttributes attrs,
                           int idx)
                    throws IOException,
                           AutomationException
Removes a given override from the blob.

Remarks

RemoveOverride method can be used to remove override present on a specific graphical attribute given its index. Shape overrides cannot be handled using this method. For removing shape override, use IRepresentation::RemoveShapeOverride method.

Product Availability

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

Specified by:
removeOverride in interface IOverride
Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isOverridenWithField

public int isOverridenWithField(IGraphicAttributes attrs,
                                int idx)
                         throws IOException,
                                AutomationException
Checks if the value of a graphical attribute comes from a feature field.

Product Availability

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

Specified by:
isOverridenWithField in interface IOverride
Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
Returns:
The fldIdx
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeOverrides

public void removeOverrides()
                     throws IOException,
                            AutomationException
Removes all attributes overrides from the representation.

Remarks

RemoveOverrides method can be used to remove all overrides (except shape overrides) present on a feature representation.

For removing shape override, use IRepresentation::RemoveShapeOverride method.

Product Availability

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

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

isHasAttributeOverride

public boolean isHasAttributeOverride()
                               throws IOException,
                                      AutomationException
Indicates if a graphical attribute is overriden.

Remarks

HasAttributeOverride property will return True when a feature representation has attribute overrides. To get information on whether or not the representation has shape overrides, use IRepresentation::HasShapeOverride property.

Product Availability

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

Specified by:
isHasAttributeOverride in interface IOverride
Returns:
The hasAttributeOverride
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hitTest

public boolean hitTest(IPoint point,
                       double tolerance)
                throws IOException,
                       AutomationException
Tests if a point is located on the graphics outline.

Product Availability

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

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

getAllOutlineParts

public IGeometry getAllOutlineParts(int type,
                                    int option,
                                    double buffer,
                                    IEnvelope clipEnvelope)
                             throws IOException,
                                    AutomationException
Constructs the entire drawing outline of a graphics.

Product Availability

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

Specified by:
getAllOutlineParts in interface IGraphicsOutline
Parameters:
type - A com.esri.arcgis.display.esriOutlineType constant (in)
option - A com.esri.arcgis.display.esriOutlineOption constant (in)
buffer - The buffer (in)
clipEnvelope - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
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.

reset

public void reset(int type,
                  int option,
                  double buffer,
                  IEnvelope clipEnvelope)
           throws IOException,
                  AutomationException
Resets the collection of drawing outline parts to the beginning, before calling NextOutlinePart. To be used when drawing outline of a graphics is accessed part by part.

Product Availability

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

Specified by:
reset in interface IGraphicsOutline
Parameters:
type - A com.esri.arcgis.display.esriOutlineType constant (in)
option - A com.esri.arcgis.display.esriOutlineOption constant (in)
buffer - The buffer (in)
clipEnvelope - 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.

nextOutlinePart

public IGeometry nextOutlinePart()
                          throws IOException,
                                 AutomationException
Hands back the next drawing outline part. It is necessary to call the Reset method before iterating with the NextOutlinePart method.

Product Availability

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

Specified by:
nextOutlinePart in interface IGraphicsOutline
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.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.