edu.mit.sketch.grammar.me
Class Shade

java.lang.Object
  |
  +--edu.mit.sketch.geom.Rectangle
        |
        +--edu.mit.sketch.grammar.me.Shade
All Implemented Interfaces:
GeometricObject, Paintable, Rotatable, SequenceTerminal, Serializable, Terminal, Translatable

public class Shade
extends Rectangle
implements SequenceTerminal, Serializable

This class represents a line described by its end-points p, q.

See Also:
Serialized Form

Field Summary
 Vector lines
          Lines that formed this Shade.
 int shades
          Number of shades to draw.
 
Fields inherited from class edu.mit.sketch.geom.Rectangle
graphics, time_stamp, x, y
 
Fields inherited from interface edu.mit.sketch.geom.GeometricObject
CIRCLE, ELLIPSE, LINE, POINT, POLYGON, RECTANGLE, SQUARE
 
Constructor Summary
Shade(Vector input_lines)
          The constructor.
 
Method Summary
 double getAngle()
          Returns the angle of the object WRT the x axis in radians.
 Rectangle getRectangularBounds()
          Supplied for completeness.
 long getTimeStamp()
          Returns the time stamp of the current Terminal
 String getType()
          Implement GeometricObject
 void paint()
          Draw the object
 void paint(Graphics g)
          Draw the object
 void paintOriginal(Graphics g)
          This method is used to paint the original data points that forms this GeometricObject
 boolean pointIsOn(Point point, int radius)
          Returns true if the point is within +-radius distance from the curve defining the object.
 void setTimeStamp(long time_stamp)
          Sets the time stamp of the current Terminal
 String toString()
          Override toString
 void translate(double x, double y)
          Add the arguments to the (x, y) position of the object.
 
Methods inherited from class edu.mit.sketch.geom.Rectangle
area, containsGeometricObject, containsGeometricObjects, getCenter, getDataPoints, getHeight, getMajorAxisAngle, getMajorAxisDirection, getMajorAxisLength, getMinorAxisAngle, getMinorAxisLength, getPolygonalBounds, getWidth, hasOnMajorAxisDirection, isRectangle, paint, pointIsOnOriginal, rotateAbout, scaleAboutCenter, setDataPoints, setGraphicsContext, setRectangle, shade, shade, spatialRelation, spatialRelation, spatialRelationCartesian, touches, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.mit.sketch.ui.Paintable
setGraphicsContext
 

Field Detail

lines

public Vector lines
Lines that formed this Shade.

shades

public int shades
Number of shades to draw.
Constructor Detail

Shade

public Shade(Vector input_lines)
The constructor.
Method Detail

getType

public String getType()
Implement GeometricObject
Specified by:
getType in interface Paintable
Overrides:
getType in class Rectangle

toString

public String toString()
Override toString
Overrides:
toString in class Rectangle

paint

public void paint()
Draw the object
Specified by:
paint in interface Paintable
Overrides:
paint in class Rectangle

paint

public void paint(Graphics g)
Draw the object
Specified by:
paint in interface Paintable
Overrides:
paint in class Rectangle

paintOriginal

public void paintOriginal(Graphics g)
This method is used to paint the original data points that forms this GeometricObject
Specified by:
paintOriginal in interface Paintable
Overrides:
paintOriginal in class Rectangle

pointIsOn

public boolean pointIsOn(Point point,
                         int radius)
Returns true if the point is within +-radius distance from the curve defining the object. Returns false o/w.
Overrides:
pointIsOn in class Rectangle

getRectangularBounds

public Rectangle getRectangularBounds()
Supplied for completeness.
Overrides:
getRectangularBounds in class Rectangle

getAngle

public double getAngle()
Returns the angle of the object WRT the x axis in radians.
Overrides:
getAngle in class Rectangle

setTimeStamp

public void setTimeStamp(long time_stamp)
Sets the time stamp of the current Terminal
Specified by:
setTimeStamp in interface Terminal
Overrides:
setTimeStamp in class Rectangle

getTimeStamp

public long getTimeStamp()
Returns the time stamp of the current Terminal
Specified by:
getTimeStamp in interface Terminal
Overrides:
getTimeStamp in class Rectangle

translate

public void translate(double x,
                      double y)
Add the arguments to the (x, y) position of the object.
Overrides:
translate in class Rectangle