Class Ground

java.lang.Object
  |
  +--Ground

class Ground
extends java.lang.Object
implements Rotatable, NonTerminal

A basic Ground object with shading and edges.


Field Summary
private  java.util.Vector children
          children
private  Polygon edge
          Original edge of the ground object.
 java.awt.Graphics graphics
          Graphics context for this Geometric object.
private  Polygon new_edge
          Modified edge.
private  Shade shade
          Original body of the shade.
 
Constructor Summary
(package private) Ground(Shade shade, Polygon edge)
          The constructor.
 
Method Summary
 double getAngle()
          Returns the angle of the Ground WRT the x axis in radians.
 java.util.Vector getChildren()
          This method should return a vector containing the children of this object.
 Polygon[] getPolygonalBoundsArray()
          This method should return the polygonal array bounds of this non-terminal object.
 Rectangle getRectangularBounds()
          This method should return the Rectangular bounds of this non-terminal object.
 java.lang.String getType()
          Implement Paintable
 void paint()
          Draw the Ground
 void paint(java.awt.Graphics g)
          Draw the Ground
 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 Ground object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

shade

private Shade shade
Original body of the shade.

edge

private Polygon edge
Original edge of the ground object.

new_edge

private Polygon new_edge
Modified edge.

children

private java.util.Vector children
children

graphics

public java.awt.Graphics graphics
Graphics context for this Geometric object.
Constructor Detail

Ground

Ground(Shade shade,
       Polygon edge)
The constructor.
Method Detail

getAngle

public double getAngle()
Returns the angle of the Ground WRT the x axis in radians.
Specified by:
getAngle in interface Rotatable

paint

public void paint()
Draw the Ground

paint

public void paint(java.awt.Graphics g)
Draw the Ground

paintOriginal

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

setGraphicsContext

public void setGraphicsContext(java.awt.Graphics g)
Set graphics context for this Ground object. Must be set at least once before doing any drawing.

getType

public java.lang.String getType()
Implement Paintable

getRectangularBounds

public Rectangle getRectangularBounds()
This method should return the Rectangular bounds of this non-terminal object.
Specified by:
getRectangularBounds in interface NonTerminal

getPolygonalBoundsArray

public Polygon[] getPolygonalBoundsArray()
This method should return the polygonal array bounds of this non-terminal object. This is a rough approximation of the constituents of the object.
Specified by:
getPolygonalBoundsArray in interface NonTerminal

getChildren

public java.util.Vector getChildren()
This method should return a vector containing the children of this object. Children are the Terminal or NonTerminal constituents of this object.
Specified by:
getChildren in interface NonTerminal