Class MeteoMarkFactory

  • All Implemented Interfaces:
    MarkFactory

    public class MeteoMarkFactory
    extends Object
    implements MarkFactory
    Adds to the well-known shapes some symbols the weathermen may find useful.
    Author:
    Luca Morandini lmorandini@ieee.org
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ARROW_HEIGHT_RATIO_KEY
      Key for the extshape://arrow height ratio (between 0 and 1000).
      static String ARROW_THICKNESS_KEY
      Key for the extshape://arrow base line thickness (must be between 0, just border, and 1, which turns the arrow into a irregular pentagon, "little house" like).
      static String ARROWHEAD_BASE_KEY
      Key for the extshape://arrow location of the arrowhead base, a value of 0 turns the shape into a triangle, a value of 1 into a rectangle.
      static String SHAPE_PREFIX  
      protected static Map<String,​Shape> WELLKNOWN_SHAPES  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Shape getShape​(Graphics2D graphics, Expression symbolUrl, Feature feature)
      Turns the specified URL into an Shape, eventually using the Feature attributes to evaluate the expression, or returns null if the factory cannot evaluate this symbolUrl.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ARROW_HEIGHT_RATIO_KEY

        public static final String ARROW_HEIGHT_RATIO_KEY
        Key for the extshape://arrow height ratio (between 0 and 1000). Default value is 2, twice as high as large
        See Also:
        Constant Field Values
      • ARROW_THICKNESS_KEY

        public static final String ARROW_THICKNESS_KEY
        Key for the extshape://arrow base line thickness (must be between 0, just border, and 1, which turns the arrow into a irregular pentagon, "little house" like). Default value is 0.2
        See Also:
        Constant Field Values
      • ARROWHEAD_BASE_KEY

        public static final String ARROWHEAD_BASE_KEY
        Key for the extshape://arrow location of the arrowhead base, a value of 0 turns the shape into a triangle, a value of 1 into a rectangle. Default value is 0.5
        See Also:
        Constant Field Values
      • WELLKNOWN_SHAPES

        protected static final Map<String,​Shape> WELLKNOWN_SHAPES
    • Constructor Detail

      • MeteoMarkFactory

        public MeteoMarkFactory()
    • Method Detail

      • getShape

        public Shape getShape​(Graphics2D graphics,
                              Expression symbolUrl,
                              Feature feature)
                       throws Exception
        Description copied from interface: MarkFactory
        Turns the specified URL into an Shape, eventually using the Feature attributes to evaluate the expression, or returns null if the factory cannot evaluate this symbolUrl.

        The returned Shape must not exceed the [-0.5, -0.5, 0.5, 0.5] bounds (will be rescaled according to the parameter given in graphics on the fly

        Specified by:
        getShape in interface MarkFactory
        symbolUrl - the expression that will return the symbol name. Once evaluated the expression should return something like plainName or like protocol://path. See the actual implementations for details on the kind of supported name.
        feature - The feature that will be used to evaluate the symbolURL expression (or to extract data from it, think complex attributes, in that case a visit to the expression and some direct attribute value extraction might be needed instead)
        Throws:
        Exception