package jalview.bin;
import jalview.api.JalviewApp;
import jalview.api.StructureSelectionManagerProvider;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.io.AnnotationFile;
import jalview.io.DataSourceType;
import jalview.io.JPredFile;
import jalview.io.JnetAnnotationMaker;
import jalview.io.NewickFile;
import jalview.structure.StructureSelectionManager;
import jalview.util.HttpUtils;
import jalview.util.MessageManager;
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;
private boolean debug;
private String 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();
}
/**
* 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);
/*
*
*
*
*
*
*/
int pdbFileCount = 0;
// Accumulate pdbs here if they are heading for the same view (if
// alignPdbStructures is true)
Vector