Interface StyleFactory

  • All Known Implementing Classes:
    AbstractStyleFactory, StyleFactoryImpl

    public interface StyleFactory
    Factory used in the production of style objects.

    This factory is responsible for the production of style objects; where noted these create methods are in agreement with the Symbology Encoding 1.1 specification.

    Since:
    GeoAPI 2.2
    Author:
    Open Geospatial Consortium, Johann Sorel (Geomatys)
    • Method Detail

      • createExternalGraphic

        ExternalGraphic createExternalGraphic​(URL url,
                                              String format)
      • createExternalGraphic

        ExternalGraphic createExternalGraphic​(String uri,
                                              String format)
      • createExternalGraphic

        ExternalGraphic createExternalGraphic​(Icon inlineContent,
                                              String format)
      • getCircleMark

        Mark getCircleMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • getXMark

        Mark getXMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • getStarMark

        Mark getStarMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • getSquareMark

        Mark getSquareMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • getCrossMark

        Mark getCrossMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • getTriangleMark

        Mark getTriangleMark()
        Convinence method for obtaining a mark of a fixed shape
        Returns:
        a Mark that matches the name in this method.
      • createExtent

        Extent createExtent​(String name,
                            String value)
        Creates a new extent.
        Parameters:
        name - The name of the extent.
        value - The value of the extent.
        Returns:
        The new extent.
      • createFeatureTypeConstraint

        FeatureTypeConstraint createFeatureTypeConstraint​(String featureTypeName,
                                                          Filter filter,
                                                          Extent... extents)
        Creates a new feature type constraint.
        Parameters:
        featureTypeName - The feature type name.
        filter - The filter.
        extents - The extents.
        Returns:
        The new feature type constaint.
      • createImageOutline

        ImageOutline createImageOutline​(Symbolizer symbolizer)
        Creates a new ImageOutline.
        Parameters:
        symbolizer - A line or polygon symbolizer.
        Returns:
        The new image outline.
      • createLineSymbolizer

        LineSymbolizer createLineSymbolizer()
        Create default line symbolizer
      • createPointSymbolizer

        PointSymbolizer createPointSymbolizer​(Graphic graphic,
                                              String geometryPropertyName)
      • createStyle

        Style createStyle()
      • createStroke

        Stroke createStroke​(Expression color,
                            Expression width)
        A convienice method to make a simple stroke
        Parameters:
        color - the color of the line
        width - the width of the line
        Returns:
        the stroke object
      • createStroke

        Stroke createStroke​(Expression color,
                            Expression width,
                            Expression opacity)
        A convienice method to make a simple stroke
        Parameters:
        color - the color of the line
        width - The width of the line
        opacity - The opacity of the line
        Returns:
        The stroke
      • createStroke

        Stroke createStroke​(Expression color,
                            Expression width,
                            Expression opacity,
                            Expression lineJoin,
                            Expression lineCap,
                            float[] dashArray,
                            Expression dashOffset,
                            Graphic graphicFill,
                            Graphic graphicStroke)
        creates a stroke
        Parameters:
        color - The color of the line
        width - The width of the line
        opacity - The opacity of the line
        lineJoin - - the type of Line joint
        lineCap - - the type of line cap
        dashArray - - an array of floats describing the dashes in the line
        dashOffset - - where in the dash array to start drawing from
        graphicFill - - a graphic object to fill the line with
        graphicStroke - - a graphic object to draw the line with
        Returns:
        The completed stroke.
      • createRule

        Rule createRule()
      • createLineSymbolizer

        LineSymbolizer createLineSymbolizer​(Stroke stroke,
                                            String geometryPropertyName)
      • createMark

        Mark createMark()
      • createColorMap

        ColorMap createColorMap()
      • getDefaultStyle

        Style getDefaultStyle()
      • getDefaultStroke

        Stroke getDefaultStroke()
      • getDefaultFill

        Fill getDefaultFill()
      • getDefaultMark

        Mark getDefaultMark()
      • getDefaultTextSymbolizer

        TextSymbolizer getDefaultTextSymbolizer()
        Creates a default Text Symbolizer, using the defaultFill, defaultFont and defaultPointPlacement, Sets the geometry attribute name to be geometry:text. No Halo is set. The label is not set
        Returns:
        A default TextSymbolizer
      • createDefaultGraphic

        Graphic createDefaultGraphic()
      • getDefaultGraphic

        Graphic getDefaultGraphic()
      • getDefaultFont

        Font getDefaultFont()
      • createUserLayer

        UserLayer createUserLayer()
      • createRemoteOWS

        RemoteOWS createRemoteOWS​(String service,
                                  String onlineResource)
      • colorMap

        ColorMap colorMap​(Expression propertyName,
                          Expression... mapping)
        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
        Parameters:
        propertyName - Property name to categorize, or use "Raster"
        mapping - Defined as a series of Expressions
        Returns:
        ColorMap wrapped around the "Cateogize" function
      • colorReplacement

        ColorReplacement colorReplacement​(Expression propertyName,
                                          Expression... mapping)
        Wrap up a replacement function using the provided expressions.
        Parameters:
        propertyName - Property name to categorize, or use "Raster"
        mapping - Defined as a series of Expressions
        Returns:
        ColorReplacement wrapped around a Function
      • externalGraphic

        ExternalGraphic externalGraphic​(Icon inline,
                                        Collection<ColorReplacement> replacements)
        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.

      • font

        Font 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.

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

        Returns:
        Font
      • lineSymbolizer

        LineSymbolizer lineSymbolizer​(String name,
                                      Expression geometry,
                                      Description description,
                                      Unit<?> unit,
                                      Stroke stroke,
                                      Expression offset)
        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
      • pointSymbolizer

        PointSymbolizer 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.
        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

        PolygonSymbolizer polygonSymbolizer​(String name,
                                            Expression geometry,
                                            Description description,
                                            Unit<?> unit,
                                            Stroke stroke,
                                            Fill fill,
                                            Displacement displacement,
                                            Expression offset)
        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
      • extensionSymbolizer

        ExtensionSymbolizer extensionSymbolizer​(String name,
                                                String geometry,
                                                Description description,
                                                Unit<?> unit,
                                                String extensionName,
                                                Map<String,​Expression> parameters)
        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).
        Parameters:
        name - handle used to refer to this symbolizer (machine readible)
        geometry - 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

        Rule rule​(String name,
                  Description description,
                  GraphicLegend legend,
                  double min,
                  double max,
                  List<Symbolizer> symbolizers,
                  Filter filter)
        Create a rule from the provided definition.
        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
      • shadedRelief

        ShadedRelief shadedRelief​(Expression reliefFactor,
                                  boolean brightnessOnly)
        Returns:
        ShadedRelief
      • textSymbolizer

        TextSymbolizer 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.
        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
      • createTextSymbolizer

        TextSymbolizer createTextSymbolizer​(Fill fill,
                                            Font[] fonts,
                                            Halo halo,
                                            Expression label,
                                            LabelPlacement labelPlacement,
                                            String geometryPropertyName,
                                            Graphic graphic)
        Label Shield hack, non SLD 1.1
        Parameters:
        fill - Fill
        fonts - Font information (CSS)
        halo - Describes Halo
        label - Expression for label
        labelPlacement - Captures label position
        geometryPropertyName - With respect to this geometry
        graphic - Used to draw a backdrop behind label
        Returns:
        TextSymbolizer2 allowing for a backdrop behind text label
      • getImplementationHints

        Map<RenderingHints.Key,​?> getImplementationHints()