public class G3DRect extends GRect
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:
setRaised(boolean)
G3DRect
to appear raised or lowered as specified by
the parameterisRaised()
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.
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
boolean |
isRaised()
Tests whether this object appears raised.
|
void |
paint(java.awt.Graphics g)
Implements the
paint operation for this graphical object. |
void |
setRaised(boolean raised)
Sets whether this object appears raised.
|
getAWTBounds, getBounds, getFillColor, getHeight, getSize, getWidth, isFilled, scale, scale, setBounds, setBounds, setFillColor, setFilled, setSize, setSize
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
public G3DRect(double width, double height)
width
- The width of the rectangle in pixelsheight
- The height of the rectangle in pixelspublic G3DRect(double x, double y, double width, double height)
x
- The x-coordinate of the upper left cornery
- The y-coordinate of the upper left cornerwidth
- The width of the rectangle in pixelsheight
- The height of the rectangle in pixelspublic G3DRect(double x, double y, double width, double height, boolean raised)
true
.x
- The x-coordinate of the upper left cornery
- The y-coordinate of the upper left cornerwidth
- The width of the rectangle in pixelsheight
- The height of the rectangle in pixelsraised
- true
if this rectangle should appear raisedpublic void paint(java.awt.Graphics g)
GRect
paint
operation for this graphical object. This
method is not called directly by clients.public void setRaised(boolean raised)
raised
- true
if the object appears raised,
false
otherwisepublic boolean isRaised()
true
if the object appears raised, false
otherwise