deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.graphics.sld
Class Mark

java.lang.Object
  extended by org.deegree.graphics.sld.Mark
All Implemented Interfaces:
Marshallable

public class Mark
extends java.lang.Object
implements Marshallable

A Mark takes a "shape" and applies coloring to it. The shape can be derived either from a well-known name (such as "square"), an external URL in various formats (such as, perhaps GIF), or from a glyph of a font. Multiple external formats may be used with the semantic that they all contain the equivalent shape in different formats. If an image format is used that has inherent coloring, the coloring is discarded and only the opacity channel (or equivalent) is used. A Halo, Fill, and/or Stroke is applied as appropriate for the shape's source format.

Version:
$Revision: 27181 $ $Date: 2010-10-05 15:24:30 +0200 (Di, 05 Okt 2010) $
Author:
Katharina Lupp , Markus Schneider

Constructor Summary
Mark()
          Constructor for the default Mark.
Mark(java.lang.String wellKnownName, Stroke stroke, Fill fill)
          constructor initializing the class with the
 
Method Summary
 java.awt.image.BufferedImage drawCircle(int size, double fillOpacity, java.awt.Color fillColor, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a scaled instance of a circle mark according to the given parameters.
 java.awt.image.BufferedImage drawCross1(int size, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a scaled instance of a cross mark (a "+") according to the given parameters.
 java.awt.image.BufferedImage drawCross2(int size, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a scaled instance of a cross mark (an "X") according to the given parameters.
 java.awt.image.BufferedImage drawSquare(int size, double fillOpacity, java.awt.Color fillColor, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a scaled instance of a square mark according to the given parameters.
 java.awt.image.BufferedImage drawStar(int size, double fillOpacity, java.awt.Color fillColor, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a five-pointed star (pentagram) according to the given parameters.
 java.awt.image.BufferedImage drawTriangle(int size, double fillOpacity, java.awt.Color fillColor, double strokeOpacity, java.awt.Color strokeColor, float[] dash, float dashOffset, float width, int cap, int join)
          Draws a scaled instance of a triangle mark according to the given parameters.
 java.lang.String exportAsXML()
          exports the content of the Mark as XML formated String
 java.awt.image.BufferedImage getAsImage(Feature feature, int size)
          Draws the given feature on the buffered image.
 Fill getFill()
          A Fill allows area geometries to be filled.
 Stroke getStroke()
          A Stroke allows a string of line segments (or any linear geometry) to be rendered.
 java.lang.String getWellKnownName()
          Gives the well known name of a Mark's shape.
 void setAsImage(java.awt.image.BufferedImage bufferedImage)
          Sets the mark as an image.
 void setFill(Fill fill)
          sets the
 void setStroke(Stroke stroke)
          sets
 void setWellKnownName(java.lang.String wellKnownName)
          Sets the well known name of a Mark's shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mark

Mark()
Constructor for the default Mark.


Mark

Mark(java.lang.String wellKnownName,
     Stroke stroke,
     Fill fill)
constructor initializing the class with the

Parameters:
wellKnownName -
stroke -
fill -
Method Detail

getWellKnownName

public java.lang.String getWellKnownName()
Gives the well known name of a Mark's shape. Allowed values include at least "square", "circle", "triangle", "star", "cross", and "x", though map servers may draw a different symbol instead if they don't have a shape for all of these. Renderings of these marks may be made solid or hollow depending on Fill and Stroke parameters. The default value is "square".

Returns:
the WK-Name of the mark

setWellKnownName

public void setWellKnownName(java.lang.String wellKnownName)
Sets the well known name of a Mark's shape. Allowed values include at least "square", "circle", "triangle", "star", "cross", and "x", though map servers may draw a different symbol instead if they don't have a shape for all of these. Renderings of these marks may be made solid or hollow depending on Fill and Stroke parameters. The default value is "square".

Parameters:
wellKnownName - the WK-Name of the mark

getFill

public Fill getFill()
A Fill allows area geometries to be filled. There are two types of fills: solid-color and repeated GraphicFill. In general, if a Fill element is omitted in its containing element, no fill will be rendered. The default is a solid 50%-gray (color "#808080") opaque fill.

Returns:
the fill of the mark

setFill

public void setFill(Fill fill)
sets the

Parameters:
fill - the fill of the mark

getStroke

public Stroke getStroke()
A Stroke allows a string of line segments (or any linear geometry) to be rendered. There are three basic types of strokes: solid Color, GraphicFill (stipple), and repeated GraphicStroke. A repeated graphic is plotted linearly and has its graphic symbol bended around the curves of the line string. The default is a solid black line (Color "#000000").

Returns:
the stroke of the mark

setStroke

public void setStroke(Stroke stroke)
sets

Parameters:
stroke - the stroke of the mark

getAsImage

public java.awt.image.BufferedImage getAsImage(Feature feature,
                                               int size)
                                        throws FilterEvaluationException
Draws the given feature on the buffered image. The drawing values are used from the 'Fill' object (if set). or white as a default fill color and black as a stroke color. If the stroke is null the BasicStroke values (CAP_ROUND, JOIN_ROUND) will be used.

Be careful to set the buffered image first!.

Parameters:
feature -
size - DOCUMENT ME!
Returns:
The feature as a buffered image with a the 'Fill' values. or white as a default fill color and black as a stroke color.
Throws:
FilterEvaluationException

setAsImage

public void setAsImage(java.awt.image.BufferedImage bufferedImage)
Sets the mark as an image. RThis method is not part of the sld specifications but it is added to speed up applications.

Parameters:
bufferedImage - the bufferedImage to be set for the mark

drawTriangle

public java.awt.image.BufferedImage drawTriangle(int size,
                                                 double fillOpacity,
                                                 java.awt.Color fillColor,
                                                 double strokeOpacity,
                                                 java.awt.Color strokeColor,
                                                 float[] dash,
                                                 float dashOffset,
                                                 float width,
                                                 int cap,
                                                 int join)
Draws a scaled instance of a triangle mark according to the given parameters.

Parameters:
size - resulting image's height and width
fillOpacity - opacity value for the filled parts of the image
fillColor - Color to be used for the fill
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
image displaying a triangle

drawStar

public java.awt.image.BufferedImage drawStar(int size,
                                             double fillOpacity,
                                             java.awt.Color fillColor,
                                             double strokeOpacity,
                                             java.awt.Color strokeColor,
                                             float[] dash,
                                             float dashOffset,
                                             float width,
                                             int cap,
                                             int join)
Draws a five-pointed star (pentagram) according to the given parameters.

Parameters:
size - resulting image's height and width
fillOpacity - opacity value for the filled parts of the image
fillColor - Color to be used for the fill
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
an image of a pentagram

drawCircle

public java.awt.image.BufferedImage drawCircle(int size,
                                               double fillOpacity,
                                               java.awt.Color fillColor,
                                               double strokeOpacity,
                                               java.awt.Color strokeColor,
                                               float[] dash,
                                               float dashOffset,
                                               float width,
                                               int cap,
                                               int join)
Draws a scaled instance of a circle mark according to the given parameters.

Parameters:
size - resulting image's height and widthh
fillOpacity - opacity value for the filled parts of the image
fillColor - Color to be used for the fill
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
image displaying a circle

drawSquare

public java.awt.image.BufferedImage drawSquare(int size,
                                               double fillOpacity,
                                               java.awt.Color fillColor,
                                               double strokeOpacity,
                                               java.awt.Color strokeColor,
                                               float[] dash,
                                               float dashOffset,
                                               float width,
                                               int cap,
                                               int join)
Draws a scaled instance of a square mark according to the given parameters.

Parameters:
size - resulting image's height and widthh
fillOpacity - opacity value for the filled parts of the image
fillColor - Color to be used for the fill
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
image displaying a square

drawCross1

public java.awt.image.BufferedImage drawCross1(int size,
                                               double strokeOpacity,
                                               java.awt.Color strokeColor,
                                               float[] dash,
                                               float dashOffset,
                                               float width,
                                               int cap,
                                               int join)
Draws a scaled instance of a cross mark (a "+") according to the given parameters.

Parameters:
size - resulting image's height and widthh
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
image displaying a cross (a "+")

drawCross2

public java.awt.image.BufferedImage drawCross2(int size,
                                               double strokeOpacity,
                                               java.awt.Color strokeColor,
                                               float[] dash,
                                               float dashOffset,
                                               float width,
                                               int cap,
                                               int join)
Draws a scaled instance of a cross mark (an "X") according to the given parameters.

Parameters:
size - resulting image's height and widthh
strokeOpacity - opacity value for the stroked parts of the image
strokeColor - Color to be used for the strokes
dash - dash array for rendering boundary line
width - of the boundary line
cap - of the boundary line
join - of the boundary line
dashOffset -
Returns:
image displaying a cross (a "X")

exportAsXML

public java.lang.String exportAsXML()
exports the content of the Mark as XML formated String

Specified by:
exportAsXML in interface Marshallable
Returns:
xml representation of the Mark

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org