import uk.ac.vamsas.client.picking.IPickManager;
import uk.ac.vamsas.client.picking.Message;
import uk.ac.vamsas.client.picking.MouseOverMessage;
+import uk.ac.vamsas.client.picking.SelectionMessage;
import uk.ac.vamsas.objects.core.Entry;
/**
public void handleMessage(Message message)
{
- if (message instanceof MouseOverMessage && vobj2jv != null)
+ if (vobj2jv==null)
+ {
+ // we are not in a session yet.
+ return;
+ }
+ if (message instanceof MouseOverMessage)
{
MouseOverMessage mm = (MouseOverMessage) message;
String mstring = mm.getVorbaID() + " " + mm.getPosition();
.getPosition());
}
}
+ if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
+ {
+ // we only care about AlignmentSequence selections
+ SelectionMessage sm = (SelectionMessage) message;
+
+ Object[] jvobjs = new Object[sm.getVorbaIDs().length];
+ Class type = null;
+ for (int o=0;o<jvobjs.length; o++)
+ {
+ jvobjs[o] = vobj2jv.get(sm.getVorbaIDs()[o]);
+ if (jvobjs[o]==null)
+ {
+ // can't cope with selections for unmapped objects
+ continue;
+ }
+ if (type==null){ type = jvobjs[o].getClass(); };
+ if (type != jvobjs[o].getClass())
+ {
+ // discard - can't cope with selections over mixed objects
+ continue;
+ }
+ }
+ if (type == jalview.datamodel.Alignment.class)
+ {
+ if (jvobjs.length==1) {
+ // othewise discard - can't cope with multiple alignment selections (at the moment) ?
+ ;
+ }
+ // send a message to select the specified columns over the given alignment
+ }
+ if (type == jalview.datamodel.Sequence.class)
+ {
+ boolean aligned = ((jalview.datamodel.Sequence)jvobjs[0]).getDatasetSequence()==null;
+ for (int c=0; jvobjs.length>1 && c<jvobjs.length; c++)
+ {
+ if (((jalview.datamodel.Sequence) jvobjs[c]).getDatasetSequence()==null)
+ {
+ aligned=false;
+ continue;
+ }
+ }
+ if (!aligned)
+ {
+ // if cardinality is greater than one then verify all sequences are alignment sequences.
+ if (jvobjs.length==1)
+ {
+ // find all instances of this dataset sequence in the displayed alignments containing the associated range and select them.
+ }
+ } else {
+ // locate the alignment containing the given sequences and select the associated ranges on them.
+ }
+ }
+ // discard message.
+ for (int c=0;c<jvobjs.length;c++) { jvobjs[c] = null;};
+ jvobjs=null;
+ return;
+ }
}
});
picker = new VamsasListener()
VorbaId v = (VorbaId) jv2vobj.get(seq);
if (v != null)
{
- Cache.log.debug("Mouse over " + v.getId() + " bound to "
- + seq + " at " + index);
+ //Cache.log.debug("Mouse over " + v.getId() + " bound to "
+ // + seq + " at " + index);
last = seq;
i = index;
MouseOverMessage message = new MouseOverMessage(v.getId(),