public class TextStyle2D extends Style2D
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!
Constructor and Description |
---|
TextStyle2D() |
TextStyle2D(TextStyle2D t) |
Modifier and Type | Method and Description |
---|---|
double |
getAnchorX() |
double |
getAnchorY() |
Composite |
getComposite()
Getter for property composite.
|
double |
getDisplacementX() |
double |
getDisplacementY() |
Paint |
getFill()
Getter for property fill.
|
Font |
getFont() |
Font[] |
getFonts() |
Style2D |
getGraphic()
gets the Style2D to be drawn underneath this text
|
Rectangle |
getGraphicDimensions() |
Composite |
getHaloComposite() |
Paint |
getHaloFill() |
float |
getHaloRadius() |
Shape |
getHaloShape(Graphics2D graphics) |
String |
getLabel() |
int |
getPerpendicularOffset()
only valid for a isPointPlacement=false (ie. a lineplacement)
|
double |
getRotation() |
GlyphVector |
getTextGlyphVector(Graphics2D graphics)
Gets the glyph vector for the main font
|
boolean |
isPointPlacement() |
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 |
setFill(Paint fill)
Setter for property fill.
|
void |
setFont(Font font) |
void |
setFonts(Font[] fonts) |
void |
setGraphic(Style2D s)
Sets the style2D to be drawn underneath this text
|
void |
setHaloComposite(Composite composite) |
void |
setHaloFill(Paint paint) |
void |
setHaloRadius(float f) |
void |
setLabel(String label) |
void |
setPerpendicularOffset(int displace)
only valid for a isPointPlacement=false (ie. a lineplacement)
|
void |
setPointPlacement(boolean pointPlacement) |
void |
setRotation(double f) |
String |
toString()
Returns a string representation of this style.
|
clone, getMaxScale, getMinScale, isScaleInRange, setMinMaxScale
public TextStyle2D()
public TextStyle2D(TextStyle2D t)
public double getAnchorX()
public double getAnchorY()
public Font getFont()
public Composite getHaloComposite()
public Paint getHaloFill()
public float getHaloRadius()
public double getRotation()
public GlyphVector getTextGlyphVector(Graphics2D graphics)
public Shape getHaloShape(Graphics2D graphics)
public void setAnchorX(double f)
f
- public void setAnchorY(double f)
f
- public void setFont(Font font)
font
- public void setHaloComposite(Composite composite)
composite
- public void setHaloFill(Paint paint)
paint
- public void setHaloRadius(float f)
f
- public void setRotation(double f)
f
- public String getLabel()
public void setLabel(String label)
label
- The label to set.public boolean isPointPlacement()
public void setPointPlacement(boolean pointPlacement)
pointPlacement
- (true => point placement, false => line placement.)public double getDisplacementX()
public void setDisplacementX(double displacementX)
displacementX
- The displacementX to set.public double getDisplacementY()
public void setDisplacementY(double displacementY)
displacementY
- The displacementY to set.public Paint getFill()
public void setFill(Paint fill)
fill
- New value of property fill.public void setPerpendicularOffset(int displace)
displace
- in pixelspublic int getPerpendicularOffset()
public Composite getComposite()
public void setComposite(Composite composite)
composite
- New value of property composite.public String toString()
public void setGraphic(Style2D s)
public Style2D getGraphic()
public Rectangle getGraphicDimensions()
public Font[] getFonts()
public void setFonts(Font[] fonts)
fonts
- the fonts to setCopyright © 1996–2019 Geotools. All rights reserved.