org.geotools.renderer.style
Class TextStyle2D

java.lang.Object
  extended byorg.geotools.renderer.style.Style
      extended byorg.geotools.renderer.style.Style2D
          extended byorg.geotools.renderer.style.TextStyle2D

public class TextStyle2D
extends Style2D

DJB: This class was fundamentally wrong - it tried to convert into . Not only was it doing a really crappy job, but its fundamentally the wrong place to do it. The SLD spec defines a as: and as: 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
 
Fields inherited from class org.geotools.renderer.style.Style
maxScale, minScale
 
Constructor Summary
TextStyle2D()
           
 
Method Summary
 double getAnchorX()
           
 double getAnchorY()
           
 java.awt.Composite getComposite()
          Getter for property composite.
 double getDisplacementX()
           
 double getDisplacementY()
           
 java.awt.Paint getFill()
          Getter for property fill.
 java.awt.Font getFont()
           
 java.awt.Composite getHaloComposite()
           
 java.awt.Paint getHaloFill()
           
 float getHaloRadius()
           
 java.awt.Shape getHaloShape(java.awt.Graphics2D graphics)
           
 java.lang.String getLabel()
           
 int getPerpendicularOffset()
          only valid for a isPointPlacement=false (ie. a lineplacement)
 double getRotation()
           
 java.awt.font.GlyphVector getTextGlyphVector(java.awt.Graphics2D graphics)
           
 boolean isPointPlacement()
           
 void setAnchorX(double f)
           
 void setAnchorY(double f)
           
 void setComposite(java.awt.Composite composite)
          Setter for property composite.
 void setDisplacementX(double displacementX)
           
 void setDisplacementY(double displacementY)
           
 void setFill(java.awt.Paint fill)
          Setter for property fill.
 void setFont(java.awt.Font font)
           
 void setHaloComposite(java.awt.Composite composite)
           
 void setHaloFill(java.awt.Paint paint)
           
 void setHaloRadius(float f)
           
 void setLabel(java.lang.String label)
           
 void setPerpendicularOffset(int displace)
          only valid for a isPointPlacement=false (ie. a lineplacement)
 void setPointPlacement(boolean pointPlacement)
           
 void setRotation(double f)
           
 java.lang.String toString()
          Returns a string representation of this style.
 
Methods inherited from class org.geotools.renderer.style.Style
getMaxScale, getMinScale, isScaleInRange, setMinMaxScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextStyle2D

public TextStyle2D()
Method Detail

getAnchorX

public double getAnchorX()
Returns:

getAnchorY

public double getAnchorY()
Returns:

getFont

public java.awt.Font getFont()
Returns:

getHaloComposite

public java.awt.Composite getHaloComposite()
Returns:

getHaloFill

public java.awt.Paint getHaloFill()
Returns:

getHaloRadius

public float getHaloRadius()
Returns:

getRotation

public double getRotation()
Returns:

getTextGlyphVector

public java.awt.font.GlyphVector getTextGlyphVector(java.awt.Graphics2D graphics)
Returns:

getHaloShape

public java.awt.Shape getHaloShape(java.awt.Graphics2D graphics)
Returns:

setAnchorX

public void setAnchorX(double f)

setAnchorY

public void setAnchorY(double f)

setFont

public void setFont(java.awt.Font font)
Parameters:
font -

setHaloComposite

public void setHaloComposite(java.awt.Composite composite)
Parameters:
composite -

setHaloFill

public void setHaloFill(java.awt.Paint paint)
Parameters:
paint -

setHaloRadius

public void setHaloRadius(float f)
Parameters:
f -

setRotation

public void setRotation(double f)
Parameters:
f -

getLabel

public java.lang.String getLabel()
Returns:
Returns the label.

setLabel

public void setLabel(java.lang.String label)
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

public java.awt.Paint getFill()
Getter for property fill.

Returns:
Value of property fill.

setFill

public void setFill(java.awt.Paint fill)
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

public java.awt.Composite getComposite()
Getter for property composite.

Returns:
Value of property composite.

setComposite

public void setComposite(java.awt.Composite composite)
Setter for property composite.

Parameters:
composite - New value of property composite.

toString

public java.lang.String toString()
Returns a string representation of this style.



Copyright © GeoTools. All Rights Reserved.