lt.monarch.chart.text
Class LadderTextPainter

java.lang.Object
  extended by lt.monarch.chart.text.TextPainter
      extended by lt.monarch.chart.text.RotatedLabelPainter
          extended by lt.monarch.chart.text.LadderTextPainter
All Implemented Interfaces:
java.io.Serializable, AbstractTextPainter

public class LadderTextPainter
extends RotatedLabelPainter

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.text.TextPainter
boundingBox, hAlignment, text, vAlignment, xMargin, yMargin
 
Constructor Summary
Constructor and Description
LadderTextPainter()
          Empty ladder text painter constructor
LadderTextPainter(double angle)
          Ladder text painter constructor
LadderTextPainter(java.lang.String text)
          Ladder text painter constructor
LadderTextPainter(java.lang.String text, Alignment hAlign, Alignment vAlign)
          Ladder text painter constructor
LadderTextPainter(java.lang.String text, double angle)
          Ladder text painter constructor
 
Method Summary
Modifier and Type Method and Description
 Rectangle2D findBounds(AbstractGraphics g, Rectangle2D r)
          Finds the bounding box of text painting area.
 Area getFullArea(java.awt.FontMetrics fm)
          Returns the area where is label.
protected  java.awt.Dimension getFullSize(java.awt.FontMetrics fm)
          Returns full not rotated text size.
 Rectangle2D getPreferredBounds(java.awt.FontMetrics fm)
          Gets preferred bounds
 float getRelativePosition()
          Returns relative position for the label
 double getRotationAngle()
          Gets rotation angle for label in radians
 Point2D getRotationPoint()
          Returns rotation point.
 HotSpotMap mapEntity(ChartEntity entity, HotSpotMap hotMap)
          Maps label entity
 void paint(AbstractGraphics g, Rectangle2D r)
          Paints text into specified rectangle using provided graphics context.
 void setAngle(double angle)
          Sets the text rotation angle.
 void setRelativePosition(float relativePosition)
          Sets relative position for the label
 void setRotationAngle(double rotationAngle)
          Sets rotation angle for the label in radians
 void setRotationPoint(Point2D rotationPoint)
          Sets rotation point
 void setText(java.lang.String s)
          Sets text for text painter.
 
Methods inherited from class lt.monarch.chart.text.TextPainter
dispose, getBounds, getHorizontalAlignment, getHorizontalMargin, getMarginInPixels, getMinimumHeight, getMinimumSize, getMinimumSize, getText, getVerticalAlignment, getVerticalMargin, getWrappingEnabled, setHorizontalAlignment, setHorizontalMargin, setMargin, setText, setVerticalAlignment, setVerticalMargin, setWrappingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LadderTextPainter

public LadderTextPainter(java.lang.String text,
                         double angle)
Ladder text painter constructor

Parameters:
text - text to paint
angle - rotation angle in radiant

LadderTextPainter

public LadderTextPainter(double angle)
Ladder text painter constructor

Parameters:
angle - rotation angle in radiant

LadderTextPainter

public LadderTextPainter(java.lang.String text,
                         Alignment hAlign,
                         Alignment vAlign)
Ladder text painter constructor

Parameters:
text - text to paint
hAlign - horizontal alignment
vAlign - vertical alignment

LadderTextPainter

public LadderTextPainter(java.lang.String text)
Ladder text painter constructor

Parameters:
text - text to paint

LadderTextPainter

public LadderTextPainter()
Empty ladder text painter constructor

Method Detail

getFullArea

public Area getFullArea(java.awt.FontMetrics fm)
Description copied from class: RotatedLabelPainter
Returns the area where is label.

Specified by:
getFullArea in class RotatedLabelPainter
Parameters:
fm - font metrics
Returns:
the bounding area of label

getFullSize

protected java.awt.Dimension getFullSize(java.awt.FontMetrics fm)
Description copied from class: RotatedLabelPainter
Returns full not rotated text size.

Specified by:
getFullSize in class RotatedLabelPainter
Parameters:
fm - font metrics
Returns:
full size dimension

getPreferredBounds

public Rectangle2D getPreferredBounds(java.awt.FontMetrics fm)
Description copied from class: RotatedLabelPainter
Gets preferred bounds

Specified by:
getPreferredBounds in class RotatedLabelPainter
Parameters:
fm - FontMetrics
Returns:
preferred bounds

getRotationAngle

public double getRotationAngle()
Description copied from class: RotatedLabelPainter
Gets rotation angle for label in radians

Specified by:
getRotationAngle in class RotatedLabelPainter
Returns:
rotation angle in radians

setRelativePosition

public void setRelativePosition(float relativePosition)
Description copied from class: RotatedLabelPainter
Sets relative position for the label

Specified by:
setRelativePosition in class RotatedLabelPainter
Parameters:
relativePosition - relative position for the label

getRelativePosition

public float getRelativePosition()
Description copied from class: RotatedLabelPainter
Returns relative position for the label

Specified by:
getRelativePosition in class RotatedLabelPainter
Returns:
relative position for the label

setRotationAngle

public void setRotationAngle(double rotationAngle)
Description copied from class: RotatedLabelPainter
Sets rotation angle for the label in radians

Specified by:
setRotationAngle in class RotatedLabelPainter
Parameters:
rotationAngle - rotation angle for label

setRotationPoint

public void setRotationPoint(Point2D rotationPoint)
Description copied from class: RotatedLabelPainter
Sets rotation point

Specified by:
setRotationPoint in class RotatedLabelPainter
Parameters:
rotationPoint - rotation point

getRotationPoint

public Point2D getRotationPoint()
Returns rotation point.

Specified by:
getRotationPoint in class RotatedLabelPainter
Returns:
rotPoint rotation point

setText

public void setText(java.lang.String s)
Description copied from interface: AbstractTextPainter
Sets text for text painter.

Specified by:
setText in interface AbstractTextPainter
Overrides:
setText in class TextPainter
Parameters:
s - text string.

setAngle

public void setAngle(double angle)
Sets the text rotation angle.

Parameters:
angle - rotation angle in radians

findBounds

public Rectangle2D findBounds(AbstractGraphics g,
                              Rectangle2D r)
Description copied from interface: AbstractTextPainter
Finds the bounding box of text painting area.

Specified by:
findBounds in interface AbstractTextPainter
Overrides:
findBounds in class TextPainter
Parameters:
g - current graphics context.
r - text string rectangle.
Returns:
bounding box

paint

public void paint(AbstractGraphics g,
                  Rectangle2D r)
Description copied from interface: AbstractTextPainter
Paints text into specified rectangle using provided graphics context.

Specified by:
paint in interface AbstractTextPainter
Overrides:
paint in class TextPainter
Parameters:
g - current graphics context.
r - area of text painting.

mapEntity

public HotSpotMap mapEntity(ChartEntity entity,
                            HotSpotMap hotMap)
Maps label entity

Parameters:
entity - entity
hotMap - hotspot map
Returns:
hotspot map instance