import jalview.analysis.AlignmentUtils;
import jalview.datamodel.AlignmentI;
import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
import jalview.gui.SplitFrame;
- import jalview.io.AppletFormatAdapter;
import jalview.io.DataSourceType;
import jalview.io.FileFormatException;
import jalview.io.FileFormatI;
// TODO or format as file=/examples/uniref50.fa (etc)?
public class JalviewJS
{
+
+ static
+ {
+ /**
+ * @j2sNative
+ *
+ * thisApplet.__Info.args =
+ * ["file","examples/uniref50.fa","features",
+ * "examples/exampleFeatures.txt",
+ * "props","/Users/gmcarstairs/.jalview_properties"];
+ */
+
+ }
+
private static final String PARAM_FILE = "file";
private static final String PARAM_FILE2 = "file2";
/*
* convert to SplitFrame if a valid file2 is supplied
*/
+ int height = AlignFrame.DEFAULT_HEIGHT;
AlignFrame alignFrame2 = createAlignFrame(PARAM_FILE2);
if (alignFrame2 != null)
{
if (splitFrame != null)
{
internalFrame = splitFrame;
+ height *= 2;
}
}
// fudge so that dialogs can be opened with this frame as parent
// todo JAL-3031 also override Desktop.addInternalFrame etc
- // Desktop.parent = frame.getContentPane();
+ Desktop.parent = frame.getContentPane();
frame.pack();
- frame.setSize(AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+ frame.setSize(AlignFrame.DEFAULT_WIDTH, height);
frame.setVisible(true);
}
// todo extract helper for protocol resolution from JalviewLite
DataSourceType sourceType = featureFile.startsWith("http")
? DataSourceType.URL
- : DataSourceType.FILE;
+ : DataSourceType.LOCALURL;
alignFrame.parseFeaturesFile(featureFile, sourceType);
}
}
String file = getParameter(fileParam);
if (file != null)
{
- DataSourceType protocol = AppletFormatAdapter.checkProtocol(file);
+ DataSourceType protocol = file.startsWith("http") ? DataSourceType.URL
+ : DataSourceType.LOCALURL;
+ // DataSourceType protocol = AppletFormatAdapter.checkProtocol(file);
FileFormatI format = new IdentifyFile().identify(file, protocol);
FileLoader fileLoader = new FileLoader(false);
af = fileLoader.LoadFileWaitTillLoaded(file, protocol, format);