- // this should really be a trace message.
- // Cache.log.debug("Mouse over " + v.getId() + " bound to "
- // + seq + " at " + index);
- last = seq;
- i = index;
- try {
- JSObject js = JSObject.getWindow(jvlite);
- js.call(_listener, new Object[] { _af, seq.getDisplayId(false), ""+(1+i)});
- } catch (Exception ex)
+ // this should really be a trace message.
+ // Cache.log.debug("Mouse over " + v.getId() + " bound to "
+ // + seq + " at " + index);
+ last = seq;
+ i = index;
+ AlignFrame src = null;
+ try
+ {
+ if (source != null)
+ {
+ if (source instanceof jalview.appletgui.AlignViewport
+ && ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame.viewport == source)
+ {
+ // should be valid if it just generated an event!
+ src = ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame;
+
+ }
+ // TODO: ensure that if '_af' is specified along with a handler
+ // function, then only events from that alignFrame are sent to that
+ // function
+ }
+ executeJavascriptFunction(
+ _listener,
+ new Object[]
+ { src, seq.getDisplayId(false), "" + (1 + i),
+ "" + seq.findPosition(i) });
+ } catch (Exception ex)
+ {
+
+ System.err
+ .println("JalviewLite javascript error: Couldn't send mouseOver with handler '"
+ + _listener + "'");
+ if (ex instanceof netscape.javascript.JSException)