jdraw.jdraw
Class GraphicObject

java.lang.Object
  |
  +--jdraw.jdraw.GraphicObject
Direct Known Subclasses:
JDrawText

public class GraphicObject
extends java.lang.Object

Class GraphicObject is the class that holds a node in the Graphics List. Each node contains a Shape object, a Color object, and will ultimately hold a z-value of some sort, once I've figured out layers.


Field Summary
protected  java.awt.Color color
          A Color object holds the color value of this Graphic.
protected  java.util.Vector controlPoints
          A Vector holding all of the control Points of this.shape.
protected  int fillType
           
protected  java.awt.Shape shape
          A Shape object holds the Shape object of this Graphic.
protected  int shapeType
           
 
Constructor Summary
GraphicObject()
          Construct this with a null Shape and a null Color.
GraphicObject(java.awt.Shape s, java.awt.Color c, int f, java.util.Vector cPoints)
          Construct this with the given Shape and Color objects.
GraphicObject(java.awt.Shape s, java.awt.Color c, int f, java.util.Vector cPoints, int sType)
          Construct this with the given Shape and Color objects.
 
Method Summary
 java.awt.Color getColor()
          Returns this.color.
 java.util.Vector getControlPoints()
           
 int getFillType()
           
 java.awt.Shape getShape()
          Returns this.shape.
 int getShapeType()
           
 boolean isPointOnBorder(java.awt.Point tempPoint)
          Method isPointOnBorder(Point) returns a boolean value representing whether the paramater Point resides on the border of this.shape.
 void setColor(java.awt.Color c)
          Set this.color to the passed in Color.
 void setFillType(int fType)
           
 void setShape(java.awt.Shape s)
          Set this.shape to the passed in Shape.
 void setShapeType(int s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected java.awt.Shape shape
A Shape object holds the Shape object of this Graphic.

color

protected java.awt.Color color
A Color object holds the color value of this Graphic.

controlPoints

protected java.util.Vector controlPoints
A Vector holding all of the control Points of this.shape.

shapeType

protected int shapeType

fillType

protected int fillType
Constructor Detail

GraphicObject

public GraphicObject(java.awt.Shape s,
                     java.awt.Color c,
                     int f,
                     java.util.Vector cPoints,
                     int sType)
Construct this with the given Shape and Color objects.

GraphicObject

public GraphicObject(java.awt.Shape s,
                     java.awt.Color c,
                     int f,
                     java.util.Vector cPoints)
Construct this with the given Shape and Color objects.

GraphicObject

public GraphicObject()
Construct this with a null Shape and a null Color.
Method Detail

isPointOnBorder

public boolean isPointOnBorder(java.awt.Point tempPoint)
Method isPointOnBorder(Point) returns a boolean value representing whether the paramater Point resides on the border of this.shape. Used for selection. Currently working for: Rectangle, Line, probably polygon.. Doesn't yet work for Ellipse. can't figure out the PathIterator on it.

setShape

public void setShape(java.awt.Shape s)
Set this.shape to the passed in Shape.

setColor

public void setColor(java.awt.Color c)
Set this.color to the passed in Color.

getShape

public java.awt.Shape getShape()
Returns this.shape.

getColor

public java.awt.Color getColor()
Returns this.color.

getControlPoints

public java.util.Vector getControlPoints()

getShapeType

public int getShapeType()

setShapeType

public void setShapeType(int s)

getFillType

public int getFillType()

setFillType

public void setFillType(int fType)