gramschmidt
Class GSDataModel

java.lang.Object
  extended by gramschmidt.GSDataModel

public class GSDataModel
extends java.lang.Object

Class that holds the data (vectors) used in the application. Available data: - initial vectors - orthogonal vectors - normalized orthogonal vectors - projections used in calculations


Constructor Summary
GSDataModel()
          Create a new data model.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Add a ChangeListener.
 void fireStateChanged(javax.swing.event.ChangeEvent e)
          Notify all ChangeListeners.
 javax.vecmath.Vector3d getNormalizedVector(int i)
           
 javax.vecmath.Vector3d getOrthogonalVector(int i)
           
 javax.vecmath.Vector3d getProjectedVector(int i)
           
 javax.vecmath.Vector3d getVector(int i)
           
 boolean initialize(javax.vecmath.Vector3d v1, javax.vecmath.Vector3d v2, javax.vecmath.Vector3d v3)
          Initialize the data using the given vectors.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Remove a ChangeListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSDataModel

public GSDataModel()
Create a new data model. Initialize this model before use.

Method Detail

initialize

public boolean initialize(javax.vecmath.Vector3d v1,
                          javax.vecmath.Vector3d v2,
                          javax.vecmath.Vector3d v3)
Initialize the data using the given vectors.

Returns:
false if any of the vectors are null or of length 0. In this case, the data is unaltered.

getVector

public javax.vecmath.Vector3d getVector(int i)
Returns:
initial vector i (i = 1,2,3).

getOrthogonalVector

public javax.vecmath.Vector3d getOrthogonalVector(int i)
Returns:
orthogonal vector i (i = 1,2,3).

getNormalizedVector

public javax.vecmath.Vector3d getNormalizedVector(int i)
Returns:
normalized orthogonal vector i (i = 1,2,3).

getProjectedVector

public javax.vecmath.Vector3d getProjectedVector(int i)
Returns:
p(v2,u1), p(v3,u1) and p(v3,u2) for i = 1,2,3 respectively, where p(x,y) is the orthogonal projection of x onto y.

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Add a ChangeListener.


removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove a ChangeListener.


fireStateChanged

public void fireStateChanged(javax.swing.event.ChangeEvent e)
Notify all ChangeListeners.