From 4f4671d6ef1cb82d03fa9959f4e46d692babc1ef Mon Sep 17 00:00:00 2001 From: hansonr Date: Thu, 18 Jul 2019 08:47:10 +0100 Subject: [PATCH] JAL-3269 ready for testing embedded interface --- src/jalview/bin/Jalview.java | 262 ++++++++++++++------------ src/jalview/bin/JalviewAppLoader.java | 145 ++++++++++++++ src/jalview/bin/JalviewLite.java | 52 +++-- src/jalview/javascript/JalviewLiteJsApi.java | 74 +++++--- 4 files changed, 366 insertions(+), 167 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 047356b..2cf6f37 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -553,8 +553,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi parseArguments(aparser, true); } - private Object parseArguments(ArgsParser aparser, - boolean isStartup) + private Object parseArguments(ArgsParser aparser, boolean isStartup) { boolean isJS = Platform.isJS(); @@ -1321,6 +1320,17 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi JalviewApp app = new JalviewApp() { + // TODO BH 2019 + // + // These are methods that are in JalviewLite that various classes call + // but are not in JalviewLiteJsApi. Or, even if they are, other classes + // call + // them to JalviewLite directly. Some may not be necessary, but they have + // to + // be at least mentioned here, or the classes calling them should + // reference + // JalviewLite itself. + private boolean alignPDBStructures; // From JalviewLite; not implemented private Hashtable> jsmessages; @@ -1472,7 +1482,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi @Override public StructureSelectionManagerProvider getStructureSelectionManagerProvider() { - // TODO Auto-generated method stub + // TODO Q: what exactly is this? BH return null; } @@ -1489,8 +1499,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi ColumnSelection colsel, HiddenColumns hidden, SelectionSource source, Object alignFrame) { - // TODO Auto-generated method stub - return null; + return appLoader.getSelectionForListener(getCurrentAlignFrame(), + seqsel, colsel, hidden, source, alignFrame); } @Override @@ -1502,16 +1512,14 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi @Override public Hashtable getJSHashes() { - return (jshashes == null - ? (jshashes = new Hashtable<>()) + return (jshashes == null ? (jshashes = new Hashtable<>()) : jshashes); } @Override public Hashtable> getJSMessages() { - return (jsmessages == null - ? (jsmessages = new Hashtable<>()) + return (jsmessages == null ? (jsmessages = new Hashtable<>()) : jsmessages); } @@ -1602,11 +1610,10 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public void highlightIn(AlignFrameI alf, - String sequenceId, String position, String alignedPosition) + public void highlightIn(AlignFrameI alf, String sequenceId, + String position, String alignedPosition) { - appLoader.highlightIn(alf, sequenceId, position, - alignedPosition); + appLoader.highlightIn(alf, sequenceId, position, alignedPosition); } @Override @@ -1622,15 +1629,14 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public void selectIn(AlignFrameI alf, String sequenceIds, - String columns) + 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) + public void selectIn(AlignFrameI alf, String sequenceIds, String columns, + String sep) { appLoader.selectIn(alf, sequenceIds, columns, sep); } @@ -1644,8 +1650,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String getSelectedSequencesAsAlignmentFrom( - AlignFrameI alf, String format, String sep) + public String getSelectedSequencesAsAlignmentFrom(AlignFrameI alf, + String format, String sep) { return appLoader.getSelectedSequencesAsAlignmentFrom(alf, format, sep); } @@ -1663,8 +1669,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String getAlignmentOrderFrom(AlignFrameI alf, - String sep) + public String getAlignmentOrderFrom(AlignFrameI alf, String sep) { return appLoader.getAlignmentOrderFrom(alf, sep); } @@ -1682,8 +1687,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String orderAlignmentBy(AlignFrameI alf, - String order, String undoName, String sep) + public String orderAlignmentBy(AlignFrameI alf, String order, + String undoName, String sep) { return appLoader.orderAlignmentBy(alf, order, undoName, sep); } @@ -1695,8 +1700,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String getAlignmentFrom(AlignFrameI alf, - String format) + public String getAlignmentFrom(AlignFrameI alf, String format) { return getAlignmentFrom(alf, format, null); } @@ -1708,8 +1712,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String getAlignmentFrom(AlignFrameI alf, - String format, String suffix) + public String getAlignmentFrom(AlignFrameI alf, String format, + String suffix) { return appLoader.getAlignmentFrom(alf, format, suffix); } @@ -1717,176 +1721,106 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi @Override public void loadAnnotation(String annotation) { - // TODO Auto-generated method stub - + loadAnnotationFrom(getCurrentAlignFrame(), annotation); } @Override - public void loadAnnotationFrom(AlignFrameI alf, - String annotation) + public void loadAnnotationFrom(AlignFrameI alf, String annotation) { - // TODO Auto-generated method stub - + appLoader.loadAnnotationFrom(alf, annotation); } @Override public void loadFeatures(String features, boolean autoenabledisplay) { - // TODO Auto-generated method stub - + loadFeaturesFrom(currentAlignFrame, features, autoenabledisplay); } @Override - public boolean loadFeaturesFrom(AlignFrameI alf, - String features, boolean autoenabledisplay) + public boolean loadFeaturesFrom(AlignFrameI alf, String features, + boolean autoenabledisplay) { - // TODO Auto-generated method stub - return false; + return appLoader.loadFeaturesFrom(alf, features, autoenabledisplay); } @Override public String getFeatures(String format) { - // TODO Auto-generated method stub - return null; + return getFeaturesFrom(getCurrentAlignFrame(), format); } @Override - public String getFeaturesFrom(AlignFrameI alf, - String format) + public String getFeaturesFrom(AlignFrameI alf, String format) { - // TODO Auto-generated method stub - return null; + return appLoader.getFeaturesFrom(alf, format); } @Override public String getAnnotation() { - // TODO Auto-generated method stub - return null; + return getAnnotationFrom(getCurrentAlignFrame()); } @Override public String getAnnotationFrom(AlignFrameI alf) { - // TODO Auto-generated method stub - return null; + return appLoader.getAnnotationFrom(alf); } @Override public AlignFrameI newView() { - // TODO Auto-generated method stub - return null; + return newViewFrom(getCurrentAlignFrame(), null); } @Override public AlignFrameI newView(String name) { - // TODO Auto-generated method stub - return null; + return newViewFrom(getCurrentAlignFrame(), name); } @Override public AlignFrameI newViewFrom(AlignFrameI alf) { - // TODO Auto-generated method stub - return null; + return newViewFrom(alf, null); } @Override public AlignFrameI newViewFrom(AlignFrameI alf, String name) { - // TODO Auto-generated method stub - return null; + return appLoader.newViewFrom(alf, name); } @Override - public AlignFrameI loadAlignment(String text, - String title) + public AlignFrameI loadAlignment(String text, String title) { return appLoader.loadAlignment(text, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT, title); } @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 boolean addPdbFile(AlignFrameI alFrame, - String sequenceId, String pdbEntryString, String pdbFile) + 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) + public void scrollViewToIn(AlignFrameI alf, String topRow, + String leftHandColumn) { appLoader.scrollViewToIn(alf, topRow, leftHandColumn); } @Override - public void scrollViewToRowIn(AlignFrameI alf, - String topRow) + public void scrollViewToRowIn(AlignFrameI alf, String topRow) { appLoader.scrollViewToRowIn(alf, topRow); } @Override - public void scrollViewToColumnIn(AlignFrameI alf, - String leftHandColumn) + public void scrollViewToColumnIn(AlignFrameI alf, String leftHandColumn) { appLoader.scrollViewToColumnIn(alf, leftHandColumn); } @@ -1910,15 +1844,14 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } @Override - public String getFeatureGroupsOfStateOn(AlignFrameI alf, - boolean visible) + public String getFeatureGroupsOfStateOn(AlignFrameI alf, boolean visible) { return appLoader.getFeatureGroupsOfStateOn(alf, visible); } @Override - public void setFeatureGroupStateOn(AlignFrameI alf, - String groups, boolean state) + public void setFeatureGroupStateOn(AlignFrameI alf, String groups, + boolean state) { setFeatureGroupStateOn(alf, groups, state); } @@ -1980,4 +1913,85 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi 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 + + } + } diff --git a/src/jalview/bin/JalviewAppLoader.java b/src/jalview/bin/JalviewAppLoader.java index 921ccdf..51a0330 100644 --- a/src/jalview/bin/JalviewAppLoader.java +++ b/src/jalview/bin/JalviewAppLoader.java @@ -7,6 +7,7 @@ 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; @@ -17,6 +18,7 @@ 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; @@ -24,6 +26,7 @@ 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; @@ -1335,4 +1338,146 @@ public class JalviewAppLoader } } + public void loadAnnotationFrom(AlignFrameI alf, String annotation) + { + if (new AnnotationFile().annotateAlignmentView( + ((AlignFrame) alf).getViewport(), annotation, + DataSourceType.PASTE)) + { + ((AlignFrame) alf).alignPanel.fontChanged(); + ((AlignFrame) alf).alignPanel.setScrollValues(0, 0); + } + else + { + ((AlignFrame) alf).parseFeaturesFile(annotation, + DataSourceType.PASTE); + } + } + + public boolean loadFeaturesFrom(AlignFrameI alf, String features, + boolean autoenabledisplay) + { + boolean ret = ((AlignFrame) alf).parseFeaturesFile(features, + DataSourceType.PASTE); + if (!ret) + { + return false; + } + if (autoenabledisplay) + { + ((AlignFrame) alf).getViewport().setShowSequenceFeatures(true); + // this next was for a checkbox in JalviewLite + // ((AlignFrame) alf).getViewport().sequenceFeatures.setState(true); + } + return true; + } + + public String getFeaturesFrom(AlignFrameI alf, String format) + { + AlignFrame f = ((AlignFrame) alf); + + String features; + FeaturesFile formatter = new FeaturesFile(); + if (format.equalsIgnoreCase("Jalview")) + { + features = formatter.printJalviewFormat( + f.getViewport().getAlignment().getSequencesArray(), + f.alignPanel.getFeatureRenderer(), true); + } + else + { + features = formatter.printGffFormat( + f.getViewport().getAlignment().getSequencesArray(), + f.alignPanel.getFeatureRenderer(), true); + } + + if (features == null) + { + features = ""; + } + return features; + + } + + public String getAnnotationFrom(AlignFrameI alf) + { + AlignFrame f = (AlignFrame) alf; + String annotation = new AnnotationFile() + .printAnnotationsForView(f.getViewport()); + return annotation; + } + + public AlignFrameI newViewFrom(AlignFrameI alf, String name) + { + return (AlignFrameI) ((AlignFrame) alf).newView(name, true); + } + + public String[] separatorListToArray(String list) + { + return separatorListToArray(list, separator); + } + + public Object[] getSelectionForListener(AlignFrameI currentFrame, + SequenceGroup seqsel, ColumnSelection colsel, + HiddenColumns hidden, SelectionSource source, Object alignFrame) + { + // System.err.println("Testing selection event relay to + // jsfunction:"+_listener); + String setid = ""; + AlignFrame src = (AlignFrame) alignFrame; + if (source != null) + { + if (source instanceof AlignViewport + && ((AlignFrame) currentFrame).getViewport() == source) + { + // should be valid if it just generated an event! + src = (AlignFrame) currentFrame; + + } + } + String[] seqs = new String[] {}; + String[] cols = new String[] {}; + int strt = 0, end = (src == null) ? -1 + : src.alignPanel.av.getAlignment().getWidth(); + if (seqsel != null && seqsel.getSize() > 0) + { + seqs = new String[seqsel.getSize()]; + for (int i = 0; i < seqs.length; i++) + { + seqs[i] = seqsel.getSequenceAt(i).getName(); + } + if (strt < seqsel.getStartRes()) + { + strt = seqsel.getStartRes(); + } + if (end == -1 || end > seqsel.getEndRes()) + { + end = seqsel.getEndRes(); + } + } + if (colsel != null && !colsel.isEmpty()) + { + if (end == -1) + { + end = colsel.getMax() + 1; + } + cols = new String[colsel.getSelected().size()]; + for (int i = 0; i < cols.length; i++) + { + cols[i] = "" + (1 + colsel.getSelected().get(i).intValue()); + } + } + else + { + if (seqsel != null && seqsel.getSize() > 0) + { + // send a valid range, otherwise we send the empty selection + cols = new String[2]; + cols[0] = "" + (1 + strt) + "-" + (1 + end); + } + } + return new Object[] { src, setid, arrayToSeparatorList(seqs), + arrayToSeparatorList(cols) }; + } + } \ No newline at end of file diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 1dd7b25..75b0add 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -2077,6 +2077,7 @@ public class JalviewLite extends Applet * @param list * @return elements separated by separator */ + @Override public String[] separatorListToArray(String list) { return JalviewAppLoader.separatorListToArray(list, separator); @@ -2556,21 +2557,38 @@ public class JalviewLite extends Applet return new jalview.appletgui.FeatureRenderer((AlignmentViewport) vp); } - /** - * bind structures in a viewer to any matching sequences in an alignFrame (use - * sequenceIds to limit scope of search to specific sequences) - * - * @param alFrame - * @param viewer - * @param sequenceIds - * @return TODO: consider making an exception structure for indicating when - * binding fails public SequenceStructureBinding - * addStructureViewInstance( AlignFrame alFrame, Object viewer, String - * sequenceIds) { - * - * if (sequenceIds != null && sequenceIds.length() > 0) { return - * alFrame.addStructureViewInstance(viewer, - * separatorListToArray(sequenceIds)); } else { return - * alFrame.addStructureViewInstance(viewer, null); } // return null; } - */ + @Override + public String getSelectedSequencesAsAlignment(String format, + boolean suffix) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSelectedSequencesAsAlignmentFrom(AlignFrameI alf, + String format, boolean suffix) + { + // TODO Auto-generated method stub + return null; + } + + // /** + // * bind structures in a viewer to any matching sequences in an alignFrame + // (use + // * sequenceIds to limit scope of search to specific sequences) + // * + // * @param alFrame + // * @param viewer + // * @param sequenceIds + // * @return TODO: consider making an exception structure for indicating when + // * binding fails public SequenceStructureBinding + // * addStructureViewInstance( AlignFrame alFrame, Object viewer, String + // * sequenceIds) { + // * + // * if (sequenceIds != null && sequenceIds.length() > 0) { return + // * alFrame.addStructureViewInstance(viewer, + // * separatorListToArray(sequenceIds)); } else { return + // * alFrame.addStructureViewInstance(viewer, null); } // return null; } + // */ } diff --git a/src/jalview/javascript/JalviewLiteJsApi.java b/src/jalview/javascript/JalviewLiteJsApi.java index 6cb8e07..3ce2c9f 100644 --- a/src/jalview/javascript/JalviewLiteJsApi.java +++ b/src/jalview/javascript/JalviewLiteJsApi.java @@ -1,13 +1,13 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$); + * Copyright (C); $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. + * of the License, or (at your option); any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty @@ -42,7 +42,7 @@ public interface JalviewLiteJsApi /** * @return String list of selected sequence IDs, each terminated by the - * 'boolean not' character (""+0x00AC) or (¬) + * 'boolean not' character (""+0x00AC); or (¬); */ public abstract String getSelectedSequences(); @@ -207,7 +207,8 @@ public interface JalviewLiteJsApi * - separator to use * @return */ - public abstract String getAlignmentOrderFrom(AlignFrameI alf, String sep); + public abstract String getAlignmentOrderFrom(AlignFrameI alf, + String sep); /** * re-order the current alignment using the given list of sequence IDs @@ -233,7 +234,8 @@ public interface JalviewLiteJsApi * @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); + public abstract String orderBy(String order, String undoName, + String sep); /** * re-order the given alignment using the given list of sequence IDs separated @@ -253,7 +255,7 @@ public interface JalviewLiteJsApi /** * get alignment as format (format names FASTA, BLC, CLUSTAL, MSF, PILEUP, - * PFAM - see jalview.io.AppletFormatAdapter for full list) + * PFAM - see jalview.io.AppletFormatAdapter for full list); * * @param format * @return @@ -335,7 +337,7 @@ public interface JalviewLiteJsApi boolean autoenabledisplay); /** - * get the sequence features in the given format (Jalview or GFF) + * get the sequence features in the given format (Jalview or GFF); * * @param format * @return @@ -343,7 +345,7 @@ public interface JalviewLiteJsApi public abstract String getFeatures(String format); /** - * get the sequence features in alf in the given format (Jalview or GFF) + * get the sequence features in alf in the given format (Jalview or GFF); * * @param alf * @param format @@ -413,8 +415,8 @@ public interface JalviewLiteJsApi * * @param listener * name of javascript function (called with arguments - * [jalview.appletgui.AlignFrameI,String(sequence id),String(column - * in alignment), String(position in sequence)] + * [jalview.appletgui.AlignFrameI,String(sequence id);,String(column + * in alignment);, String(position in sequence);] */ public abstract void setMouseoverListener(String listener); @@ -423,7 +425,7 @@ public interface JalviewLiteJsApi * * @param af * (null or specific AlignFrameI for which events are to be listened - * for) + * for); * @param listener * name of javascript function */ @@ -437,10 +439,10 @@ public interface JalviewLiteJsApi * * @param listener * name of javascript function (called with arguments - * [jalview.appletgui.AlignFrameI, 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)] + * [jalview.appletgui.AlignFrameI, 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); @@ -453,11 +455,11 @@ public interface JalviewLiteJsApi * * @param listener * - javascript function (arguments are variable, see - * jalview.javascript.MouseOverStructureListener for full details) + * jalview.javascript.MouseOverStructureListener for full details); * @param modelSet * - separator separated list of PDB file URIs that this viewer is * handling. These files must be in the same order they appear in - * Jmol (e.g. first one is frame 1, second is frame 2, etc). + * Jmol (e.g. first one is frame 1, second is frame 2, etc);. * @see jalview.javascript.MouseOverStructureListener */ public abstract void setStructureListener(String listener, @@ -465,12 +467,12 @@ public interface JalviewLiteJsApi /** * remove any callback using the given listener function and associated with - * the given AlignFrameI (or null for all callbacks) + * the given AlignFrameI (or null for all callbacks); * * @param af - * (may be null) + * (may be null); * @param listener - * (may be null) + * (may be null); */ public abstract void removeJavascriptListener(AlignFrameI af, String listener); @@ -537,7 +539,7 @@ public interface JalviewLiteJsApi /** * * @return - * @see jalview.appletgui.AlignFrameI#getFeatureGroups() + * @see jalview.appletgui.AlignFrameI#getFeatureGroups(); */ public abstract String getFeatureGroups(); @@ -545,14 +547,14 @@ public interface JalviewLiteJsApi * @param alf * AlignFrameI to get feature groups on * @return - * @see jalview.appletgui.AlignFrameI#getFeatureGroups() + * @see jalview.appletgui.AlignFrameI#getFeatureGroups(); */ public abstract String getFeatureGroupsOn(AlignFrameI alf); /** * @param visible * @return - * @see jalview.appletgui.AlignFrameI#getFeatureGroupsOfState(boolean) + * @see jalview.appletgui.AlignFrameI#getFeatureGroupsOfState(boolean); */ public abstract String getFeatureGroupsOfState(boolean visible); @@ -561,7 +563,7 @@ public interface JalviewLiteJsApi * align frame to get groups of state visible * @param visible * @return - * @see jalview.appletgui.AlignFrameI#getFeatureGroupsOfState(boolean) + * @see jalview.appletgui.AlignFrameI#getFeatureGroupsOfState(boolean); */ public abstract String getFeatureGroupsOfStateOn(AlignFrameI alf, boolean visible); @@ -572,7 +574,7 @@ public interface JalviewLiteJsApi * @param state * true or false * @see jalview.appletgui.AlignFrameI#setFeatureGroupState(java.lang.String[], - * boolean) + * boolean); */ public abstract void setFeatureGroupStateOn(AlignFrameI alf, String groups, @@ -604,4 +606,24 @@ public interface JalviewLiteJsApi */ public abstract String getJsMessage(String messageclass, String viewId); + /// in http://www.jalview.org/examples/jalviewLiteJs.html but missing here + + // get selected sequences as alignment as format with or without start-end + // suffix + public String getSelectedSequencesAsAlignment(String format, + boolean suffix); + + // get selected sequences as alignment from given view as format with or + // without start-end suffix + public String getSelectedSequencesAsAlignmentFrom(AlignFrameI alf, + String format, boolean suffix); + + public String arrayToSeparatorList(String[] array); + + // get a string array from a list + public String[] separatorListToArray(String list); + + // debug flag - controls output to standard out + public static boolean debug = false; + } -- 1.7.10.2