All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.machines.TwoArmsMachine

java.lang.Object
   |
   +----primitives.machines.Machine
           |
           +----primitives.machines.NarmsMachine
                   |
                   +----primitives.machines.TwoArmsMachine

public class TwoArmsMachine
extends NarmsMachine
Class used to control the motion of a 2-arms machine. Used by the TwoArmsSpaceDemo applet.

See Also:
TwoArmsSpaceDemo

Variable Index

 o angles
The limit angles of motion [should be private]

Constructor Index

 o TwoArmsMachine(Dimension, double, int)
initializes the machines and checks the limit angles of its motion.

Method Index

 o finalize()
 o redraw(Graphics)
draws the machine using a specified graphic context.
 o rotateJoint(int, double)
rotates the central joint relative to a given periferial joint.

Variables

 o angles
 public double angles[]
The limit angles of motion [should be private]

Constructors

 o TwoArmsMachine
 public TwoArmsMachine(Dimension d,
                       double ratio,
                       int i)
initializes the machines and checks the limit angles of its motion.

Parameters:
d - the size of the rectangle the machine should be drawn in.
ratio - see Machine
i - the arm to rotate 0 or 1.

Methods

 o rotateJoint
 public void rotateJoint(int i,
                         double dalpha) throws MachineException
rotates the central joint relative to a given periferial joint.

Parameters:
i - the relative joint to use.
dalpha - the amount in radians to rotate.
Throws: MachineException
if the rotation is nt pysically possible.
See Also:
rotateJoint
 o redraw
 public void redraw(Graphics g)
draws the machine using a specified graphic context.

Parameters:
g - the graphic context to draw to.
Overrides:
redraw in class NarmsMachine
See Also:
MachineListener
 o finalize
 public void finalize() throws Throwable
Throws: Throwable
.
Overrides:
finalize in class NarmsMachine

All Packages  Class Hierarchy  This Package  Previous  Next  Index