com.esri.adf.web.util
Class GraphicsUtil

java.lang.Object
  extended by com.esri.adf.web.util.GraphicsUtil

public class GraphicsUtil
extends Object

Utility class for Graphics to export symbol.


Method Summary
static byte[] exportSymbol(WebSymbol symbol, int width, int height)
           Convenient method to export WebSymbol based on the specified dimension.
static byte[] exportSymbol(WebSymbol symbol, WebGeometry geometry, int width, int height)
           Convenient method to export WebSymbol based on the specified WebGeometry and dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

exportSymbol

public static byte[] exportSymbol(WebSymbol symbol,
                                  int width,
                                  int height)

Convenient method to export WebSymbol based on the specified dimension.

Parameters:
symbol - the WebSymbol object
width - the width of the bounding box
height - the height of the bouding box
Returns:
byte[] the given symbol in bytes

exportSymbol

public static byte[] exportSymbol(WebSymbol symbol,
                                  WebGeometry geometry,
                                  int width,
                                  int height)

Convenient method to export WebSymbol based on the specified WebGeometry and dimension.

The Geometry should be in screen coordinates.

  For example polygon geometry with dimension (10 X 10),
 
  WebPoint point1 = new WebPoint(0,0);
  WebPoint point2 = new WebPoint(10,0);
  WebPoint point3 = new WebPoint(10,10);
  WebPoint point4 = new WebPoint(0,10);
 
  WebRing ring = new WebRing();
  ring.addPoint(point1);
  ring.addPoint(point2);
  ring.addPoint(point3);
  ring.addPoint(point4);
  ring.addPoint(point1);
 
  WebPolygon polygon = new WebPolygon();
  polygon.addRing(ring);
 

Parameters:
symbol - the WebSymbol object
geometry - the WebGeometry object
width - the width of the bounding box
height - the height of the bouding box
Returns:
byte[] the given symbol in bytes