org.geotools.styling
Class StyleFactoryImpl2

Object
  extended by StyleFactoryImpl2
All Implemented Interfaces:
StyleFactory

public class StyleFactoryImpl2
extends Object
implements StyleFactory

Factory for creating Styles; based on the GeoAPI StyleFactory interface.

This factory is simple; it just creates styles with no logic or magic default values. For magic default values please read the SE or SLD specification; or use an appropriate builder.

Author:
Jody Garnett

Constructor Summary
  StyleFactoryImpl2()
           
protected StyleFactoryImpl2(FilterFactory2 factory)
           
 
Method Summary
 AnchorPoint anchorPoint(Expression x, Expression y)
           
 ChannelSelection channelSelection(SelectedChannelType gray)
           
 ChannelSelectionImpl channelSelection(SelectedChannelType red, SelectedChannelType green, SelectedChannelType blue)
           
 ColorMapImpl colorMap(Expression propertyName, Expression... mapping)
          Wrap up a "Categorize" function using the provided expressions.
 ColorReplacementImpl colorReplacement(Expression propertyName, Expression... mapping)
          Wrap up a replacement function using the provided expressions.
 ContrastEnhancementImpl contrastEnhancement(Expression gamma, ContrastMethod method)
           
 DescriptionImpl description(InternationalString title, InternationalString description)
           
 DisplacementImpl displacement(Expression dx, Expression dy)
          Create Displacement
 ExtensionSymbolizer extensionSymbolizer(String name, String propertyName, Description description, Unit<?> unit, String extensionName, Map<String,Expression> parameters)
          Used to represent a symbolizer intended for a vendor specific rendering process.
 ExternalGraphicImpl externalGraphic(Icon inline, Collection<ColorReplacement> replacements)
          Create ExternalGraphic using a Java Icon.
 ExternalGraphicImpl externalGraphic(OnLineResource resource, String format, Collection<ColorReplacement> replacements)
          Create externalGraphic
 ExternalMarkImpl externalMark(Icon inline)
           
 ExternalMarkImpl externalMark(OnLineResource resource, String format, int markIndex)
           
 FeatureTypeStyleImpl featureTypeStyle(String name, Description description, Id definedFor, Set<Name> featureTypeNames, Set<SemanticType> types, List<Rule> rules)
           
 FillImpl fill(GraphicFill graphicFill, Expression color, Expression opacity)
          Create fill.
 FontImpl font(List<Expression> family, Expression style, Expression weight, Expression size)
          Create font entry; note this captures a list of font families in the preferred order, with the rendering engine choosing the first entry in the list available to the runtime environment.
 GraphicImpl graphic(List<GraphicalSymbol> symbols, Expression opacity, Expression size, Expression rotation, AnchorPoint anchor, Displacement disp)
          Create a graphic.
 GraphicImpl graphicFill(List<GraphicalSymbol> symbols, Expression opacity, Expression size, Expression rotation, AnchorPoint anchorPoint, Displacement displacement)
           
 GraphicImpl graphicLegend(List<GraphicalSymbol> symbols, Expression opacity, Expression size, Expression rotation, AnchorPoint anchorPoint, Displacement displacement)
           
 GraphicImpl graphicStroke(List<GraphicalSymbol> symbols, Expression opacity, Expression size, Expression rotation, AnchorPoint anchorPoint, Displacement displacement, Expression initialGap, Expression gap)
           
 HaloImpl halo(Fill fill, Expression radius)
           
 LinePlacementImpl linePlacement(Expression offset, Expression initialGap, Expression gap, boolean repeated, boolean aligned, boolean generalizedLine)
           
 LineSymbolizerImpl lineSymbolizer(String name, Expression geometry, Description description, Unit<?> unit, Stroke stroke, Expression offset)
           
 MarkImpl mark(Expression wellKnownName, Fill fill, Stroke stroke)
           
 MarkImpl mark(ExternalMark externalMark, Fill fill, Stroke stroke)
           
 PointPlacementImpl pointPlacement(AnchorPoint anchor, Displacement displacement, Expression rotation)
           
 PointSymbolizerImpl pointSymbolizer(String name, Expression geometry, Description description, Unit<?> unit, Graphic graphic)
          Creation of a PointSymbolizer to describe how geometry can be rendered as a point.
 PolygonSymbolizerImpl polygonSymbolizer(String name, Expression geometry, Description description, Unit<?> unit, Stroke stroke, Fill fill, Displacement displacement, Expression offset)
           
 RasterSymbolizerImpl rasterSymbolizer(String name, Expression geometry, Description description, Unit<?> unit, Expression opacity, ChannelSelection channelSelection, OverlapBehavior overlapsBehaviour, ColorMap colorMap, ContrastEnhancement contrast, ShadedRelief shaded, Symbolizer outline)
           
 RuleImpl rule(String name, Description description, GraphicLegend legend, double min, double max, List<Symbolizer> symbolizers, Filter filter)
          Create a rule from the provided definition.
 SelectedChannelTypeImpl selectedChannelType(String channelName, ContrastEnhancement contrastEnhancement)
           
 ShadedReliefImpl shadedRelief(Expression reliefFactor, boolean brightnessOnly)
           
 StrokeImpl stroke(Expression color, Expression opacity, Expression width, Expression join, Expression cap, float[] dashes, Expression offset)
           
 StrokeImpl stroke(GraphicFill fill, Expression color, Expression opacity, Expression width, Expression join, Expression cap, float[] dashes, Expression offset)
           
 StrokeImpl stroke(GraphicStroke stroke, Expression color, Expression opacity, Expression width, Expression join, Expression cap, float[] dashes, Expression offset)
           
 StyleImpl style(String name, Description description, boolean isDefault, List<FeatureTypeStyle> featureTypeStyles, Symbolizer defaultSymbolizer)
           
 TextSymbolizerImpl textSymbolizer(String name, Expression geometry, Description description, Unit<?> unit, Expression label, Font font, LabelPlacement placement, Halo halo, Fill fill)
          Creation of a TextSymbolizer defining how labels are portrayed.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleFactoryImpl2

public StyleFactoryImpl2()

StyleFactoryImpl2

protected StyleFactoryImpl2(FilterFactory2 factory)
Method Detail

anchorPoint

public AnchorPoint anchorPoint(Expression x,
                               Expression y)
Specified by:
anchorPoint in interface StyleFactory
Returns:

channelSelection

public ChannelSelection channelSelection(SelectedChannelType gray)
Specified by:
channelSelection in interface StyleFactory
Returns:

channelSelection

public ChannelSelectionImpl channelSelection(SelectedChannelType red,
                                             SelectedChannelType green,
                                             SelectedChannelType blue)
Specified by:
channelSelection in interface StyleFactory
Returns:

colorMap

public ColorMapImpl colorMap(Expression propertyName,
                             Expression... mapping)
Description copied from interface: StyleFactory
Wrap up a "Categorize" function using the provided expressions.

The function will be created based on:

  1. PropertyName; use "Rasterdata" to indicate this is a color map
  2. Literal: lookup value
  3. Literal: threshold 1
  4. Literal: value 1
  5. Literal: threshold 2
  6. Literal: value 2
  7. Literal: (Optional) succeeding or preceding

Specified by:
colorMap in interface StyleFactory
Parameters:
propertyName - Property name to categorize, or use "Raster"
mapping - Defined as a series of Expressions
Returns:
ColorMap wrapped around the "Cateogize" function

colorReplacement

public ColorReplacementImpl colorReplacement(Expression propertyName,
                                             Expression... mapping)
Description copied from interface: StyleFactory
Wrap up a replacement function using the provided expressions.

Specified by:
colorReplacement in interface StyleFactory
Parameters:
propertyName - Property name to categorize, or use "Raster"
mapping - Defined as a series of Expressions
Returns:
ColorReplacement wrapped around a Function

contrastEnhancement

public ContrastEnhancementImpl contrastEnhancement(Expression gamma,
                                                   ContrastMethod method)
Specified by:
contrastEnhancement in interface StyleFactory
Returns:

description

public DescriptionImpl description(InternationalString title,
                                   InternationalString description)
Specified by:
description in interface StyleFactory
Returns:

displacement

public DisplacementImpl displacement(Expression dx,
                                     Expression dy)
Description copied from interface: StyleFactory
Create Displacement

Specified by:
displacement in interface StyleFactory
Returns:

externalGraphic

public ExternalGraphicImpl externalGraphic(Icon inline,
                                           Collection<ColorReplacement> replacements)
Description copied from interface: StyleFactory
Create ExternalGraphic using a Java Icon.

This is used to produce high quality output by allowing you to directly draw each symbol by supplying your own Icon implementation.

Specified by:
externalGraphic in interface StyleFactory
Returns:

externalGraphic

public ExternalGraphicImpl externalGraphic(OnLineResource resource,
                                           String format,
                                           Collection<ColorReplacement> replacements)
Description copied from interface: StyleFactory
Create externalGraphic

Specified by:
externalGraphic in interface StyleFactory
Returns:

externalMark

public ExternalMarkImpl externalMark(Icon inline)
Specified by:
externalMark in interface StyleFactory
Returns:

externalMark

public ExternalMarkImpl externalMark(OnLineResource resource,
                                     String format,
                                     int markIndex)
Specified by:
externalMark in interface StyleFactory
Returns:

featureTypeStyle

public FeatureTypeStyleImpl featureTypeStyle(String name,
                                             Description description,
                                             Id definedFor,
                                             Set<Name> featureTypeNames,
                                             Set<SemanticType> types,
                                             List<Rule> rules)
Specified by:
featureTypeStyle in interface StyleFactory
rules - May not be null or empty
Returns:

fill

public FillImpl fill(GraphicFill graphicFill,
                     Expression color,
                     Expression opacity)
Description copied from interface: StyleFactory
Create fill.

Specified by:
fill in interface StyleFactory
Returns:

font

public FontImpl font(List<Expression> family,
                     Expression style,
                     Expression weight,
                     Expression size)
Description copied from interface: StyleFactory
Create font entry; note this captures a list of font families in the preferred order, with the rendering engine choosing the first entry in the list available to the runtime environment.

If fonts are not showing up as you expect please review the list of fonts installed into your JRE.

Specified by:
font in interface StyleFactory
Returns:
Font

graphic

public GraphicImpl graphic(List<GraphicalSymbol> symbols,
                           Expression opacity,
                           Expression size,
                           Expression rotation,
                           AnchorPoint anchor,
                           Displacement disp)
Description copied from interface: StyleFactory
Create a graphic.

Specified by:
graphic in interface StyleFactory
Returns:

graphicFill

public GraphicImpl graphicFill(List<GraphicalSymbol> symbols,
                               Expression opacity,
                               Expression size,
                               Expression rotation,
                               AnchorPoint anchorPoint,
                               Displacement displacement)
Specified by:
graphicFill in interface StyleFactory
Returns:

graphicLegend

public GraphicImpl graphicLegend(List<GraphicalSymbol> symbols,
                                 Expression opacity,
                                 Expression size,
                                 Expression rotation,
                                 AnchorPoint anchorPoint,
                                 Displacement displacement)
Specified by:
graphicLegend in interface StyleFactory
Returns:

graphicStroke

public GraphicImpl graphicStroke(List<GraphicalSymbol> symbols,
                                 Expression opacity,
                                 Expression size,
                                 Expression rotation,
                                 AnchorPoint anchorPoint,
                                 Displacement displacement,
                                 Expression initialGap,
                                 Expression gap)
Specified by:
graphicStroke in interface StyleFactory
Returns:

halo

public HaloImpl halo(Fill fill,
                     Expression radius)
Specified by:
halo in interface StyleFactory
Returns:

linePlacement

public LinePlacementImpl linePlacement(Expression offset,
                                       Expression initialGap,
                                       Expression gap,
                                       boolean repeated,
                                       boolean aligned,
                                       boolean generalizedLine)
Specified by:
linePlacement in interface StyleFactory
Returns:

lineSymbolizer

public LineSymbolizerImpl lineSymbolizer(String name,
                                         Expression geometry,
                                         Description description,
                                         Unit<?> unit,
                                         Stroke stroke,
                                         Expression offset)
Specified by:
lineSymbolizer in interface StyleFactory
Parameters:
name - handle used to refer to this symbolizer (machine readible)
geometry - Expression used to produce the Geometry to renderer; often a PropertyName
unit - Unit of measure used to define this symbolizer
stroke - Definition of how to stroke linework
offset - Offset used to position line relative to origional
Returns:
Newly created Line Symbolizer

mark

public MarkImpl mark(Expression wellKnownName,
                     Fill fill,
                     Stroke stroke)
Specified by:
mark in interface StyleFactory
Returns:

mark

public MarkImpl mark(ExternalMark externalMark,
                     Fill fill,
                     Stroke stroke)
Specified by:
mark in interface StyleFactory
Returns:

pointPlacement

public PointPlacementImpl pointPlacement(AnchorPoint anchor,
                                         Displacement displacement,
                                         Expression rotation)
Specified by:
pointPlacement in interface StyleFactory
Returns:

pointSymbolizer

public PointSymbolizerImpl pointSymbolizer(String name,
                                           Expression geometry,
                                           Description description,
                                           Unit<?> unit,
                                           Graphic graphic)
Description copied from interface: StyleFactory
Creation of a PointSymbolizer to describe how geometry can be rendered as a point.

Specified by:
pointSymbolizer in interface StyleFactory
Parameters:
name - handle used to refer to this symbolizer (machine readable)
geometry - Expression used to extract the Geometry rendered; usually a PropertyName
description - Human readable description of symboizer
unit - Unit of Measure used to interpret symbolizer distances
graphic - Graphic used to represent the geometry when rendering
Returns:
Newly created PointSymbolizer

polygonSymbolizer

public PolygonSymbolizerImpl polygonSymbolizer(String name,
                                               Expression geometry,
                                               Description description,
                                               Unit<?> unit,
                                               Stroke stroke,
                                               Fill fill,
                                               Displacement displacement,
                                               Expression offset)
Specified by:
polygonSymbolizer in interface StyleFactory
Parameters:
name - handle used to refer to this symbolizer (machine readable)
geometry - Expression used to extract the Geometry rendered; usually a PropertyName
description - Human readable description of symboizer
unit - Unit of Measure used to interpret symbolizer distances
Returns:

rasterSymbolizer

public RasterSymbolizerImpl rasterSymbolizer(String name,
                                             Expression geometry,
                                             Description description,
                                             Unit<?> unit,
                                             Expression opacity,
                                             ChannelSelection channelSelection,
                                             OverlapBehavior overlapsBehaviour,
                                             ColorMap colorMap,
                                             ContrastEnhancement contrast,
                                             ShadedRelief shaded,
                                             Symbolizer outline)
Specified by:
rasterSymbolizer in interface StyleFactory
Parameters:
name - handle used to refer to this symbolizer (machine readable)
geometry - Expression used to extract the Geometry rendered; usually a PropertyName
description - Human readable description of symboizer
unit - Unit of Measure used to interpret symbolizer distances
Returns:
RasterSymbolizer

extensionSymbolizer

public ExtensionSymbolizer extensionSymbolizer(String name,
                                               String propertyName,
                                               Description description,
                                               Unit<?> unit,
                                               String extensionName,
                                               Map<String,Expression> parameters)
Description copied from interface: StyleFactory
Used to represent a symbolizer intended for a vendor specific rendering process. This facility should be used to control subject matter that is beyond the scope of the traditional symbology encoding data structure (subject matter like wind barbs or extra deegrees of freedom like temporal symbolizers are good examples of the use of this facility).

Specified by:
extensionSymbolizer in interface StyleFactory
Parameters:
name - handle used to refer to this symbolizer (machine readible)
propertyName - Geometry expression to renderer; formally a PropertyName
description - Description of this symbolizer; human readable
unit - Unit of measure to use when interpretting this symbolizer
extensionName - Extension name used to identify the vendor specific extension being controlled
parameters - Named expressions used to configure the vendor specific rendering process
Returns:
newly created ExtensionSymbolizer

rule

public RuleImpl rule(String name,
                     Description description,
                     GraphicLegend legend,
                     double min,
                     double max,
                     List<Symbolizer> symbolizers,
                     Filter filter)
Description copied from interface: StyleFactory
Create a rule from the provided definition.

Specified by:
rule in interface StyleFactory
Parameters:
name - handle used to refer to this rule (machine readable)
description - Human readable description of this rule
legend - Graphic used to indicate this rule in a legend or user interface
min - minimum scale denominator used to control when this rule is applied
max - maximum scale denominator used to control when this rule is applied
Returns:
Newly created Rule

selectedChannelType

public SelectedChannelTypeImpl selectedChannelType(String channelName,
                                                   ContrastEnhancement contrastEnhancement)
Specified by:
selectedChannelType in interface StyleFactory
Returns:
SelectedChannelType

shadedRelief

public ShadedReliefImpl shadedRelief(Expression reliefFactor,
                                     boolean brightnessOnly)
Specified by:
shadedRelief in interface StyleFactory
Returns:
ShadedRelief

stroke

public StrokeImpl stroke(Expression color,
                         Expression opacity,
                         Expression width,
                         Expression join,
                         Expression cap,
                         float[] dashes,
                         Expression offset)
Specified by:
stroke in interface StyleFactory

stroke

public StrokeImpl stroke(GraphicFill fill,
                         Expression color,
                         Expression opacity,
                         Expression width,
                         Expression join,
                         Expression cap,
                         float[] dashes,
                         Expression offset)
Specified by:
stroke in interface StyleFactory

stroke

public StrokeImpl stroke(GraphicStroke stroke,
                         Expression color,
                         Expression opacity,
                         Expression width,
                         Expression join,
                         Expression cap,
                         float[] dashes,
                         Expression offset)
Specified by:
stroke in interface StyleFactory

style

public StyleImpl style(String name,
                       Description description,
                       boolean isDefault,
                       List<FeatureTypeStyle> featureTypeStyles,
                       Symbolizer defaultSymbolizer)
Specified by:
style in interface StyleFactory
Returns:

textSymbolizer

public TextSymbolizerImpl textSymbolizer(String name,
                                         Expression geometry,
                                         Description description,
                                         Unit<?> unit,
                                         Expression label,
                                         Font font,
                                         LabelPlacement placement,
                                         Halo halo,
                                         Fill fill)
Description copied from interface: StyleFactory
Creation of a TextSymbolizer defining how labels are portrayed.

Specified by:
textSymbolizer in interface StyleFactory
Parameters:
name - Handle used to refer to this symbolizer (machine readable)
geometry - Geometry to be rendered
description - Human readable description
unit - Unit of measure used to interpret symbolizer sizes
label - Text displayed for this symbolizer
font - Font selected to renderer this symbolizer
placement - Placement information relative to orgiginal geometry
halo - definition of a halo or outline surrounding the symbolizer
fill - definition of fill used
Returns:
newly created TextSymbolizer


Copyright © 1996-2014 Geotools. All Rights Reserved.