+ AlignViewport getOriginatingSource(CommandI command)
+ {
+ AlignViewport originalSource = null;
+ //For sequence removal and addition, we need to fire
+ //the property change event FROM the viewport where the
+ //original alignment was altered
+ AlignmentI al=null;
+ if (command instanceof EditCommand)
+ {
+ EditCommand editCommand = (EditCommand) command;
+ al = editCommand.getAlignment();
+ Vector comps = (Vector) PaintRefresher.components
+ .get(viewport.getSequenceSetId());
+
+ for (int i = 0; i < comps.size(); i++)
+ {
+ if (comps.elementAt(i) instanceof AlignmentPanel)
+ {
+ if (al == ( (AlignmentPanel) comps.elementAt(i)).av.alignment)
+ {
+ originalSource = ( (AlignmentPanel) comps.elementAt(i)).av;
+ break;
+ }
+ }
+ }
+ }
+
+ if (originalSource == null)
+ {
+ //The original view is closed, we must validate
+ //the current view against the closed view first
+ if (al != null)
+ PaintRefresher.validateSequences(al, viewport.alignment);
+
+ originalSource = viewport;
+ }
+
+ return originalSource;
+ }