All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.machines.Translator1

java.lang.Object
   |
   +----primitives.machines.Machine
           |
           +----primitives.machines.Translator1

public class Translator1
extends Machine
implements FunctionalLinkage
A class encapsulating the Translator Linkage

See Also:
Adder

Variable Index

 o activeJoint
 o anchorStr
 o def
 o heights
Stores the 2 heights of the parallograms.
 o inputs
Used to store a copy of the input location
 o inputStr
 o jointStr
 o origin
The relative origin, initialized to the location of the first anchor
 o output
Used to store a copy of the output joint location.
 o outputStr
 o parameters
 o temp
 o translator
The vector of translation

Constructor Index

 o Translator1(Point, Coordinate)

Method Index

 o forceInputJoints(Coordinate[])
 o getActiveJoint()
 o getActiveStr(int)
 o getInputJoints()
 o getOutputJoints()
 o getParameters()
 o mouseDragged(MouseEvent)
 o mouseMoved(MouseEvent)
 o redraw(Graphics)
Draws the translator linkage
 o setActiveJoint(int)
 o setInputJoints(Coordinate[])
 o setParameters(double[])

Variables

 o translator
 Coordinate translator
The vector of translation

 o output
 Coordinate output[]
Used to store a copy of the output joint location.

 o inputs
 Coordinate inputs[]
Used to store a copy of the input location

 o heights
 double heights[]
Stores the 2 heights of the parallograms.

 o origin
 Point origin
The relative origin, initialized to the location of the first anchor

 o parameters
 double parameters[]
 o activeJoint
 int activeJoint
 o temp
 Coordinate temp
 o jointStr
 static final String jointStr
 o inputStr
 static final String inputStr
 o anchorStr
 static final String anchorStr
 o outputStr
 static final String outputStr
 o def
 static final String def

Constructors

 o Translator1
 public Translator1(Point startPoint,
                    Coordinate translator)
Parameters:
startPoint - the location of the first anchor.
translator - the translaton vetor in polar coordinates

Methods

 o forceInputJoints
 public Coordinate[] forceInputJoints(Coordinate inputs[])
Parameters:
inputs - the first member of the array is used to force the location of the input joint.
Returns:
a 1 size array containing the location of the output joint.
See Also:
FunctionalLinkage
 o setInputJoints
 public Coordinate[] setInputJoints(Coordinate inputJoints[]) throws MachineException
Parameters:
inputJoints - the location of the input joint is set to the first member of this array
Throws: MachineException
if the new locations for the input joint is not valid.
See Also:
FunctionalLinkage
 o getOutputJoints
 public Coordinate[] getOutputJoints()
See Also:
FunctionalLinkage
 o getInputJoints
 public Coordinate[] getInputJoints()
See Also:
FunctionalLinkage
 o redraw
 public void redraw(Graphics g)
Draws the translator linkage

Parameters:
g - the graphic context to draw to
Overrides:
redraw in class Machine
 o getParameters
 public double[] getParameters()
Returns:
the 2 heights of the parallograms, the modul and argument of the translator vector.
See Also:
FunctionalLinkage
 o setParameters
 public void setParameters(double parameters[]) throws MachineException
Parameters:
parameters - see getParameters for the list of parameters
Throws: MachineException
if the modul of the vector or one of the heights of the parallograms is less then 10 pixels.
See Also:
FunctionalLinkage
 o mouseMoved
 public int mouseMoved(MouseEvent m)
See Also:
FunctionalLinkage
 o mouseDragged
 public void mouseDragged(MouseEvent m) throws MachineException
Throws: MachineException
if the new location of the active joint is not valid
See Also:
FunctionalLinkage
 o getActiveStr
 public String getActiveStr(int activeJoint)
See Also:
FunctionalLinkage
 o getActiveJoint
 public int getActiveJoint()
See Also:
FunctionalLinkage
 o setActiveJoint
 public void setActiveJoint(int activeJoint)
See Also:
FunctionalLinkage

All Packages  Class Hierarchy  This Package  Previous  Next  Index