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:
java.io.Serializable

public class WebPictureMarkerSymbol
extends WebSymbol
implements java.io.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 java.lang.String TYPE
           
 
Fields inherited from class com.esri.adf.web.data.symbol.WebSymbol
transparency
 
Constructor Summary
WebPictureMarkerSymbol()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getFileName()
          Returns a String specifying a filename or path.
 java.awt.image.BufferedImage getImage()
          Returns the picture as a buffered image.
 byte[] getPicture()
          Returns the picture as byte array.
 java.lang.String getType()
          Returns the type of the symbol as "PictureMarker"
 java.net.URL getURL()
          Returns the picture URL.
 int getWidth()
          Unsupported operation for this symbol.
 int hashCode()
           
 boolean isAntialiasing()
          Unsupported operation for this symbol.
 void setAntialiasing(boolean antialiasing)
          Unsupported operation for this symbol.
 void setFileName(java.lang.String fileName)
          Sets the file name containing picture.
 void setImage(java.awt.image.BufferedImage image)
          Sets the picture as a buffered image.
 void setPicture(byte[] picture)
          Sets the picture as byte array.
 void setURL(java.net.URL location)
          Sets the URL for the picture.
 void setWidth(int width)
          Unsupported operation for this symbol.
 java.lang.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 java.lang.String TYPE
See Also:
Constant Field Values
Constructor Detail

WebPictureMarkerSymbol

public WebPictureMarkerSymbol()
Method Detail

getType

public java.lang.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(java.net.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 java.net.URL getURL()
Returns the picture URL.

Returns:
the picture URL used for drawing picture marker symbol

setImage

public void setImage(java.awt.image.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 java.awt.image.BufferedImage getImage()
Returns the picture as a buffered image.

Returns:
the buffered image used for drawing picture marker symbol

setFileName

public void setFileName(java.lang.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 java.lang.String getFileName()
Returns a String specifying a filename or path.

Returns:
a String specifying a filename or path

toString

public java.lang.String toString()
Overrides:
toString in class WebSymbol

hashCode

public int hashCode()
Overrides:
hashCode in class WebSymbol

equals

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