X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=0b1cf6039385cd125076aae18cd83143fbbfa3fd;hb=4865a4110b7725acefd5b166f9b7c482ac01ce15;hp=9ec00334946c525298817e219ff2d9a2ef399777;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 9ec0033..0b1cf60 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; @@ -64,12 +61,17 @@ import java.util.HashMap; import java.util.Map; import java.util.Vector; +import javax.swing.LookAndFeel; import javax.swing.UIManager; +import groovy.lang.Binding; +import groovy.util.GroovyScriptEngine; + /** * Main class for Jalview Application
*
- * start with java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview + * start with java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" + * jalview.bin.Jalview * * @author $author$ * @version $Revision$ @@ -264,7 +266,7 @@ public class Jalview { error.printStackTrace(); System.out.println("\nEssential logging libraries not found." - + "\nUse: java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview"); + + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview"); System.exit(0); } @@ -275,20 +277,43 @@ public class Jalview UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { + System.err.println("Unexpected Look and Feel Exception"); + ex.printStackTrace(); } if (Platform.isAMac()) { + + LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager + .getLookAndFeel(); System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Jalview"); System.setProperty("apple.laf.useScreenMenuBar", "true"); - try + if (lookAndFeel != null) { - UIManager.setLookAndFeel( - ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel()); - } catch (Throwable e) + try + { + UIManager.setLookAndFeel(lookAndFeel); + } catch (Throwable e) + { + System.err.println( + "Failed to set QuaQua look and feel: " + e.toString()); + } + } + if (lookAndFeel == null || !(lookAndFeel.getClass() + .isAssignableFrom(UIManager.getLookAndFeel().getClass())) + || !UIManager.getLookAndFeel().getClass().toString() + .toLowerCase().contains("quaqua")) { - System.err.println( - "Failed to set QuaQua look and feel: " + e.toString()); + try + { + System.err.println( + "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976"); + UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel"); + } catch (Throwable e) + { + System.err.println( + "Failed to reset look and feel: " + e.toString()); + } } } @@ -970,7 +995,7 @@ public class Jalview } try { - Map vbinding = new HashMap(); + Map vbinding = new HashMap<>(); vbinding.put("Jalview", this); if (af != null) { @@ -1036,7 +1061,7 @@ public class Jalview + nickname + "|" + url); if (source == null) { - source = new Vector(); + source = new Vector<>(); } source.addElement(nickname); } @@ -1054,7 +1079,7 @@ public class Jalview System.out.println("adding source '" + data + "'"); if (source == null) { - source = new Vector(); + source = new Vector<>(); } source.addElement(data); }