import jalview.api.AlignViewportI;
import jalview.commands.CommandI;
import jalview.commands.OrderCommand;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SequenceGroup;
private final StructureSelectionManager ssm;
- private AlignmentPanel[] associatedPanels;
-
private Map<SequenceI, TreeNodeI> sequencesBoundToNodes;
private Map<TreeNodeI, SequenceI> nodesBoundToSequences;
treeView.addMouseListener(this);
treeView.registerWithPaintRefresher(
parentAvport.getSequenceSetId());
- associatedPanels = PaintRefresher
- .getAssociatedPanels(parentAvport.getSequenceSetId());
aptxFrame.addFrameListener(new InternalFrameAdapter()
{
}
}
-
- for (AlignmentPanel associatedPanel : associatedPanels) {
+ for (AlignmentPanel associatedPanel : getAssociatedPanels())
+ {
associatedPanel.updateAnnotation();
treeGroup.setName("Tree Group " + nrTreeGroups);
treeGroup.setIdColour(groupColour);
- for (AlignmentPanel associatedPanel : associatedPanels)
+ for (AlignmentPanel associatedPanel : getAssociatedPanels())
{
AlignViewportI altViewport = associatedPanel
.getAlignViewport();
}
@Override
- public void sortByTree_actionPerformed()// modify for Aptx
+ public void sortByTree_actionPerformed()
{
- // if (treeCanvas.applyToAllViews)
- // {
- // final ArrayList<CommandI> commands = new ArrayList<>();
- // for (AlignmentPanel ap : PaintRefresher
- // .getAssociatedPanels(parentAvport.getSequenceSetId()))
- // {
- // commands.add(sortAlignmentIn(ap.av.getAlignPanel()));
- // }
- // parentAvport.getAlignPanel().alignFrame.addHistoryItem(new CommandI()
- // {
- //
- // @Override
- // public void undoCommand(AlignmentI[] views)
- // {
- // for (CommandI tsort : commands)
- // {
- // tsort.undoCommand(views);
- // }
- // }
- //
- // @Override
- // public int getSize()
- // {
- // return commands.size();
- // }
- //
- // @Override
- // public String getDescription()
- // {
- // return "Tree Sort (many views)";
- // }
- //
- // @Override
- // public void doCommand(AlignmentI[] views)
- // {
- //
- // for (CommandI tsort : commands)
- // {
- // tsort.doCommand(views);
- // }
- // }
- // });
- // for (AlignmentPanel ap : PaintRefresher
- // .getAssociatedPanels(av.getSequenceSetId()))
- // {
- // // ensure all the alignFrames refresh their GI after adding an undo item
- // ap.alignFrame.updateEditMenuBar();
- // }
- // }
- // else
- // {
- // treeCanvas.ap.alignFrame
- // .addHistoryItem(sortAlignmentIn(treeCanvas.ap));
- // }
+ // if (applyToAllViews)
+
+ final ArrayList<CommandI> commands = new ArrayList<>();
+ for (AlignmentPanel ap : PaintRefresher
+ .getAssociatedPanels(parentAvport.getSequenceSetId()))
+ {
+ commands.add(sortAlignmentIn(ap.av.getAlignPanel()));
+ ap.alignFrame.addHistoryItem(new CommandI()
+ {
+
+ @Override
+ public void undoCommand(AlignmentI[] views)
+ {
+ for (CommandI tsort : commands)
+ {
+ tsort.undoCommand(views);
+ }
+ }
+
+ @Override
+ public int getSize()
+ {
+ return commands.size();
+ }
+
+ @Override
+ public String getDescription()
+ {
+ return "Tree Sort (many views)";
+ }
+
+ @Override
+ public void doCommand(AlignmentI[] views)
+ {
+
+ for (CommandI tsort : commands)
+ {
+ tsort.doCommand(views);
+ }
+ }
+ });
+
+ ap.alignFrame.updateEditMenuBar();
+ }
+ }
+ // else
+ // {
+ // alignPanel.alignFrame.addHistoryItem(sortAlignmentIn(alignPanel));
+ // }
+
- }
@Override
public CommandI sortAlignmentIn(AlignmentPanel ap)
public AlignmentPanel[] getAssociatedPanels()
{
- return associatedPanels;
+ return PaintRefresher
+ .getAssociatedPanels(parentAvport.getSequenceSetId());
}
- public void setAssociatedPanels(AlignmentPanel[] associatedPanels)
- {
- this.associatedPanels = associatedPanels;
- }
+
}