- boolean first = true;
-
- public void setPoints(Vector points, int npoint)
- {
- this.points = points;
- this.npoint = npoint;
- if (first)
- {
- ToolTipManager.sharedInstance().registerComponent(this);
- ToolTipManager.sharedInstance().setInitialDelay(0);
- ToolTipManager.sharedInstance().setDismissDelay(10000);
- }
- prefsize = getPreferredSize();
- orig = new float[npoint][3];
-
- for (int i = 0; i < npoint; i++)
- {
- SequencePoint sp = (SequencePoint) points.elementAt(i);
-
- for (int j = 0; j < 3; j++)
- {
- orig[i][j] = sp.coord[j];
- }
- }
-
- // Initialize the matrices to identity
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- if (i != j)
- {
- idmat.addElement(i, j, 0);
- objmat.addElement(i, j, 0);
- rotmat.addElement(i, j, 0);
- }
- else
- {
- idmat.addElement(i, j, 0);
- objmat.addElement(i, j, 0);
- rotmat.addElement(i, j, 0);
- }
- }
- }
-
- axes = new float[3][3];
- initAxes();
-
- findCentre();
- findWidth();
-
- scale = findScale();
- if (first)
- {
-
- addMouseListener(this);
-
- addMouseMotionListener(this);
- }
- first = false;
- }
-
- public void initAxes()
- {
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- if (i != j)
- {
- axes[i][j] = 0;
- }
- else
- {
- axes[i][j] = 1;
- }
- }
- }
- }
-
- /**
- * DOCUMENT ME!
- */
- public void findWidth()