X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=4f174d3721120d51ad81791c3fa168840fc1481a;hb=6a62797914bea08062a44e1b30edcdaa8fa3c96f;hp=684e7aca51c57ddde8a561f5ee159850a4f02f04;hpb=e26efc02d16dcec0ef8b96571ff2a785fcb08f12;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 684e7ac..4f174d3 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -30,10 +30,12 @@ import jalview.analysis.ParseProperties; import jalview.analysis.SequenceIdMatcher; import jalview.api.AlignViewControllerGuiI; import jalview.api.AlignViewControllerI; +import jalview.api.AlignmentViewPanel; import jalview.api.analysis.ScoreModelI; import jalview.bin.Cache; import jalview.commands.CommandI; import jalview.commands.EditCommand; +import jalview.commands.EditCommand.Action; import jalview.commands.OrderCommand; import jalview.commands.RemoveGapColCommand; import jalview.commands.RemoveGapsCommand; @@ -53,6 +55,7 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.io.AlignmentProperties; import jalview.io.AnnotationFile; +import jalview.io.BioJsHTMLOutput; import jalview.io.FeaturesFile; import jalview.io.FileLoader; import jalview.io.FormatAdapter; @@ -114,6 +117,7 @@ import java.beans.PropertyChangeEvent; import java.io.File; import java.net.URL; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.Hashtable; import java.util.List; @@ -1231,6 +1235,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel.seqPanel.seqCanvas.getFeatureRenderer()); } + @Override + public void bioJSMenuItem_actionPerformed(ActionEvent e) + { + new BioJsHTMLOutput(alignPanel, + alignPanel.seqPanel.seqCanvas.getFeatureRenderer()); + } public void createImageMap(File file, String image) { alignPanel.makePNGImageMap(file, image); @@ -1410,7 +1420,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (viewport.historyList.size() > 0) { undoMenuItem.setEnabled(true); - CommandI command = (CommandI) viewport.historyList.peek(); + CommandI command = viewport.historyList.peek(); undoMenuItem.setText(MessageManager.formatMessage( "label.undo_command", new String[] { command.getDescription() })); @@ -1425,7 +1435,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { redoMenuItem.setEnabled(true); - CommandI command = (CommandI) viewport.redoList.peek(); + CommandI command = viewport.redoList.peek(); redoMenuItem.setText(MessageManager.formatMessage( "label.redo_command", new String[] { command.getDescription() })); @@ -1489,7 +1499,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { return; } - CommandI command = (CommandI) viewport.historyList.pop(); + CommandI command = viewport.historyList.pop(); viewport.redoList.push(command); command.undoCommand(getViewAlignments()); @@ -1528,7 +1538,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return; } - CommandI command = (CommandI) viewport.redoList.pop(); + CommandI command = viewport.redoList.pop(); viewport.historyList.push(command); command.doCommand(getViewAlignments()); @@ -1990,7 +2000,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // ///// // ADD HISTORY ITEM // - addHistoryItem(new EditCommand(MessageManager.getString("label.add_sequences"), EditCommand.PASTE, + addHistoryItem(new EditCommand( + MessageManager.getString("label.add_sequences"), + Action.PASTE, sequences, 0, alignment.getWidth(), alignment)); } // Add any annotations attached to sequences @@ -2261,8 +2273,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, /* * //ADD HISTORY ITEM */ - addHistoryItem(new EditCommand(MessageManager.getString("label.cut_sequences"), EditCommand.CUT, cut, - sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1, + addHistoryItem(new EditCommand( + MessageManager.getString("label.cut_sequences"), Action.CUT, + cut, sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1, viewport.getAlignment())); viewport.setSelectionGroup(null); @@ -4180,6 +4193,21 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ msa = viewport.getAlignmentView(true); } + else if (viewport.getSelectionGroup() != null + && viewport.getSelectionGroup().getSize() == 1) + { + int option = JOptionPane + .showConfirmDialog( +this, + "More than one sequece group selection is required for this Job, click \n'Cancel' to edit your selection or 'Ok' to submit the entire sequence.", + "Invalid selection", + JOptionPane.OK_CANCEL_OPTION); + if (option == JOptionPane.OK_OPTION) + { + msa = viewport.getAlignmentView(false); + } + + } else { /* @@ -5797,7 +5825,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, aa.visible = visible; } } - this.alignPanel.paintAlignment(true); + alignPanel.validateAnnotationDimensions(false); + alignPanel.alignmentChanged(); } /** @@ -5811,6 +5840,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, .setShowAutocalculatedAbove(isShowAutoCalculatedAbove()); alignPanel.paintAlignment(true); } + + /** + * + * @return alignment panels in this alignemnt frame + */ + public List getAlignPanels() + { + return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels; + } } class PrintThread extends Thread