All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.toolkit.graphics.GraphicString

java.lang.Object
   |
   +----com.ibm.eou.toolkit.graphics.GraphicString

public class GraphicString
extends Object
This class encapsulates text and attributes to represent a graphical text string. It will allow text to be drawn using any (Java supported) font and color. It also provides various highlighting styles and allows text to be drawn at different angles.


Variable Index

 o ANTICLOCKWISE_90
Rotation constant for 90 degree anti-clockwise rotation of the text base line.
 o CLOCKWISE_90
Rotation constant for 90 degree clockwise rotation of the text base line.
 o EMBOSSED
Embossed effect.
 o ENGRAVED
Engraved effect.
 o NO_ROTATION
Rotation constant for 0 degree rotation of the text base line.
 o NONE
No highlighting.
 o ROTATE_180
Rotation constant for 180 degree rotation.
 o SHADOW
Drop shadow effect.

Constructor Index

 o GraphicString(String)
Create a GraphicString with the given text.
 o GraphicString(String, Font)
Create a GraphicString with the given text and font.
 o GraphicString(String, Font, Color)
Create a GraphicString with the given text, font and color.
 o GraphicString(String, Font, Color, int)
Create a GraphicString with the given text, font, color and highlight style.

Method Index

 o clone()
 o copyright()
Copyright method to ensure that short copyright string appears in class file.
 o getBounds(int, int)
Return the bounding box of the rendered text, as if rendered at the given baseline start position coordinates.
 o getColor()
Return the color that will be used to display the text.
 o getFont()
Return the font.
 o getHeight()
Return the rendered text's height, perpendicular to the baseline.
 o getHighlightColor()
Return the highlight color.
 o getLowlightColor()
Return the lowlight color.
 o getMaximumFont(Dimension)
Return a Font of the same face name and style as that currently set, with the font size adjusted so that the text will just fit into the size provided.
 o getRotation()
Return the rotation.
 o getSize()
Return the dimensions of the area required when the text is rendered.
 o getStyle()
Return the style.
 o getText()
Return the text.
 o getWidth()
Return the rendered text's width, in the direction of the baseline.
 o render(Graphics, int, int)
Render the GraphicString at the given baseline start position coordinates.
 o setColor(Color)
Set the color to be used when drawing text.
 o setColor(Color, boolean)
Set the color to be used when drawing text.
 o setFont(Font)
Set the font to be used when drawing text.
 o setHighlightColor(Color)
Set the highlight color to be used when drawing embossed or engraved text.
 o setLowlightColor(Color)
Set the lowlight color to be used when drawing shadowed, embossed or engraved text.
 o setRotation(int)
Set the amount of rotation to be applied to the baseline when drawn.
 o setStyle(int)
Set the highlighting style to be used when drawing text.
 o setStyle(int, Point)
Set the highlighting style to be used when drawing text, and the offset to control the relative displacement of text highlighting.
 o setText(String)
Set the text to be drawn.

Variables

 o NONE
 public static final int NONE
No highlighting.

 o SHADOW
 public static final int SHADOW
Drop shadow effect.

 o ENGRAVED
 public static final int ENGRAVED
Engraved effect.

 o EMBOSSED
 public static final int EMBOSSED
Embossed effect.

 o NO_ROTATION
 public static final int NO_ROTATION
Rotation constant for 0 degree rotation of the text base line.

 o CLOCKWISE_90
 public static final int CLOCKWISE_90
Rotation constant for 90 degree clockwise rotation of the text base line.

 o ANTICLOCKWISE_90
 public static final int ANTICLOCKWISE_90
Rotation constant for 90 degree anti-clockwise rotation of the text base line.

 o ROTATE_180
 public static final int ROTATE_180
Rotation constant for 180 degree rotation.

Constructors

 o GraphicString
 public GraphicString(String string)
Create a GraphicString with the given text.

See Also:
setText, setFont, setColor, setStyle
 o GraphicString
 public GraphicString(String string,
                      Font font)
Create a GraphicString with the given text and font.

See Also:
setText, setFont, setColor, setStyle
 o GraphicString
 public GraphicString(String string,
                      Font font,
                      Color color)
Create a GraphicString with the given text, font and color.

See Also:
setText, setFont, setColor, setStyle
 o GraphicString
 public GraphicString(String string,
                      Font font,
                      Color color,
                      int style)
Create a GraphicString with the given text, font, color and highlight style.

See Also:
setText, setFont, setColor, setStyle

Methods

 o copyright
 public static String copyright()
Copyright method to ensure that short copyright string appears in class file.

 o setText
 public void setText(String string)
Set the text to be drawn.

 o getText
 public String getText()
Return the text.

 o setFont
 public void setFont(Font font)
Set the font to be used when drawing text.

 o getFont
 public Font getFont()
Return the font.

 o setColor
 public void setColor(Color color)
Set the color to be used when drawing text. The highlight and lowlight colors remain unchanged. Use setHighlightColor and setLowlightColor to set these explicitly.

See Also:
setHighlightColor, setLowlightColor
 o setColor
 public void setColor(Color color,
                      boolean setHighlightColors)
Set the color to be used when drawing text. If the boolean parameter is set to true, it will also set the highlight and lowlight colors to sensible defaults at the same time. Use setHighlightColor and setLowlightColor to set these explicitly.

 o getColor
 public Color getColor()
Return the color that will be used to display the text.

 o setHighlightColor
 public void setHighlightColor(Color color)
Set the highlight color to be used when drawing embossed or engraved text.

 o getHighlightColor
 public Color getHighlightColor()
Return the highlight color.

 o setLowlightColor
 public void setLowlightColor(Color color)
Set the lowlight color to be used when drawing shadowed, embossed or engraved text.

 o getLowlightColor
 public Color getLowlightColor()
Return the lowlight color.

 o setStyle
 public void setStyle(int style)
Set the highlighting style to be used when drawing text.

See Also:
NONE, SHADOW, ENGRAVED, EMBOSSED
 o setStyle
 public void setStyle(int style,
                      Point offset)
Set the highlighting style to be used when drawing text, and the offset to control the relative displacement of text highlighting.

See Also:
NONE, SHADOW, ENGRAVED, EMBOSSED
 o getStyle
 public int getStyle()
Return the style.

See Also:
NONE, SHADOW, ENGRAVED, EMBOSSED
 o getSize
 public Dimension getSize()
Return the dimensions of the area required when the text is rendered. This takes account of any rotation.

 o setRotation
 public void setRotation(int rotation)
Set the amount of rotation to be applied to the baseline when drawn.

See Also:
NO_ROTATION, CLOCKWISE_90, ANTICLOCKWISE_90, ROTATE_180
 o getRotation
 public int getRotation()
Return the rotation.

See Also:
NO_ROTATION, CLOCKWISE_90, ANTICLOCKWISE_90, ROTATE_180
 o getWidth
 public int getWidth()
Return the rendered text's width, in the direction of the baseline.

 o getHeight
 public int getHeight()
Return the rendered text's height, perpendicular to the baseline.

 o render
 public void render(Graphics g,
                    int x,
                    int y)
Render the GraphicString at the given baseline start position coordinates.

 o getBounds
 public Rectangle getBounds(int x,
                            int y)
Return the bounding box of the rendered text, as if rendered at the given baseline start position coordinates.

 o getMaximumFont
 public Font getMaximumFont(Dimension constraints)
Return a Font of the same face name and style as that currently set, with the font size adjusted so that the text will just fit into the size provided.

 o clone
 public Object clone()
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index