JAL-629 Test tidyup
[jalview.git] / src / jalview / io / StructureFile.java
index 94a832b..f498c1e 100644 (file)
  */
 package jalview.io;
 
+import java.awt.Color;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.List;
+import java.util.Vector;
+
 import jalview.analysis.AlignSeq;
 import jalview.api.FeatureSettingsModelI;
 import jalview.datamodel.Alignment;
@@ -31,13 +37,7 @@ import jalview.datamodel.PDBEntry;
 import jalview.datamodel.PDBEntry.Type;
 import jalview.datamodel.SequenceI;
 import jalview.structure.StructureImportSettings;
-
-import java.awt.Color;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.List;
-import java.util.Vector;
-
+import jalview.structure.StructureImportSettings.TFType;
 import mc_view.PDBChain;
 
 public abstract class StructureFile extends AlignFile
@@ -68,10 +68,59 @@ public abstract class StructureFile extends AlignFile
 
   private boolean pdbIdAvailable;
 
+  private StructureImportSettings.TFType temperatureFactorType = TFType.DEFAULT;
+
+  private String paeMatrix = null;
+
+  private boolean alphaFoldModel;
+
+  public void setPAEMatrix(String paeFilename)
+  {
+    paeMatrix = paeFilename;
+  }
+
+  public String getPAEMatrix()
+  {
+    return paeMatrix;
+  }
+
+  public boolean hasPAEMatrix()
+  {
+    return paeMatrix != null;
+  }
+
+  public void setTemperatureFactorType(StructureImportSettings.TFType t)
+  {
+    this.temperatureFactorType = t;
+  }
+
+  public StructureImportSettings.TFType getTemperatureFactorType()
+  {
+    return temperatureFactorType;
+  }
+
+  public void setAlphafoldModel(boolean afm)
+  {
+    alphaFoldModel = afm;
+  }
+
+  public boolean isAlphafoldModel()
+  {
+    return alphaFoldModel;
+  }
+
   public StructureFile(Object inFile, DataSourceType sourceType)
           throws IOException
   {
-    super(inFile, sourceType);
+    this(inFile, sourceType, null);
+  }
+
+  public StructureFile(Object inFile, DataSourceType sourceType,
+          StructureImportSettings.TFType tempfacType) throws IOException
+  {
+    super(false, inFile, sourceType);
+    this.setTemperatureFactorType(tempfacType);
+    doParse();
   }
 
   public StructureFile(FileParse fp) throws IOException
@@ -95,7 +144,8 @@ public abstract class StructureFile extends AlignFile
             .isProcessSecondaryStructure();
     this.externalSecondaryStructure = StructureImportSettings
             .isExternalSecondaryStructure();
-
+    this.temperatureFactorType = StructureImportSettings
+            .getTemperatureFactorType();
   }
 
   public StructureFile(boolean parseImmediately, Object dataObject,
@@ -319,6 +369,8 @@ public abstract class StructureFile extends AlignFile
                 .setProcessSecondaryStructure(predictSecondaryStructure);
         StructureImportSettings
                 .setExternalSecondaryStructure(externalSecondaryStructure);
+        StructureImportSettings
+                .setTemperatureFactorType(temperatureFactorType);
         Object jmf = constructor.newInstance(args);
         AlignmentI al = new Alignment((SequenceI[]) cl
                 .getMethod("getSeqsAsArray", new Class[] {}).invoke(jmf));
@@ -342,10 +394,10 @@ public abstract class StructureFile extends AlignFile
     }
     StructureImportSettings.setShowSeqFeatures(true);
   }
-  
+
   /**
-   * Answers the first PDBChain found matching the given id, or null if none 
-   * is found
+   * Answers the first PDBChain found matching the given id, or null if none is
+   * found
    * 
    * @param id
    * @return