public class GraphicImpl extends Object implements Graphic, Cloneable
Modifier | Constructor and Description |
---|---|
protected |
GraphicImpl()
Creates a new instance of DefaultGraphic
|
|
GraphicImpl(FilterFactory factory) |
|
GraphicImpl(FilterFactory factory,
AnchorPoint anchor,
Expression gap,
Expression initialGap) |
Modifier and Type | Method and Description |
---|---|
void |
accept(StyleVisitor visitor)
accepts a StyleVisitor - used by xmlencoder and other packages which need to walk the style
tree
|
Object |
accept(StyleVisitor visitor,
Object data)
calls the visit method of a StyleVisitor
|
Object |
clone()
Creates a deep copy clone.
|
boolean |
equals(Object oth)
Compares this GraphicImpl with another for equality.
|
AnchorPointImpl |
getAnchorPoint()
Location inside of the Graphic (or Label) to position the main-geometry point.
|
DisplacementImpl |
getDisplacement()
The Displacement gives the X and Y displacements from the "hot-spot" point.
|
Expression |
getGap()
Gap gives the distance between two graphics.
|
Expression |
getInitialGap()
InitialGap specifies how far away the first graphic will be drawn relative to the start of
the rendering line
|
Expression |
getOpacity()
This specifies the level of translucency to use when rendering the graphic.
|
Expression |
getRotation()
This parameter defines the rotation of a graphic in the clockwise direction about its centre
point in decimal degrees.
|
Expression |
getSize()
This paramteter gives the absolute size of the graphic in pixels encoded as a floating point
number.
|
List<GraphicalSymbol> |
graphicalSymbols()
List of all symbols used to represent this graphic.
|
int |
hashCode()
Override of hashcode
|
void |
setAnchorPoint(AnchorPoint anchor) |
void |
setAnchorPoint(AnchorPoint anchorPoint)
Anchor point (expressed as an x/y percentage of the graphic size).
|
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.
|
protected GraphicImpl()
public GraphicImpl(FilterFactory factory)
public GraphicImpl(FilterFactory factory, AnchorPoint anchor, Expression gap, Expression initialGap)
public List<GraphicalSymbol> graphicalSymbols()
Graphic
graphicalSymbols
in interface Graphic
public AnchorPointImpl getAnchorPoint()
Graphic
The coordinates are provided as 0.0 to 1.0 range amounting to a percentage of the graphic width/height. So the default of 0.5/0.5 indicates that the graphic would be centered.
Please keep in mind that a system may shuffle things around a bit in order to prevent graphics from overlapping (so this AnchorPoint is only a hint about how things should be if there is enough room).
getAnchorPoint
in interface Graphic
public void setAnchorPoint(AnchorPoint anchor)
public void setAnchorPoint(AnchorPoint anchorPoint)
Graphic
public Expression getOpacity()
getOpacity
in interface Graphic
public Expression getRotation()
getRotation
in interface Graphic
public Expression getSize()
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.
public DisplacementImpl getDisplacement()
Graphic
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
getDisplacement
in interface Graphic
public Expression getInitialGap()
GraphicStroke
getInitialGap
in interface GraphicStroke
public void setInitialGap(Expression initialGap)
public Expression getGap()
GraphicStroke
getGap
in interface GraphicStroke
public void setGap(Expression gap)
public void setDisplacement(Displacement offset)
offset
- Amount to offset graphicpublic void setOpacity(Expression opacity)
GraphicLegend
opacity
- opacity between 0 and 1public void setRotation(Expression rotation)
rotation
- New value of property rotation.public void setSize(Expression size)
size
- New value of property size.public Object accept(StyleVisitor visitor, Object data)
GraphicLegend
accept
in interface Graphic
accept
in interface GraphicFill
accept
in interface GraphicLegend
accept
in interface GraphicStroke
visitor
- the style visitorpublic void accept(StyleVisitor visitor)
Graphic
visitor
- - the visitor objectpublic Object clone()
clone
in class Object
Object.clone()
public int hashCode()
public boolean equals(Object oth)
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.
Copyright © 1996–2021 Geotools. All rights reserved.