acm.graphics
Class GRoundRect

java.lang.Object
  |
  +--acm.graphics.GObject
        |
        +--acm.graphics.GRect
              |
              +--acm.graphics.GRoundRect

public class GRoundRect extends GRect

The GRoundRect class is a graphical object whose appearance consists of a rounded rectangle.

[examples forthcoming]


Field Summary
static double DEFAULT_ARC
The default arc diameter used for the corners of a rounded rectangle.
 
Constructor Summary
GRoundRect(double width, double height)
Constructs a new rounded rectangle with the specified width and height, positioned at the origin.
GRoundRect(double x, double y, double width, double height)
Constructs a new rounded rectangle with the specified bounds.
GRoundRect(double x, double y, double width, double height, double arcSize)
Constructs a new rounded rectangle with the specified bounds and a single parameter describing both the describing the curvature at the corners.
GRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
Constructs a new rounded rectangle with the specified bounds and arc parameters describing the curvature at the corners.
 
Method Summary
void paint(Graphics g)
Implements the paint operation for this graphical object.
 

Inherited Method Summary
void addMouseListener(MouseListener listener)
Adds a mouse listener to this graphical object. [Inherited from GObject]
void addMouseMotionListener(MouseMotionListener listener)
Adds a mouse motion listener to this graphical object. [Inherited from GObject]
boolean contains(double x, double y)
Checks to see whether a point is inside the object. [Inherited from GObject]
Rectangle getBounds()
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers everything drawn by the figure. [Inherited from GObject]
Color getColor()
Returns the color used to display this object. [Inherited from GObject]
Color getFillColor()
Returns the color used to display the filled region of this object. [Inherited from GObject]
double getHeight()
Returns the height of this object. [Inherited from GObject]
Point getLocation()
Returns the nearest Point corresponding to the location of this object. [Inherited from GObject]
Dimension getSize()
Returns the size of this object as a Dimension. [Inherited from GObject]
double getWidth()
Returns the width of this object. [Inherited from GObject]
double getX()
Returns the x-coordinate of the object. [Inherited from GObject]
double getY()
Returns the y-coordinate of the object. [Inherited from GObject]
boolean isFilled()
Returns whether this object is filled. [Inherited from GObject]
boolean isVisible()
Checks to see whether this object is visible. [Inherited from GObject]
void moveToBack()
Moves this object to the back of the display in stacking order. [Inherited from GObject]
void moveToFront()
Moves this object to the front of the display in stacking order. [Inherited from GObject]
void paint(Graphics g)
Implements the paint operation for this graphical object. [Inherited from GRect]
void removeMouseListener(MouseListener listener)
Removes a mouse listener from this graphical object. [Inherited from GObject]
void removeMouseMotionListener(MouseMotionListener listener)
Removes a mouse motion listener from this graphical object. [Inherited from GObject]
void scale(double sf)
Scales the object on the screen by the scale factor sf, which applies in both dimensions. [Inherited from GObject]
void scale(double sx, double sy)
Scales the object on the screen by the scale factors sx and sy. [Inherited from GObject]
void setBounds(double x, double y, double width, double height)
Changes the bounds used to define the rectangle. [Inherited from GRect]
void setColor(Color c)
Sets the color used to display this object. [Inherited from GObject]
void setFillColor(Color c)
Sets the color used to display the filled region of this object. [Inherited from GObject]
void setFilled(boolean fill)
Sets whether this object is filled. [Inherited from GObject]
void setLocation(double x, double y)
Sets the location of this object to the point (x, y). [Inherited from GObject]
void setSize(double width, double height)
Changes the size of this object to the specified width and height. [Inherited from GObject]
void setVisible(boolean visible)
Sets whether this object is visible. [Inherited from GObject]
void translate(double dx, double dy)
Moves the object on the screen using the displacements dx and dy. [Inherited from GObject]

Field Detail

public static final double DEFAULT_ARC

The default arc diameter used for the corners of a rounded rectangle.
Constructor Detail

public GRoundRect(double width, double height)

Constructs a new rounded rectangle with the specified width and height, positioned at the origin.
 
Usage: GRoundRect grect = new GRoundRect(width, height);
Parameters: 
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
 

public GRoundRect(double x, double y, double width, double height)

Constructs a new rounded rectangle with the specified bounds.
 
Usage: GRoundRect grect = new GRoundRect(x, y, width, height);
Parameters: 
x  The x-coordinate of the upper left corner
y  The y-coordinate of the upper left corner
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
 

public GRoundRect(double x, double y, double width, double height, double arcSize)

Constructs a new rounded rectangle with the specified bounds and a single parameter describing both the describing the curvature at the corners.
 
Usage: GRoundRect grect = new GRoundRect(x, y, width, height, arcSize);
Parameters: 
x  The x-coordinate of the upper left corner
y  The y-coordinate of the upper left corner
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
arcSize  The diameter of the circle in place at each corner
 

public GRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)

Constructs a new rounded rectangle with the specified bounds and arc parameters describing the curvature at the corners.
 
Usage: GRoundRect grect = new GRoundRect(x, y, width, height, arcWidth, arcHeight);
Parameters: 
x  The x-coordinate of the upper left corner
y  The y-coordinate of the upper left corner
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
arcWidth  The width of the oval in place at each corner
arcHeight  The height of the oval in place at each corner
 
Method Detail

public void paint(Graphics g)

Implements the paint operation for this graphical object. This method is not called directly by clients.