Class wb.GraphLine
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class wb.GraphLine

java.lang.Object
   |
   +----wb.GraphUnit
           |
           +----wb.GraphLine

public class GraphLine
extends GraphUnit
GraphLine in an extention of GraphUnit. It uses all the member variables of the base class and the meaning of each is altered. xmin, ymin correspond to the starting point and xmax, ymax refer to the other end of the line.

Constructor Index

 o GraphLine(int, int, Color)
Creates an instance of GraphLine with its type set to LINES and the starting co-ordinates are set.
 o GraphLine(int, int, int, int, Color)
Creates an instance of GraphLine with its type set to LINES and this constructor is defines the line completely
 o GraphLine(DataInputStream)
Creates an instance of GraphLine from an Input Data Stream attached the network socket.

Method Index

 o addnext(int, int)
Provides a method to fix the end point of the Line.
 o erase(Graphics, Color)
Rendering method that actually erases the line from the canvas/screen Called by the screen update thread.
 o isInside(int, int)
method to verify if the passed point is enclosed in the handles of this Object.
 o paint(Graphics)
Rendering method that actually draws the line to the canvas/screen Called by the screen update thread.

Constructors

 o GraphLine
  public GraphLine(int x,
                   int y,
                   Color arg)
Creates an instance of GraphLine with its type set to LINES and the starting co-ordinates are set.
Parameters:
x - the x-coordinate of the starting point
y - the y-coordinate of the starting point
arg - the color of the line
 o GraphLine
  public GraphLine(int x1,
                   int y1,
                   int x2,
                   int y2,
                   Color arg)
Creates an instance of GraphLine with its type set to LINES and this constructor is defines the line completely
Parameters:
x1 - the x-coordinate of the starting point
y1 - the y-coordinate of the starting point
x2 - the x-coordinate of the end point
y2 - the y-coordinate of the end point
arg - the color of the line
 o GraphLine
  public GraphLine(DataInputStream din) throws IOException
Creates an instance of GraphLine from an Input Data Stream attached the network socket. This is very useful when in a conference.
Parameters:
din - DataInputStream from which data is read and assigned to the member variables of the class
Throws: IOException
when there is an I/O error in reading the data
See Also:
GraphUnit

Methods

 o addnext
  public void addnext(int x,
                      int y)
Provides a method to fix the end point of the Line. Useful when constructed with only one point known
Parameters:
x - the x-coordinate of the end point
y - the y-coordinate of the end point
Overrides:
addnext in class GraphUnit
 o paint
  public void paint(Graphics g)
Rendering method that actually draws the line to the canvas/screen Called by the screen update thread. Paints in PaintMode of Graphics
Parameters:
g - Graphics to which the object is rendered onto
Overrides:
paint in class GraphUnit
 o erase
  public void erase(Graphics g,
                    Color arg)
Rendering method that actually erases the line from the canvas/screen Called by the screen update thread. Useful to provide rubber-banding paints in XOR mode of the graphics
Parameters:
g - Graphics to which the object is rendered onto
arg - Color of the background
Overrides:
erase in class GraphUnit
 o 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