public abstract class AbstractDrawable extends java.lang.Object implements Drawable, java.io.Serializable
Drawable
interface.
This class implements common functionality like the different ways for
getting and setting the bounding rectangle of the drawable object.Constructor and Description |
---|
AbstractDrawable()
Creates an AbstractDrawable.
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBounds()
Returns the bounds of this
Drawable . |
double |
getHeight()
Returns the height of the bounds.
|
java.awt.geom.Dimension2D |
getPreferredSize()
Returns the preferred size of the
Drawable . |
double |
getWidth()
Returns the width of the bounds.
|
double |
getX()
Returns the x-position of the bounds.
|
double |
getY()
Returns the y-position of the bounds.
|
void |
setBounds(double x,
double y,
double width,
double height)
Sets the bounds to the specified coordinates, width and height.
|
void |
setBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds to the specified bounding rectangle.
|
public java.awt.geom.Rectangle2D getBounds()
Drawable
.public double getX()
public double getY()
public double getWidth()
public double getHeight()
public void setBounds(java.awt.geom.Rectangle2D bounds)
public void setBounds(double x, double y, double width, double height)
public java.awt.geom.Dimension2D getPreferredSize()
Drawable
.getPreferredSize
in interface Drawable