Class wb.GFreeHand
All Packages Class Hierarchy This Package Previous Next Index
Class wb.GFreeHand
java.lang.Object
|
+----wb.GraphUnit
|
+----wb.GFreeHand
- public class GFreeHand
- extends GraphUnit
PolyLine in its native form
Maps the base class member variables
(xmin, ymin) as the starting point
(xmax or ymax) --> the number of points in the polygon
Limit to a max of 400 points
-
xpoints
- Array of integer to hold the x-coordinates of the remaining points
-
ypoints
- Array of integer to hold the y-coordinates of the remaining points
-
GFreeHand(int, int, Color)
- Creates an Instance of FreeHand Line with its first point set along with
the Color and type
-
GFreeHand(DataInputStream)
- Creates an instance of the GFreeHand by reading the data from the
Input Stream.
-
addnext(int, int)
- Method to add the next point of the polyline
-
basedepacketize(DataInputStream)
- Helper method to unpack the data from byte array and place fill the
member variables.
-
erase(Graphics, Color)
- Paints the object using the background color to the canvas/screen
-
isInside(int, int)
- method to verify if the passed point is enclosed in the handles
of this Object.
-
isValid()
- Provides a method to verify if the current object is valid either
for transportation or rendering
-
packetize(DataOutputStream)
- method for Object transport.
-
paint(Graphics)
- Does the real work of painting the object to the canvas/screen
xpoints
protected int xpoints[]
- Array of integer to hold the x-coordinates of the remaining points
ypoints
protected int ypoints[]
- Array of integer to hold the y-coordinates of the remaining points
GFreeHand
public GFreeHand(int x,
int y,
Color arg)
- Creates an Instance of FreeHand Line with its first point set along with
the Color and type
- Parameters:
- x1 - the x coordinate of the first point
- y1 - the y coordinate of the first point
- arg - the color of this rectangle.
- See Also:
- addnext, GTypes
GFreeHand
public GFreeHand(DataInputStream din) throws IOException
- Creates an instance of the GFreeHand by reading the data from the
Input Stream. It then fills up the member variables of the class
- Parameters:
- din - DataInputStream the stream from which the data is read
- Throws: IOException
- if an I/O error occurs
- See Also:
- ByteUnPackInputStream, packetize
basedepacketize
protected void basedepacketize(DataInputStream din) throws IOException
- Helper method to unpack the data from byte array and place fill the
member variables.
- Parameters:
- din - the stream from which it reads the data
- Throws: IOException
- if an I/O error occurs
- Overrides:
- basedepacketize in class GraphUnit
- See Also:
- basepacketize, ByteUnPackInputStream
packetize
public void packetize(DataOutputStream dos) throws IOException
- method for Object transport.
- Parameters:
- dos, - DataOutputStream to which the data is to be written.
- Throws: IOException,
- throws IOException when there is a read error
- Overrides:
- packetize in class GraphUnit
- See Also:
- basedepacketize, basepacketize, packetize, BytePackOututStream
addnext
public void addnext(int x,
int y)
- Method to add the next point of the polyline
- Parameters:
- x - the x-coordinate of the (next)point
- y - the y-coordinate of the (next)point
- Overrides:
- addnext in class GraphUnit
paint
public void paint(Graphics g)
- Does the real work of painting the object to the canvas/screen
- Parameters:
- g - Graphics on to which the object is rendered
- Overrides:
- paint in class GraphUnit
erase
public void erase(Graphics g,
Color arg)
- Paints the object using the background color to the canvas/screen
- Parameters:
- g - Graphics on to which the object is rendered
- arg - Color of the background
- Overrides:
- erase in class GraphUnit
- See Also:
- erase
isValid
public boolean isValid()
- Provides a method to verify if the current object is valid either
for transportation or rendering
- Returns:
- boolean true if the number of points is more than 1
else false
- 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