|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwheelsunh.etc.AbstractGraphic
wheelsunh.users.AbstractShape
wheelsunh.users.Shape
wheelsunh.users.RectangularShape
public abstract class RectangularShape
Superclass for all Shapes that can be described in terms of rectangular dimensions (ellipse, rectangle, etc.).
Field Summary |
---|
Fields inherited from class wheelsunh.users.Shape |
---|
_c, _dp, _shape, DEFAULT_COLOR |
Fields inherited from class wheelsunh.users.AbstractShape |
---|
_rot |
Constructor Summary | |
---|---|
RectangularShape(java.awt.geom.RectangularShape s)
The default constructor will draw the shape in the center of the wheelsunh.users.Frame's DrawingPanel, with dimension DEFAULT_WIDTH x DEFAULT_HEIGHT and color DEFAULT_COLOR. |
|
RectangularShape(java.awt.geom.RectangularShape s,
java.awt.Color c)
Draws new shape in the wheelsunh.users.Frame's DrawingPanel with default dimensions and location, and color set to the passed-in color. |
|
RectangularShape(java.awt.geom.RectangularShape s,
DrawingPanel dp)
Constructs a rectagular shape with the passed-in properties. |
|
RectangularShape(java.awt.geom.RectangularShape s,
int degrees)
Draws new shape with default location, color, and dimension in the wheelsunh.users.DrawingPanel, at a rotation of degrees. |
|
RectangularShape(java.awt.geom.RectangularShape s,
int x,
int y)
Draws new shape in the wheelsunh.users.Frame's DrawingPanel with default color and location, and location set to the passed-in values. |
Method Summary | |
---|---|
void |
actualPaint(java.awt.Graphics2D g)
Overrides actualPaint to paint a frame and fill with the specified colors. |
java.awt.Rectangle |
getBounds()
Overrides the getBounds method of Shape to account for the shape's frame. |
java.awt.Color |
getFillColor()
Returns the shape's fill color. |
java.awt.Color |
getFrameColor()
Returns the color of the shape's frame. |
int |
getFrameThickness()
Returns the thickness of the frame's stroke. |
int |
getHeight()
Returns the shape's height. |
java.awt.Point |
getLocation()
Returns the shape's location. |
java.awt.Dimension |
getSize()
Returns the shape's dimensions. |
int |
getWidth()
Returns the shape's width. |
int |
getXLocation()
Returns the x value of the shape's location. |
int |
getYLocation()
Returns the y value of the shape's location. |
void |
setColor(java.awt.Color c)
Overridden to set the color of the shape's frame and fill. |
void |
setFillColor(java.awt.Color c)
Sets the color of the shape's fill. |
void |
setFrameColor(java.awt.Color c)
Sets the color of the shape's frame. |
void |
setFrameThickness(int thickness)
Sets the thickness of the frame's stroke. |
void |
setLocation(int x,
int y)
Set the location of the upper-left corner of the shape's bounding box. |
void |
setLocation(java.awt.Point p)
Set the location of the upper-left corner of the shape's bounding box. |
void |
setSize(java.awt.Dimension d)
Set the dimension of the shape. |
void |
setSize(int width,
int height)
Set the dimension of the shape. |
Methods inherited from class wheelsunh.users.Shape |
---|
contains, getColor, getRotation, hide, paint, setRotation, show |
Methods inherited from class wheelsunh.users.AbstractShape |
---|
boundsIntersects, center, distance, getCenter, getCenterX, getCenterY, getIntersection, intersects, intersects, setCenter |
Methods inherited from class wheelsunh.etc.AbstractGraphic |
---|
mouseClicked, mouseDragged, mousePressed, mouseReleased |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface wheelsunh.Colorable |
---|
getColor |
Constructor Detail |
---|
public RectangularShape(java.awt.geom.RectangularShape s)
public RectangularShape(java.awt.geom.RectangularShape s, java.awt.Color c)
public RectangularShape(java.awt.geom.RectangularShape s, int x, int y)
public RectangularShape(java.awt.geom.RectangularShape s, int degrees)
public RectangularShape(java.awt.geom.RectangularShape s, DrawingPanel dp)
Method Detail |
---|
public void actualPaint(java.awt.Graphics2D g)
actualPaint
in class Shape
g
- the instance of java.awt.Graphics2D
that should
be used to paint the shapepublic void setColor(java.awt.Color c)
setColor
in interface Colorable
setColor
in class Shape
public void setFrameColor(java.awt.Color c)
setFrameColor
in interface AdvancedColorable
public java.awt.Color getFrameColor()
getFrameColor
in interface AdvancedColorable
public void setFillColor(java.awt.Color c)
setFillColor
in interface AdvancedColorable
public java.awt.Color getFillColor()
getFillColor
in interface AdvancedColorable
public void setFrameThickness(int thickness)
public int getFrameThickness()
public void setLocation(int x, int y)
setLocation
in interface Locatable
setLocation
in class Shape
public void setLocation(java.awt.Point p)
setLocation
in interface Locatable
setLocation
in class Shape
public java.awt.Point getLocation()
getLocation
in interface Locatable
getLocation
in class Shape
public int getXLocation()
getXLocation
in interface Locatable
getXLocation
in class Shape
public int getYLocation()
getYLocation
in interface Locatable
getYLocation
in class Shape
public void setSize(int width, int height)
setSize
in interface Sizeable
public void setSize(java.awt.Dimension d)
setSize
in interface Sizeable
public java.awt.Dimension getSize()
getSize
in interface Sizeable
public int getWidth()
getWidth
in interface Sizeable
getWidth
in class AbstractShape
public int getHeight()
getHeight
in interface Sizeable
getHeight
in class AbstractShape
public java.awt.Rectangle getBounds()
getBounds
in class Shape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |