Class Stroke.ConstantStroke

  • All Implemented Interfaces:
    Stroke
    Enclosing interface:
    Stroke

    public abstract static class Stroke.ConstantStroke
    extends Object
    implements Stroke
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantStroke()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(StyleVisitor visitor)  
      Object accept​(TraversingStyleVisitor visitor, Object data)
      calls the visit method of a StyleVisitor
      void setColor​(Expression color)
      This parameter gives the solid color that will be used for a stroke.
      The color value is RGB-encoded using two hexidecimal digits per primary-color component in the order Red, Green, Blue, prefixed wih the hash (#) sign.
      void setDashArray​(float[] dashArray)
      Shortcut to define dash array using literal numbers.
      void setDashArray​(List<Expression> dashArray)
      This parameter encodes the dash pattern as a list of expressions.
      The first expression gives the length in pixels of the dash to draw, the second gives the amount of space to leave, and this pattern repeats.
      If an odd number of values is given, then the pattern is expanded by repeating it twice to give an even number of values.
      void setDashOffset​(Expression dashOffset)
      A dash array need not start from the beginning.
      void setGraphicFill​(Graphic graphicFill)
      This parameter indicates that a stipple-fill repeated graphic will be used and specifies the fill graphic to use.
      void setGraphicStroke​(Graphic graphicStroke)
      This parameter indicates that a repeated-linear-graphic graphic stroke type will be used and specifies the graphic to use.
      void setLineCap​(Expression lineCap)
      This parameter controls how line strings should be capped.
      void setLineJoin​(Expression lineJoin)
      This parameter controls how line strings should be joined together.
      void setOpacity​(Expression opacity)
      This specifies the level of translucency to use when rendering the stroke.
      The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing totally transparent and 1.0 representing totally opaque.
      void setWidth​(Expression width)
      This parameter gives the absolute width (thickness) of a stroke in pixels encoded as a float.
      • Methods inherited from class Object

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

      • ConstantStroke

        public ConstantStroke()
    • Method Detail

      • setColor

        public void setColor​(Expression color)
        Description copied from interface: Stroke
        This parameter gives the solid color that will be used for a stroke.
        The color value is RGB-encoded using two hexidecimal digits per primary-color component in the order Red, Green, Blue, prefixed wih the hash (#) sign. The hexidecimal digits between A and F may be in either upper or lower case. For example, full red is encoded as "#ff0000" (with no quotation marks).

        Note: in CSS this parameter is just called Stroke and not Color.

        Specified by:
        setColor in interface Stroke
      • setWidth

        public void setWidth​(Expression width)
        Description copied from interface: Stroke
        This parameter gives the absolute width (thickness) of a stroke in pixels encoded as a float. Fractional numbers are allowed but negative numbers are not.
        Specified by:
        setWidth in interface Stroke
      • setOpacity

        public void setOpacity​(Expression opacity)
        Description copied from interface: Stroke
        This specifies the level of translucency to use when rendering the stroke.
        The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing totally transparent and 1.0 representing totally opaque. A linear scale of translucency is used for intermediate values.
        For example, "0.65" would represent 65% opacity.
        Specified by:
        setOpacity in interface Stroke
      • setLineJoin

        public void setLineJoin​(Expression lineJoin)
        Description copied from interface: Stroke
        This parameter controls how line strings should be joined together.
        Specified by:
        setLineJoin in interface Stroke
      • setLineCap

        public void setLineCap​(Expression lineCap)
        Description copied from interface: Stroke
        This parameter controls how line strings should be capped.
        Specified by:
        setLineCap in interface Stroke
      • setDashArray

        public void setDashArray​(float[] dashArray)
        Description copied from interface: Stroke
        Shortcut to define dash array using literal numbers.
        Specified by:
        setDashArray in interface Stroke
      • setDashArray

        public void setDashArray​(List<Expression> dashArray)
        Description copied from interface: Stroke
        This parameter encodes the dash pattern as a list of expressions.
        The first expression gives the length in pixels of the dash to draw, the second gives the amount of space to leave, and this pattern repeats.
        If an odd number of values is given, then the pattern is expanded by repeating it twice to give an even number of values.

        For example, "2 1 3 2" would produce:
        -- ---  -- ---  -- ---   -- ---  -- ---  --

        Specified by:
        setDashArray in interface Stroke
      • setDashOffset

        public void setDashOffset​(Expression dashOffset)
        Description copied from interface: Stroke
        A dash array need not start from the beginning. This method allows for an offset into the dash array before starting it.
        Specified by:
        setDashOffset in interface Stroke
      • setGraphicFill

        public void setGraphicFill​(Graphic graphicFill)
        Description copied from interface: Stroke
        This parameter indicates that a stipple-fill repeated graphic will be used and specifies the fill graphic to use.
        Specified by:
        setGraphicFill in interface Stroke
      • setGraphicStroke

        public void setGraphicStroke​(Graphic graphicStroke)
        Description copied from interface: Stroke
        This parameter indicates that a repeated-linear-graphic graphic stroke type will be used and specifies the graphic to use.

        Proper stroking with a linear graphic requires two "hot-spot" points within the space of the graphic to indicate where the rendering line starts and stops. In the case of raster images with no special mark-up, this line will be assumed to be the middle pixel row of the image, starting from the first pixel column and ending at the last pixel column.

        Specified by:
        setGraphicStroke in interface Stroke
      • accept

        public Object accept​(TraversingStyleVisitor visitor,
                             Object data)
        Description copied from interface: Stroke
        calls the visit method of a StyleVisitor
        Specified by:
        accept in interface Stroke
        Parameters:
        visitor - the style visitor