Package org.geotools.api.style
Class Stroke.ConstantStroke
Object
ConstantStroke
- All Implemented Interfaces:
Stroke
- Enclosing interface:
- Stroke
-
Nested Class Summary
Nested classes/interfaces inherited from interface Stroke
Stroke.ConstantStroke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StyleVisitor visitor) accept
(TraversingStyleVisitor visitor, Object data) calls the visit method of a StyleVisitorvoid
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
Methods inherited from interface Stroke
dashArray, getColor, getDashArray, getDashOffset, getGraphicFill, getGraphicStroke, getLineCap, getLineJoin, getOpacity, getWidth
-
Constructor Details
-
ConstantStroke
public ConstantStroke()
-
-
Method Details
-
setColor
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.
-
setWidth
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. -
setOpacity
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 interfaceStroke
-
setLineJoin
Description copied from interface:Stroke
This parameter controls how line strings should be joined together.- Specified by:
setLineJoin
in interfaceStroke
-
setLineCap
Description copied from interface:Stroke
This parameter controls how line strings should be capped.- Specified by:
setLineCap
in interfaceStroke
-
setDashArray
public void setDashArray(float[] dashArray) Description copied from interface:Stroke
Shortcut to define dash array using literal numbers.- Specified by:
setDashArray
in interfaceStroke
-
setDashArray
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 interfaceStroke
-
setDashOffset
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 interfaceStroke
-
setGraphicFill
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 interfaceStroke
-
setGraphicStroke
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 interfaceStroke
-
accept
-
accept
Description copied from interface:Stroke
calls the visit method of a StyleVisitor
-