/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 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.
- *
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.gui;
import jalview.structure.SelectionSource;
import jalview.structure.StructureSelectionManager;
import jalview.structure.VamsasListener;
+import jalview.structure.VamsasSource;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import uk.ac.vamsas.client.IClient;
import uk.ac.vamsas.client.IClientDocument;
import uk.ac.vamsas.client.InvalidSessionDocumentException;
-import uk.ac.vamsas.client.NoDefaultSessionException;
import uk.ac.vamsas.client.UserHandle;
import uk.ac.vamsas.client.VorbaId;
import uk.ac.vamsas.client.picking.IMessageHandler;
* @author jimp
*
*/
-public class VamsasApplication implements SelectionSource
+public class VamsasApplication implements SelectionSource, VamsasSource
{
IClient vclient = null;
} catch (Error e)
{
Cache.log
- .warn(
- "Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
+ .warn("Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
e);
} catch (Exception e)
{
Cache.log
- .warn(
- "Probable VAMSAS client incompatibility - carrying on regardless",
+ .warn("Probable VAMSAS client incompatibility - carrying on regardless",
e);
}
}
*/
private ClientHandle getJalviewHandle()
{
- return new ClientHandle("jalview.bin.Jalview", jalview.bin.Cache
- .getProperty("VERSION"));
+ return new ClientHandle("jalview.bin.Jalview",
+ jalview.bin.Cache.getProperty("VERSION"));
}
/**
} catch (Exception e)
{
Cache.log
- .warn(
- "Exception whilst refreshing jalview windows after a vamsas document update.",
+ .warn("Exception whilst refreshing jalview windows after a vamsas document update.",
e);
}
}
{
final IPickManager pm = vclient.getPickManager();
final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager();
- final SelectionSource me = this;
+ .getStructureSelectionManager(Desktop.instance);
+ final VamsasApplication me = this;
pm.registerMessageHandler(new IMessageHandler()
{
String last = null;
// Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
// bound to "+jvobj+" at "+mm.getPosition());
// position is character position in aligned sequence
- ssm.mouseOverVamsasSequence((SequenceI) jvobj, mm
- .getPosition());
+ ssm.mouseOverVamsasSequence((SequenceI) jvobj,
+ mm.getPosition(), me);
}
}
if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
int i = -1;
- public void mouseOver(SequenceI seq, int index)
+ public void mouseOver(SequenceI seq, int index,
+ VamsasSource source)
{
if (jv2vobj == null)
return;
{
String[] vobj = new String[seqsel.getSize()];
int o = 0;
- Enumeration sels = seqsel.getSequences(null).elements();
- while (sels.hasMoreElements())
+ for (SequenceI sel : seqsel.getSequences(null))
{
- SequenceI sel = (SequenceI) sels.nextElement();
VorbaId v = (VorbaId) jv2vobj.get(sel);
if (v != null)
{
}
else
{
- int[] intervals = colsel.getVisibleContigs(seqsel
- .getStartRes(), seqsel.getEndRes() + 1);
+ int[] intervals = colsel.getVisibleContigs(
+ seqsel.getStartRes(), seqsel.getEndRes() + 1);
for (int iv = 0; iv < intervals.length; iv += 2)
{
Seg s = new Seg();