JAL-1998 JAL-3772 JAL-3416 Merge conflict resolution of JalviewFileChooser and JvOpti...
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 4 Nov 2022 17:53:36 +0000 (17:53 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 4 Nov 2022 17:53:36 +0000 (17:53 +0000)
37 files changed:
resources/images/windowIcons/alignmentIcon.png [new file with mode: 0644]
resources/images/windowIcons/annotationIcon.png [new file with mode: 0644]
resources/images/windowIcons/featuresIcon.png [new file with mode: 0644]
resources/images/windowIcons/fetchIcon.png [new file with mode: 0644]
resources/images/windowIcons/overviewIcon.png [new file with mode: 0644]
resources/images/windowIcons/plainIcon.png [new file with mode: 0644]
resources/images/windowIcons/preferencesIcon.png [new file with mode: 0644]
resources/images/windowIcons/splitIcon.png [new file with mode: 0644]
resources/images/windowIcons/structureIcon.png [new file with mode: 0644]
resources/images/windowIcons/treeIcon.png [new file with mode: 0644]
src/jalview/bin/Jalview.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AnnotationChooser.java
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/AnnotationColumnChooser.java
src/jalview/gui/AnnotationExporter.java
src/jalview/gui/AppVarna.java
src/jalview/gui/CalculationChooser.java
src/jalview/gui/CutAndPasteHtmlTransfer.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/gui/Desktop.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/Finder.java
src/jalview/gui/FontChooser.java
src/jalview/gui/JvOptionPane.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/Preferences.java
src/jalview/gui/RedundancyPanel.java
src/jalview/gui/SequenceFetcher.java
src/jalview/gui/SliderPanel.java
src/jalview/gui/SplitFrame.java
src/jalview/gui/StructureViewerBase.java
src/jalview/gui/TreePanel.java
src/jalview/gui/UserDefinedColours.java
src/jalview/gui/WebserviceInfo.java
src/jalview/gui/WindowIcons.java [new file with mode: 0644]
src/jalview/io/JalviewFileChooser.java

diff --git a/resources/images/windowIcons/alignmentIcon.png b/resources/images/windowIcons/alignmentIcon.png
new file mode 100644 (file)
index 0000000..9f3d779
Binary files /dev/null and b/resources/images/windowIcons/alignmentIcon.png differ
diff --git a/resources/images/windowIcons/annotationIcon.png b/resources/images/windowIcons/annotationIcon.png
new file mode 100644 (file)
index 0000000..a730b7e
Binary files /dev/null and b/resources/images/windowIcons/annotationIcon.png differ
diff --git a/resources/images/windowIcons/featuresIcon.png b/resources/images/windowIcons/featuresIcon.png
new file mode 100644 (file)
index 0000000..84da9f8
Binary files /dev/null and b/resources/images/windowIcons/featuresIcon.png differ
diff --git a/resources/images/windowIcons/fetchIcon.png b/resources/images/windowIcons/fetchIcon.png
new file mode 100644 (file)
index 0000000..570a929
Binary files /dev/null and b/resources/images/windowIcons/fetchIcon.png differ
diff --git a/resources/images/windowIcons/overviewIcon.png b/resources/images/windowIcons/overviewIcon.png
new file mode 100644 (file)
index 0000000..924ac70
Binary files /dev/null and b/resources/images/windowIcons/overviewIcon.png differ
diff --git a/resources/images/windowIcons/plainIcon.png b/resources/images/windowIcons/plainIcon.png
new file mode 100644 (file)
index 0000000..dbbad71
Binary files /dev/null and b/resources/images/windowIcons/plainIcon.png differ
diff --git a/resources/images/windowIcons/preferencesIcon.png b/resources/images/windowIcons/preferencesIcon.png
new file mode 100644 (file)
index 0000000..29ebf39
Binary files /dev/null and b/resources/images/windowIcons/preferencesIcon.png differ
diff --git a/resources/images/windowIcons/splitIcon.png b/resources/images/windowIcons/splitIcon.png
new file mode 100644 (file)
index 0000000..c6a0520
Binary files /dev/null and b/resources/images/windowIcons/splitIcon.png differ
diff --git a/resources/images/windowIcons/structureIcon.png b/resources/images/windowIcons/structureIcon.png
new file mode 100644 (file)
index 0000000..8cda58b
Binary files /dev/null and b/resources/images/windowIcons/structureIcon.png differ
diff --git a/resources/images/windowIcons/treeIcon.png b/resources/images/windowIcons/treeIcon.png
new file mode 100644 (file)
index 0000000..02f04ed
Binary files /dev/null and b/resources/images/windowIcons/treeIcon.png differ
index b5e1958..b87a14d 100755 (executable)
@@ -1157,6 +1157,8 @@ public class Jalview
       UIManager.put("TabbedPane.tabWidthMode", "compact");
       UIManager.put("TabbedPane.selectedBackground", Color.white);
     }
+
+    Desktop.setLiveDragMode(Cache.getDefault("FLAT_LIVE_DRAG_MODE", true));
     return set;
   }
 
index d8fec3a..c11b866 100644 (file)
@@ -350,6 +350,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
+    setFrameIcon(WindowIcons.alignmentIcon);
+
     // setBackground(Color.white); // BH 2019
 
     if (!Jalview.isHeadlessMode())
@@ -3447,6 +3449,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             .formatMessage("label.overview_params", new Object[]
             { this.getTitle() }), true, frame.getWidth(), frame.getHeight(),
             true, true);
+    frame.setFrameIcon(WindowIcons.overviewIcon);
     frame.pack();
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     frame.addInternalFrameListener(
index 791421d..ad5e574 100644 (file)
  */
 package jalview.gui;
 
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SequenceGroup;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Checkbox;
 import java.awt.CheckboxGroup;
@@ -45,6 +40,11 @@ import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 import javax.swing.JPanel;
 
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceGroup;
+import jalview.util.MessageManager;
+
 /**
  * A panel that allows the user to select which sequence-associated annotation
  * rows to show or hide.
@@ -602,6 +602,7 @@ public class AnnotationChooser extends JPanel
   private void showFrame()
   {
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.annotationIcon);
     frame.setContentPane(this);
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     Desktop.addInternalFrame(frame,
index 4e9a26d..77dc1c5 100644 (file)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.GraphLine;
-import jalview.datamodel.SequenceGroup;
-import jalview.gui.JalviewColourChooser.ColourChooserListener;
-import jalview.schemes.AnnotationColourGradient;
-import jalview.schemes.ColourSchemeI;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -48,6 +39,14 @@ import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 import javax.swing.JPanel;
 
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.GraphLine;
+import jalview.datamodel.SequenceGroup;
+import jalview.gui.JalviewColourChooser.ColourChooserListener;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
+import jalview.util.MessageManager;
 import net.miginfocom.swing.MigLayout;
 
 @SuppressWarnings("serial")
@@ -87,6 +86,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter
       }
     }
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.annotationIcon);
     frame.setContentPane(this);
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     Desktop.addInternalFrame(frame,
index c0d4708..401df42 100644 (file)
 
 package jalview.gui;
 
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.HiddenColumns;
-import jalview.io.cache.JvCacheableInputBox;
-import jalview.schemes.AnnotationColourGradient;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
-
 import java.awt.BorderLayout;
 import java.awt.CardLayout;
 import java.awt.Color;
@@ -50,6 +42,13 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.border.TitledBorder;
 
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.HiddenColumns;
+import jalview.io.cache.JvCacheableInputBox;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
 import net.miginfocom.swing.MigLayout;
 
 @SuppressWarnings("serial")
@@ -98,6 +97,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter
   {
     super(av, ap);
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.annotationIcon);
     frame.setContentPane(this);
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     Desktop.addInternalFrame(frame,
index 1efd100..c22761a 100644 (file)
  */
 package jalview.gui;
 
-import java.util.Locale;
-
-import jalview.api.FeatureRenderer;
-import jalview.bin.Cache;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.SequenceI;
-import jalview.io.AnnotationFile;
-import jalview.io.FeaturesFile;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.util.MessageManager;
-
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Locale;
 
 import javax.swing.BoxLayout;
 import javax.swing.ButtonGroup;
@@ -50,6 +39,16 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.SwingConstants;
 
+import jalview.api.FeatureRenderer;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.SequenceI;
+import jalview.io.AnnotationFile;
+import jalview.io.FeaturesFile;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.util.MessageManager;
+
 /**
  * 
  * GUI dialog for exporting features or alignment annotations depending upon
@@ -108,6 +107,7 @@ public class AnnotationExporter extends JPanel
     }
 
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.annotationIcon);
     frame.setContentPane(this);
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     Dimension preferredSize = frame.getPreferredSize();
index 3a64716..6fac8fc 100644 (file)
  */
 package jalview.gui;
 
-import jalview.analysis.AlignSeq;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.HiddenColumns;
-import jalview.datamodel.RnaViewerModel;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.ext.varna.RnaModel;
-import jalview.structure.SecondaryStructureListener;
-import jalview.structure.SelectionListener;
-import jalview.structure.SelectionSource;
-import jalview.structure.StructureSelectionManager;
-import jalview.structure.VamsasSource;
-import jalview.util.Comparison;
-import jalview.util.MessageManager;
-import jalview.util.ShiftList;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.util.Collection;
@@ -60,6 +43,22 @@ import fr.orsay.lri.varna.models.FullBackup;
 import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation;
 import fr.orsay.lri.varna.models.rna.ModeleBase;
 import fr.orsay.lri.varna.models.rna.RNA;
+import jalview.analysis.AlignSeq;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.RnaViewerModel;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.ext.varna.RnaModel;
+import jalview.structure.SecondaryStructureListener;
+import jalview.structure.SelectionListener;
+import jalview.structure.SelectionSource;
+import jalview.structure.StructureSelectionManager;
+import jalview.structure.VamsasSource;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+import jalview.util.ShiftList;
 
 public class AppVarna extends JInternalFrame
         implements SelectionListener, SecondaryStructureListener,
@@ -216,6 +215,7 @@ public class AppVarna extends JInternalFrame
    */
   protected AppVarna(AlignmentPanel ap)
   {
+    this.setFrameIcon(null);
     this.ap = ap;
     this.viewId = System.currentTimeMillis() + "." + this.hashCode();
     vab = new AppVarnaBinding();
index f7e5413..dda0a9f 100644 (file)
  */
 package jalview.gui;
 
-import jalview.analysis.TreeBuilder;
-import jalview.analysis.scoremodels.ScoreModels;
-import jalview.analysis.scoremodels.SimilarityParams;
-import jalview.api.analysis.ScoreModelI;
-import jalview.api.analysis.SimilarityParamsI;
-import jalview.bin.Cache;
-import jalview.datamodel.SequenceGroup;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -61,6 +52,15 @@ import javax.swing.JRadioButton;
 import javax.swing.event.InternalFrameAdapter;
 import javax.swing.event.InternalFrameEvent;
 
+import jalview.analysis.TreeBuilder;
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
+import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
+import jalview.datamodel.SequenceGroup;
+import jalview.util.MessageManager;
+
 /**
  * A dialog where a user can choose and action Tree or PCA calculation options
  */
@@ -130,6 +130,7 @@ public class CalculationChooser extends JPanel
   {
     setLayout(new BorderLayout());
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.treeIcon);
     frame.setContentPane(this);
     this.setBackground(Color.white);
     frame.addFocusListener(new FocusListener()
index 6e0032f..5c94d54 100644 (file)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GCutAndPasteHtmlTransfer;
-import jalview.util.MessageManager;
-import jalview.viewmodel.AlignmentViewport;
-
 import java.awt.Toolkit;
 import java.awt.datatransfer.Clipboard;
 import java.awt.datatransfer.StringSelection;
@@ -44,6 +37,13 @@ import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkEvent.EventType;
 import javax.swing.event.HyperlinkListener;
 
+import jalview.bin.Cache;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GCutAndPasteHtmlTransfer;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+
 /**
  * Cut'n'paste files into the desktop See JAL-1105
  * 
@@ -58,6 +58,7 @@ public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
   public CutAndPasteHtmlTransfer()
   {
     super();
+    this.setFrameIcon(WindowIcons.logoIcon);
     displaySource.setSelected(false);
     textarea.addKeyListener(new KeyListener()
     {
index 112d502..bc3c0d2 100644 (file)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
+
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.ComplexAlignFile;
 import jalview.api.FeatureSettingsModelI;
 import jalview.api.FeaturesDisplayedI;
 import jalview.api.FeaturesSourceI;
+import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.HiddenColumns;
@@ -45,22 +61,6 @@ import jalview.json.binding.biojson.v1.ColourSchemeMapper;
 import jalview.schemes.ColourSchemeI;
 import jalview.util.MessageManager;
 
-import java.awt.Toolkit;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.StringSelection;
-import java.awt.datatransfer.Transferable;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-
 /**
  * Cut'n'paste files into the desktop See JAL-1105
  * 
@@ -78,6 +78,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
 
   public CutAndPasteTransfer()
   {
+    this.setFrameIcon(null);
     SwingUtilities.invokeLater(new Runnable()
     {
       @Override
index 9e3eb55..2605195 100644 (file)
@@ -191,6 +191,14 @@ public class Desktop extends jalview.jbgui.GDesktop
 
   public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
 
+  private static int DRAG_MODE = JDesktopPane.OUTLINE_DRAG_MODE;
+
+  public static void setLiveDragMode(boolean b)
+  {
+    DRAG_MODE = b ? JDesktopPane.LIVE_DRAG_MODE
+            : JDesktopPane.OUTLINE_DRAG_MODE;
+  }
+
   private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
 
   public static boolean nosplash = false;
@@ -487,7 +495,7 @@ public class Desktop extends jalview.jbgui.GDesktop
     }
 
     getContentPane().add(desktop, BorderLayout.CENTER);
-    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
+    desktop.setDragMode(DRAG_MODE);
 
     // This line prevents Windows Look&Feel resizing all new windows to maximum
     // if previous window was maximised
index 0d6d371..ebd4712 100644 (file)
@@ -411,6 +411,7 @@ public class FeatureSettings extends JPanel
     {
       frame = new JInternalFrame();
       frame.setContentPane(this);
+      frame.setFrameIcon(WindowIcons.featuresIcon);
       Rectangle bounds = af.getFeatureSettingsGeometry();
       String title;
       if (af.getAlignPanels().size() > 1 || Desktop.getAlignmentPanels(
index 358d9a4..ee70565 100755 (executable)
@@ -20,8 +20,6 @@
  */
 package jalview.gui;
 
-import java.util.Locale;
-
 import java.awt.Dimension;
 import java.awt.event.ActionEvent;
 import java.awt.event.FocusAdapter;
@@ -30,6 +28,7 @@ import java.awt.event.KeyEvent;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -109,6 +108,7 @@ public class Finder extends GFinder
     focusFixed = fixedFocus;
     finders = new HashMap<>();
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.logoIcon);
     frame.setContentPane(this);
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     frame.addInternalFrameListener(new InternalFrameAdapter()
index 92cc4c6..2e8e667 100755 (executable)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
-import jalview.jbgui.GFontChooser;
-import jalview.util.MessageManager;
-
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.geom.Rectangle2D;
@@ -31,6 +27,10 @@ import java.awt.geom.Rectangle2D;
 import javax.swing.JInternalFrame;
 import javax.swing.JLayeredPane;
 
+import jalview.bin.Cache;
+import jalview.jbgui.GFontChooser;
+import jalview.util.MessageManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -112,6 +112,7 @@ public class FontChooser extends GFontChooser
   void init()
   {
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.logoIcon);
     frame.setContentPane(this);
 
     smoothFont.setSelected(ap.av.antiAlias);
index b58ea41..752f25c 100644 (file)
 
 package jalview.gui;
 
+import java.awt.AWTEvent;
+import java.awt.ActiveEvent;
 import java.awt.Component;
+import java.awt.Container;
 import java.awt.Dialog.ModalityType;
+import java.awt.EventQueue;
 import java.awt.HeadlessException;
+import java.awt.MenuComponent;
+import java.awt.Toolkit;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseMotionAdapter;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
@@ -42,10 +50,13 @@ import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
+import javax.swing.event.InternalFrameEvent;
+import javax.swing.event.InternalFrameListener;
 
 import jalview.util.Platform;
 import jalview.util.dialogrunner.DialogRunnerI;
@@ -55,7 +66,7 @@ public class JvOptionPane extends JOptionPane
 {
   private static final long serialVersionUID = -3019167117756785229L;
 
-  private static Object mockResponse = JOptionPane.CANCEL_OPTION;
+  private static Object mockResponse = JvOptionPane.CANCEL_OPTION;
 
   private static boolean interactiveMode = true;
 
@@ -103,17 +114,17 @@ public class JvOptionPane extends JOptionPane
     }
     switch (optionType)
     {
-    case JOptionPane.YES_NO_CANCEL_OPTION:
+    case JvOptionPane.YES_NO_CANCEL_OPTION:
       // FeatureRenderer amendFeatures ?? TODO ??
       // Chimera close
       // PromptUserConfig
       // $FALL-THROUGH$
     default:
-    case JOptionPane.YES_NO_OPTION:
+    case JvOptionPane.YES_NO_OPTION:
       // PromptUserConfig usage stats
       // for now treated as "OK CANCEL"
       // $FALL-THROUGH$
-    case JOptionPane.OK_CANCEL_OPTION:
+    case JvOptionPane.OK_CANCEL_OPTION:
       // will fall back to simple HTML
       return JOptionPane.showConfirmDialog(parentComponent, message, title,
               optionType);
@@ -201,13 +212,13 @@ public class JvOptionPane extends JOptionPane
     }
     switch (optionType)
     {
-    case JOptionPane.YES_NO_CANCEL_OPTION:
+    case JvOptionPane.YES_NO_CANCEL_OPTION:
       // ColourMenuHelper.addMenuItmers.offerRemoval TODO
-    case JOptionPane.YES_NO_OPTION:
+    case JvOptionPane.YES_NO_OPTION:
       // UserDefinedColoursSave -- relevant? TODO
       // $FALL-THROUGH$
     default:
-    case JOptionPane.OK_CANCEL_OPTION:
+    case JvOptionPane.OK_CANCEL_OPTION:
 
       // EditNameDialog --- uses panel for messsage TODO
 
@@ -236,13 +247,13 @@ public class JvOptionPane extends JOptionPane
     }
     switch (optionType)
     {
-    case JOptionPane.YES_NO_CANCEL_OPTION:
-    case JOptionPane.YES_NO_OPTION:
+    case JvOptionPane.YES_NO_CANCEL_OPTION:
+    case JvOptionPane.YES_NO_OPTION:
       // UserQuestionanaireCheck
       // VamsasApplication
       // $FALL-THROUGH$
     default:
-    case JOptionPane.OK_CANCEL_OPTION:
+    case JvOptionPane.OK_CANCEL_OPTION:
       // will fall back to simple HTML
       return JOptionPane.showConfirmDialog(parentComponent, message, title,
               optionType, messageType);
@@ -270,11 +281,11 @@ public class JvOptionPane extends JOptionPane
     }
     switch (optionType)
     {
-    case JOptionPane.YES_NO_CANCEL_OPTION:
-    case JOptionPane.YES_NO_OPTION:
+    case JvOptionPane.YES_NO_CANCEL_OPTION:
+    case JvOptionPane.YES_NO_OPTION:
       //$FALL-THROUGH$
     default:
-    case JOptionPane.OK_CANCEL_OPTION:
+    case JvOptionPane.OK_CANCEL_OPTION:
       // Preferences editLink/newLink
       return JOptionPane.showConfirmDialog(parentComponent, message, title,
               optionType, messageType, icon);
@@ -711,7 +722,7 @@ public class JvOptionPane extends JOptionPane
 
   public static void resetMock()
   {
-    setMockResponse(JOptionPane.CANCEL_OPTION);
+    setMockResponse(JvOptionPane.CANCEL_OPTION);
     setInteractiveMode(true);
   }
 
@@ -734,10 +745,10 @@ public class JvOptionPane extends JOptionPane
     {
       switch (messageType)
       {
-      case JOptionPane.WARNING_MESSAGE:
+      case JvOptionPane.WARNING_MESSAGE:
         prefix = "WARNING! ";
         break;
-      case JOptionPane.ERROR_MESSAGE:
+      case JvOptionPane.ERROR_MESSAGE:
         prefix = "ERROR! ";
         break;
       default:
@@ -927,13 +938,101 @@ public class JvOptionPane extends JOptionPane
        * attached to the button press of the dialog.  This means we can use
        * a non-modal JDialog for the confirmation without blocking the GUI.
        */
+      JOptionPane joptionpane = new JOptionPane();
+      // Make button options
+      int[] buttonActions = { JvOptionPane.YES_OPTION,
+          JvOptionPane.NO_OPTION, JvOptionPane.CANCEL_OPTION };
 
-      JDialog dialog = createDialog(parentComponent, message, title,
-              optionType, messageType, icon, options, initialValue, modal,
-              buttons);
-      jalview.bin.Console.debug("About to setVisible(true)");
+      // we need the strings to make the buttons with actionEventListener
+      if (options == null)
+      {
+        ArrayList<String> options_default = new ArrayList<>();
+        options_default
+                .add(UIManager.getString("OptionPane.yesButtonText"));
+        if (optionType == JvOptionPane.YES_NO_OPTION
+                || optionType == JvOptionPane.YES_NO_CANCEL_OPTION)
+        {
+          options_default
+                  .add(UIManager.getString("OptionPane.noButtonText"));
+        }
+        if (optionType == JvOptionPane.YES_NO_CANCEL_OPTION)
+        {
+          options_default
+                  .add(UIManager.getString("OptionPane.cancelButtonText"));
+        }
+        options = options_default.toArray();
+      }
+
+      ArrayList<JButton> options_btns = new ArrayList<>();
+      Object initialValue_btn = null;
+      if (!Platform.isJS()) // JalviewJS already uses callback, don't need to add them here
+      {
+        for (int i = 0; i < options.length && i < 3; i++)
+        {
+          Object o = options[i];
+          int buttonAction = buttonActions[i];
+          Runnable action = callbacks.get(buttonAction);
+          JButton jb = new JButton();
+          jb.setText((String) o);
+          jb.addActionListener(new ActionListener()
+          {
+            @Override
+            public void actionPerformed(ActionEvent e)
+            {
+              joptionpane.setValue(buttonAction);
+              if (action != null)
+                Executors.defaultThreadFactory().newThread(action).start();
+              // joptionpane.transferFocusBackward();
+              joptionpane.transferFocusBackward();
+              joptionpane.setVisible(false);
+              // put focus and raise parent window if possible, unless cancel
+              // button pressed
+              boolean raiseParent = (parentComponent != null);
+              if (buttonAction == JvOptionPane.CANCEL_OPTION)
+                raiseParent = false;
+              if (optionType == JvOptionPane.YES_NO_OPTION
+                      && buttonAction == JvOptionPane.NO_OPTION)
+                raiseParent = false;
+              if (raiseParent)
+              {
+                parentComponent.requestFocus();
+                if (parentComponent instanceof JInternalFrame)
+                {
+                  JInternalFrame jif = (JInternalFrame) parentComponent;
+                  jif.show();
+                  jif.moveToFront();
+                  jif.grabFocus();
+                }
+                else if (parentComponent instanceof Window)
+                {
+                  Window w = (Window) parentComponent;
+                  w.toFront();
+                  w.requestFocus();
+                }
+              }
+              joptionpane.setVisible(false);
+            }
+          });
+          options_btns.add(jb);
+          if (o.equals(initialValue))
+            initialValue_btn = jb;
+        }
+      }
+      joptionpane.setMessage(message);
+      joptionpane.setMessageType(messageType);
+      joptionpane.setOptionType(optionType);
+      joptionpane.setIcon(icon);
+      joptionpane.setOptions(
+              Platform.isJS() ? options : options_btns.toArray());
+      joptionpane.setInitialValue(
+              Platform.isJS() ? initialValue : initialValue_btn);
+
+      JDialog dialog = joptionpane.createDialog(parentComponent, title);
+      dialog.setIconImage(WindowIcons.logoIcon.getImage());
+      dialog.setModalityType(modal ? ModalityType.APPLICATION_MODAL
+              : ModalityType.MODELESS);
+      dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
       dialog.setVisible(true);
-      jalview.bin.Console.debug("Just setVisible(true)");
     }
   }
 
@@ -946,20 +1045,77 @@ public class JvOptionPane extends JOptionPane
       handleResponse(getMockResponse());
     }
 
+    // need to set these separately so we can set the title bar icon later
+    this.setOptionType(yesNoCancelOption);
+    this.setMessageType(questionMessage);
+    this.setIcon(icon);
+    this.setInitialValue(initresponse);
+    this.setOptions(options);
+    this.setMessage(mainPanel);
+
     ourOptions = Arrays.asList(options);
     int response;
     if (parentComponent != this)
     {
-      response = JOptionPane.showInternalOptionDialog(parentComponent,
-              mainPanel, title, yesNoCancelOption, questionMessage, icon,
-              options, initresponse);
+      JInternalFrame jif = this.createInternalFrame(parentComponent, title);
+      jif.setFrameIcon(WindowIcons.logoIcon);
+      jif.addInternalFrameListener(new InternalFrameListener()
+      {
+        @Override
+        public void internalFrameActivated(InternalFrameEvent arg0)
+        {
+        }
+
+        @Override
+        public void internalFrameClosed(InternalFrameEvent arg0)
+        {
+          JvOptionPane.this.internalDialogHandleResponse();
+        }
+
+        @Override
+        public void internalFrameClosing(InternalFrameEvent arg0)
+        {
+        }
+
+        @Override
+        public void internalFrameDeactivated(InternalFrameEvent arg0)
+        {
+        }
+
+        @Override
+        public void internalFrameDeiconified(InternalFrameEvent arg0)
+        {
+        }
+
+        @Override
+        public void internalFrameIconified(InternalFrameEvent arg0)
+        {
+        }
+
+        @Override
+        public void internalFrameOpened(InternalFrameEvent arg0)
+        {
+        }
+      });
+      jif.setVisible(true);
+      startModal(jif);
+      return;
     }
     else
     {
-      response = JOptionPane.showOptionDialog(parentComponent, mainPanel,
-              title, yesNoCancelOption, questionMessage, icon, options,
-              initresponse);
+      JDialog dialog = this.createDialog(parentComponent, title);
+      dialog.setIconImage(WindowIcons.logoIcon.getImage());
+      dialog.setVisible(true); // blocking
+      this.internalDialogHandleResponse();
+      return;
     }
+  }
+
+  private void internalDialogHandleResponse()
+  {
+    String responseString = (String) this.getValue();
+    int response = ourOptions.indexOf(responseString);
+
     if (!Platform.isJS())
     /**
      * Java only
@@ -1258,4 +1414,78 @@ public class JvOptionPane extends JOptionPane
 
     return false;
   }
+
+  /**
+   * This helper method makes the JInternalFrame wait until it is notified by an
+   * InternalFrameClosing event. This method also adds the given JOptionPane to
+   * the JInternalFrame and sizes it according to the JInternalFrame's preferred
+   * size.
+   *
+   * @param f
+   *          The JInternalFrame to make modal.
+   */
+  private static void startModal(JInternalFrame f)
+  {
+    // We need to add an additional glasspane-like component directly
+    // below the frame, which intercepts all mouse events that are not
+    // directed at the frame itself.
+    JPanel modalInterceptor = new JPanel();
+    modalInterceptor.setOpaque(false);
+    JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f);
+    lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue());
+    modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight());
+    modalInterceptor.addMouseListener(new MouseAdapter()
+    {
+    });
+    modalInterceptor.addMouseMotionListener(new MouseMotionAdapter()
+    {
+    });
+    lp.add(modalInterceptor);
+    f.toFront();
+
+    // We need to explicitly dispatch events when we are blocking the event
+    // dispatch thread.
+    EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+    try
+    {
+      while (!f.isClosed())
+      {
+        if (EventQueue.isDispatchThread())
+        {
+          // The getNextEventMethod() issues wait() when no
+          // event is available, so we don't need do explicitly wait().
+          AWTEvent ev = queue.getNextEvent();
+          // This mimics EventQueue.dispatchEvent(). We can't use
+          // EventQueue.dispatchEvent() directly, because it is
+          // protected, unfortunately.
+          if (ev instanceof ActiveEvent)
+            ((ActiveEvent) ev).dispatch();
+          else if (ev.getSource() instanceof Component)
+            ((Component) ev.getSource()).dispatchEvent(ev);
+          else if (ev.getSource() instanceof MenuComponent)
+            ((MenuComponent) ev.getSource()).dispatchEvent(ev);
+          // Other events are ignored as per spec in
+          // EventQueue.dispatchEvent
+        }
+        else
+        {
+          // Give other threads a chance to become active.
+          Thread.yield();
+        }
+      }
+    } catch (InterruptedException ex)
+    {
+      // If we get interrupted, then leave the modal state.
+    } finally
+    {
+      // Clean up the modal interceptor.
+      lp.remove(modalInterceptor);
+
+      // Remove the internal frame from its parent, so it is no longer
+      // lurking around and clogging memory.
+      Container parent = f.getParent();
+      if (parent != null)
+        parent.remove(f);
+    }
+  }
 }
index e6b6b83..63ce5ad 100644 (file)
  */
 package jalview.gui;
 
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
+
 import jalview.analysis.scoremodels.ScoreModels;
 import jalview.api.AlignViewportI;
 import jalview.api.analysis.ScoreModelI;
@@ -39,23 +56,6 @@ import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.PCAModel;
 
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.print.PageFormat;
-import java.awt.print.Printable;
-import java.awt.print.PrinterException;
-import java.awt.print.PrinterJob;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JMenuItem;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-
 /**
  * The panel holding the Principal Component Analysis 3-D visualisation
  */
@@ -92,6 +92,7 @@ public class PCAPanel extends GPCAPanel
           SimilarityParamsI params)
   {
     super();
+    this.setFrameIcon(WindowIcons.treeIcon);
     this.av = alignPanel.av;
     this.ap = alignPanel;
     boolean nucleotide = av.getAlignment().isNucleotide();
index 06d3a60..987051f 100755 (executable)
@@ -249,6 +249,7 @@ public class Preferences extends GPreferences
   {
     super();
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.preferencesIcon);
     frame.setContentPane(this);
     if (!Platform.isJS())
     /**
index 6ed3248..7a50758 100755 (executable)
  */
 package jalview.gui;
 
-import jalview.analysis.AlignSeq;
-import jalview.commands.CommandI;
-import jalview.commands.EditCommand;
-import jalview.commands.EditCommand.Action;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.jbgui.GSliderPanel;
-import jalview.util.MessageManager;
-
 import java.awt.event.ActionEvent;
 import java.util.ArrayList;
 import java.util.List;
@@ -42,6 +33,15 @@ import javax.swing.event.ChangeListener;
 import javax.swing.event.InternalFrameAdapter;
 import javax.swing.event.InternalFrameEvent;
 
+import jalview.analysis.AlignSeq;
+import jalview.commands.CommandI;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GSliderPanel;
+import jalview.util.MessageManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -100,6 +100,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
     worker.start();
 
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.logoIcon);
     frame.setContentPane(this);
     Desktop.addInternalFrame(frame,
             MessageManager
index e596fbf..3b93059 100755 (executable)
@@ -186,6 +186,7 @@ public class SequenceFetcher extends JPanel implements Runnable
 
     frame = new JInternalFrame();
     frame.setContentPane(this);
+    frame.setFrameIcon(WindowIcons.fetchIcon);
     Desktop.addInternalFrame(frame, getFrameTitle(), true, 400,
             Platform.isAMacAndNotJS() ? 240 : 180);
   }
index 5e1357a..6665588 100755 (executable)
@@ -156,6 +156,7 @@ public class SliderPanel extends GSliderPanel
     {
       sliderPanel = new SliderPanel(ap, rs.getConservationInc(), true, rs);
       conservationSlider = new JInternalFrame();
+      conservationSlider.setFrameIcon(WindowIcons.logoIcon);
       conservationSlider.setContentPane(sliderPanel);
       conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER);
     }
@@ -269,6 +270,7 @@ public class SliderPanel extends GSliderPanel
     {
       sliderPanel = new SliderPanel(ap, threshold, false, rs);
       PIDSlider = new JInternalFrame();
+      PIDSlider.setFrameIcon(WindowIcons.logoIcon);
       PIDSlider.setContentPane(sliderPanel);
       PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
     }
index 6ebedb7..7398a3f 100644 (file)
@@ -105,6 +105,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI
    */
   protected void init()
   {
+    setFrameIcon(WindowIcons.splitIcon);
     getTopFrame().setSplitFrame(this);
     getBottomFrame().setSplitFrame(this);
     getTopFrame().setVisible(true);
index 6765366..82b6759 100644 (file)
@@ -135,6 +135,7 @@ public abstract class StructureViewerBase extends GStructureViewer
   public StructureViewerBase()
   {
     super();
+    setFrameIcon(WindowIcons.structureIcon);
   }
 
   /**
index d735402..2d446d9 100755 (executable)
  */
 package jalview.gui;
 
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 
+import javax.swing.ButtonGroup;
+import javax.swing.JMenuItem;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
+
+import org.jibble.epsgraphics.EpsGraphics2D;
+
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.AverageDistanceTree;
 import jalview.analysis.NJTree;
@@ -53,25 +71,6 @@ import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JMenuItem;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-
-import org.jibble.epsgraphics.EpsGraphics2D;
-
 /**
  * DOCUMENT ME!
  * 
@@ -106,6 +105,7 @@ public class TreePanel extends GTreePanel
           SimilarityParamsI options)
   {
     super();
+    this.setFrameIcon(WindowIcons.treeIcon);
     this.similarityParams = options;
     initTreePanel(ap, type, modelName, null, null);
 
index 4db8bfa..4979746 100755 (executable)
@@ -148,6 +148,7 @@ public class UserDefinedColours extends GUserDefinedColours
   {
     colorChooser.getSelectionModel().addChangeListener(this);
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.logoIcon);
     frame.setContentPane(this);
     Desktop.addInternalFrame(frame,
             MessageManager.getString("label.user_defined_colours"),
index ee1b473..edcab0c 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.gui;
 
-import java.util.Locale;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -33,6 +31,7 @@ import java.awt.MediaTracker;
 import java.awt.RenderingHints;
 import java.awt.event.ActionEvent;
 import java.awt.image.BufferedImage;
+import java.util.Locale;
 import java.util.Vector;
 
 import javax.swing.JComponent;
@@ -324,6 +323,7 @@ public class WebserviceInfo extends GWebserviceInfo
           boolean makeVisible)
   {
     frame = new JInternalFrame();
+    frame.setFrameIcon(WindowIcons.logoIcon);
     frame.setContentPane(this);
     Desktop.addInternalFrame(frame, title, makeVisible, width, height);
     frame.setClosable(false);
diff --git a/src/jalview/gui/WindowIcons.java b/src/jalview/gui/WindowIcons.java
new file mode 100644 (file)
index 0000000..b735667
--- /dev/null
@@ -0,0 +1,51 @@
+package jalview.gui;
+
+import javax.swing.ImageIcon;
+
+import jalview.util.ChannelProperties;
+
+public class WindowIcons
+{
+  public static final ImageIcon logoIcon = new ImageIcon(
+          ChannelProperties.getImage("logo.16"));
+
+  protected static final ImageIcon plainIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/plainIcon.png"));
+
+  protected static final ImageIcon alignmentIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/alignmentIcon.png"));
+
+  protected static final ImageIcon featuresIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/featuresIcon.png"));
+
+  protected static final ImageIcon fetchIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/fetchIcon.png"));
+
+  protected static final ImageIcon annotationIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/annotationIcon.png"));
+
+  protected static final ImageIcon overviewIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/overviewIcon.png"));
+
+  protected static final ImageIcon treeIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/treeIcon.png"));
+
+  protected static final ImageIcon structureIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/structureIcon.png"));
+
+  protected static final ImageIcon splitIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/splitIcon.png"));
+
+  protected static final ImageIcon preferencesIcon = new ImageIcon(
+          WindowIcons.class
+                  .getResource("/images/windowIcons/preferencesIcon.png"));
+}
index dba7ad1..077bffb 100755 (executable)
 //////////////////////////////////////////////////////////////////
 package jalview.io;
 
+import jalview.bin.Cache;
+import jalview.gui.JvOptionPane;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.dialogrunner.DialogRunnerI;
+
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.EventQueue;
@@ -43,6 +49,7 @@ import java.util.concurrent.Callable;
 import javax.swing.BoxLayout;
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.JCheckBox;
+import javax.swing.JDialog;
 import javax.swing.JFileChooser;
 import javax.swing.JList;
 import javax.swing.JOptionPane;
@@ -54,6 +61,7 @@ import javax.swing.plaf.basic.BasicFileChooserUI;
 
 import jalview.bin.Cache;
 import jalview.gui.JvOptionPane;
+import jalview.gui.WindowIcons;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.util.dialogrunner.DialogRunnerI;
@@ -670,4 +678,13 @@ public class JalviewFileChooser extends JFileChooser
       break;
     }
   }
+
+  @Override
+  protected JDialog createDialog(Component parent) throws HeadlessException
+  {
+    JDialog dialog = super.createDialog(parent);
+    dialog.setIconImage(WindowIcons.logoIcon.getImage());
+    return dialog;
+  }
+
 }