All Packages Class Hierarchy This Package Previous Next Index
Class primitives.machines.StraightLineMachine
java.lang.Object
|
+----primitives.machines.StraightLineMachine
- public class StraightLineMachine
- extends Object
- implements MachineListener
A class defining a Peacullier Linkage used by
StraightLineDemo
-
alpha
-
-
bigCenter
-
-
centralJoint
-
-
d
-
-
dcentralJoint
-
-
demo
-
-
doutputJoint
-
-
dradialJoints
-
-
leader
-
-
leaderJoint
-
-
line
-
-
outputJoint
-
-
p
-
-
r
-
-
radialJoints
-
-
reachedEnd
-
-
smallCenter
-
-
temp
-
-
tempPoints
-
-
x
-
-
y
-
-
StraightLineMachine(Dimension, boolean)
-
-
drawLine(Graphics, Point, Point)
-
-
finalize()
- Sets object fields to null.
-
moveMachine(double)
- preforms a motion of the machine
-
redraw(Graphics)
- Redraws the machine.
-
restorePoints()
- restores to the last valid state of the machine in case
the current state is not valid.
-
savePoints()
- preform backup of last valid state incase next step is not legal.
-
switchLeader()
- switches between 2 supporting joints.
bigCenter
public ExtPoint bigCenter
smallCenter
public ExtPoint smallCenter
radialJoints
public ExtPoint radialJoints[]
dradialJoints
private Coordinate dradialJoints[]
outputJoint
public ExtPoint outputJoint
doutputJoint
private Coordinate doutputJoint
centralJoint
public ExtPoint centralJoint
dcentralJoint
private Coordinate dcentralJoint
y
public double y
x
public double x
r
public int r
alpha
public double alpha
line
public int line
leader
public Coordinate leader
d
private Dimension d
demo
private boolean demo
leaderJoint
public int leaderJoint
tempPoints
private Coordinate tempPoints[]
temp
private Coordinate temp
reachedEnd
static final String reachedEnd
p
static final String p
StraightLineMachine
public StraightLineMachine(Dimension d,
boolean demo)
- Parameters:
- d - the size of the rectangle in which to draw the machine.
- demo - if false draws circles and straight line of various joints.
finalize
public void finalize() throws Throwable
- Sets object fields to null.
- Throws: Throwable
- .
- Overrides:
- finalize in class Object
savePoints
private void savePoints()
- preform backup of last valid state incase next step is not legal.
restorePoints
private void restorePoints()
- restores to the last valid state of the machine in case
the current state is not valid.
switchLeader
public double switchLeader()
- switches between 2 supporting joints.
this is done in order to keep a well behaved motion
without changing the moveMachine method to be based on the current
state of the machine.
- Returns:
- the current angle of the straight motion joint
moveMachine
public void moveMachine(double alpha) throws MachineException
- preforms a motion of the machine
- Parameters:
- alpha - the angle to move the leader joint to.
- Throws: MachineException
- if the move is not valid.
drawLine
private void drawLine(Graphics g,
Point p1,
Point p2)
redraw
public void redraw(Graphics g)
- Redraws the machine.
If
demo
is set to true, blue circles and black line of motion
of the various joint are also drawn.
- Parameters:
- g - the graphic context to draw to.
All Packages Class Hierarchy This Package Previous Next Index