|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgraphics.AbstractGraphic
public abstract class AbstractGraphic
An abstract class that is the superclass for most graphics. Defines most capabilities that are shared among all Graphic shapes
| Constructor Summary | |
|---|---|
AbstractGraphic()
Creates a new instance of AbstractGraphic with a default size (0,0); location (0,0); and rotation (0) |
|
| Method Summary | |
|---|---|
void |
addMouseListener(MouseListener ml)
Adds a java.awt.event.MouseListener to this graphic |
void |
addMouseMotionListener(MouseMotionListener mml)
Adds a java.awt.event.MouseMotionListener to this graphic |
boolean |
contains(Point p)
Tests to see if the given point is contained within this shape |
Rectangle |
getBounds()
Returns the BoundingBox of this graphic |
Point |
getCenterLocation()
Gets the Center location of this graphic |
IContainer |
getContainer()
Gets the Container of this graphic |
Dimension |
getDimension()
Gets the dimension of this graphic |
Point |
getLocation()
Gets the location of this graphic |
Collection<MouseListener> |
getMouseListeners()
Gets all the java.awt.event.MouseListeners of this graphic |
Collection<MouseMotionListener> |
getMouseMotionListeners()
Gets all the java.awt.event.MouseMotionListeners of this graphic |
IGraphicMovement |
getMovement()
Gets the current movement of the graphic |
Integer |
getRotation()
Gets the current rotation of this graphic |
boolean |
intersects(IGraphic g)
Tests to see if two Graphics intersect with each other. |
Vector |
move(Vector v)
Moves the Graphic by a certain vector, according to it's current MovementBehavior |
void |
paint(Graphics2D gs)
This gets the concrete subclasses ready to do the actual painting - it figures out a rotation, then delegates the drawing to the specific subclass |
void |
rotate(Integer degreesToRotate)
Rotates the graphic by a specific number of degrees |
void |
setCenterLocation(Point point)
Changes the center location of this graphic |
void |
setContainer(IContainer container)
Sets the Container of this Graphic. |
void |
setDimension(Dimension d)
Changes the Dimension of this Graphic |
void |
setLocation(Point point)
Changes the location of this graphic |
void |
setMovement(IGraphicMovement movement)
Changes how the graphic moves |
void |
setRotation(Integer degree)
Changes the rotation of this graphic. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface graphics.IGraphic |
|---|
actualPaint, getShape |
| Constructor Detail |
|---|
public AbstractGraphic()
| Method Detail |
|---|
public IContainer getContainer()
getContainer in interface IGraphicsetContainer(IContainer container)public void setContainer(IContainer container)
setContainer in interface IGraphiccontainer - public void paint(Graphics2D gs)
paint in interface IGraphicgs - The Graphics2D object that draws the shapes on the IContainerIGraphic.paint(java.awt.Graphics2D)public void setDimension(Dimension d)
setDimension in interface ISizeabled - the new DimensionISizeable.setDimension(java.awt.Dimension),
getDimension()public Dimension getDimension()
getDimension in interface ISizeableISizeable.getDimension(),
setDimension(java.awt.Dimension)public void setLocation(Point point)
setLocation in interface ILocatablepoint - The new location to put the graphicILocatable.setLocation(java.awt.Point)public Point getLocation()
getLocation in interface ILocatableILocatable.getLocation()public void setCenterLocation(Point point)
setCenterLocation in interface CenterLocatablepoint - the location to place the center of this graphic atCenterLocatable.setCenterLocation(java.awt.Point)public Point getCenterLocation()
getCenterLocation in interface CenterLocatableCenterLocatable.getCenterLocation()public Vector move(Vector v)
move in interface ILocatablev - The vector containing the amount to moveILocatable.move(utilities.Vector)public void setMovement(IGraphicMovement movement)
setMovement in interface IGraphicmovement - IGraphic.setMovement(graphics.movement.IGraphicMovement)public IGraphicMovement getMovement()
getMovement in interface IGraphicIGraphic.getMovement()public void setRotation(Integer degree)
setRotation in interface IRotatabledegree - The number of degrees to set the rotation atIRotatable.setRotation(java.lang.Integer)public Integer getRotation()
getRotation in interface IRotatableIRotatable.getRotation()public void rotate(Integer degreesToRotate)
rotate in interface IRotatabledegreesToRotate - The number of degrees to rotate this graphicIRotatable.rotate(java.lang.Integer)public void addMouseListener(MouseListener ml)
java.awt.event.MouseListener to this graphic
addMouseListener in interface IGraphicml - IGraphic.addMouseListener(java.awt.event.MouseListener)public Collection<MouseListener> getMouseListeners()
java.awt.event.MouseListeners of this graphic
getMouseListeners in interface IGraphicIGraphic.getMouseListeners()public void addMouseMotionListener(MouseMotionListener mml)
java.awt.event.MouseMotionListener to this graphic
addMouseMotionListener in interface IGraphicmml - The java.awt.event.MouseMotionListener to add to theIGraphic.addMouseMotionListener(java.awt.event.MouseMotionListener)public Collection<MouseMotionListener> getMouseMotionListeners()
java.awt.event.MouseMotionListeners of this graphic
getMouseMotionListeners in interface IGraphicIGraphic.getMouseMotionListeners()public Rectangle getBounds()
getBounds in interface IGraphicIGraphic.getBounds()public boolean contains(Point p)
contains in interface IGraphicp - The point to test for containment
IGraphic.contains(java.awt.Point)public boolean intersects(IGraphic g)
intersects in interface IGraphicg - the graphic to test for intersection
IGraphic.intersects(graphics.IGraphic)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||