Class Spring

java.lang.Object
  |
  +--Rectangle
        |
        +--Spring

class Spring
extends Rectangle

A basic Spring


Field Summary
(package private)  Line end_points
          End points of the spring stored in a line.
(package private)  int loops
          The number of loops that the spring makes.
(package private)  Polygon polygon
          The polygon that was used to construct the spring.
 
Fields inherited from class Rectangle
angle, graphics, height, height_x, height_y, points, time_stamp, width, width_x, width_y, x, y
 
Constructor Summary
(package private) Spring(Polygon polygon)
          The constructor constructs a spring that is approximated by the input polygon.
 
Method Summary
 Rectangle getRectangularBounds()
          This method should return the Rectangular bounds of this non-terminal object.
 java.lang.String getType()
          Implement Paintable
static boolean isSpring(Polygon polygon)
          Returns true if the input polygon looks like a Spring.
 void paint()
          Draw the Spring
 void paint(java.awt.Graphics g)
          Draw the Spring Can be made faster by incrementing theta in larger chunks.
 void paintOriginal(java.awt.Graphics g)
          This method is used to paint the original data points that forms this GeometricObject
 void setGraphicsContext(java.awt.Graphics g)
          Set graphics context for this Pin object.
 
Methods inherited from class Rectangle
area, containsGeometricObject, containsGeometricObjects, getAngle, getCenter, getDataPoints, getHeight, getMajorAxisAngle, getMajorAxisDirection, getMajorAxisLength, getMinorAxisAngle, getMinorAxisLength, getPolygonalBounds, getTimeStamp, getWidth, hasOnMajorAxisDirection, isRectangle, paint, pointIsOn, pointIsOnOriginal, rotateAbout, scaleAboutCenter, setDataPoints, setRectangle, setTimeStamp, shade, shade, spatialRelation, spatialRelation, spatialRelationCartesian, toString, touches, union
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

loops

int loops
The number of loops that the spring makes.

polygon

Polygon polygon
The polygon that was used to construct the spring.

end_points

Line end_points
End points of the spring stored in a line.
Constructor Detail

Spring

Spring(Polygon polygon)
The constructor constructs a spring that is approximated by the input polygon.
Method Detail

paint

public void paint()
Draw the Spring
Overrides:
paint in class Rectangle

isSpring

public static boolean isSpring(Polygon polygon)
Returns true if the input polygon looks like a Spring.

paint

public void paint(java.awt.Graphics g)
Draw the Spring Can be made faster by incrementing theta in larger chunks.
Overrides:
paint in class Rectangle

setGraphicsContext

public void setGraphicsContext(java.awt.Graphics g)
Set graphics context for this Pin object. Must be set at least once before doing any drawing.
Overrides:
setGraphicsContext in class Rectangle

getType

public java.lang.String getType()
Implement Paintable
Overrides:
getType in class Rectangle

paintOriginal

public void paintOriginal(java.awt.Graphics g)
This method is used to paint the original data points that forms this GeometricObject
Overrides:
paintOriginal in class Rectangle

getRectangularBounds

public Rectangle getRectangularBounds()
This method should return the Rectangular bounds of this non-terminal object.
Overrides:
getRectangularBounds in class Rectangle