cse115.graphics
Class AbstractColorableGraphic

java.lang.Object
  extended by cse115.graphics.AbstractGraphic
      extended by cse115.graphics.AbstractColorableGraphic
All Implemented Interfaces:
CenterLocatable, Colorable, ColorableGraphic, Graphic, Locatable, Rotatable, Sizeable
Direct Known Subclasses:
Ellipse, FramedEllipse, FramedRectangle, Polygon, Rectangle, Rectangle3D

public abstract class AbstractColorableGraphic
extends AbstractGraphic
implements ColorableGraphic

Extends AbstractGraphic to add methods that are relevant to Color

Author:
Michael Kozelsky Created on: Jul 28, 2006 AbstractColorableGraphic.java

Constructor Summary
AbstractColorableGraphic()
          Creates a new instance of AbstractColorableGraphic
 
Method Summary
 Color getColor()
          Gets the Color of this Graphic
 void paint(Graphics2D gs)
          The Paint method partially overrides the superclass method to set the color of the Graphics2D object
 void setColor(Color c)
          Sets the Color of this Graphic
 
Methods inherited from class cse115.graphics.AbstractGraphic
addMouseListener, addMouseMotionListener, contains, getBounds, getCenterLocation, getContainer, getDimension, getLocation, getMouseListeners, getMouseMotionListeners, getRotation, intersects, move, rotate, setCenterLocation, setContainer, setDimension, setLocation, setRotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cse115.graphics.Graphic
actualPaint, addMouseListener, addMouseMotionListener, contains, getBounds, getMouseListeners, getMouseMotionListeners, getShape, intersects, setContainer
 
Methods inherited from interface cse115.graphics.Sizeable
getDimension, setDimension
 
Methods inherited from interface cse115.graphics.CenterLocatable
getCenterLocation, setCenterLocation
 
Methods inherited from interface cse115.graphics.Locatable
getLocation, move, setLocation
 
Methods inherited from interface cse115.graphics.Rotatable
getRotation, rotate, setRotation
 

Constructor Detail

AbstractColorableGraphic

public AbstractColorableGraphic()
Creates a new instance of AbstractColorableGraphic

Method Detail

getColor

public Color getColor()
Gets the Color of this Graphic

Specified by:
getColor in interface Colorable
Returns:
a java.awt.Color representing the color of this graphic
See Also:
Colorable.getColor()

setColor

public void setColor(Color c)
Sets the Color of this Graphic

Specified by:
setColor in interface Colorable
Parameters:
c - The Color to set the graphic to be
See Also:
Colorable.setColor(java.awt.Color)

paint

public void paint(Graphics2D gs)
The Paint method partially overrides the superclass method to set the color of the Graphics2D object

Specified by:
paint in interface Graphic
Overrides:
paint in class AbstractGraphic
Parameters:
gs - The Graphics2D object which will paint this graphic
See Also:
Graphic.paint(java.awt.Graphics2D)