From 25e662ba13098a2a0085b44c44bd1193d683e3d7 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 24 Jul 2009 15:24:10 +0000 Subject: [PATCH] headless warning messages, prototype group annotation and annotation update method --- src/jalview/gui/AlignFrame.java | 41 +++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index d5a98fe..131e79e 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -622,6 +622,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewBoxesMenuItem.setSelected(av.showBoxes); viewTextMenuItem.setSelected(av.showText); showUnconservedMenuItem.setSelected(av.showUnconserved); + showGroupConsensus.setSelected(av.showGroupConsensus); + showGroupConservation.setSelected(av.showGroupConservation); setColourSelected(ColourSchemeProperty.getColourName(av .getGlobalColourScheme())); @@ -893,12 +895,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (!jalview.io.AppletFormatAdapter.isValidFormat(format, true)) { - // JBPNote need to have a raise_gui flag here - JOptionPane.showInternalMessageDialog(this, "Cannot save file " + warningMessage("Cannot save file " + fileName + " using format " + format, - "Alignment output format not supported", - JOptionPane.WARNING_MESSAGE); + "Alignment output format not supported"); saveAs_actionPerformed(null); + // JBPNote need to have a raise_gui flag here return false; } @@ -959,6 +960,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return success; } + private void warningMessage(String warning, String title) + { + if (new jalview.util.Platform().isHeadless()) + { + System.err.println("Warning: "+title+"\nWarning: "+warning); + + } else { + JOptionPane.showInternalMessageDialog(this,warning,title,JOptionPane.WARNING_MESSAGE); + } + return; + } + /** * DOCUMENT ME! * @@ -1913,6 +1926,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.sequenceColours = null; viewport.setSelectionGroup(null); PaintRefresher.Refresh(this, viewport.getSequenceSetId()); + alignPanel.updateAnnotation(); alignPanel.paintAlignment(true); } @@ -4412,6 +4426,25 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.setShowUnconserved(showUnconservedMenuItem.getState()); alignPanel.paintAlignment(true); } + + /* (non-Javadoc) + * @see jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event.ActionEvent) + */ + protected void showGroupConsensus_actionPerformed(ActionEvent e) + { + viewport.setShowGroupConsensus(showGroupConsensus.getState()); + alignPanel.updateAnnotation(); + + } + + /* (non-Javadoc) + * @see jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt.event.ActionEvent) + */ + protected void showGroupConservation_actionPerformed(ActionEvent e) + { + viewport.setShowGroupConservation(showGroupConservation.getState()); + alignPanel.updateAnnotation(); + } } class PrintThread extends Thread -- 1.7.10.2