public abstract class CanvasObject
extends java.lang.Object
Constructor and Description |
---|
CanvasObject() |
Modifier and Type | Method and Description |
---|---|
Canvas |
getCanvas() |
int |
getHeight()
Gets the height of the canvas object.
|
int |
getRotation()
Gets the degrees in clockwise rotation of the canvas object.
|
double |
getScale()
Gets the scale of the canvas object.
|
int |
getWidth()
Gets the width of the canvas object.
|
int |
getX()
Gets the x position of the canvas object.
|
int |
getY()
Gets the y position of the canvas object.
|
void |
runRotateAnimation(int degrees)
Runs a rotation animation on the canvas object.
|
void |
runScaleAnimation(double scale)
Runs a scale animation on the canvas object.
|
void |
setCanvas(Canvas canvas) |
void |
setMovable(boolean isMovable)
Sets is the canvas object is movable.
|
void |
setRotation(int degrees)
Sets the degrees in clockwise rotation of the canvas object.
|
void |
setScale(double scale)
Sets the scale of the canvas object.
|
void |
setX(int x)
Sets the x position of the canvas object.
|
void |
setY(int y)
Sets the y position of the canvas object.
|
public Canvas getCanvas()
public void setCanvas(Canvas canvas)
public void setX(int x)
x
- The value of the x position to be set to.public void setY(int y)
y
- The value of the y positin of to be set to.public int getX()
public int getY()
public void setRotation(int degrees)
degrees
- The value of the clockwise degrees to be set to.public int getRotation()
public void setScale(double scale)
scale
- The scale of the object to be set to.public double getScale()
public int getWidth()
public int getHeight()
public void runRotateAnimation(int degrees)
degrees
- The clockwise degrees to be rotated by the canvas object
during the animation.public void runScaleAnimation(double scale)
scale
- The final scale of the canvas object.public void setMovable(boolean isMovable)
isMovable
- Flag indicating whether the canvas object is movable or not.