Merge branch 'features/JAL-1767pcaInProject' into bug/JAL-3171_maintain_datasets_acro...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 19 Dec 2018 16:53:33 +0000 (16:53 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 19 Dec 2018 16:53:33 +0000 (16:53 +0000)
63 files changed:
help/html/calculations/pca.html
resources/lang/Messages.properties
resources/lang/Messages_es.properties
schemas/jalview.xsd
src/jalview/analysis/PCA.java
src/jalview/analysis/scoremodels/ScoreModels.java
src/jalview/analysis/scoremodels/SimilarityParams.java
src/jalview/api/RotatableCanvasI.java
src/jalview/appletgui/PCAPanel.java
src/jalview/appletgui/RotatableCanvas.java
src/jalview/datamodel/Point.java [new file with mode: 0644]
src/jalview/datamodel/SequencePoint.java
src/jalview/gui/CalculationChooser.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/RotatableCanvas.java
src/jalview/gui/TreePanel.java
src/jalview/jbgui/GPCAPanel.java
src/jalview/math/Matrix.java
src/jalview/math/MatrixI.java
src/jalview/math/RotatableMatrix.java
src/jalview/math/SparseMatrix.java
src/jalview/schemabinding/version2/.castor.cdr
src/jalview/schemabinding/version2/Axis.java [new file with mode: 0644]
src/jalview/schemabinding/version2/D.java [new file with mode: 0644]
src/jalview/schemabinding/version2/DoubleMatrix.java [new file with mode: 0644]
src/jalview/schemabinding/version2/DoubleVector.java [new file with mode: 0644]
src/jalview/schemabinding/version2/E.java [new file with mode: 0644]
src/jalview/schemabinding/version2/EigenMatrix.java [new file with mode: 0644]
src/jalview/schemabinding/version2/JalviewModelSequence.java
src/jalview/schemabinding/version2/PairwiseMatrix.java [new file with mode: 0644]
src/jalview/schemabinding/version2/PcaData.java [new file with mode: 0644]
src/jalview/schemabinding/version2/PcaDataType.java [new file with mode: 0644]
src/jalview/schemabinding/version2/PcaViewer.java [new file with mode: 0644]
src/jalview/schemabinding/version2/Row.java [new file with mode: 0644]
src/jalview/schemabinding/version2/SeqPointMax.java [new file with mode: 0644]
src/jalview/schemabinding/version2/SeqPointMin.java [new file with mode: 0644]
src/jalview/schemabinding/version2/SequencePoint.java [new file with mode: 0644]
src/jalview/schemabinding/version2/Tree.java
src/jalview/schemabinding/version2/TridiagonalMatrix.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/AxisDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/DDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/DoubleMatrixDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/DoubleVectorDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/EDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/EigenMatrixDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java
src/jalview/schemabinding/version2/descriptors/PairwiseMatrixDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/PcaDataDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/PcaDataTypeDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/PcaViewerDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/RowDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/SeqPointMaxDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/SeqPointMinDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/SequencePointDescriptor.java [new file with mode: 0644]
src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java
src/jalview/schemabinding/version2/descriptors/TridiagonalMatrixDescriptor.java [new file with mode: 0644]
src/jalview/viewmodel/PCAModel.java
test/jalview/analysis/scoremodels/ScoreModelsTest.java
test/jalview/gui/CalculationChooserTest.java [new file with mode: 0644]
test/jalview/io/Jalview2xmlTests.java
test/jalview/math/MatrixTest.java
test/jalview/math/RotatableMatrixTest.java [new file with mode: 0644]

index 0104078..5b76d10 100755 (executable)
     <em>Calculating PCAs for aligned sequences</em><br />Jalview can
     perform PCA analysis on both proteins and nucleotide sequence
     alignments. In both cases, components are generated by an
-    eigenvector decomposition of the matrix formed from the sum of
-    substitution matrix scores at each aligned position between each
-    pair of sequences - computed with one of the available score
-    matrices, such as <a href="scorematrices.html#blosum62">BLOSUM62</a>,
+    eigenvector decomposition of the matrix formed from pairwise similarity
+    scores between each pair of sequences. The similarity score model is 
+    selected on the <a href="calculations.html">calculations dialog</a>, and
+    may use one of the available score matrices, such as 
+    <a href="scorematrices.html#blosum62">BLOSUM62</a>,
     <a href="scorematrices.html#pam250">PAM250</a>, or the <a
       href="scorematrices.html#simplenucleotide">simple single
-      nucleotide substitution matrix</a>. The options available for
-    calculation are given in the <strong><em>Change
-        Parameters</em></strong> menu.
+      nucleotide substitution matrix</a>, or by sequence percentage identity,
+      or sequence feature similarity. 
   </p>
   <img src="pcaviewer.gif">
   <p>
index ae5b0e7..449c9b6 100644 (file)
@@ -172,10 +172,9 @@ label.principal_component_analysis = Principal Component Analysis
 label.average_distance_identity = Average Distance Using % Identity
 label.neighbour_joining_identity = Neighbour Joining Using % Identity
 label.choose_calculation = Choose Calculation
-label.treecalc_title = {0} Using {1}
+label.calc_title = {0} Using {1}
 label.tree_calc_av = Average Distance
 label.tree_calc_nj = Neighbour Joining
-label.select_score_model = Select score model
 label.score_model_pid = % Identity
 label.score_model_blosum62 = BLOSUM62
 label.score_model_pam250 = PAM 250
@@ -879,7 +878,6 @@ label.error_unsupported_owwner_user_colour_scheme = Unsupported owner for User C
 label.save_alignment_to_file = Save Alignment to file
 label.save_features_to_file = Save Features to File
 label.save_annotation_to_file = Save Annotation to File
-label.no_features_on_alignment = No features found on alignment
 label.save_pdb_file = Save PDB File
 label.save_text_to_file = Save Text to File
 label.save_state = Save State
index 555977d..3c82386 100644 (file)
@@ -169,10 +169,9 @@ label.principal_component_analysis = An
 label.average_distance_identity = Distancia Media Usando % de Identidad
 label.neighbour_joining_identity = Unir vecinos utilizando % de Identidad
 label.choose_calculation = Elegir el cálculo
-label.treecalc_title = {0} utilizando {1}
+label.calc_title = {0} utilizando {1}
 label.tree_calc_av = Distancia media
 label.tree_calc_nj = Unir vecinos
-label.select_score_model = Selecciones modelo de puntuación
 label.score_model_pid = % Identidad
 label.score_model_blosum62 = BLOSUM62
 label.score_model_pam250 = PAM 250
@@ -804,7 +803,6 @@ label.error_unsupported_owwner_user_colour_scheme = Propietario no soportado par
 label.save_alignment_to_file = Guardar Alineamiento en fichero
 label.save_features_to_file = Guardar Características en un fichero
 label.save_annotation_to_file = Guardar Anotación en un fichero
-label.no_features_on_alignment = No se han encontrado características en el alineamiento
 label.save_pdb_file = Guardar fichero PDB 
 label.save_text_to_file = Guardar Texto en un fichero
 label.save_state = Guardar estado
index 7511ad2..07dee98 100755 (executable)
                                                        </xs:annotation>
                                                </xs:attribute>
                                                <xs:attributeGroup ref="jv:swingwindow" />
+                                               <xs:attribute name="linkToAllViews" use="optional" default="false" type="xs:boolean" />
+                                       </xs:complexType>
+                               </xs:element>
+                               <xs:element name="PcaViewer" minOccurs="0" maxOccurs="unbounded">
+                                       <xs:complexType>
+                                               <xs:sequence>
+                                                       <xs:element name="sequencePoint" minOccurs="1" maxOccurs="unbounded">
+                                                               <xs:complexType>
+                                                                       <xs:attribute name="sequenceRef" type="xs:string" />
+                                                                       <xs:attributeGroup ref="jv:position" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element name="axis" minOccurs="3" maxOccurs="3">
+                                                               <xs:annotation>
+                                                                       <xs:documentation>
+                                                                               endpoints of X, Y and Z axes in that order
+                                                                       </xs:documentation>
+                                                               </xs:annotation>
+                                                               <xs:complexType>
+                                                                       <xs:attributeGroup ref="jv:position" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element name="seqPointMin">
+                                                               <xs:complexType>
+                                                                       <xs:attributeGroup ref="jv:position" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element name="seqPointMax">
+                                                               <xs:complexType>
+                                                                       <xs:attributeGroup ref="jv:position" />
+                                                               </xs:complexType>
+                                                       </xs:element>
+                                                       <xs:element name="pcaData" type="jv:PcaDataType" />
+                                               </xs:sequence>
+                                               <xs:attribute name="title" type="xs:string" />
+                                               <xs:attribute name="scoreModelName" type="xs:string" />
+                                               <xs:attribute name="xDim" type="xs:int" />
+                                               <xs:attribute name="yDim" type="xs:int" />
+                                               <xs:attribute name="zDim" type="xs:int" />
+                                               <xs:attribute name="bgColour" type="xs:int" />
+                                               <xs:attribute name="scaleFactor" type="xs:float" />
+                                               <xs:attribute name="showLabels" type="xs:boolean" />
+                                               <xs:attribute name="linkToAllViews" type="xs:boolean" />
+                                               <xs:attributeGroup ref="jv:SimilarityParams" />
+                                               <xs:attributeGroup ref="jv:swingwindow" />
                                        </xs:complexType>
                                </xs:element>
                                <xs:element name="FeatureSettings" minOccurs="0">
                <xs:attribute name="predefinedColours" type="xs:boolean"
                        use="optional" />
        </xs:complexType>
-
+       <xs:attributeGroup name="SimilarityParams">
+               <xs:annotation>
+                       <xs:documentation>
+                               parameters that condition a similarity score calculation
+                       </xs:documentation>
+               </xs:annotation>
+               <xs:attribute name="includeGaps" type="xs:boolean" />
+               <xs:attribute name="matchGaps" type="xs:boolean" />
+               <xs:attribute name="includeGappedColumns" type="xs:boolean" />
+               <xs:attribute name="denominateByShortestLength" type="xs:boolean" />
+       </xs:attributeGroup>
+       <xs:attributeGroup name="position">
+               <xs:attribute name="xPos" type="xs:float" />
+               <xs:attribute name="yPos" type="xs:float" />
+               <xs:attribute name="zPos" type="xs:float" />
+       </xs:attributeGroup>
+       <xs:complexType name="PcaDataType">
+               <xs:annotation>
+                       <xs:documentation>
+                               The results of a PCA calculation
+                       </xs:documentation>
+               </xs:annotation>
+               <xs:sequence>
+                       <xs:element name="pairwiseMatrix" type="jv:DoubleMatrix" />
+                       <xs:element name="tridiagonalMatrix" type="jv:DoubleMatrix" />
+                       <xs:element name="eigenMatrix" type="jv:DoubleMatrix" />
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="DoubleVector">
+               <xs:sequence>
+                       <xs:element name="v" type="xs:double" minOccurs="0" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+       <xs:complexType name="DoubleMatrix">
+               <xs:sequence>
+                       <xs:element name="row" type="jv:DoubleVector" minOccurs="0" maxOccurs="unbounded" />
+                       <xs:element name="D" minOccurs="0" type="jv:DoubleVector" />
+                       <xs:element name="E" minOccurs="0" type="jv:DoubleVector" />
+               </xs:sequence>
+               <xs:attribute name="rows"  type="xs:int" />
+               <xs:attribute name="columns" type="xs:int" />
+       </xs:complexType>
 </xs:schema>
index 42a168d..d51f00e 100755 (executable)
@@ -22,7 +22,9 @@ package jalview.analysis;
 
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
 import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Point;
 import jalview.math.MatrixI;
 
 import java.io.PrintStream;
@@ -32,28 +34,37 @@ import java.io.PrintStream;
  */
 public class PCA implements Runnable
 {
-  MatrixI symm;
-
-  double[] eigenvalue;
+  /*
+   * inputs
+   */
+  final private AlignmentView seqs;
 
-  MatrixI eigenvector;
+  final private ScoreModelI scoreModel;
 
-  StringBuilder details = new StringBuilder(1024);
+  final private SimilarityParamsI similarityParams;
 
-  final private AlignmentView seqs;
+  /*
+   * outputs
+   */
+  private MatrixI pairwiseScores;
 
-  private ScoreModelI scoreModel;
+  private MatrixI tridiagonal;
 
-  private SimilarityParamsI similarityParams;
+  private MatrixI eigenMatrix;
 
-  public PCA(AlignmentView s, ScoreModelI sm, SimilarityParamsI options)
+  /**
+   * Constructor given the sequences to compute for, the similarity model to
+   * use, and a set of parameters for sequence comparison
+   * 
+   * @param sequences
+   * @param sm
+   * @param options
+   */
+  public PCA(AlignmentView sequences, ScoreModelI sm, SimilarityParamsI options)
   {
-    this.seqs = s;
-    this.similarityParams = options;
+    this.seqs = sequences;
     this.scoreModel = sm;
-
-    details.append("PCA calculation using " + sm.getName()
-            + " sequence similarity matrix\n========\n\n");
+    this.similarityParams = options;
   }
 
   /**
@@ -66,7 +77,7 @@ public class PCA implements Runnable
    */
   public double getEigenvalue(int i)
   {
-    return eigenvector.getD()[i];
+    return eigenMatrix.getD()[i];
   }
 
   /**
@@ -83,15 +94,16 @@ public class PCA implements Runnable
    * 
    * @return DOCUMENT ME!
    */
-  public float[][] getComponents(int l, int n, int mm, float factor)
+  public Point[] getComponents(int l, int n, int mm, float factor)
   {
-    float[][] out = new float[getHeight()][3];
+    Point[] out = new Point[getHeight()];
 
     for (int i = 0; i < getHeight(); i++)
     {
-      out[i][0] = (float) component(i, l) * factor;
-      out[i][1] = (float) component(i, n) * factor;
-      out[i][2] = (float) component(i, mm) * factor;
+      float x = (float) component(i, l) * factor;
+      float y = (float) component(i, n) * factor;
+      float z = (float) component(i, mm) * factor;
+      out[i] = new Point(x, y, z);
     }
 
     return out;
@@ -132,84 +144,111 @@ public class PCA implements Runnable
   {
     double out = 0.0;
 
-    for (int i = 0; i < symm.width(); i++)
+    for (int i = 0; i < pairwiseScores.width(); i++)
     {
-      out += (symm.getValue(row, i) * eigenvector.getValue(i, n));
+      out += (pairwiseScores.getValue(row, i) * eigenMatrix.getValue(i, n));
     }
 
-    return out / eigenvector.getD()[n];
+    return out / eigenMatrix.getD()[n];
   }
 
+  /**
+   * Answers a formatted text report of the PCA calculation results (matrices
+   * and eigenvalues) suitable for display
+   * 
+   * @return
+   */
   public String getDetails()
   {
-    return details.toString();
+    StringBuilder sb = new StringBuilder(1024);
+    sb.append("PCA calculation using ").append(scoreModel.getName())
+            .append(" sequence similarity matrix\n========\n\n");
+    PrintStream ps = wrapOutputBuffer(sb);
+    
+    /*
+     * pairwise similarity scores
+     */
+    sb.append(" --- OrigT * Orig ---- \n");
+    pairwiseScores.print(ps, "%8.2f");
+    
+    /*
+     * tridiagonal matrix, with D and E vectors
+     */
+    sb.append(" ---Tridiag transform matrix ---\n");
+    sb.append(" --- D vector ---\n");
+    tridiagonal.printD(ps, "%15.4e");
+    ps.println();
+    sb.append("--- E vector ---\n");
+    tridiagonal.printE(ps, "%15.4e");
+    ps.println();
+    
+    /*
+     * eigenvalues matrix, with D vector
+     */
+    sb.append(" --- New diagonalization matrix ---\n");
+    eigenMatrix.print(ps, "%8.2f");
+    sb.append(" --- Eigenvalues ---\n");
+    eigenMatrix.printD(ps, "%15.4e");
+    ps.println();
+    
+    return sb.toString();
   }
 
   /**
-   * DOCUMENT ME!
+   * Performs the PCA calculation
    */
   @Override
   public void run()
   {
+    try
+    {
+      /*
+       * sequence pairwise similarity scores
+       */
+      pairwiseScores = scoreModel.findSimilarities(seqs, similarityParams);
+
+      /*
+       * tridiagonal matrix
+       */
+      tridiagonal = pairwiseScores.copy();
+      tridiagonal.tred();
+
+      /*
+       * the diagonalization matrix
+       */
+      eigenMatrix = tridiagonal.copy();
+      eigenMatrix.tqli();
+    } catch (Exception q)
+    {
+      Cache.log.error("Error computing PCA:  " + q.getMessage());
+      q.printStackTrace();
+    }
+  }
+
+  /**
+   * Returns a PrintStream that wraps (appends its output to) the given
+   * StringBuilder
+   * 
+   * @param sb
+   * @return
+   */
+  protected PrintStream wrapOutputBuffer(StringBuilder sb)
+  {
     PrintStream ps = new PrintStream(System.out)
     {
       @Override
       public void print(String x)
       {
-        details.append(x);
+        sb.append(x);
       }
 
       @Override
       public void println()
       {
-        details.append("\n");
+        sb.append("\n");
       }
     };
-
-    // long now = System.currentTimeMillis();
-    try
-    {
-      eigenvector = scoreModel.findSimilarities(seqs, similarityParams);
-
-      details.append(" --- OrigT * Orig ---- \n");
-      eigenvector.print(ps, "%8.2f");
-
-      symm = eigenvector.copy();
-
-      eigenvector.tred();
-
-      details.append(" ---Tridiag transform matrix ---\n");
-      details.append(" --- D vector ---\n");
-      eigenvector.printD(ps, "%15.4e");
-      ps.println();
-      details.append("--- E vector ---\n");
-      eigenvector.printE(ps, "%15.4e");
-      ps.println();
-
-      // Now produce the diagonalization matrix
-      eigenvector.tqli();
-    } catch (Exception q)
-    {
-      q.printStackTrace();
-      details.append("\n*** Unexpected exception when performing PCA ***\n"
-              + q.getLocalizedMessage());
-      details.append(
-              "*** Matrices below may not be fully diagonalised. ***\n");
-    }
-
-    details.append(" --- New diagonalization matrix ---\n");
-    eigenvector.print(ps, "%8.2f");
-    details.append(" --- Eigenvalues ---\n");
-    eigenvector.printD(ps, "%15.4e");
-    ps.println();
-    /*
-     * for (int seq=0;seq<symm.rows;seq++) { ps.print("\"Seq"+seq+"\""); for
-     * (int ev=0;ev<symm.rows; ev++) {
-     * 
-     * ps.print(","+component(seq, ev)); } ps.println(); }
-     */
-    // System.out.println(("PCA.run() took "
-    // + (System.currentTimeMillis() - now) + "ms"));
+    return ps;
   }
 
   /**
@@ -221,6 +260,42 @@ public class PCA implements Runnable
   public int getHeight()
   {
     // TODO can any of seqs[] be null?
-    return seqs.getSequences().length;
+    return pairwiseScores.height();// seqs.getSequences().length;
+  }
+
+  /**
+   * Answers the sequence pairwise similarity scores which were the first step
+   * of the PCA calculation
+   * 
+   * @return
+   */
+  public MatrixI getPairwiseScores()
+  {
+    return pairwiseScores;
+  }
+
+  public void setPairwiseScores(MatrixI m)
+  {
+    pairwiseScores = m;
+  }
+
+  public MatrixI getEigenmatrix()
+  {
+    return eigenMatrix;
+  }
+
+  public void setEigenmatrix(MatrixI m)
+  {
+    eigenMatrix = m;
+  }
+
+  public MatrixI getTridiagonal()
+  {
+    return tridiagonal;
+  }
+
+  public void setTridiagonal(MatrixI tridiagonal)
+  {
+    this.tridiagonal = tridiagonal;
   }
 }
index 7262fb8..3cbd5f1 100644 (file)
@@ -66,11 +66,11 @@ public class ScoreModels
     /*
      * using LinkedHashMap keeps models ordered as added
      */
-    models = new LinkedHashMap<String, ScoreModelI>();
+    models = new LinkedHashMap<>();
     BLOSUM62 = loadScoreMatrix("scoreModel/blosum62.scm");
     PAM250 = loadScoreMatrix("scoreModel/pam250.scm");
-    registerScoreModel(new PIDModel());
     DNA = loadScoreMatrix("scoreModel/dna.scm");
+    registerScoreModel(new PIDModel());
     registerScoreModel(new FeatureDistanceModel());
   }
 
index 58b08dd..5c47703 100644 (file)
@@ -147,4 +147,57 @@ public class SimilarityParams implements SimilarityParamsI
   {
     return matchGaps;
   }
+
+  /**
+   * IDE-generated hashCode method
+   */
+  @Override
+  public int hashCode()
+  {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + (denominateByShortestLength ? 1231 : 1237);
+    result = prime * result + (includeGappedColumns ? 1231 : 1237);
+    result = prime * result + (includeGaps ? 1231 : 1237);
+    result = prime * result + (matchGaps ? 1231 : 1237);
+    return result;
+  }
+
+  /**
+   * IDE-generated equals method
+   */
+  @Override
+  public boolean equals(Object obj)
+  {
+    if (this == obj)
+    {
+      return true;
+    }
+    if (obj == null)
+    {
+      return false;
+    }
+    if (getClass() != obj.getClass())
+    {
+      return false;
+    }
+    SimilarityParams other = (SimilarityParams) obj;
+    if (denominateByShortestLength != other.denominateByShortestLength)
+    {
+      return false;
+    }
+    if (includeGappedColumns != other.includeGappedColumns)
+    {
+      return false;
+    }
+    if (includeGaps != other.includeGaps)
+    {
+      return false;
+    }
+    if (matchGaps != other.matchGaps)
+    {
+      return false;
+    }
+    return true;
+  }
 }
index a57bcdb..c6eb6de 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
+ * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -22,7 +22,7 @@ package jalview.api;
 
 import jalview.datamodel.SequencePoint;
 
-import java.util.Vector;
+import java.util.List;
 
 /**
  * interface implemented by RotatatableCanvas GUI elements (such as point clouds
@@ -33,7 +33,23 @@ import java.util.Vector;
  */
 public interface RotatableCanvasI
 {
+  void setPoints(List<SequencePoint> points, int rows);
 
-  void setPoints(Vector<SequencePoint> points, int rows);
+  /**
+   * Zoom the view in (or out) by the given factor, which should be >= 0. A
+   * factor greater than 1 zooms in (expands the display), a factor less than 1
+   * zooms out (shrinks the display).
+   * 
+   * @param factor
+   */
+  void zoom(float factor);
 
+  /**
+   * Rotates the view by the specified number of degrees about the x and/or y
+   * axis
+   * 
+   * @param x
+   * @param y
+   */
+  void rotate(float x, float y);
 }
index fc1d359..7c0dfa9 100644 (file)
@@ -134,7 +134,7 @@ public class PCAPanel extends EmbmenuFrame
     {
       nuclSetting.setState(pcaModel.isNucleotide());
       protSetting.setState(!pcaModel.isNucleotide());
-      pcaModel.run();
+      pcaModel.calculate();
       // ////////////////
       xCombobox.select(0);
       yCombobox.select(1);
@@ -167,9 +167,7 @@ public class PCAPanel extends EmbmenuFrame
     int dim2 = top - yCombobox.getSelectedIndex();
     int dim3 = top - zCombobox.getSelectedIndex();
     pcaModel.updateRcView(dim1, dim2, dim3);
-    rc.img = null;
-    rc.rotmat.setIdentity();
-    rc.initAxes();
+    rc.resetView();
     rc.paint(rc.getGraphics());
   }
 
@@ -281,7 +279,7 @@ public class PCAPanel extends EmbmenuFrame
     {
     }
     ;
-    Object[] alAndColsel = pcaModel.getSeqtrings()
+    Object[] alAndColsel = pcaModel.getInputData()
             .getAlignmentAndHiddenColumns(gc);
 
     if (alAndColsel != null && alAndColsel[0] != null)
index afb4e95..34f8ea5 100755 (executable)
 package jalview.appletgui;
 
 import jalview.api.RotatableCanvasI;
+import jalview.datamodel.Point;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.SequencePoint;
 import jalview.math.RotatableMatrix;
-import jalview.util.Format;
+import jalview.math.RotatableMatrix.Axis;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 
@@ -40,32 +41,26 @@ import java.awt.event.KeyListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
-import java.util.Vector;
+import java.util.List;
 
 public class RotatableCanvas extends Panel implements MouseListener,
         MouseMotionListener, KeyListener, RotatableCanvasI
 {
-  RotatableMatrix idmat = new RotatableMatrix(3, 3);
-
-  RotatableMatrix objmat = new RotatableMatrix(3, 3);
-
-  RotatableMatrix rotmat = new RotatableMatrix(3, 3);
+  private static final int DIMS = 3;
 
   String tooltip;
 
-  int toolx, tooly;
+  int toolx;
+
+  int tooly;
 
   // RubberbandRectangle rubberband;
 
   boolean drawAxes = true;
 
-  int omx = 0;
-
-  int mx = 0;
-
-  int omy = 0;
+  int mouseX = 0;
 
-  int my = 0;
+  int mouseY = 0;
 
   Image img;
 
@@ -73,13 +68,13 @@ public class RotatableCanvas extends Panel implements MouseListener,
 
   Dimension prefsize;
 
-  float centre[] = new float[3];
+  Point centre;
 
-  float width[] = new float[3];
+  float[] width = new float[DIMS];
 
-  float max[] = new float[3];
+  float[] max = new float[DIMS];
 
-  float min[] = new float[3];
+  float[] min = new float[DIMS];
 
   float maxwidth;
 
@@ -87,11 +82,11 @@ public class RotatableCanvas extends Panel implements MouseListener,
 
   int npoint;
 
-  Vector points;
+  List<SequencePoint> points;
 
-  float[][] orig;
+  Point[] orig;
 
-  float[][] axes;
+  Point[] axisEndPoints;
 
   int startx;
 
@@ -115,9 +110,10 @@ public class RotatableCanvas extends Panel implements MouseListener,
 
   boolean showLabels = false;
 
-  public RotatableCanvas(AlignmentViewport av)
+  public RotatableCanvas(AlignmentViewport viewport)
   {
-    this.av = av;
+    this.av = viewport;
+    axisEndPoints = new Point[DIMS];
   }
 
   public void showLabels(boolean b)
@@ -126,46 +122,23 @@ public class RotatableCanvas extends Panel implements MouseListener,
     repaint();
   }
 
-  public void setPoints(Vector points, int npoint)
+  @Override
+  public void setPoints(List<SequencePoint> points, int npoint)
   {
     this.points = points;
     this.npoint = npoint;
     PaintRefresher.Register(this, av.getSequenceSetId());
 
     prefsize = getPreferredSize();
-    orig = new float[npoint][3];
+    orig = new Point[npoint];
 
     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);
-        }
-      }
+      SequencePoint sp = points.get(i);
+      orig[i] = sp.coord;
     }
 
-    axes = new float[3][3];
-    initAxes();
+    resetAxes();
 
     findCentre();
     findWidth();
@@ -195,115 +168,93 @@ public class RotatableCanvas extends Panel implements MouseListener,
    * super.removeNotify(); }
    */
 
-  public void initAxes()
+  /**
+   * Resets axes to the initial state: x-axis to the right, y-axis up, z-axis to
+   * back (so obscured in a 2-D display)
+   */
+  public void resetAxes()
   {
-    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;
-        }
-      }
-    }
+    axisEndPoints[0] = new Point(1f, 0f, 0f);
+    axisEndPoints[1] = new Point(0f, 1f, 0f);
+    axisEndPoints[2] = new Point(0f, 0f, 1f);
   }
 
+  /**
+   * Computes and saves the maximum and minimum (x, y, z) positions of any
+   * sequence point, and also the min-max range (width) for each dimension, and
+   * the maximum width for all dimensions
+   */
   public void findWidth()
   {
     max = new float[3];
     min = new float[3];
 
-    max[0] = (float) -1e30;
-    max[1] = (float) -1e30;
-    max[2] = (float) -1e30;
+    max[0] = Float.MIN_VALUE;
+    max[1] = Float.MIN_VALUE;
+    max[2] = Float.MIN_VALUE;
 
-    min[0] = (float) 1e30;
-    min[1] = (float) 1e30;
-    min[2] = (float) 1e30;
+    min[0] = Float.MAX_VALUE;
+    min[1] = Float.MAX_VALUE;
+    min[2] = Float.MAX_VALUE;
 
-    for (int i = 0; i < 3; i++)
+    for (SequencePoint sp : points)
     {
-      for (int j = 0; j < npoint; j++)
-      {
-        SequencePoint sp = (SequencePoint) points.elementAt(j);
-        if (sp.coord[i] >= max[i])
-        {
-          max[i] = sp.coord[i];
-        }
-        if (sp.coord[i] <= min[i])
-        {
-          min[i] = sp.coord[i];
-        }
-      }
+      max[0] = Math.max(max[0], sp.coord.x);
+      max[1] = Math.max(max[1], sp.coord.y);
+      max[2] = Math.max(max[2], sp.coord.z);
+      min[0] = Math.min(min[0], sp.coord.x);
+      min[1] = Math.min(min[1], sp.coord.y);
+      min[2] = Math.min(min[2], sp.coord.z);
     }
 
-    // System.out.println("xmax " + max[0] + " min " + min[0]);
-    // System.out.println("ymax " + max[1] + " min " + min[1]);
-    // System.out.println("zmax " + max[2] + " min " + min[2]);
-
     width[0] = Math.abs(max[0] - min[0]);
     width[1] = Math.abs(max[1] - min[1]);
     width[2] = Math.abs(max[2] - min[2]);
 
-    maxwidth = width[0];
-
-    if (width[1] > width[0])
-    {
-      maxwidth = width[1];
-    }
-    if (width[2] > width[1])
-    {
-      maxwidth = width[2];
-    }
-
-    // System.out.println("Maxwidth = " + maxwidth);
+    maxwidth = Math.max(width[0], Math.max(width[1], width[2]));
   }
 
   public float findScale()
   {
-    int dim, width, height;
+    int dim, w, height;
     if (getSize().width != 0)
     {
-      width = getSize().width;
+      w = getSize().width;
       height = getSize().height;
     }
     else
     {
-      width = prefsize.width;
+      w = prefsize.width;
       height = prefsize.height;
     }
 
-    if (width < height)
+    if (w < height)
     {
-      dim = width;
+      dim = w;
     }
     else
     {
       dim = height;
     }
 
-    return (float) (dim * scalefactor / (2 * maxwidth));
+    return dim * scalefactor / (2 * maxwidth);
   }
 
+  /**
+   * Computes and saves the position of the centre of the view
+   */
   public void findCentre()
   {
-    // Find centre coordinate
     findWidth();
 
-    centre[0] = (max[0] + min[0]) / 2;
-    centre[1] = (max[1] + min[1]) / 2;
-    centre[2] = (max[2] + min[2]) / 2;
+    float x = (max[0] + min[0]) / 2;
+    float y = (max[1] + min[1]) / 2;
+    float z = (max[2] + min[2]) / 2;
 
-    // System.out.println("Centre x " + centre[0]);
-    // System.out.println("Centre y " + centre[1]);
-    // System.out.println("Centre z " + centre[2]);
+    centre = new Point(x, y, z);
   }
 
+  @Override
   public Dimension getPreferredSize()
   {
     if (prefsize != null)
@@ -316,16 +267,19 @@ public class RotatableCanvas extends Panel implements MouseListener,
     }
   }
 
+  @Override
   public Dimension getMinimumSize()
   {
     return getPreferredSize();
   }
 
+  @Override
   public void update(Graphics g)
   {
     paint(g);
   }
 
+  @Override
   public void paint(Graphics g)
   {
     if (points == null)
@@ -355,7 +309,7 @@ public class RotatableCanvas extends Panel implements MouseListener,
 
       drawBackground(ig, Color.black);
       drawScene(ig);
-      if (drawAxes == true)
+      if (drawAxes)
       {
         drawAxes(ig);
       }
@@ -377,8 +331,8 @@ public class RotatableCanvas extends Panel implements MouseListener,
     for (int i = 0; i < 3; i++)
     {
       g.drawLine(getSize().width / 2, getSize().height / 2,
-              (int) (axes[i][0] * scale * max[0] + getSize().width / 2),
-              (int) (axes[i][1] * scale * max[1] + getSize().height / 2));
+              (int) (axisEndPoints[i].x * scale * max[0] + getSize().width / 2),
+              (int) (axisEndPoints[i].y * scale * max[1] + getSize().height / 2));
     }
   }
 
@@ -390,81 +344,85 @@ public class RotatableCanvas extends Panel implements MouseListener,
 
   public void drawScene(Graphics g)
   {
-    // boolean darker = false;
-
-    int halfwidth = getSize().width / 2;
-    int halfheight = getSize().height / 2;
-
     for (int i = 0; i < npoint; i++)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int x = (int) ((float) (sp.coord[0] - centre[0]) * scale) + halfwidth;
-      int y = (int) ((float) (sp.coord[1] - centre[1]) * scale)
-              + halfheight;
-      float z = sp.coord[1] - centre[2];
-
-      if (av.getSequenceColour(sp.sequence) == Color.black)
-      {
-        g.setColor(Color.white);
-      }
-      else
-      {
-        g.setColor(av.getSequenceColour(sp.sequence));
-      }
-
+      SequencePoint sp = points.get(i);
+      SequenceI sequence = sp.getSequence();
+      Color sequenceColour = av.getSequenceColour(sequence);
+      g.setColor(
+              sequenceColour == Color.black ? Color.white : sequenceColour);
       if (av.getSelectionGroup() != null)
       {
         if (av.getSelectionGroup().getSequences(null)
-                .contains(((SequencePoint) points.elementAt(i)).sequence))
+                .contains(sequence))
         {
           g.setColor(Color.gray);
         }
       }
-      if (z < 0)
+
+      if (sp.coord.z < centre.z)
       {
         g.setColor(g.getColor().darker());
       }
 
+      int halfwidth = getSize().width / 2;
+      int halfheight = getSize().height / 2;
+      int x = (int) ((sp.coord.x - centre.x) * scale) + halfwidth;
+      int y = (int) ((sp.coord.y - centre.y) * scale) + halfheight;
       g.fillRect(x - 3, y - 3, 6, 6);
+
       if (showLabels)
       {
         g.setColor(Color.red);
-        g.drawString(
-                ((SequencePoint) points.elementAt(i)).sequence.getName(),
-                x - 3, y - 4);
+        g.drawString(sequence.getName(), x - 3, y - 4);
       }
     }
   }
 
-  public Dimension minimumsize()
-  {
-    return prefsize;
-  }
-
-  public Dimension preferredsize()
-  {
-    return prefsize;
-  }
-
+  @Override
   public void keyTyped(KeyEvent evt)
   {
   }
 
+  @Override
   public void keyReleased(KeyEvent evt)
   {
   }
 
+  @Override
   public void keyPressed(KeyEvent evt)
   {
-    if (evt.getKeyCode() == KeyEvent.VK_UP)
+    boolean shiftDown = evt.isShiftDown();
+    int keyCode = evt.getKeyCode();
+    if (keyCode == KeyEvent.VK_UP)
+    {
+      if (shiftDown)
+      {
+        rotate(0f, -1f);
+      }
+      else
+      {
+        zoom(1.1f);
+      }
+    }
+    else if (keyCode == KeyEvent.VK_DOWN)
     {
-      scalefactor = (float) (scalefactor * 1.1);
-      scale = findScale();
+      if (shiftDown)
+      {
+        rotate(0f, 1f);
+      }
+      else
+      {
+        zoom(0.9f);
+      }
     }
-    else if (evt.getKeyCode() == KeyEvent.VK_DOWN)
+    else if (shiftDown && keyCode == KeyEvent.VK_LEFT)
     {
-      scalefactor = (float) (scalefactor * 0.9);
-      scale = findScale();
+      rotate(1f, 0f);
+    }
+    else if (shiftDown && keyCode == KeyEvent.VK_RIGHT)
+    {
+      rotate(-1f, 0f);
     }
     else if (evt.getKeyChar() == 's')
     {
@@ -478,46 +436,34 @@ public class RotatableCanvas extends Panel implements MouseListener,
     repaint();
   }
 
-  public void printPoints()
-  {
-    for (int i = 0; i < npoint; i++)
-    {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      Format.print(System.out, "%5d ", i);
-      for (int j = 0; j < 3; j++)
-      {
-        Format.print(System.out, "%13.3f  ", sp.coord[j]);
-      }
-      System.out.println();
-    }
-  }
-
+  @Override
   public void mouseClicked(MouseEvent evt)
   {
   }
 
+  @Override
   public void mouseEntered(MouseEvent evt)
   {
   }
 
+  @Override
   public void mouseExited(MouseEvent evt)
   {
   }
 
+  @Override
   public void mouseReleased(MouseEvent evt)
   {
   }
 
+  @Override
   public void mousePressed(MouseEvent evt)
   {
     int x = evt.getX();
     int y = evt.getY();
 
-    mx = x;
-    my = y;
-
-    omx = mx;
-    omy = my;
+    mouseX = x;
+    mouseY = y;
 
     startx = x;
     starty = y;
@@ -528,7 +474,7 @@ public class RotatableCanvas extends Panel implements MouseListener,
     rectx2 = -1;
     recty2 = -1;
 
-    SequenceI found = findPoint(x, y);
+    SequenceI found = findSequenceAtPoint(x, y);
 
     if (found != null)
     {
@@ -552,9 +498,10 @@ public class RotatableCanvas extends Panel implements MouseListener,
     repaint();
   }
 
+  @Override
   public void mouseMoved(MouseEvent evt)
   {
-    SequenceI found = findPoint(evt.getX(), evt.getY());
+    SequenceI found = findSequenceAtPoint(evt.getX(), evt.getY());
     if (found == null)
     {
       tooltip = null;
@@ -568,40 +515,22 @@ public class RotatableCanvas extends Panel implements MouseListener,
     repaint();
   }
 
+  @Override
   public void mouseDragged(MouseEvent evt)
   {
-    mx = evt.getX();
-    my = evt.getY();
-
-    rotmat.setIdentity();
+    int xPos = evt.getX();
+    int yPos = evt.getY();
 
-    rotmat.rotate((float) (my - omy), 'x');
-    rotmat.rotate((float) (mx - omx), 'y');
-
-    for (int i = 0; i < npoint; i++)
+    if (xPos == mouseX && yPos == mouseY)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      sp.coord[0] -= centre[0];
-      sp.coord[1] -= centre[1];
-      sp.coord[2] -= centre[2];
-
-      // Now apply the rotation matrix
-      sp.coord = rotmat.vectorMultiply(sp.coord);
-
-      // Now translate back again
-      sp.coord[0] += centre[0];
-      sp.coord[1] += centre[1];
-      sp.coord[2] += centre[2];
+      return;
     }
 
-    for (int i = 0; i < 3; i++)
-    {
-      axes[i] = rotmat.vectorMultiply(axes[i]);
-    }
-    omx = mx;
-    omy = my;
+    int xDelta = xPos - mouseX;
+    int yDelta = yPos - mouseY;
 
-    paint(this.getGraphics());
+    rotate(xDelta, yDelta);
+    repaint();
   }
 
   public void rectSelect(int x1, int y1, int x2, int y2)
@@ -609,29 +538,38 @@ public class RotatableCanvas extends Panel implements MouseListener,
     // boolean changedSel = false;
     for (int i = 0; i < npoint; i++)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int tmp1 = (int) ((sp.coord[0] - centre[0]) * scale
-              + (float) getSize().width / 2.0);
-      int tmp2 = (int) ((sp.coord[1] - centre[1]) * scale
-              + (float) getSize().height / 2.0);
+      SequencePoint sp = points.get(i);
+      int tmp1 = (int) ((sp.coord.x - centre.x) * scale
+              + getSize().width / 2.0);
+      int tmp2 = (int) ((sp.coord.y - centre.y) * scale
+              + getSize().height / 2.0);
 
+      SequenceI sequence = sp.getSequence();
       if (tmp1 > x1 && tmp1 < x2 && tmp2 > y1 && tmp2 < y2)
       {
         if (av != null)
         {
           if (!av.getSelectionGroup().getSequences(null)
-                  .contains(sp.sequence))
+                  .contains(sequence))
           {
-            av.getSelectionGroup().addSequence(sp.sequence, true);
+            av.getSelectionGroup().addSequence(sequence, true);
           }
         }
       }
     }
   }
 
-  public SequenceI findPoint(int x, int y)
+  /**
+   * Answers the first sequence found whose point on the display is within 2
+   * pixels of the given coordinates, or null if none is found
+   * 
+   * @param x
+   * @param y
+   * 
+   * @return
+   */
+  public SequenceI findSequenceAtPoint(int x, int y)
   {
-
     int halfwidth = getSize().width / 2;
     int halfheight = getSize().height / 2;
 
@@ -640,20 +578,22 @@ public class RotatableCanvas extends Panel implements MouseListener,
     for (int i = 0; i < npoint; i++)
     {
 
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int px = (int) ((float) (sp.coord[0] - centre[0]) * scale)
+      SequencePoint sp = points.get(i);
+      int px = (int) ((sp.coord.x - centre.x) * scale)
               + halfwidth;
-      int py = (int) ((float) (sp.coord[1] - centre[1]) * scale)
+      int py = (int) ((sp.coord.y - centre.y) * scale)
               + halfheight;
 
       if (Math.abs(px - x) < 3 && Math.abs(py - y) < 3)
       {
         found = i;
+        break;
       }
     }
+
     if (found != -1)
     {
-      return ((SequencePoint) points.elementAt(found)).sequence;
+      return points.get(found).getSequence();
     }
     else
     {
@@ -661,4 +601,79 @@ public class RotatableCanvas extends Panel implements MouseListener,
     }
   }
 
+  /**
+   * Resets the view to initial state (no rotation)
+   */
+  public void resetView()
+  {
+    img = null;
+    resetAxes();
+  }
+
+  @Override
+  public void zoom(float factor)
+  {
+    if (factor > 0f)
+    {
+      scalefactor *= factor;
+    }
+    scale = findScale();
+  }
+
+  @Override
+  public void rotate(float x, float y)
+  {
+    if (x == 0f && y == 0f)
+    {
+      return;
+    }
+  
+    /*
+     * get the identity transformation...
+     */
+    RotatableMatrix rotmat = new RotatableMatrix();
+  
+    /*
+     * rotate around the X axis for change in Y
+     * (mouse movement up/down); note we are equating a
+     * number of pixels with degrees of rotation here!
+     */
+    if (y != 0)
+    {
+      rotmat.rotate(y, Axis.X);
+    }
+  
+    /*
+     * rotate around the Y axis for change in X
+     * (mouse movement left/right)
+     */
+    if (x != 0)
+    {
+      rotmat.rotate(x, Axis.Y);
+    }
+  
+    /*
+     * apply the composite transformation to sequence points
+     */
+    for (int i = 0; i < npoint; i++)
+    {
+      SequencePoint sp = points.get(i);
+      sp.translate(-centre.x, -centre.y, -centre.z);
+
+      // Now apply the rotation matrix
+      sp.coord = rotmat.vectorMultiply(sp.coord);
+
+      // Now translate back again
+      sp.translate(centre.x, centre.y, centre.z);
+    }
+  
+    /*
+     * rotate the x/y/z axis positions
+     */
+    for (int i = 0; i < DIMS; i++)
+    {
+      axisEndPoints[i] = rotmat.vectorMultiply(axisEndPoints[i]);
+    }
+  }
+
 }
diff --git a/src/jalview/datamodel/Point.java b/src/jalview/datamodel/Point.java
new file mode 100644 (file)
index 0000000..e7c77c0
--- /dev/null
@@ -0,0 +1,71 @@
+package jalview.datamodel;
+
+/**
+ * A bean that models an (x, y, z) position in 3-D space
+ */
+public final class Point
+{
+  public final float x;
+
+  public final float y;
+
+  public final float z;
+
+  public Point(float xVal, float yVal, float zVal)
+  {
+    x = xVal;
+    y = yVal;
+    z = zVal;
+  }
+
+  /**
+   * toString for convenience of inspection in debugging or logging
+   */
+  @Override
+  public String toString()
+  {
+    return String.format("[%f, %f, %f]", x, y, z);
+  }
+
+  @Override
+  public int hashCode()
+  {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + Float.floatToIntBits(x);
+    result = prime * result + Float.floatToIntBits(y);
+    result = prime * result + Float.floatToIntBits(z);
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj)
+  {
+    if (this == obj)
+    {
+      return true;
+    }
+    if (obj == null)
+    {
+      return false;
+    }
+    if (getClass() != obj.getClass())
+    {
+      return false;
+    }
+    Point other = (Point) obj;
+    if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x))
+    {
+      return false;
+    }
+    if (Float.floatToIntBits(y) != Float.floatToIntBits(other.y))
+    {
+      return false;
+    }
+    if (Float.floatToIntBits(z) != Float.floatToIntBits(other.z))
+    {
+      return false;
+    }
+    return true;
+  }
+}
index a6b967e..3db7cee 100755 (executable)
 package jalview.datamodel;
 
 /**
- * DOCUMENT ME!
- * 
- * @author $author$
- * @version $Revision$
+ * A bean that models a set of (x, y, z) values and a reference to a sequence.
+ * As used in Principal Component Analysis, the (x, y, z) values are the
+ * sequence's score for the currently selected first, second and third
+ * dimensions of the PCA.
  */
 public class SequencePoint
 {
-  // SMJS PUBLIC
+  /*
+   * Associated alignment sequence, or dummy sequence object
+   */
+  private final SequenceI sequence;
+
+  /*
+   * x, y, z values
+   */
+  public Point coord;
+
   /**
-   * for points with no real physical association with an alignment sequence
+   * Constructor
+   * 
+   * @param sequence
+   * @param coord
    */
-  public boolean isPlaceholder = false;
+  public SequencePoint(SequenceI sequence, Point pt)
+  {
+    this.sequence = sequence;
+    this.coord = pt;
+  }
 
   /**
-   * Associated alignment sequence, or dummy sequence object.
+   * Constructor given a sequence and an array of x, y, z coordinate positions
+   * 
+   * @param sequence
+   * @param coords
+   * @throws ArrayIndexOutOfBoundsException
+   *           if array length is less than 3
    */
-  public SequenceI sequence;
+  public SequencePoint(SequenceI sequence, float[] coords)
+  {
+    this(sequence, new Point(coords[0], coords[1], coords[2]));
+  }
+
+  public SequenceI getSequence()
+  {
+    return sequence;
+  }
 
   /**
-   * array of coordinates in embedded sequence space.
+   * Applies a translation to the (x, y, z) coordinates
+   * 
+   * @param centre
    */
-  public float[] coord;
+  public void translate(float x, float y, float z)
+  {
+    coord = new Point(coord.x + x, coord.y + y, coord.z + z);
+  }
 
-  // SMJS ENDPUBLIC
-  public SequencePoint(SequenceI sequence, float[] coord)
+  /**
+   * string representation for ease of inspection in debugging or logging only
+   */
+  @Override
+  public String toString()
   {
-    this.sequence = sequence;
-    this.coord = coord;
+    return sequence.getName() + " " + coord.toString();
   }
 }
index 183419e..336a312 100644 (file)
@@ -25,6 +25,7 @@ import jalview.analysis.scoremodels.ScoreModels;
 import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
 import jalview.datamodel.SequenceGroup;
 import jalview.util.MessageManager;
 
@@ -103,7 +104,7 @@ public class CalculationChooser extends JPanel
 
   final ComboBoxTooltipRenderer renderer = new ComboBoxTooltipRenderer();
 
-  List<String> tips = new ArrayList<String>();
+  List<String> tips = new ArrayList<>();
 
   /*
    * the most recently opened PCA results panel
@@ -375,7 +376,7 @@ public class CalculationChooser extends JPanel
    */
   protected JComboBox<String> buildModelOptionsList()
   {
-    final JComboBox<String> scoreModelsCombo = new JComboBox<String>();
+    final JComboBox<String> scoreModelsCombo = new JComboBox<>();
     scoreModelsCombo.setRenderer(renderer);
 
     /*
@@ -418,39 +419,42 @@ public class CalculationChooser extends JPanel
   {
     Object curSel = comboBox.getSelectedItem();
     toolTips.clear();
-    DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
+    DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
+
+    /*
+     * select the score models applicable to the alignment type
+     */
+    boolean nucleotide = af.getViewport().getAlignment().isNucleotide();
+    List<ScoreModelI> models = getApplicableScoreModels(nucleotide,
+            pca.isSelected());
 
     /*
      * now we can actually add entries to the combobox,
      * remembering their descriptions for tooltips
      */
-    ScoreModels scoreModels = ScoreModels.getInstance();
     boolean selectedIsPresent = false;
-    for (ScoreModelI sm : scoreModels.getModels())
+    for (ScoreModelI sm : models)
     {
-      boolean nucleotide = af.getViewport().getAlignment().isNucleotide();
-      if (sm.isDNA() && nucleotide || sm.isProtein() && !nucleotide)
+      if (curSel != null && sm.getName().equals(curSel))
+      {
+        selectedIsPresent = true;
+        curSel = sm.getName();
+      }
+      model.addElement(sm.getName());
+
+      /*
+       * tooltip is description if provided, else text lookup with
+       * fallback on the model name
+       */
+      String tooltip = sm.getDescription();
+      if (tooltip == null)
       {
-        if (curSel != null && sm.getName().equals(curSel))
-        {
-          selectedIsPresent = true;
-          curSel = sm.getName();
-        }
-        model.addElement(sm.getName());
-
-        /*
-         * tooltip is description if provided, else text lookup with
-         * fallback on the model name
-         */
-        String tooltip = sm.getDescription();
-        if (tooltip == null)
-        {
-          tooltip = MessageManager.getStringOrReturn("label.score_model_",
-                  sm.getName());
-        }
-        toolTips.add(tooltip);
+        tooltip = MessageManager.getStringOrReturn("label.score_model_",
+                sm.getName());
       }
+      toolTips.add(tooltip);
     }
+
     if (selectedIsPresent)
     {
       model.setSelectedItem(curSel);
@@ -460,6 +464,47 @@ public class CalculationChooser extends JPanel
   }
 
   /**
+   * Builds a list of score models which are applicable for the alignment and
+   * calculation type (peptide or generic models for protein, nucleotide or
+   * generic models for nucleotide).
+   * <p>
+   * As a special case, includes BLOSUM62 as an extra option for nucleotide PCA.
+   * This is for backwards compatibility with Jalview prior to 2.8 when BLOSUM62
+   * was the only score matrix supported. This is included if property
+   * BLOSUM62_PCA_FOR_NUCLEOTIDE is set to true in the Jalview properties file.
+   * 
+   * @param nucleotide
+   * @param forPca
+   * @return
+   */
+  protected static List<ScoreModelI> getApplicableScoreModels(
+          boolean nucleotide, boolean forPca)
+  {
+    List<ScoreModelI> filtered = new ArrayList<>();
+
+    ScoreModels scoreModels = ScoreModels.getInstance();
+    for (ScoreModelI sm : scoreModels.getModels())
+    {
+      if (!nucleotide && sm.isProtein() || nucleotide && sm.isDNA())
+      {
+        filtered.add(sm);
+      }
+    }
+
+    /*
+     * special case: add BLOSUM62 as last option for nucleotide PCA, 
+     * for backwards compatibility with Jalview < 2.8 (JAL-2962)
+     */
+    if (nucleotide && forPca
+            && Cache.getDefault("BLOSUM62_PCA_FOR_NUCLEOTIDE", false))
+    {
+      filtered.add(scoreModels.getBlosum62());
+    }
+
+    return filtered;
+  }
+
+  /**
    * Open and calculate the selected tree or PCA on 'OK'
    */
   protected void calculate_actionPerformed()
@@ -539,7 +584,13 @@ public class CalculationChooser extends JPanel
               JvOptionPane.WARNING_MESSAGE);
       return;
     }
+
+    /*
+     * construct the panel and kick off its calculation thread
+     */
     pcaPanel = new PCAPanel(af.alignPanel, modelName, params);
+    new Thread(pcaPanel).start();
+
   }
 
   /**
index 5cd8f9a..42760f3 100644 (file)
  */
 package jalview.gui;
 
+import static jalview.math.RotatableMatrix.Axis.X;
+import static jalview.math.RotatableMatrix.Axis.Y;
+import static jalview.math.RotatableMatrix.Axis.Z;
+
 import jalview.analysis.Conservation;
+import jalview.analysis.PCA;
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.FeatureColourI;
 import jalview.api.ViewStyleI;
+import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
 import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
 import jalview.datamodel.AlignedCodonFrame;
@@ -31,6 +40,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.GraphLine;
 import jalview.datamodel.PDBEntry;
+import jalview.datamodel.Point;
 import jalview.datamodel.RnaViewerModel;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceGroup;
@@ -45,16 +55,22 @@ import jalview.ext.varna.RnaModel;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.io.DataSourceType;
 import jalview.io.FileFormat;
+import jalview.math.Matrix;
+import jalview.math.MatrixI;
 import jalview.renderer.ResidueShaderI;
 import jalview.schemabinding.version2.AlcodMap;
 import jalview.schemabinding.version2.AlcodonFrame;
 import jalview.schemabinding.version2.Annotation;
 import jalview.schemabinding.version2.AnnotationColours;
 import jalview.schemabinding.version2.AnnotationElement;
+import jalview.schemabinding.version2.Axis;
 import jalview.schemabinding.version2.CalcIdParam;
-import jalview.schemabinding.version2.Colour;
 import jalview.schemabinding.version2.CompoundMatcher;
+import jalview.schemabinding.version2.D;
 import jalview.schemabinding.version2.DBRef;
+import jalview.schemabinding.version2.DoubleMatrix;
+import jalview.schemabinding.version2.E;
+import jalview.schemabinding.version2.EigenMatrix;
 import jalview.schemabinding.version2.Features;
 import jalview.schemabinding.version2.Group;
 import jalview.schemabinding.version2.HiddenColumns;
@@ -69,18 +85,26 @@ import jalview.schemabinding.version2.MappingChoice;
 import jalview.schemabinding.version2.MatchCondition;
 import jalview.schemabinding.version2.MatcherSet;
 import jalview.schemabinding.version2.OtherData;
+import jalview.schemabinding.version2.PairwiseMatrix;
+import jalview.schemabinding.version2.PcaData;
+import jalview.schemabinding.version2.PcaViewer;
 import jalview.schemabinding.version2.PdbentryItem;
 import jalview.schemabinding.version2.Pdbids;
 import jalview.schemabinding.version2.Property;
 import jalview.schemabinding.version2.RnaViewer;
+import jalview.schemabinding.version2.Row;
 import jalview.schemabinding.version2.SecondaryStructure;
+import jalview.schemabinding.version2.SeqPointMax;
+import jalview.schemabinding.version2.SeqPointMin;
 import jalview.schemabinding.version2.Sequence;
+import jalview.schemabinding.version2.SequencePoint;
 import jalview.schemabinding.version2.SequenceSet;
 import jalview.schemabinding.version2.SequenceSetProperties;
 import jalview.schemabinding.version2.Setting;
 import jalview.schemabinding.version2.StructureState;
 import jalview.schemabinding.version2.ThresholdLine;
 import jalview.schemabinding.version2.Tree;
+import jalview.schemabinding.version2.TridiagonalMatrix;
 import jalview.schemabinding.version2.UserColours;
 import jalview.schemabinding.version2.Viewport;
 import jalview.schemabinding.version2.types.ColourThreshTypeType;
@@ -101,6 +125,7 @@ import jalview.util.StringUtils;
 import jalview.util.jarInputStreamProvider;
 import jalview.util.matcher.Condition;
 import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.PCAModel;
 import jalview.viewmodel.ViewportRanges;
 import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
 import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
@@ -1130,6 +1155,7 @@ public class Jalview2XML
               tree.setXpos(tp.getX());
               tree.setYpos(tp.getY());
               tree.setId(makeHashCode(tp, null));
+              tree.setLinkToAllViews(tp.treeCanvas.applyToAllViews);
               jms.addTree(tree);
             }
           }
@@ -1137,6 +1163,24 @@ public class Jalview2XML
       }
     }
 
+    /*
+     * save PCA viewers
+     */
+    if (!storeDS && Desktop.desktop != null)
+    {
+      for (JInternalFrame frame : Desktop.desktop.getAllFrames())
+      {
+        if (frame instanceof PCAPanel)
+        {
+          PCAPanel panel = (PCAPanel) frame;
+          if (panel.av.getAlignment() == jal)
+          {
+            savePCA(panel, jms);
+          }
+        }
+      }
+    }
+
     // SAVE ANNOTATIONS
     /**
      * store forward refs from an annotationRow to any groups
@@ -1514,6 +1558,165 @@ public class Jalview2XML
   }
 
   /**
+   * Writes PCA viewer attributes and computed values to an XML model object and adds it to the JalviewModel. Any exceptions are reported by logging.
+   */
+  protected void savePCA(PCAPanel panel, JalviewModelSequence jms)
+  {
+    try
+    {
+      PcaViewer viewer = new PcaViewer();
+      viewer.setHeight(panel.getHeight());
+      viewer.setWidth(panel.getWidth());
+      viewer.setXpos(panel.getX());
+      viewer.setYpos(panel.getY());
+      viewer.setTitle(panel.getTitle());
+      PCAModel pcaModel = panel.pcaModel;
+      viewer.setScoreModelName(pcaModel.getScoreModelName());
+      viewer.setXDim(panel.getSelectedDimensionIndex(X));
+      viewer.setYDim(panel.getSelectedDimensionIndex(Y));
+      viewer.setZDim(panel.getSelectedDimensionIndex(Z));
+      viewer.setBgColour(panel.rc.getBackgroundColour().getRGB());
+      viewer.setScaleFactor(panel.rc.scaleFactor);
+      float[] spMin = panel.rc.getSeqMin();
+      SeqPointMin spmin = new SeqPointMin();
+      spmin.setXPos(spMin[0]);
+      spmin.setYPos(spMin[1]);
+      spmin.setZPos(spMin[2]);
+      viewer.setSeqPointMin(spmin);
+      float[] spMax = panel.rc.getSeqMax();
+      SeqPointMax spmax = new SeqPointMax();
+      spmax.setXPos(spMax[0]);
+      spmax.setYPos(spMax[1]);
+      spmax.setZPos(spMax[2]);
+      viewer.setSeqPointMax(spmax);
+      viewer.setShowLabels(panel.rc.showLabels);
+      viewer.setLinkToAllViews(panel.rc.applyToAllViews);
+      SimilarityParamsI sp = pcaModel.getSimilarityParameters();
+      viewer.setIncludeGaps(sp.includeGaps());
+      viewer.setMatchGaps(sp.matchGaps());
+      viewer.setIncludeGappedColumns(sp.includeGappedColumns());
+      viewer.setDenominateByShortestLength(sp.denominateByShortestLength());
+
+      /*
+       * sequence points on display
+       */
+      for (jalview.datamodel.SequencePoint spt : pcaModel
+              .getSequencePoints())
+      {
+        SequencePoint point = new SequencePoint();
+        point.setSequenceRef(seqHash(spt.getSequence()));
+        point.setXPos(spt.coord.x);
+        point.setYPos(spt.coord.y);
+        point.setZPos(spt.coord.z);
+        viewer.addSequencePoint(point);
+      }
+
+      /*
+       * (end points of) axes on display
+       */
+      for (Point p : panel.rc.axisEndPoints)
+      {
+        Axis axis = new Axis();
+        axis.setXPos(p.x);
+        axis.setYPos(p.y);
+        axis.setZPos(p.z);
+        viewer.addAxis(axis);
+      }
+
+      /*
+       * raw PCA data (note we are not restoring PCA inputs here -
+       * alignment view, score model, similarity parameters)
+       */
+      PcaData data = new PcaData();
+      viewer.setPcaData(data);
+      PCA pca = pcaModel.getPcaData();
+
+      PairwiseMatrix pm = new PairwiseMatrix();
+      saveDoubleMatrix(pca.getPairwiseScores(), pm);
+      data.setPairwiseMatrix(pm);
+
+      TridiagonalMatrix tm = new TridiagonalMatrix();
+      saveDoubleMatrix(pca.getTridiagonal(), tm);
+      data.setTridiagonalMatrix(tm);
+
+      EigenMatrix eigenMatrix = new EigenMatrix();
+      data.setEigenMatrix(eigenMatrix);
+      saveDoubleMatrix(pca.getEigenmatrix(), eigenMatrix);
+
+      jms.addPcaViewer(viewer);
+    } catch (Throwable t)
+    {
+      Cache.log.error("Error saving PCA: " + t.getMessage());
+    }
+  }
+
+  /**
+   * Stores values from a matrix into an XML element, including (if present) the
+   * D or E vectors
+   * 
+   * @param m
+   * @param xmlMatrix
+   * @see #loadDoubleMatrix(DoubleMatrix)
+   */
+  protected void saveDoubleMatrix(MatrixI m, DoubleMatrix xmlMatrix)
+  {
+    xmlMatrix.setRows(m.height());
+    xmlMatrix.setColumns(m.width());
+    for (int i = 0; i < m.height(); i++)
+    {
+      Row row = new Row();
+      for (int j = 0; j < m.width(); j++)
+      {
+        row.addV(m.getValue(i, j));
+      }
+      xmlMatrix.addRow(row);
+    }
+    if (m.getD() != null)
+    {
+      D dVector = new D();
+      dVector.setV(m.getD());
+      xmlMatrix.setD(dVector);
+    }
+    if (m.getE() != null)
+    {
+      E eVector = new E();
+      eVector.setV(m.getE());
+      xmlMatrix.setE(eVector);
+    }
+  }
+
+  /**
+   * Loads XML matrix data into a new Matrix object, including the D and/or E
+   * vectors (if present)
+   * 
+   * @param mData
+   * @return
+   * @see Jalview2XML#saveDoubleMatrix(MatrixI, DoubleMatrix)
+   */
+  protected MatrixI loadDoubleMatrix(DoubleMatrix mData)
+  {
+    int rows = mData.getRows();
+    double[][] vals = new double[rows][];
+
+    for (int i = 0; i < rows; i++)
+    {
+      vals[i] = mData.getRow(i).getV();
+    }
+
+    MatrixI m = new Matrix(vals);
+    
+    if (mData.getD() != null) {
+      m.setD(mData.getD().getV());
+    }
+    if (mData.getE() != null)
+    {
+      m.setE(mData.getE().getV());
+    }
+
+    return m;
+  }
+
+  /**
    * Save any Varna viewers linked to this sequence. Writes an rnaViewer element
    * for each viewer, with
    * <ul>
@@ -3642,6 +3845,7 @@ public class Jalview2XML
     if (loadTreesAndStructures)
     {
       loadTrees(jms, view, af, av, ap);
+      loadPCAViewers(jms, ap);
       loadPDBStructures(jprovider, jseqs, af, ap);
       loadRnaViewers(jprovider, jseqs, ap);
     }
@@ -3789,7 +3993,6 @@ public class Jalview2XML
           // works still
           tp.getTreeCanvas().setViewport(av); // af.viewport;
           tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
-
         }
         if (tp == null)
         {
@@ -3817,6 +4020,7 @@ public class Jalview2XML
         tp.showDistances(tree.getShowDistances());
 
         tp.getTreeCanvas().setThreshold(tree.getThreshold());
+        tp.treeCanvas.applyToAllViews = tree.isLinkToAllViews();
 
         if (tree.getCurrentTree())
         {
@@ -5751,6 +5955,126 @@ public class Jalview2XML
   }
 
   /**
+   * Loads any saved PCA viewers
+   * 
+   * @param jms
+   * @param ap
+   */
+  protected void loadPCAViewers(JalviewModelSequence jms, AlignmentPanel ap)
+  {
+    try
+    {
+      for (int t = 0; t < jms.getPcaViewerCount(); t++)
+      {
+        PcaViewer viewer = jms.getPcaViewer(t);
+        String modelName = viewer.getScoreModelName();
+        SimilarityParamsI params = new SimilarityParams(
+                viewer.isIncludeGappedColumns(),
+                viewer.isMatchGaps(), viewer.isIncludeGaps(),
+                viewer.isDenominateByShortestLength());
+
+        /*
+         * create the panel (without computing the PCA)
+         */
+        PCAPanel panel = new PCAPanel(ap, modelName, params);
+
+        panel.setTitle(viewer.getTitle());
+        panel.setBounds(new Rectangle(viewer.getXpos(), viewer.getYpos(),
+                viewer.getWidth(), viewer.getHeight()));
+  
+        boolean showLabels = viewer.isShowLabels();
+        panel.setShowLabels(showLabels);
+        panel.rc.showLabels = showLabels;
+        panel.rc.bgColour = new Color(viewer.getBgColour());
+        panel.rc.applyToAllViews = viewer.isLinkToAllViews();
+
+        /*
+         * load PCA output data
+         */
+        ScoreModelI scoreModel = ScoreModels.getInstance()
+                .getScoreModel(modelName, ap);
+        PCA pca = new PCA(null, scoreModel, params);
+        PcaData pcaData = viewer.getPcaData();
+
+        MatrixI pairwise = loadDoubleMatrix(pcaData.getPairwiseMatrix());
+        pca.setPairwiseScores(pairwise);
+
+        MatrixI triDiag = loadDoubleMatrix(pcaData.getTridiagonalMatrix());
+        pca.setTridiagonal(triDiag);
+
+        MatrixI result = loadDoubleMatrix(pcaData.getEigenMatrix());
+        pca.setEigenmatrix(result);
+
+        panel.pcaModel.setPCA(pca);
+
+        /*
+         * we haven't saved the input data! (JAL-2647 to do)
+         */
+        panel.setInputData(null);
+
+        /*
+         * add the sequence points for the PCA display
+         */
+        List<jalview.datamodel.SequencePoint> seqPoints = new ArrayList<>();
+        for (SequencePoint sp : viewer.getSequencePoint())
+        {
+          String seqId = sp.getSequenceRef();
+          SequenceI seq = seqRefIds.get(seqId);
+          if (seq == null)
+          {
+            throw new IllegalStateException(
+                    "Unmatched seqref for PCA: " + seqId);
+          }
+          Point pt = new Point(sp.getXPos(), sp.getYPos(), sp.getZPos());
+          jalview.datamodel.SequencePoint seqPoint = new jalview.datamodel.SequencePoint(
+                  seq, pt);
+          seqPoints.add(seqPoint);
+        }
+        panel.rc.setPoints(seqPoints, seqPoints.size());
+
+        /*
+         * set min-max ranges and scale after setPoints (which recomputes them)
+         */
+        panel.rc.scaleFactor = viewer.getScaleFactor();
+        SeqPointMin spMin = viewer.getSeqPointMin();
+        float[] min = new float[] { spMin.getXPos(), spMin.getYPos(),
+            spMin.getZPos() };
+        SeqPointMax spMax = viewer.getSeqPointMax();
+        float[] max = new float[] { spMax.getXPos(), spMax.getYPos(),
+            spMax.getZPos() };
+        panel.rc.setSeqMinMax(min, max);
+
+        // todo: hold points list in PCAModel only
+        panel.pcaModel.setSequencePoints(seqPoints);
+
+        panel.setSelectedDimensionIndex(viewer.getXDim(), X);
+        panel.setSelectedDimensionIndex(viewer.getYDim(), Y);
+        panel.setSelectedDimensionIndex(viewer.getZDim(), Z);
+
+        // is this duplication needed?
+        panel.top = seqPoints.size() - 1;
+        panel.pcaModel.setTop(seqPoints.size() - 1);
+
+        /*
+         * add the axes' end points for the display
+         */
+        for (int i = 0; i < 3; i++)
+        {
+          Axis axis = viewer.getAxis(i);
+          panel.rc.axisEndPoints[i] = new Point(axis.getXPos(),
+                  axis.getYPos(), axis.getZPos());
+        }
+
+        Desktop.addInternalFrame(panel, MessageManager.formatMessage(
+                "label.calc_title", "PCA", modelName), 475, 450);
+      }
+    } catch (Exception ex)
+    {
+      Cache.log.error("Error loading PCA: " + ex.toString());
+    }
+  }
+
+  /**
    * Populates an XML model of the feature colour scheme for one feature type
    * 
    * @param featureType
index c1e935a..da1dffe 100644 (file)
 package jalview.gui;
 
 import jalview.analysis.scoremodels.ScoreModels;
-import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.SequenceI;
 import jalview.jbgui.GPCAPanel;
+import jalview.math.RotatableMatrix.Axis;
+import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.PCAModel;
@@ -46,7 +48,6 @@ import java.awt.print.PrinterException;
 import java.awt.print.PrinterJob;
 
 import javax.swing.ButtonGroup;
-import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JColorChooser;
 import javax.swing.JMenuItem;
 import javax.swing.JRadioButtonMenuItem;
@@ -54,16 +55,14 @@ import javax.swing.event.InternalFrameAdapter;
 import javax.swing.event.InternalFrameEvent;
 
 /**
- * DOCUMENT ME!
- * 
- * @author $author$
- * @version $Revision$
+ * The panel holding the Principal Component Analysis 3-D visualisation
  */
 public class PCAPanel extends GPCAPanel
         implements Runnable, IProgressIndicator
 {
+  private static final int MIN_WIDTH = 470;
 
-  private IProgressIndicator progressBar;
+  private static final int MIN_HEIGHT = 250;
 
   RotatableCanvas rc;
 
@@ -73,28 +72,11 @@ public class PCAPanel extends GPCAPanel
 
   PCAModel pcaModel;
 
-  private static final int MIN_WIDTH = 470;
-
-  private static final int MIN_HEIGHT = 250;
-
   int top = 0;
 
-  private boolean working;
+  private IProgressIndicator progressBar;
 
-  /**
-   * Creates a new PCAPanel object using default score model and parameters
-   * 
-   * @param alignPanel
-   */
-  public PCAPanel(AlignmentPanel alignPanel)
-  {
-    this(alignPanel,
-            ScoreModels.getInstance()
-                    .getDefaultModel(
-                            !alignPanel.av.getAlignment().isNucleotide())
-                    .getName(),
-            SimilarityParams.SeqSpace);
-  }
+  private boolean working;
 
   /**
    * Constructor given sequence data, a similarity (or distance) score model
@@ -144,8 +126,11 @@ public class PCAPanel extends GPCAPanel
 
     rc = new RotatableCanvas(alignPanel);
     this.getContentPane().add(rc, BorderLayout.CENTER);
-    Thread worker = new Thread(this);
-    worker.start();
+
+    addKeyListener(rc);
+    validate();
+
+    this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
   }
 
   /**
@@ -157,58 +142,8 @@ public class PCAPanel extends GPCAPanel
     pcaModel = null;
   }
 
-  /**
-   * Repopulate the options and actions under the score model menu when it is
-   * selected. Options will depend on whether 'nucleotide' or 'peptide'
-   * modelling is selected (and also possibly on whether any additional score
-   * models have been added).
-   */
-  @Override
-  protected void scoreModel_menuSelected()
-  {
-    scoreModelMenu.removeAll();
-    for (final ScoreModelI sm : ScoreModels.getInstance().getModels())
-    {
-      final String name = sm.getName();
-      JCheckBoxMenuItem jm = new JCheckBoxMenuItem(name);
-
-      /*
-       * if the score model doesn't provide a description, try to look one
-       * up in the text bundle, falling back on its name
-       */
-      String tooltip = sm.getDescription();
-      if (tooltip == null)
-      {
-        tooltip = MessageManager.getStringOrReturn("label.score_model_",
-                name);
-      }
-      jm.setToolTipText(tooltip);
-      jm.setSelected(pcaModel.getScoreModelName().equals(name));
-      if ((pcaModel.isNucleotide() && sm.isDNA())
-              || (!pcaModel.isNucleotide() && sm.isProtein()))
-      {
-        jm.addActionListener(new ActionListener()
-        {
-          @Override
-          public void actionPerformed(ActionEvent e)
-          {
-            if (!pcaModel.getScoreModelName().equals(name))
-            {
-              ScoreModelI sm2 = ScoreModels.getInstance()
-                      .getScoreModel(name, ap);
-              pcaModel.setScoreModel(sm2);
-              Thread worker = new Thread(PCAPanel.this);
-              worker.start();
-            }
-          }
-        });
-        scoreModelMenu.add(jm);
-      }
-    }
-  }
-
   @Override
-  public void bgcolour_actionPerformed(ActionEvent e)
+  protected void bgcolour_actionPerformed()
   {
     Color col = JColorChooser.showDialog(this,
             MessageManager.getString("label.select_background_colour"),
@@ -222,11 +157,12 @@ public class PCAPanel extends GPCAPanel
   }
 
   /**
-   * DOCUMENT ME!
+   * Calculates the PCA and displays the results
    */
   @Override
   public void run()
   {
+    working = true;
     long progId = System.currentTimeMillis();
     IProgressIndicator progress = this;
     String message = MessageManager.getString("label.pca_recalculating");
@@ -236,20 +172,16 @@ public class PCAPanel extends GPCAPanel
       message = MessageManager.getString("label.pca_calculating");
     }
     progress.setProgressBar(message, progId);
-    working = true;
     try
     {
-      calcSettings.setEnabled(false);
-      pcaModel.run();
-      // ////////////////
+      pcaModel.calculate();
+
       xCombobox.setSelectedIndex(0);
       yCombobox.setSelectedIndex(1);
       zCombobox.setSelectedIndex(2);
 
       pcaModel.updateRc(rc);
       // rc.invalidate();
-      nuclSetting.setSelected(pcaModel.isNucleotide());
-      protSetting.setSelected(!pcaModel.isNucleotide());
       top = pcaModel.getTop();
 
     } catch (OutOfMemoryError er)
@@ -261,50 +193,24 @@ public class PCAPanel extends GPCAPanel
     {
       progress.setProgressBar("", progId);
     }
-    calcSettings.setEnabled(true);
+
     repaint();
     if (getParent() == null)
     {
-      addKeyListener(rc);
-      Desktop.addInternalFrame(this, MessageManager
-              .getString("label.principal_component_analysis"), 475, 450);
-      this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
+      Desktop.addInternalFrame(this,
+              MessageManager.formatMessage("label.calc_title", "PCA",
+                      pcaModel.getScoreModelName()),
+              475, 450);
     }
     working = false;
   }
 
-  @Override
-  protected void nuclSetting_actionPerfomed(ActionEvent arg0)
-  {
-    if (!pcaModel.isNucleotide())
-    {
-      pcaModel.setNucleotide(true);
-      pcaModel.setScoreModel(
-              ScoreModels.getInstance().getDefaultModel(false));
-      Thread worker = new Thread(this);
-      worker.start();
-    }
-
-  }
-
-  @Override
-  protected void protSetting_actionPerfomed(ActionEvent arg0)
-  {
-
-    if (pcaModel.isNucleotide())
-    {
-      pcaModel.setNucleotide(false);
-      pcaModel.setScoreModel(
-              ScoreModels.getInstance().getDefaultModel(true));
-      Thread worker = new Thread(this);
-      worker.start();
-    }
-  }
-
   /**
-   * DOCUMENT ME!
+   * Updates the PCA display after a change of component to use for x, y or z
+   * axis
    */
-  void doDimensionChange()
+  @Override
+  protected void doDimensionChange()
   {
     if (top == 0)
     {
@@ -315,50 +221,35 @@ public class PCAPanel extends GPCAPanel
     int dim2 = top - yCombobox.getSelectedIndex();
     int dim3 = top - zCombobox.getSelectedIndex();
     pcaModel.updateRcView(dim1, dim2, dim3);
-    rc.img = null;
-    rc.rotmat.setIdentity();
-    rc.initAxes();
-    rc.paint(rc.getGraphics());
+    rc.resetView();
   }
 
   /**
-   * DOCUMENT ME!
+   * Sets the selected checkbox item index for PCA dimension (1, 2, 3...) for
+   * the given axis (X/Y/Z)
    * 
-   * @param e
-   *          DOCUMENT ME!
+   * @param index
+   * @param axis
    */
-  @Override
-  protected void xCombobox_actionPerformed(ActionEvent e)
+  public void setSelectedDimensionIndex(int index, Axis axis)
   {
-    doDimensionChange();
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param e
-   *          DOCUMENT ME!
-   */
-  @Override
-  protected void yCombobox_actionPerformed(ActionEvent e)
-  {
-    doDimensionChange();
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param e
-   *          DOCUMENT ME!
-   */
-  @Override
-  protected void zCombobox_actionPerformed(ActionEvent e)
-  {
-    doDimensionChange();
+    switch (axis)
+    {
+    case X:
+      xCombobox.setSelectedIndex(index);
+      break;
+    case Y:
+      yCombobox.setSelectedIndex(index);
+      break;
+    case Z:
+      zCombobox.setSelectedIndex(index);
+      break;
+    default:
+    }
   }
 
   @Override
-  public void outputValues_actionPerformed(ActionEvent e)
+  protected void outputValues_actionPerformed()
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
     try
@@ -374,32 +265,35 @@ public class PCAPanel extends GPCAPanel
   }
 
   @Override
-  public void showLabels_actionPerformed(ActionEvent e)
+  protected void showLabels_actionPerformed()
   {
     rc.showLabels(showLabels.getState());
   }
 
   @Override
-  public void print_actionPerformed(ActionEvent e)
+  protected void print_actionPerformed()
   {
     PCAPrinter printer = new PCAPrinter();
     printer.start();
   }
 
+  /**
+   * If available, shows the data which formed the inputs for the PCA as a new
+   * alignment
+   */
   @Override
-  public void originalSeqData_actionPerformed(ActionEvent e)
+  public void originalSeqData_actionPerformed()
   {
-    // this was cut'n'pasted from the equivalent TreePanel method - we should
-    // make this an abstract function of all jalview analysis windows
-    if (pcaModel.getSeqtrings() == null)
+    // JAL-2647 disabled after load from project (until save to project done)
+    if (pcaModel.getInputData() == null)
     {
-      jalview.bin.Cache.log.info(
+      Cache.log.info(
               "Unexpected call to originalSeqData_actionPerformed - should have hidden this menu action.");
       return;
     }
     // decide if av alignment is sufficiently different to original data to
     // warrant a new window to be created
-    // create new alignmnt window with hidden regions (unhiding hidden regions
+    // create new alignment window with hidden regions (unhiding hidden regions
     // yields unaligned seqs)
     // or create a selection box around columns in alignment view
     // test Alignment(SeqCigar[])
@@ -412,8 +306,8 @@ public class PCAPanel extends GPCAPanel
     } catch (Exception ex)
     {
     }
-    ;
-    Object[] alAndColsel = pcaModel.getSeqtrings()
+
+    Object[] alAndColsel = pcaModel.getInputData()
             .getAlignmentAndHiddenColumns(gc);
 
     if (alAndColsel != null && alAndColsel[0] != null)
@@ -495,9 +389,9 @@ public class PCAPanel extends GPCAPanel
     {
       pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
 
-      rc.drawBackground(pg, rc.bgColour);
+      rc.drawBackground(pg);
       rc.drawScene(pg);
-      if (rc.drawAxes == true)
+      if (rc.drawAxes)
       {
         rc.drawAxes(pg);
       }
@@ -514,61 +408,53 @@ public class PCAPanel extends GPCAPanel
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @param e
-   *          DOCUMENT ME!
+   * Handler for 'Save as EPS' option
    */
   @Override
-  public void eps_actionPerformed(ActionEvent e)
+  protected void eps_actionPerformed()
   {
-    makePCAImage(jalview.util.ImageMaker.TYPE.EPS);
+    makePCAImage(ImageMaker.TYPE.EPS);
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @param e
-   *          DOCUMENT ME!
+   * Handler for 'Save as PNG' option
    */
   @Override
-  public void png_actionPerformed(ActionEvent e)
+  protected void png_actionPerformed()
   {
-    makePCAImage(jalview.util.ImageMaker.TYPE.PNG);
+    makePCAImage(ImageMaker.TYPE.PNG);
   }
 
-  void makePCAImage(jalview.util.ImageMaker.TYPE type)
+  void makePCAImage(ImageMaker.TYPE type)
   {
     int width = rc.getWidth();
     int height = rc.getHeight();
 
-    jalview.util.ImageMaker im;
-
-    if (type == jalview.util.ImageMaker.TYPE.PNG)
-    {
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from PCA",
-              width, height, null, null, null, 0, false);
-    }
-    else if (type == jalview.util.ImageMaker.TYPE.EPS)
-    {
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from PCA",
-              width, height, null, this.getTitle(), null, 0, false);
-    }
-    else
-    {
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
-              width, height, null, this.getTitle(), null, 0, false);
-
+    ImageMaker im;
+
+    switch (type)
+    {
+    case PNG:
+      im = new ImageMaker(this, ImageMaker.TYPE.PNG,
+              "Make PNG image from PCA", width, height, null, null, null, 0,
+              false);
+      break;
+    case EPS:
+      im = new ImageMaker(this, ImageMaker.TYPE.EPS,
+              "Make EPS file from PCA", width, height, null,
+              this.getTitle(), null, 0, false);
+      break;
+    default:
+      im = new ImageMaker(this, ImageMaker.TYPE.SVG,
+              "Make SVG file from PCA", width, height, null,
+              this.getTitle(), null, 0, false);
     }
 
     if (im.getGraphics() != null)
     {
-      rc.drawBackground(im.getGraphics(), Color.black);
+      rc.drawBackground(im.getGraphics());
       rc.drawScene(im.getGraphics());
-      if (rc.drawAxes == true)
+      if (rc.drawAxes)
       {
         rc.drawAxes(im.getGraphics());
       }
@@ -577,11 +463,15 @@ public class PCAPanel extends GPCAPanel
   }
 
   @Override
-  public void viewMenu_menuSelected()
+  protected void viewMenu_menuSelected()
   {
     buildAssociatedViewMenu();
   }
 
+  /**
+   * Builds the menu showing the choice of possible views (for the associated
+   * sequence data) to which the PCA may be linked
+   */
   void buildAssociatedViewMenu()
   {
     AlignmentPanel[] aps = PaintRefresher
@@ -604,9 +494,9 @@ public class PCAPanel extends GPCAPanel
 
     JRadioButtonMenuItem item;
     ButtonGroup buttonGroup = new ButtonGroup();
-    int i, iSize = aps.length;
-    final PCAPanel thisPCAPanel = this;
-    for (i = 0; i < iSize; i++)
+    int iSize = aps.length;
+
+    for (int i = 0; i < iSize; i++)
     {
       final AlignmentPanel ap = aps[i];
       item = new JRadioButtonMenuItem(ap.av.getViewName(), ap.av == rc.av);
@@ -617,9 +507,10 @@ public class PCAPanel extends GPCAPanel
         public void actionPerformed(ActionEvent evt)
         {
           rc.applyToAllViews = false;
-          rc.av = ap.av;
-          rc.ap = ap;
-          PaintRefresher.Register(thisPCAPanel, ap.av.getSequenceSetId());
+          rc.av = panel.av;
+          rc.ap = panel;
+          PaintRefresher.Register(PCAPanel.this,
+                  panel.av.getSequenceSetId());
         }
       });
 
@@ -652,7 +543,7 @@ public class PCAPanel extends GPCAPanel
    * )
    */
   @Override
-  protected void outputPoints_actionPerformed(ActionEvent e)
+  protected void outputPoints_actionPerformed()
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
     try
@@ -678,7 +569,7 @@ public class PCAPanel extends GPCAPanel
    * .ActionEvent)
    */
   @Override
-  protected void outputProjPoints_actionPerformed(ActionEvent e)
+  protected void outputProjPoints_actionPerformed()
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
     try
@@ -793,7 +684,7 @@ public class PCAPanel extends GPCAPanel
   }
 
   @Override
-  protected void resetButton_actionPerformed(ActionEvent e)
+  protected void resetButton_actionPerformed()
   {
     int t = top;
     top = 0; // ugly - prevents dimensionChanged events from being processed
@@ -812,4 +703,42 @@ public class PCAPanel extends GPCAPanel
   {
     return working;
   }
+
+  /**
+   * Answers the selected checkbox item index for PCA dimension for the X, Y or
+   * Z axis of the display
+   * 
+   * @param axis
+   * @return
+   */
+  public int getSelectedDimensionIndex(Axis axis)
+  {
+    switch (axis)
+    {
+    case X:
+      return xCombobox.getSelectedIndex();
+    case Y:
+      return yCombobox.getSelectedIndex();
+    default:
+      return zCombobox.getSelectedIndex();
+    }
+  }
+
+  public void setShowLabels(boolean show)
+  {
+    showLabels.setSelected(show);
+  }
+
+  /**
+   * Sets the input data used to calculate the PCA. This is provided for
+   * 'restore from project', which does not currently support this (AL-2647), so
+   * sets the value to null, and hides the menu option for "Input Data...". J
+   * 
+   * @param data
+   */
+  public void setInputData(AlignmentView data)
+  {
+    pcaModel.setInputData(data);
+    originalSeqData.setVisible(data != null);
+  }
 }
index 02368df..b00055b 100755 (executable)
 package jalview.gui;
 
 import jalview.api.RotatableCanvasI;
+import jalview.datamodel.Point;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.SequencePoint;
 import jalview.math.RotatableMatrix;
+import jalview.math.RotatableMatrix.Axis;
+import jalview.util.ColorUtils;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 
@@ -43,328 +46,192 @@ import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
 import java.awt.event.MouseWheelEvent;
 import java.awt.event.MouseWheelListener;
-import java.util.Vector;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
 
 import javax.swing.JPanel;
 import javax.swing.ToolTipManager;
 
 /**
- * DOCUMENT ME!
- * 
- * @author $author$
- * @version $Revision$
+ * Models a Panel on which a set of points, and optionally x/y/z axes, can be
+ * drawn, and rotated or zoomed with the mouse
  */
 public class RotatableCanvas extends JPanel implements MouseListener,
-        MouseMotionListener, KeyListener, RotatableCanvasI
+        MouseMotionListener, KeyListener, RotatableCanvasI,
+        MouseWheelListener
 {
-  RotatableMatrix idmat = new RotatableMatrix(3, 3);
+  private static final float ZOOM_OUT = 0.9f;
 
-  RotatableMatrix objmat = new RotatableMatrix(3, 3);
+  private static final float ZOOM_IN = 1.1f;
 
-  RotatableMatrix rotmat = new RotatableMatrix(3, 3);
+  /*
+   * pixels distance within which tooltip shows sequence name
+   */
+  private static final int NEARBY = 3;
 
-  // RubberbandRectangle rubberband;
-  boolean drawAxes = true;
+  private static final List<String> AXES = Arrays.asList("x", "y", "z");
 
-  int omx = 0;
+  private static final Color AXIS_COLOUR = Color.yellow;
 
-  int mx = 0;
+  private static final int DIMS = 3;
+
+  boolean drawAxes = true;
 
-  int omy = 0;
+  int mouseX;
 
-  int my = 0;
+  int mouseY;
 
   Image img;
 
   Graphics ig;
 
-  Dimension prefsize;
+  Dimension prefSize;
 
-  float[] centre = new float[3];
-
-  float[] width = new float[3];
-
-  float[] max = new float[3];
-
-  float[] min = new float[3];
+  /*
+   * the min-max [x, y, z] values of sequence points when the points
+   * were set on the object, or when the view is reset; 
+   * x and y ranges are not recomputed as points are rotated, as this
+   * would make scaling (zoom) unstable, but z ranges are (for correct
+   * graduated colour brightness based on z-coordinate)
+   */
+  float[] seqMin;
 
-  float maxwidth;
+  float[] seqMax;
 
-  float scale;
+  /*
+   * a scale factor used in drawing; when equal to 1, the points span
+   * half the available width or height (whichever is less); increase this
+   * factor to zoom in, decrease it to zoom out
+   */
+  float scaleFactor;
 
   int npoint;
 
-  Vector points;
-
-  float[][] orig;
-
-  float[][] axes;
-
-  int startx;
-
-  int starty;
-
-  int lastx;
-
-  int lasty;
-
-  int rectx1;
-
-  int recty1;
-
-  int rectx2;
+  /*
+   * sequences and their (x, y, z) PCA dimension values
+   */
+  List<SequencePoint> sequencePoints;
 
-  int recty2;
+  /*
+   * x, y, z axis end points (PCA dimension values)
+   */
+  Point[] axisEndPoints;
 
-  float scalefactor = 1;
+  // fields for 'select rectangle' (JAL-1124)
+  // int rectx1;
+  // int recty1;
+  // int rectx2;
+  // int recty2;
 
   AlignmentViewport av;
 
   AlignmentPanel ap;
 
-  boolean showLabels = false;
+  boolean showLabels;
 
-  Color bgColour = Color.black;
+  Color bgColour;
 
-  boolean applyToAllViews = false;
+  boolean applyToAllViews;
 
-  public RotatableCanvas(AlignmentPanel ap)
+  /**
+   * Constructor
+   * 
+   * @param panel
+   */
+  public RotatableCanvas(AlignmentPanel panel)
   {
-    this.av = ap.av;
-    this.ap = ap;
-
-    addMouseWheelListener(new MouseWheelListener()
-    {
-      @Override
-      public void mouseWheelMoved(MouseWheelEvent e)
-      {
-        double wheelRotation = e.getPreciseWheelRotation();
-        if (wheelRotation > 0)
-        {
-          /*
-           * zoom in
-           */
-          scale = (float) (scale * 1.1);
-          repaint();
-        }
-        else if (wheelRotation < 0)
-        {
-          /*
-           * zoom out
-           */
-          scale = (float) (scale * 0.9);
-          repaint();
-        }
-      }
-    });
-
+    this.av = panel.av;
+    this.ap = panel;
+    axisEndPoints = new Point[DIMS];
+    showLabels = false;
+    applyToAllViews = false;
+    bgColour = Color.BLACK;
+    resetAxes();
+
+    ToolTipManager.sharedInstance().registerComponent(this);
+
+    addMouseListener(this);
+    addMouseMotionListener(this);
+    addMouseWheelListener(this);
   }
 
-  public void showLabels(boolean b)
+  /**
+   * Refreshes the display with labels shown (or not)
+   * 
+   * @param show
+   */
+  public void showLabels(boolean show)
   {
-    showLabels = b;
+    showLabels = show;
     repaint();
   }
 
-  boolean first = true;
-
   @Override
-  public void setPoints(Vector points, int npoint)
+  public void setPoints(List<SequencePoint> points, int np)
   {
-    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);
-        }
-      }
-    }
+    this.sequencePoints = points;
+    this.npoint = np;
+    prefSize = getPreferredSize();
 
-    axes = new float[3][3];
-    initAxes();
+    findWidths();
 
-    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;
-        }
-      }
-    }
+    scaleFactor = 1f;
   }
 
   /**
-   * DOCUMENT ME!
+   * Resets axes to the initial state: x-axis to the right, y-axis up, z-axis to
+   * back (so obscured in a 2-D display)
    */
-  public void findWidth()
+  protected void resetAxes()
   {
-    max = new float[3];
-    min = new float[3];
-
-    max[0] = (float) -1e30;
-    max[1] = (float) -1e30;
-    max[2] = (float) -1e30;
-
-    min[0] = (float) 1e30;
-    min[1] = (float) 1e30;
-    min[2] = (float) 1e30;
-
-    for (int i = 0; i < 3; i++)
-    {
-      for (int j = 0; j < npoint; j++)
-      {
-        SequencePoint sp = (SequencePoint) points.elementAt(j);
-
-        if (sp.coord[i] >= max[i])
-        {
-          max[i] = sp.coord[i];
-        }
-
-        if (sp.coord[i] <= min[i])
-        {
-          min[i] = sp.coord[i];
-        }
-      }
-    }
-
-    // System.out.println("xmax " + max[0] + " min " + min[0]);
-    // System.out.println("ymax " + max[1] + " min " + min[1]);
-    // System.out.println("zmax " + max[2] + " min " + min[2]);
-    width[0] = Math.abs(max[0] - min[0]);
-    width[1] = Math.abs(max[1] - min[1]);
-    width[2] = Math.abs(max[2] - min[2]);
-
-    maxwidth = width[0];
-
-    if (width[1] > width[0])
-    {
-      maxwidth = width[1];
-    }
-
-    if (width[2] > width[1])
-    {
-      maxwidth = width[2];
-    }
-
-    // System.out.println("Maxwidth = " + maxwidth);
+    axisEndPoints[0] = new Point(1f, 0f, 0f);
+    axisEndPoints[1] = new Point(0f, 1f, 0f);
+    axisEndPoints[2] = new Point(0f, 0f, 1f);
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
+   * Computes and saves the min-max ranges of x/y/z positions of the sequence
+   * points
    */
-  public float findScale()
+  protected void findWidths()
   {
-    int dim;
-    int width;
-    int height;
-
-    if (getWidth() != 0)
-    {
-      width = getWidth();
-      height = getHeight();
-    }
-    else
-    {
-      width = prefsize.width;
-      height = prefsize.height;
-    }
-
-    if (width < height)
-    {
-      dim = width;
-    }
-    else
-    {
-      dim = height;
-    }
-
-    return (dim * scalefactor) / (2 * maxwidth);
+    float[] max = new float[DIMS];
+    float[] min = new float[DIMS];
+    
+    max[0] = -Float.MAX_VALUE;
+    max[1] = -Float.MAX_VALUE;
+    max[2] = -Float.MAX_VALUE;
+    
+    min[0] = Float.MAX_VALUE;
+    min[1] = Float.MAX_VALUE;
+    min[2] = Float.MAX_VALUE;
+    
+    for (SequencePoint sp : sequencePoints)
+    {
+      max[0] = Math.max(max[0], sp.coord.x);
+      max[1] = Math.max(max[1], sp.coord.y);
+      max[2] = Math.max(max[2], sp.coord.z);
+      min[0] = Math.min(min[0], sp.coord.x);
+      min[1] = Math.min(min[1], sp.coord.y);
+      min[2] = Math.min(min[2], sp.coord.z);
+    }
+    
+    seqMin = min;
+    seqMax = max;
   }
 
   /**
-   * DOCUMENT ME!
-   */
-  public void findCentre()
-  {
-    // Find centre coordinate
-    findWidth();
-
-    centre[0] = (max[0] + min[0]) / 2;
-    centre[1] = (max[1] + min[1]) / 2;
-    centre[2] = (max[2] + min[2]) / 2;
-
-    // System.out.println("Centre x " + centre[0]);
-    // System.out.println("Centre y " + centre[1]);
-    // System.out.println("Centre z " + centre[2]);
-  }
-
-  /**
-   * DOCUMENT ME!
+   * Answers the preferred size if it has been set, else 400 x 400
    * 
-   * @return DOCUMENT ME!
+   * @return
    */
   @Override
   public Dimension getPreferredSize()
   {
-    if (prefsize != null)
+    if (prefSize != null)
     {
-      return prefsize;
+      return prefSize;
     }
     else
     {
@@ -373,9 +240,10 @@ public class RotatableCanvas extends JPanel implements MouseListener,
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers the preferred size
    * 
-   * @return DOCUMENT ME!
+   * @return
+   * @see RotatableCanvas#getPreferredSize()
    */
   @Override
   public Dimension getMinimumSize()
@@ -384,10 +252,9 @@ public class RotatableCanvas extends JPanel implements MouseListener,
   }
 
   /**
-   * DOCUMENT ME!
+   * Repaints the panel
    * 
    * @param g
-   *          DOCUMENT ME!
    */
   @Override
   public void paintComponent(Graphics g1)
@@ -397,7 +264,7 @@ public class RotatableCanvas extends JPanel implements MouseListener,
 
     g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
             RenderingHints.VALUE_ANTIALIAS_ON);
-    if (points == null)
+    if (sequencePoints == null)
     {
       g.setFont(new Font("Verdana", Font.PLAIN, 18));
       g.drawString(
@@ -406,24 +273,24 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     }
     else
     {
-      // Only create the image at the beginning -
-      if ((img == null) || (prefsize.width != getWidth())
-              || (prefsize.height != getHeight()))
+      /*
+       * create the image at the beginning or after a resize
+       */
+      boolean resized = prefSize.width != getWidth()
+              || prefSize.height != getHeight();
+      if (img == null || resized)
       {
-        prefsize.width = getWidth();
-        prefsize.height = getHeight();
+        prefSize.width = getWidth();
+        prefSize.height = getHeight();
 
-        scale = findScale();
-
-        // System.out.println("New scale = " + scale);
         img = createImage(getWidth(), getHeight());
         ig = img.getGraphics();
       }
 
-      drawBackground(ig, bgColour);
+      drawBackground(ig);
       drawScene(ig);
 
-      if (drawAxes == true)
+      if (drawAxes)
       {
         drawAxes(ig);
       }
@@ -433,96 +300,110 @@ public class RotatableCanvas extends JPanel implements MouseListener,
   }
 
   /**
-   * DOCUMENT ME!
+   * Resets the rotation and choice of axes to the initial state (without change
+   * of scale factor)
+   */
+  public void resetView()
+  {
+    img = null;
+    findWidths();
+    resetAxes();
+    repaint();
+  }
+
+  /**
+   * Draws lines for the x, y, z axes
    * 
    * @param g
-   *          DOCUMENT ME!
    */
   public void drawAxes(Graphics g)
   {
+    g.setColor(AXIS_COLOUR);
 
-    g.setColor(Color.yellow);
+    int midX = getWidth() / 2;
+    int midY = getHeight() / 2;
+    float maxWidth = Math.max(Math.abs(seqMax[0] - seqMin[0]),
+            Math.abs(seqMax[1] - seqMin[1]));
+    int pix = Math.min(getWidth(), getHeight());
+    float scaleBy = pix * scaleFactor / (2f * maxWidth);
 
-    for (int i = 0; i < 3; i++)
+    for (int i = 0; i < DIMS; i++)
     {
-      g.drawLine(getWidth() / 2, getHeight() / 2,
-              (int) ((axes[i][0] * scale * max[0]) + (getWidth() / 2)),
-              (int) ((axes[i][1] * scale * max[1]) + (getHeight() / 2)));
+      g.drawLine(midX, midY,
+              midX + (int) (axisEndPoints[i].x * scaleBy * seqMax[0]),
+              midY + (int) (axisEndPoints[i].y * scaleBy * seqMax[1]));
     }
   }
 
   /**
-   * DOCUMENT ME!
+   * Fills the background with the currently configured background colour
    * 
    * @param g
-   *          DOCUMENT ME!
-   * @param col
-   *          DOCUMENT ME!
    */
-  public void drawBackground(Graphics g, Color col)
+  public void drawBackground(Graphics g)
   {
-    g.setColor(col);
-    g.fillRect(0, 0, prefsize.width, prefsize.height);
+    g.setColor(bgColour);
+    g.fillRect(0, 0, prefSize.width, prefSize.height);
   }
 
   /**
-   * DOCUMENT ME!
+   * Draws points (6x6 squares) for the sequences of the PCA, and labels
+   * (sequence names) if configured to do so. The sequence points colours are
+   * taken from the sequence ids in the alignment (converting black to white).
+   * Sequences 'at the back' (z-coordinate is negative) are shaded slightly
+   * darker to help give a 3-D sensation.
    * 
    * @param g
-   *          DOCUMENT ME!
    */
   public void drawScene(Graphics g1)
   {
-
     Graphics2D g = (Graphics2D) g1;
 
     g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
             RenderingHints.VALUE_ANTIALIAS_ON);
+    int pix = Math.min(getWidth(), getHeight());
+    float xWidth = Math.abs(seqMax[0] - seqMin[0]);
+    float yWidth = Math.abs(seqMax[1] - seqMin[1]);
+    float maxWidth = Math.max(xWidth, yWidth);
+    float scaleBy = pix * scaleFactor / (2f * maxWidth);
 
-    int halfwidth = getWidth() / 2;
-    int halfheight = getHeight() / 2;
+    float[] centre = getCentre();
 
     for (int i = 0; i < npoint; i++)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int x = (int) ((sp.coord[0] - centre[0]) * scale) + halfwidth;
-      int y = (int) ((sp.coord[1] - centre[1]) * scale)
-              + halfheight;
-      float z = sp.coord[1] - centre[2];
-
-      if (av.getSequenceColour(sp.sequence) == Color.black)
-      {
-        g.setColor(Color.white);
-      }
-      else
-      {
-        g.setColor(av.getSequenceColour(sp.sequence));
-      }
-
-      if (av.getSelectionGroup() != null)
-      {
-        if (av.getSelectionGroup().getSequences(null)
-                .contains(((SequencePoint) points.elementAt(i)).sequence))
-        {
-          g.setColor(Color.gray);
-        }
-      }
-
-      if (z < 0)
-      {
-        g.setColor(g.getColor().darker());
-      }
-
+      /*
+       * sequence point colour as sequence id, but
+       * gray if sequence is currently selected
+       */
+      SequencePoint sp = sequencePoints.get(i);
+      Color sequenceColour = getSequencePointColour(sp);
+      g.setColor(sequenceColour);
+
+      int halfwidth = getWidth() / 2;
+      int halfheight = getHeight() / 2;
+      int x = (int) ((sp.coord.x - centre[0]) * scaleBy) + halfwidth;
+      int y = (int) ((sp.coord.y - centre[1]) * scaleBy) + halfheight;
       g.fillRect(x - 3, y - 3, 6, 6);
+
       if (showLabels)
       {
         g.setColor(Color.red);
-        g.drawString(
-                ((SequencePoint) points.elementAt(i)).sequence.getName(),
-                x - 3, y - 4);
+        g.drawString(sp.getSequence().getName(), x - 3, y - 4);
+      }
+    }
+    if (showLabels)
+    {
+      g.setColor(AXIS_COLOUR);
+      int midX = getWidth() / 2;
+      int midY = getHeight() / 2;
+      Iterator<String> axes = AXES.iterator();
+      for (Point p : axisEndPoints)
+      {
+        int x = midX + (int) (p.x * scaleBy * seqMax[0]);
+        int y = midY + (int) (p.y * scaleBy * seqMax[1]);
+        g.drawString(axes.next(), x - 3, y - 4);
       }
     }
-
     // //Now the rectangle
     // if (rectx2 != -1 && recty2 != -1) {
     // g.setColor(Color.white);
@@ -532,128 +413,147 @@ public class RotatableCanvas extends JPanel implements MouseListener,
   }
 
   /**
-   * DOCUMENT ME!
+   * Determines the colour to use when drawing a sequence point. The colour is
+   * taken from the sequence id, with black converted to white, and then
+   * graduated from darker (at the back) to brighter (at the front) based on the
+   * z-axis coordinate of the point.
    * 
-   * @return DOCUMENT ME!
+   * @param sp
+   * @return
    */
-  public Dimension minimumsize()
+  protected Color getSequencePointColour(SequencePoint sp)
   {
-    return prefsize;
-  }
+    SequenceI sequence = sp.getSequence();
+    Color sequenceColour = av.getSequenceColour(sequence);
+    if (sequenceColour == Color.black)
+    {
+      sequenceColour = Color.white;
+    }
+    if (av.getSelectionGroup() != null)
+    {
+      if (av.getSelectionGroup().getSequences(null).contains(sequence))
+      {
+        sequenceColour = Color.gray;
+      }
+    }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
-  public Dimension preferredsize()
-  {
-    return prefsize;
+    /*
+     * graduate brighter for point in front of centre, darker if behind centre
+     */
+    float zCentre = (seqMin[2] + seqMax[2]) / 2f;
+    if (sp.coord.z > zCentre)
+    {
+      sequenceColour = ColorUtils.getGraduatedColour(sp.coord.z, 0,
+              sequenceColour, seqMax[2], sequenceColour.brighter());
+    }
+    else if (sp.coord.z < zCentre)
+    {
+      sequenceColour = ColorUtils.getGraduatedColour(sp.coord.z, seqMin[2],
+              sequenceColour.darker(), 0, sequenceColour);
+    }
+
+    return sequenceColour;
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
   @Override
   public void keyTyped(KeyEvent evt)
   {
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
   @Override
   public void keyReleased(KeyEvent evt)
   {
   }
 
   /**
-   * DOCUMENT ME!
+   * Responds to up or down arrow key by zooming in or out, respectively
    * 
    * @param evt
-   *          DOCUMENT ME!
    */
   @Override
   public void keyPressed(KeyEvent evt)
   {
-    if (evt.getKeyCode() == KeyEvent.VK_UP)
+    int keyCode = evt.getKeyCode();
+    boolean shiftDown = evt.isShiftDown();
+
+    if (keyCode == KeyEvent.VK_UP)
     {
-      scalefactor = (float) (scalefactor * 1.1);
-      scale = findScale();
+      if (shiftDown)
+      {
+        rotate(0f, -1f);
+      }
+      else
+      {
+        zoom(ZOOM_IN);
+      }
     }
-    else if (evt.getKeyCode() == KeyEvent.VK_DOWN)
+    else if (keyCode == KeyEvent.VK_DOWN)
     {
-      scalefactor = (float) (scalefactor * 0.9);
-      scale = findScale();
+      if (shiftDown)
+      {
+        rotate(0f, 1f);
+      }
+      else
+      {
+        zoom(ZOOM_OUT);
+      }
+    }
+    else if (shiftDown && keyCode == KeyEvent.VK_LEFT)
+    {
+      rotate(1f, 0f);
+    }
+    else if (shiftDown && keyCode == KeyEvent.VK_RIGHT)
+    {
+      rotate(-1f, 0f);
     }
     else if (evt.getKeyChar() == 's')
     {
-      System.err.println("DEBUG: Rectangle selection"); // log.debug
-
-      if ((rectx2 != -1) && (recty2 != -1))
-      {
-        rectSelect(rectx1, recty1, rectx2, recty2);
-      }
+      // Cache.log.warn("DEBUG: Rectangle selection");
+      // todo not yet enabled as rectx2, recty2 are always -1
+      // need to set them in mouseDragged; JAL-1124
+      // if ((rectx2 != -1) && (recty2 != -1))
+      // {
+      // rectSelect(rectx1, recty1, rectx2, recty2);
+      // }
     }
 
     repaint();
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
+  @Override
+  public void zoom(float factor)
+  {
+    if (factor > 0f)
+    {
+      scaleFactor *= factor;
+    }
+  }
+
   @Override
   public void mouseClicked(MouseEvent evt)
   {
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
   @Override
   public void mouseEntered(MouseEvent evt)
   {
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
   @Override
   public void mouseExited(MouseEvent evt)
   {
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
-   */
   @Override
   public void mouseReleased(MouseEvent evt)
   {
   }
 
   /**
-   * DOCUMENT ME!
-   * 
-   * @param evt
-   *          DOCUMENT ME!
+   * If the mouse press is at (within 2 pixels of) a sequence point, toggles
+   * (adds or removes) the corresponding sequence as a member of the viewport
+   * selection group. This supports configuring a group in the alignment by
+   * clicking on points in the PCA display.
    */
   @Override
   public void mousePressed(MouseEvent evt)
@@ -661,22 +561,15 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     int x = evt.getX();
     int y = evt.getY();
 
-    mx = x;
-    my = y;
-
-    omx = mx;
-    omy = my;
-
-    startx = x;
-    starty = y;
+    mouseX = x;
+    mouseY = y;
 
-    rectx1 = x;
-    recty1 = y;
+    // rectx1 = x;
+    // recty1 = y;
+    // rectx2 = -1;
+    // recty2 = -1;
 
-    rectx2 = -1;
-    recty2 = -1;
-
-    SequenceI found = findPoint(x, y);
+    SequenceI found = findSequenceAtPoint(x, y);
 
     if (found != null)
     {
@@ -704,36 +597,37 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     repaint();
   }
 
-  // private void fireSequenceSelectionEvent(Selection sel) {
-  // controller.handleSequenceSelectionEvent(new
-  // SequenceSelectionEvent(this,sel));
-  // }
+  /**
+   * Sets the tooltip to the name of the sequence within 2 pixels of the mouse
+   * position, or clears the tooltip if none found
+   */
   @Override
   public void mouseMoved(MouseEvent evt)
   {
-    SequenceI found = findPoint(evt.getX(), evt.getY());
+    SequenceI found = findSequenceAtPoint(evt.getX(), evt.getY());
 
-    if (found != null)
-    {
-      this.setToolTipText(found.getName());
-    }
-    else
-    {
-      this.setToolTipText(null);
-    }
+    this.setToolTipText(found == null ? null : found.getName());
   }
 
   /**
-   * DOCUMENT ME!
+   * Action handler for a mouse drag. Rotates the display around the X axis (for
+   * up/down mouse movement) and/or the Y axis (for left/right mouse movement).
    * 
    * @param evt
-   *          DOCUMENT ME!
    */
   @Override
   public void mouseDragged(MouseEvent evt)
   {
-    mx = evt.getX();
-    my = evt.getY();
+    int xPos = evt.getX();
+    int yPos = evt.getY();
+
+    if (xPos == mouseX && yPos == mouseY)
+    {
+      return;
+    }
+
+    int xDelta = xPos - mouseX;
+    int yDelta = yPos - mouseY;
 
     // Check if this is a rectangle drawing drag
     if ((evt.getModifiers() & InputEvent.BUTTON2_MASK) != 0)
@@ -743,113 +637,178 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     }
     else
     {
-      rotmat.setIdentity();
+      rotate(xDelta, yDelta);
 
-      rotmat.rotate(my - omy, 'x');
-      rotmat.rotate(mx - omx, 'y');
+      mouseX = xPos;
+      mouseY = yPos;
 
-      for (int i = 0; i < npoint; i++)
-      {
-        SequencePoint sp = (SequencePoint) points.elementAt(i);
-        sp.coord[0] -= centre[0];
-        sp.coord[1] -= centre[1];
-        sp.coord[2] -= centre[2];
-
-        // Now apply the rotation matrix
-        sp.coord = rotmat.vectorMultiply(sp.coord);
-
-        // Now translate back again
-        sp.coord[0] += centre[0];
-        sp.coord[1] += centre[1];
-        sp.coord[2] += centre[2];
-      }
+      // findWidths();
 
-      for (int i = 0; i < 3; i++)
-      {
-        axes[i] = rotmat.vectorMultiply(axes[i]);
-      }
+      repaint();
+    }
+  }
 
-      omx = mx;
-      omy = my;
+  @Override
+  public void rotate(float x, float y)
+  {
+    if (x == 0f && y == 0f)
+    {
+      return;
+    }
 
-      paint(this.getGraphics());
+    /*
+     * get the identity transformation...
+     */
+    RotatableMatrix rotmat = new RotatableMatrix();
+
+    /*
+     * rotate around the X axis for change in Y
+     * (mouse movement up/down); note we are equating a
+     * number of pixels with degrees of rotation here!
+     */
+    if (y != 0)
+    {
+      rotmat.rotate(y, Axis.X);
+    }
+
+    /*
+     * rotate around the Y axis for change in X
+     * (mouse movement left/right)
+     */
+    if (x != 0)
+    {
+      rotmat.rotate(x, Axis.Y);
+    }
+
+    /*
+     * apply the composite transformation to sequence points;
+     * update z min-max range (affects colour graduation), but not
+     * x or y min-max (as this would affect axis scaling)
+     */
+    float[] centre = getCentre();
+    float zMin = Float.MAX_VALUE;
+    float zMax = -Float.MAX_VALUE;
+
+    for (int i = 0; i < npoint; i++)
+    {
+      SequencePoint sp = sequencePoints.get(i);
+      sp.translate(-centre[0], -centre[1], -centre[2]);
+
+      // Now apply the rotation matrix
+      sp.coord = rotmat.vectorMultiply(sp.coord);
+
+      // Now translate back again
+      sp.translate(centre[0], centre[1], centre[2]);
+      
+      zMin = Math.min(zMin, sp.coord.z);
+      zMax = Math.max(zMax, sp.coord.z);
+    }
+
+    seqMin[2] = zMin;
+    seqMax[2] = zMax;
+
+    /*
+     * rotate the x/y/z axis positions
+     */
+    for (int i = 0; i < DIMS; i++)
+    {
+      axisEndPoints[i] = rotmat.vectorMultiply(axisEndPoints[i]);
     }
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers the x/y/z coordinates that are midway between the maximum and
+   * minimum sequence point values
+   * 
+   * @return
+   */
+  private float[] getCentre()
+  {
+    float xCentre = (seqMin[0] + seqMax[0]) / 2f;
+    float yCentre = (seqMin[1] + seqMax[1]) / 2f;
+    float zCentre = (seqMin[2] + seqMax[2]) / 2f;
+
+    return new float[] { xCentre, yCentre, zCentre };
+  }
+
+  /**
+   * Adds any sequences whose displayed points are within the given rectangle to
+   * the viewport's current selection. Intended for key 's' after dragging to
+   * select a region of the PCA.
    * 
    * @param x1
-   *          DOCUMENT ME!
    * @param y1
-   *          DOCUMENT ME!
    * @param x2
-   *          DOCUMENT ME!
    * @param y2
-   *          DOCUMENT ME!
    */
-  public void rectSelect(int x1, int y1, int x2, int y2)
+  protected void rectSelect(int x1, int y1, int x2, int y2)
   {
+    float[] centre = getCentre();
+
     for (int i = 0; i < npoint; i++)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int tmp1 = (int) (((sp.coord[0] - centre[0]) * scale)
+      SequencePoint sp = sequencePoints.get(i);
+      int tmp1 = (int) (((sp.coord.x - centre[0]) * scaleFactor)
               + (getWidth() / 2.0));
-      int tmp2 = (int) (((sp.coord[1] - centre[1]) * scale)
+      int tmp2 = (int) (((sp.coord.y - centre[1]) * scaleFactor)
               + (getHeight() / 2.0));
 
       if ((tmp1 > x1) && (tmp1 < x2) && (tmp2 > y1) && (tmp2 < y2))
       {
         if (av != null)
         {
+          SequenceI sequence = sp.getSequence();
           if (!av.getSelectionGroup().getSequences(null)
-                  .contains(sp.sequence))
+                  .contains(sequence))
           {
-            av.getSelectionGroup().addSequence(sp.sequence, true);
+            av.getSelectionGroup().addSequence(sequence, true);
           }
         }
       }
     }
-
-    // if (changedSel) {
-    // fireSequenceSelectionEvent(av.getSelection());
-    // }
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers the first sequence found whose point on the display is within 2
+   * pixels of the given coordinates, or null if none is found
    * 
    * @param x
-   *          DOCUMENT ME!
    * @param y
-   *          DOCUMENT ME!
    * 
-   * @return DOCUMENT ME!
+   * @return
    */
-  public SequenceI findPoint(int x, int y)
+  protected SequenceI findSequenceAtPoint(int x, int y)
   {
     int halfwidth = getWidth() / 2;
     int halfheight = getHeight() / 2;
 
     int found = -1;
+    int pix = Math.min(getWidth(), getHeight());
+    float xWidth = Math.abs(seqMax[0] - seqMin[0]);
+    float yWidth = Math.abs(seqMax[1] - seqMin[1]);
+    float maxWidth = Math.max(xWidth, yWidth);
+    float scaleBy = pix * scaleFactor / (2f * maxWidth);
+
+    float[] centre = getCentre();
 
     for (int i = 0; i < npoint; i++)
     {
-      SequencePoint sp = (SequencePoint) points.elementAt(i);
-      int px = (int) ((sp.coord[0] - centre[0]) * scale)
+      SequencePoint sp = sequencePoints.get(i);
+      int px = (int) ((sp.coord.x - centre[0]) * scaleBy)
               + halfwidth;
-      int py = (int) ((sp.coord[1] - centre[1]) * scale)
+      int py = (int) ((sp.coord.y - centre[1]) * scaleBy)
               + halfheight;
 
-      if ((Math.abs(px - x) < 3) && (Math.abs(py - y) < 3))
+      if ((Math.abs(px - x) < NEARBY) && (Math.abs(py - y) < NEARBY))
       {
         found = i;
+        break;
       }
     }
 
     if (found != -1)
     {
-      return ((SequencePoint) points.elementAt(found)).sequence;
+      return sequencePoints.get(found).getSequence();
     }
     else
     {
@@ -857,6 +816,12 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     }
   }
 
+  /**
+   * Answers the panel the PCA is associated with (all panels for this alignment
+   * if 'associate with all panels' is selected).
+   * 
+   * @return
+   */
   AlignmentPanel[] getAssociatedPanels()
   {
     if (applyToAllViews)
@@ -869,19 +834,64 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     }
   }
 
+  public Color getBackgroundColour()
+  {
+    return bgColour;
+  }
+
+  /**
+   * Zooms in or out in response to mouse wheel movement
+   */
+  @Override
+  public void mouseWheelMoved(MouseWheelEvent e)
+  {
+    double wheelRotation = e.getPreciseWheelRotation();
+    if (wheelRotation > 0)
+    {
+      zoom(ZOOM_IN);
+      repaint();
+    }
+    else if (wheelRotation < 0)
+    {
+      zoom(ZOOM_OUT);
+      repaint();
+    }
+  }
+
+  /**
+   * Answers the sequence point minimum [x, y, z] values. Note these are derived
+   * when sequence points are set, but x and y values are not updated on
+   * rotation (because this would result in changes to scaling).
+   * 
+   * @return
+   */
+  public float[] getSeqMin()
+  {
+    return seqMin;
+  }
+
   /**
+   * Answers the sequence point maximum [x, y, z] values. Note these are derived
+   * when sequence points are set, but x and y values are not updated on
+   * rotation (because this would result in changes to scaling).
    * 
-   * @return x,y,z positions of point s (index into points) under current
-   *         transform.
+   * @return
    */
-  public double[] getPointPosition(int s)
+  public float[] getSeqMax()
   {
-    double pts[] = new double[3];
-    float[] p = ((SequencePoint) points.elementAt(s)).coord;
-    pts[0] = p[0];
-    pts[1] = p[1];
-    pts[2] = p[2];
-    return pts;
+    return seqMax;
   }
 
+  /**
+   * Sets the minimum and maximum [x, y, z] positions for sequence points. For
+   * use when restoring a saved PCA from state data.
+   * 
+   * @param min
+   * @param max
+   */
+  public void setSeqMinMax(float[] min, float[] max)
+  {
+    seqMin = min;
+    seqMax = max;
+  }
 }
index 084f461..ca4f84e 100755 (executable)
@@ -879,7 +879,7 @@ public class TreePanel extends GTreePanel
     /*
      * put them together as <method> Using <model>
      */
-    final String ttl = MessageManager.formatMessage("label.treecalc_title",
+    final String ttl = MessageManager.formatMessage("label.calc_title",
             treecalcnm, smn);
     return ttl;
   }
index a183794..122ad0f 100755 (executable)
@@ -46,13 +46,11 @@ public class GPCAPanel extends JInternalFrame
 {
   private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
 
-  protected JComboBox<String> xCombobox = new JComboBox<String>();
+  protected JComboBox<String> xCombobox = new JComboBox<>();
 
-  protected JComboBox<String> yCombobox = new JComboBox<String>();
+  protected JComboBox<String> yCombobox = new JComboBox<>();
 
-  protected JComboBox<String> zCombobox = new JComboBox<String>();
-
-  protected JMenu scoreModelMenu = new JMenu();
+  protected JComboBox<String> zCombobox = new JComboBox<>();
 
   protected JMenu viewMenu = new JMenu();
 
@@ -60,16 +58,15 @@ public class GPCAPanel extends JInternalFrame
 
   protected JMenu associateViewsMenu = new JMenu();
 
-  protected JMenu calcSettings = new JMenu();
-
-  protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
-
-  protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
-
   protected JLabel statusBar = new JLabel();
 
   protected JPanel statusPanel = new JPanel();
 
+  protected JMenuItem originalSeqData;
+
+  /**
+   * Constructor
+   */
   public GPCAPanel()
   {
     try
@@ -110,7 +107,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        zCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     yCombobox.setFont(VERDANA_12);
@@ -119,7 +116,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        yCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     xCombobox.setFont(VERDANA_12);
@@ -128,7 +125,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        xCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     JButton resetButton = new JButton();
@@ -139,7 +136,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        resetButton_actionPerformed(e);
+        resetButton_actionPerformed();
       }
     });
     JMenu fileMenu = new JMenu();
@@ -152,7 +149,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        eps_actionPerformed(e);
+        eps_actionPerformed();
       }
     });
     JMenuItem png = new JMenuItem("PNG");
@@ -161,7 +158,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        png_actionPerformed(e);
+        png_actionPerformed();
       }
     });
     JMenuItem outputValues = new JMenuItem();
@@ -171,7 +168,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputValues_actionPerformed(e);
+        outputValues_actionPerformed();
       }
     });
     JMenuItem outputPoints = new JMenuItem();
@@ -181,7 +178,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputPoints_actionPerformed(e);
+        outputPoints_actionPerformed();
       }
     });
     JMenuItem outputProjPoints = new JMenuItem();
@@ -192,7 +189,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputProjPoints_actionPerformed(e);
+        outputProjPoints_actionPerformed();
       }
     });
     JMenuItem print = new JMenuItem();
@@ -202,7 +199,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        print_actionPerformed(e);
+        print_actionPerformed();
       }
     });
     viewMenu.setText(MessageManager.getString("action.view"));
@@ -224,33 +221,13 @@ public class GPCAPanel extends JInternalFrame
       {
       }
     });
-    scoreModelMenu
-            .setText(MessageManager.getString("label.select_score_model"));
-    scoreModelMenu.addMenuListener(new MenuListener()
-    {
-      @Override
-      public void menuSelected(MenuEvent e)
-      {
-        scoreModel_menuSelected();
-      }
-
-      @Override
-      public void menuDeselected(MenuEvent e)
-      {
-      }
-
-      @Override
-      public void menuCanceled(MenuEvent e)
-      {
-      }
-    });
     showLabels.setText(MessageManager.getString("label.show_labels"));
     showLabels.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        showLabels_actionPerformed(e);
+        showLabels_actionPerformed();
       }
     });
     JMenuItem bgcolour = new JMenuItem();
@@ -260,47 +237,22 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        bgcolour_actionPerformed(e);
+        bgcolour_actionPerformed();
       }
     });
-    JMenuItem originalSeqData = new JMenuItem();
+    originalSeqData = new JMenuItem();
     originalSeqData.setText(MessageManager.getString("label.input_data"));
     originalSeqData.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        originalSeqData_actionPerformed(e);
+        originalSeqData_actionPerformed();
       }
     });
     associateViewsMenu.setText(
             MessageManager.getString("label.associate_nodes_with"));
-    calcSettings.setText(MessageManager.getString("action.change_params"));
-    nuclSetting
-            .setText(MessageManager.getString("label.nucleotide_matrix"));
-    protSetting.setText(MessageManager.getString("label.protein_matrix"));
-    nuclSetting.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        nuclSetting_actionPerfomed(arg0);
-      }
-    });
-    protSetting.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        protSetting_actionPerfomed(arg0);
-      }
-    });
 
-    calcSettings.add(nuclSetting);
-    calcSettings.add(protSetting);
-    calcSettings.add(scoreModelMenu);
     statusPanel.setLayout(new GridLayout());
     statusBar.setFont(VERDANA_12);
     // statusPanel.setBackground(Color.lightGray);
@@ -321,7 +273,6 @@ public class GPCAPanel extends JInternalFrame
     JMenuBar jMenuBar1 = new JMenuBar();
     jMenuBar1.add(fileMenu);
     jMenuBar1.add(viewMenu);
-    jMenuBar1.add(calcSettings);
     setJMenuBar(jMenuBar1);
     fileMenu.add(saveMenu);
     fileMenu.add(outputValues);
@@ -336,91 +287,51 @@ public class GPCAPanel extends JInternalFrame
     viewMenu.add(associateViewsMenu);
   }
 
-  protected void scoreModel_menuSelected()
-  {
-    // TODO Auto-generated method stub
-
-  }
-
-  protected void resetButton_actionPerformed(ActionEvent e)
+  protected void resetButton_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void protSetting_actionPerfomed(ActionEvent arg0)
+  protected void outputPoints_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void nuclSetting_actionPerfomed(ActionEvent arg0)
+  protected void outputProjPoints_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void outputPoints_actionPerformed(ActionEvent e)
+  protected void eps_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void outputProjPoints_actionPerformed(ActionEvent e)
+  protected void png_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void xCombobox_actionPerformed(ActionEvent e)
+  protected void outputValues_actionPerformed()
   {
   }
 
-  protected void yCombobox_actionPerformed(ActionEvent e)
+  protected void print_actionPerformed()
   {
   }
 
-  protected void zCombobox_actionPerformed(ActionEvent e)
+  protected void showLabels_actionPerformed()
   {
   }
 
-  public void eps_actionPerformed(ActionEvent e)
+  protected void bgcolour_actionPerformed()
   {
-
   }
 
-  public void png_actionPerformed(ActionEvent e)
+  protected void originalSeqData_actionPerformed()
   {
-
   }
 
-  public void outputValues_actionPerformed(ActionEvent e)
+  protected void viewMenu_menuSelected()
   {
-
   }
 
-  public void print_actionPerformed(ActionEvent e)
+  protected void doDimensionChange()
   {
-
-  }
-
-  public void showLabels_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void bgcolour_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void originalSeqData_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void viewMenu_menuSelected()
-  {
-
   }
 }
index 8910c67..77862c8 100755 (executable)
@@ -24,6 +24,7 @@ import jalview.util.Format;
 import jalview.util.MessageManager;
 
 import java.io.PrintStream;
+import java.util.Arrays;
 
 /**
  * A class to model rectangular matrices of double values and operations on them
@@ -31,37 +32,40 @@ import java.io.PrintStream;
 public class Matrix implements MatrixI
 {
   /*
-   * the cell values in row-major order
+   * maximum number of iterations for tqli
    */
-  private double[][] value;
+  private static final int MAX_ITER = 45;
+  // fudge - add 15 iterations, just in case
 
   /*
    * the number of rows
    */
-  protected int rows;
+  final protected int rows;
 
   /*
    * the number of columns
    */
-  protected int cols;
+  final protected int cols;
+
+  /*
+   * the cell values in row-major order
+   */
+  private double[][] value;
 
   protected double[] d; // Diagonal
 
   protected double[] e; // off diagonal
 
   /**
-   * maximum number of iterations for tqli
+   * Constructor given number of rows and columns
    * 
+   * @param colCount
+   * @param rowCount
    */
-  private static final int maxIter = 45; // fudge - add 15 iterations, just in
-                                         // case
-
-  /**
-   * Default constructor
-   */
-  public Matrix()
+  protected Matrix(int rowCount, int colCount)
   {
-
+    rows = rowCount;
+    cols = colCount;
   }
 
   /**
@@ -103,11 +107,6 @@ public class Matrix implements MatrixI
     }
   }
 
-  /**
-   * Returns a new matrix which is the transpose of this one
-   * 
-   * @return
-   */
   @Override
   public MatrixI transpose()
   {
@@ -145,18 +144,6 @@ public class Matrix implements MatrixI
     }
   }
 
-  /**
-   * Returns a new matrix which is the result of premultiplying this matrix by
-   * the supplied argument. If this of size AxB (A rows and B columns), and the
-   * argument is CxA (C rows and A columns), the result is of size CxB.
-   * 
-   * @param in
-   * 
-   * @return
-   * @throws IllegalArgumentException
-   *           if the number of columns in the pre-multiplier is not equal to
-   *           the number of rows in the multiplicand (this)
-   */
   @Override
   public MatrixI preMultiply(MatrixI in)
   {
@@ -208,21 +195,6 @@ public class Matrix implements MatrixI
     return out;
   }
 
-  /**
-   * Returns a new matrix which is the result of postmultiplying this matrix by
-   * the supplied argument. If this of size AxB (A rows and B columns), and the
-   * argument is BxC (B rows and C columns), the result is of size AxC.
-   * <p>
-   * This method simply returns the result of in.preMultiply(this)
-   * 
-   * @param in
-   * 
-   * @return
-   * @throws IllegalArgumentException
-   *           if the number of rows in the post-multiplier is not equal to the
-   *           number of columns in the multiplicand (this)
-   * @see #preMultiply(Matrix)
-   */
   @Override
   public MatrixI postMultiply(MatrixI in)
   {
@@ -234,11 +206,6 @@ public class Matrix implements MatrixI
     return in.preMultiply(this);
   }
 
-  /**
-   * Answers a new matrix with a copy of the values in this one
-   * 
-   * @return
-   */
   @Override
   public MatrixI copy()
   {
@@ -249,7 +216,17 @@ public class Matrix implements MatrixI
       System.arraycopy(value[i], 0, newmat[i], 0, value[i].length);
     }
 
-    return new Matrix(newmat);
+    Matrix m = new Matrix(newmat);
+    if (this.d != null)
+    {
+      m.d = Arrays.copyOf(this.d, this.d.length);
+    }
+    if (this.e != null)
+    {
+      m.e = Arrays.copyOf(this.e, this.e.length);
+    }
+
+    return m;
   }
 
   /**
@@ -479,11 +456,11 @@ public class Matrix implements MatrixI
         {
           iter++;
 
-          if (iter == maxIter)
+          if (iter == MAX_ITER)
           {
             throw new Exception(MessageManager.formatMessage(
                     "exception.matrix_too_many_iteration", new String[]
-                    { "tqli", Integer.valueOf(maxIter).toString() }));
+                    { "tqli", Integer.valueOf(MAX_ITER).toString() }));
           }
           else
           {
@@ -743,11 +720,11 @@ public class Matrix implements MatrixI
         {
           iter++;
 
-          if (iter == maxIter)
+          if (iter == MAX_ITER)
           {
             throw new Exception(MessageManager.formatMessage(
                     "exception.matrix_too_many_iteration", new String[]
-                    { "tqli2", Integer.valueOf(maxIter).toString() }));
+                    { "tqli2", Integer.valueOf(MAX_ITER).toString() }));
           }
           else
           {
@@ -995,4 +972,16 @@ public class Matrix implements MatrixI
       }
     }
   }
+
+  @Override
+  public void setD(double[] v)
+  {
+    d = v;
+  }
+
+  @Override
+  public void setE(double[] v)
+  {
+    e = v;
+  }
 }
index 5b93c76..d72890a 100644 (file)
@@ -22,6 +22,10 @@ package jalview.math;
 
 import java.io.PrintStream;
 
+/**
+ * An interface that describes a rectangular matrix of double values and
+ * operations on it
+ */
 public interface MatrixI
 {
   /**
@@ -63,18 +67,59 @@ public interface MatrixI
    */
   double[] getRow(int i);
 
+  /**
+   * Answers a new matrix with a copy of the values in this one
+   * 
+   * @return
+   */
   MatrixI copy();
 
+  /**
+   * Returns a new matrix which is the transpose of this one
+   * 
+   * @return
+   */
   MatrixI transpose();
 
+  /**
+   * Returns a new matrix which is the result of premultiplying this matrix by
+   * the supplied argument. If this of size AxB (A rows and B columns), and the
+   * argument is CxA (C rows and A columns), the result is of size CxB.
+   * 
+   * @param in
+   * 
+   * @return
+   * @throws IllegalArgumentException
+   *           if the number of columns in the pre-multiplier is not equal to
+   *           the number of rows in the multiplicand (this)
+   */
   MatrixI preMultiply(MatrixI m);
 
+  /**
+   * Returns a new matrix which is the result of postmultiplying this matrix by
+   * the supplied argument. If this of size AxB (A rows and B columns), and the
+   * argument is BxC (B rows and C columns), the result is of size AxC.
+   * <p>
+   * This method simply returns the result of in.preMultiply(this)
+   * 
+   * @param in
+   * 
+   * @return
+   * @throws IllegalArgumentException
+   *           if the number of rows in the post-multiplier is not equal to the
+   *           number of columns in the multiplicand (this)
+   * @see #preMultiply(Matrix)
+   */
   MatrixI postMultiply(MatrixI m);
 
   double[] getD();
 
   double[] getE();
 
+  void setD(double[] v);
+
+  void setE(double[] v);
+
   void print(PrintStream ps, String format);
 
   void printD(PrintStream ps, String format);
index 5971227..602c5e4 100755 (executable)
  */
 package jalview.math;
 
+import jalview.datamodel.Point;
+
+import java.util.HashMap;
+import java.util.Map;
+
 /**
- * DOCUMENT ME!
- * 
- * @author $author$
- * @version $Revision$
+ * Model for a 3x3 matrix which provides methods for rotation in 3-D space
  */
 public class RotatableMatrix
 {
-  float[][] matrix;
+  private static final int DIMS = 3;
 
-  float[] temp;
+  /*
+   * cache the most used rotations: +/- 1, 2, 3, 4 degrees around x or y axis
+   */
+  private static Map<Axis, Map<Float, float[][]>> cachedRotations;
 
-  float[][] rot;
+  static
+  {
+    cachedRotations = new HashMap<>();
+    for (Axis axis : Axis.values())
+    {
+      HashMap<Float, float[][]> map = new HashMap<>();
+      cachedRotations.put(axis, map);
+      for (int deg = 1; deg < 5; deg++)
+      {
+        float[][] rotation = getRotation(deg, axis);
+        map.put(Float.valueOf(deg), rotation);
+        rotation = getRotation(-deg, axis);
+        map.put(Float.valueOf(-deg), rotation);
+      }
+    }
+  }
 
-  /**
-   * Creates a new RotatableMatrix object.
-   * 
-   * @param rows
-   *          DOCUMENT ME!
-   * @param cols
-   *          DOCUMENT ME!
-   */
-  public RotatableMatrix(int rows, int cols)
+  public enum Axis
   {
-    matrix = new float[rows][cols];
+    X, Y, Z
+  };
 
-    temp = new float[3];
+  float[][] matrix;
 
-    rot = new float[3][3];
+  /**
+   * Constructor creates a new identity matrix (all values zero except for 1 on
+   * the diagonal)
+   */
+  public RotatableMatrix()
+  {
+    matrix = new float[DIMS][DIMS];
+    for (int j = 0; j < DIMS; j++)
+    {
+      matrix[j][j] = 1f;
+    }
   }
 
   /**
-   * DOCUMENT ME!
+   * Sets the value at position (i, j) of the matrix
    * 
    * @param i
-   *          DOCUMENT ME!
    * @param j
-   *          DOCUMENT ME!
    * @param value
-   *          DOCUMENT ME!
    */
-  public void addElement(int i, int j, float value)
+  public void setValue(int i, int j, float value)
   {
     matrix[i][j] = value;
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers the value at position (i, j) of the matrix
+   * 
+   * @param i
+   * @param j
+   * @return
+   */
+  public float getValue(int i, int j)
+  {
+    return matrix[i][j];
+  }
+
+  /**
+   * Prints the matrix in rows of space-delimited values
    */
   public void print()
   {
@@ -82,174 +114,137 @@ public class RotatableMatrix
   }
 
   /**
-   * DOCUMENT ME!
+   * Rotates the matrix through the specified number of degrees around the
+   * specified axis
    * 
    * @param degrees
-   *          DOCUMENT ME!
    * @param axis
-   *          DOCUMENT ME!
    */
-  public void rotate(float degrees, char axis)
+  public void rotate(float degrees, Axis axis)
   {
-    float costheta = (float) Math.cos((degrees * Math.PI) / (float) 180.0);
+    float[][] rot = getRotation(degrees, axis);
 
-    float sintheta = (float) Math.sin((degrees * Math.PI) / (float) 180.0);
+    preMultiply(rot);
+  }
 
-    if (axis == 'z')
+  /**
+   * Answers a matrix which, when it pre-multiplies another matrix, applies a
+   * rotation of the specified number of degrees around the specified axis
+   * 
+   * @param degrees
+   * @param axis
+   * @return
+   * @see https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
+   */
+  protected static float[][] getRotation(float degrees, Axis axis)
+  {
+    Float floatValue = Float.valueOf(degrees);
+    if (cachedRotations.get(axis).containsKey(floatValue))
     {
-      rot[0][0] = (float) costheta;
-
-      rot[0][1] = (float) -sintheta;
-
-      rot[0][2] = (float) 0.0;
-
-      rot[1][0] = (float) sintheta;
-
-      rot[1][1] = (float) costheta;
-
-      rot[1][2] = (float) 0.0;
-
-      rot[2][0] = (float) 0.0;
-
-      rot[2][1] = (float) 0.0;
-
-      rot[2][2] = (float) 1.0;
-
-      preMultiply(rot);
+      // System.out.println("getRotation from cache: " + (int) degrees);
+      return cachedRotations.get(axis).get(floatValue);
     }
 
-    if (axis == 'x')
-    {
-      rot[0][0] = (float) 1.0;
-
-      rot[0][1] = (float) 0.0;
-
-      rot[0][2] = (float) 0.0;
-
-      rot[1][0] = (float) 0.0;
+    float costheta = (float) Math.cos(degrees * Math.PI / 180f);
 
-      rot[1][1] = (float) costheta;
+    float sintheta = (float) Math.sin(degrees * Math.PI / 180f);
 
-      rot[1][2] = (float) sintheta;
+    float[][] rot = new float[DIMS][DIMS];
 
-      rot[2][0] = (float) 0.0;
-
-      rot[2][1] = (float) -sintheta;
-
-      rot[2][2] = (float) costheta;
-
-      preMultiply(rot);
-    }
-
-    if (axis == 'y')
+    switch (axis)
     {
-      rot[0][0] = (float) costheta;
-
-      rot[0][1] = (float) 0.0;
-
-      rot[0][2] = (float) -sintheta;
-
-      rot[1][0] = (float) 0.0;
-
-      rot[1][1] = (float) 1.0;
-
-      rot[1][2] = (float) 0.0;
-
-      rot[2][0] = (float) sintheta;
-
-      rot[2][1] = (float) 0.0;
-
-      rot[2][2] = (float) costheta;
-
-      preMultiply(rot);
+    case X:
+      rot[0][0] = 1f;
+      rot[1][1] = costheta;
+      rot[1][2] = sintheta;
+      rot[2][1] = -sintheta;
+      rot[2][2] = costheta;
+      break;
+    case Y:
+      rot[0][0] = costheta;
+      rot[0][2] = -sintheta;
+      rot[1][1] = 1f;
+      rot[2][0] = sintheta;
+      rot[2][2] = costheta;
+      break;
+    case Z:
+      rot[0][0] = costheta;
+      rot[0][1] = -sintheta;
+      rot[1][0] = sintheta;
+      rot[1][1] = costheta;
+      rot[2][2] = 1f;
+      break;
     }
+    return rot;
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers a new array of float values which is the result of pre-multiplying
+   * this matrix by the given vector. Each value of the result is the dot
+   * product of the vector with one column of this matrix. The matrix and input
+   * vector are not modified.
    * 
    * @param vect
-   *          DOCUMENT ME!
    * 
-   * @return DOCUMENT ME!
+   * @return
    */
   public float[] vectorMultiply(float[] vect)
   {
-    temp[0] = vect[0];
-
-    temp[1] = vect[1];
-
-    temp[2] = vect[2];
+    float[] result = new float[DIMS];
 
-    for (int i = 0; i < 3; i++)
+    for (int i = 0; i < DIMS; i++)
     {
-      temp[i] = (matrix[i][0] * vect[0]) + (matrix[i][1] * vect[1])
+      result[i] = (matrix[i][0] * vect[0]) + (matrix[i][1] * vect[1])
               + (matrix[i][2] * vect[2]);
     }
 
-    vect[0] = temp[0];
-
-    vect[1] = temp[1];
-
-    vect[2] = temp[2];
-
-    return vect;
+    return result;
   }
 
   /**
-   * DOCUMENT ME!
+   * Performs pre-multiplication of this matrix by the given one. Value (i, j)
+   * of the result is the dot product of the i'th row of <code>mat</code> with
+   * the j'th column of this matrix.
    * 
    * @param mat
-   *          DOCUMENT ME!
    */
   public void preMultiply(float[][] mat)
   {
-    float[][] tmp = new float[3][3];
+    float[][] tmp = new float[DIMS][DIMS];
 
-    for (int i = 0; i < 3; i++)
+    for (int i = 0; i < DIMS; i++)
     {
-      for (int j = 0; j < 3; j++)
+      for (int j = 0; j < DIMS; j++)
       {
         tmp[i][j] = (mat[i][0] * matrix[0][j]) + (mat[i][1] * matrix[1][j])
                 + (mat[i][2] * matrix[2][j]);
       }
     }
 
-    for (int i = 0; i < 3; i++)
-    {
-      for (int j = 0; j < 3; j++)
-      {
-        matrix[i][j] = tmp[i][j];
-      }
-    }
+    matrix = tmp;
   }
 
   /**
-   * DOCUMENT ME!
+   * Performs post-multiplication of this matrix by the given one. Value (i, j)
+   * of the result is the dot product of the i'th row of this matrix with the
+   * j'th column of <code>mat</code>.
    * 
    * @param mat
-   *          DOCUMENT ME!
    */
   public void postMultiply(float[][] mat)
   {
-    float[][] tmp = new float[3][3];
+    float[][] tmp = new float[DIMS][DIMS];
 
-    for (int i = 0; i < 3; i++)
+    for (int i = 0; i < DIMS; i++)
     {
-      for (int j = 0; j < 3; j++)
+      for (int j = 0; j < DIMS; j++)
       {
         tmp[i][j] = (matrix[i][0] * mat[0][j]) + (matrix[i][1] * mat[1][j])
                 + (matrix[i][2] * mat[2][j]);
       }
     }
 
-    for (int i = 0; i < 3; i++)
-    {
-      for (int j = 0; j < 3; j++)
-      {
-        matrix[i][j] = tmp[i][j];
-      }
-    }
+    matrix = tmp;
   }
 
   /**
@@ -260,47 +255,47 @@ public class RotatableMatrix
    */
   public static void main(String[] args)
   {
-    RotatableMatrix m = new RotatableMatrix(3, 3);
+    RotatableMatrix m = new RotatableMatrix();
 
-    m.addElement(0, 0, 1);
+    m.setValue(0, 0, 1);
 
-    m.addElement(0, 1, 0);
+    m.setValue(0, 1, 0);
 
-    m.addElement(0, 2, 0);
+    m.setValue(0, 2, 0);
 
-    m.addElement(1, 0, 0);
+    m.setValue(1, 0, 0);
 
-    m.addElement(1, 1, 2);
+    m.setValue(1, 1, 2);
 
-    m.addElement(1, 2, 0);
+    m.setValue(1, 2, 0);
 
-    m.addElement(2, 0, 0);
+    m.setValue(2, 0, 0);
 
-    m.addElement(2, 1, 0);
+    m.setValue(2, 1, 0);
 
-    m.addElement(2, 2, 1);
+    m.setValue(2, 2, 1);
 
     m.print();
 
-    RotatableMatrix n = new RotatableMatrix(3, 3);
+    RotatableMatrix n = new RotatableMatrix();
 
-    n.addElement(0, 0, 2);
+    n.setValue(0, 0, 2);
 
-    n.addElement(0, 1, 1);
+    n.setValue(0, 1, 1);
 
-    n.addElement(0, 2, 1);
+    n.setValue(0, 2, 1);
 
-    n.addElement(1, 0, 2);
+    n.setValue(1, 0, 2);
 
-    n.addElement(1, 1, 1);
+    n.setValue(1, 1, 1);
 
-    n.addElement(1, 2, 1);
+    n.setValue(1, 2, 1);
 
-    n.addElement(2, 0, 2);
+    n.setValue(2, 0, 2);
 
-    n.addElement(2, 1, 1);
+    n.setValue(2, 1, 1);
 
-    n.addElement(2, 2, 1);
+    n.setValue(2, 2, 1);
 
     n.print();
 
@@ -321,26 +316,15 @@ public class RotatableMatrix
   }
 
   /**
-   * DOCUMENT ME!
+   * Performs a vector multiplication whose result is the Point representing the
+   * input point's value vector post-multiplied by this matrix.
+   * 
+   * @param coord
+   * @return
    */
-  public void setIdentity()
+  public Point vectorMultiply(Point coord)
   {
-    matrix[0][0] = (float) 1.0;
-
-    matrix[1][1] = (float) 1.0;
-
-    matrix[2][2] = (float) 1.0;
-
-    matrix[0][1] = (float) 0.0;
-
-    matrix[0][2] = (float) 0.0;
-
-    matrix[1][0] = (float) 0.0;
-
-    matrix[1][2] = (float) 0.0;
-
-    matrix[2][0] = (float) 0.0;
-
-    matrix[2][1] = (float) 0.0;
+    float[] v = vectorMultiply(new float[] { coord.x, coord.y, coord.z });
+    return new Point(v[0], v[1], v[2]);
   }
 }
index 86592a0..e24cda5 100644 (file)
@@ -45,11 +45,8 @@ public class SparseMatrix extends Matrix
    */
   public SparseMatrix(double[][] v)
   {
-    rows = v.length;
-    if (rows > 0)
-    {
-      cols = v[0].length;
-    }
+    super(v.length, v.length > 0 ? v[0].length : 0);
+
     sparseColumns = new SparseDoubleArray[cols];
 
     /*
index e1100a8..34aaf3e 100644 (file)
@@ -1,53 +1,73 @@
-#Thu Dec 14 09:10:14 GMT 2017
-jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor
-jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor
-jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor
-jalview.schemabinding.version2.CalcIdParam=jalview.schemabinding.version2.descriptors.CalcIdParamDescriptor
-jalview.schemabinding.version2.Tree=jalview.schemabinding.version2.descriptors.TreeDescriptor
-jalview.schemabinding.version2.JalviewModel=jalview.schemabinding.version2.descriptors.JalviewModelDescriptor
-jalview.schemabinding.version2.SequenceType=jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor
-jalview.schemabinding.version2.OtherData=jalview.schemabinding.version2.descriptors.OtherDataDescriptor
-jalview.schemabinding.version2.Setting=jalview.schemabinding.version2.descriptors.SettingDescriptor
-jalview.schemabinding.version2.AlcodonFrame=jalview.schemabinding.version2.descriptors.AlcodonFrameDescriptor
-jalview.schemabinding.version2.AnnotationElement=jalview.schemabinding.version2.descriptors.AnnotationElementDescriptor
-jalview.schemabinding.version2.FeatureMatcherSet=jalview.schemabinding.version2.descriptors.FeatureMatcherSetDescriptor
+#Mon May 07 14:44:01 BST 2018
 jalview.schemabinding.version2.SecondaryStructure=jalview.schemabinding.version2.descriptors.SecondaryStructureDescriptor
-jalview.schemabinding.version2.MatchCondition=jalview.schemabinding.version2.descriptors.MatchConditionDescriptor
-jalview.schemabinding.version2.SequenceSet=jalview.schemabinding.version2.descriptors.SequenceSetDescriptor
-jalview.schemabinding.version2.Viewport=jalview.schemabinding.version2.descriptors.ViewportDescriptor
-jalview.schemabinding.version2.RnaViewer=jalview.schemabinding.version2.descriptors.RnaViewerDescriptor
+jalview.schemabinding.version2.MapListFrom=jalview.schemabinding.version2.descriptors.MapListFromDescriptor
+jalview.schemabinding.version2.DoubleVector=jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
+jalview.schemabinding.version2.Features=jalview.schemabinding.version2.descriptors.FeaturesDescriptor
 jalview.schemabinding.version2.MapListType=jalview.schemabinding.version2.descriptors.MapListTypeDescriptor
-jalview.schemabinding.version2.Property=jalview.schemabinding.version2.descriptors.PropertyDescriptor
-jalview.schemabinding.version2.UserColourScheme=jalview.schemabinding.version2.descriptors.UserColourSchemeDescriptor
+jalview.schemabinding.version2.CompoundMatcher=jalview.schemabinding.version2.descriptors.CompoundMatcherDescriptor
+jalview.schemabinding.version2.CalcIdParam=jalview.schemabinding.version2.descriptors.CalcIdParamDescriptor
+jalview.schemabinding.version2.Axis=jalview.schemabinding.version2.descriptors.AxisDescriptor
+jalview.schemabinding.version2.E=jalview.schemabinding.version2.descriptors.EDescriptor
+jalview.schemabinding.version2.D=jalview.schemabinding.version2.descriptors.DDescriptor
+jalview.schemabinding.version2.AlcodonFrame=jalview.schemabinding.version2.descriptors.AlcodonFrameDescriptor
 jalview.schemabinding.version2.DBRef=jalview.schemabinding.version2.descriptors.DBRefDescriptor
-jalview.schemabinding.version2.AlcodMap=jalview.schemabinding.version2.descriptors.AlcodMapDescriptor
-jalview.schemabinding.version2.Annotation=jalview.schemabinding.version2.descriptors.AnnotationDescriptor
 jalview.schemabinding.version2.JSeq=jalview.schemabinding.version2.descriptors.JSeqDescriptor
+jalview.schemabinding.version2.VAMSAS=jalview.schemabinding.version2.descriptors.VAMSASDescriptor
+jalview.schemabinding.version2.SequencePoint=jalview.schemabinding.version2.descriptors.SequencePointDescriptor
+jalview.schemabinding.version2.AlcodMap=jalview.schemabinding.version2.descriptors.AlcodMapDescriptor
+jalview.schemabinding.version2.TridiagonalMatrix=jalview.schemabinding.version2.descriptors.TridiagonalMatrixDescriptor
+jalview.schemabinding.version2.Row=jalview.schemabinding.version2.descriptors.RowDescriptor
+jalview.schemabinding.version2.PairwiseMatrix=jalview.schemabinding.version2.descriptors.PairwiseMatrixDescriptor
+jalview.schemabinding.version2.RnaViewer=jalview.schemabinding.version2.descriptors.RnaViewerDescriptor
+jalview.schemabinding.version2.Group=jalview.schemabinding.version2.descriptors.GroupDescriptor
+jalview.schemabinding.version2.PcaViewer=jalview.schemabinding.version2.descriptors.PcaViewerDescriptor
+jalview.schemabinding.version2.JalviewModel=jalview.schemabinding.version2.descriptors.JalviewModelDescriptor
+jalview.schemabinding.version2.JalviewModelSequence=jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor
+jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor
+jalview.schemabinding.version2.TridiagonalE=jalview.schemabinding.version2.descriptors.TridiagonalEDescriptor
+jalview.schemabinding.version2.TridiagonalD=jalview.schemabinding.version2.descriptors.TridiagonalDDescriptor
+jalview.schemabinding.version2.FeatureMatcherSet=jalview.schemabinding.version2.descriptors.FeatureMatcherSetDescriptor
+jalview.schemabinding.version2.VamsasModel=jalview.schemabinding.version2.descriptors.VamsasModelDescriptor
+jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor
 jalview.schemabinding.version2.MatcherSet=jalview.schemabinding.version2.descriptors.MatcherSetDescriptor
-jalview.schemabinding.version2.Sequence=jalview.schemabinding.version2.descriptors.SequenceDescriptor
-jalview.schemabinding.version2.WebServiceParameterSet=jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
-jalview.schemabinding.version2.Alcodon=jalview.schemabinding.version2.descriptors.AlcodonDescriptor
-jalview.schemabinding.version2.Filter=jalview.schemabinding.version2.descriptors.FilterDescriptor
+jalview.schemabinding.version2.JalviewUserColours=jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor
+jalview.schemabinding.version2.FeatureSettings=jalview.schemabinding.version2.descriptors.FeatureSettingsDescriptor
 jalview.schemabinding.version2.AnnotationColours=jalview.schemabinding.version2.descriptors.AnnotationColoursDescriptor
-jalview.schemabinding.version2.Pdbids=jalview.schemabinding.version2.descriptors.PdbidsDescriptor
+jalview.schemabinding.version2.UserColours=jalview.schemabinding.version2.descriptors.UserColoursDescriptor
+jalview.schemabinding.version2.PcaData=jalview.schemabinding.version2.descriptors.PcaDataDescriptor
+jalview.schemabinding.version2.Feature=jalview.schemabinding.version2.descriptors.FeatureDescriptor
+jalview.schemabinding.version2.FeatureMatcher=jalview.schemabinding.version2.descriptors.FeatureMatcherDescriptor
+jalview.schemabinding.version2.EigenMatrixE=jalview.schemabinding.version2.descriptors.EigenMatrixEDescriptor
+jalview.schemabinding.version2.EigenMatrixD=jalview.schemabinding.version2.descriptors.EigenMatrixDDescriptor
+jalview.schemabinding.version2.Annotation=jalview.schemabinding.version2.descriptors.AnnotationDescriptor
+jalview.schemabinding.version2.EigenMatrix=jalview.schemabinding.version2.descriptors.EigenMatrixDescriptor
+jalview.schemabinding.version2.HiddenColumns=jalview.schemabinding.version2.descriptors.HiddenColumnsDescriptor
+jalview.schemabinding.version2.Property=jalview.schemabinding.version2.descriptors.PropertyDescriptor
+jalview.schemabinding.version2.Tree=jalview.schemabinding.version2.descriptors.TreeDescriptor
+jalview.schemabinding.version2.Pdbentry=jalview.schemabinding.version2.descriptors.PdbentryDescriptor
+jalview.schemabinding.version2.OtherData=jalview.schemabinding.version2.descriptors.OtherDataDescriptor
+jalview.schemabinding.version2.Sequence=jalview.schemabinding.version2.descriptors.SequenceDescriptor
 jalview.schemabinding.version2.AnnotationColourScheme=jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor
+jalview.schemabinding.version2.Setting=jalview.schemabinding.version2.descriptors.SettingDescriptor
+jalview.schemabinding.version2.Pdbids=jalview.schemabinding.version2.descriptors.PdbidsDescriptor
+jalview.schemabinding.version2.JGroup=jalview.schemabinding.version2.descriptors.JGroupDescriptor
 jalview.schemabinding.version2.Mapping=jalview.schemabinding.version2.descriptors.MappingDescriptor
-jalview.schemabinding.version2.CompoundMatcher=jalview.schemabinding.version2.descriptors.CompoundMatcherDescriptor
-jalview.schemabinding.version2.JalviewModelSequence=jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor
-jalview.schemabinding.version2.Group=jalview.schemabinding.version2.descriptors.GroupDescriptor
-jalview.schemabinding.version2.MappingChoice=jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor
-jalview.schemabinding.version2.Feature=jalview.schemabinding.version2.descriptors.FeatureDescriptor
-jalview.schemabinding.version2.UserColours=jalview.schemabinding.version2.descriptors.UserColoursDescriptor
-jalview.schemabinding.version2.Colour=jalview.schemabinding.version2.descriptors.ColourDescriptor
+jalview.schemabinding.version2.SequenceSet=jalview.schemabinding.version2.descriptors.SequenceSetDescriptor
+jalview.schemabinding.version2.PcaDataType=jalview.schemabinding.version2.descriptors.PcaDataTypeDescriptor
+jalview.schemabinding.version2.SeqPointMin=jalview.schemabinding.version2.descriptors.SeqPointMinDescriptor
+jalview.schemabinding.version2.MatchCondition=jalview.schemabinding.version2.descriptors.MatchConditionDescriptor
+jalview.schemabinding.version2.SymmMatrix=jalview.schemabinding.version2.descriptors.SymmMatrixDescriptor
+jalview.schemabinding.version2.WebServiceParameterSet=jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
 jalview.schemabinding.version2.PdbentryItem=jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor
-jalview.schemabinding.version2.MapListFrom=jalview.schemabinding.version2.descriptors.MapListFromDescriptor
-jalview.schemabinding.version2.FeatureSettings=jalview.schemabinding.version2.descriptors.FeatureSettingsDescriptor
-jalview.schemabinding.version2.JGroup=jalview.schemabinding.version2.descriptors.JGroupDescriptor
+jalview.schemabinding.version2.Viewport=jalview.schemabinding.version2.descriptors.ViewportDescriptor
+jalview.schemabinding.version2.DoubleMatrix=jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
+jalview.schemabinding.version2.Colour=jalview.schemabinding.version2.descriptors.ColourDescriptor
+jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor
+jalview.schemabinding.version2.Filter=jalview.schemabinding.version2.descriptors.FilterDescriptor
+jalview.schemabinding.version2.MappingChoice=jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor
+jalview.schemabinding.version2.Alcodon=jalview.schemabinding.version2.descriptors.AlcodonDescriptor
+jalview.schemabinding.version2.UserColourScheme=jalview.schemabinding.version2.descriptors.UserColourSchemeDescriptor
 jalview.schemabinding.version2.MapListTo=jalview.schemabinding.version2.descriptors.MapListToDescriptor
-jalview.schemabinding.version2.JalviewUserColours=jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor
-jalview.schemabinding.version2.VamsasModel=jalview.schemabinding.version2.descriptors.VamsasModelDescriptor
-jalview.schemabinding.version2.Pdbentry=jalview.schemabinding.version2.descriptors.PdbentryDescriptor
-jalview.schemabinding.version2.HiddenColumns=jalview.schemabinding.version2.descriptors.HiddenColumnsDescriptor
-jalview.schemabinding.version2.Features=jalview.schemabinding.version2.descriptors.FeaturesDescriptor
-jalview.schemabinding.version2.VAMSAS=jalview.schemabinding.version2.descriptors.VAMSASDescriptor
-jalview.schemabinding.version2.FeatureMatcher=jalview.schemabinding.version2.descriptors.FeatureMatcherDescriptor
+jalview.schemabinding.version2.SequenceType=jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor
+jalview.schemabinding.version2.AnnotationElement=jalview.schemabinding.version2.descriptors.AnnotationElementDescriptor
+jalview.schemabinding.version2.SeqPointMax=jalview.schemabinding.version2.descriptors.SeqPointMaxDescriptor
diff --git a/src/jalview/schemabinding/version2/Axis.java b/src/jalview/schemabinding/version2/Axis.java
new file mode 100644 (file)
index 0000000..9fe9660
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * endpoints of X, Y and Z axes in that order
+ * 
+ * 
+ * @version $Revision$ $Date$
+ */
+public class Axis implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _xPos.
+   */
+  private float _xPos;
+
+  /**
+   * keeps track of state for field: _xPos
+   */
+  private boolean _has_xPos;
+
+  /**
+   * Field _yPos.
+   */
+  private float _yPos;
+
+  /**
+   * keeps track of state for field: _yPos
+   */
+  private boolean _has_yPos;
+
+  /**
+   * Field _zPos.
+   */
+  private float _zPos;
+
+  /**
+   * keeps track of state for field: _zPos
+   */
+  private boolean _has_zPos;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public Axis()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   */
+  public void deleteXPos()
+  {
+    this._has_xPos = false;
+  }
+
+  /**
+   */
+  public void deleteYPos()
+  {
+    this._has_yPos = false;
+  }
+
+  /**
+   */
+  public void deleteZPos()
+  {
+    this._has_zPos = false;
+  }
+
+  /**
+   * Returns the value of field 'xPos'.
+   * 
+   * @return the value of field 'XPos'.
+   */
+  public float getXPos()
+  {
+    return this._xPos;
+  }
+
+  /**
+   * Returns the value of field 'yPos'.
+   * 
+   * @return the value of field 'YPos'.
+   */
+  public float getYPos()
+  {
+    return this._yPos;
+  }
+
+  /**
+   * Returns the value of field 'zPos'.
+   * 
+   * @return the value of field 'ZPos'.
+   */
+  public float getZPos()
+  {
+    return this._zPos;
+  }
+
+  /**
+   * Method hasXPos.
+   * 
+   * @return true if at least one XPos has been added
+   */
+  public boolean hasXPos()
+  {
+    return this._has_xPos;
+  }
+
+  /**
+   * Method hasYPos.
+   * 
+   * @return true if at least one YPos has been added
+   */
+  public boolean hasYPos()
+  {
+    return this._has_yPos;
+  }
+
+  /**
+   * Method hasZPos.
+   * 
+   * @return true if at least one ZPos has been added
+   */
+  public boolean hasZPos()
+  {
+    return this._has_zPos;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Sets the value of field 'xPos'.
+   * 
+   * @param xPos
+   *          the value of field 'xPos'.
+   */
+  public void setXPos(final float xPos)
+  {
+    this._xPos = xPos;
+    this._has_xPos = true;
+  }
+
+  /**
+   * Sets the value of field 'yPos'.
+   * 
+   * @param yPos
+   *          the value of field 'yPos'.
+   */
+  public void setYPos(final float yPos)
+  {
+    this._yPos = yPos;
+    this._has_yPos = true;
+  }
+
+  /**
+   * Sets the value of field 'zPos'.
+   * 
+   * @param zPos
+   *          the value of field 'zPos'.
+   */
+  public void setZPos(final float zPos)
+  {
+    this._zPos = zPos;
+    this._has_zPos = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.Axis
+   */
+  public static jalview.schemabinding.version2.Axis unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.Axis) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.Axis.class, reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/D.java b/src/jalview/schemabinding/version2/D.java
new file mode 100644 (file)
index 0000000..9ea09d9
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class D.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class D extends DoubleVector implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public D()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
+   */
+  public static jalview.schemabinding.version2.DoubleVector unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.D.class, reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/DoubleMatrix.java b/src/jalview/schemabinding/version2/DoubleMatrix.java
new file mode 100644 (file)
index 0000000..04aed99
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class DoubleMatrix.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class DoubleMatrix implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _rows.
+   */
+  private int _rows;
+
+  /**
+   * keeps track of state for field: _rows
+   */
+  private boolean _has_rows;
+
+  /**
+   * Field _columns.
+   */
+  private int _columns;
+
+  /**
+   * keeps track of state for field: _columns
+   */
+  private boolean _has_columns;
+
+  /**
+   * Field _rowList.
+   */
+  private java.util.Vector _rowList;
+
+  /**
+   * Field _d.
+   */
+  private jalview.schemabinding.version2.D _d;
+
+  /**
+   * Field _e.
+   */
+  private jalview.schemabinding.version2.E _e;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public DoubleMatrix()
+  {
+    super();
+    this._rowList = new java.util.Vector();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * 
+   * 
+   * @param vRow
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addRow(final jalview.schemabinding.version2.Row vRow)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._rowList.addElement(vRow);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vRow
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addRow(final int index,
+          final jalview.schemabinding.version2.Row vRow)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._rowList.add(index, vRow);
+  }
+
+  /**
+   */
+  public void deleteColumns()
+  {
+    this._has_columns = false;
+  }
+
+  /**
+   */
+  public void deleteRows()
+  {
+    this._has_rows = false;
+  }
+
+  /**
+   * Method enumerateRow.
+   * 
+   * @return an Enumeration over all jalview.schemabinding.version2.Row elements
+   */
+  public java.util.Enumeration enumerateRow()
+  {
+    return this._rowList.elements();
+  }
+
+  /**
+   * Returns the value of field 'columns'.
+   * 
+   * @return the value of field 'Columns'.
+   */
+  public int getColumns()
+  {
+    return this._columns;
+  }
+
+  /**
+   * Returns the value of field 'd'.
+   * 
+   * @return the value of field 'D'.
+   */
+  public jalview.schemabinding.version2.D getD()
+  {
+    return this._d;
+  }
+
+  /**
+   * Returns the value of field 'e'.
+   * 
+   * @return the value of field 'E'.
+   */
+  public jalview.schemabinding.version2.E getE()
+  {
+    return this._e;
+  }
+
+  /**
+   * Method getRow.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the jalview.schemabinding.version2.Row at the given
+   *         index
+   */
+  public jalview.schemabinding.version2.Row getRow(final int index)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._rowList.size())
+    {
+      throw new IndexOutOfBoundsException("getRow: Index value '" + index
+              + "' not in range [0.." + (this._rowList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.Row) _rowList.get(index);
+  }
+
+  /**
+   * Method getRow.Returns the contents of the collection in an Array.
+   * <p>
+   * Note: Just in case the collection contents are changing in another thread,
+   * we pass a 0-length Array of the correct type into the API call. This way we
+   * <i>know</i> that the Array returned is of exactly the correct length.
+   * 
+   * @return this collection as an Array
+   */
+  public jalview.schemabinding.version2.Row[] getRow()
+  {
+    jalview.schemabinding.version2.Row[] array = new jalview.schemabinding.version2.Row[0];
+    return (jalview.schemabinding.version2.Row[]) this._rowList
+            .toArray(array);
+  }
+
+  /**
+   * Method getRowCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getRowCount()
+  {
+    return this._rowList.size();
+  }
+
+  /**
+   * Returns the value of field 'rows'.
+   * 
+   * @return the value of field 'Rows'.
+   */
+  public int getRows()
+  {
+    return this._rows;
+  }
+
+  /**
+   * Method hasColumns.
+   * 
+   * @return true if at least one Columns has been added
+   */
+  public boolean hasColumns()
+  {
+    return this._has_columns;
+  }
+
+  /**
+   * Method hasRows.
+   * 
+   * @return true if at least one Rows has been added
+   */
+  public boolean hasRows()
+  {
+    return this._has_rows;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   */
+  public void removeAllRow()
+  {
+    this._rowList.clear();
+  }
+
+  /**
+   * Method removeRow.
+   * 
+   * @param vRow
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removeRow(final jalview.schemabinding.version2.Row vRow)
+  {
+    boolean removed = _rowList.remove(vRow);
+    return removed;
+  }
+
+  /**
+   * Method removeRowAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.Row removeRowAt(final int index)
+  {
+    java.lang.Object obj = this._rowList.remove(index);
+    return (jalview.schemabinding.version2.Row) obj;
+  }
+
+  /**
+   * Sets the value of field 'columns'.
+   * 
+   * @param columns
+   *          the value of field 'columns'.
+   */
+  public void setColumns(final int columns)
+  {
+    this._columns = columns;
+    this._has_columns = true;
+  }
+
+  /**
+   * Sets the value of field 'd'.
+   * 
+   * @param d
+   *          the value of field 'd'.
+   */
+  public void setD(final jalview.schemabinding.version2.D d)
+  {
+    this._d = d;
+  }
+
+  /**
+   * Sets the value of field 'e'.
+   * 
+   * @param e
+   *          the value of field 'e'.
+   */
+  public void setE(final jalview.schemabinding.version2.E e)
+  {
+    this._e = e;
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vRow
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setRow(final int index,
+          final jalview.schemabinding.version2.Row vRow)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._rowList.size())
+    {
+      throw new IndexOutOfBoundsException("setRow: Index value '" + index
+              + "' not in range [0.." + (this._rowList.size() - 1) + "]");
+    }
+
+    this._rowList.set(index, vRow);
+  }
+
+  /**
+   * 
+   * 
+   * @param vRowArray
+   */
+  public void setRow(final jalview.schemabinding.version2.Row[] vRowArray)
+  {
+    // -- copy array
+    _rowList.clear();
+
+    for (int i = 0; i < vRowArray.length; i++)
+    {
+      this._rowList.add(vRowArray[i]);
+    }
+  }
+
+  /**
+   * Sets the value of field 'rows'.
+   * 
+   * @param rows
+   *          the value of field 'rows'.
+   */
+  public void setRows(final int rows)
+  {
+    this._rows = rows;
+    this._has_rows = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
+   */
+  public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.DoubleMatrix.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/DoubleVector.java b/src/jalview/schemabinding/version2/DoubleVector.java
new file mode 100644 (file)
index 0000000..c4d8ff5
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class DoubleVector.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class DoubleVector implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _vList.
+   */
+  private java.util.Vector _vList;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public DoubleVector()
+  {
+    super();
+    this._vList = new java.util.Vector();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * 
+   * 
+   * @param vV
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addV(final double vV)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._vList.addElement(new java.lang.Double(vV));
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vV
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addV(final int index, final double vV)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._vList.add(index, new java.lang.Double(vV));
+  }
+
+  /**
+   * Method enumerateV.
+   * 
+   * @return an Enumeration over all double elements
+   */
+  public java.util.Enumeration enumerateV()
+  {
+    return this._vList.elements();
+  }
+
+  /**
+   * Method getV.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the double at the given index
+   */
+  public double getV(final int index)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._vList.size())
+    {
+      throw new IndexOutOfBoundsException("getV: Index value '" + index
+              + "' not in range [0.." + (this._vList.size() - 1) + "]");
+    }
+
+    return ((java.lang.Double) _vList.get(index)).doubleValue();
+  }
+
+  /**
+   * Method getV.Returns the contents of the collection in an Array.
+   * 
+   * @return this collection as an Array
+   */
+  public double[] getV()
+  {
+    int size = this._vList.size();
+    double[] array = new double[size];
+    java.util.Iterator iter = _vList.iterator();
+    for (int index = 0; index < size; index++)
+    {
+      array[index] = ((java.lang.Double) iter.next()).doubleValue();
+    }
+    return array;
+  }
+
+  /**
+   * Method getVCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getVCount()
+  {
+    return this._vList.size();
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   */
+  public void removeAllV()
+  {
+    this._vList.clear();
+  }
+
+  /**
+   * Method removeV.
+   * 
+   * @param vV
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removeV(final double vV)
+  {
+    boolean removed = _vList.remove(new java.lang.Double(vV));
+    return removed;
+  }
+
+  /**
+   * Method removeVAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public double removeVAt(final int index)
+  {
+    java.lang.Object obj = this._vList.remove(index);
+    return ((java.lang.Double) obj).doubleValue();
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vV
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setV(final int index, final double vV)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._vList.size())
+    {
+      throw new IndexOutOfBoundsException("setV: Index value '" + index
+              + "' not in range [0.." + (this._vList.size() - 1) + "]");
+    }
+
+    this._vList.set(index, new java.lang.Double(vV));
+  }
+
+  /**
+   * 
+   * 
+   * @param vVArray
+   */
+  public void setV(final double[] vVArray)
+  {
+    // -- copy array
+    _vList.clear();
+
+    for (int i = 0; i < vVArray.length; i++)
+    {
+      this._vList.add(new java.lang.Double(vVArray[i]));
+    }
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
+   */
+  public static jalview.schemabinding.version2.DoubleVector unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.DoubleVector.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/E.java b/src/jalview/schemabinding/version2/E.java
new file mode 100644 (file)
index 0000000..5daa4dd
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class E.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class E extends DoubleVector implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public E()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
+   */
+  public static jalview.schemabinding.version2.DoubleVector unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.E.class, reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/EigenMatrix.java b/src/jalview/schemabinding/version2/EigenMatrix.java
new file mode 100644 (file)
index 0000000..b04a50c
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class EigenMatrix.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class EigenMatrix extends DoubleMatrix
+        implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public EigenMatrix()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
+   */
+  public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.EigenMatrix.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
index c7c02c5..932ba14 100644 (file)
@@ -52,6 +52,11 @@ public class JalviewModelSequence implements java.io.Serializable
   private java.util.Vector _treeList;
 
   /**
+   * Field _pcaViewerList.
+   */
+  private java.util.Vector _pcaViewerList;
+
+  /**
    * Field _featureSettings.
    */
   private jalview.schemabinding.version2.FeatureSettings _featureSettings;
@@ -68,6 +73,7 @@ public class JalviewModelSequence implements java.io.Serializable
     this._viewportList = new java.util.Vector();
     this._userColoursList = new java.util.Vector();
     this._treeList = new java.util.Vector();
+    this._pcaViewerList = new java.util.Vector();
   }
 
   // -----------/
@@ -133,6 +139,35 @@ public class JalviewModelSequence implements java.io.Serializable
   /**
    * 
    * 
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addPcaViewer(
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._pcaViewerList.addElement(vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addPcaViewer(final int index,
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._pcaViewerList.add(index, vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
    * @param vTree
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
@@ -239,6 +274,17 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method enumeratePcaViewer.
+   * 
+   * @return an Enumeration over all jalview.schemabinding.version2.PcaViewer
+   *         elements
+   */
+  public java.util.Enumeration enumeratePcaViewer()
+  {
+    return this._pcaViewerList.elements();
+  }
+
+  /**
    * Method enumerateTree.
    * 
    * @return an Enumeration over all jalview.schemabinding.version2.Tree
@@ -296,9 +342,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JGroupList.size())
     {
-      throw new IndexOutOfBoundsException("getJGroup: Index value '"
-              + index + "' not in range [0.."
-              + (this._JGroupList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException(
+              "getJGroup: Index value '" + index + "' not in range [0.."
+                      + (this._JGroupList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
@@ -379,6 +425,56 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method getPcaViewer.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the jalview.schemabinding.version2.PcaViewer at the
+   *         given index
+   */
+  public jalview.schemabinding.version2.PcaViewer getPcaViewer(
+          final int index) throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._pcaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException(
+              "getPcaViewer: Index value '" + index + "' not in range [0.."
+                      + (this._pcaViewerList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.PcaViewer) _pcaViewerList
+            .get(index);
+  }
+
+  /**
+   * Method getPcaViewer.Returns the contents of the collection in an Array.
+   * <p>
+   * Note: Just in case the collection contents are changing in another thread,
+   * we pass a 0-length Array of the correct type into the API call. This way we
+   * <i>know</i> that the Array returned is of exactly the correct length.
+   * 
+   * @return this collection as an Array
+   */
+  public jalview.schemabinding.version2.PcaViewer[] getPcaViewer()
+  {
+    jalview.schemabinding.version2.PcaViewer[] array = new jalview.schemabinding.version2.PcaViewer[0];
+    return (jalview.schemabinding.version2.PcaViewer[]) this._pcaViewerList
+            .toArray(array);
+  }
+
+  /**
+   * Method getPcaViewerCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getPcaViewerCount()
+  {
+    return this._pcaViewerList.size();
+  }
+
+  /**
    * Method getTree.
    * 
    * @param index
@@ -485,15 +581,15 @@ public class JalviewModelSequence implements java.io.Serializable
    * @return the value of the jalview.schemabinding.version2.Viewport at the
    *         given index
    */
-  public jalview.schemabinding.version2.Viewport getViewport(final int index)
-          throws java.lang.IndexOutOfBoundsException
+  public jalview.schemabinding.version2.Viewport getViewport(
+          final int index) throws java.lang.IndexOutOfBoundsException
   {
     // check bounds for index
     if (index < 0 || index >= this._viewportList.size())
     {
-      throw new IndexOutOfBoundsException("getViewport: Index value '"
-              + index + "' not in range [0.."
-              + (this._viewportList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException(
+              "getViewport: Index value '" + index + "' not in range [0.."
+                      + (this._viewportList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.Viewport) _viewportList
@@ -581,35 +677,42 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
-     */
+   */
   public void removeAllJGroup()
   {
     this._JGroupList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllJSeq()
   {
     this._JSeqList.clear();
   }
 
   /**
-     */
+   */
+  public void removeAllPcaViewer()
+  {
+    this._pcaViewerList.clear();
+  }
+
+  /**
+   */
   public void removeAllTree()
   {
     this._treeList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllUserColours()
   {
     this._userColoursList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllViewport()
   {
     this._viewportList.clear();
@@ -666,6 +769,32 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method removePcaViewer.
+   * 
+   * @param vPcaViewer
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removePcaViewer(
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+  {
+    boolean removed = _pcaViewerList.remove(vPcaViewer);
+    return removed;
+  }
+
+  /**
+   * Method removePcaViewerAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.PcaViewer removePcaViewerAt(
+          final int index)
+  {
+    java.lang.Object obj = this._pcaViewerList.remove(index);
+    return (jalview.schemabinding.version2.PcaViewer) obj;
+  }
+
+  /**
    * Method removeTree.
    * 
    * @param vTree
@@ -768,9 +897,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JGroupList.size())
     {
-      throw new IndexOutOfBoundsException("setJGroup: Index value '"
-              + index + "' not in range [0.."
-              + (this._JGroupList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException(
+              "setJGroup: Index value '" + index + "' not in range [0.."
+                      + (this._JGroupList.size() - 1) + "]");
     }
 
     this._JGroupList.set(index, vJGroup);
@@ -820,7 +949,8 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * @param vJSeqArray
    */
-  public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
+  public void setJSeq(
+          final jalview.schemabinding.version2.JSeq[] vJSeqArray)
   {
     // -- copy array
     _JSeqList.clear();
@@ -835,6 +965,46 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * 
    * @param index
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setPcaViewer(final int index,
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._pcaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException(
+              "setPcaViewer: Index value '" + index + "' not in range [0.."
+                      + (this._pcaViewerList.size() - 1) + "]");
+    }
+
+    this._pcaViewerList.set(index, vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param vPcaViewerArray
+   */
+  public void setPcaViewer(
+          final jalview.schemabinding.version2.PcaViewer[] vPcaViewerArray)
+  {
+    // -- copy array
+    _pcaViewerList.clear();
+
+    for (int i = 0; i < vPcaViewerArray.length; i++)
+    {
+      this._pcaViewerList.add(vPcaViewerArray[i]);
+    }
+  }
+
+  /**
+   * 
+   * 
+   * @param index
    * @param vTree
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
@@ -858,7 +1028,8 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * @param vTreeArray
    */
-  public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
+  public void setTree(
+          final jalview.schemabinding.version2.Tree[] vTreeArray)
   {
     // -- copy array
     _treeList.clear();
@@ -924,9 +1095,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._viewportList.size())
     {
-      throw new IndexOutOfBoundsException("setViewport: Index value '"
-              + index + "' not in range [0.."
-              + (this._viewportList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException(
+              "setViewport: Index value '" + index + "' not in range [0.."
+                      + (this._viewportList.size() - 1) + "]");
     }
 
     this._viewportList.set(index, vViewport);
diff --git a/src/jalview/schemabinding/version2/PairwiseMatrix.java b/src/jalview/schemabinding/version2/PairwiseMatrix.java
new file mode 100644 (file)
index 0000000..3906111
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class PairwiseMatrix.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PairwiseMatrix extends DoubleMatrix
+        implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PairwiseMatrix()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
+   */
+  public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.PairwiseMatrix.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/PcaData.java b/src/jalview/schemabinding/version2/PcaData.java
new file mode 100644 (file)
index 0000000..dfce269
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class PcaData.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaData extends PcaDataType implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaData()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.PcaDataType
+   */
+  public static jalview.schemabinding.version2.PcaDataType unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.PcaDataType) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.PcaData.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/PcaDataType.java b/src/jalview/schemabinding/version2/PcaDataType.java
new file mode 100644 (file)
index 0000000..42f1723
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * The results of a PCA calculation
+ * 
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaDataType implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _pairwiseMatrix.
+   */
+  private jalview.schemabinding.version2.PairwiseMatrix _pairwiseMatrix;
+
+  /**
+   * Field _tridiagonalMatrix.
+   */
+  private jalview.schemabinding.version2.TridiagonalMatrix _tridiagonalMatrix;
+
+  /**
+   * Field _eigenMatrix.
+   */
+  private jalview.schemabinding.version2.EigenMatrix _eigenMatrix;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaDataType()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Returns the value of field 'eigenMatrix'.
+   * 
+   * @return the value of field 'EigenMatrix'.
+   */
+  public jalview.schemabinding.version2.EigenMatrix getEigenMatrix()
+  {
+    return this._eigenMatrix;
+  }
+
+  /**
+   * Returns the value of field 'pairwiseMatrix'.
+   * 
+   * @return the value of field 'PairwiseMatrix'.
+   */
+  public jalview.schemabinding.version2.PairwiseMatrix getPairwiseMatrix()
+  {
+    return this._pairwiseMatrix;
+  }
+
+  /**
+   * Returns the value of field 'tridiagonalMatrix'.
+   * 
+   * @return the value of field 'TridiagonalMatrix'.
+   */
+  public jalview.schemabinding.version2.TridiagonalMatrix getTridiagonalMatrix()
+  {
+    return this._tridiagonalMatrix;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Sets the value of field 'eigenMatrix'.
+   * 
+   * @param eigenMatrix
+   *          the value of field 'eigenMatrix'.
+   */
+  public void setEigenMatrix(
+          final jalview.schemabinding.version2.EigenMatrix eigenMatrix)
+  {
+    this._eigenMatrix = eigenMatrix;
+  }
+
+  /**
+   * Sets the value of field 'pairwiseMatrix'.
+   * 
+   * @param pairwiseMatrix
+   *          the value of field 'pairwiseMatrix'.
+   */
+  public void setPairwiseMatrix(
+          final jalview.schemabinding.version2.PairwiseMatrix pairwiseMatrix)
+  {
+    this._pairwiseMatrix = pairwiseMatrix;
+  }
+
+  /**
+   * Sets the value of field 'tridiagonalMatrix'.
+   * 
+   * @param tridiagonalMatrix
+   *          the value of field 'tridiagonalMatrix'.
+   */
+  public void setTridiagonalMatrix(
+          final jalview.schemabinding.version2.TridiagonalMatrix tridiagonalMatrix)
+  {
+    this._tridiagonalMatrix = tridiagonalMatrix;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.PcaDataType
+   */
+  public static jalview.schemabinding.version2.PcaDataType unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.PcaDataType) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.PcaDataType.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/PcaViewer.java b/src/jalview/schemabinding/version2/PcaViewer.java
new file mode 100644 (file)
index 0000000..3fce2d5
--- /dev/null
@@ -0,0 +1,1403 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class PcaViewer.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaViewer implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _title.
+   */
+  private java.lang.String _title;
+
+  /**
+   * Field _scoreModelName.
+   */
+  private java.lang.String _scoreModelName;
+
+  /**
+   * Field _xDim.
+   */
+  private int _xDim;
+
+  /**
+   * keeps track of state for field: _xDim
+   */
+  private boolean _has_xDim;
+
+  /**
+   * Field _yDim.
+   */
+  private int _yDim;
+
+  /**
+   * keeps track of state for field: _yDim
+   */
+  private boolean _has_yDim;
+
+  /**
+   * Field _zDim.
+   */
+  private int _zDim;
+
+  /**
+   * keeps track of state for field: _zDim
+   */
+  private boolean _has_zDim;
+
+  /**
+   * Field _bgColour.
+   */
+  private int _bgColour;
+
+  /**
+   * keeps track of state for field: _bgColour
+   */
+  private boolean _has_bgColour;
+
+  /**
+   * Field _scaleFactor.
+   */
+  private float _scaleFactor;
+
+  /**
+   * keeps track of state for field: _scaleFactor
+   */
+  private boolean _has_scaleFactor;
+
+  /**
+   * Field _showLabels.
+   */
+  private boolean _showLabels;
+
+  /**
+   * keeps track of state for field: _showLabels
+   */
+  private boolean _has_showLabels;
+
+  /**
+   * Field _linkToAllViews.
+   */
+  private boolean _linkToAllViews;
+
+  /**
+   * keeps track of state for field: _linkToAllViews
+   */
+  private boolean _has_linkToAllViews;
+
+  /**
+   * Field _includeGaps.
+   */
+  private boolean _includeGaps;
+
+  /**
+   * keeps track of state for field: _includeGaps
+   */
+  private boolean _has_includeGaps;
+
+  /**
+   * Field _matchGaps.
+   */
+  private boolean _matchGaps;
+
+  /**
+   * keeps track of state for field: _matchGaps
+   */
+  private boolean _has_matchGaps;
+
+  /**
+   * Field _includeGappedColumns.
+   */
+  private boolean _includeGappedColumns;
+
+  /**
+   * keeps track of state for field: _includeGappedColumns
+   */
+  private boolean _has_includeGappedColumns;
+
+  /**
+   * Field _denominateByShortestLength.
+   */
+  private boolean _denominateByShortestLength;
+
+  /**
+   * keeps track of state for field: _denominateByShortestLength
+   */
+  private boolean _has_denominateByShortestLength;
+
+  /**
+   * Field _width.
+   */
+  private int _width;
+
+  /**
+   * keeps track of state for field: _width
+   */
+  private boolean _has_width;
+
+  /**
+   * Field _height.
+   */
+  private int _height;
+
+  /**
+   * keeps track of state for field: _height
+   */
+  private boolean _has_height;
+
+  /**
+   * Field _xpos.
+   */
+  private int _xpos;
+
+  /**
+   * keeps track of state for field: _xpos
+   */
+  private boolean _has_xpos;
+
+  /**
+   * Field _ypos.
+   */
+  private int _ypos;
+
+  /**
+   * keeps track of state for field: _ypos
+   */
+  private boolean _has_ypos;
+
+  /**
+   * Field _sequencePointList.
+   */
+  private java.util.Vector _sequencePointList;
+
+  /**
+   * endpoints of X, Y and Z axes in that order
+   * 
+   */
+  private java.util.Vector _axisList;
+
+  /**
+   * Field _seqPointMin.
+   */
+  private jalview.schemabinding.version2.SeqPointMin _seqPointMin;
+
+  /**
+   * Field _seqPointMax.
+   */
+  private jalview.schemabinding.version2.SeqPointMax _seqPointMax;
+
+  /**
+   * Field _pcaData.
+   */
+  private jalview.schemabinding.version2.PcaData _pcaData;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaViewer()
+  {
+    super();
+    this._sequencePointList = new java.util.Vector();
+    this._axisList = new java.util.Vector();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * 
+   * 
+   * @param vAxis
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addAxis(final jalview.schemabinding.version2.Axis vAxis)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check for the maximum size
+    if (this._axisList.size() >= 3)
+    {
+      throw new IndexOutOfBoundsException("addAxis has a maximum of 3");
+    }
+
+    this._axisList.addElement(vAxis);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vAxis
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addAxis(final int index,
+          final jalview.schemabinding.version2.Axis vAxis)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check for the maximum size
+    if (this._axisList.size() >= 3)
+    {
+      throw new IndexOutOfBoundsException("addAxis has a maximum of 3");
+    }
+
+    this._axisList.add(index, vAxis);
+  }
+
+  /**
+   * 
+   * 
+   * @param vSequencePoint
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addSequencePoint(
+          final jalview.schemabinding.version2.SequencePoint vSequencePoint)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._sequencePointList.addElement(vSequencePoint);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vSequencePoint
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addSequencePoint(final int index,
+          final jalview.schemabinding.version2.SequencePoint vSequencePoint)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._sequencePointList.add(index, vSequencePoint);
+  }
+
+  /**
+   */
+  public void deleteBgColour()
+  {
+    this._has_bgColour = false;
+  }
+
+  /**
+   */
+  public void deleteDenominateByShortestLength()
+  {
+    this._has_denominateByShortestLength = false;
+  }
+
+  /**
+   */
+  public void deleteHeight()
+  {
+    this._has_height = false;
+  }
+
+  /**
+   */
+  public void deleteIncludeGappedColumns()
+  {
+    this._has_includeGappedColumns = false;
+  }
+
+  /**
+   */
+  public void deleteIncludeGaps()
+  {
+    this._has_includeGaps = false;
+  }
+
+  /**
+   */
+  public void deleteLinkToAllViews()
+  {
+    this._has_linkToAllViews = false;
+  }
+
+  /**
+   */
+  public void deleteMatchGaps()
+  {
+    this._has_matchGaps = false;
+  }
+
+  /**
+   */
+  public void deleteScaleFactor()
+  {
+    this._has_scaleFactor = false;
+  }
+
+  /**
+   */
+  public void deleteShowLabels()
+  {
+    this._has_showLabels = false;
+  }
+
+  /**
+   */
+  public void deleteWidth()
+  {
+    this._has_width = false;
+  }
+
+  /**
+   */
+  public void deleteXDim()
+  {
+    this._has_xDim = false;
+  }
+
+  /**
+   */
+  public void deleteXpos()
+  {
+    this._has_xpos = false;
+  }
+
+  /**
+   */
+  public void deleteYDim()
+  {
+    this._has_yDim = false;
+  }
+
+  /**
+   */
+  public void deleteYpos()
+  {
+    this._has_ypos = false;
+  }
+
+  /**
+   */
+  public void deleteZDim()
+  {
+    this._has_zDim = false;
+  }
+
+  /**
+   * Method enumerateAxis.
+   * 
+   * @return an Enumeration over all jalview.schemabinding.version2.Axis
+   *         elements
+   */
+  public java.util.Enumeration enumerateAxis()
+  {
+    return this._axisList.elements();
+  }
+
+  /**
+   * Method enumerateSequencePoint.
+   * 
+   * @return an Enumeration over all
+   *         jalview.schemabinding.version2.SequencePoint elements
+   */
+  public java.util.Enumeration enumerateSequencePoint()
+  {
+    return this._sequencePointList.elements();
+  }
+
+  /**
+   * Method getAxis.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the jalview.schemabinding.version2.Axis at the given
+   *         index
+   */
+  public jalview.schemabinding.version2.Axis getAxis(final int index)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._axisList.size())
+    {
+      throw new IndexOutOfBoundsException("getAxis: Index value '" + index
+              + "' not in range [0.." + (this._axisList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.Axis) _axisList.get(index);
+  }
+
+  /**
+   * Method getAxis.Returns the contents of the collection in an Array.
+   * <p>
+   * Note: Just in case the collection contents are changing in another thread,
+   * we pass a 0-length Array of the correct type into the API call. This way we
+   * <i>know</i> that the Array returned is of exactly the correct length.
+   * 
+   * @return this collection as an Array
+   */
+  public jalview.schemabinding.version2.Axis[] getAxis()
+  {
+    jalview.schemabinding.version2.Axis[] array = new jalview.schemabinding.version2.Axis[0];
+    return (jalview.schemabinding.version2.Axis[]) this._axisList
+            .toArray(array);
+  }
+
+  /**
+   * Method getAxisCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getAxisCount()
+  {
+    return this._axisList.size();
+  }
+
+  /**
+   * Returns the value of field 'bgColour'.
+   * 
+   * @return the value of field 'BgColour'.
+   */
+  public int getBgColour()
+  {
+    return this._bgColour;
+  }
+
+  /**
+   * Returns the value of field 'denominateByShortestLength'.
+   * 
+   * @return the value of field 'DenominateByShortestLength'.
+   */
+  public boolean getDenominateByShortestLength()
+  {
+    return this._denominateByShortestLength;
+  }
+
+  /**
+   * Returns the value of field 'height'.
+   * 
+   * @return the value of field 'Height'.
+   */
+  public int getHeight()
+  {
+    return this._height;
+  }
+
+  /**
+   * Returns the value of field 'includeGappedColumns'.
+   * 
+   * @return the value of field 'IncludeGappedColumns'.
+   */
+  public boolean getIncludeGappedColumns()
+  {
+    return this._includeGappedColumns;
+  }
+
+  /**
+   * Returns the value of field 'includeGaps'.
+   * 
+   * @return the value of field 'IncludeGaps'.
+   */
+  public boolean getIncludeGaps()
+  {
+    return this._includeGaps;
+  }
+
+  /**
+   * Returns the value of field 'linkToAllViews'.
+   * 
+   * @return the value of field 'LinkToAllViews'.
+   */
+  public boolean getLinkToAllViews()
+  {
+    return this._linkToAllViews;
+  }
+
+  /**
+   * Returns the value of field 'matchGaps'.
+   * 
+   * @return the value of field 'MatchGaps'.
+   */
+  public boolean getMatchGaps()
+  {
+    return this._matchGaps;
+  }
+
+  /**
+   * Returns the value of field 'pcaData'.
+   * 
+   * @return the value of field 'PcaData'.
+   */
+  public jalview.schemabinding.version2.PcaData getPcaData()
+  {
+    return this._pcaData;
+  }
+
+  /**
+   * Returns the value of field 'scaleFactor'.
+   * 
+   * @return the value of field 'ScaleFactor'.
+   */
+  public float getScaleFactor()
+  {
+    return this._scaleFactor;
+  }
+
+  /**
+   * Returns the value of field 'scoreModelName'.
+   * 
+   * @return the value of field 'ScoreModelName'.
+   */
+  public java.lang.String getScoreModelName()
+  {
+    return this._scoreModelName;
+  }
+
+  /**
+   * Returns the value of field 'seqPointMax'.
+   * 
+   * @return the value of field 'SeqPointMax'.
+   */
+  public jalview.schemabinding.version2.SeqPointMax getSeqPointMax()
+  {
+    return this._seqPointMax;
+  }
+
+  /**
+   * Returns the value of field 'seqPointMin'.
+   * 
+   * @return the value of field 'SeqPointMin'.
+   */
+  public jalview.schemabinding.version2.SeqPointMin getSeqPointMin()
+  {
+    return this._seqPointMin;
+  }
+
+  /**
+   * Method getSequencePoint.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the jalview.schemabinding.version2.SequencePoint at
+   *         the given index
+   */
+  public jalview.schemabinding.version2.SequencePoint getSequencePoint(
+          final int index) throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._sequencePointList.size())
+    {
+      throw new IndexOutOfBoundsException("getSequencePoint: Index value '"
+              + index + "' not in range [0.."
+              + (this._sequencePointList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.SequencePoint) _sequencePointList
+            .get(index);
+  }
+
+  /**
+   * Method getSequencePoint.Returns the contents of the collection in an Array.
+   * <p>
+   * Note: Just in case the collection contents are changing in another thread,
+   * we pass a 0-length Array of the correct type into the API call. This way we
+   * <i>know</i> that the Array returned is of exactly the correct length.
+   * 
+   * @return this collection as an Array
+   */
+  public jalview.schemabinding.version2.SequencePoint[] getSequencePoint()
+  {
+    jalview.schemabinding.version2.SequencePoint[] array = new jalview.schemabinding.version2.SequencePoint[0];
+    return (jalview.schemabinding.version2.SequencePoint[]) this._sequencePointList
+            .toArray(array);
+  }
+
+  /**
+   * Method getSequencePointCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getSequencePointCount()
+  {
+    return this._sequencePointList.size();
+  }
+
+  /**
+   * Returns the value of field 'showLabels'.
+   * 
+   * @return the value of field 'ShowLabels'.
+   */
+  public boolean getShowLabels()
+  {
+    return this._showLabels;
+  }
+
+  /**
+   * Returns the value of field 'title'.
+   * 
+   * @return the value of field 'Title'.
+   */
+  public java.lang.String getTitle()
+  {
+    return this._title;
+  }
+
+  /**
+   * Returns the value of field 'width'.
+   * 
+   * @return the value of field 'Width'.
+   */
+  public int getWidth()
+  {
+    return this._width;
+  }
+
+  /**
+   * Returns the value of field 'xDim'.
+   * 
+   * @return the value of field 'XDim'.
+   */
+  public int getXDim()
+  {
+    return this._xDim;
+  }
+
+  /**
+   * Returns the value of field 'xpos'.
+   * 
+   * @return the value of field 'Xpos'.
+   */
+  public int getXpos()
+  {
+    return this._xpos;
+  }
+
+  /**
+   * Returns the value of field 'yDim'.
+   * 
+   * @return the value of field 'YDim'.
+   */
+  public int getYDim()
+  {
+    return this._yDim;
+  }
+
+  /**
+   * Returns the value of field 'ypos'.
+   * 
+   * @return the value of field 'Ypos'.
+   */
+  public int getYpos()
+  {
+    return this._ypos;
+  }
+
+  /**
+   * Returns the value of field 'zDim'.
+   * 
+   * @return the value of field 'ZDim'.
+   */
+  public int getZDim()
+  {
+    return this._zDim;
+  }
+
+  /**
+   * Method hasBgColour.
+   * 
+   * @return true if at least one BgColour has been added
+   */
+  public boolean hasBgColour()
+  {
+    return this._has_bgColour;
+  }
+
+  /**
+   * Method hasDenominateByShortestLength.
+   * 
+   * @return true if at least one DenominateByShortestLength has been added
+   */
+  public boolean hasDenominateByShortestLength()
+  {
+    return this._has_denominateByShortestLength;
+  }
+
+  /**
+   * Method hasHeight.
+   * 
+   * @return true if at least one Height has been added
+   */
+  public boolean hasHeight()
+  {
+    return this._has_height;
+  }
+
+  /**
+   * Method hasIncludeGappedColumns.
+   * 
+   * @return true if at least one IncludeGappedColumns has been added
+   */
+  public boolean hasIncludeGappedColumns()
+  {
+    return this._has_includeGappedColumns;
+  }
+
+  /**
+   * Method hasIncludeGaps.
+   * 
+   * @return true if at least one IncludeGaps has been added
+   */
+  public boolean hasIncludeGaps()
+  {
+    return this._has_includeGaps;
+  }
+
+  /**
+   * Method hasLinkToAllViews.
+   * 
+   * @return true if at least one LinkToAllViews has been added
+   */
+  public boolean hasLinkToAllViews()
+  {
+    return this._has_linkToAllViews;
+  }
+
+  /**
+   * Method hasMatchGaps.
+   * 
+   * @return true if at least one MatchGaps has been added
+   */
+  public boolean hasMatchGaps()
+  {
+    return this._has_matchGaps;
+  }
+
+  /**
+   * Method hasScaleFactor.
+   * 
+   * @return true if at least one ScaleFactor has been added
+   */
+  public boolean hasScaleFactor()
+  {
+    return this._has_scaleFactor;
+  }
+
+  /**
+   * Method hasShowLabels.
+   * 
+   * @return true if at least one ShowLabels has been added
+   */
+  public boolean hasShowLabels()
+  {
+    return this._has_showLabels;
+  }
+
+  /**
+   * Method hasWidth.
+   * 
+   * @return true if at least one Width has been added
+   */
+  public boolean hasWidth()
+  {
+    return this._has_width;
+  }
+
+  /**
+   * Method hasXDim.
+   * 
+   * @return true if at least one XDim has been added
+   */
+  public boolean hasXDim()
+  {
+    return this._has_xDim;
+  }
+
+  /**
+   * Method hasXpos.
+   * 
+   * @return true if at least one Xpos has been added
+   */
+  public boolean hasXpos()
+  {
+    return this._has_xpos;
+  }
+
+  /**
+   * Method hasYDim.
+   * 
+   * @return true if at least one YDim has been added
+   */
+  public boolean hasYDim()
+  {
+    return this._has_yDim;
+  }
+
+  /**
+   * Method hasYpos.
+   * 
+   * @return true if at least one Ypos has been added
+   */
+  public boolean hasYpos()
+  {
+    return this._has_ypos;
+  }
+
+  /**
+   * Method hasZDim.
+   * 
+   * @return true if at least one ZDim has been added
+   */
+  public boolean hasZDim()
+  {
+    return this._has_zDim;
+  }
+
+  /**
+   * Returns the value of field 'denominateByShortestLength'.
+   * 
+   * @return the value of field 'DenominateByShortestLength'.
+   */
+  public boolean isDenominateByShortestLength()
+  {
+    return this._denominateByShortestLength;
+  }
+
+  /**
+   * Returns the value of field 'includeGappedColumns'.
+   * 
+   * @return the value of field 'IncludeGappedColumns'.
+   */
+  public boolean isIncludeGappedColumns()
+  {
+    return this._includeGappedColumns;
+  }
+
+  /**
+   * Returns the value of field 'includeGaps'.
+   * 
+   * @return the value of field 'IncludeGaps'.
+   */
+  public boolean isIncludeGaps()
+  {
+    return this._includeGaps;
+  }
+
+  /**
+   * Returns the value of field 'linkToAllViews'.
+   * 
+   * @return the value of field 'LinkToAllViews'.
+   */
+  public boolean isLinkToAllViews()
+  {
+    return this._linkToAllViews;
+  }
+
+  /**
+   * Returns the value of field 'matchGaps'.
+   * 
+   * @return the value of field 'MatchGaps'.
+   */
+  public boolean isMatchGaps()
+  {
+    return this._matchGaps;
+  }
+
+  /**
+   * Returns the value of field 'showLabels'.
+   * 
+   * @return the value of field 'ShowLabels'.
+   */
+  public boolean isShowLabels()
+  {
+    return this._showLabels;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   */
+  public void removeAllAxis()
+  {
+    this._axisList.clear();
+  }
+
+  /**
+   */
+  public void removeAllSequencePoint()
+  {
+    this._sequencePointList.clear();
+  }
+
+  /**
+   * Method removeAxis.
+   * 
+   * @param vAxis
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removeAxis(final jalview.schemabinding.version2.Axis vAxis)
+  {
+    boolean removed = _axisList.remove(vAxis);
+    return removed;
+  }
+
+  /**
+   * Method removeAxisAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.Axis removeAxisAt(final int index)
+  {
+    java.lang.Object obj = this._axisList.remove(index);
+    return (jalview.schemabinding.version2.Axis) obj;
+  }
+
+  /**
+   * Method removeSequencePoint.
+   * 
+   * @param vSequencePoint
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removeSequencePoint(
+          final jalview.schemabinding.version2.SequencePoint vSequencePoint)
+  {
+    boolean removed = _sequencePointList.remove(vSequencePoint);
+    return removed;
+  }
+
+  /**
+   * Method removeSequencePointAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.SequencePoint removeSequencePointAt(
+          final int index)
+  {
+    java.lang.Object obj = this._sequencePointList.remove(index);
+    return (jalview.schemabinding.version2.SequencePoint) obj;
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vAxis
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setAxis(final int index,
+          final jalview.schemabinding.version2.Axis vAxis)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._axisList.size())
+    {
+      throw new IndexOutOfBoundsException("setAxis: Index value '" + index
+              + "' not in range [0.." + (this._axisList.size() - 1) + "]");
+    }
+
+    this._axisList.set(index, vAxis);
+  }
+
+  /**
+   * 
+   * 
+   * @param vAxisArray
+   */
+  public void setAxis(
+          final jalview.schemabinding.version2.Axis[] vAxisArray)
+  {
+    // -- copy array
+    _axisList.clear();
+
+    for (int i = 0; i < vAxisArray.length; i++)
+    {
+      this._axisList.add(vAxisArray[i]);
+    }
+  }
+
+  /**
+   * Sets the value of field 'bgColour'.
+   * 
+   * @param bgColour
+   *          the value of field 'bgColour'.
+   */
+  public void setBgColour(final int bgColour)
+  {
+    this._bgColour = bgColour;
+    this._has_bgColour = true;
+  }
+
+  /**
+   * Sets the value of field 'denominateByShortestLength'.
+   * 
+   * @param denominateByShortestLength
+   *          the value of field 'denominateByShortestLength'.
+   */
+  public void setDenominateByShortestLength(
+          final boolean denominateByShortestLength)
+  {
+    this._denominateByShortestLength = denominateByShortestLength;
+    this._has_denominateByShortestLength = true;
+  }
+
+  /**
+   * Sets the value of field 'height'.
+   * 
+   * @param height
+   *          the value of field 'height'.
+   */
+  public void setHeight(final int height)
+  {
+    this._height = height;
+    this._has_height = true;
+  }
+
+  /**
+   * Sets the value of field 'includeGappedColumns'.
+   * 
+   * @param includeGappedColumns
+   *          the value of field 'includeGappedColumns'.
+   */
+  public void setIncludeGappedColumns(final boolean includeGappedColumns)
+  {
+    this._includeGappedColumns = includeGappedColumns;
+    this._has_includeGappedColumns = true;
+  }
+
+  /**
+   * Sets the value of field 'includeGaps'.
+   * 
+   * @param includeGaps
+   *          the value of field 'includeGaps'.
+   */
+  public void setIncludeGaps(final boolean includeGaps)
+  {
+    this._includeGaps = includeGaps;
+    this._has_includeGaps = true;
+  }
+
+  /**
+   * Sets the value of field 'linkToAllViews'.
+   * 
+   * @param linkToAllViews
+   *          the value of field 'linkToAllViews'.
+   */
+  public void setLinkToAllViews(final boolean linkToAllViews)
+  {
+    this._linkToAllViews = linkToAllViews;
+    this._has_linkToAllViews = true;
+  }
+
+  /**
+   * Sets the value of field 'matchGaps'.
+   * 
+   * @param matchGaps
+   *          the value of field 'matchGaps'.
+   */
+  public void setMatchGaps(final boolean matchGaps)
+  {
+    this._matchGaps = matchGaps;
+    this._has_matchGaps = true;
+  }
+
+  /**
+   * Sets the value of field 'pcaData'.
+   * 
+   * @param pcaData
+   *          the value of field 'pcaData'.
+   */
+  public void setPcaData(
+          final jalview.schemabinding.version2.PcaData pcaData)
+  {
+    this._pcaData = pcaData;
+  }
+
+  /**
+   * Sets the value of field 'scaleFactor'.
+   * 
+   * @param scaleFactor
+   *          the value of field 'scaleFactor'.
+   */
+  public void setScaleFactor(final float scaleFactor)
+  {
+    this._scaleFactor = scaleFactor;
+    this._has_scaleFactor = true;
+  }
+
+  /**
+   * Sets the value of field 'scoreModelName'.
+   * 
+   * @param scoreModelName
+   *          the value of field 'scoreModelName'.
+   */
+  public void setScoreModelName(final java.lang.String scoreModelName)
+  {
+    this._scoreModelName = scoreModelName;
+  }
+
+  /**
+   * Sets the value of field 'seqPointMax'.
+   * 
+   * @param seqPointMax
+   *          the value of field 'seqPointMax'.
+   */
+  public void setSeqPointMax(
+          final jalview.schemabinding.version2.SeqPointMax seqPointMax)
+  {
+    this._seqPointMax = seqPointMax;
+  }
+
+  /**
+   * Sets the value of field 'seqPointMin'.
+   * 
+   * @param seqPointMin
+   *          the value of field 'seqPointMin'.
+   */
+  public void setSeqPointMin(
+          final jalview.schemabinding.version2.SeqPointMin seqPointMin)
+  {
+    this._seqPointMin = seqPointMin;
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vSequencePoint
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setSequencePoint(final int index,
+          final jalview.schemabinding.version2.SequencePoint vSequencePoint)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._sequencePointList.size())
+    {
+      throw new IndexOutOfBoundsException("setSequencePoint: Index value '"
+              + index + "' not in range [0.."
+              + (this._sequencePointList.size() - 1) + "]");
+    }
+
+    this._sequencePointList.set(index, vSequencePoint);
+  }
+
+  /**
+   * 
+   * 
+   * @param vSequencePointArray
+   */
+  public void setSequencePoint(
+          final jalview.schemabinding.version2.SequencePoint[] vSequencePointArray)
+  {
+    // -- copy array
+    _sequencePointList.clear();
+
+    for (int i = 0; i < vSequencePointArray.length; i++)
+    {
+      this._sequencePointList.add(vSequencePointArray[i]);
+    }
+  }
+
+  /**
+   * Sets the value of field 'showLabels'.
+   * 
+   * @param showLabels
+   *          the value of field 'showLabels'.
+   */
+  public void setShowLabels(final boolean showLabels)
+  {
+    this._showLabels = showLabels;
+    this._has_showLabels = true;
+  }
+
+  /**
+   * Sets the value of field 'title'.
+   * 
+   * @param title
+   *          the value of field 'title'.
+   */
+  public void setTitle(final java.lang.String title)
+  {
+    this._title = title;
+  }
+
+  /**
+   * Sets the value of field 'width'.
+   * 
+   * @param width
+   *          the value of field 'width'.
+   */
+  public void setWidth(final int width)
+  {
+    this._width = width;
+    this._has_width = true;
+  }
+
+  /**
+   * Sets the value of field 'xDim'.
+   * 
+   * @param xDim
+   *          the value of field 'xDim'.
+   */
+  public void setXDim(final int xDim)
+  {
+    this._xDim = xDim;
+    this._has_xDim = true;
+  }
+
+  /**
+   * Sets the value of field 'xpos'.
+   * 
+   * @param xpos
+   *          the value of field 'xpos'.
+   */
+  public void setXpos(final int xpos)
+  {
+    this._xpos = xpos;
+    this._has_xpos = true;
+  }
+
+  /**
+   * Sets the value of field 'yDim'.
+   * 
+   * @param yDim
+   *          the value of field 'yDim'.
+   */
+  public void setYDim(final int yDim)
+  {
+    this._yDim = yDim;
+    this._has_yDim = true;
+  }
+
+  /**
+   * Sets the value of field 'ypos'.
+   * 
+   * @param ypos
+   *          the value of field 'ypos'.
+   */
+  public void setYpos(final int ypos)
+  {
+    this._ypos = ypos;
+    this._has_ypos = true;
+  }
+
+  /**
+   * Sets the value of field 'zDim'.
+   * 
+   * @param zDim
+   *          the value of field 'zDim'.
+   */
+  public void setZDim(final int zDim)
+  {
+    this._zDim = zDim;
+    this._has_zDim = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.PcaViewer
+   */
+  public static jalview.schemabinding.version2.PcaViewer unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.PcaViewer) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.PcaViewer.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/Row.java b/src/jalview/schemabinding/version2/Row.java
new file mode 100644 (file)
index 0000000..d351d1d
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class Row.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class Row extends DoubleVector implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public Row()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
+   */
+  public static jalview.schemabinding.version2.DoubleVector unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.Row.class, reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/SeqPointMax.java b/src/jalview/schemabinding/version2/SeqPointMax.java
new file mode 100644 (file)
index 0000000..3ca78a2
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class SeqPointMax.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SeqPointMax implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _xPos.
+   */
+  private float _xPos;
+
+  /**
+   * keeps track of state for field: _xPos
+   */
+  private boolean _has_xPos;
+
+  /**
+   * Field _yPos.
+   */
+  private float _yPos;
+
+  /**
+   * keeps track of state for field: _yPos
+   */
+  private boolean _has_yPos;
+
+  /**
+   * Field _zPos.
+   */
+  private float _zPos;
+
+  /**
+   * keeps track of state for field: _zPos
+   */
+  private boolean _has_zPos;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SeqPointMax()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   */
+  public void deleteXPos()
+  {
+    this._has_xPos = false;
+  }
+
+  /**
+   */
+  public void deleteYPos()
+  {
+    this._has_yPos = false;
+  }
+
+  /**
+   */
+  public void deleteZPos()
+  {
+    this._has_zPos = false;
+  }
+
+  /**
+   * Returns the value of field 'xPos'.
+   * 
+   * @return the value of field 'XPos'.
+   */
+  public float getXPos()
+  {
+    return this._xPos;
+  }
+
+  /**
+   * Returns the value of field 'yPos'.
+   * 
+   * @return the value of field 'YPos'.
+   */
+  public float getYPos()
+  {
+    return this._yPos;
+  }
+
+  /**
+   * Returns the value of field 'zPos'.
+   * 
+   * @return the value of field 'ZPos'.
+   */
+  public float getZPos()
+  {
+    return this._zPos;
+  }
+
+  /**
+   * Method hasXPos.
+   * 
+   * @return true if at least one XPos has been added
+   */
+  public boolean hasXPos()
+  {
+    return this._has_xPos;
+  }
+
+  /**
+   * Method hasYPos.
+   * 
+   * @return true if at least one YPos has been added
+   */
+  public boolean hasYPos()
+  {
+    return this._has_yPos;
+  }
+
+  /**
+   * Method hasZPos.
+   * 
+   * @return true if at least one ZPos has been added
+   */
+  public boolean hasZPos()
+  {
+    return this._has_zPos;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Sets the value of field 'xPos'.
+   * 
+   * @param xPos
+   *          the value of field 'xPos'.
+   */
+  public void setXPos(final float xPos)
+  {
+    this._xPos = xPos;
+    this._has_xPos = true;
+  }
+
+  /**
+   * Sets the value of field 'yPos'.
+   * 
+   * @param yPos
+   *          the value of field 'yPos'.
+   */
+  public void setYPos(final float yPos)
+  {
+    this._yPos = yPos;
+    this._has_yPos = true;
+  }
+
+  /**
+   * Sets the value of field 'zPos'.
+   * 
+   * @param zPos
+   *          the value of field 'zPos'.
+   */
+  public void setZPos(final float zPos)
+  {
+    this._zPos = zPos;
+    this._has_zPos = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.SeqPointMax
+   */
+  public static jalview.schemabinding.version2.SeqPointMax unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.SeqPointMax) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.SeqPointMax.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/SeqPointMin.java b/src/jalview/schemabinding/version2/SeqPointMin.java
new file mode 100644 (file)
index 0000000..4ce9fab
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class SeqPointMin.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SeqPointMin implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _xPos.
+   */
+  private float _xPos;
+
+  /**
+   * keeps track of state for field: _xPos
+   */
+  private boolean _has_xPos;
+
+  /**
+   * Field _yPos.
+   */
+  private float _yPos;
+
+  /**
+   * keeps track of state for field: _yPos
+   */
+  private boolean _has_yPos;
+
+  /**
+   * Field _zPos.
+   */
+  private float _zPos;
+
+  /**
+   * keeps track of state for field: _zPos
+   */
+  private boolean _has_zPos;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SeqPointMin()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   */
+  public void deleteXPos()
+  {
+    this._has_xPos = false;
+  }
+
+  /**
+   */
+  public void deleteYPos()
+  {
+    this._has_yPos = false;
+  }
+
+  /**
+   */
+  public void deleteZPos()
+  {
+    this._has_zPos = false;
+  }
+
+  /**
+   * Returns the value of field 'xPos'.
+   * 
+   * @return the value of field 'XPos'.
+   */
+  public float getXPos()
+  {
+    return this._xPos;
+  }
+
+  /**
+   * Returns the value of field 'yPos'.
+   * 
+   * @return the value of field 'YPos'.
+   */
+  public float getYPos()
+  {
+    return this._yPos;
+  }
+
+  /**
+   * Returns the value of field 'zPos'.
+   * 
+   * @return the value of field 'ZPos'.
+   */
+  public float getZPos()
+  {
+    return this._zPos;
+  }
+
+  /**
+   * Method hasXPos.
+   * 
+   * @return true if at least one XPos has been added
+   */
+  public boolean hasXPos()
+  {
+    return this._has_xPos;
+  }
+
+  /**
+   * Method hasYPos.
+   * 
+   * @return true if at least one YPos has been added
+   */
+  public boolean hasYPos()
+  {
+    return this._has_yPos;
+  }
+
+  /**
+   * Method hasZPos.
+   * 
+   * @return true if at least one ZPos has been added
+   */
+  public boolean hasZPos()
+  {
+    return this._has_zPos;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Sets the value of field 'xPos'.
+   * 
+   * @param xPos
+   *          the value of field 'xPos'.
+   */
+  public void setXPos(final float xPos)
+  {
+    this._xPos = xPos;
+    this._has_xPos = true;
+  }
+
+  /**
+   * Sets the value of field 'yPos'.
+   * 
+   * @param yPos
+   *          the value of field 'yPos'.
+   */
+  public void setYPos(final float yPos)
+  {
+    this._yPos = yPos;
+    this._has_yPos = true;
+  }
+
+  /**
+   * Sets the value of field 'zPos'.
+   * 
+   * @param zPos
+   *          the value of field 'zPos'.
+   */
+  public void setZPos(final float zPos)
+  {
+    this._zPos = zPos;
+    this._has_zPos = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.SeqPointMin
+   */
+  public static jalview.schemabinding.version2.SeqPointMin unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.SeqPointMin) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.SeqPointMin.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/SequencePoint.java b/src/jalview/schemabinding/version2/SequencePoint.java
new file mode 100644 (file)
index 0000000..191c4dd
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class SequencePoint.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SequencePoint implements java.io.Serializable
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _sequenceRef.
+   */
+  private java.lang.String _sequenceRef;
+
+  /**
+   * Field _xPos.
+   */
+  private float _xPos;
+
+  /**
+   * keeps track of state for field: _xPos
+   */
+  private boolean _has_xPos;
+
+  /**
+   * Field _yPos.
+   */
+  private float _yPos;
+
+  /**
+   * keeps track of state for field: _yPos
+   */
+  private boolean _has_yPos;
+
+  /**
+   * Field _zPos.
+   */
+  private float _zPos;
+
+  /**
+   * keeps track of state for field: _zPos
+   */
+  private boolean _has_zPos;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SequencePoint()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   */
+  public void deleteXPos()
+  {
+    this._has_xPos = false;
+  }
+
+  /**
+   */
+  public void deleteYPos()
+  {
+    this._has_yPos = false;
+  }
+
+  /**
+   */
+  public void deleteZPos()
+  {
+    this._has_zPos = false;
+  }
+
+  /**
+   * Returns the value of field 'sequenceRef'.
+   * 
+   * @return the value of field 'SequenceRef'.
+   */
+  public java.lang.String getSequenceRef()
+  {
+    return this._sequenceRef;
+  }
+
+  /**
+   * Returns the value of field 'xPos'.
+   * 
+   * @return the value of field 'XPos'.
+   */
+  public float getXPos()
+  {
+    return this._xPos;
+  }
+
+  /**
+   * Returns the value of field 'yPos'.
+   * 
+   * @return the value of field 'YPos'.
+   */
+  public float getYPos()
+  {
+    return this._yPos;
+  }
+
+  /**
+   * Returns the value of field 'zPos'.
+   * 
+   * @return the value of field 'ZPos'.
+   */
+  public float getZPos()
+  {
+    return this._zPos;
+  }
+
+  /**
+   * Method hasXPos.
+   * 
+   * @return true if at least one XPos has been added
+   */
+  public boolean hasXPos()
+  {
+    return this._has_xPos;
+  }
+
+  /**
+   * Method hasYPos.
+   * 
+   * @return true if at least one YPos has been added
+   */
+  public boolean hasYPos()
+  {
+    return this._has_yPos;
+  }
+
+  /**
+   * Method hasZPos.
+   * 
+   * @return true if at least one ZPos has been added
+   */
+  public boolean hasZPos()
+  {
+    return this._has_zPos;
+  }
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Sets the value of field 'sequenceRef'.
+   * 
+   * @param sequenceRef
+   *          the value of field 'sequenceRef'.
+   */
+  public void setSequenceRef(final java.lang.String sequenceRef)
+  {
+    this._sequenceRef = sequenceRef;
+  }
+
+  /**
+   * Sets the value of field 'xPos'.
+   * 
+   * @param xPos
+   *          the value of field 'xPos'.
+   */
+  public void setXPos(final float xPos)
+  {
+    this._xPos = xPos;
+    this._has_xPos = true;
+  }
+
+  /**
+   * Sets the value of field 'yPos'.
+   * 
+   * @param yPos
+   *          the value of field 'yPos'.
+   */
+  public void setYPos(final float yPos)
+  {
+    this._yPos = yPos;
+    this._has_yPos = true;
+  }
+
+  /**
+   * Sets the value of field 'zPos'.
+   * 
+   * @param zPos
+   *          the value of field 'zPos'.
+   */
+  public void setZPos(final float zPos)
+  {
+    this._zPos = zPos;
+    this._has_zPos = true;
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.SequencePoint
+   */
+  public static jalview.schemabinding.version2.SequencePoint unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.SequencePoint) Unmarshaller
+            .unmarshal(jalview.schemabinding.version2.SequencePoint.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
index 19b3eb1..1923eee 100644 (file)
@@ -7,8 +7,8 @@
 
 package jalview.schemabinding.version2;
 
-//---------------------------------/
-//- Imported classes and packages -/
+  //---------------------------------/
+ //- Imported classes and packages -/
 //---------------------------------/
 
 import org.exolab.castor.xml.Marshaller;
@@ -19,860 +19,899 @@ import org.exolab.castor.xml.Unmarshaller;
  * 
  * @version $Revision$ $Date$
  */
-public class Tree implements java.io.Serializable
-{
-
-  // --------------------------/
-  // - Class/Member Variables -/
-  // --------------------------/
-
-  /**
-   * Field _fontName.
-   */
-  private java.lang.String _fontName;
-
-  /**
-   * Field _fontSize.
-   */
-  private int _fontSize;
-
-  /**
-   * keeps track of state for field: _fontSize
-   */
-  private boolean _has_fontSize;
-
-  /**
-   * Field _fontStyle.
-   */
-  private int _fontStyle;
-
-  /**
-   * keeps track of state for field: _fontStyle
-   */
-  private boolean _has_fontStyle;
-
-  /**
-   * Field _threshold.
-   */
-  private float _threshold;
-
-  /**
-   * keeps track of state for field: _threshold
-   */
-  private boolean _has_threshold;
-
-  /**
-   * Field _showBootstrap.
-   */
-  private boolean _showBootstrap;
-
-  /**
-   * keeps track of state for field: _showBootstrap
-   */
-  private boolean _has_showBootstrap;
-
-  /**
-   * Field _showDistances.
-   */
-  private boolean _showDistances;
-
-  /**
-   * keeps track of state for field: _showDistances
-   */
-  private boolean _has_showDistances;
-
-  /**
-   * Field _markUnlinked.
-   */
-  private boolean _markUnlinked;
-
-  /**
-   * keeps track of state for field: _markUnlinked
-   */
-  private boolean _has_markUnlinked;
-
-  /**
-   * Field _fitToWindow.
-   */
-  private boolean _fitToWindow;
-
-  /**
-   * keeps track of state for field: _fitToWindow
-   */
-  private boolean _has_fitToWindow;
-
-  /**
-   * Field _currentTree.
-   */
-  private boolean _currentTree;
-
-  /**
-   * keeps track of state for field: _currentTree
-   */
-  private boolean _has_currentTree;
-
-  /**
-   * Tree ID added for binding tree visualization settings to vamsas document
-   * trees in jalview 2.4.1
-   * 
-   */
-  private java.lang.String _id;
-
-  /**
-   * Field _width.
-   */
-  private int _width;
-
-  /**
-   * keeps track of state for field: _width
-   */
-  private boolean _has_width;
-
-  /**
-   * Field _height.
-   */
-  private int _height;
-
-  /**
-   * keeps track of state for field: _height
-   */
-  private boolean _has_height;
-
-  /**
-   * Field _xpos.
-   */
-  private int _xpos;
-
-  /**
-   * keeps track of state for field: _xpos
-   */
-  private boolean _has_xpos;
-
-  /**
-   * Field _ypos.
-   */
-  private int _ypos;
-
-  /**
-   * keeps track of state for field: _ypos
-   */
-  private boolean _has_ypos;
-
-  /**
-   * Field _title.
-   */
-  private java.lang.String _title;
-
-  /**
-   * Field _newick.
-   */
-  private java.lang.String _newick;
-
-  // ----------------/
-  // - Constructors -/
-  // ----------------/
-
-  public Tree()
-  {
-    super();
-  }
-
-  // -----------/
-  // - Methods -/
-  // -----------/
-
-  /**
-     */
-  public void deleteCurrentTree()
-  {
-    this._has_currentTree = false;
-  }
-
-  /**
-     */
-  public void deleteFitToWindow()
-  {
-    this._has_fitToWindow = false;
-  }
-
-  /**
-     */
-  public void deleteFontSize()
-  {
-    this._has_fontSize = false;
-  }
-
-  /**
-     */
-  public void deleteFontStyle()
-  {
-    this._has_fontStyle = false;
-  }
-
-  /**
-     */
-  public void deleteHeight()
-  {
-    this._has_height = false;
-  }
-
-  /**
-     */
-  public void deleteMarkUnlinked()
-  {
-    this._has_markUnlinked = false;
-  }
-
-  /**
-     */
-  public void deleteShowBootstrap()
-  {
-    this._has_showBootstrap = false;
-  }
-
-  /**
-     */
-  public void deleteShowDistances()
-  {
-    this._has_showDistances = false;
-  }
-
-  /**
-     */
-  public void deleteThreshold()
-  {
-    this._has_threshold = false;
-  }
-
-  /**
-     */
-  public void deleteWidth()
-  {
-    this._has_width = false;
-  }
-
-  /**
-     */
-  public void deleteXpos()
-  {
-    this._has_xpos = false;
-  }
-
-  /**
-     */
-  public void deleteYpos()
-  {
-    this._has_ypos = false;
-  }
-
-  /**
-   * Returns the value of field 'currentTree'.
-   * 
-   * @return the value of field 'CurrentTree'.
-   */
-  public boolean getCurrentTree()
-  {
-    return this._currentTree;
-  }
-
-  /**
-   * Returns the value of field 'fitToWindow'.
-   * 
-   * @return the value of field 'FitToWindow'.
-   */
-  public boolean getFitToWindow()
-  {
-    return this._fitToWindow;
-  }
-
-  /**
-   * Returns the value of field 'fontName'.
-   * 
-   * @return the value of field 'FontName'.
-   */
-  public java.lang.String getFontName()
-  {
-    return this._fontName;
-  }
-
-  /**
-   * Returns the value of field 'fontSize'.
-   * 
-   * @return the value of field 'FontSize'.
-   */
-  public int getFontSize()
-  {
-    return this._fontSize;
-  }
-
-  /**
-   * Returns the value of field 'fontStyle'.
-   * 
-   * @return the value of field 'FontStyle'.
-   */
-  public int getFontStyle()
-  {
-    return this._fontStyle;
-  }
-
-  /**
-   * Returns the value of field 'height'.
-   * 
-   * @return the value of field 'Height'.
-   */
-  public int getHeight()
-  {
-    return this._height;
-  }
-
-  /**
-   * Returns the value of field 'id'. The field 'id' has the following
-   * description: Tree ID added for binding tree visualization settings to
-   * vamsas document trees in jalview 2.4.1
-   * 
-   * 
-   * @return the value of field 'Id'.
-   */
-  public java.lang.String getId()
-  {
-    return this._id;
-  }
-
-  /**
-   * Returns the value of field 'markUnlinked'.
-   * 
-   * @return the value of field 'MarkUnlinked'.
-   */
-  public boolean getMarkUnlinked()
-  {
-    return this._markUnlinked;
-  }
-
-  /**
-   * Returns the value of field 'newick'.
-   * 
-   * @return the value of field 'Newick'.
-   */
-  public java.lang.String getNewick()
-  {
-    return this._newick;
-  }
-
-  /**
-   * Returns the value of field 'showBootstrap'.
-   * 
-   * @return the value of field 'ShowBootstrap'.
-   */
-  public boolean getShowBootstrap()
-  {
-    return this._showBootstrap;
-  }
-
-  /**
-   * Returns the value of field 'showDistances'.
-   * 
-   * @return the value of field 'ShowDistances'.
-   */
-  public boolean getShowDistances()
-  {
-    return this._showDistances;
-  }
-
-  /**
-   * Returns the value of field 'threshold'.
-   * 
-   * @return the value of field 'Threshold'.
-   */
-  public float getThreshold()
-  {
-    return this._threshold;
-  }
-
-  /**
-   * Returns the value of field 'title'.
-   * 
-   * @return the value of field 'Title'.
-   */
-  public java.lang.String getTitle()
-  {
-    return this._title;
-  }
-
-  /**
-   * Returns the value of field 'width'.
-   * 
-   * @return the value of field 'Width'.
-   */
-  public int getWidth()
-  {
-    return this._width;
-  }
-
-  /**
-   * Returns the value of field 'xpos'.
-   * 
-   * @return the value of field 'Xpos'.
-   */
-  public int getXpos()
-  {
-    return this._xpos;
-  }
-
-  /**
-   * Returns the value of field 'ypos'.
-   * 
-   * @return the value of field 'Ypos'.
-   */
-  public int getYpos()
-  {
-    return this._ypos;
-  }
-
-  /**
-   * Method hasCurrentTree.
-   * 
-   * @return true if at least one CurrentTree has been added
-   */
-  public boolean hasCurrentTree()
-  {
-    return this._has_currentTree;
-  }
-
-  /**
-   * Method hasFitToWindow.
-   * 
-   * @return true if at least one FitToWindow has been added
-   */
-  public boolean hasFitToWindow()
-  {
-    return this._has_fitToWindow;
-  }
-
-  /**
-   * Method hasFontSize.
-   * 
-   * @return true if at least one FontSize has been added
-   */
-  public boolean hasFontSize()
-  {
-    return this._has_fontSize;
-  }
-
-  /**
-   * Method hasFontStyle.
-   * 
-   * @return true if at least one FontStyle has been added
-   */
-  public boolean hasFontStyle()
-  {
-    return this._has_fontStyle;
-  }
-
-  /**
-   * Method hasHeight.
-   * 
-   * @return true if at least one Height has been added
-   */
-  public boolean hasHeight()
-  {
-    return this._has_height;
-  }
-
-  /**
-   * Method hasMarkUnlinked.
-   * 
-   * @return true if at least one MarkUnlinked has been added
-   */
-  public boolean hasMarkUnlinked()
-  {
-    return this._has_markUnlinked;
-  }
-
-  /**
-   * Method hasShowBootstrap.
-   * 
-   * @return true if at least one ShowBootstrap has been added
-   */
-  public boolean hasShowBootstrap()
-  {
-    return this._has_showBootstrap;
-  }
-
-  /**
-   * Method hasShowDistances.
-   * 
-   * @return true if at least one ShowDistances has been added
-   */
-  public boolean hasShowDistances()
-  {
-    return this._has_showDistances;
-  }
-
-  /**
-   * Method hasThreshold.
-   * 
-   * @return true if at least one Threshold has been added
-   */
-  public boolean hasThreshold()
-  {
-    return this._has_threshold;
-  }
-
-  /**
-   * Method hasWidth.
-   * 
-   * @return true if at least one Width has been added
-   */
-  public boolean hasWidth()
-  {
-    return this._has_width;
-  }
-
-  /**
-   * Method hasXpos.
-   * 
-   * @return true if at least one Xpos has been added
-   */
-  public boolean hasXpos()
-  {
-    return this._has_xpos;
-  }
-
-  /**
-   * Method hasYpos.
-   * 
-   * @return true if at least one Ypos has been added
-   */
-  public boolean hasYpos()
-  {
-    return this._has_ypos;
-  }
-
-  /**
-   * Returns the value of field 'currentTree'.
-   * 
-   * @return the value of field 'CurrentTree'.
-   */
-  public boolean isCurrentTree()
-  {
-    return this._currentTree;
-  }
-
-  /**
-   * Returns the value of field 'fitToWindow'.
-   * 
-   * @return the value of field 'FitToWindow'.
-   */
-  public boolean isFitToWindow()
-  {
-    return this._fitToWindow;
-  }
-
-  /**
-   * Returns the value of field 'markUnlinked'.
-   * 
-   * @return the value of field 'MarkUnlinked'.
-   */
-  public boolean isMarkUnlinked()
-  {
-    return this._markUnlinked;
-  }
-
-  /**
-   * Returns the value of field 'showBootstrap'.
-   * 
-   * @return the value of field 'ShowBootstrap'.
-   */
-  public boolean isShowBootstrap()
-  {
-    return this._showBootstrap;
-  }
-
-  /**
-   * Returns the value of field 'showDistances'.
-   * 
-   * @return the value of field 'ShowDistances'.
-   */
-  public boolean isShowDistances()
-  {
-    return this._showDistances;
-  }
-
-  /**
-   * Method isValid.
-   * 
-   * @return true if this object is valid according to the schema
-   */
-  public boolean isValid()
-  {
-    try
-    {
-      validate();
-    } catch (org.exolab.castor.xml.ValidationException vex)
-    {
-      return false;
-    }
-    return true;
-  }
-
-  /**
-   * 
-   * 
-   * @param out
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   */
-  public void marshal(final java.io.Writer out)
-          throws org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    Marshaller.marshal(this, out);
-  }
-
-  /**
-   * 
-   * 
-   * @param handler
-   * @throws java.io.IOException
-   *           if an IOException occurs during marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   */
-  public void marshal(final org.xml.sax.ContentHandler handler)
-          throws java.io.IOException,
-          org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    Marshaller.marshal(this, handler);
-  }
-
-  /**
-   * Sets the value of field 'currentTree'.
-   * 
-   * @param currentTree
-   *          the value of field 'currentTree'.
-   */
-  public void setCurrentTree(final boolean currentTree)
-  {
-    this._currentTree = currentTree;
-    this._has_currentTree = true;
-  }
-
-  /**
-   * Sets the value of field 'fitToWindow'.
-   * 
-   * @param fitToWindow
-   *          the value of field 'fitToWindow'.
-   */
-  public void setFitToWindow(final boolean fitToWindow)
-  {
-    this._fitToWindow = fitToWindow;
-    this._has_fitToWindow = true;
-  }
-
-  /**
-   * Sets the value of field 'fontName'.
-   * 
-   * @param fontName
-   *          the value of field 'fontName'.
-   */
-  public void setFontName(final java.lang.String fontName)
-  {
-    this._fontName = fontName;
-  }
-
-  /**
-   * Sets the value of field 'fontSize'.
-   * 
-   * @param fontSize
-   *          the value of field 'fontSize'.
-   */
-  public void setFontSize(final int fontSize)
-  {
-    this._fontSize = fontSize;
-    this._has_fontSize = true;
-  }
-
-  /**
-   * Sets the value of field 'fontStyle'.
-   * 
-   * @param fontStyle
-   *          the value of field 'fontStyle'.
-   */
-  public void setFontStyle(final int fontStyle)
-  {
-    this._fontStyle = fontStyle;
-    this._has_fontStyle = true;
-  }
-
-  /**
-   * Sets the value of field 'height'.
-   * 
-   * @param height
-   *          the value of field 'height'.
-   */
-  public void setHeight(final int height)
-  {
-    this._height = height;
-    this._has_height = true;
-  }
-
-  /**
-   * Sets the value of field 'id'. The field 'id' has the following description:
-   * Tree ID added for binding tree visualization settings to vamsas document
-   * trees in jalview 2.4.1
-   * 
-   * 
-   * @param id
-   *          the value of field 'id'.
-   */
-  public void setId(final java.lang.String id)
-  {
-    this._id = id;
-  }
-
-  /**
-   * Sets the value of field 'markUnlinked'.
-   * 
-   * @param markUnlinked
-   *          the value of field 'markUnlinked'.
-   */
-  public void setMarkUnlinked(final boolean markUnlinked)
-  {
-    this._markUnlinked = markUnlinked;
-    this._has_markUnlinked = true;
-  }
-
-  /**
-   * Sets the value of field 'newick'.
-   * 
-   * @param newick
-   *          the value of field 'newick'.
-   */
-  public void setNewick(final java.lang.String newick)
-  {
-    this._newick = newick;
-  }
-
-  /**
-   * Sets the value of field 'showBootstrap'.
-   * 
-   * @param showBootstrap
-   *          the value of field 'showBootstrap'.
-   */
-  public void setShowBootstrap(final boolean showBootstrap)
-  {
-    this._showBootstrap = showBootstrap;
-    this._has_showBootstrap = true;
-  }
-
-  /**
-   * Sets the value of field 'showDistances'.
-   * 
-   * @param showDistances
-   *          the value of field 'showDistances'.
-   */
-  public void setShowDistances(final boolean showDistances)
-  {
-    this._showDistances = showDistances;
-    this._has_showDistances = true;
-  }
-
-  /**
-   * Sets the value of field 'threshold'.
-   * 
-   * @param threshold
-   *          the value of field 'threshold'.
-   */
-  public void setThreshold(final float threshold)
-  {
-    this._threshold = threshold;
-    this._has_threshold = true;
-  }
-
-  /**
-   * Sets the value of field 'title'.
-   * 
-   * @param title
-   *          the value of field 'title'.
-   */
-  public void setTitle(final java.lang.String title)
-  {
-    this._title = title;
-  }
-
-  /**
-   * Sets the value of field 'width'.
-   * 
-   * @param width
-   *          the value of field 'width'.
-   */
-  public void setWidth(final int width)
-  {
-    this._width = width;
-    this._has_width = true;
-  }
-
-  /**
-   * Sets the value of field 'xpos'.
-   * 
-   * @param xpos
-   *          the value of field 'xpos'.
-   */
-  public void setXpos(final int xpos)
-  {
-    this._xpos = xpos;
-    this._has_xpos = true;
-  }
-
-  /**
-   * Sets the value of field 'ypos'.
-   * 
-   * @param ypos
-   *          the value of field 'ypos'.
-   */
-  public void setYpos(final int ypos)
-  {
-    this._ypos = ypos;
-    this._has_ypos = true;
-  }
-
-  /**
-   * Method unmarshal.
-   * 
-   * @param reader
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   * @return the unmarshaled jalview.schemabinding.version2.Tree
-   */
-  public static jalview.schemabinding.version2.Tree unmarshal(
-          final java.io.Reader reader)
-          throws org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(
-            jalview.schemabinding.version2.Tree.class, reader);
-  }
-
-  /**
-   * 
-   * 
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   */
-  public void validate() throws org.exolab.castor.xml.ValidationException
-  {
-    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-    validator.validate(this);
-  }
+public class Tree implements java.io.Serializable {
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field _fontName.
+     */
+    private java.lang.String _fontName;
+
+    /**
+     * Field _fontSize.
+     */
+    private int _fontSize;
+
+    /**
+     * keeps track of state for field: _fontSize
+     */
+    private boolean _has_fontSize;
+
+    /**
+     * Field _fontStyle.
+     */
+    private int _fontStyle;
+
+    /**
+     * keeps track of state for field: _fontStyle
+     */
+    private boolean _has_fontStyle;
+
+    /**
+     * Field _threshold.
+     */
+    private float _threshold;
+
+    /**
+     * keeps track of state for field: _threshold
+     */
+    private boolean _has_threshold;
+
+    /**
+     * Field _showBootstrap.
+     */
+    private boolean _showBootstrap;
+
+    /**
+     * keeps track of state for field: _showBootstrap
+     */
+    private boolean _has_showBootstrap;
+
+    /**
+     * Field _showDistances.
+     */
+    private boolean _showDistances;
+
+    /**
+     * keeps track of state for field: _showDistances
+     */
+    private boolean _has_showDistances;
+
+    /**
+     * Field _markUnlinked.
+     */
+    private boolean _markUnlinked;
+
+    /**
+     * keeps track of state for field: _markUnlinked
+     */
+    private boolean _has_markUnlinked;
+
+    /**
+     * Field _fitToWindow.
+     */
+    private boolean _fitToWindow;
+
+    /**
+     * keeps track of state for field: _fitToWindow
+     */
+    private boolean _has_fitToWindow;
+
+    /**
+     * Field _currentTree.
+     */
+    private boolean _currentTree;
+
+    /**
+     * keeps track of state for field: _currentTree
+     */
+    private boolean _has_currentTree;
+
+    /**
+     * Tree ID added for binding tree
+     *  visualization
+     *  settings to vamsas
+     *  document trees in jalview 2.4.1
+     *  
+     */
+    private java.lang.String _id;
+
+    /**
+     * Field _linkToAllViews.
+     */
+    private boolean _linkToAllViews = false;
+
+    /**
+     * keeps track of state for field: _linkToAllViews
+     */
+    private boolean _has_linkToAllViews;
+
+    /**
+     * Field _width.
+     */
+    private int _width;
+
+    /**
+     * keeps track of state for field: _width
+     */
+    private boolean _has_width;
+
+    /**
+     * Field _height.
+     */
+    private int _height;
+
+    /**
+     * keeps track of state for field: _height
+     */
+    private boolean _has_height;
+
+    /**
+     * Field _xpos.
+     */
+    private int _xpos;
+
+    /**
+     * keeps track of state for field: _xpos
+     */
+    private boolean _has_xpos;
+
+    /**
+     * Field _ypos.
+     */
+    private int _ypos;
+
+    /**
+     * keeps track of state for field: _ypos
+     */
+    private boolean _has_ypos;
+
+    /**
+     * Field _title.
+     */
+    private java.lang.String _title;
+
+    /**
+     * Field _newick.
+     */
+    private java.lang.String _newick;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    public Tree() {
+        super();
+    }
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     */
+    public void deleteCurrentTree(
+    ) {
+        this._has_currentTree= false;
+    }
+
+    /**
+     */
+    public void deleteFitToWindow(
+    ) {
+        this._has_fitToWindow= false;
+    }
+
+    /**
+     */
+    public void deleteFontSize(
+    ) {
+        this._has_fontSize= false;
+    }
+
+    /**
+     */
+    public void deleteFontStyle(
+    ) {
+        this._has_fontStyle= false;
+    }
+
+    /**
+     */
+    public void deleteHeight(
+    ) {
+        this._has_height= false;
+    }
+
+    /**
+     */
+    public void deleteLinkToAllViews(
+    ) {
+        this._has_linkToAllViews= false;
+    }
+
+    /**
+     */
+    public void deleteMarkUnlinked(
+    ) {
+        this._has_markUnlinked= false;
+    }
+
+    /**
+     */
+    public void deleteShowBootstrap(
+    ) {
+        this._has_showBootstrap= false;
+    }
+
+    /**
+     */
+    public void deleteShowDistances(
+    ) {
+        this._has_showDistances= false;
+    }
+
+    /**
+     */
+    public void deleteThreshold(
+    ) {
+        this._has_threshold= false;
+    }
+
+    /**
+     */
+    public void deleteWidth(
+    ) {
+        this._has_width= false;
+    }
+
+    /**
+     */
+    public void deleteXpos(
+    ) {
+        this._has_xpos= false;
+    }
+
+    /**
+     */
+    public void deleteYpos(
+    ) {
+        this._has_ypos= false;
+    }
+
+    /**
+     * Returns the value of field 'currentTree'.
+     * 
+     * @return the value of field 'CurrentTree'.
+     */
+    public boolean getCurrentTree(
+    ) {
+        return this._currentTree;
+    }
+
+    /**
+     * Returns the value of field 'fitToWindow'.
+     * 
+     * @return the value of field 'FitToWindow'.
+     */
+    public boolean getFitToWindow(
+    ) {
+        return this._fitToWindow;
+    }
+
+    /**
+     * Returns the value of field 'fontName'.
+     * 
+     * @return the value of field 'FontName'.
+     */
+    public java.lang.String getFontName(
+    ) {
+        return this._fontName;
+    }
+
+    /**
+     * Returns the value of field 'fontSize'.
+     * 
+     * @return the value of field 'FontSize'.
+     */
+    public int getFontSize(
+    ) {
+        return this._fontSize;
+    }
+
+    /**
+     * Returns the value of field 'fontStyle'.
+     * 
+     * @return the value of field 'FontStyle'.
+     */
+    public int getFontStyle(
+    ) {
+        return this._fontStyle;
+    }
+
+    /**
+     * Returns the value of field 'height'.
+     * 
+     * @return the value of field 'Height'.
+     */
+    public int getHeight(
+    ) {
+        return this._height;
+    }
+
+    /**
+     * Returns the value of field 'id'. The field 'id' has the
+     * following description: Tree ID added for binding tree
+     *  visualization
+     *  settings to vamsas
+     *  document trees in jalview 2.4.1
+     *  
+     * 
+     * @return the value of field 'Id'.
+     */
+    public java.lang.String getId(
+    ) {
+        return this._id;
+    }
+
+    /**
+     * Returns the value of field 'linkToAllViews'.
+     * 
+     * @return the value of field 'LinkToAllViews'.
+     */
+    public boolean getLinkToAllViews(
+    ) {
+        return this._linkToAllViews;
+    }
+
+    /**
+     * Returns the value of field 'markUnlinked'.
+     * 
+     * @return the value of field 'MarkUnlinked'.
+     */
+    public boolean getMarkUnlinked(
+    ) {
+        return this._markUnlinked;
+    }
+
+    /**
+     * Returns the value of field 'newick'.
+     * 
+     * @return the value of field 'Newick'.
+     */
+    public java.lang.String getNewick(
+    ) {
+        return this._newick;
+    }
+
+    /**
+     * Returns the value of field 'showBootstrap'.
+     * 
+     * @return the value of field 'ShowBootstrap'.
+     */
+    public boolean getShowBootstrap(
+    ) {
+        return this._showBootstrap;
+    }
+
+    /**
+     * Returns the value of field 'showDistances'.
+     * 
+     * @return the value of field 'ShowDistances'.
+     */
+    public boolean getShowDistances(
+    ) {
+        return this._showDistances;
+    }
+
+    /**
+     * Returns the value of field 'threshold'.
+     * 
+     * @return the value of field 'Threshold'.
+     */
+    public float getThreshold(
+    ) {
+        return this._threshold;
+    }
+
+    /**
+     * Returns the value of field 'title'.
+     * 
+     * @return the value of field 'Title'.
+     */
+    public java.lang.String getTitle(
+    ) {
+        return this._title;
+    }
+
+    /**
+     * Returns the value of field 'width'.
+     * 
+     * @return the value of field 'Width'.
+     */
+    public int getWidth(
+    ) {
+        return this._width;
+    }
+
+    /**
+     * Returns the value of field 'xpos'.
+     * 
+     * @return the value of field 'Xpos'.
+     */
+    public int getXpos(
+    ) {
+        return this._xpos;
+    }
+
+    /**
+     * Returns the value of field 'ypos'.
+     * 
+     * @return the value of field 'Ypos'.
+     */
+    public int getYpos(
+    ) {
+        return this._ypos;
+    }
+
+    /**
+     * Method hasCurrentTree.
+     * 
+     * @return true if at least one CurrentTree has been added
+     */
+    public boolean hasCurrentTree(
+    ) {
+        return this._has_currentTree;
+    }
+
+    /**
+     * Method hasFitToWindow.
+     * 
+     * @return true if at least one FitToWindow has been added
+     */
+    public boolean hasFitToWindow(
+    ) {
+        return this._has_fitToWindow;
+    }
+
+    /**
+     * Method hasFontSize.
+     * 
+     * @return true if at least one FontSize has been added
+     */
+    public boolean hasFontSize(
+    ) {
+        return this._has_fontSize;
+    }
+
+    /**
+     * Method hasFontStyle.
+     * 
+     * @return true if at least one FontStyle has been added
+     */
+    public boolean hasFontStyle(
+    ) {
+        return this._has_fontStyle;
+    }
+
+    /**
+     * Method hasHeight.
+     * 
+     * @return true if at least one Height has been added
+     */
+    public boolean hasHeight(
+    ) {
+        return this._has_height;
+    }
+
+    /**
+     * Method hasLinkToAllViews.
+     * 
+     * @return true if at least one LinkToAllViews has been added
+     */
+    public boolean hasLinkToAllViews(
+    ) {
+        return this._has_linkToAllViews;
+    }
+
+    /**
+     * Method hasMarkUnlinked.
+     * 
+     * @return true if at least one MarkUnlinked has been added
+     */
+    public boolean hasMarkUnlinked(
+    ) {
+        return this._has_markUnlinked;
+    }
+
+    /**
+     * Method hasShowBootstrap.
+     * 
+     * @return true if at least one ShowBootstrap has been added
+     */
+    public boolean hasShowBootstrap(
+    ) {
+        return this._has_showBootstrap;
+    }
+
+    /**
+     * Method hasShowDistances.
+     * 
+     * @return true if at least one ShowDistances has been added
+     */
+    public boolean hasShowDistances(
+    ) {
+        return this._has_showDistances;
+    }
+
+    /**
+     * Method hasThreshold.
+     * 
+     * @return true if at least one Threshold has been added
+     */
+    public boolean hasThreshold(
+    ) {
+        return this._has_threshold;
+    }
+
+    /**
+     * Method hasWidth.
+     * 
+     * @return true if at least one Width has been added
+     */
+    public boolean hasWidth(
+    ) {
+        return this._has_width;
+    }
+
+    /**
+     * Method hasXpos.
+     * 
+     * @return true if at least one Xpos has been added
+     */
+    public boolean hasXpos(
+    ) {
+        return this._has_xpos;
+    }
+
+    /**
+     * Method hasYpos.
+     * 
+     * @return true if at least one Ypos has been added
+     */
+    public boolean hasYpos(
+    ) {
+        return this._has_ypos;
+    }
+
+    /**
+     * Returns the value of field 'currentTree'.
+     * 
+     * @return the value of field 'CurrentTree'.
+     */
+    public boolean isCurrentTree(
+    ) {
+        return this._currentTree;
+    }
+
+    /**
+     * Returns the value of field 'fitToWindow'.
+     * 
+     * @return the value of field 'FitToWindow'.
+     */
+    public boolean isFitToWindow(
+    ) {
+        return this._fitToWindow;
+    }
+
+    /**
+     * Returns the value of field 'linkToAllViews'.
+     * 
+     * @return the value of field 'LinkToAllViews'.
+     */
+    public boolean isLinkToAllViews(
+    ) {
+        return this._linkToAllViews;
+    }
+
+    /**
+     * Returns the value of field 'markUnlinked'.
+     * 
+     * @return the value of field 'MarkUnlinked'.
+     */
+    public boolean isMarkUnlinked(
+    ) {
+        return this._markUnlinked;
+    }
+
+    /**
+     * Returns the value of field 'showBootstrap'.
+     * 
+     * @return the value of field 'ShowBootstrap'.
+     */
+    public boolean isShowBootstrap(
+    ) {
+        return this._showBootstrap;
+    }
+
+    /**
+     * Returns the value of field 'showDistances'.
+     * 
+     * @return the value of field 'ShowDistances'.
+     */
+    public boolean isShowDistances(
+    ) {
+        return this._showDistances;
+    }
+
+    /**
+     * Method isValid.
+     * 
+     * @return true if this object is valid according to the schema
+     */
+    public boolean isValid(
+    ) {
+        try {
+            validate();
+        } catch (org.exolab.castor.xml.ValidationException vex) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 
+     * 
+     * @param out
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     */
+    public void marshal(
+            final java.io.Writer out)
+    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        Marshaller.marshal(this, out);
+    }
+
+    /**
+     * 
+     * 
+     * @param handler
+     * @throws java.io.IOException if an IOException occurs during
+     * marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     */
+    public void marshal(
+            final org.xml.sax.ContentHandler handler)
+    throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        Marshaller.marshal(this, handler);
+    }
+
+    /**
+     * Sets the value of field 'currentTree'.
+     * 
+     * @param currentTree the value of field 'currentTree'.
+     */
+    public void setCurrentTree(
+            final boolean currentTree) {
+        this._currentTree = currentTree;
+        this._has_currentTree = true;
+    }
+
+    /**
+     * Sets the value of field 'fitToWindow'.
+     * 
+     * @param fitToWindow the value of field 'fitToWindow'.
+     */
+    public void setFitToWindow(
+            final boolean fitToWindow) {
+        this._fitToWindow = fitToWindow;
+        this._has_fitToWindow = true;
+    }
+
+    /**
+     * Sets the value of field 'fontName'.
+     * 
+     * @param fontName the value of field 'fontName'.
+     */
+    public void setFontName(
+            final java.lang.String fontName) {
+        this._fontName = fontName;
+    }
+
+    /**
+     * Sets the value of field 'fontSize'.
+     * 
+     * @param fontSize the value of field 'fontSize'.
+     */
+    public void setFontSize(
+            final int fontSize) {
+        this._fontSize = fontSize;
+        this._has_fontSize = true;
+    }
+
+    /**
+     * Sets the value of field 'fontStyle'.
+     * 
+     * @param fontStyle the value of field 'fontStyle'.
+     */
+    public void setFontStyle(
+            final int fontStyle) {
+        this._fontStyle = fontStyle;
+        this._has_fontStyle = true;
+    }
+
+    /**
+     * Sets the value of field 'height'.
+     * 
+     * @param height the value of field 'height'.
+     */
+    public void setHeight(
+            final int height) {
+        this._height = height;
+        this._has_height = true;
+    }
+
+    /**
+     * Sets the value of field 'id'. The field 'id' has the
+     * following description: Tree ID added for binding tree
+     *  visualization
+     *  settings to vamsas
+     *  document trees in jalview 2.4.1
+     *  
+     * 
+     * @param id the value of field 'id'.
+     */
+    public void setId(
+            final java.lang.String id) {
+        this._id = id;
+    }
+
+    /**
+     * Sets the value of field 'linkToAllViews'.
+     * 
+     * @param linkToAllViews the value of field 'linkToAllViews'.
+     */
+    public void setLinkToAllViews(
+            final boolean linkToAllViews) {
+        this._linkToAllViews = linkToAllViews;
+        this._has_linkToAllViews = true;
+    }
+
+    /**
+     * Sets the value of field 'markUnlinked'.
+     * 
+     * @param markUnlinked the value of field 'markUnlinked'.
+     */
+    public void setMarkUnlinked(
+            final boolean markUnlinked) {
+        this._markUnlinked = markUnlinked;
+        this._has_markUnlinked = true;
+    }
+
+    /**
+     * Sets the value of field 'newick'.
+     * 
+     * @param newick the value of field 'newick'.
+     */
+    public void setNewick(
+            final java.lang.String newick) {
+        this._newick = newick;
+    }
+
+    /**
+     * Sets the value of field 'showBootstrap'.
+     * 
+     * @param showBootstrap the value of field 'showBootstrap'.
+     */
+    public void setShowBootstrap(
+            final boolean showBootstrap) {
+        this._showBootstrap = showBootstrap;
+        this._has_showBootstrap = true;
+    }
+
+    /**
+     * Sets the value of field 'showDistances'.
+     * 
+     * @param showDistances the value of field 'showDistances'.
+     */
+    public void setShowDistances(
+            final boolean showDistances) {
+        this._showDistances = showDistances;
+        this._has_showDistances = true;
+    }
+
+    /**
+     * Sets the value of field 'threshold'.
+     * 
+     * @param threshold the value of field 'threshold'.
+     */
+    public void setThreshold(
+            final float threshold) {
+        this._threshold = threshold;
+        this._has_threshold = true;
+    }
+
+    /**
+     * Sets the value of field 'title'.
+     * 
+     * @param title the value of field 'title'.
+     */
+    public void setTitle(
+            final java.lang.String title) {
+        this._title = title;
+    }
+
+    /**
+     * Sets the value of field 'width'.
+     * 
+     * @param width the value of field 'width'.
+     */
+    public void setWidth(
+            final int width) {
+        this._width = width;
+        this._has_width = true;
+    }
+
+    /**
+     * Sets the value of field 'xpos'.
+     * 
+     * @param xpos the value of field 'xpos'.
+     */
+    public void setXpos(
+            final int xpos) {
+        this._xpos = xpos;
+        this._has_xpos = true;
+    }
+
+    /**
+     * Sets the value of field 'ypos'.
+     * 
+     * @param ypos the value of field 'ypos'.
+     */
+    public void setYpos(
+            final int ypos) {
+        this._ypos = ypos;
+        this._has_ypos = true;
+    }
+
+    /**
+     * Method unmarshal.
+     * 
+     * @param reader
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     * @return the unmarshaled jalview.schemabinding.version2.Tree
+     */
+    public static jalview.schemabinding.version2.Tree unmarshal(
+            final java.io.Reader reader)
+    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(jalview.schemabinding.version2.Tree.class, reader);
+    }
+
+    /**
+     * 
+     * 
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     */
+    public void validate(
+    )
+    throws org.exolab.castor.xml.ValidationException {
+        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+        validator.validate(this);
+    }
 
 }
diff --git a/src/jalview/schemabinding/version2/TridiagonalMatrix.java b/src/jalview/schemabinding/version2/TridiagonalMatrix.java
new file mode 100644 (file)
index 0000000..b22302c
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
+/**
+ * Class TridiagonalMatrix.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalMatrix extends DoubleMatrix
+        implements java.io.Serializable
+{
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public TridiagonalMatrix()
+  {
+    super();
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method isValid.
+   * 
+   * @return true if this object is valid according to the schema
+   */
+  public boolean isValid()
+  {
+    try
+    {
+      validate();
+    } catch (org.exolab.castor.xml.ValidationException vex)
+    {
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * 
+   * 
+   * @param out
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void marshal(final java.io.Writer out)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, out);
+  }
+
+  /**
+   * 
+   * 
+   * @param handler
+   * @throws java.io.IOException
+   *           if an IOException occurs during marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   */
+  public void marshal(final org.xml.sax.ContentHandler handler)
+          throws java.io.IOException,
+          org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    Marshaller.marshal(this, handler);
+  }
+
+  /**
+   * Method unmarshal.
+   * 
+   * @param reader
+   * @throws org.exolab.castor.xml.MarshalException
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
+   */
+  public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
+          final java.io.Reader reader)
+          throws org.exolab.castor.xml.MarshalException,
+          org.exolab.castor.xml.ValidationException
+  {
+    return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
+            .unmarshal(
+                    jalview.schemabinding.version2.TridiagonalMatrix.class,
+                    reader);
+  }
+
+  /**
+   * 
+   * 
+   * @throws org.exolab.castor.xml.ValidationException
+   *           if this object is an invalid instance according to the schema
+   */
+  public void validate() throws org.exolab.castor.xml.ValidationException
+  {
+    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+    validator.validate(this);
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/AxisDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AxisDescriptor.java
new file mode 100644 (file)
index 0000000..16444be
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.Axis;
+
+/**
+ * Class AxisDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class AxisDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public AxisDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "axis";
+    _elementDefinition = true;
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _xPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_xPos", "xPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        Axis target = (Axis) object;
+        if (!target.hasXPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getXPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          Axis target = (Axis) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXPos();
+            return;
+          }
+          target.setXPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _yPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_yPos", "yPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        Axis target = (Axis) object;
+        if (!target.hasYPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getYPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          Axis target = (Axis) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYPos();
+            return;
+          }
+          target.setYPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _yPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _zPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_zPos", "zPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        Axis target = (Axis) object;
+        if (!target.hasZPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getZPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          Axis target = (Axis) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteZPos();
+            return;
+          }
+          target.setZPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _zPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.Axis.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/DDescriptor.java b/src/jalview/schemabinding/version2/descriptors/DDescriptor.java
new file mode 100644 (file)
index 0000000..6eb4b59
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.D;
+
+/**
+ * Class DDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class DDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public DDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "D";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.D.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/DoubleMatrixDescriptor.java b/src/jalview/schemabinding/version2/descriptors/DoubleMatrixDescriptor.java
new file mode 100644 (file)
index 0000000..f2d197b
--- /dev/null
@@ -0,0 +1,404 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.DoubleMatrix;
+
+/**
+ * Class DoubleMatrixDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class DoubleMatrixDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public DoubleMatrixDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "DoubleMatrix";
+    _elementDefinition = false;
+
+    // -- set grouping compositor
+    setCompositorAsSequence();
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _rows
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_rows", "rows",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleMatrix target = (DoubleMatrix) object;
+        if (!target.hasRows())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getRows());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteRows();
+            return;
+          }
+          target.setRows(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _rows
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _columns
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_columns", "columns",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleMatrix target = (DoubleMatrix) object;
+        if (!target.hasColumns())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getColumns());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteColumns();
+            return;
+          }
+          target.setColumns(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _columns
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+    // -- _rowList
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.Row.class, "_rowList", "row",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleMatrix target = (DoubleMatrix) object;
+        return target.getRow();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          target.addRow((jalview.schemabinding.version2.Row) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          target.removeAllRow();
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.Row();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setMultivalued(true);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _rowList
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(0);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _d
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.D.class, "_d", "D",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleMatrix target = (DoubleMatrix) object;
+        return target.getD();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          target.setD((jalview.schemabinding.version2.D) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.D();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _d
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _e
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.E.class, "_e", "E",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleMatrix target = (DoubleMatrix) object;
+        return target.getE();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleMatrix target = (DoubleMatrix) object;
+          target.setE((jalview.schemabinding.version2.E) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.E();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _e
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.DoubleMatrix.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/DoubleVectorDescriptor.java b/src/jalview/schemabinding/version2/descriptors/DoubleVectorDescriptor.java
new file mode 100644 (file)
index 0000000..488ef8c
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.DoubleVector;
+
+/**
+ * Class DoubleVectorDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class DoubleVectorDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public DoubleVectorDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "DoubleVector";
+    _elementDefinition = false;
+
+    // -- set grouping compositor
+    setCompositorAsSequence();
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- initialize element descriptors
+
+    // -- _vList
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Double.TYPE, "_vList", "v",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        DoubleVector target = (DoubleVector) object;
+        return target.getV();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleVector target = (DoubleVector) object;
+          // ignore null values for non optional primitives
+          if (value == null)
+          {
+            return;
+          }
+
+          target.addV(((java.lang.Double) value).doubleValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          DoubleVector target = (DoubleVector) object;
+          target.removeAllV();
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setMultivalued(true);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _vList
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(0);
+    { // -- local scope
+      org.exolab.castor.xml.validators.DoubleValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.DoubleValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-1.7976931348623157E308);
+      typeValidator.setMaxInclusive(1.7976931348623157E308);
+    }
+    desc.setValidator(fieldValidator);
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.DoubleVector.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/EDescriptor.java b/src/jalview/schemabinding/version2/descriptors/EDescriptor.java
new file mode 100644 (file)
index 0000000..b35c3ed
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.E;
+
+/**
+ * Class EDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class EDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public EDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "E";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.E.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/EigenMatrixDescriptor.java b/src/jalview/schemabinding/version2/descriptors/EigenMatrixDescriptor.java
new file mode 100644 (file)
index 0000000..92e2414
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.EigenMatrix;
+
+/**
+ * Class EigenMatrixDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class EigenMatrixDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public EigenMatrixDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "eigenMatrix";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.EigenMatrix.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
index e8c4ef4..af40425 100644 (file)
@@ -18,8 +18,8 @@ import jalview.schemabinding.version2.JalviewModelSequence;
  * 
  * @version $Revision$ $Date$
  */
-public class JalviewModelSequenceDescriptor extends
-        org.exolab.castor.xml.util.XMLClassDescriptorImpl
+public class JalviewModelSequenceDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
 {
 
   // --------------------------/
@@ -91,8 +91,8 @@ public class JalviewModelSequenceDescriptor extends
         }
       }
 
-      public void resetValue(Object object) throws IllegalStateException,
-              IllegalArgumentException
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
       {
         try
         {
@@ -146,8 +146,8 @@ public class JalviewModelSequenceDescriptor extends
         }
       }
 
-      public void resetValue(Object object) throws IllegalStateException,
-              IllegalArgumentException
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
       {
         try
         {
@@ -194,15 +194,16 @@ public class JalviewModelSequenceDescriptor extends
         try
         {
           JalviewModelSequence target = (JalviewModelSequence) object;
-          target.addViewport((jalview.schemabinding.version2.Viewport) value);
+          target.addViewport(
+                  (jalview.schemabinding.version2.Viewport) value);
         } catch (java.lang.Exception ex)
         {
           throw new IllegalStateException(ex.toString());
         }
       }
 
-      public void resetValue(Object object) throws IllegalStateException,
-              IllegalArgumentException
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
       {
         try
         {
@@ -250,15 +251,16 @@ public class JalviewModelSequenceDescriptor extends
         try
         {
           JalviewModelSequence target = (JalviewModelSequence) object;
-          target.addUserColours((jalview.schemabinding.version2.UserColours) value);
+          target.addUserColours(
+                  (jalview.schemabinding.version2.UserColours) value);
         } catch (java.lang.Exception ex)
         {
           throw new IllegalStateException(ex.toString());
         }
       }
 
-      public void resetValue(Object object) throws IllegalStateException,
-              IllegalArgumentException
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
       {
         try
         {
@@ -312,8 +314,8 @@ public class JalviewModelSequenceDescriptor extends
         }
       }
 
-      public void resetValue(Object object) throws IllegalStateException,
-              IllegalArgumentException
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
       {
         try
         {
@@ -341,6 +343,63 @@ public class JalviewModelSequenceDescriptor extends
     { // -- local scope
     }
     desc.setValidator(fieldValidator);
+    // -- _pcaViewerList
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.PcaViewer.class,
+            "_pcaViewerList", "PcaViewer",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        JalviewModelSequence target = (JalviewModelSequence) object;
+        return target.getPcaViewer();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          JalviewModelSequence target = (JalviewModelSequence) object;
+          target.addPcaViewer(
+                  (jalview.schemabinding.version2.PcaViewer) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          JalviewModelSequence target = (JalviewModelSequence) object;
+          target.removeAllPcaViewer();
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.PcaViewer();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setMultivalued(true);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _pcaViewerList
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(0);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
     // -- _featureSettings
     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
             jalview.schemabinding.version2.FeatureSettings.class,
@@ -361,7 +420,8 @@ public class JalviewModelSequenceDescriptor extends
         try
         {
           JalviewModelSequence target = (JalviewModelSequence) object;
-          target.setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value);
+          target.setFeatureSettings(
+                  (jalview.schemabinding.version2.FeatureSettings) value);
         } catch (java.lang.Exception ex)
         {
           throw new IllegalStateException(ex.toString());
diff --git a/src/jalview/schemabinding/version2/descriptors/PairwiseMatrixDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PairwiseMatrixDescriptor.java
new file mode 100644 (file)
index 0000000..9520f58
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.PairwiseMatrix;
+
+/**
+ * Class PairwiseMatrixDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PairwiseMatrixDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PairwiseMatrixDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "pairwiseMatrix";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.PairwiseMatrix.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/PcaDataDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PcaDataDescriptor.java
new file mode 100644 (file)
index 0000000..29b551c
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.PcaData;
+
+/**
+ * Class PcaDataDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaDataDescriptor extends
+        jalview.schemabinding.version2.descriptors.PcaDataTypeDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaDataDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.PcaDataTypeDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "pcaData";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.PcaData.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/PcaDataTypeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PcaDataTypeDescriptor.java
new file mode 100644 (file)
index 0000000..49ad090
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.PcaDataType;
+
+/**
+ * Class PcaDataTypeDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaDataTypeDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaDataTypeDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "PcaDataType";
+    _elementDefinition = false;
+
+    // -- set grouping compositor
+    setCompositorAsSequence();
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- initialize element descriptors
+
+    // -- _pairwiseMatrix
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.PairwiseMatrix.class,
+            "_pairwiseMatrix", "pairwiseMatrix",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaDataType target = (PcaDataType) object;
+        return target.getPairwiseMatrix();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaDataType target = (PcaDataType) object;
+          target.setPairwiseMatrix(
+                  (jalview.schemabinding.version2.PairwiseMatrix) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.PairwiseMatrix();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _pairwiseMatrix
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _tridiagonalMatrix
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.TridiagonalMatrix.class,
+            "_tridiagonalMatrix", "tridiagonalMatrix",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaDataType target = (PcaDataType) object;
+        return target.getTridiagonalMatrix();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaDataType target = (PcaDataType) object;
+          target.setTridiagonalMatrix(
+                  (jalview.schemabinding.version2.TridiagonalMatrix) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.TridiagonalMatrix();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _tridiagonalMatrix
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _eigenMatrix
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.EigenMatrix.class,
+            "_eigenMatrix", "eigenMatrix",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaDataType target = (PcaDataType) object;
+        return target.getEigenMatrix();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaDataType target = (PcaDataType) object;
+          target.setEigenMatrix(
+                  (jalview.schemabinding.version2.EigenMatrix) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.EigenMatrix();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _eigenMatrix
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.PcaDataType.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/PcaViewerDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PcaViewerDescriptor.java
new file mode 100644 (file)
index 0000000..630ae9a
--- /dev/null
@@ -0,0 +1,1320 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.PcaViewer;
+
+/**
+ * Class PcaViewerDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class PcaViewerDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public PcaViewerDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "PcaViewer";
+    _elementDefinition = true;
+
+    // -- set grouping compositor
+    setCompositorAsSequence();
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _title
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.String.class, "_title", "title",
+            org.exolab.castor.xml.NodeType.Attribute);
+    desc.setImmutable(true);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getTitle();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.setTitle((java.lang.String) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _title
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.StringValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setWhiteSpace("preserve");
+    }
+    desc.setValidator(fieldValidator);
+    // -- _scoreModelName
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.String.class, "_scoreModelName", "scoreModelName",
+            org.exolab.castor.xml.NodeType.Attribute);
+    desc.setImmutable(true);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getScoreModelName();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.setScoreModelName((java.lang.String) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _scoreModelName
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.StringValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setWhiteSpace("preserve");
+    }
+    desc.setValidator(fieldValidator);
+    // -- _xDim
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_xDim", "xDim",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasXDim())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getXDim());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXDim();
+            return;
+          }
+          target.setXDim(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xDim
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _yDim
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_yDim", "yDim",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasYDim())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getYDim());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYDim();
+            return;
+          }
+          target.setYDim(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _yDim
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _zDim
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_zDim", "zDim",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasZDim())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getZDim());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteZDim();
+            return;
+          }
+          target.setZDim(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _zDim
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _bgColour
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_bgColour", "bgColour",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasBgColour())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getBgColour());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteBgColour();
+            return;
+          }
+          target.setBgColour(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _bgColour
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _scaleFactor
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_scaleFactor", "scaleFactor",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasScaleFactor())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getScaleFactor());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteScaleFactor();
+            return;
+          }
+          target.setScaleFactor(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _scaleFactor
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _showLabels
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_showLabels", "showLabels",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasShowLabels())
+        {
+          return null;
+        }
+        return (target.getShowLabels() ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteShowLabels();
+            return;
+          }
+          target.setShowLabels(((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _showLabels
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _linkToAllViews
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_linkToAllViews", "linkToAllViews",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasLinkToAllViews())
+        {
+          return null;
+        }
+        return (target.getLinkToAllViews() ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteLinkToAllViews();
+            return;
+          }
+          target.setLinkToAllViews(
+                  ((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _linkToAllViews
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _includeGaps
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_includeGaps", "includeGaps",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasIncludeGaps())
+        {
+          return null;
+        }
+        return (target.getIncludeGaps() ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteIncludeGaps();
+            return;
+          }
+          target.setIncludeGaps(((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _includeGaps
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _matchGaps
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_matchGaps", "matchGaps",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasMatchGaps())
+        {
+          return null;
+        }
+        return (target.getMatchGaps() ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteMatchGaps();
+            return;
+          }
+          target.setMatchGaps(((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _matchGaps
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _includeGappedColumns
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_includeGappedColumns",
+            "includeGappedColumns",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasIncludeGappedColumns())
+        {
+          return null;
+        }
+        return (target.getIncludeGappedColumns() ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteIncludeGappedColumns();
+            return;
+          }
+          target.setIncludeGappedColumns(
+                  ((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _includeGappedColumns
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _denominateByShortestLength
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Boolean.TYPE, "_denominateByShortestLength",
+            "denominateByShortestLength",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasDenominateByShortestLength())
+        {
+          return null;
+        }
+        return (target.getDenominateByShortestLength()
+                ? java.lang.Boolean.TRUE
+                : java.lang.Boolean.FALSE);
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteDenominateByShortestLength();
+            return;
+          }
+          target.setDenominateByShortestLength(
+                  ((java.lang.Boolean) value).booleanValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _denominateByShortestLength
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+      fieldValidator.setValidator(typeValidator);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _width
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_width", "width",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasWidth())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getWidth());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteWidth();
+            return;
+          }
+          target.setWidth(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _width
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _height
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_height", "height",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasHeight())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getHeight());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteHeight();
+            return;
+          }
+          target.setHeight(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _height
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _xpos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_xpos", "xpos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasXpos())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getXpos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXpos();
+            return;
+          }
+          target.setXpos(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xpos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _ypos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Integer.TYPE, "_ypos", "ypos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        if (!target.hasYpos())
+        {
+          return null;
+        }
+        return new java.lang.Integer(target.getYpos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYpos();
+            return;
+          }
+          target.setYpos(((java.lang.Integer) value).intValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _ypos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.IntValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive(-2147483648);
+      typeValidator.setMaxInclusive(2147483647);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+    // -- _sequencePointList
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.SequencePoint.class,
+            "_sequencePointList", "sequencePoint",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getSequencePoint();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.addSequencePoint(
+                  (jalview.schemabinding.version2.SequencePoint) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.removeAllSequencePoint();
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.SequencePoint();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(true);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _sequencePointList
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _axisList
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.Axis.class, "_axisList", "axis",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getAxis();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.addAxis((jalview.schemabinding.version2.Axis) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public void resetValue(Object object)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.removeAllAxis();
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.Axis();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(true);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _axisList
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(3);
+    fieldValidator.setMaxOccurs(3);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _seqPointMin
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.SeqPointMin.class,
+            "_seqPointMin", "seqPointMin",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getSeqPointMin();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.setSeqPointMin(
+                  (jalview.schemabinding.version2.SeqPointMin) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.SeqPointMin();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _seqPointMin
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _seqPointMax
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.SeqPointMax.class,
+            "_seqPointMax", "seqPointMax",
+            org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getSeqPointMax();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.setSeqPointMax(
+                  (jalview.schemabinding.version2.SeqPointMax) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.SeqPointMax();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _seqPointMax
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+    // -- _pcaData
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            jalview.schemabinding.version2.PcaData.class, "_pcaData",
+            "pcaData", org.exolab.castor.xml.NodeType.Element);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        PcaViewer target = (PcaViewer) object;
+        return target.getPcaData();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          PcaViewer target = (PcaViewer) object;
+          target.setPcaData((jalview.schemabinding.version2.PcaData) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return new jalview.schemabinding.version2.PcaData();
+      }
+    };
+    desc.setHandler(handler);
+    desc.setNameSpaceURI("www.jalview.org");
+    desc.setRequired(true);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _pcaData
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    fieldValidator.setMinOccurs(1);
+    { // -- local scope
+    }
+    desc.setValidator(fieldValidator);
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.PcaViewer.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/RowDescriptor.java b/src/jalview/schemabinding/version2/descriptors/RowDescriptor.java
new file mode 100644 (file)
index 0000000..f9ca1a6
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.Row;
+
+/**
+ * Class RowDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class RowDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public RowDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "row";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.Row.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/SeqPointMaxDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SeqPointMaxDescriptor.java
new file mode 100644 (file)
index 0000000..18f0cb7
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.SeqPointMax;
+
+/**
+ * Class SeqPointMaxDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SeqPointMaxDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SeqPointMaxDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "seqPointMax";
+    _elementDefinition = true;
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _xPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_xPos", "xPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMax target = (SeqPointMax) object;
+        if (!target.hasXPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getXPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMax target = (SeqPointMax) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXPos();
+            return;
+          }
+          target.setXPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _yPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_yPos", "yPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMax target = (SeqPointMax) object;
+        if (!target.hasYPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getYPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMax target = (SeqPointMax) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYPos();
+            return;
+          }
+          target.setYPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _yPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _zPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_zPos", "zPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMax target = (SeqPointMax) object;
+        if (!target.hasZPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getZPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMax target = (SeqPointMax) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteZPos();
+            return;
+          }
+          target.setZPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _zPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.SeqPointMax.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/SeqPointMinDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SeqPointMinDescriptor.java
new file mode 100644 (file)
index 0000000..fbf978e
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.SeqPointMin;
+
+/**
+ * Class SeqPointMinDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SeqPointMinDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SeqPointMinDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "seqPointMin";
+    _elementDefinition = true;
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _xPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_xPos", "xPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMin target = (SeqPointMin) object;
+        if (!target.hasXPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getXPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMin target = (SeqPointMin) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXPos();
+            return;
+          }
+          target.setXPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _yPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_yPos", "yPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMin target = (SeqPointMin) object;
+        if (!target.hasYPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getYPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMin target = (SeqPointMin) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYPos();
+            return;
+          }
+          target.setYPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _yPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _zPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_zPos", "zPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SeqPointMin target = (SeqPointMin) object;
+        if (!target.hasZPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getZPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SeqPointMin target = (SeqPointMin) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteZPos();
+            return;
+          }
+          target.setZPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _zPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.SeqPointMin.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
diff --git a/src/jalview/schemabinding/version2/descriptors/SequencePointDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequencePointDescriptor.java
new file mode 100644 (file)
index 0000000..0d48052
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.SequencePoint;
+
+/**
+ * Class SequencePointDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class SequencePointDescriptor
+        extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public SequencePointDescriptor()
+  {
+    super();
+    _nsURI = "www.jalview.org";
+    _xmlName = "sequencePoint";
+    _elementDefinition = true;
+    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+    org.exolab.castor.mapping.FieldHandler handler = null;
+    org.exolab.castor.xml.FieldValidator fieldValidator = null;
+    // -- initialize attribute descriptors
+
+    // -- _sequenceRef
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.String.class, "_sequenceRef", "sequenceRef",
+            org.exolab.castor.xml.NodeType.Attribute);
+    desc.setImmutable(true);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SequencePoint target = (SequencePoint) object;
+        return target.getSequenceRef();
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SequencePoint target = (SequencePoint) object;
+          target.setSequenceRef((java.lang.String) value);
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _sequenceRef
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.StringValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setWhiteSpace("preserve");
+    }
+    desc.setValidator(fieldValidator);
+    // -- _xPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_xPos", "xPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SequencePoint target = (SequencePoint) object;
+        if (!target.hasXPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getXPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SequencePoint target = (SequencePoint) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteXPos();
+            return;
+          }
+          target.setXPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _xPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _yPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_yPos", "yPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SequencePoint target = (SequencePoint) object;
+        if (!target.hasYPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getYPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SequencePoint target = (SequencePoint) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteYPos();
+            return;
+          }
+          target.setYPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _yPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- _zPos
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+            java.lang.Float.TYPE, "_zPos", "zPos",
+            org.exolab.castor.xml.NodeType.Attribute);
+    handler = new org.exolab.castor.xml.XMLFieldHandler()
+    {
+      public java.lang.Object getValue(java.lang.Object object)
+              throws IllegalStateException
+      {
+        SequencePoint target = (SequencePoint) object;
+        if (!target.hasZPos())
+        {
+          return null;
+        }
+        return new java.lang.Float(target.getZPos());
+      }
+
+      public void setValue(java.lang.Object object, java.lang.Object value)
+              throws IllegalStateException, IllegalArgumentException
+      {
+        try
+        {
+          SequencePoint target = (SequencePoint) object;
+          // if null, use delete method for optional primitives
+          if (value == null)
+          {
+            target.deleteZPos();
+            return;
+          }
+          target.setZPos(((java.lang.Float) value).floatValue());
+        } catch (java.lang.Exception ex)
+        {
+          throw new IllegalStateException(ex.toString());
+        }
+      }
+
+      public java.lang.Object newInstance(java.lang.Object parent)
+      {
+        return null;
+      }
+    };
+    desc.setHandler(handler);
+    desc.setMultivalued(false);
+    addFieldDescriptor(desc);
+
+    // -- validation code for: _zPos
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();
+    { // -- local scope
+      org.exolab.castor.xml.validators.FloatValidator typeValidator;
+      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+      fieldValidator.setValidator(typeValidator);
+      typeValidator.setMinInclusive((float) -3.4028235E38);
+      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    }
+    desc.setValidator(fieldValidator);
+    // -- initialize element descriptors
+
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.SequencePoint.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
index 8e675f3..898d456 100644 (file)
@@ -7,8 +7,8 @@
 
 package jalview.schemabinding.version2.descriptors;
 
-//---------------------------------/
-//- Imported classes and packages -/
+  //---------------------------------/
+ //- Imported classes and packages -/
 //---------------------------------/
 
 import jalview.schemabinding.version2.Tree;
@@ -18,978 +18,839 @@ import jalview.schemabinding.version2.Tree;
  * 
  * @version $Revision$ $Date$
  */
-public class TreeDescriptor extends
-        org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
-  // --------------------------/
-  // - Class/Member Variables -/
-  // --------------------------/
-
-  /**
-   * Field _elementDefinition.
-   */
-  private boolean _elementDefinition;
-
-  /**
-   * Field _nsPrefix.
-   */
-  private java.lang.String _nsPrefix;
-
-  /**
-   * Field _nsURI.
-   */
-  private java.lang.String _nsURI;
-
-  /**
-   * Field _xmlName.
-   */
-  private java.lang.String _xmlName;
-
-  // ----------------/
-  // - Constructors -/
-  // ----------------/
-
-  public TreeDescriptor()
-  {
-    super();
-    _nsURI = "www.jalview.org";
-    _xmlName = "tree";
-    _elementDefinition = true;
-
-    // -- set grouping compositor
-    setCompositorAsSequence();
-    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
-    org.exolab.castor.mapping.FieldHandler handler = null;
-    org.exolab.castor.xml.FieldValidator fieldValidator = null;
-    // -- initialize attribute descriptors
-
-    // -- _fontName
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_fontName", "fontName",
-            org.exolab.castor.xml.NodeType.Attribute);
-    desc.setImmutable(true);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        return target.getFontName();
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          target.setFontName((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field _elementDefinition.
+     */
+    private boolean _elementDefinition;
+
+    /**
+     * Field _nsPrefix.
+     */
+    private java.lang.String _nsPrefix;
+
+    /**
+     * Field _nsURI.
+     */
+    private java.lang.String _nsURI;
+
+    /**
+     * Field _xmlName.
+     */
+    private java.lang.String _xmlName;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    public TreeDescriptor() {
+        super();
+        _nsURI = "www.jalview.org";
+        _xmlName = "tree";
+        _elementDefinition = true;
+        
+        //-- set grouping compositor
+        setCompositorAsSequence();
+        org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
+        org.exolab.castor.mapping.FieldHandler             handler        = null;
+        org.exolab.castor.xml.FieldValidator               fieldValidator = null;
+        //-- initialize attribute descriptors
+        
+        //-- _fontName
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fontName", "fontName", org.exolab.castor.xml.NodeType.Attribute);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                return target.getFontName();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    target.setFontName( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _fontName
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.StringValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setWhiteSpace("preserve");
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _fontName
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.StringValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setWhiteSpace("preserve");
-    }
-    desc.setValidator(fieldValidator);
-    // -- _fontSize
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_fontSize", "fontSize",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasFontSize())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _fontSize
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontSize", "fontSize", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasFontSize()) { return null; }
+                return new java.lang.Integer(target.getFontSize());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteFontSize();
+                        return;
+                    }
+                    target.setFontSize( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _fontSize
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-        return new java.lang.Integer(target.getFontSize());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteFontSize();
-            return;
-          }
-          target.setFontSize(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _fontStyle
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontStyle", "fontStyle", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasFontStyle()) { return null; }
+                return new java.lang.Integer(target.getFontStyle());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteFontStyle();
+                        return;
+                    }
+                    target.setFontStyle( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _fontStyle
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _fontSize
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _fontStyle
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_fontStyle", "fontStyle",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasFontStyle())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _threshold
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasThreshold()) { return null; }
+                return new java.lang.Float(target.getThreshold());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteThreshold();
+                        return;
+                    }
+                    target.setThreshold( ((java.lang.Float) value).floatValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _threshold
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.FloatValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive((float) -3.4028235E38);
+            typeValidator.setMaxInclusive((float) 3.4028235E38);
         }
-        return new java.lang.Integer(target.getFontStyle());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteFontStyle();
-            return;
-          }
-          target.setFontStyle(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _showBootstrap
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBootstrap", "showBootstrap", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasShowBootstrap()) { return null; }
+                return (target.getShowBootstrap() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteShowBootstrap();
+                        return;
+                    }
+                    target.setShowBootstrap( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _showBootstrap
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _fontStyle
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _threshold
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Float.TYPE, "_threshold", "threshold",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasThreshold())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _showDistances
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showDistances", "showDistances", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasShowDistances()) { return null; }
+                return (target.getShowDistances() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteShowDistances();
+                        return;
+                    }
+                    target.setShowDistances( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _showDistances
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-        return new java.lang.Float(target.getThreshold());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteThreshold();
-            return;
-          }
-          target.setThreshold(((java.lang.Float) value).floatValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _markUnlinked
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_markUnlinked", "markUnlinked", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasMarkUnlinked()) { return null; }
+                return (target.getMarkUnlinked() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteMarkUnlinked();
+                        return;
+                    }
+                    target.setMarkUnlinked( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _markUnlinked
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _threshold
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.FloatValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive((float) -3.4028235E38);
-      typeValidator.setMaxInclusive((float) 3.4028235E38);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _showBootstrap
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Boolean.TYPE, "_showBootstrap", "showBootstrap",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasShowBootstrap())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _fitToWindow
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_fitToWindow", "fitToWindow", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasFitToWindow()) { return null; }
+                return (target.getFitToWindow() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteFitToWindow();
+                        return;
+                    }
+                    target.setFitToWindow( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _fitToWindow
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-        return (target.getShowBootstrap() ? java.lang.Boolean.TRUE
-                : java.lang.Boolean.FALSE);
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteShowBootstrap();
-            return;
-          }
-          target.setShowBootstrap(((java.lang.Boolean) value)
-                  .booleanValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _currentTree
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_currentTree", "currentTree", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasCurrentTree()) { return null; }
+                return (target.getCurrentTree() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteCurrentTree();
+                        return;
+                    }
+                    target.setCurrentTree( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _currentTree
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _showBootstrap
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
-      fieldValidator.setValidator(typeValidator);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _showDistances
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Boolean.TYPE, "_showDistances", "showDistances",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasShowDistances())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _id
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
+        super.setIdentity(desc);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                return target.getId();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    target.setId( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return new java.lang.String();
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _id
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IdValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-        return (target.getShowDistances() ? java.lang.Boolean.TRUE
-                : java.lang.Boolean.FALSE);
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteShowDistances();
-            return;
-          }
-          target.setShowDistances(((java.lang.Boolean) value)
-                  .booleanValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _linkToAllViews
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_linkToAllViews", "linkToAllViews", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasLinkToAllViews()) { return null; }
+                return (target.getLinkToAllViews() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteLinkToAllViews();
+                        return;
+                    }
+                    target.setLinkToAllViews( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _linkToAllViews
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _showDistances
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
-      fieldValidator.setValidator(typeValidator);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _markUnlinked
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Boolean.TYPE, "_markUnlinked", "markUnlinked",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasMarkUnlinked())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _width
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasWidth()) { return null; }
+                return new java.lang.Integer(target.getWidth());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteWidth();
+                        return;
+                    }
+                    target.setWidth( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _width
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-        return (target.getMarkUnlinked() ? java.lang.Boolean.TRUE
-                : java.lang.Boolean.FALSE);
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteMarkUnlinked();
-            return;
-          }
-          target.setMarkUnlinked(((java.lang.Boolean) value).booleanValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _height
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasHeight()) { return null; }
+                return new java.lang.Integer(target.getHeight());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteHeight();
+                        return;
+                    }
+                    target.setHeight( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _height
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _markUnlinked
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
-      fieldValidator.setValidator(typeValidator);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _fitToWindow
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Boolean.TYPE, "_fitToWindow", "fitToWindow",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasFitToWindow())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _xpos
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasXpos()) { return null; }
+                return new java.lang.Integer(target.getXpos());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteXpos();
+                        return;
+                    }
+                    target.setXpos( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _xpos
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-        return (target.getFitToWindow() ? java.lang.Boolean.TRUE
-                : java.lang.Boolean.FALSE);
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteFitToWindow();
-            return;
-          }
-          target.setFitToWindow(((java.lang.Boolean) value).booleanValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _ypos
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                if (!target.hasYpos()) { return null; }
+                return new java.lang.Integer(target.getYpos());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteYpos();
+                        return;
+                    }
+                    target.setYpos( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _ypos
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _fitToWindow
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
-      fieldValidator.setValidator(typeValidator);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _currentTree
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Boolean.TYPE, "_currentTree", "currentTree",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasCurrentTree())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- initialize element descriptors
+        
+        //-- _title
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Element);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                return target.getTitle();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    target.setTitle( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setNameSpaceURI("www.jalview.org");
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _title
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.StringValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setWhiteSpace("preserve");
         }
-        return (target.getCurrentTree() ? java.lang.Boolean.TRUE
-                : java.lang.Boolean.FALSE);
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteCurrentTree();
-            return;
-          }
-          target.setCurrentTree(((java.lang.Boolean) value).booleanValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _newick
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_newick", "newick", org.exolab.castor.xml.NodeType.Element);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                Tree target = (Tree) object;
+                return target.getNewick();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    Tree target = (Tree) object;
+                    target.setNewick( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setNameSpaceURI("www.jalview.org");
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _newick
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.StringValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setWhiteSpace("preserve");
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _currentTree
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.BooleanValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
-      fieldValidator.setValidator(typeValidator);
+        desc.setValidator(fieldValidator);
     }
-    desc.setValidator(fieldValidator);
-    // -- _id
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_id", "id",
-            org.exolab.castor.xml.NodeType.Attribute);
-    super.setIdentity(desc);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        return target.getId();
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          target.setId((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
 
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return new java.lang.String();
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _id
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IdValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IdValidator();
-      fieldValidator.setValidator(typeValidator);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _width
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_width", "width",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasWidth())
-        {
-          return null;
-        }
-        return new java.lang.Integer(target.getWidth());
-      }
 
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteWidth();
-            return;
-          }
-          target.setWidth(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
+      //-----------/
+     //- Methods -/
+    //-----------/
 
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
+    /**
+     * Method getAccessMode.
+     * 
+     * @return the access mode specified for this class.
+     */
+    public org.exolab.castor.mapping.AccessMode getAccessMode(
+    ) {
         return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _width
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
     }
-    desc.setValidator(fieldValidator);
-    // -- _height
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_height", "height",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasHeight())
-        {
-          return null;
-        }
-        return new java.lang.Integer(target.getHeight());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteHeight();
-            return;
-          }
-          target.setHeight(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
 
-    // -- validation code for: _height
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
+    /**
+     * Method getIdentity.
+     * 
+     * @return the identity field, null if this class has no
+     * identity.
+     */
+    public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+    ) {
+        return super.getIdentity();
     }
-    desc.setValidator(fieldValidator);
-    // -- _xpos
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_xpos", "xpos",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasXpos())
-        {
-          return null;
-        }
-        return new java.lang.Integer(target.getXpos());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteXpos();
-            return;
-          }
-          target.setXpos(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
 
-    // -- validation code for: _xpos
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
+    /**
+     * Method getJavaClass.
+     * 
+     * @return the Java class represented by this descriptor.
+     */
+    public java.lang.Class getJavaClass(
+    ) {
+        return jalview.schemabinding.version2.Tree.class;
     }
-    desc.setValidator(fieldValidator);
-    // -- _ypos
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_ypos", "ypos",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        if (!target.hasYpos())
-        {
-          return null;
-        }
-        return new java.lang.Integer(target.getYpos());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteYpos();
-            return;
-          }
-          target.setYpos(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
 
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _ypos
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
+    /**
+     * Method getNameSpacePrefix.
+     * 
+     * @return the namespace prefix to use when marshaling as XML.
+     */
+    public java.lang.String getNameSpacePrefix(
+    ) {
+        return _nsPrefix;
     }
-    desc.setValidator(fieldValidator);
-    // -- initialize element descriptors
-
-    // -- _title
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_title", "title",
-            org.exolab.castor.xml.NodeType.Element);
-    desc.setImmutable(true);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        return target.getTitle();
-      }
 
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          target.setTitle((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setNameSpaceURI("www.jalview.org");
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _title
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.StringValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setWhiteSpace("preserve");
+    /**
+     * Method getNameSpaceURI.
+     * 
+     * @return the namespace URI used when marshaling and
+     * unmarshaling as XML.
+     */
+    public java.lang.String getNameSpaceURI(
+    ) {
+        return _nsURI;
     }
-    desc.setValidator(fieldValidator);
-    // -- _newick
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_newick", "newick",
-            org.exolab.castor.xml.NodeType.Element);
-    desc.setImmutable(true);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        Tree target = (Tree) object;
-        return target.getNewick();
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          Tree target = (Tree) object;
-          target.setNewick((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
 
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setNameSpaceURI("www.jalview.org");
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _newick
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.StringValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setWhiteSpace("preserve");
+    /**
+     * Method getValidator.
+     * 
+     * @return a specific validator for the class described by this
+     * ClassDescriptor.
+     */
+    public org.exolab.castor.xml.TypeValidator getValidator(
+    ) {
+        return this;
     }
-    desc.setValidator(fieldValidator);
-  }
-
-  // -----------/
-  // - Methods -/
-  // -----------/
-
-  /**
-   * Method getAccessMode.
-   * 
-   * @return the access mode specified for this class.
-   */
-  public org.exolab.castor.mapping.AccessMode getAccessMode()
-  {
-    return null;
-  }
-
-  /**
-   * Method getIdentity.
-   * 
-   * @return the identity field, null if this class has no identity.
-   */
-  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
-  {
-    return super.getIdentity();
-  }
-
-  /**
-   * Method getJavaClass.
-   * 
-   * @return the Java class represented by this descriptor.
-   */
-  public java.lang.Class getJavaClass()
-  {
-    return jalview.schemabinding.version2.Tree.class;
-  }
 
-  /**
-   * Method getNameSpacePrefix.
-   * 
-   * @return the namespace prefix to use when marshaling as XML.
-   */
-  public java.lang.String getNameSpacePrefix()
-  {
-    return _nsPrefix;
-  }
-
-  /**
-   * Method getNameSpaceURI.
-   * 
-   * @return the namespace URI used when marshaling and unmarshaling as XML.
-   */
-  public java.lang.String getNameSpaceURI()
-  {
-    return _nsURI;
-  }
-
-  /**
-   * Method getValidator.
-   * 
-   * @return a specific validator for the class described by this
-   *         ClassDescriptor.
-   */
-  public org.exolab.castor.xml.TypeValidator getValidator()
-  {
-    return this;
-  }
-
-  /**
-   * Method getXMLName.
-   * 
-   * @return the XML Name for the Class being described.
-   */
-  public java.lang.String getXMLName()
-  {
-    return _xmlName;
-  }
+    /**
+     * Method getXMLName.
+     * 
+     * @return the XML Name for the Class being described.
+     */
+    public java.lang.String getXMLName(
+    ) {
+        return _xmlName;
+    }
 
-  /**
-   * Method isElementDefinition.
-   * 
-   * @return true if XML schema definition of this Class is that of a global
-   *         element or element with anonymous type definition.
-   */
-  public boolean isElementDefinition()
-  {
-    return _elementDefinition;
-  }
+    /**
+     * Method isElementDefinition.
+     * 
+     * @return true if XML schema definition of this Class is that
+     * of a global
+     * element or element with anonymous type definition.
+     */
+    public boolean isElementDefinition(
+    ) {
+        return _elementDefinition;
+    }
 
 }
diff --git a/src/jalview/schemabinding/version2/descriptors/TridiagonalMatrixDescriptor.java b/src/jalview/schemabinding/version2/descriptors/TridiagonalMatrixDescriptor.java
new file mode 100644 (file)
index 0000000..3abbeab
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
+ */
+
+package jalview.schemabinding.version2.descriptors;
+
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.schemabinding.version2.TridiagonalMatrix;
+
+/**
+ * Class TridiagonalMatrixDescriptor.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class TridiagonalMatrixDescriptor extends
+        jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
+{
+
+  // --------------------------/
+  // - Class/Member Variables -/
+  // --------------------------/
+
+  /**
+   * Field _elementDefinition.
+   */
+  private boolean _elementDefinition;
+
+  /**
+   * Field _nsPrefix.
+   */
+  private java.lang.String _nsPrefix;
+
+  /**
+   * Field _nsURI.
+   */
+  private java.lang.String _nsURI;
+
+  /**
+   * Field _xmlName.
+   */
+  private java.lang.String _xmlName;
+
+  // ----------------/
+  // - Constructors -/
+  // ----------------/
+
+  public TridiagonalMatrixDescriptor()
+  {
+    super();
+    setExtendsWithoutFlatten(
+            new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
+    _nsURI = "www.jalview.org";
+    _xmlName = "tridiagonalMatrix";
+    _elementDefinition = true;
+  }
+
+  // -----------/
+  // - Methods -/
+  // -----------/
+
+  /**
+   * Method getAccessMode.
+   * 
+   * @return the access mode specified for this class.
+   */
+  public org.exolab.castor.mapping.AccessMode getAccessMode()
+  {
+    return null;
+  }
+
+  /**
+   * Method getIdentity.
+   * 
+   * @return the identity field, null if this class has no identity.
+   */
+  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+  {
+    return super.getIdentity();
+  }
+
+  /**
+   * Method getJavaClass.
+   * 
+   * @return the Java class represented by this descriptor.
+   */
+  public java.lang.Class getJavaClass()
+  {
+    return jalview.schemabinding.version2.TridiagonalMatrix.class;
+  }
+
+  /**
+   * Method getNameSpacePrefix.
+   * 
+   * @return the namespace prefix to use when marshaling as XML.
+   */
+  public java.lang.String getNameSpacePrefix()
+  {
+    return _nsPrefix;
+  }
+
+  /**
+   * Method getNameSpaceURI.
+   * 
+   * @return the namespace URI used when marshaling and unmarshaling as XML.
+   */
+  public java.lang.String getNameSpaceURI()
+  {
+    return _nsURI;
+  }
+
+  /**
+   * Method getValidator.
+   * 
+   * @return a specific validator for the class described by this
+   *         ClassDescriptor.
+   */
+  public org.exolab.castor.xml.TypeValidator getValidator()
+  {
+    return this;
+  }
+
+  /**
+   * Method getXMLName.
+   * 
+   * @return the XML Name for the Class being described.
+   */
+  public java.lang.String getXMLName()
+  {
+    return _xmlName;
+  }
+
+  /**
+   * Method isElementDefinition.
+   * 
+   * @return true if XML schema definition of this Class is that of a global
+   *         element or element with anonymous type definition.
+   */
+  public boolean isElementDefinition()
+  {
+    return _elementDefinition;
+  }
+
+}
index 5e7fca2..1693294 100644 (file)
@@ -25,31 +25,39 @@ import jalview.api.RotatableCanvasI;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
 import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Point;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.SequencePoint;
 
+import java.util.List;
 import java.util.Vector;
 
 public class PCAModel
 {
-  private volatile PCA pca;
-
-  int top;
+  /*
+   * inputs
+   */
+  private AlignmentView inputData;
 
-  AlignmentView seqstrings;
+  private final SequenceI[] seqs;
 
-  SequenceI[] seqs;
+  private final SimilarityParamsI similarityParams;
 
   /*
-   * Name of score model used to calculate PCA
+   * options - score model, nucleotide / protein
    */
-  ScoreModelI scoreModel;
+  private ScoreModelI scoreModel;
 
   private boolean nucleotide = false;
 
-  private Vector<SequencePoint> points;
+  /*
+   * outputs
+   */
+  private PCA pca;
 
-  private SimilarityParamsI similarityParams;
+  int top;
+
+  private List<SequencePoint> points;
 
   /**
    * Constructor given sequence data, score model and score calculation
@@ -64,17 +72,21 @@ public class PCAModel
   public PCAModel(AlignmentView seqData, SequenceI[] sqs, boolean nuc,
           ScoreModelI modelName, SimilarityParamsI params)
   {
-    seqstrings = seqData;
+    inputData = seqData;
     seqs = sqs;
     nucleotide = nuc;
     scoreModel = modelName;
     similarityParams = params;
   }
 
-  public void run()
+  /**
+   * Performs the PCA calculation (in the same thread) and extracts result data
+   * needed for visualisation by PCAPanel
+   */
+  public void calculate()
   {
-    pca = new PCA(seqstrings, scoreModel, similarityParams);
-    pca.run();
+    pca = new PCA(inputData, scoreModel, similarityParams);
+    pca.run(); // executes in same thread, wait for completion
 
     // Now find the component coordinates
     int ii = 0;
@@ -88,13 +100,13 @@ public class PCAModel
     // top = pca.getM().height() - 1;
     top = height - 1;
 
-    points = new Vector<SequencePoint>();
-    float[][] scores = pca.getComponents(top - 1, top - 2, top - 3, 100);
+    points = new Vector<>();
+    Point[] scores = pca.getComponents(top - 1, top - 2, top - 3, 100);
 
     for (int i = 0; i < height; i++)
     {
       SequencePoint sp = new SequencePoint(seqs[i], scores[i]);
-      points.addElement(sp);
+      points.add(sp);
     }
   }
 
@@ -114,17 +126,22 @@ public class PCAModel
   }
 
   /**
+   * Answers the index of the principal dimension of the PCA
    * 
-   * 
-   * @return index of principle dimension of PCA
+   * @return
    */
   public int getTop()
   {
     return top;
   }
 
+  public void setTop(int t)
+  {
+    top = t;
+  }
+
   /**
-   * update the 2d coordinates for the list of points to the given dimensions
+   * Updates the 3D coordinates for the list of points to the given dimensions.
    * Principal dimension is getTop(). Next greatest eigenvector is getTop()-1.
    * Note - pca.getComponents starts counting the spectrum from rank-2 to zero,
    * rather than rank-1, so getComponents(dimN ...) == updateRcView(dimN+1 ..)
@@ -136,11 +153,11 @@ public class PCAModel
   public void updateRcView(int dim1, int dim2, int dim3)
   {
     // note: actual indices for components are dim1-1, etc (patch for JAL-1123)
-    float[][] scores = pca.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 100);
+    Point[] scores = pca.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 100);
 
     for (int i = 0; i < pca.getHeight(); i++)
     {
-      points.elementAt(i).coord = scores[i];
+      points.get(i).coord = scores[i];
     }
   }
 
@@ -149,9 +166,14 @@ public class PCAModel
     return pca.getDetails();
   }
 
-  public AlignmentView getSeqtrings()
+  public AlignmentView getInputData()
+  {
+    return inputData;
+  }
+
+  public void setInputData(AlignmentView data)
   {
-    return seqstrings;
+    inputData = data;
   }
 
   public String getPointsasCsv(boolean transformed, int xdim, int ydim,
@@ -192,42 +214,58 @@ public class PCAModel
       }
       else
       {
-        // output current x,y,z coords for points
-        fl = getPointPosition(s);
-        for (int d = 0; d < fl.length; d++)
-        {
-          csv.append(",");
-          csv.append(fl[d]);
-        }
+        Point p = points.get(s).coord;
+        csv.append(",").append(p.x);
+        csv.append(",").append(p.y);
+        csv.append(",").append(p.z);
       }
       csv.append("\n");
     }
     return csv.toString();
   }
 
+  public String getScoreModelName()
+  {
+    return scoreModel == null ? "" : scoreModel.getName();
+  }
+
+  public void setScoreModel(ScoreModelI sm)
+  {
+    this.scoreModel = sm;
+  }
+
   /**
+   * Answers the parameters configured for pairwise similarity calculations
    * 
-   * @return x,y,z positions of point s (index into points) under current
-   *         transform.
+   * @return
    */
-  public double[] getPointPosition(int s)
+  public SimilarityParamsI getSimilarityParameters()
   {
-    double pts[] = new double[3];
-    float[] p = points.elementAt(s).coord;
-    pts[0] = p[0];
-    pts[1] = p[1];
-    pts[2] = p[2];
-    return pts;
+    return similarityParams;
   }
 
-  public String getScoreModelName()
+  public List<SequencePoint> getSequencePoints()
   {
-    return scoreModel == null ? "" : scoreModel.getName();
+    return points;
   }
 
-  public void setScoreModel(ScoreModelI sm)
+  public void setSequencePoints(List<SequencePoint> sp)
   {
-    this.scoreModel = sm;
+    points = sp;
+  }
+
+  /**
+   * Answers the object holding the values of the computed PCA
+   * 
+   * @return
+   */
+  public PCA getPcaData()
+  {
+    return pca;
   }
 
+  public void setPCA(PCA data)
+  {
+    pca = data;
+  }
 }
index ffcd1a8..5e44d3d 100644 (file)
@@ -45,16 +45,16 @@ public class ScoreModelsTest
     assertTrue(sm instanceof SimilarityScoreModel);
     assertTrue(sm instanceof PairwiseScoreModelI);
     assertFalse(sm instanceof DistanceScoreModel);
-    assertEquals(sm.getName(), "PID");
-    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'C'), 0f);
-    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'r'), 1f);
+    assertEquals(sm.getName(), "DNA");
+    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('c', 'x'), 1f);
 
     sm = models.next();
     assertTrue(sm instanceof SimilarityScoreModel);
     assertTrue(sm instanceof PairwiseScoreModelI);
     assertFalse(sm instanceof DistanceScoreModel);
-    assertEquals(sm.getName(), "DNA");
-    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('c', 'x'), 1f);
+    assertEquals(sm.getName(), "PID");
+    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'C'), 0f);
+    assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'r'), 1f);
 
     sm = models.next();
     assertFalse(sm instanceof SimilarityScoreModel);
diff --git a/test/jalview/gui/CalculationChooserTest.java b/test/jalview/gui/CalculationChooserTest.java
new file mode 100644 (file)
index 0000000..6c2e777
--- /dev/null
@@ -0,0 +1,98 @@
+package jalview.gui;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertSame;
+
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.api.analysis.ScoreModelI;
+import jalview.bin.Cache;
+
+import java.util.List;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class CalculationChooserTest
+{
+  @BeforeClass(alwaysRun = true)
+  public void setUp()
+  {
+    // read-only Jalview properties
+    Cache.loadProperties("test/jalview/io/testProps.jvprops");
+    Cache.applicationProperties.setProperty("BLOSUM62_PCA_FOR_NUCLEOTIDE",
+            Boolean.FALSE.toString());
+  }
+
+  @Test(groups = "Functional")
+  public void testGetApplicableScoreModels()
+  {
+    ScoreModels models = ScoreModels.getInstance();
+    ScoreModelI blosum62 = models.getBlosum62();
+    ScoreModelI pam250 = models.getPam250();
+    ScoreModelI dna = models.getDefaultModel(false);
+
+    /*
+     * peptide models for PCA
+     */
+    List<ScoreModelI> filtered = CalculationChooser
+            .getApplicableScoreModels(false, true);
+    assertEquals(filtered.size(), 4);
+    assertSame(filtered.get(0), blosum62);
+    assertSame(filtered.get(1), pam250);
+    assertEquals(filtered.get(2).getName(), "PID");
+    assertEquals(filtered.get(3).getName(), "Sequence Feature Similarity");
+
+    /*
+     * peptide models for Tree are the same
+     */
+    filtered = CalculationChooser.getApplicableScoreModels(false, false);
+    assertEquals(filtered.size(), 4);
+    assertSame(filtered.get(0), blosum62);
+    assertSame(filtered.get(1), pam250);
+    assertEquals(filtered.get(2).getName(), "PID");
+    assertEquals(filtered.get(3).getName(), "Sequence Feature Similarity");
+
+    /*
+     * nucleotide models for PCA
+     */
+    filtered = CalculationChooser.getApplicableScoreModels(true, true);
+    assertEquals(filtered.size(), 3);
+    assertSame(filtered.get(0), dna);
+    assertEquals(filtered.get(1).getName(), "PID");
+    assertEquals(filtered.get(2).getName(), "Sequence Feature Similarity");
+
+    /*
+     * nucleotide models for Tree are the same
+     */
+    filtered = CalculationChooser.getApplicableScoreModels(true, false);
+    assertEquals(filtered.size(), 3);
+    assertSame(filtered.get(0), dna);
+    assertEquals(filtered.get(1).getName(), "PID");
+    assertEquals(filtered.get(2).getName(), "Sequence Feature Similarity");
+
+    /*
+     * enable inclusion of BLOSUM62 for nucleotide PCA (JAL-2962)
+     */
+    Cache.applicationProperties.setProperty("BLOSUM62_PCA_FOR_NUCLEOTIDE",
+            Boolean.TRUE.toString());
+
+    /*
+     * nucleotide models for Tree are unchanged
+     */
+    filtered = CalculationChooser.getApplicableScoreModels(true, false);
+    assertEquals(filtered.size(), 3);
+    assertSame(filtered.get(0), dna);
+    assertEquals(filtered.get(1).getName(), "PID");
+    assertEquals(filtered.get(2).getName(), "Sequence Feature Similarity");
+
+    /*
+     * nucleotide models for PCA add BLOSUM62 as last option
+     */
+    filtered = CalculationChooser.getApplicableScoreModels(true, true);
+    assertEquals(filtered.size(), 4);
+    assertSame(filtered.get(0), dna);
+    assertEquals(filtered.get(1).getName(), "PID");
+    assertEquals(filtered.get(2).getName(), "Sequence Feature Similarity");
+    assertSame(filtered.get(3), blosum62);
+  }
+}
index 53bb0e7..3baacc8 100644 (file)
@@ -26,32 +26,41 @@ import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertSame;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
+import jalview.analysis.PCA;
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.FeatureColourI;
 import jalview.api.ViewStyleI;
+import jalview.bin.Cache;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.HiddenSequences;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.PDBEntry.Type;
+import jalview.datamodel.Point;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
+import jalview.datamodel.SequencePoint;
 import jalview.datamodel.features.FeatureMatcher;
 import jalview.datamodel.features.FeatureMatcherSet;
 import jalview.datamodel.features.FeatureMatcherSetI;
 import jalview.gui.AlignFrame;
 import jalview.gui.AlignViewport;
 import jalview.gui.AlignmentPanel;
+import jalview.gui.CalculationChooser;
 import jalview.gui.Desktop;
 import jalview.gui.FeatureRenderer;
 import jalview.gui.Jalview2XML;
 import jalview.gui.JvOptionPane;
+import jalview.gui.PCAPanel;
 import jalview.gui.PopupMenu;
+import jalview.gui.RotatableCanvas;
 import jalview.gui.SliderPanel;
+import jalview.math.MatrixTest;
 import jalview.renderer.ResidueShaderI;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.BuriedColourScheme;
@@ -65,6 +74,7 @@ import jalview.schemes.TCoffeeColourScheme;
 import jalview.structure.StructureImportSettings;
 import jalview.util.matcher.Condition;
 import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.PCAModel;
 
 import java.awt.Color;
 import java.io.File;
@@ -74,14 +84,31 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.swing.JInternalFrame;
+import javax.swing.JRadioButton;
+
 import org.testng.Assert;
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import junit.extensions.PA;
+
 @Test(singleThreaded = true)
 public class Jalview2xmlTests extends Jalview2xmlBase
 {
+  @BeforeClass(alwaysRun = true)
+  public void setUp()
+  {
+    Cache.loadProperties("test/jalview/io/testProps.jvprops");
+  }
+
+  @BeforeMethod(alwaysRun = true)
+  public void setUpMethod()
+  {
+    Desktop.instance.closeAll_actionPerformed(null);
+  }
 
   @Override
   @BeforeClass(alwaysRun = true)
@@ -1035,4 +1062,134 @@ public class Jalview2xmlTests extends Jalview2xmlBase
     addFeature(seq, featureType, score++);
     addFeature(seq, featureType, score);
   }
+
+  /**
+   * Test save and reload of a PCA viewer
+   * 
+   * @throws IOException
+   */
+  @Test(groups = { "Functional" })
+  public void testSaveLoadPCA() throws IOException
+  {
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/uniref50.fa", DataSourceType.FILE);
+    assertEquals(af.getViewport().getAlignment().getHeight(), 15);
+
+    /*
+     * calculate and open PCA (calculates in a separate thread)
+     */
+    CalculationChooser chooser = new CalculationChooser(af);
+    ((JRadioButton) PA.getValue(chooser, "pca")).setSelected(true);
+    PA.invokeMethod(chooser, "calculate_actionPerformed()");
+    PCAPanel pcaPanel = (PCAPanel) PA.getValue(chooser, "pcaPanel");
+    assertNotNull(pcaPanel);
+    waitFor(50); // let it get started!!
+    while (pcaPanel.isWorking())
+    {
+      waitFor(50);
+    }
+    PA.invokeMethod(chooser, "close_actionPerformed()");
+
+    /*
+     * rotate, zoom in, change background colour
+     */
+    RotatableCanvas rc = (RotatableCanvas) PA.getValue(pcaPanel, "rc");
+    PA.setValue(rc, "bgColour", Color.PINK);
+    rc.zoom(1.9f);
+    rc.rotate(20, 40f);
+
+    /*
+     * save as Jalview project
+     */
+    File tfile = File.createTempFile("JalviewTest", ".jvp");
+    tfile.deleteOnExit();
+    String filePath = tfile.getAbsolutePath();
+    assertTrue(af.saveAlignment(filePath, FileFormat.Jalview),
+            "Failed to store as a project.");
+  
+    /*
+     * load the saved project and locate the restored PCA panel
+     */
+    new FileLoader().LoadFileWaitTillLoaded(filePath, DataSourceType.FILE);
+    JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+    PCAPanel pcaPanel2 = null;
+    for (JInternalFrame frame : frames)
+    {
+      if (frame instanceof PCAPanel && frame != pcaPanel)
+      {
+        pcaPanel2 = (PCAPanel) frame;
+      }
+    }
+    assertNotNull(pcaPanel2);
+
+    /*
+     * compare restored and original PCA
+     */
+    PCAModel pcaModel = (PCAModel) PA.getValue(pcaPanel, "pcaModel");
+    PCAModel pcaModel2 = (PCAModel) PA.getValue(pcaPanel2, "pcaModel");
+    RotatableCanvas rc2 = (RotatableCanvas) PA.getValue(pcaPanel2, "rc");
+    assertNotNull(pcaModel);
+    assertNotNull(pcaModel2);
+    assertNotNull(rc2);
+    assertEquals(rc2.getBackgroundColour(), Color.PINK);
+    assertEquals(PA.getValue(rc2, "scaleFactor"), 1.9f);
+
+    // original has input data
+    assertNotNull(pcaModel.getInputData());
+    // restored has no input data (JAL-2647 to do)
+    assertNull(pcaModel2.getInputData());
+
+    // verify sequence points are at the same positions
+    List<SequencePoint> seqPts = pcaModel.getSequencePoints();
+    List<SequencePoint> seqPts2 = pcaModel2.getSequencePoints();
+    assertEquals(seqPts.size(), seqPts2.size());
+    for (int i = 0; i < seqPts.size(); i++)
+    {
+      SequencePoint sp = seqPts.get(i);
+      SequencePoint sp2 = seqPts2.get(i);
+      assertEquals(sp.getSequence().getName(), sp2.getSequence().getName());
+      assertEquals(sp.coord, sp2.coord);
+    }
+
+    // verify axis end points are at the same positions
+    Point[] axes = (Point[]) PA.getValue(rc, "axisEndPoints");
+    Point[] axes2 = (Point[]) PA.getValue(rc2, "axisEndPoints");
+    assertEquals(axes.length, 3);
+    assertEquals(axes2.length, 3);
+    for (int i = 0; i < 3; i++)
+    {
+      assertEquals(axes[i], axes2[i]);
+    }
+
+    // compare PCA data
+    PCA pca = (PCA) PA.getValue(pcaModel, "pca");
+    PCA pca2 = (PCA) PA.getValue(pcaModel2, "pca");
+    assertNotNull(pca);
+    assertNotNull(pca2);
+    // same (BLOSUM62) score model (a singleton object)
+    assertSame(PA.getValue(pca, "scoreModel"),
+            PA.getValue(pca2, "scoreModel"));
+    assertEquals(PA.getValue(pca, "similarityParams"),
+            PA.getValue(pca2, "similarityParams"));
+    MatrixTest.assertMatricesMatch(pca.getPairwiseScores(),
+            pca2.getPairwiseScores());
+    MatrixTest.assertMatricesMatch(pca.getTridiagonal(),
+            pca2.getTridiagonal());
+    MatrixTest.assertMatricesMatch(pca.getEigenmatrix(),
+            pca2.getEigenmatrix());
+  }
+
+  protected void waitFor(long t)
+  {
+    synchronized (this)
+    {
+      try
+      {
+        wait(t);
+      } catch (InterruptedException e)
+      {
+        fail(e.getMessage());
+      }
+    }
+  }
 }
index 97ded5a..2cde593 100644 (file)
@@ -188,9 +188,23 @@ public class MatrixTest
       }
     }
     Matrix m1 = new Matrix(in);
+
     Matrix m2 = (Matrix) m1.copy();
     assertNotSame(m1, m2);
     assertTrue(matrixEquals(m1, m2));
+    assertNull(m2.d);
+    assertNull(m2.e);
+
+    /*
+     * now add d and e vectors and recopy
+     */
+    m1.d = Arrays.copyOf(in[2], in[2].length);
+    m1.e = Arrays.copyOf(in[4], in[4].length);
+    m2 = (Matrix) m1.copy();
+    assertNotSame(m2.d, m1.d);
+    assertNotSame(m2.e, m1.e);
+    assertEquals(m2.d, m1.d);
+    assertEquals(m2.e, m1.e);
   }
 
   /**
@@ -356,7 +370,7 @@ public class MatrixTest
     assertMatricesMatch(m1, m2);
   }
 
-  private void assertMatricesMatch(MatrixI m1, MatrixI m2)
+  public static void assertMatricesMatch(MatrixI m1, MatrixI m2)
   {
     if (m1.height() != m2.height())
     {
@@ -378,8 +392,10 @@ public class MatrixTest
         }
       }
     }
-    ArrayAsserts.assertArrayEquals(m1.getD(), m2.getD(), 0.00001d);
-    ArrayAsserts.assertArrayEquals(m1.getE(), m2.getE(), 0.00001d);
+    ArrayAsserts.assertArrayEquals("D vector", m1.getD(), m2.getD(),
+            0.00001d);
+    ArrayAsserts.assertArrayEquals("E vector", m1.getE(), m2.getE(),
+            0.00001d);
   }
 
   @Test(groups = "Functional")
diff --git a/test/jalview/math/RotatableMatrixTest.java b/test/jalview/math/RotatableMatrixTest.java
new file mode 100644 (file)
index 0000000..06982d5
--- /dev/null
@@ -0,0 +1,157 @@
+package jalview.math;
+
+import static org.testng.Assert.assertEquals;
+
+import jalview.math.RotatableMatrix.Axis;
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class RotatableMatrixTest
+{
+  private RotatableMatrix rm;
+
+  @BeforeMethod(alwaysRun = true)
+  public void setUp()
+  {
+    rm = new RotatableMatrix();
+
+    /*
+     * 0.5 1.0 1.5
+     * 1.0 2.0 3.0
+     * 1.5 3.0 4.5
+     */
+    for (int i = 1; i <= 3; i++)
+    {
+      for (int j = 1; j <= 3; j++)
+      {
+        rm.setValue(i - 1, j - 1, i * j / 2f);
+      }
+    }
+  }
+
+  @Test(groups = "Functional")
+  public void testPreMultiply()
+  {
+    float[][] pre = new float[3][3];
+    int i = 1;
+    for (int j = 0; j < 3; j++)
+    {
+      for (int k = 0; k < 3; k++)
+      {
+        pre[j][k] = i++;
+      }
+    }
+
+    rm.preMultiply(pre);
+
+    /*
+     * check rm[i, j] is now the product of the i'th row of pre
+     * and the j'th column of (original) rm
+     */
+    for (int j = 0; j < 3; j++)
+    {
+      for (int k = 0; k < 3; k++)
+      {
+        float expected = 0f;
+        for (int l = 0; l < 3; l++)
+        {
+          float rm_l_k = (l + 1) * (k + 1) / 2f;
+          expected += pre[j][l] * rm_l_k;
+        }
+        assertEquals(rm.getValue(j, k), expected,
+                String.format("[%d, %d]", j, k));
+      }
+    }
+  }
+
+  @Test(groups = "Functional")
+  public void testVectorMultiply()
+  {
+    float[] result = rm.vectorMultiply(new float[] { 2f, 3f, 4.5f });
+
+    // vector times first column of matrix
+    assertEquals(result[0], 2f * 0.5f + 3f * 1f + 4.5f * 1.5f);
+
+    // vector times second column of matrix
+    assertEquals(result[1], 2f * 1.0f + 3f * 2f + 4.5f * 3f);
+
+    // vector times third column of matrix
+    assertEquals(result[2], 2f * 1.5f + 3f * 3f + 4.5f * 4.5f);
+  }
+
+  @Test(groups = "Functional")
+  public void testGetRotation()
+  {
+    float theta = 60f;
+    double cosTheta = Math.cos((theta * Math.PI / 180f));
+    double sinTheta = Math.sin((theta * Math.PI / 180f));
+
+    /*
+     * sanity check that sin(60) = sqrt(3) / 2, cos(60) = 1/2
+     */
+    double delta = 0.0001d;
+    assertEquals(cosTheta, 0.5f, delta);
+    assertEquals(sinTheta, Math.sqrt(3d) / 2d, delta);
+
+    /*
+     * so far so good, now verify rotations
+     * @see https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
+     */
+
+    /*
+     * 60 degrees about X axis should be
+     *  1   0   0 
+     *  0  cos -sin
+     *  0  sin cos
+     *  but code applies the negative of this
+     *  nb cos(-x) = cos(x), sin(-x) = -sin(x)
+     */
+    float[][] rot = RotatableMatrix.getRotation(theta, Axis.X);
+    assertEquals(rot[0][0], 1f, delta);
+    assertEquals(rot[0][1], 0f, delta);
+    assertEquals(rot[0][2], 0f, delta);
+    assertEquals(rot[1][0], 0f, delta);
+    assertEquals(rot[1][1], cosTheta, delta);
+    assertEquals(rot[1][2], sinTheta, delta);
+    assertEquals(rot[2][0], 0f, delta);
+    assertEquals(rot[2][1], -sinTheta, delta);
+    assertEquals(rot[2][2], cosTheta, delta);
+
+    /*
+     * 60 degrees about Y axis should be
+     *   cos 0 sin
+     *    0  1  0
+     *  -sin 0 cos
+     *  but code applies the negative of this
+     */
+    rot = RotatableMatrix.getRotation(theta, Axis.Y);
+    assertEquals(rot[0][0], cosTheta, delta);
+    assertEquals(rot[0][1], 0f, delta);
+    assertEquals(rot[0][2], -sinTheta, delta);
+    assertEquals(rot[1][0], 0f, delta);
+    assertEquals(rot[1][1], 1f, delta);
+    assertEquals(rot[1][2], 0f, delta);
+    assertEquals(rot[2][0], sinTheta, delta);
+    assertEquals(rot[2][1], 0f, delta);
+    assertEquals(rot[2][2], cosTheta, delta);
+
+    /*
+     * 60 degrees about Z axis should be
+     *  cos -sin 0
+     *  sin  cos 0
+     *   0    0  1
+     * - and it is!
+     */
+    rot = RotatableMatrix.getRotation(theta, Axis.Z);
+    assertEquals(rot[0][0], cosTheta, delta);
+    assertEquals(rot[0][1], -sinTheta, delta);
+    assertEquals(rot[0][2], 0f, delta);
+    assertEquals(rot[1][0], sinTheta, delta);
+    assertEquals(rot[1][1], cosTheta, delta);
+    assertEquals(rot[1][2], 0f, delta);
+    assertEquals(rot[2][0], 0f, delta);
+    assertEquals(rot[2][1], 0f, delta);
+    assertEquals(rot[2][2], 1f, delta);
+  }
+}