com.esri.adf.web.data.symbol
Class WebPictureMarkerSymbol

java.lang.Object
  extended by com.esri.adf.web.data.symbol.WebSymbol
      extended by com.esri.adf.web.data.symbol.WebPictureMarkerSymbol
All Implemented Interfaces:
Serializable

public class WebPictureMarkerSymbol
extends WebSymbol
implements Serializable

WebPictureMarkerSymbol is a class used to symbolize point features. This symbol can be created using one of the following, byte[], URL, file name or a BufferedImage.

If multiple set methods are used then the following order is used to draw the symbol,

 1. getPicture()
 2. getURL()
 3. getImage()
 4. getFileName().
 
 For example,
   WebMultiPoint points = new WebMultiPoint();
   points.addPoint(new WebPoint(50, 50));
   points.addPoint(new WebPoint(100, 50));
   points.addPoint(new WebPoint(100, 100));
   points.addPoint(new WebPoint(50, 100));
 
   WebPictureMarkerSymbol pms = new WebPictureMarkerSymbol();
   pms.setAngle(45.0);
   pms.setFileName("c:/images/myImage.png");
 
   GraphicElement element = new GraphicElement();
   element.setGeometry(points);
   element.setSymbol(pms);
 
   WebElementConverter converter = new WebElementConverter(150, 150);
   converter.draw(element);
   byte[] image = converter.getPNGImage();
 
Warning: The image property of this symbol is not Serializable.

See Also:
Serialized Form

Field Summary
static String TYPE
           
 
Fields inherited from class com.esri.adf.web.data.symbol.WebSymbol
transparency
 
Constructor Summary
WebPictureMarkerSymbol()
           
 
Method Summary
 boolean equals(Object obj)
           
 String getFileName()
          Returns a String specifying a filename or path.
 BufferedImage getImage()
          Returns the picture as a buffered image.
 byte[] getPicture()
          Returns the picture as byte array.
 String getType()
          Returns the type of the symbol as "PictureMarker"
 URL getURL()
          Returns the picture URL.
 int getWidth()
          Unsupported operation for this symbol.
 double getXOffset()
          Returns the x-axis offset.
 double getYOffset()
          Returns the y-axis offset.
 int hashCode()
           
 boolean isAntialiasing()
          Unsupported operation for this symbol.
 void setAntialiasing(boolean antialiasing)
          Unsupported operation for this symbol.
 void setFileName(String fileName)
          Sets the file name containing picture.
 void setImage(BufferedImage image)
          Sets the picture as a buffered image.
 void setPicture(byte[] picture)
          Sets the picture as byte array.
 void setURL(URL location)
          Sets the URL for the picture.
 void setWidth(int width)
          Unsupported operation for this symbol.
 void setXOffset(double xOffset)
          Sets the symbol x-axis offset.
 void setYOffset(double yOffset)
          Sets the symbol y-axis offset.
 String toString()
           
 
Methods inherited from class com.esri.adf.web.data.symbol.WebSymbol
getAngle, getTransparency, setAngle, setTransparency
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

WebPictureMarkerSymbol

public WebPictureMarkerSymbol()
Method Detail

getType

public String getType()
Returns the type of the symbol as "PictureMarker"

Specified by:
getType in class WebSymbol
Returns:
the string representation of symbol type TYPE

setWidth

public void setWidth(int width)
Unsupported operation for this symbol.

Overrides:
setWidth in class WebSymbol
Parameters:
width - the symbol width in pixels.

getWidth

public int getWidth()
Unsupported operation for this symbol.

Overrides:
getWidth in class WebSymbol
Returns:
width of the symbol.

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Unsupported operation for this symbol.

Overrides:
setAntialiasing in class WebSymbol
Parameters:
antialiasing - the antialiasing value, default value is false.
See Also:
WebSymbol.isAntialiasing()

isAntialiasing

public boolean isAntialiasing()
Unsupported operation for this symbol.

Overrides:
isAntialiasing in class WebSymbol
Returns:
the antialiasing for this symbol.
See Also:
WebSymbol.setAntialiasing(boolean)

setPicture

public void setPicture(byte[] picture)
Sets the picture as byte array.
 For example,
   pms.setPicture(com.esri.adf.web.util.ImageUtil.readInputStream(new java.net.URL("http://www.esri.com/graphics/orangearrow_small.gif").openStream()));
 

Parameters:
picture - the picture to be drawn on picture marker symbol

getPicture

public byte[] getPicture()
Returns the picture as byte array.

Returns:
the picture in bytes

setURL

public void setURL(URL location)
Sets the URL for the picture.
 For example,
   pms.setURL(new java.net.URL("http://www.esri.com/graphics/orangearrow_small.gif"));
 

Parameters:
location - the picture URL used for drawing picture marker symbol

getURL

public URL getURL()
Returns the picture URL.

Returns:
the picture URL used for drawing picture marker symbol

setImage

public void setImage(BufferedImage image)
Sets the picture as a buffered image.
 For example,
   pms.setImage(javax.imageio.ImageIO.read(new java.net.URL("http://www.esri.com/graphics/orangearrow_small.gif")));
   GraphicsUtil.exportSymbol(pms, 100, 100);
 

Parameters:
image - the buffered image used for drawing picture marker symbol

getImage

public BufferedImage getImage()
Returns the picture as a buffered image.

Returns:
the buffered image used for drawing picture marker symbol

setFileName

public void setFileName(String fileName)
Sets the file name containing picture.
 For example,
   pms.setFileName("c:/images/myImage.png");
 or relative URL
   pms.setFileName("/images/myImage.png");
 

Parameters:
fileName - the name of the file containing the picture

getFileName

public String getFileName()
Returns a String specifying a filename or path.

Returns:
a String specifying a filename or path

setXOffset

public void setXOffset(double xOffset)
Sets the symbol x-axis offset.

Parameters:
xOffset - the x-axis offset.

getXOffset

public double getXOffset()
Returns the x-axis offset.

Returns:
the x-axis offset.

setYOffset

public void setYOffset(double yOffset)
Sets the symbol y-axis offset.

Parameters:
yOffset - the y-axis offset.

getYOffset

public double getYOffset()
Returns the y-axis offset.

Returns:
the y-axis offset.

toString

public String toString()
Overrides:
toString in class WebSymbol

hashCode

public int hashCode()
Overrides:
hashCode in class WebSymbol

equals

public boolean equals(Object obj)
Overrides:
equals in class WebSymbol