|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Motor
A basic motor with a body and a rotor
| Field Summary | |
private Rectangle |
body
Original body of the motor. |
private java.util.Vector |
children
children |
java.awt.Graphics |
graphics
Graphics context for this Geometric object. |
private Line |
new_rotor
Modified rotor of the motor to be parallel to major axis. |
private double |
relative_rotor_angle
Angle that the line from the center of the body to the tip rotor makes with the x axis. |
private Line |
rotor
Original rotor of the motor. |
private int |
rotor_length
Rotor length of the rotor. |
private Point |
tip_position
The position of the tip relative to the center of the body. |
| Constructor Summary | |
(package private) |
Motor(Rectangle body,
Line rotor)
The constructor. |
| Method Summary | |
double |
getAngle()
Returns the angle of the motor 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 Motor |
void |
paint(java.awt.Graphics g)
Draw the Motor |
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 Motor object. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Rectangle body
private Line rotor
private Line new_rotor
private int rotor_length
private double relative_rotor_angle
private Point tip_position
private java.util.Vector children
public java.awt.Graphics graphics
| Constructor Detail |
Motor(Rectangle body,
Line rotor)
| Method Detail |
public double getAngle()
public void paint()
public void paint(java.awt.Graphics g)
public void paintOriginal(java.awt.Graphics g)
public void setGraphicsContext(java.awt.Graphics g)
public java.lang.String getType()
public Rectangle getRectangularBounds()
public Polygon[] getPolygonalBoundsArray()
public java.util.Vector getChildren()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||