From 06ce038f4a089e976bf8d1334b36169a35a4de92 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 30 Apr 2020 18:04:20 +0100 Subject: [PATCH] JAL-3608 Added 'metal' option for laf property --- src/jalview/bin/Jalview.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index cfcc2f7..87e26ee 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -367,7 +367,7 @@ public class Jalview desktop = null; - // property laf = "crossplatform", "system", "gtk" or "mac" + // property laf = "crossplatform", "system", "gtk", "metal" or "mac" // If not set (or chosen laf fails), use the normal SystemLaF and if on Mac, // try Quaqua/Vaqua. String laf = System.getProperty("laf", "none"); @@ -394,6 +394,12 @@ public class Jalview System.err.println("Could not set requested laf=" + laf); } break; + case "metal": + lafSet = setMetalLookAndFeel(); + { + System.err.println("Could not set requested laf=" + laf); + } + break; case "mac": lafSet = setMacLookAndFeel(); if (!lafSet) @@ -900,6 +906,22 @@ public class Jalview return set; } + private static boolean setMetalLookAndFeel() + { + boolean set = false; + String laf = "javax.swing.plaf.metal.MetalLookAndFeel"; + try + { + UIManager.setLookAndFeel(laf); + set = true; + } catch (Exception ex) + { + System.err.println("Unexpected Look and Feel Exception"); + ex.printStackTrace(); + } + return set; + } + private static boolean setMacLookAndFeel() { boolean set = false; -- 1.7.10.2