|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esri.core.map.Graphic
public class Graphic
The Graphic class is used to represent a feature that can have any of the following types:
Geometry
Symbol
InfoTemplate
Graphic objects are immutable, which means its state cannot change after
construction. When a Graphic object is added to a GraphicsLayer via
the GraphicsLayer.addGraphic(Graphic) method, this method returns a unique
ID (UID) which you can then use to reference the added graphic for subsequent
operations. Graphic objects are stateless so there is no guarantee that a
feature in the GraphicsLayer exists after the request for the Graphic
object is completed.
Graphic objects can be displayed, altered and removed using a
GraphicsLayer (see the GraphicsLayer class for more details)
| Constructor Summary | |
|---|---|
Graphic(Geometry geometry,
Symbol symbol)
Instantiates a new Graphic object. |
|
Graphic(Geometry geometry,
Symbol symbol,
Map<String,Object> attributes,
InfoTemplate infoTemp)
Instantiates a new Graphic object. |
|
Graphic(int uid,
Geometry geometry,
Symbol symbol,
Map<String,Object> attributes,
InfoTemplate infoTemp)
Instantiates a new Graphic object. |
|
| Method Summary | |
|---|---|
static Graphic |
fromJson(org.codehaus.jackson.JsonParser parser)
Convenient method which parses the JSON representation of a graphic into a graphic object. |
String[] |
getAttributeNames()
Gets the name of all the attributes. |
Map<String,Object> |
getAttributes()
Returns all attributes of the graphic as a read-only collection. |
Object |
getAttributeValue(String key)
Gets the attribute value by the given name. |
Geometry |
getGeometry()
Gets the geometry that defines the graphic. |
InfoTemplate |
getInfoTemplate()
Returns the template. |
Symbol |
getSymbol()
Gets the symbol for the graphic. |
int |
getUid()
Gets unique ID. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Graphic(Geometry geometry,
Symbol symbol)
geometry - the geometry to draw;symbol - the symbol to draw the geometry with.
public Graphic(Geometry geometry,
Symbol symbol,
Map<String,Object> attributes,
InfoTemplate infoTemp)
geometry - The geometry to draw.symbol - The symbol to draw the geometry with.attributes - The name-value pairs of fields and their connected field
values that are associated with the graphic.infoTemp - The InfoTemplate object.
public Graphic(int uid,
Geometry geometry,
Symbol symbol,
Map<String,Object> attributes,
InfoTemplate infoTemp)
uid - The unique ID.geometry - The geometry to draw.symbol - The symbol to draw the geometry with.attributes - The name-value pairs of fields and their connected field
values that are associated with the graphicinfoTemp - The InfoTemplate object.| Method Detail |
|---|
public int getUid()
public Symbol getSymbol()
public Geometry getGeometry()
public String[] getAttributeNames()
public Object getAttributeValue(String key)
public InfoTemplate getInfoTemplate()
public Map<String,Object> getAttributes()
public static Graphic fromJson(org.codehaus.jackson.JsonParser parser)
throws Exception
parser - Parser initialized with a graphic JSON String.
Exception - Exception if parsing fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||