|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.styling.SLD
Utility class for working with Geotools SLD objects.
This class assumes a subset of the SLD specification:
When you start to branch out to SLD information that contains multiple rules you will need to modify this class.
Field Summary | |
static StyleBuilder |
builder
|
static int |
NOTFOUND
NOTFOUND indicates int value was unavailable |
Constructor Summary | |
SLD()
|
Method Summary | |
static java.awt.Color |
color(Expression expr)
Navigate through the expression finding the first mentioned Color. |
static java.awt.Color |
color(Fill fill)
|
static java.awt.Color |
color(LineSymbolizer symbolizer)
Retrieve color from linesymbolizer if available. |
static java.awt.Color |
color(PointSymbolizer symbolizer)
Grabs the color from the first Mark. |
static java.lang.String[] |
colors(Rule rule)
|
static java.lang.String[] |
colors(Style style)
|
static java.lang.String |
colorToHex(java.awt.Color c)
|
static Style |
defaultStyle(StyledLayerDescriptor sld)
|
static double |
doubleValue(Expression expr)
Deprecated. |
static FeatureTypeStyle |
featureTypeStyle(StyledLayerDescriptor sld,
FeatureType type)
|
static FeatureTypeStyle |
featureTypeStyle(Style style,
FeatureType type)
Returns the feature type style in the style which matched a particular name. |
static FeatureTypeStyle[] |
featureTypeStyles(StyledLayerDescriptor sld)
|
static Fill |
fill(PointSymbolizer sym)
|
static Fill |
fill(PolygonSymbolizer sym)
|
static Filter[] |
filters(Rule[] rule)
|
static Filter[] |
filters(Style style)
|
static Font |
font(TextSymbolizer symbolizer)
|
static Graphic |
graphic(PointSymbolizer sym)
|
static int |
intValue(Expression expr)
Deprecated. |
static java.awt.Color |
lineColor(LineSymbolizer symbolizer)
Retrieve linestring color from linesymbolizer if available. |
static float[] |
lineDash(LineSymbolizer symbolizer)
Grabs the dashes array from the first LineSymbolizer. |
static java.lang.String |
lineLinecap(LineSymbolizer symbolizer)
Grabs the linecap from the first LineSymbolizer. |
static java.lang.String |
lineLinejoin(LineSymbolizer symbolizer)
Grabs the linejoin from the first LineSymbolizer. |
static double |
lineOpacity(LineSymbolizer symbolizer)
Grabs the opacity from the first LineSymbolizer. |
static LineSymbolizer |
lineSymbolizer(FeatureTypeStyle fts)
Retrieve the first LineSymbolizer from the provided Style. |
static LineSymbolizer |
lineSymbolizer(Style style)
Retrieve the first LineSymbolizer from the provided Style. |
static int |
lineWidth(LineSymbolizer symbolizer)
Retrieve linestring width from symbolizer if available. |
static Mark |
mark(Graphic graphic)
|
static Mark |
mark(PointSymbolizer sym)
|
static Style |
matchingStyle(Style[] styles,
FeatureType schema)
Returns the first style object which matches a given schema. |
static java.lang.Number |
number(Expression expr)
Deprecated. |
static double |
opacity(Fill fill)
|
static double |
opacity(Stroke stroke)
|
static double |
pointBorderOpacity(PointSymbolizer symbolizer)
Grabs the point border opacity from the first PointSymbolizer. |
static java.awt.Color |
pointColor(PointSymbolizer symbolizer)
Grabs the color from the first Mark. |
static java.awt.Color |
pointFill(PointSymbolizer symbolizer)
Grabs the fill from the first Mark. |
static java.net.URL |
pointGraphic(Style style)
Grabs the location of the first external graphic. |
static Mark |
pointMark(Style style)
|
static double |
pointOpacity(PointSymbolizer symbolizer)
Grabs the point opacity from the first PointSymbolizer. |
static int |
pointSize(PointSymbolizer symbolizer)
Grabs the size of the points graphic, if found. |
static PointSymbolizer |
pointSymbolizer(FeatureTypeStyle fts)
Retrieve the first PointSymbolizer from the provided FeatureTypeStyle. |
static PointSymbolizer |
pointSymbolizer(Style style)
Retrieve the first PointSymbolizer from the provided Style. |
static java.lang.String |
pointWellKnownName(PointSymbolizer symbolizer)
Grabs the well known name of the first Mark that has one. |
static int |
pointWidth(PointSymbolizer symbolizer)
Grabs the width of the first Mark with a Stroke that has a non-null width. |
static double |
polyBorderOpacity(PolygonSymbolizer symbolizer)
Grabs the border opacity from the first PolygonSymbolizer. |
static java.awt.Color |
polyColor(PolygonSymbolizer symbolizer)
Grabs the color from the first PolygonSymbolizer. |
static java.awt.Color |
polyFill(PolygonSymbolizer symbolizer)
Grabs the fill from the first PolygonSymbolizer. |
static double |
polyFillOpacity(PolygonSymbolizer symbolizer)
Grabs the fill opacity from the first PolygonSymbolizer. |
static PolygonSymbolizer |
polySymbolizer(FeatureTypeStyle fts)
Retrieve the first PolygonSymbolizer from the provided Style. |
static PolygonSymbolizer |
polySymbolizer(Style style)
Retrieve the first PolygonSymbolizer from the provided Style. |
static int |
polyWidth(PolygonSymbolizer symbolizer)
Grabs the color from the first PolygonSymbolizer. |
static double |
rasterOpacity(RasterSymbolizer symbolizer)
Grabs the opacity from the first RasterSymbolizer. |
static double |
rasterOpacity(Style style)
|
static RasterSymbolizer |
rasterSymbolizer(FeatureTypeStyle fts)
Retrieve the first RasterSymbolizer from the provided Style. |
static RasterSymbolizer |
rasterSymbolizer(Style style)
Retrieve the first RasterSymbolizer from the provided Style. |
static Rule[] |
rules(Style style)
|
static void |
setLineColour(LineSymbolizer symbolizer,
java.awt.Color colour)
Sets the Colour for the given Line symbolizer |
static void |
setLineColour(Style style,
java.awt.Color colour)
Sets the colour for a line symbolizer |
static void |
setPointColour(PointSymbolizer symbolizer,
java.awt.Color colour)
Sets the Colour for the given point symbolizer |
static void |
setPointColour(Style style,
java.awt.Color colour)
Sets the Colour for the point symbolizer |
static void |
setPolyColour(PolygonSymbolizer symbolizer,
java.awt.Color colour)
Sets the Colour for the given polygon symbolizer |
static void |
setPolyColour(Style style,
java.awt.Color colour)
Sets the colour for a polygon symbolizer |
static int |
size(Mark mark)
|
static java.lang.String |
stringValue(Expression expr)
Deprecated. |
static Stroke |
stroke(LineSymbolizer sym)
|
static Stroke |
stroke(PointSymbolizer sym)
|
static Stroke |
stroke(PolygonSymbolizer sym)
|
static java.awt.Color |
strokeColor(Stroke stroke)
|
static StyledLayerDescriptor |
styledLayerDescriptor(java.lang.Object gtComponent)
Climbs the style hierarchy until null or an SLD is found. |
static Style[] |
styles(StyledLayerDescriptor sld)
|
protected static Symbolizer |
symbolizer(FeatureTypeStyle fts,
java.lang.Class SYMBOLIZER)
Retrieve the first SYMBOLIZER from the provided FeatureTypeStyle. |
protected static Symbolizer |
symbolizer(Style style,
java.lang.Class SYMBOLIZER)
Retrieve the first SYMBOLIZER from the provided Style. |
static java.awt.Color |
textFontFill(TextSymbolizer symbolizer)
Grabs the fontFill from the first TextSymbolizer. |
static java.awt.Color |
textHaloFill(TextSymbolizer symbolizer)
Grabs the haloFill from the first TextSymbolizer. |
static double |
textHaloOpacity(TextSymbolizer symbolizer)
Grabs the halo opacity from the first TextSymbolizer. |
static int |
textHaloWidth(TextSymbolizer symbolizer)
Grabs the halo width from the first TextSymbolizer. |
static Expression |
textLabel(TextSymbolizer symbolizer)
Grabs the label from the first TextSymbolizer. |
static java.lang.String |
textLabelString(TextSymbolizer sym)
|
static TextSymbolizer |
textSymbolizer(FeatureTypeStyle fts)
Retrieve the first TextSymbolizer from the provided Style. |
static TextSymbolizer |
textSymbolizer(Style style)
Retrieve the first TextSymbolizer from the provided Style. |
static java.awt.Color |
toColor(java.lang.String htmlColor)
|
static java.lang.String |
toHTMLColor(java.awt.Color color)
Converts a java.awt.Color into an HTML Colour |
static java.lang.Object |
value(Expression expr,
java.lang.Class TYPE)
Deprecated. |
static java.lang.String |
wellKnownName(Mark mark)
|
static int |
width(LineSymbolizer symbolizer)
Retrieve linestring width from symbolizer if available. |
static int |
width(Stroke stroke)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOTFOUND
NOTFOUND
indicates int value was unavailable
public static final StyleBuilder builder
Constructor Detail |
public SLD()
Method Detail |
public static java.awt.Color lineColor(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static java.awt.Color strokeColor(Stroke stroke)
public static java.awt.Color color(Fill fill)
public static void setLineColour(Style style, java.awt.Color colour)
style
- colour
- public static void setLineColour(LineSymbolizer symbolizer, java.awt.Color colour)
symbolizer
- colour
- public static java.awt.Color color(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static int lineWidth(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static int width(Stroke stroke)
public static int size(Mark mark)
public static int width(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static double lineOpacity(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static double opacity(Stroke stroke)
public static java.lang.String lineLinejoin(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static java.lang.String lineLinecap(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static float[] lineDash(LineSymbolizer symbolizer)
symbolizer
- Line symbolizer information.
public static java.net.URL pointGraphic(Style style)
style
- SLD style information.
public static Mark pointMark(Style style)
public static Mark mark(PointSymbolizer sym)
public static Mark mark(Graphic graphic)
public static Graphic graphic(PointSymbolizer sym)
public static int pointSize(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static java.lang.String pointWellKnownName(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static java.lang.String wellKnownName(Mark mark)
public static java.awt.Color pointColor(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static void setPointColour(Style style, java.awt.Color colour)
style
- colour
- public static void setPointColour(PointSymbolizer symbolizer, java.awt.Color colour)
symbolizer
- colour
- public static java.awt.Color color(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static int pointWidth(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static double pointBorderOpacity(PointSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static double pointOpacity(PointSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static java.awt.Color pointFill(PointSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Point symbolizer information.
public static int polyWidth(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static java.awt.Color polyColor(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static void setPolyColour(Style style, java.awt.Color colour)
style
- colour
- public static void setPolyColour(PolygonSymbolizer symbolizer, java.awt.Color colour)
symbolizer
- colour
- public static java.awt.Color polyFill(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double polyBorderOpacity(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double polyFillOpacity(PolygonSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Polygon symbolizer information.
public static double opacity(Fill fill)
public static double rasterOpacity(RasterSymbolizer symbolizer)
If you are using something fun like rules you will need to do your own thing.
symbolizer
- Raster symbolizer information.
public static double rasterOpacity(Style style)
public static TextSymbolizer textSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static TextSymbolizer textSymbolizer(Style style)
style
- SLD style information.
public static Expression textLabel(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static java.lang.String textLabelString(TextSymbolizer sym)
public static java.awt.Color textFontFill(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static Font font(TextSymbolizer symbolizer)
public static java.awt.Color textHaloFill(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static int textHaloWidth(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static double textHaloOpacity(TextSymbolizer symbolizer)
If you are using something fun like symbols you will need to do your own thing.
symbolizer
- Text symbolizer information.
public static java.lang.Object value(Expression expr, java.lang.Class TYPE)
expr
- DOCUMENT ME!TYPE
- DOCUMENT ME!
org.geotools.filter.Filters#value(Expression, Class)
public static java.awt.Color color(Expression expr)
If you have a specific Feature in mind please use:
Object value = expr.getValue( feature );
return value instanceof Color ? (Color) value : null;
expr
-
public static int intValue(Expression expr)
expr
- DOCUMENT ME!
Filters#intValue(Expression)
public static java.lang.String stringValue(Expression expr)
expr
- DOCUMENT ME!
Filters#stringValue(Expression)
public static double doubleValue(Expression expr)
expr
- DOCUMENT ME!
Filters#doubleValue(Expression)
public static java.lang.Number number(Expression expr)
expr
- DOCUMENT ME!
Filters#number(Expression)
public static RasterSymbolizer rasterSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static RasterSymbolizer rasterSymbolizer(Style style)
style
- SLD style information.
public static LineSymbolizer lineSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static LineSymbolizer lineSymbolizer(Style style)
style
- SLD style information.
public static Stroke stroke(LineSymbolizer sym)
public static Stroke stroke(PolygonSymbolizer sym)
public static Stroke stroke(PointSymbolizer sym)
public static Fill fill(PolygonSymbolizer sym)
public static Fill fill(PointSymbolizer sym)
public static PointSymbolizer pointSymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static PointSymbolizer pointSymbolizer(Style style)
style
- SLD style information.
public static PolygonSymbolizer polySymbolizer(FeatureTypeStyle fts)
fts
- SLD featureTypeStyle information.
public static PolygonSymbolizer polySymbolizer(Style style)
style
- SLD style information.
public static FeatureTypeStyle featureTypeStyle(Style style, FeatureType type)
style
- The style in question.type
- The feature type must be non-null.
public static Style matchingStyle(Style[] styles, FeatureType schema)
styles
- Array of style objects.schema
- Feature schema.
protected static Symbolizer symbolizer(Style style, java.lang.Class SYMBOLIZER)
style
- SLD style information.SYMBOLIZER
- LineSymbolizer.class, PointSymbolizer.class,
PolygonSymbolizer.class, RasterSymbolizer.class, or TextSymbolizer.class
protected static Symbolizer symbolizer(FeatureTypeStyle fts, java.lang.Class SYMBOLIZER)
SYMBOLIZER
- LineSymbolizer.class, PointSymbolizer.class,
PolygonSymbolizer.class, RasterSymbolizer.class, or TextSymbolizer.class
public static java.lang.String colorToHex(java.awt.Color c)
public static Style[] styles(StyledLayerDescriptor sld)
public static FeatureTypeStyle[] featureTypeStyles(StyledLayerDescriptor sld)
public static FeatureTypeStyle featureTypeStyle(StyledLayerDescriptor sld, FeatureType type)
public static Style defaultStyle(StyledLayerDescriptor sld)
public static StyledLayerDescriptor styledLayerDescriptor(java.lang.Object gtComponent)
public static Filter[] filters(Rule[] rule)
public static Filter[] filters(Style style)
public static Rule[] rules(Style style)
public static java.lang.String[] colors(Style style)
public static java.lang.String[] colors(Rule rule)
public static java.lang.String toHTMLColor(java.awt.Color color)
color
-
public static java.awt.Color toColor(java.lang.String htmlColor)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |