+ appLoader = new JalviewAppLoader(true);
+ appLoader.load(app);
+ }
+
+ /**
+ *
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequences()
+ */
+ @Override
+ public String getSelectedSequences()
+ {
+ return getSelectedSequencesFrom(getCurrentAlignFrame());
+ }
+
+ /**
+ *
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequences(java.lang.String)
+ */
+ @Override
+ public String getSelectedSequences(String sep)
+ {
+ return getSelectedSequencesFrom(getCurrentAlignFrame(), sep);
+ }
+
+ /**
+ *
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesFrom(jalview.appletgui
+ * .AlignFrame)
+ */
+ @Override
+ public String getSelectedSequencesFrom(AlignFrameI alf)
+ {
+ return getSelectedSequencesFrom(alf, null);
+ }
+
+ /**
+ *
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesFrom(jalview.appletgui
+ * .AlignFrame, java.lang.String)
+ */
+ @Override
+ public String getSelectedSequencesFrom(AlignFrameI alf, String sep)
+ {
+ return appLoader.getSelectedSequencesFrom(alf, sep);
+ }
+
+ /**
+ *
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesFrom(jalview.appletgui
+ * .AlignFrame, java.lang.String)
+ */
+ @Override
+ public void highlight(String sequenceId, String position,
+ String alignedPosition)
+ {
+ highlightIn(getCurrentAlignFrame(), sequenceId, position,
+ alignedPosition);
+ }
+
+ @Override
+ public void highlightIn(AlignFrameI alf, String sequenceId,
+ String position, String alignedPosition)
+ {
+ appLoader.highlightIn(alf, sequenceId, position, alignedPosition);
+ }
+
+ @Override
+ public void select(String sequenceIds, String columns)
+ {
+ selectIn(getCurrentAlignFrame(), sequenceIds, columns, null);
+ }
+
+ @Override
+ public void select(String sequenceIds, String columns, String sep)
+ {
+ selectIn(getCurrentAlignFrame(), sequenceIds, columns, sep);
+ }
+
+ @Override
+ public void selectIn(AlignFrameI alf, String sequenceIds, String columns)
+ {
+ selectIn(alf, sequenceIds, columns, null);
+ }
+
+ @Override
+ public void selectIn(AlignFrameI alf, String sequenceIds, String columns,
+ String sep)
+ {
+ appLoader.selectIn(alf, sequenceIds, columns, sep);
+ }
+
+ @Override
+ public String getSelectedSequencesAsAlignment(String format,
+ String suffix)
+ {
+ return getSelectedSequencesAsAlignmentFrom(getCurrentAlignFrame(),
+ format, suffix);
+ }
+
+ @Override
+ public String getSelectedSequencesAsAlignmentFrom(AlignFrameI alf,
+ String format, String sep)
+ {
+ return appLoader.getSelectedSequencesAsAlignmentFrom(alf, format, sep);
+ }
+
+ @Override
+ public String getAlignmentOrder()
+ {
+ return getAlignmentFrom(getCurrentAlignFrame(), null);
+ }
+
+ @Override
+ public String getAlignmentOrderFrom(AlignFrameI alf)
+ {
+ return getAlignmentFrom(alf, null);
+ }
+
+ @Override
+ public String getAlignmentOrderFrom(AlignFrameI alf, String sep)
+ {
+ return appLoader.getAlignmentOrderFrom(alf, sep);
+ }
+
+ @Override
+ public String orderBy(String order, String undoName)
+ {
+ return orderBy(order, undoName, null);
+ }
+
+ @Override
+ public String orderBy(String order, String undoName, String sep)
+ {
+ return orderAlignmentBy(getCurrentAlignFrame(), order, undoName, sep);
+ }
+
+ @Override
+ public String orderAlignmentBy(AlignFrameI alf, String order,
+ String undoName, String sep)
+ {
+ return appLoader.orderAlignmentBy(alf, order, undoName, sep);
+ }
+
+ @Override
+ public String getAlignment(String format)
+ {
+ return getAlignmentFrom(null, format, null);
+ }
+
+ @Override
+ public String getAlignmentFrom(AlignFrameI alf, String format)
+ {
+ return getAlignmentFrom(alf, format, null);
+ }
+
+ @Override
+ public String getAlignment(String format, String suffix)
+ {
+ return getAlignmentFrom(getCurrentAlignFrame(), format, suffix);
+ }
+
+ @Override
+ public String getAlignmentFrom(AlignFrameI alf, String format,
+ String suffix)
+ {
+ return appLoader.getAlignmentFrom(alf, format, suffix);
+ }
+
+ @Override
+ public void loadAnnotation(String annotation)
+ {
+ loadAnnotationFrom(getCurrentAlignFrame(), annotation);
+ }
+
+ @Override
+ public void loadAnnotationFrom(AlignFrameI alf, String annotation)
+ {
+ appLoader.loadAnnotationFrom(alf, annotation);
+ }
+
+ @Override
+ public void loadFeatures(String features, boolean autoenabledisplay)
+ {
+ loadFeaturesFrom(currentAlignFrame, features, autoenabledisplay);
+ }
+
+ @Override
+ public boolean loadFeaturesFrom(AlignFrameI alf, String features,
+ boolean autoenabledisplay)
+ {
+ return appLoader.loadFeaturesFrom(alf, features, autoenabledisplay);
+ }
+
+ @Override
+ public String getFeatures(String format)
+ {
+ return getFeaturesFrom(getCurrentAlignFrame(), format);
+ }
+
+ @Override
+ public String getFeaturesFrom(AlignFrameI alf, String format)
+ {
+ return appLoader.getFeaturesFrom(alf, format);
+ }
+
+ @Override
+ public String getAnnotation()
+ {
+ return getAnnotationFrom(getCurrentAlignFrame());
+ }
+
+ @Override
+ public String getAnnotationFrom(AlignFrameI alf)
+ {
+ return appLoader.getAnnotationFrom(alf);
+ }
+
+ @Override
+ public AlignFrameI newView()
+ {
+ return newViewFrom(getCurrentAlignFrame(), null);
+ }
+
+ @Override
+ public AlignFrameI newView(String name)
+ {
+ return newViewFrom(getCurrentAlignFrame(), name);
+ }
+
+ @Override
+ public AlignFrameI newViewFrom(AlignFrameI alf)
+ {
+ return newViewFrom(alf, null);
+ }
+
+ @Override
+ public AlignFrameI newViewFrom(AlignFrameI alf, String name)
+ {
+ return appLoader.newViewFrom(alf, name);
+ }
+
+ @Override
+ public AlignFrameI loadAlignment(String text, String title)
+ {
+ return appLoader.loadAlignment(text, AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT, title);
+ }
+
+ @Override
+ public boolean addPdbFile(AlignFrameI alFrame, String sequenceId,
+ String pdbEntryString, String pdbFile)
+ {
+ return appLoader.addPdbFile(alFrame, sequenceId, pdbEntryString,
+ pdbFile);
+ }
+
+ @Override
+ public void scrollViewToIn(AlignFrameI alf, String topRow,
+ String leftHandColumn)
+ {
+ appLoader.scrollViewToIn(alf, topRow, leftHandColumn);
+ }
+
+ @Override
+ public void scrollViewToRowIn(AlignFrameI alf, String topRow)
+ {
+ appLoader.scrollViewToRowIn(alf, topRow);
+ }
+
+ @Override
+ public void scrollViewToColumnIn(AlignFrameI alf, String leftHandColumn)
+ {
+ appLoader.scrollViewToColumnIn(alf, leftHandColumn);
+ }
+
+ @Override
+ public String getFeatureGroups()
+ {
+ return getFeatureGroupsOn(getCurrentAlignFrame());
+ }
+
+ @Override
+ public String getFeatureGroupsOn(AlignFrameI alf)
+ {
+ return appLoader.getFeatureGroupsOn(alf);
+ }
+
+ @Override
+ public String getFeatureGroupsOfState(boolean visible)
+ {
+ return getFeatureGroupsOfStateOn(getCurrentAlignFrame(), visible);
+ }
+
+ @Override
+ public String getFeatureGroupsOfStateOn(AlignFrameI alf, boolean visible)
+ {
+ return appLoader.getFeatureGroupsOfStateOn(alf, visible);
+ }
+
+ @Override
+ public void setFeatureGroupStateOn(AlignFrameI alf, String groups,
+ boolean state)
+ {
+ setFeatureGroupStateOn(alf, groups, state);
+ }
+
+ @Override
+ public void setFeatureGroupState(String groups, boolean state)
+ {
+ appLoader.setFeatureGroupStateOn(getCurrentAlignFrame(), groups, state);
+ }
+
+ @Override
+ public String getSeparator()
+ {
+ return appLoader.getSeparator();
+ }
+
+ @Override
+ public void setSeparator(String separator)
+ {
+ appLoader.setSeparator(separator);
+ }
+
+ @Override
+ public String getJsMessage(String messageclass, String viewId)
+ {
+ // see http://www.jalview.org/examples/jalviewLiteJs.html
+ return null;
+ }
+
+ /**
+ * Open a new Tree panel on the desktop statically. Params are standard (not
+ * set by Groovy). No dialog is opened.
+ *
+ * @param af
+ * @param treeType
+ * @param modelName
+ * @return null, or the string "label.you_need_at_least_n_sequences" if number
+ * of sequences selected is inappropriate
+ */
+ @Override
+ public Object openTreePanel(AlignFrame af, String treeType,
+ String modelName)
+ {
+ return CalculationChooser.openTreePanel(af, treeType, modelName, null);
+ }
+
+ /**
+ * public static method for JalviewJS API to open a PCAPanel without
+ * necessarily using a dialog.
+ *
+ * @param af
+ * @param modelName
+ * @return the PCAPanel, or the string "label.you_need_at_least_n_sequences"
+ * if number of sequences selected is inappropriate
+ */
+ @Override
+ public Object openPcaPanel(AlignFrame af, String modelName)
+ {
+ return CalculationChooser.openPcaPanel(af, modelName, null);
+ }
+
+ @Override
+ public String getSelectedSequencesAsAlignment(String format,
+ boolean suffix)
+ {
+ return getSelectedSequencesAsAlignmentFrom(getCurrentAlignFrame(),
+ format, suffix);
+ }
+
+ @Override
+ public String getSelectedSequencesAsAlignmentFrom(AlignFrameI alf,
+ String format, boolean suffix)
+ {
+ return appLoader.getSelectedSequencesAsAlignmentFrom(alf, format,
+ "" + suffix);
+ }
+
+ @Override
+ public String arrayToSeparatorList(String[] array)
+ {
+ return appLoader.arrayToSeparatorList(array);
+ }
+
+ @Override
+ public String[] separatorListToArray(String list)
+ {
+ return appLoader.separatorListToArray(list);
+ }
+
+ //// probably not needed in JalviewJS -- From when Jmol and Jalview did not
+ //// have a direct connection?
+
+ @Override
+ public void setMouseoverListener(String listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setMouseoverListener(AlignFrameI af, String listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setSelectionListener(String listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setSelectionListener(AlignFrameI af, String listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setStructureListener(String listener, String modelSet)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void removeJavascriptListener(AlignFrameI af, String listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseOverStructure(String pdbResNum, String chain,
+ String pdbfile)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void showOverview()
+ {
+ currentAlignFrame.overviewMenuItem_actionPerformed(null);
+ }
+
+ public void notifyWorker(AlignCalcWorkerI worker, String status)
+ {
+ // System.out.println("Jalview worker " + worker.getClass().getSimpleName()
+ // + " " + status);