Class TextStyle2D
- All Implemented Interfaces:
Cloneable
This class was fundamentally wrong - it tried to convert The SLD spec defines a and its annotated as: A "PerpendicularOffset" gives the perpendicular distance away from a line to draw a label. which
is a bit vague, but there's a little more details here:
The PerpendicularOffset element of a LinePlacement gives the perpendicular distance away from a line to draw a
label. ... The distance is in pixels and is positive to the left-hand.
Left hand/right hand for perpendicularOffset is just crap - I'm assuming them mean +ive --> "up" and -ive -->
"down". See the actual label code for how it deals with this.
I've removed all the absoluteLineDisplacement stuff and replaced it with isPointPlacement() (true) --> render
normally (PointPlacement Attributes) isPointPlacement() (false) --> render LinePlacement
This replaces the old behavior which converted a LinePlacement -> pointplacement and set the
absoluteLineDisplacement flag!
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
Getter for property composite.double
double
getFill()
Getter for property fill.getFont()
Font[]
getFonts()
gets the Style2D to be drawn underneath this textfloat
getHaloShape
(Graphics2D graphics) getLabel()
int
only valid for a isPointPlacement=false (ie. a lineplacement)double
getTextGlyphVector
(Graphics2D graphics) Gets the glyph vector for the main fontboolean
void
setAnchorX
(double f) void
setAnchorY
(double f) void
setComposite
(Composite composite) Setter for property composite.void
setDisplacementX
(double displacementX) void
setDisplacementY
(double displacementY) void
Setter for property fill.void
void
void
Sets the style2D to be drawn underneath this textvoid
setHaloComposite
(Composite composite) void
setHaloFill
(Paint paint) void
setHaloRadius
(float f) void
void
setPerpendicularOffset
(int displace) only valid for a isPointPlacement=false (ie. a lineplacement)void
setPointPlacement
(boolean pointPlacement) void
setRotation
(double f) toString()
Returns a string representation of this style.Methods inherited from class Style
clone, getMaxScale, getMinScale, isScaleInRange, setMinMaxScale
-
Constructor Details
-
TextStyle2D
public TextStyle2D() -
TextStyle2D
-
-
Method Details
-
getAnchorX
public double getAnchorX() -
getAnchorY
public double getAnchorY() -
getFont
-
getHaloComposite
-
getHaloFill
-
getHaloRadius
public float getHaloRadius() -
getRotation
public double getRotation() -
getTextGlyphVector
Gets the glyph vector for the main font -
getHaloShape
-
setAnchorX
public void setAnchorX(double f) - Parameters:
f
-
-
setAnchorY
public void setAnchorY(double f) - Parameters:
f
-
-
setFont
- Parameters:
font
-
-
setHaloComposite
- Parameters:
composite
-
-
setHaloFill
- Parameters:
paint
-
-
setHaloRadius
public void setHaloRadius(float f) - Parameters:
f
-
-
setRotation
public void setRotation(double f) - Parameters:
f
-
-
getLabel
- Returns:
- Returns the label.
-
setLabel
- Parameters:
label
- The label to set.
-
isPointPlacement
public boolean isPointPlacement()- Returns:
- Returns the pointPlacement (true => point placement, false => line placement)
-
setPointPlacement
public void setPointPlacement(boolean pointPlacement) - Parameters:
pointPlacement
- (true => point placement, false => line placement.)
-
getDisplacementX
public double getDisplacementX()- Returns:
- Returns the displacementX.
-
setDisplacementX
public void setDisplacementX(double displacementX) - Parameters:
displacementX
- The displacementX to set.
-
getDisplacementY
public double getDisplacementY()- Returns:
- Returns the displacementY.
-
setDisplacementY
public void setDisplacementY(double displacementY) - Parameters:
displacementY
- The displacementY to set.
-
getFill
Getter for property fill.- Returns:
- Value of property fill.
-
setFill
Setter for property fill.- Parameters:
fill
- New value of property fill.
-
setPerpendicularOffset
public void setPerpendicularOffset(int displace) only valid for a isPointPlacement=false (ie. a lineplacement)- Parameters:
displace
- in pixels
-
getPerpendicularOffset
public int getPerpendicularOffset()only valid for a isPointPlacement=false (ie. a lineplacement)- Returns:
- displacement in pixels
-
getComposite
Getter for property composite.- Returns:
- Value of property composite.
-
setComposite
Setter for property composite.- Parameters:
composite
- New value of property composite.
-
toString
Returns a string representation of this style. -
setGraphic
Sets the style2D to be drawn underneath this text -
getGraphic
gets the Style2D to be drawn underneath this text -
getGraphicDimensions
-
getFonts
- Returns:
- the fonts
-
setFonts
- Parameters:
fonts
- the fonts to set
-