|
||||||||||
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(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 |
Integer |
getRotation()
Gets the current rotation of this graphic |
boolean |
intersects(IGraphic g)
In Beta Testing 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)
Sets the movement of the Graphic. |
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 IGraphic
setContainer(IContainer container)
public void setContainer(IContainer container)
setContainer
in interface IGraphic
container
- public void paint(Graphics2D gs)
paint
in interface IGraphic
gs
- The Graphics2D object that draws the shapes on the IContainerIGraphic.paint(java.awt.Graphics2D)
public void setDimension(Dimension d)
setDimension
in interface ISizeable
d
- the new DimensionISizeable.setDimension(java.awt.Dimension)
,
getDimension()
public Dimension getDimension()
getDimension
in interface ISizeable
ISizeable.getDimension()
,
setDimension(java.awt.Dimension)
public void setLocation(Point point)
setLocation
in interface ILocatable
point
- The new location to put the graphicILocatable.setLocation(java.awt.Point)
public Point getLocation()
getLocation
in interface ILocatable
ILocatable.getLocation()
public void setCenterLocation(Point point)
setCenterLocation
in interface CenterLocatable
point
- the location to place the center of this graphic atCenterLocatable.setCenterLocation(java.awt.Point)
public 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)
IGraphic
setMovement
in interface IGraphic
movement
- IGraphic.setMovement(graphics.movement.IGraphicMovement)
public void setRotation(Integer degree)
setRotation
in interface IRotatable
degree
- The number of degrees to set the rotation atIRotatable.setRotation(java.lang.Integer)
public Integer getRotation()
getRotation
in interface IRotatable
IRotatable.getRotation()
public void rotate(Integer degreesToRotate)
rotate
in interface IRotatable
degreesToRotate
- 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 IGraphic
ml
- IGraphic.addMouseListener(java.awt.event.MouseListener)
public Collection<MouseListener> getMouseListeners()
java.awt.event.MouseListeners
of this graphic
getMouseListeners
in interface IGraphic
IGraphic.getMouseListeners()
public void addMouseMotionListener(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 Collection<MouseMotionListener> getMouseMotionListeners()
java.awt.event.MouseMotionListeners
of this graphic
getMouseMotionListeners
in interface IGraphic
IGraphic.getMouseMotionListeners()
public Rectangle getBounds()
getBounds
in interface IGraphic
IGraphic.getBounds()
public boolean contains(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 |