Class GraphicImpl
- All Implemented Interfaces:
Cloneable
,Graphic
,GraphicFill
,GraphicLegend
,GraphicStroke
,Cloneable
- Author:
- Ian Turton, CCG, Johann Sorel (Geomatys)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance of DefaultGraphicGraphicImpl
(FilterFactory factory) GraphicImpl
(FilterFactory factory, AnchorPoint anchor, Expression gap, Expression initialGap) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StyleVisitor visitor) accepts a StyleVisitor - used by xmlencoder and other packages which need to walk the style treeaccept
(TraversingStyleVisitor visitor, Object data) Calls the visit method of a StyleVisitorclone()
Creates a deep copy clone.boolean
Compares this GraphicImpl with another for equality.The AnchorPoint element of a PointSymbolizer gives the location inside of a Graphic (or label - see 11.4.4) to use for anchoring the graphic to the main-geometry point.The Displacement gives the X and Y displacements from the "hot-spot" point.getGap()
This specifies the level of translucency to use when rendering the graphic.
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, with a linear scale of translucency for intermediate values.
For example, "0.65" would represent 65% opacity.This parameter defines the rotation of a graphic in the clockwise direction about its centre point in decimal degrees.getSize()
This paramteter gives the absolute size of the graphic in pixels encoded as a floating point number.The items in this list are either a Mark or a ExternalGraphic.int
hashCode()
Override of hashcodevoid
setAnchorPoint
(AnchorPoint anchor) void
setDisplacement
(Displacement offset) void
setGap
(Expression gap) void
setInitialGap
(Expression initialGap) void
setOpacity
(Expression opacity) Graphic opacity.void
setRotation
(Expression rotation) Setter for property rotation.void
setSize
(Expression size) Setter for property size.
-
Field Details
-
DEFAULT
A default Graphic instance.For some attributes the standard does not define a default, so a reasonable value is supplied.
-
NULL
Indicates an absense of graphic.This value is used to indicate that the Graphics based opperation should be skipped. Aka this is used by Stroke.Stroke as place holders for GRAPHIC_FILL and GRAPHIC_STROKE.
-
-
Constructor Details
-
GraphicImpl
protected GraphicImpl()Creates a new instance of DefaultGraphic -
GraphicImpl
-
GraphicImpl
public GraphicImpl(FilterFactory factory, AnchorPoint anchor, Expression gap, Expression initialGap)
-
-
Method Details
-
graphicalSymbols
Description copied from interface:Graphic
The items in this list are either a Mark or a ExternalGraphic.This list may be directly edited; the items are considered in order from most preferred (say an SVG file) to least preferred (a simple shape) with the intension that the system will make use of the first entry which it is capabile of displaying.
- Specified by:
graphicalSymbols
in interfaceGraphic
-
getAnchorPoint
Description copied from interface:Graphic
The AnchorPoint element of a PointSymbolizer gives the location inside of a Graphic (or label - see 11.4.4) to use for anchoring the graphic to the main-geometry point. The coordinates are given as two floating-point numbers in the AnchorPointX and AnchorPointY elements each with values between 0.0 and 1.0 inclusive. The bounding box of the graphic/label to be rendered is considered to be in a coordinate space from 0.0 (lower-left corner) to 1.0 (upper-right corner), and the anchor position is specified as a point in this space. The default point is X=0.5, Y=0.5, which is at the middle height and middle length of the graphic/label text. A system may choose different anchor points to de-conflict graphics/labels.- Specified by:
getAnchorPoint
in interfaceGraphic
- Returns:
- AnchorPoint , if null should use a default point X=0.5 Y=0.5
-
setAnchorPoint
- Specified by:
setAnchorPoint
in interfaceGraphic
-
getOpacity
This specifies the level of translucency to use when rendering the graphic.
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, with a linear scale of translucency for intermediate values.
For example, "0.65" would represent 65% opacity. The default value is 1.0 (opaque).- Specified by:
getOpacity
in interfaceGraphic
- Returns:
- The opacity of the Graphic, where 0.0 is completely transparent and 1.0 is completely opaque.
-
getRotation
This parameter defines the rotation of a graphic in the clockwise direction about its centre point in decimal degrees. The value encoded as a floating point number.- Specified by:
getRotation
in interfaceGraphic
- Returns:
- The angle of rotation in decimal degrees. Negative values represent counter-clockwise rotation. The default is 0.0 (no rotation).
-
getSize
This paramteter gives the absolute size of the graphic in pixels encoded as a floating point number.The default size of an image format (such as GIFD) is the inherent size of the image. The default size of a format without an inherent size (such as SVG) is defined to be 16 pixels in height and the corresponding aspect in width. If a size is specified, the height of the graphic will be scaled to that size and the corresponding aspect will be used for the width.
-
getDisplacement
Description copied from interface:Graphic
The Displacement gives the X and Y displacements from the "hot-spot" point. This element may be used to avoid over-plotting of multiple graphic symbols used as part of the same point symbol. The displacements are in units of measure above and to the right of the point. The default displacement is X=0, Y=0.If Displacement is used in conjunction with Size and/or Rotation then the graphic symbol shall be scaled and/or rotated before it is displaced.s
- Specified by:
getDisplacement
in interfaceGraphic
- Returns:
- Displacement
-
getInitialGap
- Specified by:
getInitialGap
in interfaceGraphic
-
setInitialGap
- Specified by:
setInitialGap
in interfaceGraphic
-
getGap
-
setGap
-
setDisplacement
- Specified by:
setDisplacement
in interfaceGraphic
-
setOpacity
Description copied from interface:Graphic
Graphic opacity.- Specified by:
setOpacity
in interfaceGraphic
- Parameters:
opacity
- New value of property opacity.
-
setRotation
Setter for property rotation.- Specified by:
setRotation
in interfaceGraphic
- Parameters:
rotation
- New value of property rotation.
-
setSize
Setter for property size. -
accept
Description copied from interface:Graphic
Calls the visit method of a StyleVisitor -
accept
Description copied from interface:Graphic
accepts a StyleVisitor - used by xmlencoder and other packages which need to walk the style tree -
clone
Creates a deep copy clone. -
hashCode
public int hashCode()Override of hashcode -
equals
Compares this GraphicImpl with another for equality.Two graphics are equal if and only if they both have the same geometry property name and the same list of symbols and the same rotation, size and opacity.
-