|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--acm.graphics.GObject | +--acm.graphics.GRect
public class GRect extends GObject implements GFillable, GResizable, GScalable
The GRect class is a graphical object whose appearance consists of a rectangular box.
Constructor Summary |
GRect(double width,
double height) |
GRect(double x,
double y,
double width,
double height) |
Method Summary | |
GRectangle | getBounds() |
Color | getFillColor() |
double | getHeight() |
GDimension | getSize() |
double | getWidth() |
boolean | isFilled() |
void | scale(double sf) |
void | scale(double sx,
double sy) |
void | setBounds(double x,
double y,
double width,
double height) |
void | setBounds(GRectangle bounds) |
void | setFillColor(Color c) |
void | setFilled(boolean fill) |
void | setSize(double width,
double height) |
Inherited Method Summary | |
void | addMouseListener(MouseListener listener) |
void | addMouseMotionListener(MouseMotionListener listener) |
boolean | contains(GPoint pt) |
boolean | contains(double x, double y) |
Color | getColor() |
GPoint | getLocation()GPoint .
|
double | getX() |
double | getY() |
boolean | isVisible() |
void | move(double dx, double dy)dx and dy .
|
void | movePolar(double r, double theta) |
void | removeMouseListener(MouseListener listener) |
void | removeMouseMotionListener(MouseMotionListener listener) |
void | sendBackward() |
void | sendForward() |
void | sendToBack() |
void | sendToFront() |
void | setColor(Color color) |
void | setLocation(GPoint pt) |
void | setLocation(double x, double y)x , y ).
|
void | setVisible(boolean visible) |
Constructor Detail |
public GRect(double width,
double height)
Usage: | GRect grect = new GRect(width, height); | ||||
Parameters: |
|
public GRect(double x,
double y,
double width,
double height)
Usage: | GRect grect = new GRect(x, y, width, height); | ||||||||
Parameters: |
|
Method Detail |
public GRectangle getBounds()
Usage: | GRectangle bounds = gobj.getBounds(); |
Returns: | The bounding box for this object |
public Color getFillColor()
Usage: | Color color = gobj.getFillColor(); |
Returns: | The color used to display the filled region of this object |
Specified by: | getFillColor in interface GFillable |
public double getHeight()
Usage: | double height = gobj.getHeight(); |
Returns: | The height of this object on the screen |
public GDimension getSize()
Usage: | GDimension size = gobj.getSize(); |
Returns: | The size of this object |
public double getWidth()
Usage: | double width = gobj.getWidth(); |
Returns: | The width of this object on the screen |
public boolean isFilled()
Usage: | if (gobj.isFilled()) . . . |
Returns: | The color used to display the object |
Specified by: | isFilled in interface GFillable |
public final void scale(double sf)
Usage: | gobj.scale(sf); | ||
Parameter: |
| ||
Specified by: | scale in interface GScalable |
public void scale(double sx,
double sy)
Usage: | gobj.scale(sx, sy); | ||||
Parameters: |
| ||||
Specified by: | scale in interface GScalable |
public void setBounds(double x,
double y,
double width,
double height)
Usage: | gobj.setBounds(x, y, width, height); | ||||||||
Parameters: |
| ||||||||
Specified by: | setBounds in interface GResizable |
public final void setBounds(GRectangle bounds)
Usage: | gobj.setBounds(bounds); | ||
Parameter: |
| ||
Specified by: | setBounds in interface GResizable |
public void setFillColor(Color c)
Usage: | gobj.setFillColor(color); | ||
Parameter: |
| ||
Specified by: | setFillColor in interface GFillable |
public void setFilled(boolean fill)
Usage: | gobj.setFilled(fill); | ||
Parameter: |
| ||
Specified by: | setFilled in interface GFillable |
public void setSize(double width,
double height)
Usage: | gobj.setSize(width, height); | ||||
Parameters: |
| ||||
Specified by: | setSize in interface GResizable |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |