|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object graphics.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(java.awt.event.MouseListener ml)
Adds a java.awt.event.MouseListener to this graphic |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener mml)
Adds a java.awt.event.MouseMotionListener to this graphic |
boolean |
contains(java.awt.Point p)
Tests to see if the given point is contained within this shape |
java.awt.Rectangle |
getBounds()
Returns the BoundingBox of this graphic |
java.awt.Point |
getCenterLocation()
Gets the Center location of this graphic |
IContainer |
getContainer()
Gets the Container of this graphic |
java.awt.Dimension |
getDimension()
Gets the dimension of this graphic |
java.awt.Point |
getLocation()
Gets the location of this graphic |
java.util.Collection<java.awt.event.MouseListener> |
getMouseListeners()
Gets all the java.awt.event.MouseListeners of this graphic |
java.util.Collection<java.awt.event.MouseMotionListener> |
getMouseMotionListeners()
Gets all the java.awt.event.MouseMotionListeners of this graphic |
IGraphicMovement |
getMovement()
Gets the current movement of the graphic |
java.lang.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(java.awt.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(java.lang.Integer degreesToRotate)
Rotates the graphic by a specific number of degrees |
void |
setCenterLocation(java.awt.Point point)
Changes the center location of this graphic |
void |
setContainer(IContainer container)
Sets the Container of this Graphic. |
void |
setDimension(java.awt.Dimension d)
Changes the Dimension of this Graphic |
void |
setLocation(java.awt.Point point)
Changes the location of this graphic |
void |
setMovement(IGraphicMovement movement)
Changes how the graphic moves |
void |
setRotation(java.lang.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 IGraphic
setContainer(IContainer container)
public void setContainer(IContainer container)
setContainer
in interface IGraphic
container
- public void paint(java.awt.Graphics2D gs)
paint
in interface IGraphic
gs
- The Graphics2D object that draws the shapes on the IContainerIGraphic.paint(java.awt.Graphics2D)
public void setDimension(java.awt.Dimension d)
setDimension
in interface ISizeable
d
- the new DimensionISizeable.setDimension(java.awt.Dimension)
,
getDimension()
public java.awt.Dimension getDimension()
getDimension
in interface ISizeable
ISizeable.getDimension()
,
setDimension(java.awt.Dimension)
public void setLocation(java.awt.Point point)
setLocation
in interface ILocatable
point
- The new location to put the graphicILocatable.setLocation(java.awt.Point)
public java.awt.Point getLocation()
getLocation
in interface ILocatable
ILocatable.getLocation()
public void setCenterLocation(java.awt.Point point)
setCenterLocation
in interface CenterLocatable
point
- the location to place the center of this graphic atCenterLocatable.setCenterLocation(java.awt.Point)
public java.awt.Point getCenterLocation()
getCenterLocation
in interface CenterLocatable
CenterLocatable.getCenterLocation()
public Vector move(Vector v)
move
in interface ILocatable
v
- The vector containing the amount to moveILocatable.move(utilities.Vector)
public void setMovement(IGraphicMovement movement)
setMovement
in interface IGraphic
movement
- IGraphic.setMovement(graphics.movement.IGraphicMovement)
public IGraphicMovement getMovement()
getMovement
in interface IGraphic
IGraphic.getMovement()
public void setRotation(java.lang.Integer degree)
setRotation
in interface IRotatable
degree
- The number of degrees to set the rotation atIRotatable.setRotation(java.lang.Integer)
public java.lang.Integer getRotation()
getRotation
in interface IRotatable
IRotatable.getRotation()
public void rotate(java.lang.Integer degreesToRotate)
rotate
in interface IRotatable
degreesToRotate
- The number of degrees to rotate this graphicIRotatable.rotate(java.lang.Integer)
public void addMouseListener(java.awt.event.MouseListener ml)
java.awt.event.MouseListener
to this graphic
addMouseListener
in interface IGraphic
ml
- IGraphic.addMouseListener(java.awt.event.MouseListener)
public java.util.Collection<java.awt.event.MouseListener> getMouseListeners()
java.awt.event.MouseListeners
of this graphic
getMouseListeners
in interface IGraphic
IGraphic.getMouseListeners()
public void addMouseMotionListener(java.awt.event.MouseMotionListener mml)
java.awt.event.MouseMotionListener
to this graphic
addMouseMotionListener
in interface IGraphic
mml
- The java.awt.event.MouseMotionListener
to add to theIGraphic.addMouseMotionListener(java.awt.event.MouseMotionListener)
public java.util.Collection<java.awt.event.MouseMotionListener> getMouseMotionListeners()
java.awt.event.MouseMotionListeners
of this graphic
getMouseMotionListeners
in interface IGraphic
IGraphic.getMouseMotionListeners()
public java.awt.Rectangle getBounds()
getBounds
in interface IGraphic
IGraphic.getBounds()
public boolean contains(java.awt.Point p)
contains
in interface IGraphic
p
- The point to test for containment
IGraphic.contains(java.awt.Point)
public boolean intersects(IGraphic g)
intersects
in interface IGraphic
g
- 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 |