import jalview.api.FeaturesSourceI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentAnnotation.TFType;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
private File selectedFile;
+ private AlignmentAnnotation.TFType temperatureFactorType = null;
+
/**
* default constructor always raised errors in GUI dialog boxes
*/
DataSourceType protocol, FileFormatI format)
{
this.viewport = viewport;
- if (file instanceof File) {
+ if (file instanceof File)
+ {
this.selectedFile = (File) file;
file = selectedFile.getPath();
}
public AlignFrame LoadFileWaitTillLoaded(String file,
DataSourceType sourceType, FileFormatI format)
{
+ return LoadFileWaitTillLoaded(file, sourceType, format, null);
+ }
+
+ /**
+ * Load alignment from (file, protocol) of type format with specified
+ * temperature factor type and wait till loaded
+ *
+ * @param file
+ * @param sourceType
+ * @param format
+ * @param tempfacType
+ * @return alignFrame constructed from file contents
+ */
+ public AlignFrame LoadFileWaitTillLoaded(String file,
+ DataSourceType sourceType, FileFormatI format, AlignmentAnnotation.TFType tempfacType)
+ {
this.file = file;
this.protocol = sourceType;
this.format = format;
+ this.temperatureFactorType = tempfacType;
return _LoadFileWaitTillLoaded();
}
? "Copied From Clipboard"
: file;
Runtime rt = Runtime.getRuntime();
+
try
{
if (Desktop.instance != null)
format = new IdentifyFile().identify(source, false);
// identify stream and rewind rather than close
}
- else if (selectedFile != null) {
+ else if (selectedFile != null)
+ {
format = new IdentifyFile().identify(selectedFile, protocol);
}
else
// We read the data anyway - it might make sense.
}
// BH 2018 switch to File object here instead of filename
- alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(selectedFile == null ? file : selectedFile);
+ alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(
+ selectedFile == null ? file : selectedFile);
}
else
{
file.lastIndexOf("."));
String tempStructureFileStr = createNamedJvTempFile(
urlLeafName, structExt);
-
+
// BH - switching to File object here so as to hold
// ._bytes array directly
File tempFile = new File(tempStructureFileStr);
UrlDownloadClient.download(file, tempFile);
-
- al = fa.readFile(tempFile, DataSourceType.FILE,
- format);
+
+ al = fa.readFile(tempFile, DataSourceType.FILE, format);
source = fa.getAlignFile();
}
else
{
- if (selectedFile == null) {
- al = fa.readFile(file, protocol, format);
-
- } else {
- al = fa.readFile(selectedFile, protocol, format);
- }
+ if (selectedFile == null)
+ {
+ al = fa.readFile(null, file, protocol, format,
+ temperatureFactorType);
+
+ }
+ else
+ {
+ al = fa.readFile(selectedFile, null, protocol, format,
+ temperatureFactorType);
+ }
source = fa.getAlignFile(); // keep reference for later if
-
- // necessary.
+
+ // necessary.
}
}
} catch (java.io.IOException ex)
try
{
- alignFrame.setMaximum(Cache
- .getDefault("SHOW_FULLSCREEN", false));
+ alignFrame.setMaximum(
+ Cache.getDefault("SHOW_FULLSCREEN", false));
} catch (java.beans.PropertyVetoException ex)
{
}