org.faceless.graph2
Class TextStyle

java.lang.Object
  extended by org.faceless.graph2.TextStyle

public final class TextStyle
extends Object

The TextStyle class sets the font, color and so on for any text displayed on the Graph. Each item of text has several attributes:


Field Summary
static float ROTATE_AUTO
          A special value for setRotate(double) that may be used with labels on PieGraphs - causes the label to be rotated to match the angle of the slice.
 
Constructor Summary
TextStyle(String fontname, double size, Paint textcolor)
          Create a new TextStyle and set the font, size and color
TextStyle(String fontname, double size, Paint textcolor, int align)
          Create a new TextStyle and set the font, size and textcolor
TextStyle(TextStyle style)
          Create a new TextStyle that is a clone of the specified style
 
Method Summary
 void setAlign(int align)
          Set the alignment of the text
 void setFont(String name, double size)
          Set the font
 void setPaddingBottom(double padding)
          Set the padding to the bottom of the text
 void setPaddingLeft(double padding)
          Set the padding to the left of the text
 void setPaddingRight(double padding)
          Set the padding to the right of the text
 void setPaddingTop(double padding)
          Set the padding to the top of the text
 void setRotate(double val)
          Set the rotation of the text
 void setTextColor(Paint textcolor)
          Set the color of the text
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROTATE_AUTO

public static final float ROTATE_AUTO
A special value for setRotate(double) that may be used with labels on PieGraphs - causes the label to be rotated to match the angle of the slice. With other labels this has no effect.

Since:
2.0.2
See Also:
Constant Field Values
Constructor Detail

TextStyle

public TextStyle(String fontname,
                 double size,
                 Paint textcolor)
Create a new TextStyle and set the font, size and color

Parameters:
fontname - the name of the font to use.
size - The size of the text. Typically in points but may be in whatever units your Output uses.
textcolor - what color to make the text

TextStyle

public TextStyle(String fontname,
                 double size,
                 Paint textcolor,
                 int align)
Create a new TextStyle and set the font, size and textcolor

Parameters:
fontname - the name of the font to use.
size - The size of the text. Typically in points but may be in whatever units your Output uses.
textcolor - what color to make the text
align - the alignment to use - a combination of one or more of the values from the Align class

TextStyle

public TextStyle(TextStyle style)
Create a new TextStyle that is a clone of the specified style

Method Detail

setTextColor

public void setTextColor(Paint textcolor)
Set the color of the text

Parameters:
textcolor - the color to make the text

setFont

public void setFont(String name,
                    double size)
Set the font

Parameters:
name - the name of the font to use
size - The size of the text. Typically in points but may be in whatever units your Output uses.

setRotate

public void setRotate(double val)
Set the rotation of the text

Parameters:
val - the angle to rotate the text, in degrees clockwise from 12 o'clock

setAlign

public void setAlign(int align)
Set the alignment of the text

Parameters:
align - a combination of one or more of the values from the Align class

setPaddingRight

public void setPaddingRight(double padding)
Set the padding to the right of the text

Parameters:
padding - the padding to use, in pixels or whatever units are use by your Output class

setPaddingTop

public void setPaddingTop(double padding)
Set the padding to the top of the text

Parameters:
padding - the padding to use, in pixels or whatever units are use by your Output class

setPaddingBottom

public void setPaddingBottom(double padding)
Set the padding to the bottom of the text

Parameters:
padding - the padding to use, in pixels or whatever units are use by your Output class

setPaddingLeft

public void setPaddingLeft(double padding)
Set the padding to the left of the text

Parameters:
padding - the padding to use, in pixels or whatever units are use by your Output class

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2011 Big Faceless Organization