All Packages Class Hierarchy This Package Previous Next Index
Class graph.RTextLine
java.lang.Object
|
+----graph.TextLine
|
+----graph.RTextLine
- public class RTextLine
- extends TextLine
This class is an extension of the TextLine Class
that allows text to be rotated. To rotate the text the Component.createImage
method is used. This means that this class needs to know
the component that will receive the text. If the component is not
known the text cannot be rotated and the class will fall back to the
TextLine.draw method.
The text is rotated by running the image through an ImageFilter. This filter
can easily be modified to rotate text through an arbitrary angle but
unless the text is large the integer mapping will blur the text.
Also positioning of arbitrarily rotated text becomes problematic.
- Version:
- $Revision: 1.5 $, $Date: 1996/10/23 03:13:45 $
- Author:
- Leigh Brookshaw
-
angle
- Rotation Angle of text in degrees
-
RTextLine()
- Instantiate the class
-
RTextLine(Component)
- Instantiate the class.
-
RTextLine(Font, Color, int)
- Instantiate the class
-
RTextLine(Font, Color, int, int)
- Instantiate the class
-
RTextLine(String)
- Instantiate the class.
-
RTextLine(String, Color)
- Instantiate the class
-
RTextLine(String, Font)
- Instantiate the class
-
RTextLine(String, Font, Color, int)
- Instantiate the class
-
copyState(RTextLine)
- Copy the state of the parsed Textline into the existing
object.
-
draw(Component, Graphics, int, int)
- Parse the text, rotate it then draw it to the screen.
-
draw(Graphics, int, int)
- Parse the text then draw it.
-
draw(Graphics, int, int, int)
- Parse the text then draw it.
-
getBottomEdge(Graphics)
- Return the bottom edge of the rotated text.
-
getBottomEdge(Graphics, int)
- Return the bottom edge of the rotated text.
-
getComponent()
-
-
getLeftEdge(Graphics)
- Return the left edge of the rotated text.
-
getLeftEdge(Graphics, int)
- Return the left edge of the rotated text.
-
getRHeight(Graphics)
- The height of the text after it has been rotated.
-
getRightEdge(Graphics)
- Return the right edge of the rotated text.
-
getRightEdge(Graphics, int)
- Return the right edge of the rotated text.
-
getRotation()
-
-
getRWidth(Graphics)
- The width of the text after it has been rotated.
-
getTopEdge(Graphics)
- Return the top edge of the rotated text.
-
getTopEdge(Graphics, int)
- Return the top edge of the rotated text.
-
setDrawingComponent(Component)
- Set the Component the text will be drawn into.
-
setRotation(int)
- Set the text rotation angle.
-
setRotation(int, Component)
- Set the Rotation and the Component that will be drawn into
angle
protected int angle
- Rotation Angle of text in degrees
RTextLine
public RTextLine()
- Instantiate the class
RTextLine
public RTextLine(String s)
- Instantiate the class.
- Parameters:
- s - String to parse.
RTextLine
public RTextLine(Component c)
- Instantiate the class.
- Parameters:
- c - the Component the text will be drawn into.
RTextLine
public RTextLine(String s,
Font f)
- Instantiate the class
- Parameters:
- s - String to parse.
- f - Font to use.
RTextLine
public RTextLine(String s,
Font f,
Color c,
int j)
- Instantiate the class
- Parameters:
- s - String to parse.
- f - Font to use.
- c - Color to use
- j - Justification
RTextLine
public RTextLine(String s,
Color c)
- Instantiate the class
- Parameters:
- s - String to parse.
- c - Color to use
RTextLine
public RTextLine(Font f,
Color c,
int j,
int a)
- Instantiate the class
- Parameters:
- f - Font to use.
- c - Color to use
- j - Justification
- a - Rotation angle in degrees
RTextLine
public RTextLine(Font f,
Color c,
int j)
- Instantiate the class
- Parameters:
- f - Font to use.
- c - Color to use
- j - Justification
copyState
public void copyState(RTextLine t)
- Copy the state of the parsed Textline into the existing
object.
- Parameters:
- t - The TextLine to get the state information from.
setRotation
public void setRotation(int angle)
- Set the text rotation angle. Only multiples of 90 degrees
are accepted
- Parameters:
- angle - The angle to rotate the text
setDrawingComponent
public void setDrawingComponent(Component c)
- Set the Component the text will be drawn into. This is required to rotate
the text. if it is not set the text will not be rotated.
- Parameters:
- c - The drawing component
setRotation
public void setRotation(int angle,
Component c)
- Set the Rotation and the Component that will be drawn into
- Parameters:
- angle - The angle to rotate the text
- c - The drawing component
getRotation
public int getRotation()
- Returns:
- the Rotation angle in degrees.
getComponent
public Component getComponent()
- Returns:
- the Component that will receive the text.
getRWidth
public int getRWidth(Graphics g)
- The width of the text after it has been rotated.
- Parameters:
- g - Graphics context.
- Returns:
- the width of the parsed text after it has been rotated.
getRHeight
public int getRHeight(Graphics g)
- The height of the text after it has been rotated.
- Parameters:
- g - Graphics context.
- Returns:
- the height of the parsed text after it has been rotated.
getLeftEdge
public int getLeftEdge(Graphics g)
- Return the left edge of the rotated text.
This is dependent on the justification of the text.
- Parameters:
- g - Graphics context.
- Returns:
- the Left edge of the rotated text
getRightEdge
public int getRightEdge(Graphics g)
- Return the right edge of the rotated text.
This is dependent on the justification of the text.
- Parameters:
- g - Graphics context.
- Returns:
- the Right edge of the rotated text
getTopEdge
public int getTopEdge(Graphics g)
- Return the top edge of the rotated text.
This is dependent on the justification of the text.
- Parameters:
- g - Graphics context.
- Returns:
- the Top edge of the rotated text
getBottomEdge
public int getBottomEdge(Graphics g)
- Return the bottom edge of the rotated text.
This is dependent on the justification of the text.
- Parameters:
- g - Graphics context.
- Returns:
- the Bottom edge of the rotated text
getLeftEdge
public int getLeftEdge(Graphics g,
int j)
- Return the left edge of the rotated text.
- Parameters:
- g - Graphics context.
- j - Text justification
- Returns:
- the Left edge of the rotated text
getRightEdge
public int getRightEdge(Graphics g,
int j)
- Return the right edge of the rotated text.
- Parameters:
- g - Graphics context.
- j - Text justification
- Returns:
- the Right edge of the rotated text
getTopEdge
public int getTopEdge(Graphics g,
int j)
- Return the top edge of the rotated text.
- Parameters:
- g - Graphics context.
- j - Text justification
- Returns:
- the Top edge of the rotated text
getBottomEdge
public int getBottomEdge(Graphics g,
int j)
- Return the bottom edge of the rotated text.
- Parameters:
- g - Graphics context.
- j - Text justification
- Returns:
- the Bottom edge of the rotated text
draw
public void draw(Graphics g,
int x,
int y)
- Parse the text then draw it.
- Parameters:
- g - Graphics context
- x - pixel position of the text
- y - pixel position of the text
- Overrides:
- draw in class TextLine
draw
public void draw(Graphics g,
int x,
int y,
int j)
- Parse the text then draw it.
- Parameters:
- g - Graphics context
- x - pixel position of the text
- y - pixel position of the text
- j - justification of the text
- Overrides:
- draw in class TextLine
draw
public synchronized void draw(Component comp,
Graphics g,
int x,
int y)
- Parse the text, rotate it then draw it to the screen.
- Parameters:
- g - Graphics context
- x - pixel position of the text
- y - pixel position of the text
All Packages Class Hierarchy This Package Previous Next Index