lt.monarch.chart.text
Interface AbstractTextPainter

All Known Implementing Classes:
LabelTextPainter, LadderTextPainter, Pie3DSliceLabelEntry, PieSliceLabelEntry, Rotated90TextPainter, RotatedLabelPainter, StackedTextPainter, TextPainter

public interface AbstractTextPainter


Method Summary
Modifier and Type Method and Description
 void dispose()
          Disposes the painter
 Rectangle2D findBounds(AbstractGraphics g, Rectangle2D r)
          Finds the bounding box of text painting area.
 Rectangle2D getBounds()
          Gets text painter bounds
 Alignment getHorizontalAlignment()
          Returns horizontal text alignment.
 int getHorizontalMargin()
          Returns value of horizontal text margin.
 int getMinimumHeight(java.awt.FontMetrics fm, int width)
          Returns minimum height of text drawn using given font metrics into area of given width.
 java.awt.Dimension getMinimumSize(AbstractGraphics g)
          Returns the minimum font size of the specified graphics context's current font.
 java.awt.Dimension getMinimumSize(java.awt.FontMetrics fm)
          Returns the minimum font size of the specified font metrics.
 Alignment getVerticalAlignment()
          Returns vertical text alignment.
 int getVerticalMargin()
          Returns value of vertical text margin.
 boolean getWrappingEnabled()
          Returns whether or not word wrapping is enabled.
 void paint(AbstractGraphics g, Rectangle2D r)
          Paints text into specified rectangle using provided graphics context.
 void setHorizontalAlignment(Alignment align)
          Sets horizontal text alignment.
 void setHorizontalMargin(int margin)
          Sets specified margin value for horizontal text margin.
 void setMargin(int margin)
          Sets equal specified margin value for horizontal and vertical text margin.
 void setText(java.lang.String s)
          Sets text for text painter.
 void setVerticalAlignment(Alignment align)
          Sets vertical text alignment.
 void setVerticalMargin(int margin)
          Sets specified margin value for vertical text margin.
 void setWrappingEnabled(boolean enable)
          Enables/disabled word wrapping when drawing the text.
 

Method Detail

setHorizontalAlignment

void setHorizontalAlignment(Alignment align)
Sets horizontal text alignment.

Parameters:
align - value of horizontal alignment. Possible values are : CENTER, LEFT, RIGHT.

setVerticalAlignment

void setVerticalAlignment(Alignment align)
Sets vertical text alignment.

Parameters:
align - value of vertical alignment. Possible values are: CENTER, TOP, BOTTOM.

getHorizontalAlignment

Alignment getHorizontalAlignment()
Returns horizontal text alignment.

Returns:
horizontal text alignment

getVerticalAlignment

Alignment getVerticalAlignment()
Returns vertical text alignment.

Returns:
vertical text alignment

getHorizontalMargin

int getHorizontalMargin()
Returns value of horizontal text margin.

Returns:
value of horizontal text margin.

getVerticalMargin

int getVerticalMargin()
Returns value of vertical text margin.

Returns:
value of vertical text margin.

setMargin

void setMargin(int margin)
Sets equal specified margin value for horizontal and vertical text margin.

Parameters:
margin - text margin value.

setHorizontalMargin

void setHorizontalMargin(int margin)
Sets specified margin value for horizontal text margin.

Parameters:
margin - text margin value.

setVerticalMargin

void setVerticalMargin(int margin)
Sets specified margin value for vertical text margin.

Parameters:
margin - text margin value.

setWrappingEnabled

void setWrappingEnabled(boolean enable)
Enables/disabled word wrapping when drawing the text.

Parameters:
enable - true for enabling, false for disabling.

getWrappingEnabled

boolean getWrappingEnabled()
Returns whether or not word wrapping is enabled.

Returns:
true if enabled, false if disabled.

setText

void setText(java.lang.String s)
Sets text for text painter.

Parameters:
s - text string.

getMinimumSize

java.awt.Dimension getMinimumSize(AbstractGraphics g)
Returns the minimum font size of the specified graphics context's current font.

Parameters:
g - graphics context.
Returns:
dimension of font metrics placed in graphics context

getMinimumSize

java.awt.Dimension getMinimumSize(java.awt.FontMetrics fm)
Returns the minimum font size of the specified font metrics.

Parameters:
fm - font metrics.
Returns:
dimension of font metrics placed in graphics context
See Also:
FontMetrics

getMinimumHeight

int getMinimumHeight(java.awt.FontMetrics fm,
                     int width)
Returns minimum height of text drawn using given font metrics into area of given width. If word wrapping is enabled, returned height will fit entire wrapped text.

Parameters:
fm - font metrics.
width - given width.
Returns:
text height for given width.

findBounds

Rectangle2D findBounds(AbstractGraphics g,
                       Rectangle2D r)
Finds the bounding box of text painting area.

Parameters:
g - current graphics context.
r - text string rectangle.
Returns:
bounding box

paint

void paint(AbstractGraphics g,
           Rectangle2D r)
Paints text into specified rectangle using provided graphics context.

Parameters:
g - current graphics context.
r - area of text painting.

getBounds

Rectangle2D getBounds()
Gets text painter bounds

Returns:
bounds rectangle

dispose

void dispose()
Disposes the painter