Modifier and Type | Field and Description |
---|---|
java.awt.Color |
color |
java.awt.Color |
edgeColor |
java.lang.String |
shapeClass |
Constructor and Description |
---|
DrawableShape(java.awt.Shape shape,
double x,
double y)
Constructs a DrawableShape with the given coordinates.
|
Modifier and Type | Method and Description |
---|---|
static DrawableShape |
createCircle(double x,
double y,
double d)
Creates a drawable circle.
|
static DrawableShape |
createRectangle(double x,
double y,
double w,
double h)
Creates a drawable rectangle.
|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the shape.
|
static XML.ObjectLoader |
getLoader()
Gets the XML object loader for this class.
|
double |
getTheta()
Gets the value of the roation angle theta.
|
double |
getX()
Gets the value of x.
|
double |
getY()
Gets the value of y.
|
void |
setMarkerColor(java.awt.Color fillColor,
java.awt.Color edgeColor)
Sets the shape's drawing colors.
|
void |
setTheta(double theta)
Sets the rotation angle in radians.
|
void |
setX(double _x)
Sets the x coordinate.
|
void |
setXY(double _x,
double _y)
Sets the x and y coordinates.
|
void |
setY(double _y)
Sets the y coordinate.
|
java.lang.String |
toString()
Returns a string representation of the circle.
|
void |
tranform(double[][] mat)
Transforms the shape using the given matrix.
|
void |
transform(java.awt.geom.AffineTransform transformation)
Transforms the shape using the given transformation.
|
public java.awt.Color color
public java.awt.Color edgeColor
public java.lang.String shapeClass
public DrawableShape(java.awt.Shape shape, double x, double y)
x
- coordinatey
- coordinatepublic static DrawableShape createCircle(double x, double y, double d)
x
- y
- d
- the diameterpublic static DrawableShape createRectangle(double x, double y, double w, double h)
x
- y
- w
- h
- public void setMarkerColor(java.awt.Color fillColor, java.awt.Color edgeColor)
fillColor
- edgeColor
- public void setTheta(double theta)
theta
- the new anglepublic double getTheta()
public void transform(java.awt.geom.AffineTransform transformation)
transformation
- AffineTransformpublic void tranform(double[][] mat)
mat
- double[][]public void setXY(double _x, double _y)
_x
- _y
- public void setX(double _x)
_x
- public double getX()
public void setY(double _y)
_y
- public double getY()
public java.lang.String toString()
toString
in class java.lang.Object
public void draw(DrawingPanel panel, java.awt.Graphics g)
public static XML.ObjectLoader getLoader()