From b4f18a095a262cc7c0b53cb07e712d06afab723f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 2 May 2018 15:41:51 +0100 Subject: [PATCH] =?utf8?q?JAL-2976=20fallback=20to=20Vaqua=20for=20Macs=20th?= =?utf8?q?at=20don=E2=80=99t=20work=20for=20Quaqua?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/bin/Jalview.java | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) 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); } -- 1.7.10.2