Class wb.GraphText
All Packages Class Hierarchy This Package Previous Next Index
Class wb.GraphText
java.lang.Object
|
+----wb.GraphUnit
|
+----wb.GraphText
- public class GraphText
- extends GraphUnit
Text in its native form
uses the xmin and ymin as the starting point
xmax and ymax are not used as of NOW
-
data
- Container for the text represented by this GraphText Object
-
fontsize
- A representation of the fonsize relatively.
-
GraphText(int, int, Color)
- Creates a instance with the fontsize defaulted to NORMAL
-
GraphText(int, int, int, Color)
- Creates a instance
-
GraphText(int, int, Color, String)
- Creates a instance
-
GraphText(int, int, int, Color, String)
- Creates a instance
-
GraphText(DataInputStream)
- Creates an instance by reading data from the Stream.
-
addnext(int, int)
- AddNext Not used here
-
addnext(String)
- AddNext
-
addnext(char)
- AddNext
-
basedepacketize(DataInputStream)
-
Helper method that forces the data from the stream to be read into
the byte array and extracts the data from the byte array to the
variables.
-
basepacketize(DataOutputStream)
-
Helper method that packs all the data of the base class variables.
-
erase(Graphics, Color)
- Actually this is no different from painting, except that it uses the
back ground color and paints it in the XOR mode
-
isInside(int, int)
- method to verify if the passed point is enclosed in the handles
of this Object.
-
isValid()
- isValid is very useful in determine'g miscellaneous objects
at the time of creation.
-
packetize(DataOutputStream)
-
Packetizes all the information required to create an instance of this
and writes it to the stream
calls basepacketize to packetize the base class variables and the packs
variables of this and then sync's the data to the stream.
-
paint(Graphics)
- the Heart of rendering.
data
protected StringBuffer data
- Container for the text represented by this GraphText Object
fontsize
protected int fontsize
- A representation of the fonsize relatively. Question of the the
existance of absolute fontsize on a specific platform is unanswered
defaults to NORMAL (in this implementation to 14pt)
GraphText
public GraphText(int x,
int y,
Color arg)
- Creates a instance with the fontsize defaulted to NORMAL
- Parameters:
- x - the x coordinate of the starting point
- y - the y coordinate of the starting point
- arg - the Color of this text
GraphText
public GraphText(int x,
int y,
int fsize,
Color arg)
- Creates a instance
- Parameters:
- x - the x coordinate of the starting point
- y - the y coordinate of the starting point
- fsize - the fontsize constant
could be NORMAL, BIG, SMALL
- arg - the Color of this text
GraphText
public GraphText(int x,
int y,
Color arg,
String chardata)
- Creates a instance
- Parameters:
- x - the x coordinate of the starting point
- y - the y coordinate of the starting point
- arg - the Color of this text
- chardata - the String
GraphText
public GraphText(int x,
int y,
int fsize,
Color arg,
String chardata)
- Creates a instance
- Parameters:
- x - the x coordinate of the starting point
- y - the y coordinate of the starting point
- fsize - the fontsize constant
could be NORMAL, BIG, SMALL
- arg - the Color of this text
- chardata - the String
GraphText
public GraphText(DataInputStream din) throws IOException
- Creates an instance by reading data from the Stream.
- Throws: IOException
- if reading the stream fails
basedepacketize
protected void basedepacketize(DataInputStream din) throws IOException
- Helper method that forces the data from the stream to be read into
the byte array and extracts the data from the byte array to the
variables.
- Parameters:
- din - the DataInputStream from which data is read
- Throws: IOException
- if an I/O error has occurred.
- Overrides:
- basedepacketize in class GraphUnit
basepacketize
protected void basepacketize(DataOutputStream dos) throws IOException
- Helper method that packs all the data of the base class variables.
into a byte array (BytePackOutputStream)
- Parameters:
- dos - the DataOutputStream from into which data is written
- Throws: IOException
- if an I/O error has occurred.
- Overrides:
- basepacketize in class GraphUnit
packetize
public void packetize(DataOutputStream dos) throws IOException
- Packetizes all the information required to create an instance of this
and writes it to the stream
calls basepacketize to packetize the base class variables and the packs
variables of this and then sync's the data to the stream. This method
enables data to be written in blocks.
- Parameters:
- dos - the DataOutputStream from into which data is written
- Throws: IOException
- if an I/O error has occurred.
- Overrides:
- packetize in class GraphUnit
addnext
public void addnext(int x,
int y)
- AddNext Not used here
- Parameters:
- x - the x-coordinate
- y - the y-coordinate
- Overrides:
- addnext in class GraphUnit
addnext
public void addnext(String chardata)
- AddNext
- Parameters:
- chardata - the string that is to be appended to the existing text
- Overrides:
- addnext in class GraphUnit
addnext
public void addnext(char x)
- AddNext
- Parameters:
- x - the char that is appended to the existing text
- Overrides:
- addnext in class GraphUnit
paint
public void paint(Graphics g)
- the Heart of rendering. It is called to update/paint the canvas
set the graphics appropriately with the font, color etc.
- Parameters:
- g - Graphics on to which this is rendered
- Overrides:
- paint in class GraphUnit
erase
public void erase(Graphics g,
Color arg)
- Actually this is no different from painting, except that it uses the
back ground color and paints it in the XOR mode
- Parameters:
- g - Graphics on to which this is rendered
- arg - Color the background
- Overrides:
- erase in class GraphUnit
isValid
public boolean isValid()
- isValid is very useful in determine'g miscellaneous objects
at the time of creation.
- Overrides:
- isValid in class GraphUnit
isInside
public boolean isInside(int x,
int y)
- method to verify if the passed point is enclosed in the handles
of this Object.
- Parameters:
- x - x-coordinate of the point
- y - y-coordinate of the point
- Returns:
- boolean true iff the point is enclosed in the handles
- Overrides:
- isInside in class GraphUnit
All Packages Class Hierarchy This Package Previous Next Index