2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.bin.Cache;
24 import jalview.datamodel.AlignmentI;
25 import jalview.datamodel.ColumnSelection;
26 import jalview.datamodel.HiddenColumns;
27 import jalview.datamodel.SequenceGroup;
28 import jalview.datamodel.SequenceI;
29 import jalview.io.VamsasAppDatastore;
30 import jalview.structure.SelectionListener;
31 import jalview.structure.SelectionSource;
32 import jalview.structure.StructureSelectionManager;
33 import jalview.structure.VamsasListener;
34 import jalview.structure.VamsasSource;
35 import jalview.util.MessageManager;
36 import jalview.viewmodel.AlignmentViewport;
38 import java.beans.PropertyChangeEvent;
39 import java.beans.PropertyChangeListener;
41 import java.io.IOException;
42 import java.util.Hashtable;
43 import java.util.IdentityHashMap;
44 import java.util.Iterator;
46 import javax.swing.JInternalFrame;
48 import uk.ac.vamsas.client.ClientHandle;
49 import uk.ac.vamsas.client.IClient;
50 import uk.ac.vamsas.client.IClientDocument;
51 import uk.ac.vamsas.client.InvalidSessionDocumentException;
52 import uk.ac.vamsas.client.UserHandle;
53 import uk.ac.vamsas.client.VorbaId;
54 import uk.ac.vamsas.client.picking.IMessageHandler;
55 import uk.ac.vamsas.client.picking.IPickManager;
56 import uk.ac.vamsas.client.picking.Message;
57 import uk.ac.vamsas.client.picking.MouseOverMessage;
58 import uk.ac.vamsas.client.picking.SelectionMessage;
59 import uk.ac.vamsas.objects.core.Entry;
60 import uk.ac.vamsas.objects.core.Input;
61 import uk.ac.vamsas.objects.core.Pos;
62 import uk.ac.vamsas.objects.core.Seg;
68 public class VamsasApplication implements SelectionSource, VamsasSource
70 IClient vclient = null;
72 ClientHandle app = null;
74 UserHandle user = null;
76 Desktop jdesktop = null; // our jalview desktop reference
78 private boolean inInitialUpdate = true;
80 // Cache.preferences for vamsas client session arena
81 // preferences for check for default session at startup.
82 // user and organisation stuff.
83 public VamsasApplication(Desktop jdesktop, File sessionPath,
87 // we should create a session URI from the sessionPath and pass it to
88 // the clientFactory - but the vamsas api doesn't cope with that yet.
89 this.jdesktop = jdesktop;
90 initClientSession(null, sessionPath, sessionName);
93 private static uk.ac.vamsas.client.IClientFactory getClientFactory()
96 return new uk.ac.vamsas.client.simpleclient.SimpleClientFactory();
100 * Start a new vamsas session
104 public VamsasApplication(Desktop jdesktop)
106 this.jdesktop = jdesktop;
107 initClientSession(null, null);
111 * init a connection to the session at the given url
116 public VamsasApplication(Desktop jdesktop, String sessionUrl)
118 this.jdesktop = jdesktop;
119 initClientSession(sessionUrl, null);
123 * @throws IOException
124 * or other if clientfactory instantiation failed.
125 * @return list of current sessions or null if no session exists.
127 public static String[] getSessionList() throws Exception
129 return getClientFactory().getCurrentSessions();
133 * initialise, possibly with either a valid session url or a file for a new
137 * null or a valid session url
138 * @param vamsasDocument
139 * null or a valid vamsas document file
140 * @return false if no vamsas connection was made
142 private void initClientSession(String sess, File vamsasDocument)
144 initClientSession(sess, vamsasDocument, null);
147 private boolean initClientSession(String sess, File vamsasDocument,
148 String newDocSessionName)
152 // Only need to tell the library what the application is here
153 app = getJalviewHandle();
154 uk.ac.vamsas.client.IClientFactory clientfactory = getClientFactory();
155 if (vamsasDocument != null)
159 throw new Error(MessageManager.getString(
160 "error.implementation_error_cannot_import_vamsas_doc"));
164 if (newDocSessionName != null)
166 vclient = clientfactory.openAsNewSessionIClient(app,
167 vamsasDocument, newDocSessionName);
171 vclient = clientfactory.openAsNewSessionIClient(app,
174 } catch (InvalidSessionDocumentException e)
176 JvOptionPane.showInternalMessageDialog(Desktop.desktop,
178 MessageManager.getString(
179 "label.vamsas_doc_couldnt_be_opened_as_new_session"),
181 .getString("label.vamsas_document_import_failed"),
182 JvOptionPane.ERROR_MESSAGE);
188 // join existing or create a new session
191 vclient = clientfactory.getNewSessionIClient(app);
195 vclient = clientfactory.getIClient(app, sess);
198 // set some properties for our VAMSAS interaction
200 user = vclient.getUserHandle();
202 } catch (Exception e)
204 jalview.bin.Cache.log.error("Couldn't instantiate vamsas client !",
211 private void setVclientConfig()
219 if (vclient instanceof uk.ac.vamsas.client.simpleclient.SimpleClient)
221 uk.ac.vamsas.client.simpleclient.SimpleClientConfig cfg = ((uk.ac.vamsas.client.simpleclient.SimpleClient) vclient)
222 .getSimpleClientConfig();
223 cfg._validatemergedroots = false;
224 cfg._validateupdatedroots = true; // we may write rubbish otherwise.
229 "Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
231 } catch (Exception e)
234 "Probable VAMSAS client incompatibility - carrying on regardless",
240 * make the appHandle for Jalview
244 private ClientHandle getJalviewHandle()
246 return new ClientHandle("jalview.bin.Jalview",
247 jalview.bin.Cache.getProperty("VERSION"));
252 * @return true if we are registered in a vamsas session
254 public boolean inSession()
256 return (vclient != null);
260 * called to connect to session inits handlers, does an initial document
263 public void initial_update()
267 throw new Error(MessageManager.getString(
268 "error.implementation_error_vamsas_operation_not_init"));
270 addDocumentUpdateHandler();
271 addStoreDocumentHandler();
273 inInitialUpdate = true;
275 "Jalview loading the Vamsas Session for the first time.");
276 dealWithDocumentUpdate(false); // we don't push an update out to the
277 inInitialUpdate = false;
279 Cache.log.debug("... finished update for the first time.");
283 * Update all windows after a vamsas datamodel change. this could go on the
287 protected void updateJalviewGui()
289 JInternalFrame[] frames = jdesktop.getAllFrames();
299 for (int i = frames.length - 1; i > -1; i--)
301 if (frames[i] instanceof AlignFrame)
303 AlignFrame af = (AlignFrame) frames[i];
304 af.alignPanel.alignmentChanged();
307 } catch (Exception e)
310 "Exception whilst refreshing jalview windows after a vamsas document update.",
315 public void push_update()
317 Thread udthread = new Thread(new Runnable()
323 Cache.log.info("Jalview updating to the Vamsas Session.");
325 dealWithDocumentUpdate(true);
326 Cache.log.info("Jalview finished updating to the Vamsas Session.");
334 * leave a session, prompting the user to save if necessary
336 public void end_session()
341 private boolean promptUser = true;
344 * leave a session, optionally prompting the user to save if necessary
347 * when true enable prompting by this application
350 public void end_session(boolean promptUser)
354 throw new Error(MessageManager
355 .getString("error.jalview_no_connected_vamsas_session"));
357 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
362 boolean ourprompt = this.promptUser;
363 this.promptUser = promptUser;
364 vclient.finalizeClient();
365 Cache.log.info("Jalview has left the session.");
366 this.promptUser = ourprompt; // restore default value
371 "JV Client leaving a session that's its not joined yet.");
373 joinedSession = false;
379 } catch (Exception e)
381 Cache.log.error("Vamsas Session finalization threw exceptions!", e);
385 public void updateJalview(IClientDocument cdoc)
387 Cache.log.debug("Jalview updating from sesion document ..");
389 VamsasAppDatastore vds = new VamsasAppDatastore(cdoc, vobj2jv, jv2vobj,
390 baseProvEntry(), alRedoState);
393 vds.updateToJalview();
394 } catch (Exception e)
396 Cache.log.error("Failed to update Jalview from vamsas document.", e);
402 vds.updateJalviewFromAppdata();
403 // Comment this out to repeatedly read in data from JalviewAppData
404 // firstUpdate=false;
406 } catch (Exception e)
409 "Exception when updating Jalview settings from Appdata.", e);
411 Cache.log.debug(".. finished updating from sesion document.");
415 boolean firstUpdate = false;
417 private void ensureJvVamsas()
421 jv2vobj = new IdentityHashMap();
422 vobj2jv = new Hashtable();
423 alRedoState = new Hashtable();
429 * jalview object binding to VorbaIds
431 IdentityHashMap jv2vobj = null;
433 Hashtable vobj2jv = null;
435 Hashtable alRedoState = null;
437 boolean errorsDuringUpdate = false;
439 boolean errorsDuringAppUpdate = false;
442 * update the document accessed through doc. A backup of the current object
446 * @return number of views stored in document (updated and new views)
448 public int updateVamsasDocument(IClientDocument doc)
452 errorsDuringUpdate = false;
453 errorsDuringAppUpdate = false;
454 backup_objectMapping();
455 VamsasAppDatastore vds = new VamsasAppDatastore(doc, vobj2jv, jv2vobj,
456 baseProvEntry(), alRedoState);
457 // wander through frames
458 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
464 Hashtable skipList = new Hashtable();
465 Hashtable viewset = new Hashtable();
470 for (int i = frames.length - 1; i > -1; i--)
472 if (frames[i] instanceof AlignFrame)
474 AlignFrame af = (AlignFrame) frames[i];
475 if (!viewset.containsKey(af.getViewport().getSequenceSetId()))
477 // update alignment and root from frame.
478 boolean stored = false;
481 stored = vds.storeVAMSAS(af.getViewport(), af.getTitle());
482 } catch (Exception e)
484 errorsDuringUpdate = true;
485 Cache.log.error("Exception synchronizing " + af.getTitle()
487 + (af.getViewport().viewName == null ? ""
488 : " view " + af.getViewport().viewName)
489 + " to document.", e);
493 { // record skip in skipList
494 skipList.put(af.getViewport().getSequenceSetId(), af);
499 // could try to eliminate sequenceSetId from skiplist ..
500 // (skipList.containsKey(af.getViewport().getSequenceSetId()))
501 // remember sequenceSetId so we can skip all the other views on
503 viewset.put(af.getViewport().getSequenceSetId(), af);
509 // for (int i = frames.length - 1; i > -1; i--)
511 // if (frames[i] instanceof AlignFrame)
513 // AlignFrame af = (AlignFrame) frames[i];
514 Iterator aframes = viewset.values().iterator();
515 while (aframes.hasNext())
517 AlignFrame af = (AlignFrame) aframes.next();
518 // add any AlignedCodonFrame mappings on this alignment to any other.
519 vds.storeSequenceMappings(af.getViewport(), af.getTitle());
521 } catch (Exception e)
523 Cache.log.error("Exception synchronizing Views to Document :", e);
524 errorsDuringUpdate = true;
529 if (viewset.size() > 0)
531 // Alignment views were synchronized, so store their state in the
533 // The skipList ensures we don't write out any alignments not actually
535 vds.setSkipList(skipList);
536 vds.updateJalviewClientAppdata();
538 } catch (Exception e)
540 Cache.log.error("Client Appdata Write exception", e);
541 errorsDuringAppUpdate = true;
547 private Entry baseProvEntry()
549 uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
550 pentry.setUser(user.getFullName());
551 pentry.setApp(app.getClientUrn());
552 pentry.setDate(new java.util.Date());
553 pentry.setAction("created");
558 * do a vamsas document update or update jalview from the vamsas document
561 * true to update from jalview to the vamsas document
562 * @return total number of stored alignments in the document after the update
564 protected int dealWithDocumentUpdate(boolean fromJalview)
567 // called by update handler for document update.
568 Cache.log.debug("Updating jalview from changed vamsas document.");
572 long time = System.currentTimeMillis();
573 IClientDocument cdoc = vclient.getClientDocument();
574 if (Cache.log.isDebugEnabled())
576 Cache.log.debug("Time taken to get ClientDocument = "
577 + (System.currentTimeMillis() - time));
578 time = System.currentTimeMillis();
582 storedviews += updateVamsasDocument(cdoc);
583 if (Cache.log.isDebugEnabled())
586 "Time taken to update Vamsas Document from jalview\t= "
587 + (System.currentTimeMillis() - time));
588 time = System.currentTimeMillis();
590 cdoc.setVamsasRoots(cdoc.getVamsasRoots());
591 if (Cache.log.isDebugEnabled())
593 Cache.log.debug("Time taken to set Document Roots\t\t= "
594 + (System.currentTimeMillis() - time));
595 time = System.currentTimeMillis();
601 if (Cache.log.isDebugEnabled())
604 "Time taken to update Jalview from vamsas document Roots\t= "
605 + (System.currentTimeMillis() - time));
606 time = System.currentTimeMillis();
610 vclient.updateDocument(cdoc);
611 if (Cache.log.isDebugEnabled())
613 Cache.log.debug("Time taken to update Session Document\t= "
614 + (System.currentTimeMillis() - time));
615 time = System.currentTimeMillis();
618 } catch (Exception ee)
620 System.err.println("Exception whilst updating :");
621 ee.printStackTrace(System.err);
622 // recover object map backup, since its probably corrupted with references
623 // to Vobjects that don't exist anymore.
624 recover_objectMappingBackup();
627 Cache.log.debug("Finished updating from document change.");
632 private void addDocumentUpdateHandler()
634 final VamsasApplication client = this;
635 vclient.addDocumentUpdateHandler(new PropertyChangeListener()
638 public void propertyChange(PropertyChangeEvent evt)
640 Cache.log.debug("Dealing with document update event.");
641 client.dealWithDocumentUpdate(false);
642 Cache.log.debug("finished dealing with event.");
645 Cache.log.debug("Added Jalview handler for vamsas document updates.");
648 private void addStoreDocumentHandler()
650 final VamsasApplication client = this;
651 vclient.addVorbaEventHandler(
652 uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
653 new PropertyChangeListener()
656 public void propertyChange(PropertyChangeEvent evt)
658 if (client.promptUser)
661 "Asking user if the vamsas session should be stored.");
662 int reply = JvOptionPane.showInternalConfirmDialog(
664 "The current VAMSAS session has unsaved data - do you want to save it ?",
665 "VAMSAS Session Shutdown",
666 JvOptionPane.YES_NO_OPTION,
667 JvOptionPane.QUESTION_MESSAGE);
669 if (reply == JvOptionPane.YES_OPTION)
671 Cache.log.debug("Prompting for vamsas store filename.");
672 Desktop.instance.vamsasSave_actionPerformed(null);
674 .debug("Finished attempt at storing document.");
677 "finished dealing with REQUESTTOCLOSE event.");
682 "Ignoring store document request (promptUser==false)");
686 Cache.log.debug("Added Jalview handler for vamsas document updates.");
689 public void disableGui(boolean b)
691 Desktop.instance.setVamsasUpdate(b);
694 Hashtable _backup_vobj2jv;
696 IdentityHashMap _backup_jv2vobj;
699 * make a backup of the object mappings (vobj2jv and jv2vobj)
701 public void backup_objectMapping()
703 _backup_vobj2jv = new Hashtable(vobj2jv);
704 _backup_jv2vobj = new IdentityHashMap(jv2vobj);
708 * recover original object mappings from the object mapping backup if document
712 * if backup_objectMapping was not called.
714 public void recover_objectMappingBackup()
716 if (_backup_vobj2jv == null)
720 // nothing to recover so just
724 throw new Error(MessageManager.getString(
725 "error.implementation_error_cannot_recover_vamsas_object_mappings"));
728 Iterator el = _backup_jv2vobj.entrySet().iterator();
731 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
732 jv2vobj.put(mp.getKey(), mp.getValue());
734 el = _backup_vobj2jv.entrySet().iterator();
737 java.util.Map.Entry mp = (java.util.Map.Entry) el.next();
738 vobj2jv.put(mp.getKey(), mp.getValue());
742 private boolean joinedSession = false;
744 private VamsasListener picker = null;
746 private SelectionListener selecter;
748 private void startSession()
754 vclient.joinSession();
755 joinedSession = true;
756 } catch (Exception e)
759 Cache.log.error("Failed to join vamsas session.", e);
764 final IPickManager pm = vclient.getPickManager();
765 final StructureSelectionManager ssm = StructureSelectionManager
766 .getStructureSelectionManager(Desktop.instance);
767 final VamsasApplication me = this;
768 pm.registerMessageHandler(new IMessageHandler()
773 public void handleMessage(Message message)
777 // we are not in a session yet.
780 if (message instanceof MouseOverMessage)
782 MouseOverMessage mm = (MouseOverMessage) message;
783 String mstring = mm.getVorbaID() + " " + mm.getPosition();
784 if (last != null && mstring.equals(last))
788 // if (Cache.log.isDebugEnabled())
790 // Cache.log.debug("Received MouseOverMessage "+mm.getVorbaID()+"
791 // "+mm.getPosition());
793 Object jvobj = vobj2jv.get(mm.getVorbaID());
794 if (jvobj != null && jvobj instanceof SequenceI)
797 // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
798 // bound to "+jvobj+" at "+mm.getPosition());
799 // position is character position in aligned sequence
800 ssm.mouseOverVamsasSequence((SequenceI) jvobj,
801 mm.getPosition(), me);
804 if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
806 // we only care about AlignmentSequence selections
807 SelectionMessage sm = (SelectionMessage) message;
809 System.err.println("Received\n" + sm.getRawMessage());
810 Object[] jvobjs = sm.getVorbaIDs() == null ? null
811 : new Object[sm.getVorbaIDs().length];
814 // TODO: rationalise : can only clear a selection over a
815 // referred to object
816 ssm.sendSelection(null, null, null, me);
821 for (int o = 0; o < jvobjs.length; o++)
823 jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
824 if (jvobjs[o] == null)
826 // can't cope with selections for unmapped objects
831 type = jvobjs[o].getClass();
834 if (type != jvobjs[o].getClass())
837 // discard - can't cope with selections over mixed objects
841 SequenceGroup jselection = null;
842 ColumnSelection colsel = null;
843 if (type == jalview.datamodel.Alignment.class)
845 if (jvobjs.length == 1)
847 // TODO if (sm.isNone())// send a message to select the
848 // specified columns over the
855 if (type == jalview.datamodel.Sequence.class)
859 boolean aligned = ((jalview.datamodel.Sequence) jvobjs[0])
860 .getDatasetSequence() != null;
864 jselection = new SequenceGroup();
865 jselection.addSequence(
866 seq = (jalview.datamodel.Sequence) jvobjs[0],
868 maxWidth = seq.getLength();
870 for (int c = 1; aligned && jvobjs.length > 1
871 && c < jvobjs.length; c++)
873 if (((jalview.datamodel.Sequence) jvobjs[c])
874 .getDatasetSequence() == null)
881 jselection.addSequence(
882 seq = (jalview.datamodel.Sequence) jvobjs[c],
884 if (maxWidth < seq.getLength())
886 maxWidth = seq.getLength();
894 // if cardinality is greater than one then verify all
895 // sequences are alignment sequences.
896 if (jvobjs.length == 1)
898 // find all instances of this dataset sequence in the
899 // displayed alignments containing the associated range and
905 jselection.setStartRes(0);
906 jselection.setEndRes(maxWidth);
907 // locate the alignment containing the given sequences and
908 // select the associated ranges on them.
909 if (sm.getRanges() != null)
911 int[] prange = uk.ac.vamsas.objects.utils.Range
912 .getBounds(sm.getRanges());
913 jselection.setStartRes(prange[0] - 1);
914 jselection.setEndRes(prange[1] - 1);
915 prange = uk.ac.vamsas.objects.utils.Range
916 .getIntervals(sm.getRanges());
917 colsel = new ColumnSelection();
918 for (int p = 0; p < prange.length; p += 2)
920 int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
921 // try to join up adjacent columns to make a larger
923 // lower and upper bounds
924 int l = (d < 0) ? 1 : 0;
925 int u = (d > 0) ? 1 : 0;
927 if (jselection.getStartRes() > 0
928 && prange[p + l] == jselection.getStartRes())
930 jselection.setStartRes(prange[p + l] - 1);
932 if (jselection.getEndRes() <= maxWidth && prange[p
933 + u] == (jselection.getEndRes() + 2))
935 jselection.setEndRes(prange[p + u] - 1);
937 // mark all the columns in the range.
938 for (int sr = prange[p], er = prange[p + 1], de = er
939 + d; sr != de; sr += d)
941 colsel.addElement(sr - 1);
950 ssm.sendSelection(jselection, colsel, null, me);
953 for (int c = 0; c < jvobjs.length; c++)
963 picker = new VamsasListener()
965 SequenceI last = null;
970 public void mouseOverSequence(SequenceI seq, int index,
977 if (seq != last || i != index)
979 VorbaId v = (VorbaId) jv2vobj.get(seq);
982 // this should really be a trace message.
983 // Cache.log.debug("Mouse over " + v.getId() + " bound to "
984 // + seq + " at " + index);
987 MouseOverMessage message = new MouseOverMessage(v.getId(),
989 pm.sendMessage(message);
994 selecter = new SelectionListener()
998 public void selection(SequenceGroup seqsel,
999 ColumnSelection colsel, HiddenColumns hidden,
1000 SelectionSource source)
1002 if (vobj2jv == null)
1005 "Selection listener still active for dead session.");
1006 // not in a session.
1011 AlignmentI visal = null;
1012 if (source instanceof AlignViewport)
1014 visal = ((AlignmentViewport) source).getAlignment();
1016 SelectionMessage sm = null;
1017 if ((seqsel == null || seqsel.getSize() == 0)
1018 && (colsel == null || colsel.getSelected() == null
1019 || colsel.getSelected().size() == 0))
1021 if (source instanceof AlignViewport)
1023 // the empty selection.
1024 sm = new SelectionMessage("jalview",
1026 { ((AlignmentViewport) source)
1027 .getSequenceSetId() },
1032 // the empty selection.
1033 sm = new SelectionMessage("jalview", null, null, true);
1038 String[] vobj = new String[seqsel.getSize()];
1040 for (SequenceI sel : seqsel.getSequences(null))
1042 VorbaId v = (VorbaId) jv2vobj.get(sel);
1045 vobj[o++] = v.toString();
1048 if (o < vobj.length)
1051 vobj = new String[o];
1052 System.arraycopy(t, 0, vobj, 0, o);
1056 if (seqsel != null && colsel != null)
1058 // deparse the colsel into positions on the vamsas alignment
1060 range = new Input();
1061 if (colsel.getSelected() != null
1062 && colsel.getSelected().size() > 0
1064 && seqsel.getSize() == visal.getHeight())
1066 // gather selected columns outwith the sequence positions
1068 for (Integer ival : colsel.getSelected())
1071 p.setI(ival.intValue() + 1);
1077 // int[] intervals = colsel.getVisibleContigs(
1078 // seqsel.getStartRes(), seqsel.getEndRes() + 1);
1079 int[] intervals = hidden.getVisibleContigs(
1080 seqsel.getStartRes(), seqsel.getEndRes() + 1);
1081 for (int iv = 0; iv < intervals.length; iv += 2)
1084 s.setStart(intervals[iv] + 1); // vamsas indices begin at
1086 s.setEnd(intervals[iv + 1] + 1);
1087 s.setInclusive(true);
1092 if (vobj.length > 0)
1094 sm = new SelectionMessage("jalview", vobj, range);
1103 sm.validate(); // debug
1104 Cache.log.debug("Selection Message\n" + sm.getRawMessage());
1111 ssm.addStructureViewerListener(picker); // better method here
1112 ssm.addSelectionListener(selecter);
1113 } catch (Exception e)
1115 Cache.log.error("Failed to init Vamsas Picking", e);
1120 public String getCurrentSession()
1122 if (vclient != null)
1124 return (vclient.getSessionUrn());