| org.geotools.styling.Stroke
All known Subclasses: org.geotools.styling.StrokeImpl,
Stroke | public interface Stroke extends GTComponent(Code) | | The Stroke object encapsulates the graphical-symbolization parameters for
linear geometries.
There are three basic types of stroke: solid color, graphic fill (stipple),
and repeated linear graphic stroke.
A repeated linear graphic is plotted linearly and has its graphic symbol
bent around the curves of the line string. A GraphicFill has the pixels
of the line rendered with a repeating area-fill pattern.
If neither a graphic fill nor graphic stroke element are given, then the
line symbolizer should render a solid color.
The details of this object are taken from the
OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.:
<xsd:element name="Stroke">
<xsd:annotation>
<xsd:documentation>
A "Stroke" specifies the appearance of a linear geometry. It is
defined in parallel with SVG strokes. The following CssParameters
may be used: "stroke" (color), "stroke-opacity", "stroke-width",
"stroke-linejoin", "stroke-linecap", "stroke-dasharray", and
"stroke-dashoffset".
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="sld:GraphicFill"/>
<xsd:element ref="sld:GraphicStroke"/>
</xsd:choice>
<xsd:element ref="sld:CssParameter" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Renderers can use this information when displaying styled features,
though it must be remembered that not all renderers will be able to
fully represent strokes as set out by this interface. For example, opacity
may not be supported.
Notes:
- The graphical parameters and their values are derived from SVG/CSS2
standards with names and semantics which are as close as possible.
version: $Id: Stroke.java 25459 2007-05-08 05:19:25Z jgarnett $ author: James Macgill |
Field Summary | |
final static Stroke | DEFAULT Default Stroke capturing the defaults indicated by the standard. | final static Stroke | NULL Null Stroke capturing the defaults indicated by the standard. |
Method Summary | |
void | accept(StyleVisitor visitor) | Object | clone() Creates a clone of the Stroke. | Expression | getColor() 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. | Color | getColor(Feature f) This parameter gives the solid color that will be used for a stroke.
The color value returned here as a Java Color object, this is a convinence method
that goes above
The default color is defined to be Color.BLACK
Note: in CSS this parameter is just called Stroke and not Color. | float[] | getDashArray() This parameter encodes the dash pattern as a seqeuence of floats.
The first number 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. | Expression | getDashOffset() A dash array need not start from the beginning. | Graphic | getGraphicFill() This parameter indicates that a stipple-fill repeated graphic will be
used and specifies the fill graphic to use. | Graphic | getGraphicStroke() This parameter indicates that a repeated-linear-graphic graphic stroke
type will be used and specifies the graphic to use. | Expression | getLineCap() This parameter controls how line strings should be capped.
The cap style. | Expression | getLineJoin() This parameter controls how line strings should be joined together.
The join style. | Expression | getOpacity() 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. | Expression | getWidth() This parameter gives the absolute width (thickness) of a stroke in
pixels encoded as a float.
The default is 1.0. | 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) This parameter encodes the dash pattern as a seqeuence of floats.
The first number 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. |
DEFAULT | final static Stroke DEFAULT(Code) | | Default Stroke capturing the defaults indicated by the standard.
For some attributes the standard does not define a default, so a
reasonable value is supplied.
|
NULL | final static Stroke NULL(Code) | | Null Stroke capturing the defaults indicated by the standard.
This is a NullObject, it purpose is to prevent client code from having
to do null checking.
|
clone | Object clone()(Code) | | Creates a clone of the Stroke.
A clone of the stroke object. |
getColor | Expression getColor()(Code) | | 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).
The default color is defined to be black ("#000000").
Note: in CSS this parameter is just called Stroke and not Color.
The color of the stroke encoded as a hexidecimal RGB value. |
getColor | Color getColor(Feature f)(Code) | | This parameter gives the solid color that will be used for a stroke.
The color value returned here as a Java Color object, this is a convinence method
that goes above
The default color is defined to be Color.BLACK
Note: in CSS this parameter is just called Stroke and not Color.
The color of the stroke as a Color object |
getDashArray | float[] getDashArray()(Code) | | This parameter encodes the dash pattern as a seqeuence of floats.
The first number 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.
The default is to draw an unbroken line.
For example, "2 1 3 2" would produce:
-- --- -- --- -- ---
-- --- -- --- --
The dash pattern as an array of float values in the form"dashlength gaplength ..." |
getDashOffset | Expression getDashOffset()(Code) | | A dash array need not start from the beginning. This method allows for
an offset into the dash array before starting it.
The distance, in pixels, that any dash array should start from. |
getGraphicFill | Graphic getGraphicFill()(Code) | | This parameter indicates that a stipple-fill repeated graphic will be
used and specifies the fill graphic to use.
The graphic to use as a stipple fill.If null, then no Stipple fill should be used. |
getGraphicStroke | Graphic getGraphicStroke()(Code) | | 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.
The graphic to use as a linear graphic.If null, then no graphic stroke should be used. |
getLineCap | Expression getLineCap()(Code) | | This parameter controls how line strings should be capped.
The cap style. This will be one of "butt", "round" and"square". There is no defined default. |
getLineJoin | Expression getLineJoin()(Code) | | This parameter controls how line strings should be joined together.
The join style. This will be one of "mitre", "round" and"bevel". There is no defined default. |
getOpacity | Expression getOpacity()(Code) | | 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. The default value
is 1.0 (opaque).
The opacity of the stroke, where 0.0 is completely transparentand 1.0 is completely opaque. |
getWidth | Expression getWidth()(Code) | | This parameter gives the absolute width (thickness) of a stroke in
pixels encoded as a float.
The default is 1.0. Fractional numbers are allowed but negative
numbers are not.
The width of the stroke in pixels.This may be fractional but not negative. |
setColor | void setColor(Expression color)(Code) | | 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.
|
setDashArray | void setDashArray(float[] dashArray)(Code) | | This parameter encodes the dash pattern as a seqeuence of floats.
The first number 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:
-- --- -- --- -- ---
-- --- -- --- --
|
setDashOffset | void setDashOffset(Expression dashOffset)(Code) | | A dash array need not start from the beginning. This method allows for
an offset into the dash array before starting it.
|
setGraphicFill | void setGraphicFill(Graphic graphicFill)(Code) | | This parameter indicates that a stipple-fill repeated graphic will be
used and specifies the fill graphic to use.
|
setGraphicStroke | void setGraphicStroke(Graphic graphicStroke)(Code) | | 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.
|
setLineCap | void setLineCap(Expression lineCap)(Code) | | This parameter controls how line strings should be capped.
|
setLineJoin | void setLineJoin(Expression lineJoin)(Code) | | This parameter controls how line strings should be joined together.
|
setOpacity | void setOpacity(Expression opacity)(Code) | | 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.
|
setWidth | void setWidth(Expression width)(Code) | | 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.
|
|
|