jscicalc.graph.Locus Class Reference

This class represents the locus of an OObject (usually as a graph y=f(x)). More...

Inheritance diagram for jscicalc.graph.Locus:

jscicalc.graph.Element
Collaboration diagram for jscicalc.graph.Locus:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Locus (final OObject oobject, View view)
 Construct the locus from an OObject, Model and View.
void setup (View view)
 Set or reset the information required.
void run ()
 Takes a view and updates the path from it using the OObject belonging to this.
void updatePath ()
 Update the path.
void stop ()
 Stop the thread as soon as possible.
void draw (Model model, View view, java.awt.Graphics2D graphics2d)
 Draw the element on the view using the graphics object supplied.

Protected Member Functions

OObject substitute (double x)
 Set substitution to variable = x.
double function (double x, Transformation t)
 Get value of function at x if it is real and NaN otherwise.

Protected Attributes

jscicalc.Substitution substitution
 We use substitution to substitute values for x.

Static Protected Attributes

static final
jscicalc.expression.Variable 
variable = new jscicalc.expression.Variable( new jscicalc.pobject.Variable( 'x' ) )
 We substitute for variable x: so we need a variable.
static final double epsilon = 1e-32
 Limit point at which imaginary part is considered zero.
static final double delta = 1e-8
 Limit point for x distances.

Package Functions

double increment ()
 Get incrementValue.

Package Attributes

java.util.concurrent.atomic.AtomicBoolean restart
 Flag to indicate that an update should restart as soon as possible.

Private Attributes

double incrementValue = 10
 The standard x increment (in view) for this locus.
double distance = 16
 The minimum distance between points.
final OObject oobject
 The OObject represented by this locus.
java.awt.geom.Path2D.Double path
 A path representing this locus.
View view
 Used for finding the View.
Thread thread
 Set thread to null to terminate it.
Object lock
 Used to lock threads.

Classes

class  FindResult
 Internal class used by find() functions. More...


Detailed Description

This class represents the locus of an OObject (usually as a graph y=f(x)).

Author:
J. D. Lamb
Version:
Revision
1.3

Constructor & Destructor Documentation

jscicalc.graph.Locus.Locus ( final OObject  oobject,
View  view 
)

Construct the locus from an OObject, Model and View.

This initialises the locus of points to represent something sensible within the view.

Parameters:
oobject The OObject that this Locus is to represent.
view The View

References jscicalc.graph.Locus.incrementValue, jscicalc.graph.Locus.lock, jscicalc.graph.Locus.path, jscicalc.graph.Locus.setup(), jscicalc.Substitution.Substitution(), and jscicalc.graph.Locus.substitution.


Member Function Documentation

void jscicalc.graph.Locus.setup ( View  view  ) 

Set or reset the information required.

This should be done each time the view transformation of view size changes.

Parameters:
view The View

References jscicalc.graph.Locus.restart, and jscicalc.graph.Locus.thread.

Referenced by jscicalc.graph.Locus.Locus().

void jscicalc.graph.Locus.run (  ) 

void jscicalc.graph.Locus.updatePath (  ) 

void jscicalc.graph.Locus.stop (  ) 

Stop the thread as soon as possible.

References jscicalc.graph.Locus.thread.

OObject jscicalc.graph.Locus.substitute ( double  x  )  [protected]

Set substitution to variable = x.

Parameters:
x The value to be substituted
Returns:
A substitued object

References jscicalc.Substitution.add(), jscicalc.OObject.auto_simplify(), jscicalc.graph.Locus.oobject, jscicalc.OObject.substitute(), jscicalc.graph.Locus.substitution, and jscicalc.graph.Locus.variable.

Referenced by jscicalc.graph.Locus.function().

double jscicalc.graph.Locus.function ( double  x,
Transformation  t 
) [protected]

Get value of function at x if it is real and NaN otherwise.

Use view coördinates and transform to Model to do the calculation

Parameters:
x The value to be substituted
t The Transformation used when representing this Locus
Returns:
a double Representing the outcome

References jscicalc.graph.Locus.epsilon, jscicalc.complex.Complex.imaginary(), jscicalc.complex.Complex.real(), jscicalc.graph.Locus.substitute(), jscicalc.graph.Transformation.toModelX(), and jscicalc.graph.Transformation.toViewY().

Referenced by jscicalc.graph.Locus.run().

void jscicalc.graph.Locus.draw ( Model  model,
View  view,
java.awt.Graphics2D  graphics2d 
) [virtual]

Draw the element on the view using the graphics object supplied.

Parameters:
model A Model
view A View of the Model
graphics2d A graphics context

Implements jscicalc.graph.Element.

References jscicalc.graph.Locus.path.

double jscicalc.graph.Locus.increment (  )  [package]

Get incrementValue.

Returns:
The amount to increment x by in the view between points

References jscicalc.graph.Locus.incrementValue.

Referenced by jscicalc.graph.Locus.run().


Member Data Documentation

We substitute for variable x: so we need a variable.

Referenced by jscicalc.graph.Locus.substitute().

We use substitution to substitute values for x.

Referenced by jscicalc.graph.Locus.Locus(), and jscicalc.graph.Locus.substitute().

final double jscicalc.graph.Locus.epsilon = 1e-32 [static, protected]

Limit point at which imaginary part is considered zero.

Referenced by jscicalc.graph.Locus.function().

final double jscicalc.graph.Locus.delta = 1e-8 [static, protected]

Limit point for x distances.

Referenced by jscicalc.graph.Locus.run().

double jscicalc.graph.Locus.incrementValue = 10 [private]

The standard x increment (in view) for this locus.

Referenced by jscicalc.graph.Locus.increment(), and jscicalc.graph.Locus.Locus().

double jscicalc.graph.Locus.distance = 16 [private]

The minimum distance between points.

Referenced by jscicalc.graph.Locus.run().

The OObject represented by this locus.

Referenced by jscicalc.graph.Locus.substitute().

java.awt.geom.Path2D.Double jscicalc.graph.Locus.path [private]

A path representing this locus.

Referenced by jscicalc.graph.Locus.draw(), jscicalc.graph.Locus.Locus(), and jscicalc.graph.Locus.run().

Used for finding the View.

Referenced by jscicalc.graph.Locus.run().

Thread jscicalc.graph.Locus.thread [private]

Object jscicalc.graph.Locus.lock [private]

java.util.concurrent.atomic.AtomicBoolean jscicalc.graph.Locus.restart [package]

Flag to indicate that an update should restart as soon as possible.

Referenced by jscicalc.graph.Locus.run(), jscicalc.graph.Locus.setup(), and jscicalc.graph.Locus.updatePath().


The documentation for this class was generated from the following file:

Generated on Sun Jun 1 08:58:11 2008 for Java Scientific Calculator by  doxygen 1.5.5