SystemInfo:

- renamed public fields from upper-case to mixed-case
- added public fields for osVersion and javaVersion
- fixed Mac -> MacOS
- added orLater to Mojave
This commit is contained in:
Karl Tauber
2020-07-22 22:01:19 +02:00
parent 2ffd5437a9
commit 5166d4bb0f
21 changed files with 111 additions and 109 deletions

View File

@@ -59,9 +59,9 @@ class ControlBar
className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) )
continue;
if( (SystemInfo.IS_WINDOWS && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) ||
(SystemInfo.IS_MAC && className.equals( "com.apple.laf.AquaLookAndFeel") ) ||
(SystemInfo.IS_LINUX && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel") ) )
if( (SystemInfo.isWindows && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) ||
(SystemInfo.isMacOS && className.equals( "com.apple.laf.AquaLookAndFeel") ) ||
(SystemInfo.isLinux && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel") ) )
name += " (F9)";
else if( className.equals( MetalLookAndFeel.class.getName() ) )
name += " (F12)";
@@ -112,11 +112,11 @@ class ControlBar
registerSwitchToLookAndFeel( KeyEvent.VK_F3, FlatIntelliJLaf.class.getName() );
registerSwitchToLookAndFeel( KeyEvent.VK_F4, FlatDarculaLaf.class.getName() );
if( SystemInfo.IS_WINDOWS )
if( SystemInfo.isWindows )
registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
else if( SystemInfo.IS_MAC )
else if( SystemInfo.isMacOS )
registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.apple.laf.AquaLookAndFeel" );
else if( SystemInfo.IS_LINUX )
else if( SystemInfo.isLinux )
registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" );
registerSwitchToLookAndFeel( KeyEvent.VK_F12, MetalLookAndFeel.class.getName() );
registerSwitchToLookAndFeel( KeyEvent.VK_F11, NimbusLookAndFeel.class.getName() );

View File

@@ -32,7 +32,7 @@ public class FlatLafDemo
public static void main( String[] args ) {
// on macOS enable screen menu bar
if( SystemInfo.IS_MAC && System.getProperty( "apple.laf.useScreenMenuBar" ) == null )
if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null )
System.setProperty( "apple.laf.useScreenMenuBar", "true" );
SwingUtilities.invokeLater( () -> {