From: Jim Procter Date: Wed, 2 May 2018 14:41:51 +0000 (+0100) Subject: JAL-2976 fallback to Vaqua for Macs that don’t work for Quaqua X-Git-Tag: Release_2_10_4~5^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b4f18a095a262cc7c0b53cb07e712d06afab723f;p=jalview.git JAL-2976 fallback to Vaqua for Macs that don’t work for Quaqua --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 9ec0033..287096d 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -20,9 +20,6 @@ */ package jalview.bin; -import groovy.lang.Binding; -import groovy.util.GroovyScriptEngine; - import jalview.ext.so.SequenceOntology; import jalview.gui.AlignFrame; import jalview.gui.Desktop; @@ -66,6 +63,9 @@ import java.util.Vector; import javax.swing.UIManager; +import groovy.lang.Binding; +import groovy.util.GroovyScriptEngine; + /** * Main class for Jalview Application
*
@@ -275,6 +275,8 @@ public class Jalview UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { + System.err.println("Unexpected Look and Feel Exception"); + ex.printStackTrace(); } if (Platform.isAMac()) { @@ -290,6 +292,20 @@ public class Jalview System.err.println( "Failed to set QuaQua look and feel: " + e.toString()); } + if (!ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel() + .equals(UIManager.getLookAndFeel())) + { + try + { + System.err.println( + "Quaqua LaF not available. Using VAqua(4)."); + UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel"); + } catch (Throwable e) + { + System.err.println( + "Failed to reset look and feel: " + e.toString()); + } + } } /* @@ -970,7 +986,7 @@ public class Jalview } try { - Map vbinding = new HashMap(); + Map vbinding = new HashMap<>(); vbinding.put("Jalview", this); if (af != null) { @@ -1036,7 +1052,7 @@ public class Jalview + nickname + "|" + url); if (source == null) { - source = new Vector(); + source = new Vector<>(); } source.addElement(nickname); } @@ -1054,7 +1070,7 @@ public class Jalview System.out.println("adding source '" + data + "'"); if (source == null) { - source = new Vector(); + source = new Vector<>(); } source.addElement(data); }