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.
-
ANTICLOCKWISE_90
- Rotation constant for 90 degree anti-clockwise rotation of the text base line.
-
CLOCKWISE_90
- Rotation constant for 90 degree clockwise rotation of the text base line.
-
EMBOSSED
- Embossed effect.
-
ENGRAVED
- Engraved effect.
-
NO_ROTATION
- Rotation constant for 0 degree rotation of the text base line.
-
NONE
- No highlighting.
-
ROTATE_180
- Rotation constant for 180 degree rotation.
-
SHADOW
- Drop shadow effect.
-
GraphicString(String)
- Create a GraphicString with the given text.
-
GraphicString(String, Font)
- Create a GraphicString with the given text and font.
-
GraphicString(String, Font, Color)
- Create a GraphicString with the given text, font and color.
-
GraphicString(String, Font, Color, int)
- Create a GraphicString with the given text, font, color and
highlight style.
-
clone()
-
-
copyright()
- Copyright method to ensure that short copyright string appears
in class file.
-
getBounds(int, int)
- Return the bounding box of the rendered text, as if rendered at the
given baseline start position coordinates.
-
getColor()
- Return the color that will be used to display the text.
-
getFont()
- Return the font.
-
getHeight()
- Return the rendered text's height, perpendicular to the baseline.
-
getHighlightColor()
- Return the highlight color.
-
getLowlightColor()
- Return the lowlight color.
-
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.
-
getRotation()
- Return the rotation.
-
getSize()
- Return the dimensions of the area required when the text is
rendered.
-
getStyle()
- Return the style.
-
getText()
- Return the text.
-
getWidth()
- Return the rendered text's width, in the direction of the baseline.
-
render(Graphics, int, int)
- Render the GraphicString at the given baseline start position coordinates.
-
setColor(Color)
- Set the color to be used when drawing text.
-
setColor(Color, boolean)
- Set the color to be used when drawing text.
-
setFont(Font)
- Set the font to be used when drawing text.
-
setHighlightColor(Color)
- Set the highlight color to be used when drawing embossed or engraved text.
-
setLowlightColor(Color)
- Set the lowlight color to be used when drawing shadowed, embossed or engraved text.
-
setRotation(int)
- Set the amount of rotation to be applied to the baseline when drawn.
-
setStyle(int)
- Set the highlighting style to be used when drawing text.
-
setStyle(int, Point)
- Set the highlighting style to be used when drawing text, and the
offset to control the relative displacement of text highlighting.
-
setText(String)
- Set the text to be drawn.
NONE
public static final int NONE
- No highlighting.
SHADOW
public static final int SHADOW
- Drop shadow effect.
ENGRAVED
public static final int ENGRAVED
- Engraved effect.
EMBOSSED
public static final int EMBOSSED
- Embossed effect.
NO_ROTATION
public static final int NO_ROTATION
- Rotation constant for 0 degree rotation of the text base line.
CLOCKWISE_90
public static final int CLOCKWISE_90
- Rotation constant for 90 degree clockwise rotation of the text base line.
ANTICLOCKWISE_90
public static final int ANTICLOCKWISE_90
- Rotation constant for 90 degree anti-clockwise rotation of the text base line.
ROTATE_180
public static final int ROTATE_180
- Rotation constant for 180 degree rotation.
GraphicString
public GraphicString(String string)
- Create a GraphicString with the given text.
- See Also:
- setText, setFont, setColor, setStyle
GraphicString
public GraphicString(String string,
Font font)
- Create a GraphicString with the given text and font.
- See Also:
- setText, setFont, setColor, setStyle
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
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
copyright
public static String copyright()
- Copyright method to ensure that short copyright string appears
in class file.
setText
public void setText(String string)
- Set the text to be drawn.
getText
public String getText()
- Return the text.
setFont
public void setFont(Font font)
- Set the font to be used when drawing text.
getFont
public Font getFont()
- Return the font.
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
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.
getColor
public Color getColor()
- Return the color that will be used to display the text.
setHighlightColor
public void setHighlightColor(Color color)
- Set the highlight color to be used when drawing embossed or engraved text.
getHighlightColor
public Color getHighlightColor()
- Return the highlight color.
setLowlightColor
public void setLowlightColor(Color color)
- Set the lowlight color to be used when drawing shadowed, embossed or engraved text.
getLowlightColor
public Color getLowlightColor()
- Return the lowlight color.
setStyle
public void setStyle(int style)
- Set the highlighting style to be used when drawing text.
- See Also:
- NONE, SHADOW, ENGRAVED, EMBOSSED
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
getStyle
public int getStyle()
- Return the style.
- See Also:
- NONE, SHADOW, ENGRAVED, EMBOSSED
getSize
public Dimension getSize()
- Return the dimensions of the area required when the text is
rendered. This takes account of any rotation.
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
getRotation
public int getRotation()
- Return the rotation.
- See Also:
- NO_ROTATION, CLOCKWISE_90, ANTICLOCKWISE_90, ROTATE_180
getWidth
public int getWidth()
- Return the rendered text's width, in the direction of the baseline.
getHeight
public int getHeight()
- Return the rendered text's height, perpendicular to the baseline.
render
public void render(Graphics g,
int x,
int y)
- Render the GraphicString at the given baseline start position coordinates.
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.
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.
clone
public Object clone()
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index