String setid = "";
String viewid = "";
AlignFrame src = _af;
- // filter events if necessary
- if (source instanceof AlignViewport)
+ if (source != null)
{
- if (_af != null
- && !_af.alignPanel.av.getSequenceSetId().equals(
- ((AlignViewport) source).getSequenceSetId()))
+ if (source instanceof jalview.appletgui.AlignViewport
+ && ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame.viewport == source)
{
- return;
- }
- jalview.appletgui.AlignmentPanel[] aps = jalview.appletgui.PaintRefresher
- .getAssociatedPanels(setid = ((AlignViewport) source)
- .getSequenceSetId());
- for (int a = 0; a < aps.length; a++)
- {
- System.out.println("Selection: testing source alignPanel : "
- + aps[a].getName());
- if (aps[a].av == source)
- {
- src = aps[a].alignFrame;
- }
+ // should be valid if it just generated an event!
+ src = ((jalview.appletgui.AlignViewport) source).applet.currentAlignFrame;
+
}
}
- else
- {
- // unhandled!
- System.err.println("Unhandled selection source !");
- return;
- }
String[] seqs = new String[]
{};
String[] cols = new String[]