acm.graphics
Class GRoundRect

java.lang.Object
  extended by acm.graphics.GObject
      extended by acm.graphics.GRect
          extended by acm.graphics.GRoundRect
All Implemented Interfaces:
GFillable, GResizable, GScalable, Serializable, Cloneable

public class GRoundRect
extends GRect

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

See Also:
Serialized Form

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
 double getArcHeight()
          Returns the y component of the corner radius.
 double getArcWidth()
          Returns the x component of the corner radius.
 void paint(Graphics g)
          Implements the paint operation for this graphical object.
 
Methods inherited from class acm.graphics.GRect
getAWTBounds, getBounds, getFillColor, getHeight, getSize, getWidth, isFilled, scale, scale, setBounds, setBounds, setFillColor, setFilled, setSize, setSize
 
Methods inherited from class acm.graphics.GObject
addActionListener, addMouseListener, addMouseMotionListener, areMouseListenersEnabled, colorName, contains, contains, fireActionEvent, fireActionEvent, fireMouseListeners, getColor, getComponent, getLocation, getObjectColor, getParent, getX, getY, isVisible, move, movePolar, paintObject, paramString, pause, removeActionListener, removeMouseListener, removeMouseMotionListener, repaint, sendBackward, sendForward, sendToBack, sendToFront, setColor, setLocation, setLocation, setParent, setVisible, start, start, toString, updateEnabledList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ARC

public static final double DEFAULT_ARC
The default arc diameter used for the corners of a rounded rectangle.

See Also:
Constant Field Values
Constructor Detail

GRoundRect

public GRoundRect(double width,
                  double height)
Constructs a new rounded rectangle with the specified width and height, positioned at the origin.

Parameters:
width - The width of the rectangle in pixels
height - The height of the rectangle in pixels

GRoundRect

public GRoundRect(double x,
                  double y,
                  double width,
                  double height)
Constructs a new rounded rectangle with the specified bounds.

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

GRoundRect

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.

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

GRoundRect

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.

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

getArcHeight

public double getArcHeight()
Returns the y component of the corner radius.

Returns:
The y component of the corner radius, in pixels.

getArcWidth

public double getArcWidth()
Returns the x component of the corner radius.

Returns:
The x component of the corner radius, in pixels.

paint

public void paint(Graphics g)
Implements the paint operation for this graphical object. This method is not called directly by clients.

Overrides:
paint in class GRect
Parameters:
g - The graphics context into which the painting is done