package jalview.bin;
import jalview.api.AlignFrameI;
import jalview.api.JalviewApp;
import jalview.api.StructureSelectionManagerProvider;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.gui.Desktop;
import jalview.io.AnnotationFile;
import jalview.io.AppletFormatAdapter;
import jalview.io.DataSourceType;
import jalview.io.FeaturesFile;
import jalview.io.FileFormat;
import jalview.io.FileFormatI;
import jalview.io.FileFormats;
import jalview.io.IdentifyFile;
import jalview.io.JPredFile;
import jalview.io.JnetAnnotationMaker;
import jalview.io.NewickFile;
import jalview.structure.SelectionSource;
import jalview.structure.StructureSelectionManager;
import jalview.util.HttpUtils;
import jalview.util.MessageManager;
import java.awt.EventQueue;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
/**
* A class to load parameters for either JalviewLite or Jalview
*
* @author hansonr
*
*/
public class JalviewAppLoader
{
private JalviewApp app; // Jalview or JalviewJS or JalviewLite
private boolean debug;
String separator = "\u00AC"; // JalviewLite note: the default used to
// be '|', but many sequence IDS include
// pipes.
public String getSeparator()
{
return separator;
}
public void setSeparator(String separator)
{
this.separator = separator;
}
public JalviewAppLoader(boolean debug)
{
this.debug = debug;
}
public void load(JalviewApp app)
{
this.app = app;
String sep = app.getParameter("separator");
if (sep != null)
{
if (sep.length() > 0)
{
separator = sep;
}
else
{
throw new Error(MessageManager
.getString("error.invalid_separator_parameter"));
}
}
loadTree();
loadScoreFile();
loadFeatures();
loadAnnotations();
loadJnetFile();
loadPdbFiles();
callInitCallback();
}
/**
* Load PDBFiles if any specified by parameter(s). Returns true if loaded,
* else false.
*
* @param loaderFrame
* @return
*/
protected boolean loadPdbFiles()
{
boolean result = false;
/*
* Undocumented for 2.6 -
* related to JAL-434
*/
boolean doAlign = app.getDefaultParameter("alignpdbfiles", false);
app.setAlignPdbStructures(doAlign);
/*
*
*
*
*
*
*/
// Accumulate pdbs here if they are heading for the same view (if
// alignPdbStructures is true)
Vector