jdraw.graphics
Class RectangleObject

java.lang.Object
  |
  +--jdraw.graphics.GraphicObject
        |
        +--jdraw.graphics.RectangleObject
All Implemented Interfaces:
java.io.Serializable

public class RectangleObject
extends GraphicObject

Class RectangleObject is the GraphicObject extension which holds a rectangle shape.

See Also:
Serialized Form

Field Summary
protected  java.awt.Point firstPoint
          Need a reference to the initial point.
 
Fields inherited from class jdraw.graphics.GraphicObject
arrowsOn, backgroundColor, color, controlPoints, graphicType, paint, shape, stroke
 
Constructor Summary
RectangleObject(java.awt.Color c, java.awt.Color bgc, java.util.Vector p, java.util.Vector cPoints, java.awt.BasicStroke bs)
          Construct this with the given Shape, Color, FillStyle, and ControlPoints objects.
RectangleObject(java.awt.Point pt1, java.awt.Point pt2, java.awt.Color c, java.awt.Color bgc, java.util.Vector p, java.awt.BasicStroke bs)
          Construct this with the given Points, Colors, FillStyle, BasicStroke objects.
 
Method Summary
 java.lang.Object clone()
          returns - A copy of this.
 void setControlPoints()
          Sets this.controlPoints based on the current PathIterator of this.shape.
 void setSecondPoint(java.awt.Point pt2)
          Method setSecondPoint is overwritten in EllipseObject, RectangleObject, and LineObject.
 void setShape()
          Sets this.shape based on the points currently in this.controlPoints.
 
Methods inherited from class jdraw.graphics.GraphicObject
addPoint, containedIn, deriveImage, draw, flipHorizontally, flipVertically, getBackgroundColor, getColor, getControlPoints, getGraphicType, getMaxX, getMaxY, getMinX, getMinY, getSaveBundle, getShape, getStroke, getTouchedControlPoint, isPointOnShape, rotate, setArrows, setBackgroundColor, setColor, setHorizontalCenter, setLastPoint, setMaxX, setMaxY, setMinX, setMinY, setPaint, setStroke, setVerticalCenter, translate, translateControlPoint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstPoint

protected java.awt.Point firstPoint
Need a reference to the initial point.
Constructor Detail

RectangleObject

public RectangleObject(java.awt.Color c,
                       java.awt.Color bgc,
                       java.util.Vector p,
                       java.util.Vector cPoints,
                       java.awt.BasicStroke bs)
Construct this with the given Shape, Color, FillStyle, and ControlPoints objects.
Parameters:
c - - The Color object to store in this.color.
bgc - - The Color object to store in this.backgroundColor.
p - - The Vector to store in this.paint.
cPoints - - Vector object to store in this.controlPoints.
bs - - The BasicStroke object to store in this.stroke.

RectangleObject

public RectangleObject(java.awt.Point pt1,
                       java.awt.Point pt2,
                       java.awt.Color c,
                       java.awt.Color bgc,
                       java.util.Vector p,
                       java.awt.BasicStroke bs)
Construct this with the given Points, Colors, FillStyle, BasicStroke objects.
Parameters:
pt1 - - The Point object at which to start the GeneralPath.
pt2 - - The Point object at the opposite corner of the shape from pt1
c - - The Color object to store in this.color.
bgc - - The Color object to store in this.backgroundColor.
p - - The Vector to store in this.paint.
bs - - The BasicStroke object to store in this.stroke.
Method Detail

clone

public java.lang.Object clone()
returns - A copy of this.
Overrides:
clone in class GraphicObject

setSecondPoint

public void setSecondPoint(java.awt.Point pt2)
Description copied from class: GraphicObject
Method setSecondPoint is overwritten in EllipseObject, RectangleObject, and LineObject.
Overrides:
setSecondPoint in class GraphicObject
Parameters:
pt2 - - The Point object used with firstPoint to build this.shape.

setShape

public void setShape()
Sets this.shape based on the points currently in this.controlPoints.
Overrides:
setShape in class GraphicObject

setControlPoints

public void setControlPoints()
Sets this.controlPoints based on the current PathIterator of this.shape.
Overrides:
setControlPoints in class GraphicObject