acm.graphics
Class G3DRect

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

public class G3DRect
extends GRect

The G3DRect class is used to represent a rectangle whose borders are drawn to create a three-dimensional effect. The G3DRect class is a subclass of GRect, and therefore implements all the methods defined for that class. In addition, the G3DRect class supports the following methods:

 
void setRaised(boolean raised)
   Sets the G3DRect to appear raised or lowered as specified by the parameter
boolean isRaised()
   Returns true if this G3DRect is raised.

The appearance of a G3DRect object depends on the system on which it is displayed and is typically more effective if the G3DRect is filled.

See Also:
Serialized Form

Constructor Summary
G3DRect(double width, double height)
          Constructs a new 3D rectangle with the specified width and height, positioned at the origin.
G3DRect(double x, double y, double width, double height)
          Constructs a new 3D rectangle with the specified bounds.
G3DRect(double x, double y, double width, double height, boolean raised)
          Constructs a new 3D rectangle with the specified bounds which is raised if the final parameter is true.
 
Method Summary
 boolean isRaised()
          Tests whether this object appears raised.
 void paint(Graphics g)
          Implements the paint operation for this graphical object.
 void setRaised(boolean raised)
          Sets whether this object appears raised.
 
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
 

Constructor Detail

G3DRect

public G3DRect(double width,
               double height)
Constructs a new 3D 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

G3DRect

public G3DRect(double x,
               double y,
               double width,
               double height)
Constructs a new 3D 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

G3DRect

public G3DRect(double x,
               double y,
               double width,
               double height,
               boolean raised)
Constructs a new 3D rectangle with the specified bounds which is raised if the final parameter is true.

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
raised - true if this rectangle should appear raised
Method Detail

isRaised

public boolean isRaised()
Tests whether this object appears raised.

Returns:
true if the object appears raised, false otherwise

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

setRaised

public void setRaised(boolean raised)
Sets whether this object appears raised.

Parameters:
raised - true if the object appears raised, false otherwise