org.geotools.styling
Class StyleBuilder

java.lang.Object
  extended byorg.geotools.styling.StyleBuilder

public class StyleBuilder
extends java.lang.Object

An utility class designed to ease style building by convinience methods.

Author:
aaime

Nested Class Summary
 class StyleBuilder.EqualClasses
           
 
Field Summary
static java.lang.String FONT_STYLE_ITALIC
           
static java.lang.String FONT_STYLE_NORMAL
           
static java.lang.String FONT_STYLE_OBLIQUE
           
static java.lang.String FONT_WEIGHT_BOLD
           
static java.lang.String FONT_WEIGHT_NORMAL
           
static java.lang.String LINE_CAP_BUTT
           
static java.lang.String LINE_CAP_ROUND
           
static java.lang.String LINE_CAP_SQUARE
           
static java.lang.String LINE_JOIN_BEVEL
           
static java.lang.String LINE_JOIN_MITRE
           
static java.lang.String LINE_JOIN_ROUND
           
static java.lang.String MARK_ARROW
           
static java.lang.String MARK_CIRCLE
           
static java.lang.String MARK_CROSS
           
static java.lang.String MARK_SQUARE
           
static java.lang.String MARK_STAR
           
static java.lang.String MARK_TRIANGLE
           
static java.lang.String MARK_X
           
 
Constructor Summary
StyleBuilder()
          use the default StyleFactory and FilterFactory
StyleBuilder(FilterFactory filterFactory)
          Use the supplied FilterFactory when building styles
StyleBuilder(StyleFactory styleFactory)
          Use the supplied StyleFactory when building styles
StyleBuilder(StyleFactory styleFactory, FilterFactory filterFactory)
          Use the supplied StyleFactory and FilterFactory when building styles
 
Method Summary
 Expression attributeExpression(java.lang.String attributeName)
          create an attribute expression
 Style buildClassifiedStyle(FeatureCollection fc, java.lang.String name, java.lang.String[] colors, FeatureType schema)
          given a feature collection and an array of colours build a style with the given number of classes on the named column
 Expression colorExpression(java.awt.Color color)
          convert an awt color in to a literal expression representing the color
 AnchorPoint createAnchorPoint(double x, double y)
          wrapper round Stylefactory Method
 AnchorPoint createAnchorPoint(Expression x, Expression y)
          wrapper round Stylefactory Method
 ColorMap createColorMap(java.lang.String[] labels, double[] quantities, java.awt.Color[] colors, int type)
          Creates a color map based on fixed quantities and colors.
 Displacement createDisplacement(double x, double y)
          wrapper round Stylefactory Method
 Displacement createDisplacement(Expression x, Expression y)
          wrapper round Stylefactory Method
 ExternalGraphic createExternalGraphic(java.lang.String uri, java.lang.String format)
          wrapper for stylefactory method
 ExternalGraphic createExternalGraphic(java.net.URL url, java.lang.String format)
          wrapper for stylefactory method
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Rule r)
          create a Feature type styler
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Rule[] rules)
          create a Feature type styler see the SLD Spec for more details of scaleDenominators
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Symbolizer symbolizer)
          create a Feature type styler
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Symbolizer[] symbolizers)
          create a Feature type styler
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator)
          create a Feature type styler see the SLD Spec for more details of scaleDenominators
 FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName, Symbolizer symbolizer, double minScaleDenominator, double maxScaleDenominator)
          create a Feature type styler see the SLD Spec for more details of scaleDenominators
 FeatureTypeStyle createFeatureTypeStyle(Symbolizer symbolizer)
          create a Feature type styler
 FeatureTypeStyle createFeatureTypeStyle(Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator)
          create a Feature type styler see the SLD Spec for more details of scaleDenominators
 FeatureTypeStyle createFeatureTypeStyle(Symbolizer symbolizer, double minScaleDenominator, double maxScaleDenominator)
          create a Feature type styler see the SLD Spec for more details of scaleDenominators
 Fill createFill()
          create a default fill 50% gray
 Fill createFill(java.awt.Color fillColor)
          create a fill of color
 Fill createFill(java.awt.Color color, java.awt.Color backgroundColor, double opacity, Graphic fill)
          create a fill with color, background color and opacity supplied and uses the graphic supplied for the fill
 Fill createFill(java.awt.Color fillColor, double opacity)
          create a fill with the supplied color and opacity
 Fill createFill(Expression fillColor)
          create a fill of color
 Fill createFill(Expression color, Expression opacity)
          create a fill with the supplied color and opacity
 Fill createFill(Expression color, Expression backgroundColor, Expression opacity, Graphic fill)
          create a fill with color, background color and opacity supplied and uses the graphic supplied for the fill
 Font createFont(Expression fontFamily, Expression fontStyle, Expression fontWeight, Expression fontSize)
          wrapper round StyleFactory method
 Font createFont(java.awt.Font font)
          create a geotools font object from a java font
 Font createFont(java.lang.String fontFamily, boolean italic, boolean bold, double fontSize)
          create font of supplied family, size and weight/style
 Font createFont(java.lang.String fontFamily, double fontSize)
          create font of supplied family and size
 Graphic createGraphic()
          Creates the default graphic object
 Graphic createGraphic(ExternalGraphic[] externalGraphics, Mark[] marks, Symbol[] symbols, double opacity, double size, double rotation)
          creates a graphic object
 Graphic createGraphic(ExternalGraphic[] externalGraphics, Mark[] marks, Symbol[] symbols, Expression opacity, Expression size, Expression rotation)
          creates a graphic object
 Graphic createGraphic(ExternalGraphic externalGraphic, Mark mark, Symbol symbol)
          creates a graphic object
 Graphic createGraphic(ExternalGraphic externalGraphic, Mark mark, Symbol symbol, double opacity, double size, double rotation)
          creates a graphic object
 Halo createHalo()
          wrapper round StyleFactory method to create default halo
 Halo createHalo(java.awt.Color color, double radius)
          wrapper round StyleFactory method to create halo
 Halo createHalo(java.awt.Color color, double opacity, double radius)
          wrapper round StyleFactory method to create halo
 Halo createHalo(Fill fill, double radius)
          wrapper round StyleFactory method to create halo
 Halo createHalo(Fill fill, Expression radius)
          wrapper round StyleFactory method to create halo
 LinePlacement createLinePlacement(double offset)
          wrapper round Stylefactory Method
 LinePlacement createLinePlacement(Expression offset)
          wrapper round Stylefactory Method
 LineSymbolizer createLineSymbolizer()
          create a default line symboliser
 LineSymbolizer createLineSymbolizer(java.awt.Color color)
          create a LineSymbolizer
 LineSymbolizer createLineSymbolizer(java.awt.Color color, double width)
          create a LineSymbolizer
 LineSymbolizer createLineSymbolizer(java.awt.Color color, double width, java.lang.String geometryPropertyName)
          create a LineSymbolizer
 LineSymbolizer createLineSymbolizer(double width)
          create a new line symbolizer
 LineSymbolizer createLineSymbolizer(Stroke stroke)
          create a LineSymbolizer
 LineSymbolizer createLineSymbolizer(Stroke stroke, java.lang.String geometryPropertyName)
          create a LineSymbolizer
 Mark createMark(Expression wellKnownName, Fill fill, Stroke stroke)
          create a mark with the supplied fill and stroke
 Mark createMark(java.lang.String wellKnownName)
          create the named mark
 Mark createMark(java.lang.String wellKnownName, java.awt.Color fillColor)
          create a mark of the supplied color and a default outline (black)
 Mark createMark(java.lang.String wellKnownName, java.awt.Color fillColor, java.awt.Color borderColor, double borderWidth)
          create the named mark with the colors etc supplied
 Mark createMark(java.lang.String wellKnownName, java.awt.Color borderColor, double borderWidth)
          create a mark with default fill (50% gray) and the supplied outline
 Mark createMark(java.lang.String wellKnownName, Fill fill, Stroke stroke)
          create a mark with the supplied fill and stroke
 PointPlacement createPointPlacement()
          wrapper round Stylefactory Method
 PointPlacement createPointPlacement(AnchorPoint anchorPoint, Displacement displacement, Expression rotation)
          wrapper round Stylefactory Method
 PointPlacement createPointPlacement(double anchorX, double anchorY, double rotation)
          wrapper round Stylefactory Method
 PointPlacement createPointPlacement(double anchorX, double anchorY, double displacementX, double displacementY, double rotation)
          wrapper round Stylefactory Method
 PointSymbolizer createPointSymbolizer()
          create a default point symbolizer
 PointSymbolizer createPointSymbolizer(Graphic graphic)
          create a point symbolizer
 PointSymbolizer createPointSymbolizer(Graphic graphic, java.lang.String geometryPropertyName)
          create a point symbolizer
 PolygonSymbolizer createPolygonSymbolizer()
          create a default polygon symbolizer
 PolygonSymbolizer createPolygonSymbolizer(java.awt.Color fillColor)
          create a polygon symbolizer
 PolygonSymbolizer createPolygonSymbolizer(java.awt.Color fillColor, java.awt.Color borderColor, double borderWidth)
          create a polygon symbolizer
 PolygonSymbolizer createPolygonSymbolizer(java.awt.Color borderColor, double borderWidth)
          create a polygon symbolizer
 PolygonSymbolizer createPolygonSymbolizer(Stroke stroke, Fill fill)
          create a polygon symbolizer
 PolygonSymbolizer createPolygonSymbolizer(Stroke stroke, Fill fill, java.lang.String geometryPropertyName)
          create a polygon symbolizer
 RasterSymbolizer createRasterSymbolizer()
          Creates the default raster symbolizer
 RasterSymbolizer createRasterSymbolizer(ColorMap colorMap, double opacity)
          Creates a raster symbolizer
 Rule createRule(Symbolizer symbolizer)
          create a simple styling rule
 Rule createRule(Symbolizer[] symbolizers)
          reate a simple styling rule
 Rule createRule(Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator)
          create a simple styling rule, see the SLD Spec for more details of scaleDenominators
 Rule createRule(Symbolizer symbolizer, double minScaleDenominator, double maxScaleDenominator)
          create a simple styling rule, see the SLD Spec for more details of scaleDenominators
 TextSymbolizer createStaticTextSymbolizer(java.awt.Color color, Font[] fonts, java.lang.String label)
          create a textsymbolizer which doesn't change
 TextSymbolizer createStaticTextSymbolizer(java.awt.Color color, Font font, java.lang.String label)
          create a textsymbolizer which doesn't change
 Stroke createStroke()
          create a default Stroke
 Stroke createStroke(java.awt.Color color)
          Create a default stroke with the supplied color
 Stroke createStroke(java.awt.Color color, double width)
          create a stroke with the supplied width and color
 Stroke createStroke(java.awt.Color color, double width, double opacity)
          create a stroke with color, width and opacity supplied
 Stroke createStroke(java.awt.Color color, double width, float[] dashArray)
          create a dashed line of color and width
 Stroke createStroke(java.awt.Color color, double width, java.lang.String lineJoin, java.lang.String lineCap)
          create a stroke with color, width, linejoin type and lineCap type.
 Stroke createStroke(double width)
          create a default stroke with the supplied width
 Stroke createStroke(Expression color, Expression width)
          create a stroke with the color and width supplied
 Stroke createStroke(Expression color, Expression width, Expression opacity)
          create a stroke with color, width and opacity supplied
 Style createStyle()
          create a new default style
 Style createStyle(java.lang.String featureTypeStyleName, Symbolizer symbolizer)
          create a new style
 Style createStyle(java.lang.String featureTypeStyleName, Symbolizer symbolizer, double minScaleDenominator, double maxScaleDenominator)
          create a new style
 Style createStyle(Symbolizer symbolizer)
          create a new style
 Style createStyle(Symbolizer symbolizer, double minScaleDenominator, double maxScaleDenominator)
          create a new style
 TextSymbolizer createTextSymbolizer()
          Creates a default text symbolizer.
 TextSymbolizer createTextSymbolizer(java.awt.Color color, Font[] fonts, java.lang.String attributeName)
          create a textsymbolizer
 TextSymbolizer createTextSymbolizer(java.awt.Color color, Font font, java.lang.String attributeName)
          create a textsymbolizer
 TextSymbolizer createTextSymbolizer(Fill fill, Font[] fonts, Halo halo, Expression label, LabelPlacement labelPlacement, java.lang.String geometryPropertyName)
          create a text symbolizer
 FilterFactory getFilterFactory()
          getter for filterFactory
 StyleFactory getStyleFactory()
          getter for StyleFactory
 java.lang.String[] getWellKnownMarkNames()
          Returns the array of all the well known mark names
 Expression literalExpression(double value)
          create a literal expression representing the value
 Expression literalExpression(int value)
          create a literal expression representing the value
 Expression literalExpression(java.lang.Object value)
          create a literal expression representing the value
 Expression literalExpression(java.lang.String value)
          create a literal expression representing the value
 void setFilterFactory(FilterFactory factory)
          Documented setter injection, StyleBuilder uses a StyleFactory for creation.
 void setStyleFactory(StyleFactory factory)
          Documented setter injection, StyleBuilder uses a StyleFactory for creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_JOIN_MITRE

public static final java.lang.String LINE_JOIN_MITRE
See Also:
Constant Field Values

LINE_JOIN_ROUND

public static final java.lang.String LINE_JOIN_ROUND
See Also:
Constant Field Values

LINE_JOIN_BEVEL

public static final java.lang.String LINE_JOIN_BEVEL
See Also:
Constant Field Values

LINE_CAP_BUTT

public static final java.lang.String LINE_CAP_BUTT
See Also:
Constant Field Values

LINE_CAP_ROUND

public static final java.lang.String LINE_CAP_ROUND
See Also:
Constant Field Values

LINE_CAP_SQUARE

public static final java.lang.String LINE_CAP_SQUARE
See Also:
Constant Field Values

MARK_SQUARE

public static final java.lang.String MARK_SQUARE
See Also:
Constant Field Values

MARK_CIRCLE

public static final java.lang.String MARK_CIRCLE
See Also:
Constant Field Values

MARK_TRIANGLE

public static final java.lang.String MARK_TRIANGLE
See Also:
Constant Field Values

MARK_STAR

public static final java.lang.String MARK_STAR
See Also:
Constant Field Values

MARK_CROSS

public static final java.lang.String MARK_CROSS
See Also:
Constant Field Values

MARK_ARROW

public static final java.lang.String MARK_ARROW
See Also:
Constant Field Values

MARK_X

public static final java.lang.String MARK_X
See Also:
Constant Field Values

FONT_STYLE_NORMAL

public static final java.lang.String FONT_STYLE_NORMAL
See Also:
Constant Field Values

FONT_STYLE_ITALIC

public static final java.lang.String FONT_STYLE_ITALIC
See Also:
Constant Field Values

FONT_STYLE_OBLIQUE

public static final java.lang.String FONT_STYLE_OBLIQUE
See Also:
Constant Field Values

FONT_WEIGHT_NORMAL

public static final java.lang.String FONT_WEIGHT_NORMAL
See Also:
Constant Field Values

FONT_WEIGHT_BOLD

public static final java.lang.String FONT_WEIGHT_BOLD
See Also:
Constant Field Values
Constructor Detail

StyleBuilder

public StyleBuilder()
use the default StyleFactory and FilterFactory


StyleBuilder

public StyleBuilder(StyleFactory styleFactory)
Use the supplied StyleFactory when building styles

Parameters:
styleFactory - the StyleFactory to use in building Styles

StyleBuilder

public StyleBuilder(FilterFactory filterFactory)
Use the supplied FilterFactory when building styles

Parameters:
filterFactory - Use this FilterFactory to build the style

StyleBuilder

public StyleBuilder(StyleFactory styleFactory,
                    FilterFactory filterFactory)
Use the supplied StyleFactory and FilterFactory when building styles

Parameters:
styleFactory - the StyleFactory to use
filterFactory - the FilterFactory to use
Method Detail

setStyleFactory

public void setStyleFactory(StyleFactory factory)
Documented setter injection, StyleBuilder uses a StyleFactory for creation.

Parameters:
factory -

getStyleFactory

public StyleFactory getStyleFactory()
getter for StyleFactory

Returns:
the StyleFactory being used

setFilterFactory

public void setFilterFactory(FilterFactory factory)
Documented setter injection, StyleBuilder uses a StyleFactory for creation.

Parameters:
factory -

getFilterFactory

public FilterFactory getFilterFactory()
getter for filterFactory

Returns:
the FilterFactory being used

createStroke

public Stroke createStroke()
create a default Stroke

Returns:
the Stroke created

createStroke

public Stroke createStroke(double width)
create a default stroke with the supplied width

Parameters:
width - the width of the line
Returns:
the stroke created

createStroke

public Stroke createStroke(java.awt.Color color)
Create a default stroke with the supplied color

Parameters:
color - the color of the line
Returns:
the created stroke

createStroke

public Stroke createStroke(java.awt.Color color,
                           double width)
create a stroke with the supplied width and color

Parameters:
color - the color of the line
width - the width of the line
Returns:
the created stroke

createStroke

public Stroke createStroke(java.awt.Color color,
                           double width,
                           java.lang.String lineJoin,
                           java.lang.String lineCap)
create a stroke with color, width, linejoin type and lineCap type.

Parameters:
color - the color of the line
width - the width of the line
lineJoin - the type of join to be used at points along the line
lineCap - the type of cap to be used at the end of the line
Returns:
the stroke created

createStroke

public Stroke createStroke(java.awt.Color color,
                           double width,
                           float[] dashArray)
create a dashed line of color and width

Parameters:
color - the color of the line
width - the width of the line
dashArray - an array of floats describing the length of line and spaces
Returns:
the stroke created

createStroke

public Stroke createStroke(Expression color,
                           Expression width)
create a stroke with the color and width supplied

Parameters:
color - an Expression representing the color of the line
width - an Expression representing the width of the line
Returns:
the Stroke created

createStroke

public Stroke createStroke(java.awt.Color color,
                           double width,
                           double opacity)
create a stroke with color, width and opacity supplied

Parameters:
color - the color of the line
width - the width of the line
opacity - the opacity or see throughness of the line, 0 - is transparent, 1 is completely drawn
Returns:
the stroke created

createStroke

public Stroke createStroke(Expression color,
                           Expression width,
                           Expression opacity)
create a stroke with color, width and opacity supplied

Parameters:
color - an Expression representing the color of the line
width - an Expression representing the width of the line
opacity - an Expression representing opacity the opacity or see throughness of the line, 0 - is transparent, 1 is completely drawn
Returns:
the stroke created

createFill

public Fill createFill()
create a default fill 50% gray

Returns:
the fill created

createFill

public Fill createFill(java.awt.Color fillColor)
create a fill of color

Parameters:
fillColor - the color of the fill
Returns:
the fill created

createFill

public Fill createFill(Expression fillColor)
create a fill of color

Parameters:
fillColor - an Expression representing the color of the fill
Returns:
the fill constructed

createFill

public Fill createFill(java.awt.Color fillColor,
                       double opacity)
create a fill with the supplied color and opacity

Parameters:
fillColor - the color to fill with
opacity - the opacity of the fill 0 - transparent, 1 - completly filled
Returns:
the fill created

createFill

public Fill createFill(Expression color,
                       Expression opacity)
create a fill with the supplied color and opacity

Parameters:
color - an expression representing the color to fill with
opacity - an expression representing the opacity of the fill 0 - transparent, 1 - completly filled
Returns:
the fill created

createFill

public Fill createFill(java.awt.Color color,
                       java.awt.Color backgroundColor,
                       double opacity,
                       Graphic fill)
create a fill with color, background color and opacity supplied and uses the graphic supplied for the fill

Parameters:
color - the foreground color
backgroundColor - the background color
opacity - the opacity of the fill
fill - the graphic object to use to fill the fill
Returns:
the fill created

createFill

public Fill createFill(Expression color,
                       Expression backgroundColor,
                       Expression opacity,
                       Graphic fill)
create a fill with color, background color and opacity supplied and uses the graphic supplied for the fill

Parameters:
color - an Expression representing the foreground color
backgroundColor - an Expression representing the background color
opacity - an Expression representing the opacity of the fill
fill - the graphic object to use to fill the fill
Returns:
the fill created

getWellKnownMarkNames

public java.lang.String[] getWellKnownMarkNames()
Returns the array of all the well known mark names

Returns:
DOCUMENT ME!

createMark

public Mark createMark(java.lang.String wellKnownName)
create the named mark

Parameters:
wellKnownName - the wellknown name of the mark
Returns:
the mark created

createMark

public Mark createMark(java.lang.String wellKnownName,
                       java.awt.Color fillColor,
                       java.awt.Color borderColor,
                       double borderWidth)
create the named mark with the colors etc supplied

Parameters:
wellKnownName - the well known name of the mark
fillColor - the color of the mark
borderColor - the outline color of the mark
borderWidth - the width of the outline
Returns:
the mark created

createMark

public Mark createMark(java.lang.String wellKnownName,
                       java.awt.Color borderColor,
                       double borderWidth)
create a mark with default fill (50% gray) and the supplied outline

Parameters:
wellKnownName - the well known name of the mark
borderColor - the outline color
borderWidth - the outline width
Returns:
the mark created

createMark

public Mark createMark(java.lang.String wellKnownName,
                       java.awt.Color fillColor)
create a mark of the supplied color and a default outline (black)

Parameters:
wellKnownName - the well known name of the mark
fillColor - the color of the mark
Returns:
the created mark

createMark

public Mark createMark(java.lang.String wellKnownName,
                       Fill fill,
                       Stroke stroke)
create a mark with the supplied fill and stroke

Parameters:
wellKnownName - the well known name of the mark
fill - the fill to use
stroke - the stroke to use
Returns:
the mark created

createMark

public Mark createMark(Expression wellKnownName,
                       Fill fill,
                       Stroke stroke)
create a mark with the supplied fill and stroke

Parameters:
wellKnownName - an Expression representing the well known name of the mark
fill - the fill to use
stroke - the stroke to use
Returns:
the mark created

createExternalGraphic

public ExternalGraphic createExternalGraphic(java.lang.String uri,
                                             java.lang.String format)
wrapper for stylefactory method

Parameters:
uri - the uri of the image
format - mime type of the image
Returns:
the external graphic

createExternalGraphic

public ExternalGraphic createExternalGraphic(java.net.URL url,
                                             java.lang.String format)
wrapper for stylefactory method

Parameters:
url - the url of the image
format - mime type of the image
Returns:
the external graphic

createGraphic

public Graphic createGraphic()
Creates the default graphic object

Returns:
the graphic object

createGraphic

public Graphic createGraphic(ExternalGraphic externalGraphic,
                             Mark mark,
                             Symbol symbol)
creates a graphic object

Parameters:
externalGraphic - an external graphic to use if displayable
mark - a mark to use
symbol - a symbol to use
Returns:
the graphic object

createGraphic

public Graphic createGraphic(ExternalGraphic externalGraphic,
                             Mark mark,
                             Symbol symbol,
                             double opacity,
                             double size,
                             double rotation)
creates a graphic object

Parameters:
externalGraphic - an external graphic to use if displayable
mark - a mark to use
symbol - a symbol to use
opacity - - the opacity of the graphic
size - - the size of the graphic
rotation - - the rotation from the top of the page of the graphic
Returns:
the graphic created

createGraphic

public Graphic createGraphic(ExternalGraphic[] externalGraphics,
                             Mark[] marks,
                             Symbol[] symbols,
                             double opacity,
                             double size,
                             double rotation)
creates a graphic object

Parameters:
externalGraphics - an array of external graphics to use if displayable
marks - an array of marks to use
symbols - an array of symbols to use
opacity - - the opacity of the graphic
size - - the size of the graphic
rotation - - the rotation from the top of the page of the graphic
Returns:
the graphic created

createGraphic

public Graphic createGraphic(ExternalGraphic[] externalGraphics,
                             Mark[] marks,
                             Symbol[] symbols,
                             Expression opacity,
                             Expression size,
                             Expression rotation)
creates a graphic object

Parameters:
externalGraphics - an array of external graphics to use if displayable
marks - an array of marks to use
symbols - an array of symbols to use
opacity - - an Expression representing the opacity of the graphic
size - - an Expression representing the size of the graphic
rotation - - an Expression representing the rotation from the top of the page of the graphic
Returns:
the graphic created

createAnchorPoint

public AnchorPoint createAnchorPoint(double x,
                                     double y)
wrapper round Stylefactory Method

Parameters:
x - - the x coordinate of the anchor
y - - the y coordinate of the anchor
Returns:
the AnchorPoint created

createAnchorPoint

public AnchorPoint createAnchorPoint(Expression x,
                                     Expression y)
wrapper round Stylefactory Method

Parameters:
x - - an Expression representing the x coordinate of the anchor
y - - an Expression representing the y coordinate of the anchor
Returns:
the AnchorPoint created

createDisplacement

public Displacement createDisplacement(double x,
                                       double y)
wrapper round Stylefactory Method

Parameters:
x - - the x displacement
y - - the y displacement
Returns:
the Displacement created

createDisplacement

public Displacement createDisplacement(Expression x,
                                       Expression y)
wrapper round Stylefactory Method

Parameters:
x - - an Expression representing the x displacement
y - - an Expression representing the y displacement
Returns:
the Displacement created

createPointPlacement

public PointPlacement createPointPlacement()
wrapper round Stylefactory Method

Returns:
the default pointplacement

createPointPlacement

public PointPlacement createPointPlacement(double anchorX,
                                           double anchorY,
                                           double rotation)
wrapper round Stylefactory Method

Parameters:
anchorX - - the X coordinate
anchorY - - the Y coordinate
rotation - - the rotaion of the label
Returns:
the pointplacement created

createPointPlacement

public PointPlacement createPointPlacement(double anchorX,
                                           double anchorY,
                                           double displacementX,
                                           double displacementY,
                                           double rotation)
wrapper round Stylefactory Method

Parameters:
anchorX - - the X coordinate
anchorY - - the Y coordinate
displacementX - - the X distance from the anchor
displacementY - - the Y distance from the anchor
rotation - - the rotaion of the label
Returns:
the pointplacement created

createPointPlacement

public PointPlacement createPointPlacement(AnchorPoint anchorPoint,
                                           Displacement displacement,
                                           Expression rotation)
wrapper round Stylefactory Method

Parameters:
anchorPoint - - the anchor point of the label
displacement - - the displacement of the label
rotation - - an Expresson representing the rotation of the label
Returns:
the pointplacement created

createLinePlacement

public LinePlacement createLinePlacement(double offset)
wrapper round Stylefactory Method

Parameters:
offset - - the distance between the line and the label
Returns:
the LinePlacement created

createLinePlacement

public LinePlacement createLinePlacement(Expression offset)
wrapper round Stylefactory Method

Parameters:
offset - - an Expression representing the distance between the line and the label
Returns:
the LinePlacement created

createFont

public Font createFont(java.awt.Font font)
create a geotools font object from a java font

Parameters:
font - - the font to be converted
Returns:
- the geotools font

createFont

public Font createFont(java.lang.String fontFamily,
                       double fontSize)
create font of supplied family and size

Parameters:
fontFamily - - the font family
fontSize - - the size of the font in points
Returns:
the font object created

createFont

public Font createFont(java.lang.String fontFamily,
                       boolean italic,
                       boolean bold,
                       double fontSize)
create font of supplied family, size and weight/style

Parameters:
fontFamily - - the font family
italic - - should the font be italic?
bold - - should the font be bold?
fontSize - - the size of the font in points
Returns:
the new font object

createFont

public Font createFont(Expression fontFamily,
                       Expression fontStyle,
                       Expression fontWeight,
                       Expression fontSize)
wrapper round StyleFactory method

Parameters:
fontFamily - - Expression representing Font family
fontStyle - - Expression representing Font style
fontWeight - - Expression representing Font weight
fontSize - - Expression representing Font size
Returns:
the new font object

createHalo

public Halo createHalo()
wrapper round StyleFactory method to create default halo

Returns:
the new halo

createHalo

public Halo createHalo(java.awt.Color color,
                       double radius)
wrapper round StyleFactory method to create halo

Parameters:
color - - the color of the halo
radius - - the width of the halo
Returns:
the new halo

createHalo

public Halo createHalo(java.awt.Color color,
                       double opacity,
                       double radius)
wrapper round StyleFactory method to create halo

Parameters:
color - - the color of the halo
opacity - - the opacity of the halo fill 0 - transparent 1 - solid
radius - - the width of the halo
Returns:
the new halo

createHalo

public Halo createHalo(Fill fill,
                       double radius)
wrapper round StyleFactory method to create halo

Parameters:
fill - - the fill of the halo
radius - - the width of the halo
Returns:
the new halo

createHalo

public Halo createHalo(Fill fill,
                       Expression radius)
wrapper round StyleFactory method to create halo

Parameters:
fill - - the fill of the halo
radius - - an Expression representing the width of the halo
Returns:
the new halo

createLineSymbolizer

public LineSymbolizer createLineSymbolizer()
create a default line symboliser

Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(double width)
create a new line symbolizer

Parameters:
width - the width of the line
Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(java.awt.Color color)
create a LineSymbolizer

Parameters:
color - - the color of the line
Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(java.awt.Color color,
                                           double width)
create a LineSymbolizer

Parameters:
color - - the color of the line
width - - the width of the line
Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(java.awt.Color color,
                                           double width,
                                           java.lang.String geometryPropertyName)
create a LineSymbolizer

Parameters:
color - - the color of the line
width - - the width of the line
geometryPropertyName - - the name of the geometry to be drawn
Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(Stroke stroke)
create a LineSymbolizer

Parameters:
stroke - - the stroke to be used to draw the line
Returns:
the new line symbolizer

createLineSymbolizer

public LineSymbolizer createLineSymbolizer(Stroke stroke,
                                           java.lang.String geometryPropertyName)
create a LineSymbolizer

Parameters:
stroke - - the stroke to be used to draw the line
geometryPropertyName - - the name of the geometry to be drawn
Returns:
the new line symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer()
create a default polygon symbolizer

Returns:
the new polygon symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer(java.awt.Color fillColor)
create a polygon symbolizer

Parameters:
fillColor - - the color to fill the polygon
Returns:
the new polygon symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer(java.awt.Color fillColor,
                                                 java.awt.Color borderColor,
                                                 double borderWidth)
create a polygon symbolizer

Parameters:
fillColor - - the color to fill the polygon
borderColor - - the outline color of the polygon
borderWidth - - the width of the outline
Returns:
the new polygon symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer(java.awt.Color borderColor,
                                                 double borderWidth)
create a polygon symbolizer

Parameters:
borderColor - - the outline color of the polygon
borderWidth - - the width of the outline
Returns:
the new polygon symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer(Stroke stroke,
                                                 Fill fill)
create a polygon symbolizer

Parameters:
stroke - - the stroke to use to outline the polygon
fill - - the fill to use to color the polygon
Returns:
the new polygon symbolizer

createPolygonSymbolizer

public PolygonSymbolizer createPolygonSymbolizer(Stroke stroke,
                                                 Fill fill,
                                                 java.lang.String geometryPropertyName)
create a polygon symbolizer

Parameters:
stroke - - the stroke to use to outline the polygon
fill - - the fill to use to color the polygon
geometryPropertyName - - the name of the geometry to be drawn
Returns:
the new polygon symbolizer

createPointSymbolizer

public PointSymbolizer createPointSymbolizer()
create a default point symbolizer

Returns:
the new point symbolizer

createPointSymbolizer

public PointSymbolizer createPointSymbolizer(Graphic graphic)
create a point symbolizer

Parameters:
graphic - - the graphic object to draw at the point
Returns:
the new point symbolizer

createPointSymbolizer

public PointSymbolizer createPointSymbolizer(Graphic graphic,
                                             java.lang.String geometryPropertyName)
create a point symbolizer

Parameters:
graphic - - the graphic object to draw at the point
geometryPropertyName - - the name of the geometry to be drawn
Returns:
the new point symbolizer

createTextSymbolizer

public TextSymbolizer createTextSymbolizer()
Creates a default text symbolizer. Warning: there is no definition of a default text symbolizer in the SLD standard, this is provided just for convenience and uniformity with the other symbolizers

Returns:
the default text symbolizer

createTextSymbolizer

public TextSymbolizer createTextSymbolizer(java.awt.Color color,
                                           Font font,
                                           java.lang.String attributeName)
                                    throws IllegalFilterException
create a textsymbolizer

Parameters:
color - the color of the text
font - the font to use
attributeName - the attribute to use for the label
Returns:
the new textsymbolizer
Throws:
IllegalFilterException - - if the attribute name does not exist

createTextSymbolizer

public TextSymbolizer createTextSymbolizer(java.awt.Color color,
                                           Font[] fonts,
                                           java.lang.String attributeName)
                                    throws IllegalFilterException
create a textsymbolizer

Parameters:
color - the color of the text
fonts - an array of fonts to use from the first to last
attributeName - the attribute to use for the label
Returns:
the new textsymbolizer
Throws:
IllegalFilterException - - if the attribute name does not exist

createStaticTextSymbolizer

public TextSymbolizer createStaticTextSymbolizer(java.awt.Color color,
                                                 Font font,
                                                 java.lang.String label)
create a textsymbolizer which doesn't change

Parameters:
color - the color of the text
font - the font to use
label - the label to use
Returns:
the new textsymbolizer

createStaticTextSymbolizer

public TextSymbolizer createStaticTextSymbolizer(java.awt.Color color,
                                                 Font[] fonts,
                                                 java.lang.String label)
create a textsymbolizer which doesn't change

Parameters:
color - the color of the text
fonts - an array of fonts to use from the first to last
label - the label to use
Returns:
the new textsymbolizer

createTextSymbolizer

public TextSymbolizer createTextSymbolizer(Fill fill,
                                           Font[] fonts,
                                           Halo halo,
                                           Expression label,
                                           LabelPlacement labelPlacement,
                                           java.lang.String geometryPropertyName)
create a text symbolizer

Parameters:
fill - - the fill to color the text
fonts - - an array of fonts to use from the first to last
halo - - the halo to be applied to the text
label - - Expression representing the label
labelPlacement - - where to place the label
geometryPropertyName - - the name of the geometry to use
Returns:
the new textsymbolizer

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(Symbolizer symbolizer)
create a Feature type styler

Parameters:
symbolizer - - the symbolizer to use
Returns:
the new feature type styler

createRule

public Rule createRule(Symbolizer symbolizer)
create a simple styling rule

Parameters:
symbolizer - - the symbolizer to use
Returns:
the new rule

createRule

public Rule createRule(Symbolizer[] symbolizers)
reate a simple styling rule

Parameters:
symbolizers - - an array of symbolizers to use
Returns:
the new rule

createRule

public Rule createRule(Symbolizer symbolizer,
                       double minScaleDenominator,
                       double maxScaleDenominator)
create a simple styling rule, see the SLD Spec for more details of scaleDenominators

Parameters:
symbolizer - - the symbolizer to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new rule

createRule

public Rule createRule(Symbolizer[] symbolizers,
                       double minScaleDenominator,
                       double maxScaleDenominator)
create a simple styling rule, see the SLD Spec for more details of scaleDenominators

Parameters:
symbolizers - - an array of symbolizers to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new rule

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(Symbolizer symbolizer,
                                               double minScaleDenominator,
                                               double maxScaleDenominator)
create a Feature type styler see the SLD Spec for more details of scaleDenominators

Parameters:
symbolizer - - the symbolizer to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(Symbolizer[] symbolizers,
                                               double minScaleDenominator,
                                               double maxScaleDenominator)
create a Feature type styler see the SLD Spec for more details of scaleDenominators

Parameters:
symbolizers - - an array of symbolizers to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Symbolizer symbolizer)
create a Feature type styler

Parameters:
featureTypeName - - name of the feature type
symbolizer - - the symbolizer to use
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Symbolizer[] symbolizers)
create a Feature type styler

Parameters:
featureTypeName - - name of the feature type
symbolizers - - an array of symbolizers to use
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Symbolizer symbolizer,
                                               double minScaleDenominator,
                                               double maxScaleDenominator)
create a Feature type styler see the SLD Spec for more details of scaleDenominators

Parameters:
featureTypeName - - name of the feature type
symbolizer - - the symbolizer to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Symbolizer[] symbolizers,
                                               double minScaleDenominator,
                                               double maxScaleDenominator)
create a Feature type styler see the SLD Spec for more details of scaleDenominators

Parameters:
featureTypeName - - name of the feature type
symbolizers - - an array of symbolizers to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Rule r)
create a Feature type styler

Parameters:
featureTypeName - - name of the feature type
r - - the rule that driver this feature typ style
Returns:
the new feature type styler

createFeatureTypeStyle

public FeatureTypeStyle createFeatureTypeStyle(java.lang.String featureTypeName,
                                               Rule[] rules)
create a Feature type styler see the SLD Spec for more details of scaleDenominators

Parameters:
featureTypeName - - name of the feature type
rules - - the rules that make up the FeatureTypeStyle
Returns:
the new feature type styler

createStyle

public Style createStyle(Symbolizer symbolizer)
create a new style

Parameters:
symbolizer - - the symbolizer to use
Returns:
the new style

createStyle

public Style createStyle(Symbolizer symbolizer,
                         double minScaleDenominator,
                         double maxScaleDenominator)
create a new style

Parameters:
symbolizer - - the symbolizer to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new style

createStyle

public Style createStyle(java.lang.String featureTypeStyleName,
                         Symbolizer symbolizer)
create a new style

Parameters:
featureTypeStyleName - - the name to use for the feature type style
symbolizer - - the symbolizer to use
Returns:
the new style

createStyle

public Style createStyle(java.lang.String featureTypeStyleName,
                         Symbolizer symbolizer,
                         double minScaleDenominator,
                         double maxScaleDenominator)
create a new style

Parameters:
featureTypeStyleName - - the name to use for the feature type style
symbolizer - - the symbolizer to use
minScaleDenominator - - the minimim scale to draw the feature at
maxScaleDenominator - - the maximum scale to draw the feature at
Returns:
the new style

createStyle

public Style createStyle()
create a new default style

Returns:
the new style

colorExpression

public Expression colorExpression(java.awt.Color color)
convert an awt color in to a literal expression representing the color

Parameters:
color - the color to encode
Returns:
the expression

literalExpression

public Expression literalExpression(double value)
create a literal expression representing the value

Parameters:
value - the value to be encoded
Returns:
the expression

literalExpression

public Expression literalExpression(int value)
create a literal expression representing the value

Parameters:
value - the value to be encoded
Returns:
the expression

literalExpression

public Expression literalExpression(java.lang.String value)
create a literal expression representing the value

Parameters:
value - the value to be encoded
Returns:
the expression

literalExpression

public Expression literalExpression(java.lang.Object value)
                             throws IllegalFilterException
create a literal expression representing the value

Parameters:
value - the value to be encoded
Returns:
the expression
Throws:
IllegalFilterException - DOCUMENT ME!

attributeExpression

public Expression attributeExpression(java.lang.String attributeName)
                               throws IllegalFilterException
create an attribute expression

Parameters:
attributeName - the attribute to use
Returns:
the new expression
Throws:
IllegalFilterException - if the attribute name does not exist

buildClassifiedStyle

public Style buildClassifiedStyle(FeatureCollection fc,
                                  java.lang.String name,
                                  java.lang.String[] colors,
                                  FeatureType schema)
                           throws IllegalFilterException
given a feature collection and an array of colours build a style with the given number of classes on the named column

Parameters:
fc - DOCUMENT ME!
name - DOCUMENT ME!
colors - DOCUMENT ME!
schema - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IllegalFilterException - DOCUMENT ME!

createRasterSymbolizer

public RasterSymbolizer createRasterSymbolizer()
Creates the default raster symbolizer

Returns:

createRasterSymbolizer

public RasterSymbolizer createRasterSymbolizer(ColorMap colorMap,
                                               double opacity)
Creates a raster symbolizer

Parameters:
colorMap - The symbolizer color map
opacity - The whole layer opacity
Returns:

createColorMap

public ColorMap createColorMap(java.lang.String[] labels,
                               double[] quantities,
                               java.awt.Color[] colors,
                               int type)
Creates a color map based on fixed quantities and colors.

Parameters:
quantities - The values that begin a category, or break points in a ramp, or isolated values, according to the type of color map specified by Type
colors - The colors that will be associated to the categories, break points, or isolated values
type - Either @link ColorMap#TYPE_RAMP, @link ColorMap#TYPE_INTERVALS or @link ColorMap#TYPE_VALUES


Copyright © GeoTools. All Rights Reserved.