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

Class wb.GraphRect

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

public class GraphRect
extends GraphUnit
Rectangle in its native form Maps the base class member variables (xmin ymin) --> the start point of rectangle (top left) (xmax, ymax) --> (width, height) of the rectangle

Constructor Index

 o GraphRect(int, int, Color)
Creates an Instance of Partial rectangle with its starting point the top left set along with the Color and type
 o GraphRect(int, int, int, int, Color)
Creates a Rectangle that is complete in all aspects of its definition although the rectangle arguments are start and end points of the user interaction, it appropriately identifies the left top and width and height
 o GraphRect(DataInputStream)
Creates an instance of the GraphRect by reading the data from the Input Stream.

Method Index

 o addnext(int, int)
Add next assumes that the input is referred to as the final point of user description of the diagonal.
 o erase(Graphics, Color)
Rendering method that actually erases the Rect 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 rectangle to the canvas/screen Called by the screen update thread.

Constructors

 o GraphRect
  public GraphRect(int x1,
                   int y1,
                   Color arg)
Creates an Instance of Partial rectangle with its starting point the top left set along with the Color and type
Parameters:
x1 - the x coordinate of the starting point
y1 - the y coordinate of the starting point
arg - the color of this rectangle.
See Also:
addnext, GTypes
 o GraphRect
  public GraphRect(int x1,
                   int y1,
                   int x2,
                   int y2,
                   Color arg)
Creates a Rectangle that is complete in all aspects of its definition although the rectangle arguments are start and end points of the user interaction, it appropriately identifies the left top and width and height
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 this rectangle.
 o GraphRect
  public GraphRect(DataInputStream din) throws IOException
Creates an instance of the GraphRect 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

Methods

 o addnext
  public void addnext(int x,
                      int y)
Add next assumes that the input is referred to as the final point of user description of the diagonal. Hence, it corrects the data in xmin, ymin such that xmin, ymin map to top left and xmax, ymax to width and height respectively.
Parameters:
x - int x-coordinate
y - int y-coordinate
Overrides:
addnext in class GraphUnit
 o paint
  public void paint(Graphics g)
Rendering method that actually draws the rectangle 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 Rect 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