All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.machines.ScalarMultiplier1

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

public class ScalarMultiplier1
extends Machine
implements FunctionalLinkage
A class encapsulating a Pantograph linkage.

See Also:
FunctionalLinkage, Adder, TranslatorApplet

Variable Index

 o activeJoint
 o d
 o def
 o fixed
Determines if this object should have 2 input joints or one anchor pinned at relative(0,0)
 o input1
 o input2
 o inputs
 o inputStr
 o joint5Str1
 o joint5Str2
 o lamda
The scalar multiplication parameter
 o origin
The relative origin
 o output
 o outputs
 o outputStr
 o parameters
 o sBar
 o scalar
The parameter used by the machine for computing its state.
 o setStr
 o tBar
 o temp

Constructor Index

 o ScalarMultiplier1(Rectangle, double, boolean)

Method Index

 o forceInputJoints(Coordinate[])
 o getActiveJoint()
 o getActiveStr(int)
 o getAnnolus()
 o getInputJoints()
 o getOutputJoints()
 o getParameters()
 o mouseDragged(MouseEvent)
Process a a change according to the activeJoint (a joint the mouse pointer is over).
 o mouseMoved(MouseEvent)
 o redraw(Graphics)
Drawing the pantoghraph
 o setActiveJoint(int)
 o setInputJoints(Coordinate[])
 o setParameters(double[])
 o setScalar(double)
Used to translate between the parameter used by the object (allways >1) and the scalar used to compute the output joint location.

Variables

 o scalar
 double scalar
The parameter used by the machine for computing its state. scalar is allways >1

See Also:
lamda
 o lamda
 double lamda
The scalar multiplication parameter

 o tBar
 double tBar
 o sBar
 double sBar
 o output
 int output
 o input1
 int input1
 o input2
 int input2
 o fixed
 boolean fixed
Determines if this object should have 2 input joints or one anchor pinned at relative(0,0)

 o d
 Rectangle d
 o origin
 Point origin
The relative origin

 o outputs
 Coordinate outputs[]
 o inputs
 Coordinate inputs[]
 o parameters
 double parameters[]
 o activeJoint
 int activeJoint
 o temp
 Coordinate temp
 o outputStr
 static final String outputStr
 o inputStr
 static final String inputStr
 o setStr
 static final String setStr
 o joint5Str1
 static final String joint5Str1
 o joint5Str2
 static final String joint5Str2
 o def
 static final String def

Constructors

 o ScalarMultiplier1
 public ScalarMultiplier1(Rectangle d,
                          double scalar,
                          boolean fixed)
Parameters:
d - the relative rectangle the Pantograh should be drawn in. The origin is set to the middle of this rectangle.
scalar - the parameter of multiplication.
fixed - Determines if this object should have 2 input joints or one anchor pinned at relative(0,0).

Methods

 o setScalar
 void setScalar(double scalar)
Used to translate between the parameter used by the object (allways >1) and the scalar used to compute the output joint location. the translation is done by setting different input joints.

Parameters:
scalar - the new scalar to set to.
See Also:
scalar
 o forceInputJoints
 public Coordinate[] forceInputJoints(Coordinate inputs[])
Parameters:
inputs - an array of 2 Coordinate objects. If the Pantograph is fixed the first location is overlooked.
Returns:
a one size array containing the location of the output joint.
See Also:
FunctionalLinkage
 o setInputJoints
 public Coordinate[] setInputJoints(Coordinate inputJoints[]) throws MachineException
Parameters:
inputJoints - an array of 2 Coordinate objects. If the Pantograph is fixed the first location is overlooked.
Throws: MachineException
if the new input location is not valid.
See Also:
FunctionalLinkage
 o getInputJoints
 public Coordinate[] getInputJoints()
See Also:
FunctionalLinkage
 o getOutputJoints
 public Coordinate[] getOutputJoints()
See Also:
FunctionalLinkage
 o redraw
 public void redraw(Graphics g)
Drawing the pantoghraph

Parameters:
g - the graphic context to draw to.
Overrides:
redraw in class Machine
 o getParameters
 public double[] getParameters()
See Also:
lamda, scalar
 o setParameters
 public void setParameters(double parameters[]) throws MachineException
Parameters:
parameters - the first member of this array should specify the new scalar
Throws: MachineException
if the new current location of the input joints is not valid with the new paraeters.
See Also:
FunctionalLinkage
 o mouseMoved
 public int mouseMoved(MouseEvent m)
See Also:
FunctionalLinkage
 o mouseDragged
 public void mouseDragged(MouseEvent m) throws MachineException
Process a a change according to the activeJoint (a joint the mouse pointer is over).

Throws: MachineException
.
See Also:
FunctionalLinkage
 o getAnnolus
 double[] getAnnolus()
Returns:
the annolus of input domain
 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