Class wb.GraphRRect
All Packages Class Hierarchy This Package Previous Next Index
Class wb.GraphRRect
java.lang.Object
|
+----wb.GraphUnit
|
+----wb.GraphRRect
- public class GraphRRect
- extends GraphUnit
Round Rect in its native form
Following is the mapping between the base class member variables the
representation.
(xmin, ymin) --> (top left) point of bounded rectangle
(xmax, ymax) --> (width, height) of the bounded rectangle
20 percent of the width and height is used as the diameter
and radius of the arc
-
GraphRRect(int, int, Color)
- Creates an Instance of Partial round rectangle with its
top left set along with the Color and type
-
GraphRRect(int, int, int, int, Color)
- Creates a R-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.
-
GraphRRect(DataInputStream)
- Creates an instance of the GraphRRect by reading the data from the
Input Stream.
-
addnext(int, int)
- Add next assumes that the input is referred to as the final point of user's
description of the diagonal.
-
erase(Graphics, Color)
- Rendering method that actually erases the R-Rect from the canvas/screen
Called by the screen update thread.
-
isInside(int, int)
- method to verify if the passed point is enclosed in the handles
of this Object.
-
paint(Graphics)
- Rendering method that actually draws the RRectangle to the canvas/screen
Called by the screen update thread.
GraphRRect
public GraphRRect(int x1,
int y1,
Color arg)
- Creates an Instance of Partial round rectangle with its
top left set along with the Color and type
- Parameters:
- x1 - the x coordinate of the top left point
- y1 - the y coordinate of the top left point
- arg - the color of this rectangle.
- See Also:
- addnext, GTypes
GraphRRect
public GraphRRect(int x1,
int y1,
int x2,
int y2,
Color arg)
- Creates a R-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. Note: The rectangle described by the user is in terms of
of its diagonal
- 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.
GraphRRect
public GraphRRect(DataInputStream din) throws IOException
- Creates an instance of the GraphRRect 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
addnext
public void addnext(int x,
int y)
- Add next assumes that the input is referred to as the final point of user's
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
paint
public void paint(Graphics g)
- Rendering method that actually draws the RRectangle to the canvas/screen
Called by the screen update thread. Renders in PaintMode of Graphics
case of rectangles near the borders are handled appropriately
- Parameters:
- g - Graphics to which the object is rendered onto
- Overrides:
- paint in class GraphUnit
erase
public void erase(Graphics g,
Color arg)
- Rendering method that actually erases the R-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
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