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

@@ -35,7 +35,7 @@ class FlatInputMaps
initBasicInputMaps( defaults ); initBasicInputMaps( defaults );
initTextComponentInputMaps( defaults ); initTextComponentInputMaps( defaults );
if( SystemInfo.IS_MAC ) if( SystemInfo.isMacOS )
initMacInputMaps( defaults ); initMacInputMaps( defaults );
} }
@@ -59,7 +59,7 @@ class FlatInputMaps
mac( "alt KP_DOWN", null ), "togglePopup" mac( "alt KP_DOWN", null ), "togglePopup"
); );
if( !SystemInfo.IS_MAC ) { if( !SystemInfo.isMacOS ) {
modifyInputMap( defaults, "FileChooser.ancestorInputMap", modifyInputMap( defaults, "FileChooser.ancestorInputMap",
"F2", "editFileName", "F2", "editFileName",
"BACK_SPACE", "Go Up" "BACK_SPACE", "Go Up"
@@ -93,7 +93,7 @@ class FlatInputMaps
mac( "shift ctrl END", null ), "selectLastColumnExtendSelection" mac( "shift ctrl END", null ), "selectLastColumnExtendSelection"
); );
if( !SystemInfo.IS_MAC ) { if( !SystemInfo.isMacOS ) {
modifyInputMap( defaults, "Tree.focusInputMap", modifyInputMap( defaults, "Tree.focusInputMap",
"ADD", "expand", "ADD", "expand",
"SUBTRACT", "collapse" "SUBTRACT", "collapse"
@@ -164,7 +164,7 @@ class FlatInputMaps
"control shift O", "toggle-componentOrientation", // DefaultEditorKit.toggleComponentOrientation "control shift O", "toggle-componentOrientation", // DefaultEditorKit.toggleComponentOrientation
}; };
Object[] macCommonTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { Object[] macCommonTextComponentBindings = SystemInfo.isMacOS ? new Object[] {
// move caret one character (without selecting text) // move caret one character (without selecting text)
"ctrl B", backwardAction, "ctrl B", backwardAction,
"ctrl F", forwardAction, "ctrl F", forwardAction,
@@ -211,7 +211,7 @@ class FlatInputMaps
"ENTER", JTextField.notifyAction, "ENTER", JTextField.notifyAction,
}; };
Object[] macSingleLineTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { Object[] macSingleLineTextComponentBindings = SystemInfo.isMacOS ? new Object[] {
// move caret to line begin/end (without selecting text) // move caret to line begin/end (without selecting text)
"UP", beginLineAction, "UP", beginLineAction,
"DOWN", endLineAction, "DOWN", endLineAction,
@@ -289,7 +289,7 @@ class FlatInputMaps
mac( "ctrl SPACE", "meta SPACE" ), "activate-link-action", mac( "ctrl SPACE", "meta SPACE" ), "activate-link-action",
}; };
Object[] macMultiLineTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { Object[] macMultiLineTextComponentBindings = SystemInfo.isMacOS ? new Object[] {
// move caret one line (without selecting text) // move caret one line (without selecting text)
"ctrl N", downAction, "ctrl N", downAction,
"ctrl P", upAction, "ctrl P", upAction,
@@ -579,7 +579,7 @@ class FlatInputMaps
} }
private static <T> T mac( T value, T macValue ) { private static <T> T mac( T value, T macValue ) {
return SystemInfo.IS_MAC ? macValue : value; return SystemInfo.isMacOS ? macValue : value;
} }
//---- class LazyInputMapEx ----------------------------------------------- //---- class LazyInputMapEx -----------------------------------------------

View File

@@ -147,12 +147,12 @@ public abstract class FlatLaf
*/ */
@Override @Override
public boolean getSupportsWindowDecorations() { public boolean getSupportsWindowDecorations() {
if( SystemInfo.IS_JETBRAINS_JVM_11_OR_LATER && if( SystemInfo.isJetBrainsJVM_11_orLater &&
SystemInfo.IS_WINDOWS_10_OR_LATER && SystemInfo.isWindows_10_orLater &&
JBRCustomDecorations.isSupported() ) JBRCustomDecorations.isSupported() )
return false; return false;
return SystemInfo.IS_WINDOWS_10_OR_LATER; return SystemInfo.isWindows_10_orLater;
} }
@Override @Override
@@ -187,7 +187,7 @@ public abstract class FlatLaf
@Override @Override
public void initialize() { public void initialize() {
if( SystemInfo.IS_MAC ) if( SystemInfo.isMacOS )
initializeAqua(); initializeAqua();
super.initialize(); super.initialize();
@@ -201,11 +201,11 @@ public abstract class FlatLaf
mnemonicHandler.install(); mnemonicHandler.install();
// listen to desktop property changes to update UI if system font or scaling changes // listen to desktop property changes to update UI if system font or scaling changes
if( SystemInfo.IS_WINDOWS ) { if( SystemInfo.isWindows ) {
// Windows 10 allows increasing font size independent of scaling: // Windows 10 allows increasing font size independent of scaling:
// Settings > Ease of Access > Display > Make text bigger (100% - 225%) // Settings > Ease of Access > Display > Make text bigger (100% - 225%)
desktopPropertyName = "win.messagebox.font"; desktopPropertyName = "win.messagebox.font";
} else if( SystemInfo.IS_LINUX ) { } else if( SystemInfo.isLinux ) {
// Linux/Gnome allows changing font in "Tweaks" app // Linux/Gnome allows changing font in "Tweaks" app
desktopPropertyName = "gnome.Gtk/FontName"; desktopPropertyName = "gnome.Gtk/FontName";
@@ -315,7 +315,7 @@ public abstract class FlatLaf
String aquaLafClassName = "com.apple.laf.AquaLookAndFeel"; String aquaLafClassName = "com.apple.laf.AquaLookAndFeel";
BasicLookAndFeel aquaLaf; BasicLookAndFeel aquaLaf;
try { try {
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
Method m = UIManager.class.getMethod( "createLookAndFeel", String.class ); Method m = UIManager.class.getMethod( "createLookAndFeel", String.class );
aquaLaf = (BasicLookAndFeel) m.invoke( null, "Mac OS X" ); aquaLaf = (BasicLookAndFeel) m.invoke( null, "Mac OS X" );
} else } else
@@ -391,7 +391,7 @@ public abstract class FlatLaf
UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, getAdditionalDefaults(), isDark(), defaults ); UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, getAdditionalDefaults(), isDark(), defaults );
// use Aqua MenuBarUI if Mac screen menubar is enabled // use Aqua MenuBarUI if Mac screen menubar is enabled
if( SystemInfo.IS_MAC && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) { if( SystemInfo.isMacOS && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) {
defaults.put( "MenuBarUI", "com.apple.laf.AquaMenuBarUI" ); defaults.put( "MenuBarUI", "com.apple.laf.AquaMenuBarUI" );
// add defaults necessary for AquaMenuBarUI // add defaults necessary for AquaMenuBarUI
@@ -435,17 +435,17 @@ public abstract class FlatLaf
private void initFonts( UIDefaults defaults ) { private void initFonts( UIDefaults defaults ) {
FontUIResource uiFont = null; FontUIResource uiFont = null;
if( SystemInfo.IS_WINDOWS ) { if( SystemInfo.isWindows ) {
Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty( "win.messagebox.font" ); Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty( "win.messagebox.font" );
if( winFont != null ) if( winFont != null )
uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() ); uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() );
} else if( SystemInfo.IS_MAC ) { } else if( SystemInfo.isMacOS ) {
String fontName; String fontName;
if( SystemInfo.IS_MAC_OS_10_15_CATALINA_OR_LATER ) { if( SystemInfo.isMacOS_10_15_Catalina_orLater ) {
// use Helvetica Neue font // use Helvetica Neue font
fontName = "Helvetica Neue"; fontName = "Helvetica Neue";
} else if( SystemInfo.IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER ) { } else if( SystemInfo.isMacOS_10_11_ElCapitan_orLater ) {
// use San Francisco Text font // use San Francisco Text font
fontName = ".SF NS Text"; fontName = ".SF NS Text";
} else { } else {
@@ -455,7 +455,7 @@ public abstract class FlatLaf
uiFont = createCompositeFont( fontName, Font.PLAIN, 13 ); uiFont = createCompositeFont( fontName, Font.PLAIN, 13 );
} else if( SystemInfo.IS_LINUX ) { } else if( SystemInfo.isLinux ) {
Font font = LinuxFontPolicy.getFont(); Font font = LinuxFontPolicy.getFont();
uiFont = (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font ); uiFont = (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font );
} }
@@ -515,7 +515,7 @@ public abstract class FlatLaf
} }
private void putAATextInfo( UIDefaults defaults ) { private void putAATextInfo( UIDefaults defaults ) {
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
Object desktopHints = Toolkit.getDefaultToolkit().getDesktopProperty( DESKTOPFONTHINTS ); Object desktopHints = Toolkit.getDefaultToolkit().getDesktopProperty( DESKTOPFONTHINTS );
if( desktopHints instanceof Map ) { if( desktopHints instanceof Map ) {
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )

View File

@@ -39,7 +39,7 @@ import com.formdev.flatlaf.util.UIScale;
class LinuxFontPolicy class LinuxFontPolicy
{ {
static Font getFont() { static Font getFont() {
return SystemInfo.IS_KDE ? getKDEFont() : getGnomeFont(); return SystemInfo.isKDE ? getKDEFont() : getGnomeFont();
} }
/** /**
@@ -77,7 +77,7 @@ class LinuxFontPolicy
// Ubuntu font is rendered poorly (except if running in JetBrains VM) // Ubuntu font is rendered poorly (except if running in JetBrains VM)
// --> use Liberation Sans font // --> use Liberation Sans font
if( family.startsWith( "Ubuntu" ) && if( family.startsWith( "Ubuntu" ) &&
!SystemInfo.IS_JETBRAINS_JVM && !SystemInfo.isJetBrainsJVM &&
!FlatSystemProperties.getBoolean( FlatSystemProperties.USE_UBUNTU_FONT, false ) ) !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_UBUNTU_FONT, false ) )
family = "Liberation Sans"; family = "Liberation Sans";

View File

@@ -71,13 +71,13 @@ class MnemonicHandler
@Override @Override
public boolean postProcessKeyEvent( KeyEvent e ) { public boolean postProcessKeyEvent( KeyEvent e ) {
int keyCode = e.getKeyCode(); int keyCode = e.getKeyCode();
if( SystemInfo.IS_MAC ) { if( SystemInfo.isMacOS ) {
// Ctrl+Alt keys must be pressed on Mac // Ctrl+Alt keys must be pressed on Mac
if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT ) if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT )
showMnemonics( shouldShowMnemonics( e ) && e.isControlDown() && e.isAltDown(), e.getComponent() ); showMnemonics( shouldShowMnemonics( e ) && e.isControlDown() && e.isAltDown(), e.getComponent() );
} else { } else {
// Alt key must be pressed on Windows and Linux // Alt key must be pressed on Windows and Linux
if( SystemInfo.IS_WINDOWS ) if( SystemInfo.isWindows )
return processKeyEventOnWindows( e ); return processKeyEventOnWindows( e );
if( keyCode == KeyEvent.VK_ALT ) if( keyCode == KeyEvent.VK_ALT )

View File

@@ -144,9 +144,9 @@ class UIDefaultsLoader
// handle platform specific properties // handle platform specific properties
String platformPrefix = String platformPrefix =
SystemInfo.IS_WINDOWS ? "[win]" : SystemInfo.isWindows ? "[win]" :
SystemInfo.IS_MAC ? "[mac]" : SystemInfo.isMacOS ? "[mac]" :
SystemInfo.IS_LINUX ? "[linux]" : "[unknown]"; SystemInfo.isLinux ? "[linux]" : "[unknown]";
for( String key : platformSpecificKeys ) { for( String key : platformSpecificKeys ) {
Object value = properties.remove( key ); Object value = properties.remove( key );
if( key.startsWith( platformPrefix ) ) if( key.startsWith( platformPrefix ) )

View File

@@ -306,7 +306,7 @@ public class FlatComboBoxUI
updateEditorColors(); updateEditorColors();
// macOS // macOS
if( SystemInfo.IS_MAC && editor instanceof JTextComponent ) { if( SystemInfo.isMacOS && editor instanceof JTextComponent ) {
// delegate actions from editor text field to combobox, which is necessary // delegate actions from editor text field to combobox, which is necessary
// because text field on macOS already handle those keys // because text field on macOS already handle those keys
InputMap inputMap = ((JTextComponent)editor).getInputMap(); InputMap inputMap = ((JTextComponent)editor).getInputMap();

View File

@@ -82,7 +82,7 @@ public class FlatMenuBarUI
JMenuBar menuBar = (JMenuBar) e.getSource(); JMenuBar menuBar = (JMenuBar) e.getSource();
JMenu menu = menuBar.getMenu( 0 ); JMenu menu = menuBar.getMenu( 0 );
if( menu != null ) { if( menu != null ) {
MenuSelectionManager.defaultManager().setSelectedPath( SystemInfo.IS_WINDOWS MenuSelectionManager.defaultManager().setSelectedPath( SystemInfo.isWindows
? new MenuElement[] { menuBar, menu } ? new MenuElement[] { menuBar, menu }
: new MenuElement[] { menuBar, menu, menu.getPopupMenu() } ); : new MenuElement[] { menuBar, menu, menu.getPopupMenu() } );

View File

@@ -62,7 +62,7 @@ public class FlatPopupFactory
return new NonFlashingPopup( super.getPopup( owner, contents, x, y ), contents ); return new NonFlashingPopup( super.getPopup( owner, contents, x, y ), contents );
// macOS and Linux adds drop shadow to heavy weight popups // macOS and Linux adds drop shadow to heavy weight popups
if( SystemInfo.IS_MAC || SystemInfo.IS_LINUX ) { if( SystemInfo.isMacOS || SystemInfo.isLinux ) {
Popup popup = getHeavyWeightPopup( owner, contents, x, y ); Popup popup = getHeavyWeightPopup( owner, contents, x, y );
if( popup == null ) if( popup == null )
popup = super.getPopup( owner, contents, x, y ); popup = super.getPopup( owner, contents, x, y );
@@ -105,7 +105,7 @@ public class FlatPopupFactory
throws IllegalArgumentException throws IllegalArgumentException
{ {
try { try {
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
if( java9getPopupMethod == null ) { if( java9getPopupMethod == null ) {
java9getPopupMethod = PopupFactory.class.getDeclaredMethod( java9getPopupMethod = PopupFactory.class.getDeclaredMethod(
"getPopup", Component.class, Component.class, int.class, int.class, boolean.class ); "getPopup", Component.class, Component.class, int.class, int.class, boolean.class );

View File

@@ -69,7 +69,7 @@ public class FlatRootPaneUI
{ {
// check this field before using class JBRCustomDecorations to avoid unnecessary loading of that class // check this field before using class JBRCustomDecorations to avoid unnecessary loading of that class
static final boolean canUseJBRCustomDecorations static final boolean canUseJBRCustomDecorations
= SystemInfo.IS_JETBRAINS_JVM_11_OR_LATER && SystemInfo.IS_WINDOWS_10_OR_LATER; = SystemInfo.isJetBrainsJVM_11_orLater && SystemInfo.isWindows_10_orLater;
protected JRootPane rootPane; protected JRootPane rootPane;
protected FlatTitlePane titlePane; protected FlatTitlePane titlePane;
@@ -119,7 +119,7 @@ public class FlatRootPaneUI
} }
// enable dark window appearance on macOS when running in JetBrains Runtime // enable dark window appearance on macOS when running in JetBrains Runtime
if( SystemInfo.IS_JETBRAINS_JVM && SystemInfo.IS_MAC_OS_10_14_MOJAVE ) { if( SystemInfo.isJetBrainsJVM && SystemInfo.isMacOS_10_14_Mojave_orLater ) {
LookAndFeel laf = UIManager.getLookAndFeel(); LookAndFeel laf = UIManager.getLookAndFeel();
boolean isDark = laf instanceof FlatLaf && ((FlatLaf)laf).isDark(); boolean isDark = laf instanceof FlatLaf && ((FlatLaf)laf).isDark();
c.putClientProperty( "jetbrains.awt.windowDarkAppearance", isDark ); c.putClientProperty( "jetbrains.awt.windowDarkAppearance", isDark );

View File

@@ -472,7 +472,7 @@ public class FlatTitlePane
int maximizedWidth = screenBounds.width; int maximizedWidth = screenBounds.width;
int maximizedHeight = screenBounds.height; int maximizedHeight = screenBounds.height;
if( !SystemInfo.IS_JAVA_15_OR_LATER ) { if( !SystemInfo.isJava_15_orLater ) {
// on Java 8 to 14, maximized x,y are 0,0 based on all screens in a multi-screen environment // on Java 8 to 14, maximized x,y are 0,0 based on all screens in a multi-screen environment
maximizedX = 0; maximizedX = 0;
maximizedY = 0; maximizedY = 0;

View File

@@ -191,7 +191,7 @@ public class JBRCustomDecorations
initialized = true; initialized = true;
// requires JetBrains Runtime 11 and Windows 10 // requires JetBrains Runtime 11 and Windows 10
if( !SystemInfo.IS_JETBRAINS_JVM_11_OR_LATER || !SystemInfo.IS_WINDOWS_10_OR_LATER ) if( !SystemInfo.isJetBrainsJVM_11_orLater || !SystemInfo.isWindows_10_orLater )
return; return;
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ) ) if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ) )

View File

@@ -117,10 +117,10 @@ public class HiDPIUtils
* This methods computes a correction value for the Y position. * This methods computes a correction value for the Y position.
*/ */
public static float computeTextYCorrection( Graphics2D g ) { public static float computeTextYCorrection( Graphics2D g ) {
if( !useTextYCorrection() || !SystemInfo.IS_WINDOWS ) if( !useTextYCorrection() || !SystemInfo.isWindows )
return 0; return 0;
if( !SystemInfo.IS_JAVA_9_OR_LATER ) if( !SystemInfo.isJava_9_orLater )
return UIScale.getUserScaleFactor() > 1 ? -UIScale.scale( 0.625f ) : 0; return UIScale.getUserScaleFactor() > 1 ? -UIScale.scale( 0.625f ) : 0;
AffineTransform t = g.getTransform(); AffineTransform t = g.getTransform();

View File

@@ -48,10 +48,10 @@ public class JavaCompatibility
synchronized( JavaCompatibility.class ) { synchronized( JavaCompatibility.class ) {
if( drawStringUnderlineCharAtMethod == null ) { if( drawStringUnderlineCharAtMethod == null ) {
try { try {
Class<?> cls = Class.forName( SystemInfo.IS_JAVA_9_OR_LATER Class<?> cls = Class.forName( SystemInfo.isJava_9_orLater
? "javax.swing.plaf.basic.BasicGraphicsUtils" ? "javax.swing.plaf.basic.BasicGraphicsUtils"
: "sun.swing.SwingUtilities2" ); : "sun.swing.SwingUtilities2" );
drawStringUnderlineCharAtMethod = cls.getMethod( "drawStringUnderlineCharAt", SystemInfo.IS_JAVA_9_OR_LATER drawStringUnderlineCharAtMethod = cls.getMethod( "drawStringUnderlineCharAt", SystemInfo.isJava_9_orLater
? new Class[] { JComponent.class, Graphics2D.class, String.class, int.class, float.class, float.class } ? new Class[] { JComponent.class, Graphics2D.class, String.class, int.class, float.class, float.class }
: new Class[] { JComponent.class, Graphics.class, String.class, int.class, int.class, int.class } ); : new Class[] { JComponent.class, Graphics.class, String.class, int.class, int.class, int.class } );
} catch( Exception ex ) { } catch( Exception ex ) {
@@ -62,7 +62,7 @@ public class JavaCompatibility
} }
try { try {
if( SystemInfo.IS_JAVA_9_OR_LATER ) if( SystemInfo.isJava_9_orLater )
drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, (float) x, (float) y ); drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, (float) x, (float) y );
else else
drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, x, y ); drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, x, y );

View File

@@ -27,55 +27,57 @@ import java.util.StringTokenizer;
public class SystemInfo public class SystemInfo
{ {
// platforms // platforms
public static final boolean IS_WINDOWS; public static final boolean isWindows;
public static final boolean IS_MAC; public static final boolean isMacOS;
public static final boolean IS_LINUX; public static final boolean isLinux;
// OS versions // OS versions
public static final boolean IS_WINDOWS_10_OR_LATER; public static final long osVersion;
public static final boolean IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER; public static final boolean isWindows_10_orLater;
public static final boolean IS_MAC_OS_10_14_MOJAVE; public static final boolean isMacOS_10_11_ElCapitan_orLater;
public static final boolean IS_MAC_OS_10_15_CATALINA_OR_LATER; public static final boolean isMacOS_10_14_Mojave_orLater;
public static final boolean isMacOS_10_15_Catalina_orLater;
// Java versions // Java versions
public static final boolean IS_JAVA_9_OR_LATER; public static final long javaVersion;
public static final boolean IS_JAVA_11_OR_LATER; public static final boolean isJava_9_orLater;
public static final boolean IS_JAVA_15_OR_LATER; public static final boolean isJava_11_orLater;
public static final boolean isJava_15_orLater;
// Java VMs // Java VMs
public static final boolean IS_JETBRAINS_JVM; public static final boolean isJetBrainsJVM;
public static final boolean IS_JETBRAINS_JVM_11_OR_LATER; public static final boolean isJetBrainsJVM_11_orLater;
// UI toolkits // UI toolkits
public static final boolean IS_KDE; public static final boolean isKDE;
static { static {
// platforms // platforms
String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH ); String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH );
IS_WINDOWS = osName.startsWith( "windows" ); isWindows = osName.startsWith( "windows" );
IS_MAC = osName.startsWith( "mac" ); isMacOS = osName.startsWith( "mac" );
IS_LINUX = osName.startsWith( "linux" ); isLinux = osName.startsWith( "linux" );
// OS versions // OS versions
long osVersion = scanVersion( System.getProperty( "os.version" ) ); osVersion = scanVersion( System.getProperty( "os.version" ) );
IS_WINDOWS_10_OR_LATER = (IS_WINDOWS && osVersion >= toVersion( 10, 0, 0, 0 )); isWindows_10_orLater = (isWindows && osVersion >= toVersion( 10, 0, 0, 0 ));
IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER = (IS_MAC && osVersion >= toVersion( 10, 11, 0, 0 )); isMacOS_10_11_ElCapitan_orLater = (isMacOS && osVersion >= toVersion( 10, 11, 0, 0 ));
IS_MAC_OS_10_14_MOJAVE = (IS_MAC && osVersion >= toVersion( 10, 14, 0, 0 )); isMacOS_10_14_Mojave_orLater = (isMacOS && osVersion >= toVersion( 10, 14, 0, 0 ));
IS_MAC_OS_10_15_CATALINA_OR_LATER = (IS_MAC && osVersion >= toVersion( 10, 15, 0, 0 )); isMacOS_10_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 ));
// Java versions // Java versions
long javaVersion = scanVersion( System.getProperty( "java.version" ) ); javaVersion = scanVersion( System.getProperty( "java.version" ) );
IS_JAVA_9_OR_LATER = (javaVersion >= toVersion( 9, 0, 0, 0 )); isJava_9_orLater = (javaVersion >= toVersion( 9, 0, 0, 0 ));
IS_JAVA_11_OR_LATER = (javaVersion >= toVersion( 11, 0, 0, 0 )); isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 ));
IS_JAVA_15_OR_LATER = (javaVersion >= toVersion( 15, 0, 0, 0 )); isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 ));
// Java VMs // Java VMs
IS_JETBRAINS_JVM = System.getProperty( "java.vm.vendor", "Unknown" ) isJetBrainsJVM = System.getProperty( "java.vm.vendor", "Unknown" )
.toLowerCase( Locale.ENGLISH ).contains( "jetbrains" ); .toLowerCase( Locale.ENGLISH ).contains( "jetbrains" );
IS_JETBRAINS_JVM_11_OR_LATER = IS_JETBRAINS_JVM && IS_JAVA_11_OR_LATER; isJetBrainsJVM_11_orLater = isJetBrainsJVM && isJava_11_orLater;
// UI toolkits // UI toolkits
IS_KDE = (IS_LINUX && System.getenv( "KDE_FULL_SESSION" ) != null); isKDE = (isLinux && System.getenv( "KDE_FULL_SESSION" ) != null);
} }
public static long scanVersion( String version ) { public static long scanVersion( String version ) {

View File

@@ -90,10 +90,10 @@ public class UIScale
jreHiDPI = false; jreHiDPI = false;
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
// Java 9 and later supports per-monitor scaling // Java 9 and later supports per-monitor scaling
jreHiDPI = true; jreHiDPI = true;
} else if( SystemInfo.IS_JETBRAINS_JVM ) { } else if( SystemInfo.isJetBrainsJVM ) {
// IntelliJ IDEA ships its own JetBrains Java 8 JRE that may supports per-monitor scaling // IntelliJ IDEA ships its own JetBrains Java 8 JRE that may supports per-monitor scaling
// see com.intellij.ui.JreHiDpiUtil.isJreHiDPIEnabled() // see com.intellij.ui.JreHiDpiUtil.isJreHiDPIEnabled()
try { try {
@@ -177,18 +177,18 @@ public class UIScale
// default font size // default font size
float fontSizeDivider = 12f; float fontSizeDivider = 12f;
if( SystemInfo.IS_WINDOWS ) { if( SystemInfo.isWindows ) {
// Windows LaF uses Tahoma font rather than the actual Windows system font (Segoe UI), // Windows LaF uses Tahoma font rather than the actual Windows system font (Segoe UI),
// and its size is always ca. 10% smaller than the actual system font size. // and its size is always ca. 10% smaller than the actual system font size.
// Tahoma 11 is used at 100% // Tahoma 11 is used at 100%
if( "Tahoma".equals( font.getFamily() ) ) if( "Tahoma".equals( font.getFamily() ) )
fontSizeDivider = 11f; fontSizeDivider = 11f;
} else if( SystemInfo.IS_MAC ) { } else if( SystemInfo.isMacOS ) {
// default font size on macOS is 13 // default font size on macOS is 13
fontSizeDivider = 13f; fontSizeDivider = 13f;
} else if( SystemInfo.IS_LINUX ) { } else if( SystemInfo.isLinux ) {
// default font size for Unity and Gnome is 15 and for KDE it is 13 // default font size for Unity and Gnome is 15 and for KDE it is 13
fontSizeDivider = SystemInfo.IS_KDE ? 13f : 15f; fontSizeDivider = SystemInfo.isKDE ? 13f : 15f;
} }
return font.getSize() / fontSizeDivider; return font.getSize() / fontSizeDivider;

View File

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

View File

@@ -32,7 +32,7 @@ public class FlatLafDemo
public static void main( String[] args ) { public static void main( String[] args ) {
// on macOS enable screen menu bar // 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" ); System.setProperty( "apple.laf.useScreenMenuBar", "true" );
SwingUtilities.invokeLater( () -> { SwingUtilities.invokeLater( () -> {

View File

@@ -585,7 +585,7 @@ public class FlatDisabledIconsTest
private static ImageIcon loadIcon( String iconName ) { private static ImageIcon loadIcon( String iconName ) {
ImageIcon icon = new ImageIcon( LightOrDarkIcon.class.getResource( iconName ) ); ImageIcon icon = new ImageIcon( LightOrDarkIcon.class.getResource( iconName ) );
if( SystemInfo.IS_MAC || !MultiResolutionImageSupport.isAvailable() || !iconName.endsWith( ".png" ) ) if( SystemInfo.isMacOS || !MultiResolutionImageSupport.isAvailable() || !iconName.endsWith( ".png" ) )
return icon; return icon;
String iconName2x = iconName.replace( ".png", "@2x.png" ); String iconName2x = iconName.replace( ".png", "@2x.png" );

View File

@@ -62,7 +62,7 @@ public class FlatPaintingStringTest
add( new JLabel( "flatlaf" ) ); add( new JLabel( "flatlaf" ) );
add( new JLabel( "0.25*scale" ) ); add( new JLabel( "0.25*scale" ) );
add( new JLabel( "0.5*scale" ) ); add( new JLabel( "0.5*scale" ) );
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
add( new JLabel( "0.25" ) ); add( new JLabel( "0.25" ) );
add( new JLabel( "0.5" ) ); add( new JLabel( "0.5" ) );
add( new JLabel( "0.625" ) ); add( new JLabel( "0.625" ) );
@@ -76,7 +76,7 @@ public class FlatPaintingStringTest
YCorrectionFunction none = (g, scaleFactor) -> 0; YCorrectionFunction none = (g, scaleFactor) -> 0;
YCorrectionFunction flatlaf = (g, scaleFactor) -> { YCorrectionFunction flatlaf = (g, scaleFactor) -> {
return SystemInfo.IS_JAVA_9_OR_LATER return SystemInfo.isJava_9_orLater
? HiDPIUtils.computeTextYCorrection( g ) ? HiDPIUtils.computeTextYCorrection( g )
: (scaleFactor > 1 ? -(0.625f * scaleFactor) : 0); : (scaleFactor > 1 ? -(0.625f * scaleFactor) : 0);
}; };
@@ -100,7 +100,7 @@ public class FlatPaintingStringTest
add( scaleFactor, flatlaf ); add( scaleFactor, flatlaf );
add( scaleFactor, oneQSysScale ); add( scaleFactor, oneQSysScale );
add( scaleFactor, halfSysScale ); add( scaleFactor, halfSysScale );
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
add( scaleFactor, oneQ ); add( scaleFactor, oneQ );
add( scaleFactor, half ); add( scaleFactor, half );
add( scaleFactor, fiveEights ); add( scaleFactor, fiveEights );
@@ -115,7 +115,7 @@ public class FlatPaintingStringTest
} }
private void add( float scaleFactor, YCorrectionFunction correctionFunction ) { private void add( float scaleFactor, YCorrectionFunction correctionFunction ) {
if( SystemInfo.IS_JAVA_9_OR_LATER ) { if( SystemInfo.isJava_9_orLater ) {
add( new Painter( scaleFactor, correctionFunction, 0 ), "split 4, gapx 0 0" ); add( new Painter( scaleFactor, correctionFunction, 0 ), "split 4, gapx 0 0" );
add( new Painter( scaleFactor, correctionFunction, 0.25f ), "gapx 0 0" ); add( new Painter( scaleFactor, correctionFunction, 0.25f ), "gapx 0 0" );
add( new Painter( scaleFactor, correctionFunction, 0.5f ), "gapx 0 0" ); add( new Painter( scaleFactor, correctionFunction, 0.5f ), "gapx 0 0" );
@@ -161,7 +161,7 @@ public class FlatPaintingStringTest
this.yOffset = yOffset; this.yOffset = yOffset;
setBorder( new EmptyBorder( 2, 0, 2, 0 ) ); setBorder( new EmptyBorder( 2, 0, 2, 0 ) );
if( !SystemInfo.IS_JAVA_9_OR_LATER ) { if( !SystemInfo.isJava_9_orLater ) {
Font font = getFont(); Font font = getFont();
setFont( font.deriveFont( (float) Math.round( font.getSize() * scaleFactor ) ) ); setFont( font.deriveFont( (float) Math.round( font.getSize() * scaleFactor ) ) );
} }
@@ -183,7 +183,7 @@ public class FlatPaintingStringTest
FlatUIUtils.setRenderingHints( g2 ); FlatUIUtils.setRenderingHints( g2 );
// simulate component y position at a fraction // simulate component y position at a fraction
if( scaleFactor > 1 && SystemInfo.IS_JAVA_9_OR_LATER ) if( scaleFactor > 1 && SystemInfo.isJava_9_orLater )
g2.translate( 0, yOffset ); g2.translate( 0, yOffset );
int width = getWidth(); int width = getWidth();
@@ -199,7 +199,7 @@ public class FlatPaintingStringTest
// g.drawLine( 0, height2 - 1, width2, height2 - 1 ); // g.drawLine( 0, height2 - 1, width2, height2 - 1 );
int baseline = (int) Math.round( (insets.top + fm.getAscent()) * scaleFactor2 int baseline = (int) Math.round( (insets.top + fm.getAscent()) * scaleFactor2
* (SystemInfo.IS_JAVA_9_OR_LATER ? scaleFactor : 1f) ) - 1; * (SystemInfo.isJava_9_orLater ? scaleFactor : 1f) ) - 1;
int topline = height2 - baseline - 1; int topline = height2 - baseline - 1;
g.setColor( Color.red ); g.setColor( Color.red );
@@ -211,7 +211,7 @@ public class FlatPaintingStringTest
g.translate( insets.left, 0 ); g.translate( insets.left, 0 );
// scale // scale
if( SystemInfo.IS_JAVA_9_OR_LATER ) if( SystemInfo.isJava_9_orLater )
((Graphics2D)g).scale( scaleFactor, scaleFactor ); ((Graphics2D)g).scale( scaleFactor, scaleFactor );
// compute Y correction // compute Y correction
@@ -244,7 +244,7 @@ public class FlatPaintingStringTest
} }
private int scale( int value ) { private int scale( int value ) {
return SystemInfo.IS_JAVA_9_OR_LATER ? Math.round( value * scaleFactor ) : value; return SystemInfo.isJava_9_orLater ? Math.round( value * scaleFactor ) : value;
} }
} }
} }

View File

@@ -104,9 +104,9 @@ public class FlatTestFrame
className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) ) className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) )
continue; continue;
if( (SystemInfo.IS_WINDOWS && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) || if( (SystemInfo.isWindows && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) ||
(SystemInfo.IS_MAC && className.equals( "com.apple.laf.AquaLookAndFeel" )) || (SystemInfo.isMacOS && className.equals( "com.apple.laf.AquaLookAndFeel" )) ||
(SystemInfo.IS_LINUX && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" )) ) (SystemInfo.isLinux && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" )) )
name += " (F9)"; name += " (F9)";
else if( className.equals( MetalLookAndFeel.class.getName() ) ) else if( className.equals( MetalLookAndFeel.class.getName() ) )
name += " (F12)"; name += " (F12)";
@@ -117,13 +117,13 @@ public class FlatTestFrame
} }
String substanceLightClassName = "org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel"; String substanceLightClassName = "org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel";
if( SystemInfo.IS_JAVA_9_OR_LATER && isClassAvailable( substanceLightClassName ) ) { if( SystemInfo.isJava_9_orLater && isClassAvailable( substanceLightClassName ) ) {
lafModel.addElement( new LookAndFeelInfo( "Substance Business (F5)", substanceLightClassName ) ); lafModel.addElement( new LookAndFeelInfo( "Substance Business (F5)", substanceLightClassName ) );
registerSwitchToLookAndFeel( "F5", substanceLightClassName ); registerSwitchToLookAndFeel( "F5", substanceLightClassName );
} }
String substanceDarkClassName = "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel"; String substanceDarkClassName = "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel";
if( SystemInfo.IS_JAVA_9_OR_LATER && isClassAvailable( substanceDarkClassName ) ) { if( SystemInfo.isJava_9_orLater && isClassAvailable( substanceDarkClassName ) ) {
lafModel.addElement( new LookAndFeelInfo( "Substance Graphite Aqua (Ctrl+F5)", substanceDarkClassName ) ); lafModel.addElement( new LookAndFeelInfo( "Substance Graphite Aqua (Ctrl+F5)", substanceDarkClassName ) );
registerSwitchToLookAndFeel( "ctrl F5", substanceDarkClassName ); registerSwitchToLookAndFeel( "ctrl F5", substanceDarkClassName );
} }
@@ -141,7 +141,7 @@ public class FlatTestFrame
} }
String looksWindowsClassName = "com.jgoodies.looks.windows.WindowsLookAndFeel"; String looksWindowsClassName = "com.jgoodies.looks.windows.WindowsLookAndFeel";
if( SystemInfo.IS_WINDOWS && isClassAvailable( looksWindowsClassName ) ) { if( SystemInfo.isWindows && isClassAvailable( looksWindowsClassName ) ) {
lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Windows (F7)", looksWindowsClassName ) ); lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Windows (F7)", looksWindowsClassName ) );
registerSwitchToLookAndFeel( "F7", looksWindowsClassName ); registerSwitchToLookAndFeel( "F7", looksWindowsClassName );
} }
@@ -164,11 +164,11 @@ public class FlatTestFrame
registerSwitchToLookAndFeel( "F8", FlatTestLaf.class.getName() ); registerSwitchToLookAndFeel( "F8", FlatTestLaf.class.getName() );
if( SystemInfo.IS_WINDOWS ) if( SystemInfo.isWindows )
registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
else if( SystemInfo.IS_MAC ) else if( SystemInfo.isMacOS )
registerSwitchToLookAndFeel( "F9", "com.apple.laf.AquaLookAndFeel" ); registerSwitchToLookAndFeel( "F9", "com.apple.laf.AquaLookAndFeel" );
else if( SystemInfo.IS_LINUX ) else if( SystemInfo.isLinux )
registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" ); registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" );
registerSwitchToLookAndFeel( "F12", MetalLookAndFeel.class.getName() ); registerSwitchToLookAndFeel( "F12", MetalLookAndFeel.class.getName() );
registerSwitchToLookAndFeel( "F11", NimbusLookAndFeel.class.getName() ); registerSwitchToLookAndFeel( "F11", NimbusLookAndFeel.class.getName() );

View File

@@ -91,7 +91,7 @@ public class UIDefaultsDump
dump( FlatLightLaf.class.getName(), dir ); dump( FlatLightLaf.class.getName(), dir );
dump( FlatDarkLaf.class.getName(), dir ); dump( FlatDarkLaf.class.getName(), dir );
if( SystemInfo.IS_WINDOWS ) { if( SystemInfo.isWindows ) {
dump( FlatIntelliJLaf.class.getName(), dir ); dump( FlatIntelliJLaf.class.getName(), dir );
dump( FlatDarculaLaf.class.getName(), dir ); dump( FlatDarculaLaf.class.getName(), dir );
} }
@@ -100,11 +100,11 @@ public class UIDefaultsDump
// dump( MetalLookAndFeel.class.getName(), dir ); // dump( MetalLookAndFeel.class.getName(), dir );
// dump( NimbusLookAndFeel.class.getName(), dir ); // dump( NimbusLookAndFeel.class.getName(), dir );
// //
// if( SystemInfo.IS_WINDOWS ) // if( SystemInfo.isWindows )
// dump( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", dir ); // dump( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", dir );
// else if( SystemInfo.IS_MAC ) // else if( SystemInfo.isMacOS )
// dump( "com.apple.laf.AquaLookAndFeel", dir ); // dump( "com.apple.laf.AquaLookAndFeel", dir );
// else if( SystemInfo.IS_LINUX ) // else if( SystemInfo.isLinux )
// dump( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel", dir ); // dump( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel", dir );
// //
// dump( "com.jgoodies.looks.plastic.PlasticLookAndFeel", dir ); // dump( "com.jgoodies.looks.plastic.PlasticLookAndFeel", dir );
@@ -172,9 +172,9 @@ public class UIDefaultsDump
? BasicLookAndFeel.class.getSimpleName() ? BasicLookAndFeel.class.getSimpleName()
: lookAndFeel.getClass().getSimpleName(); : lookAndFeel.getClass().getSimpleName();
} }
String osSuffix = (SystemInfo.IS_MAC && lookAndFeel instanceof FlatLaf) String osSuffix = (SystemInfo.isMacOS && lookAndFeel instanceof FlatLaf)
? "-mac" ? "-mac"
: ((SystemInfo.IS_LINUX && lookAndFeel instanceof FlatLaf) : ((SystemInfo.isLinux && lookAndFeel instanceof FlatLaf)
? "-linux" ? "-linux"
: ""); : "");
String javaVersion = System.getProperty( "java.version" ); String javaVersion = System.getProperty( "java.version" );
@@ -186,9 +186,9 @@ public class UIDefaultsDump
File origFile = null; File origFile = null;
if( !osSuffix.isEmpty() && nameSuffix.isEmpty() ) if( !osSuffix.isEmpty() && nameSuffix.isEmpty() )
origFile = new File( dir, name + nameSuffix + "_" + javaVersion + ".txt" ); origFile = new File( dir, name + nameSuffix + "_" + javaVersion + ".txt" );
else if( lookAndFeel instanceof FlatIntelliJLaf && SystemInfo.IS_WINDOWS ) else if( lookAndFeel instanceof FlatIntelliJLaf && SystemInfo.isWindows )
origFile = new File( dir, "FlatLightLaf_" + javaVersion + ".txt" ); origFile = new File( dir, "FlatLightLaf_" + javaVersion + ".txt" );
else if( lookAndFeel instanceof FlatDarculaLaf && SystemInfo.IS_WINDOWS ) else if( lookAndFeel instanceof FlatDarculaLaf && SystemInfo.isWindows )
origFile = new File( dir, "FlatDarkLaf_" + javaVersion + ".txt" ); origFile = new File( dir, "FlatDarkLaf_" + javaVersion + ".txt" );
if( origFile != null ) { if( origFile != null ) {
try { try {