From: BobHanson Date: Tue, 16 Jun 2020 11:23:01 +0000 (-0500) Subject: JAL-3446 proper call for headless state X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ff06834b537b9bdb5c39a81124a73c569abc031f;p=jalview.git JAL-3446 proper call for headless state --- diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index c8f2fc4..c068acc 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -22,6 +22,7 @@ package jalview.util; import java.awt.Component; import java.awt.Dimension; +import java.awt.GraphicsEnvironment; import java.awt.Toolkit; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; @@ -75,8 +76,6 @@ public class Platform private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null, isWin = null; - private static Boolean isHeadless = null; - private static swingjs.api.JSUtilI jsutil; static @@ -96,7 +95,6 @@ public class Platform } } } - // private static Boolean isHeadless = null; /** * added to group mouse events into Windows and nonWindows (mac, unix, linux) @@ -116,7 +114,7 @@ public class Platform static { - if (!Jalview.isHeadlessMode()) + if (!GraphicsEnvironment.isHeadless()) { // Using non-deprecated Extended key mask modifiers, but Java 8 has no // getMenuShortcutKeyMaskEx method @@ -203,18 +201,6 @@ public class Platform return (isNoJSWin == null ? (isNoJSWin = !isJS && isWin()) : isNoJSWin); } - /** - * - * @return true if we are running in non-interactive no UI mode - */ - public static boolean isHeadless() - { - if (isHeadless == null) - { - isHeadless = "true".equals(System.getProperty("java.awt.headless")); - } - return isHeadless; - } /** *