|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.planeth.gtroids.obj.base.PaintableObject
A simple paintable object
| Constructor Summary | |
PaintableObject(Shape baseShape)
Constructor for PaintableObject. |
|
| Method Summary | |
protected void |
addShape(Shape shape)
Adds a Shape to the object |
protected Shape[] |
explodeBaseShape()
Explodes the baseShape (splits it into the max possible number of pieces) |
double |
getAvgDiameter()
Returns the average diameter of the object |
protected Vector2D |
getAvgVector()
Returns the average Vector of the baseShape's vertexes |
protected java.awt.Color |
getBaseColor()
Returns the baseColor of the object |
Vector2D[] |
getBaseVertexes()
Returns the vertexes of the baseShape |
Shape.Bounds |
getBounds()
Returns the current Bounds of the Shape |
double |
getMaxRadius()
Returns the the max radius of the object |
int |
getNrOfVertexes()
Returns the number of all vertexes of the object (incl. the invisible ones) |
Vector2D |
getOrientation()
Returns the orientation of the object |
Vector2D |
getPos()
Returns the position of the object |
void |
move(Vector2D movementVector)
Moves the object with the values of the passed vector |
void |
paint(java.awt.Graphics g)
Paints the object into the passed Graphics |
protected void |
paintAtPos(java.awt.Graphics g,
Vector2D pos)
Paints the object into the passed Graphics at a different position than object's stored position. |
protected void |
randomizeBaseShape()
Randomizes the baseShape |
void |
rotate(Vector2D rotationCenter,
double theta)
Rotates the object at the passed rotationCenter with the angle theta. |
protected void |
setBaseColor(java.awt.Color color)
Sets the baseColor of the object |
protected Shape[] |
splitBaseShape()
Splits the object into 2 pieces |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PaintableObject(Shape baseShape)
baseShape - the baseShape of the object| Method Detail |
public void paint(java.awt.Graphics g)
g - Graphics to paint into
protected void paintAtPos(java.awt.Graphics g,
Vector2D pos)
g - Graphics to paint intopos - the position to paint the object
public void rotate(Vector2D rotationCenter,
double theta)
rotationCenter - the rotationCenter in the local coordinateSystem of the objecttheta - the rotation angle in radianspublic void move(Vector2D movementVector)
movementVector - the movement to be doneprotected Vector2D getAvgVector()
public Vector2D[] getBaseVertexes()
protected java.awt.Color getBaseColor()
protected void setBaseColor(java.awt.Color color)
color - the color to setprotected void randomizeBaseShape()
Shape.randomize()protected Shape[] splitBaseShape()
Shape.split(int)protected Shape[] explodeBaseShape()
Shape.explode()public Shape.Bounds getBounds()
public int getNrOfVertexes()
public Vector2D getPos()
public Vector2D getOrientation()
protected void addShape(Shape shape)
shape - the Shape to addpublic double getAvgDiameter()
public double getMaxRadius()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||