|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlab5lib.TripleShape
public class TripleShape
A composite shape that contains a circle, square and oval.
| Constructor Summary | |
|---|---|
TripleShape()
Creates a new instance of ManipulatableCompositeShape |
|
| Method Summary | |
|---|---|
void |
actualPaint(Graphics2D gs,
Point location,
Dimension dimension)
This method uses the Graphics2D object to paint the actual shape onto the Container. |
void |
addMouseListener(MouseListener ml)
Adds a java.awt.event.MouseListener onto this graphic
TODO: remove mouse listener? |
void |
addMouseMotionListener(MouseMotionListener mml)
Adds a java.awt.event.MouseMotionListener onto this
graphic TODO: remove listener? |
boolean |
contains(Point p)
Checks whether a given point is contained within this graphic |
Rectangle |
getBounds()
Returns the bounding box of this graphic |
Point |
getCenterLocation()
Finds the center location of this Object |
IContainer |
getContainer()
|
Dimension |
getDimension()
Gets the Dimension of this Object |
Point |
getLocation()
Gets the location of this Object |
Collection<MouseListener> |
getMouseListeners()
Returns all the java.awt.event.MouseListeners of this
graphic |
Collection<MouseMotionListener> |
getMouseMotionListeners()
Returns all the java.awt.event.MouseMotionListeners of
this graphic |
Integer |
getRotation()
Gets the current rotation of this Object in degrees. |
Shape |
getShape()
Should return a java.awt.Shape representation of this graphic. |
boolean |
intersects(IGraphic shape)
In Beta Testing Tests to see if two Graphics intersect with each other. |
Vector |
move(Vector v)
Moves the Object from one location to another by a specific vector |
void |
paint(Graphics2D gs)
This method uses the Graphics2D object to paint itself onto its container |
void |
rotate(Integer degreesToRotate)
Rotates clockwise the Object by the specified number of degrees |
void |
setCenterLocation(Point p)
Sets the location of this graphic by putting the center of the Object at the specified point |
void |
setColorCircle(Color newColor)
Set the color of the circle only from this composite. |
void |
setColorOval(Color newColor)
Set the color of the oval only from this composite. |
void |
setColorSquare(Color newColor)
Set the color of the square only from this composite. |
void |
setContainer(IContainer container)
This sets the container of this graphic |
void |
setDimension(Dimension d)
Sets the Dimension of this Object |
void |
setDimensionCircle(Dimension newSize)
Set the dimension of the circle only from this composite. |
void |
setDimensionOval(Dimension newSize)
Set the dimension of the oval only from this composite. |
void |
setDimensionSquare(Dimension newSize)
Set the dimension of the square only from the composite. |
void |
setDirectionVector(Vector newVector)
Set the directional vector for the entire composite shape. |
void |
setLocation(Point p)
Sets the Location of this Object to be the specified point |
void |
setLocationCircle(Point newLocation)
Set the location of the circle only from this composite. |
void |
setLocationOval(Point newLocation)
Set the location of the oval only from this composite. |
void |
setLocationSquare(Point newLocation)
Set the location of the square only from this composite. |
void |
setMovement(IGraphicMovement movement)
Sets the movement of the Graphic. |
void |
setRotation(Integer degree)
Sets the Rotation of the Object to be a certain degree. |
void |
setRotationOval(Integer newRotationAngle)
Set the rotation of the oval only from this composite. |
void |
setRotationSquare(Integer newRotationAngle)
Set the rotation of the square only from this composite. |
void |
startMotion()
Starts the motion of this graphic. |
void |
stopMotion()
Stops the motion of this graphic. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TripleShape()
| Method Detail |
|---|
public void startMotion()
public void stopMotion()
public void setDimensionSquare(Dimension newSize)
newSize - The new size to make the square.public void setDimensionCircle(Dimension newSize)
newSize - The new size to make the circle.public void setDimensionOval(Dimension newSize)
newSize - The new size to make the oval.public void setLocationCircle(Point newLocation)
newLocation - The new location for the circle.public void setLocationOval(Point newLocation)
newLocation - The new location for the oval.public void setLocationSquare(Point newLocation)
newLocation - The new location of the square.public void setRotationOval(Integer newRotationAngle)
newRotationAngle - The number of degrees to rotate the oval.public void setRotationSquare(Integer newRotationAngle)
newRotationAngle - The number of degrees to rotate the square.public void setColorSquare(Color newColor)
newColor - The new color for the square.public void setColorCircle(Color newColor)
newColor - The new color for the circle.public void setColorOval(Color newColor)
newColor - The new color for the oval.public void setDirectionVector(Vector newVector)
newVector - The new directional vector.
public void actualPaint(Graphics2D gs,
Point location,
Dimension dimension)
IGraphic
actualPaint in interface IGraphicgs - location - dimension - IGraphic.actualPaint(java.awt.Graphics2D, java.awt.Point, java.awt.Dimension)public void addMouseListener(MouseListener ml)
IGraphicjava.awt.event.MouseListener onto this graphic
TODO: remove mouse listener?
addMouseListener in interface IGraphicml - IGraphic.addMouseListener(java.awt.event.MouseListener)public void addMouseMotionListener(MouseMotionListener mml)
IGraphicjava.awt.event.MouseMotionListener onto this
graphic TODO: remove listener?
addMouseMotionListener in interface IGraphicmml - IGraphic.addMouseMotionListener(java.awt.event.MouseMotionListener)public boolean contains(Point p)
IGraphic
contains in interface IGraphicp -
IGraphic.contains(java.awt.Point)public Rectangle getBounds()
IGraphic
getBounds in interface IGraphicIGraphic.getBounds()public IContainer getContainer()
getContainer in interface IGraphicIGraphic.getContainer()public Collection<MouseListener> getMouseListeners()
IGraphicjava.awt.event.MouseListeners of this
graphic
getMouseListeners in interface IGraphicIGraphic.getMouseListeners()public Collection<MouseMotionListener> getMouseMotionListeners()
IGraphicjava.awt.event.MouseMotionListeners of
this graphic
getMouseMotionListeners in interface IGraphicIGraphic.getMouseMotionListeners()public Shape getShape()
IGraphic
getShape in interface IGraphicIGraphic.getShape()public boolean intersects(IGraphic shape)
IGraphic
intersects in interface IGraphicshape -
IGraphic.intersects(graphics.IGraphic)public void paint(Graphics2D gs)
IGraphic
paint in interface IGraphicgs - IGraphic.paint(java.awt.Graphics2D)public void setContainer(IContainer container)
IGraphic
setContainer in interface IGraphiccontainer - IGraphic.setContainer(graphics.IContainer)public void setMovement(IGraphicMovement movement)
IGraphic
setMovement in interface IGraphicmovement - IGraphic.setMovement(graphics.movement.IGraphicMovement)public Dimension getDimension()
ISizeable
getDimension in interface ISizeableISizeable.getDimension()public void setDimension(Dimension d)
ISizeable
setDimension in interface ISizeabled - ISizeable.setDimension(java.awt.Dimension)public Point getCenterLocation()
CenterLocatable
getCenterLocation in interface CenterLocatableCenterLocatable.getCenterLocation()public void setCenterLocation(Point p)
CenterLocatable
setCenterLocation in interface CenterLocatablep - CenterLocatable.setCenterLocation(java.awt.Point)public Point getLocation()
ILocatable
getLocation in interface ILocatableILocatable.getLocation()public Vector move(Vector v)
ILocatable
move in interface ILocatablev -
ILocatable.move(utilities.Vector)public void setLocation(Point p)
ILocatable
setLocation in interface ILocatablep - ILocatable.setLocation(java.awt.Point)public Integer getRotation()
IRotatable
getRotation in interface IRotatableIRotatable.getRotation()public void rotate(Integer degreesToRotate)
IRotatable
rotate in interface IRotatabledegreesToRotate - IRotatable.rotate(java.lang.Integer)public void setRotation(Integer degree)
IRotatable
setRotation in interface IRotatabledegree - IRotatable.setRotation(java.lang.Integer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||