import jalview.io.IdentifyFile;\r
import jalview.io.JnetAnnotationMaker;\r
import jalview.javascript.JSFunctionExec;\r
+import jalview.javascript.JalviewLiteJsApi;\r
import jalview.javascript.JsCallBack;\r
import jalview.structure.SelectionListener;\r
import jalview.structure.StructureSelectionManager;\r
* @author $author$\r
* @version $Revision: 1.92 $\r
*/\r
-public class JalviewLite extends Applet implements StructureSelectionManagerProvider\r
+public class JalviewLite extends Applet implements StructureSelectionManagerProvider, JalviewLiteJsApi\r
{\r
\r
// /////////////////////////////////////////\r
// The following public methods maybe called\r
// externally, eg via javascript in HTML page\r
- /**\r
- * @return String list of selected sequence IDs, each terminated by the\r
- * 'boolean not' character (""+0x00AC) or (¬)\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequences()\r
*/\r
public String getSelectedSequences()\r
{\r
return getSelectedSequencesFrom(getDefaultTargetFrame());\r
}\r
\r
- /**\r
- * @param sep\r
- * separator string or null for default\r
- * @return String list of selected sequence IDs, each terminated by given\r
- * separator string\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequences(java.lang.String)\r
*/\r
public String getSelectedSequences(String sep)\r
{\r
return getSelectedSequencesFrom(getDefaultTargetFrame(), sep);\r
}\r
\r
- /**\r
- * @param alf\r
- * alignframe containing selection\r
- * @return String list of selected sequence IDs, each terminated by current\r
- * default separator sequence\r
- * \r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesFrom(jalview.appletgui.AlignFrame)\r
*/\r
public String getSelectedSequencesFrom(AlignFrame alf)\r
{\r
return getSelectedSequencesFrom(alf, separator); // ""+0x00AC);\r
}\r
\r
- /**\r
- * get list of selected sequence IDs separated by given separator\r
- * \r
- * @param alf\r
- * window containing selection\r
- * @param sep\r
- * separator string to use - default is 'boolean not'\r
- * @return String list of selected sequence IDs, each terminated by the given\r
- * separator\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
*/\r
public String getSelectedSequencesFrom(AlignFrame alf, String sep)\r
{\r
return result.toString();\r
}\r
\r
- /**\r
- * \r
- * @param sequenceId\r
- * id of sequence to highlight\r
- * @param position\r
- * integer position [ tobe implemented or range ] on sequence\r
- * @param alignedPosition\r
- * true/false/empty string - indicate if position is an alignment\r
- * column or unaligned sequence position\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#highlight(java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public void highlight(String sequenceId, String position,\r
String alignedPosition)\r
alignedPosition);\r
}\r
\r
- /**\r
- * \r
- * @param sequenceId\r
- * id of sequence to highlight\r
- * @param position\r
- * integer position [ tobe implemented or range ] on sequence\r
- * @param alignedPosition\r
- * false, blank or something else - indicate if position is an\r
- * alignment column or unaligned sequence position\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#highlightIn(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public void highlightIn(AlignFrame alf, String sequenceId,\r
String position, String alignedPosition)\r
}\r
}\r
\r
- /**\r
- * select regions of the currrent alignment frame\r
- * \r
- * @param sequenceIds\r
- * String separated list of sequence ids or empty string\r
- * @param columns\r
- * String separated list { column range or column, ..} or empty\r
- * string\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#select(java.lang.String, java.lang.String)\r
*/\r
public void select(String sequenceIds, String columns)\r
{\r
selectIn(getDefaultTargetFrame(), sequenceIds, columns, separator);\r
}\r
\r
- /**\r
- * select regions of the currrent alignment frame\r
- * \r
- * @param toselect\r
- * String separated list { column range, seq1...seqn sequence ids }\r
- * @param sep\r
- * separator between toselect fields\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#select(java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public void select(String sequenceIds, String columns, String sep)\r
{\r
selectIn(getDefaultTargetFrame(), sequenceIds, columns, sep);\r
}\r
\r
- /**\r
- * select regions of the given alignment frame\r
- * \r
- * @param alf\r
- * @param toselect\r
- * String separated list { column range, seq1...seqn sequence ids }\r
- * @param sep\r
- * separator between toselect fields\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#selectIn(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String)\r
*/\r
public void selectIn(AlignFrame alf, String sequenceIds, String columns)\r
{\r
selectIn(alf, sequenceIds, columns, separator);\r
}\r
\r
- /**\r
- * select regions of the given alignment frame\r
- * \r
- * @param alf\r
- * @param toselect\r
- * String separated list { column range, seq1...seqn sequence ids }\r
- * @param sep\r
- * separator between toselect fields\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#selectIn(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public void selectIn(AlignFrame alf, String sequenceIds, String columns,\r
String sep)\r
}\r
}\r
\r
- /**\r
- * get sequences selected in current alignFrame and return their alignment in\r
- * format 'format' either with or without suffix\r
- * \r
- * @param alf\r
- * - where selection is\r
- * @param format\r
- * - format of alignment file\r
- * @param suffix\r
- * - "true" to append /start-end string to each sequence ID\r
- * @return selected sequences as flat file or empty string if there was no\r
- * current selection\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesAsAlignment(java.lang.String, java.lang.String)\r
*/\r
public String getSelectedSequencesAsAlignment(String format, String suffix)\r
{\r
format, suffix);\r
}\r
\r
- /**\r
- * get sequences selected in alf and return their alignment in format 'format'\r
- * either with or without suffix\r
- * \r
- * @param alf\r
- * - where selection is\r
- * @param format\r
- * - format of alignment file\r
- * @param suffix\r
- * - "true" to append /start-end string to each sequence ID\r
- * @return selected sequences as flat file or empty string if there was no\r
- * current selection\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSelectedSequencesAsAlignmentFrom(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String)\r
*/\r
public String getSelectedSequencesAsAlignmentFrom(AlignFrame alf,\r
String format, String suffix)\r
return "";\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignmentOrder()\r
+ */\r
public String getAlignmentOrder()\r
{\r
return getAlignmentOrderFrom(getDefaultTargetFrame());\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignmentOrderFrom(jalview.appletgui.AlignFrame)\r
+ */\r
public String getAlignmentOrderFrom(AlignFrame alf)\r
{\r
return getAlignmentOrderFrom(alf, separator);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignmentOrderFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public String getAlignmentOrderFrom(AlignFrame alf, String sep)\r
{\r
AlignmentI alorder = alf.getAlignViewport().getAlignment();\r
return arrayToSeparatorList(order);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#orderBy(java.lang.String, java.lang.String)\r
+ */\r
public String orderBy(String order, String undoName)\r
{\r
return orderBy(order, undoName, separator);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#orderBy(java.lang.String, java.lang.String, java.lang.String)\r
+ */\r
public String orderBy(String order, String undoName, String sep)\r
{\r
return orderAlignmentBy(getDefaultTargetFrame(), order, undoName, sep);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#orderAlignmentBy(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String, java.lang.String)\r
+ */\r
public String orderAlignmentBy(AlignFrame alf, String order,\r
String undoName, String sep)\r
{\r
return alf.sortBy(aorder, undoName) ? "true" : "";\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignment(java.lang.String)\r
+ */\r
public String getAlignment(String format)\r
{\r
return getAlignmentFrom(getDefaultTargetFrame(), format, "true");\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignmentFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public String getAlignmentFrom(AlignFrame alf, String format)\r
{\r
return getAlignmentFrom(alf, format, "true");\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignment(java.lang.String, java.lang.String)\r
+ */\r
public String getAlignment(String format, String suffix)\r
{\r
return getAlignmentFrom(getDefaultTargetFrame(), format, suffix);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAlignmentFrom(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String)\r
+ */\r
public String getAlignmentFrom(AlignFrame alf, String format,\r
String suffix)\r
{\r
}\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#loadAnnotation(java.lang.String)\r
+ */\r
public void loadAnnotation(String annotation)\r
{\r
loadAnnotationFrom(getDefaultTargetFrame(), annotation);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#loadAnnotationFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public void loadAnnotationFrom(AlignFrame alf, String annotation)\r
{\r
if (new AnnotationFile().readAnnotationFile(alf.getAlignViewport()\r
}\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeatures(java.lang.String)\r
+ */\r
public String getFeatures(String format)\r
{\r
return getFeaturesFrom(getDefaultTargetFrame(), format);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeaturesFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public String getFeaturesFrom(AlignFrame alf, String format)\r
{\r
return alf.outputFeatures(false, format);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAnnotation()\r
+ */\r
public String getAnnotation()\r
{\r
return getAnnotationFrom(getDefaultTargetFrame());\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getAnnotationFrom(jalview.appletgui.AlignFrame)\r
+ */\r
public String getAnnotationFrom(AlignFrame alf)\r
{\r
return alf.outputAnnotations(false);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#newView()\r
+ */\r
public AlignFrame newView()\r
{\r
return newViewFrom(getDefaultTargetFrame());\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#newView(java.lang.String)\r
+ */\r
public AlignFrame newView(String name)\r
{\r
return newViewFrom(getDefaultTargetFrame(), name);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#newViewFrom(jalview.appletgui.AlignFrame)\r
+ */\r
public AlignFrame newViewFrom(AlignFrame alf)\r
{\r
return alf.newView(null);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#newViewFrom(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public AlignFrame newViewFrom(AlignFrame alf, String name)\r
{\r
return alf.newView(name);\r
}\r
\r
- /**\r
- * \r
- * @param text\r
- * alignment file as a string\r
- * @param title\r
- * window title\r
- * @return null or new alignment frame\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#loadAlignment(java.lang.String, java.lang.String)\r
*/\r
public AlignFrame loadAlignment(String text, String title)\r
{\r
return null;\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setMouseoverListener(java.lang.String)\r
+ */\r
public void setMouseoverListener(String listener)\r
{\r
setMouseoverListener(currentAlignFrame, listener);\r
\r
private Vector<jalview.javascript.JSFunctionExec> javascriptListeners = new Vector<jalview.javascript.JSFunctionExec>();\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setMouseoverListener(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public void setMouseoverListener(AlignFrame af, String listener)\r
{\r
if (listener != null)\r
}\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setSelectionListener(java.lang.String)\r
+ */\r
public void setSelectionListener(String listener)\r
{\r
setSelectionListener(null, listener);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setSelectionListener(jalview.appletgui.AlignFrame, java.lang.String)\r
+ */\r
public void setSelectionListener(AlignFrame af, String listener)\r
{\r
if (listener != null)\r
}\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setStructureListener(java.lang.String, java.lang.String)\r
+ */\r
public void setStructureListener(String listener, String modelSet)\r
{\r
if (listener != null)\r
}\r
}\r
\r
- /**\r
- * remove any callback using the given listener function and associated with\r
- * the given alignFrame (or null for all callbacks)\r
- * \r
- * @param af\r
- * (may be null)\r
- * @param listener\r
- * (may be null)\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#removeJavascriptListener(jalview.appletgui.AlignFrame, java.lang.String)\r
*/\r
public void removeJavascriptListener(AlignFrame af, String listener)\r
{\r
StructureSelectionManager.release(this);\r
}\r
private jalview.javascript.JSFunctionExec jsFunctionExec;\r
- /**\r
- * send a mouseover message to all the alignment windows associated with the\r
- * given residue in the pdbfile\r
- * \r
- * @param pdbResNum\r
- * @param chain\r
- * @param pdbfile\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#mouseOverStructure(java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public void mouseOverStructure(String pdbResNum, String chain,\r
String pdbfile)\r
+ pdbResNum + "'");\r
}\r
}\r
- /**\r
- * adjust horizontal/vertical scroll to the make the given location the top left hand corner for given current view\r
- * \r
- * @param alf\r
- * @param topRow\r
- * @param leftHandColumn\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#scrollViewToIn(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String)\r
*/\r
public void scrollViewToIn(AlignFrame alf, String topRow, String leftHandColumn)\r
{\r
return "" + separator;\r
}\r
\r
- /**\r
- * @return\r
- * @see jalview.appletgui.AlignFrame#getFeatureGroups()\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeatureGroups()\r
*/\r
public String getFeatureGroups()\r
{\r
return lst;\r
}\r
\r
- /**\r
- * @param alf\r
- * alignframe to get feature groups on\r
- * @return\r
- * @see jalview.appletgui.AlignFrame#getFeatureGroups()\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeatureGroupsOn(jalview.appletgui.AlignFrame)\r
*/\r
public String getFeatureGroupsOn(AlignFrame alf)\r
{\r
return lst;\r
}\r
\r
- /**\r
- * @param visible\r
- * @return\r
- * @see jalview.appletgui.AlignFrame#getFeatureGroupsOfState(boolean)\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeatureGroupsOfState(boolean)\r
*/\r
public String getFeatureGroupsOfState(boolean visible)\r
{\r
.getFeatureGroupsOfState(visible));\r
}\r
\r
- /**\r
- * @param alf\r
- * align frame to get groups of state visible\r
- * @param visible\r
- * @return\r
- * @see jalview.appletgui.AlignFrame#getFeatureGroupsOfState(boolean)\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getFeatureGroupsOfStateOn(jalview.appletgui.AlignFrame, boolean)\r
*/\r
public String getFeatureGroupsOfStateOn(AlignFrame alf, boolean visible)\r
{\r
return arrayToSeparatorList(alf.getFeatureGroupsOfState(visible));\r
}\r
\r
- /**\r
- * @param groups\r
- * tab separated list of group names\r
- * @param state\r
- * true or false\r
- * @see jalview.appletgui.AlignFrame#setFeatureGroupState(java.lang.String[],\r
- * boolean)\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setFeatureGroupStateOn(jalview.appletgui.AlignFrame, java.lang.String, boolean)\r
*/\r
public void setFeatureGroupStateOn(AlignFrame alf, String groups,\r
boolean state)\r
alf.setFeatureGroupState(separatorListToArray(groups), st);\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setFeatureGroupState(java.lang.String, boolean)\r
+ */\r
public void setFeatureGroupState(String groups, boolean state)\r
{\r
setFeatureGroupStateOn(getDefaultTargetFrame(), groups, state);\r
}\r
\r
- /**\r
- * List separator string\r
- * \r
- * @return the separator\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getSeparator()\r
*/\r
public String getSeparator()\r
{\r
return separator;\r
}\r
\r
- /**\r
- * List separator string\r
- * \r
- * @param separator\r
- * the separator to set. empty string will reset separator to default\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#setSeparator(java.lang.String)\r
*/\r
public void setSeparator(String separator)\r
{\r
return false;\r
}\r
\r
- /**\r
- * bind a pdb file to a sequence in the given alignFrame.\r
- * \r
- * @param alFrame\r
- * - null or specific alignFrame. This specifies the dataset that\r
- * will be searched for a seuqence called sequenceId\r
- * @param sequenceId\r
- * - sequenceId within the dataset.\r
- * @param pdbEntryString\r
- * - the short name for the PDB file\r
- * @param pdbFile\r
- * - pdb file - either a URL or a valid PDB file.\r
- * @return true if binding was as success TODO: consider making an exception\r
- * structure for indicating when PDB parsing or sequenceId location\r
- * fails.\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#addPdbFile(jalview.appletgui.AlignFrame, java.lang.String, java.lang.String, java.lang.String)\r
*/\r
public boolean addPdbFile(AlignFrame alFrame, String sequenceId,\r
String pdbEntryString, String pdbFile)\r
for (int i=0;i<colcommands.length;i++) { l[i] = colcommands[i].hashCode();}\r
jshashes.put(messageclass+"|"+viewId,l);\r
}\r
+ /* (non-Javadoc)\r
+ * @see jalview.bin.JalviewLiteJsApi#getJsMessage(java.lang.String, java.lang.String)\r
+ */\r
public String getJsMessage(String messageclass, String viewId)\r
{\r
Hashtable<String,String[]> msgset = jsmessages.get(messageclass);\r
--- /dev/null
+package jalview.javascript;
+
+import jalview.appletgui.AlignFrame;
+
+/**
+ * The following public methods may be called
+ * externally, eg via javascript in an HTML page.
+ *
+ * <br><em>TODO: introduce abstract interface for jalview.appletgui.AlignFrame</em><br>
+ *
+ * Most function arguments are strings, which contain serialised versions of lists.
+ * Lists of things are separated by a separator character - either the default or a user supplied one.
+ * Ranges and positions on an alignment or sequence can be specified as a list, where an item containing a single number is a single position, and an item like 1-2 specifies columns 1 and 2 as a range.
+ */
+
+/**
+ * @author jimp
+ *
+ */
+public interface JalviewLiteJsApi
+{
+
+ /**
+ * @return String list of selected sequence IDs, each terminated by the
+ * 'boolean not' character (""+0x00AC) or (¬)
+ */
+ public abstract String getSelectedSequences();
+
+ /**
+ * @param sep
+ * separator string or null for default
+ * @return String list of selected sequence IDs, each terminated by given
+ * separator string
+ */
+ public abstract String getSelectedSequences(String sep);
+
+ /**
+ * @param alf
+ * alignframe containing selection
+ * @return String list of selected sequence IDs, each terminated by current
+ * default separator sequence
+ *
+ */
+ public abstract String getSelectedSequencesFrom(AlignFrame alf);
+
+ /**
+ * get list of selected sequence IDs separated by given separator
+ *
+ * @param alf
+ * window containing selection
+ * @param sep
+ * separator string to use - default is 'boolean not'
+ * @return String list of selected sequence IDs, each terminated by the given
+ * separator
+ */
+ public abstract String getSelectedSequencesFrom(AlignFrame alf, String sep);
+
+ /**
+ *
+ * @param sequenceId
+ * id of sequence to highlight
+ * @param position
+ * integer position [ tobe implemented or range ] on sequence
+ * @param alignedPosition
+ * true/false/empty string - indicate if position is an alignment
+ * column or unaligned sequence position
+ */
+ public abstract void highlight(String sequenceId, String position,
+ String alignedPosition);
+
+ /**
+ *
+ * @param sequenceId
+ * id of sequence to highlight
+ * @param position
+ * integer position [ tobe implemented or range ] on sequence
+ * @param alignedPosition
+ * false, blank or something else - indicate if position is an
+ * alignment column or unaligned sequence position
+ */
+ public abstract void highlightIn(AlignFrame alf, String sequenceId,
+ String position, String alignedPosition);
+
+ /**
+ * select regions of the currrent alignment frame
+ *
+ * @param sequenceIds
+ * String separated list of sequence ids or empty string
+ * @param columns
+ * String separated list { column range or column, ..} or empty
+ * string
+ */
+ public abstract void select(String sequenceIds, String columns);
+
+ /**
+ * select regions of the currrent alignment frame
+ *
+ * @param toselect
+ * String separated list { column range, seq1...seqn sequence ids }
+ * @param sep
+ * separator between toselect fields
+ */
+ public abstract void select(String sequenceIds, String columns, String sep);
+
+ /**
+ * select regions of the given alignment frame
+ *
+ * @param alf
+ * @param toselect
+ * String separated list { column range, seq1...seqn sequence ids }
+ * @param sep
+ * separator between toselect fields
+ */
+ public abstract void selectIn(AlignFrame alf, String sequenceIds,
+ String columns);
+
+ /**
+ * select regions of the given alignment frame
+ *
+ * @param alf
+ * @param toselect
+ * String separated list { column range, seq1...seqn sequence ids }
+ * @param sep
+ * separator between toselect fields
+ */
+ public abstract void selectIn(AlignFrame alf, String sequenceIds,
+ String columns, String sep);
+
+ /**
+ * get sequences selected in current alignFrame and return their alignment in
+ * format 'format' either with or without suffix
+ *
+ * @param alf
+ * - where selection is
+ * @param format
+ * - format of alignment file
+ * @param suffix
+ * - "true" to append /start-end string to each sequence ID
+ * @return selected sequences as flat file or empty string if there was no
+ * current selection
+ */
+ public abstract String getSelectedSequencesAsAlignment(String format,
+ String suffix);
+
+ /**
+ * get sequences selected in alf and return their alignment in format 'format'
+ * either with or without suffix
+ *
+ * @param alf
+ * - where selection is
+ * @param format
+ * - format of alignment file
+ * @param suffix
+ * - "true" to append /start-end string to each sequence ID
+ * @return selected sequences as flat file or empty string if there was no
+ * current selection
+ */
+ public abstract String getSelectedSequencesAsAlignmentFrom(
+ AlignFrame alf, String format, String suffix);
+
+ /**
+ * get a separator separated list of sequence IDs reflecting the order of the current alignment
+ * @return
+ */
+ public abstract String getAlignmentOrder();
+ /**
+ * get a separator separated list of sequence IDs reflecting the order of the alignment in alf
+ *
+ * @param alf
+ * @return
+ */
+ public abstract String getAlignmentOrderFrom(AlignFrame alf);
+
+ /**
+ * get a sep separated list of sequence IDs reflecting the order of the alignment in alf
+ *
+ * @param alf
+ * @param sep - separator to use
+ * @return
+ */
+ public abstract String getAlignmentOrderFrom(AlignFrame alf, String sep);
+ /**
+ * re-order the current alignment using the given list of sequence IDs
+ * @param order - sep separated list
+ * @param undoName - string to use when referring to ordering action in undo buffer
+ * @return 'true' if alignment was actually reordered. empty string if alignment did not contain sequences.
+ */
+ public abstract String orderBy(String order, String undoName);
+
+ /**
+ * re-order the current alignment using the given list of sequence IDs
+ * separated by sep
+ *
+ * @param order
+ * - sep separated list
+ * @param undoName
+ * - string to use when referring to ordering action in undo buffer
+ * @param sep
+ * @return 'true' if alignment was actually reordered. empty string if alignment did not contain sequences.
+ */
+ public abstract String orderBy(String order, String undoName, String sep);
+
+ /**
+ * re-order the given alignment using the given list of sequence IDs
+ * separated by sep
+ *
+ * @param alf
+ * @param order
+ * - sep separated list
+ * @param undoName
+ * - string to use when referring to ordering action in undo buffer
+ * @param sep
+ * @return 'true' if alignment was actually reordered. empty string if alignment did not contain sequences.
+ */
+ public abstract String orderAlignmentBy(AlignFrame alf, String order,
+ String undoName, String sep);
+
+ /**
+ * get alignment as format (format names FASTA, BLC, CLUSTAL, MSF, PILEUP, PFAM - see jalview.io.AppletFormatAdapter for full list)
+ * @param format
+ * @return
+ */
+ public abstract String getAlignment(String format);
+
+ /**
+ * get alignment displayed in alf as format
+ * @param alf
+ * @param format
+ * @return
+ */
+ public abstract String getAlignmentFrom(AlignFrame alf, String format);
+
+ /**
+ * get alignment as format with jalview start-end sequence suffix appended
+ * @param format
+ * @param suffix
+ * @return
+ */
+ public abstract String getAlignment(String format, String suffix);
+
+ /**
+ * get alignment displayed in alf as format
+ * with or without the jalview start-end sequence suffix appended
+ * @param alf
+ * @param format
+ * @param suffix
+ * @return
+ */
+ public abstract String getAlignmentFrom(AlignFrame alf, String format,
+ String suffix);
+
+ /**
+ * add the given features or annotation to the current alignment
+ * @param annotation
+ */
+ public abstract void loadAnnotation(String annotation);
+
+ /**
+ * add the given features or annotation to the given alignment view
+ * @param alf
+ * @param annotation
+ */
+ public abstract void loadAnnotationFrom(AlignFrame alf, String annotation);
+
+ /**
+ * get the sequence features in the given format (Jalview or GFF)
+ * @param format
+ * @return
+ */
+ public abstract String getFeatures(String format);
+
+ /**
+ * get the sequence features in alf in the given format (Jalview or GFF)
+ * @param alf
+ * @param format
+ * @return
+ */
+ public abstract String getFeaturesFrom(AlignFrame alf, String format);
+
+ /**
+ * get current alignment's annotation as an annotation file
+ * @return
+ */
+ public abstract String getAnnotation();
+
+ /**
+ * get alignment view alf's annotation as an annotation file
+ * @param alf
+ * @return
+ */
+ public abstract String getAnnotationFrom(AlignFrame alf);
+
+ /**
+ * create a new view and return the alignFrame instance
+ * @return
+ */
+ public abstract AlignFrame newView();
+
+ /**
+ * create a new view named name and return the alignFrame instance
+ * @param name
+ * @return
+ */
+ public abstract AlignFrame newView(String name);
+
+ /**
+ * create a new view on alf and return the alignFrame instance
+ * @param alf
+ * @return
+ */
+ public abstract AlignFrame newViewFrom(AlignFrame alf);
+
+ /**
+ * create a new view named name on alf
+ * @param alf
+ * @param name
+ * @return
+ */
+ public abstract AlignFrame newViewFrom(AlignFrame alf, String name);
+
+ /**
+ *
+ * @param text
+ * alignment file as a string
+ * @param title
+ * window title
+ * @return null or new alignment frame
+ */
+ public abstract AlignFrame loadAlignment(String text, String title);
+
+ /**
+ * register a javascript function to handle any alignment mouseover events
+ * @param listener name of javascript function (called with arguments [jalview.appletgui.AlignFrame,String(sequence id),String(column in alignment), String(position in sequence)]
+ */
+ public abstract void setMouseoverListener(String listener);
+
+ /**
+ * register a javascript function to handle mouseover events
+ * @param af (null or specific alignframe for which events are to be listened for)
+ * @param listener name of javascript function
+ */
+ public abstract void setMouseoverListener(AlignFrame af, String listener);
+
+ /**
+ * register a javascript function to handle any alignment selection events. Events are generated when the user completes a selection event, or when the user deselects all selected regions.
+ * @param listener name of javascript function (called with arguments [jalview.appletgui.AlignFrame, String(sequence set id), String(separator separated list of sequences which were selected), String(separator separated list of column ranges (i.e. single number or hyphenated range) that were selected)]
+ */
+ public abstract void setSelectionListener(String listener);
+
+ public abstract void setSelectionListener(AlignFrame af, String listener);
+
+ /**
+ * register a javascript function to handle events normally routed to a Jmol structure viewer.
+ * @param listener - javascript function (arguments are variable, see jalview.javascript.MouseOverStructureListener for full details)
+ * @param modelSet - separator separated list of PDB file URIs that this viewer is handling.
+ @see jalview.javascript.MouseOverStructureListener
+ */
+ public abstract void setStructureListener(String listener, String modelSet);
+
+ /**
+ * remove any callback using the given listener function and associated with
+ * the given alignFrame (or null for all callbacks)
+ *
+ * @param af
+ * (may be null)
+ * @param listener
+ * (may be null)
+ */
+ public abstract void removeJavascriptListener(AlignFrame af,
+ String listener);
+
+ /**
+ * send a mouseover message to all the alignment windows associated with the
+ * given residue in the pdbfile
+ *
+ * @param pdbResNum
+ * @param chain
+ * @param pdbfile
+ */
+ public abstract void mouseOverStructure(String pdbResNum, String chain,
+ String pdbfile);
+
+ /**
+ * bind a pdb file to a sequence in the given alignFrame.
+ *
+ * @param alFrame
+ * - null or specific alignFrame. This specifies the dataset that
+ * will be searched for a seuqence called sequenceId
+ * @param sequenceId
+ * - sequenceId within the dataset.
+ * @param pdbEntryString
+ * - the short name for the PDB file
+ * @param pdbFile
+ * - pdb file - either a URL or a valid PDB file.
+ * @return true if binding was as success TODO: consider making an exception
+ * structure for indicating when PDB parsing or sequenceId location
+ * fails.
+ */
+ public abstract boolean addPdbFile(AlignFrame alFrame, String sequenceId,
+ String pdbEntryString, String pdbFile);
+
+ /**
+ * adjust horizontal/vertical scroll to the make the given location the top left hand corner for given current view
+ *
+ * @param alf
+ * @param topRow
+ * @param leftHandColumn
+ */
+ public abstract void scrollViewToIn(AlignFrame alf, String topRow,
+ String leftHandColumn);
+
+ /**
+ *
+ * @return
+ * @see jalview.appletgui.AlignFrame#getFeatureGroups()
+ */
+ public abstract String getFeatureGroups();
+
+ /**
+ * @param alf
+ * alignframe to get feature groups on
+ * @return
+ * @see jalview.appletgui.AlignFrame#getFeatureGroups()
+ */
+ public abstract String getFeatureGroupsOn(AlignFrame alf);
+
+ /**
+ * @param visible
+ * @return
+ * @see jalview.appletgui.AlignFrame#getFeatureGroupsOfState(boolean)
+ */
+ public abstract String getFeatureGroupsOfState(boolean visible);
+
+ /**
+ * @param alf
+ * align frame to get groups of state visible
+ * @param visible
+ * @return
+ * @see jalview.appletgui.AlignFrame#getFeatureGroupsOfState(boolean)
+ */
+ public abstract String getFeatureGroupsOfStateOn(AlignFrame alf,
+ boolean visible);
+
+ /**
+ * @param groups
+ * tab separated list of group names
+ * @param state
+ * true or false
+ * @see jalview.appletgui.AlignFrame#setFeatureGroupState(java.lang.String[],
+ * boolean)
+ */
+ public abstract void setFeatureGroupStateOn(AlignFrame alf,
+ String groups, boolean state);
+
+ public abstract void setFeatureGroupState(String groups, boolean state);
+
+ /**
+ * List separator string
+ *
+ * @return the separator
+ */
+ public abstract String getSeparator();
+
+ /**
+ * List separator string
+ *
+ * @param separator
+ * the separator to set. empty string will reset separator to default
+ */
+ public abstract void setSeparator(String separator);
+
+ /**
+ * Retrieve fragments of a large packet of data made available by JalviewLite.
+ * @param messageclass
+ * @param viewId
+ * @return next chunk of message
+ */
+ public abstract String getJsMessage(String messageclass, String viewId);
+
+}
\ No newline at end of file