From d0b0f098d9e49806e8bcd0247bd267d66dfec5f0 Mon Sep 17 00:00:00 2001 From: mmatessi <17149962+basix86@users.noreply.github.com> Date: Thu, 27 Feb 2020 15:46:28 +0100 Subject: [PATCH 001/500] disabledIcon --- .../java/com/formdev/flatlaf/FlatLaf.java | 18 ++++---- .../com/formdev/flatlaf/ui/FlatButtonUI.java | 2 + .../ui/FlatDisabledButtonImageFilter.java | 28 ++++++++++++ .../com/formdev/flatlaf/ui/FlatUIUtils.java | 45 +++++++++++++------ 4 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDisabledButtonImageFilter.java diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index c02ec1e1..eb72c17b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -36,20 +36,13 @@ import java.util.Map; import java.util.function.Consumer; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.AbstractButton; -import javax.swing.JLabel; -import javax.swing.JRootPane; -import javax.swing.JTabbedPane; -import javax.swing.LookAndFeel; -import javax.swing.PopupFactory; -import javax.swing.SwingUtilities; -import javax.swing.UIDefaults; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.*; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; +import javax.swing.plaf.IconUIResource; import javax.swing.plaf.basic.BasicLookAndFeel; import javax.swing.text.html.HTMLEditorKit; +import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.UIScale; @@ -111,6 +104,11 @@ public abstract class FlatLaf return true; } + @Override + public Icon getDisabledIcon(JComponent component, Icon icon) { + return new IconUIResource(FlatUIUtils.getDisabledIcon(icon)); + } + @Override public void initialize() { if( SystemInfo.IS_MAC ) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java index 6055b3bd..2c8ec701 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java @@ -86,6 +86,8 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Button.toolbar.spacingInsets Insets * @uiDefault Button.toolbar.hoverBackground Color * @uiDefault Button.toolbar.pressedBackground Color + * @uiDefault Button.disabledGrayMinValue int optional + * @uiDefault Button.disabledGrayMinValue int optional * * @author Karl Tauber */ diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDisabledButtonImageFilter.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDisabledButtonImageFilter.java new file mode 100644 index 00000000..7e1c4a5f --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDisabledButtonImageFilter.java @@ -0,0 +1,28 @@ +package com.formdev.flatlaf.ui; + +import java.awt.image.RGBImageFilter; + +/** + * Used to create a disabled Icon with the ocean look. + *

+ * Imported from MetalUtils.getOceanDisabledButtonIcon + */ +class FlatDisabledButtonImageFilter extends RGBImageFilter { + private float min; + private float factor; + + FlatDisabledButtonImageFilter( int min, int max ) { + canFilterIndexColorModel = true; + this.min = ( float ) min; + this.factor = ( max - min ) / 255f; + } + + public int filterRGB( int x, int y, int rgb ) { + // Coefficients are from the sRGB color space: + int gray = Math.min( 255, ( int ) ( ( ( 0.2125f * ( ( rgb >> 16 ) & 0xFF ) ) + + ( 0.7154f * ( ( rgb >> 8 ) & 0xFF ) ) + + ( 0.0721f * ( rgb & 0xFF )) + .5f ) * factor + min) ); + + return ( rgb & 0xff000000 ) | ( gray << 16 ) | ( gray << 8 ) | ( gray ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java index 8a15c8d1..590baf62 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java @@ -16,17 +16,7 @@ package com.formdev.flatlaf.ui; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.RenderingHints; -import java.awt.Shape; +import java.awt.*; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; @@ -34,10 +24,11 @@ import java.awt.event.MouseEvent; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageProducer; import java.util.function.Consumer; -import javax.swing.JComponent; -import javax.swing.LookAndFeel; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.plaf.UIResource; import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.util.DerivedColor; @@ -433,6 +424,32 @@ public class FlatUIUtils return explicitlySet; } + public static Icon getDisabledIcon( Icon icon ) { + Image image = safeGetImage(icon); + int grayMinValue = FlatUIUtils.getUIInt( "Button.disabledGrayMinValue", 180 ); + int grayMaxValue = FlatUIUtils.getUIInt( "Button.disabledGrayMaxValue", 215 ); + FlatDisabledButtonImageFilter imageFilter = new FlatDisabledButtonImageFilter(grayMinValue, grayMaxValue); + ImageProducer producer = new FilteredImageSource(image.getSource(), imageFilter); + return new ImageIcon(Toolkit.getDefaultToolkit().createImage(producer)); + } + + private static Image safeGetImage(Icon icon) { + if ( icon instanceof ImageIcon ) { + return ( ( ImageIcon ) icon ).getImage(); + } else { + int width = icon.getIconWidth(); + int height = icon.getIconHeight(); + GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice device = environment.getDefaultScreenDevice(); + GraphicsConfiguration configuration = device.getDefaultConfiguration(); + BufferedImage image = configuration.createCompatibleImage( width, height ); + Graphics2D g = image.createGraphics(); + icon.paintIcon( null, g, 0, 0 ); + g.dispose(); + return image; + } + } + //---- class HoverListener ------------------------------------------------ public static class HoverListener From 7c25f087fb36d2b1b7062091f8678ecad16f7f49 Mon Sep 17 00:00:00 2001 From: mmatessi <17149962+basix86@users.noreply.github.com> Date: Thu, 27 Feb 2020 16:14:51 +0100 Subject: [PATCH 002/500] NPE getDisabledIcon Fix --- flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index eb72c17b..501d04f1 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -106,7 +106,7 @@ public abstract class FlatLaf @Override public Icon getDisabledIcon(JComponent component, Icon icon) { - return new IconUIResource(FlatUIUtils.getDisabledIcon(icon)); + return ( icon == null ) ? null : new IconUIResource( FlatUIUtils.getDisabledIcon( icon ) ); } @Override From 8ee6588d468f3ff1b4731dbb47d6ca13b8ee833a Mon Sep 17 00:00:00 2001 From: mmatessi <17149962+basix86@users.noreply.github.com> Date: Thu, 5 Mar 2020 13:08:49 +0100 Subject: [PATCH 003/500] fix review #70 --- .../java/com/formdev/flatlaf/FlatLaf.java | 13 ++++++++++- .../com/formdev/flatlaf/ui/FlatUIUtils.java | 23 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 501d04f1..429d8602 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -36,7 +36,18 @@ import java.util.Map; import java.util.function.Consumer; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.*; +import javax.swing.AbstractButton; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JRootPane; +import javax.swing.JTabbedPane; +import javax.swing.LookAndFeel; +import javax.swing.PopupFactory; +import javax.swing.SwingUtilities; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.IconUIResource; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java index 590baf62..844262af 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java @@ -16,7 +16,22 @@ package com.formdev.flatlaf.ui; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Toolkit; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; @@ -28,7 +43,11 @@ import java.awt.image.BufferedImage; import java.awt.image.FilteredImageSource; import java.awt.image.ImageProducer; import java.util.function.Consumer; -import javax.swing.*; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.LookAndFeel; +import javax.swing.UIManager; import javax.swing.plaf.UIResource; import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.util.DerivedColor; From de718f847c36fbd91545977094ba4221a71593a0 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 12 Mar 2020 11:15:10 +0100 Subject: [PATCH 004/500] README.md: added KeyStore Explorer and OWASP Zed Attack Proxy (ZAP) to list of projects that use FlatLaf --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c23a53b4..d1dd911f 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ Projects using FlatLaf - [NetBeans](https://netbeans.apache.org/) 11.3 - [jclasslib bytecode viewer](https://github.com/ingokegel/jclasslib) 5.5 +- [KeyStore Explorer](https://keystore-explorer.org/) 5.4.3 +- [OWASP Zed Attack Proxy (ZAP)](https://www.zaproxy.org/) (in weekly releases) - [j-lawyer](https://github.com/jlawyerorg/j-lawyer-org) - [Rest Suite](https://github.com/supanadit/restsuite) - [ControllerBuddy](https://github.com/bwRavencl/ControllerBuddy) From eb30f9d5bf059ae7c9572f57750886f73d67c1ff Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 12 Mar 2020 11:22:43 +0100 Subject: [PATCH 005/500] copy all font attributes in FlatUIUtils.nonUIResource() and when scaling fonts (issue #75) --- .../src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java | 2 +- .../src/main/java/com/formdev/flatlaf/util/UIScale.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java index 8a15c8d1..4264dfec 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java @@ -121,7 +121,7 @@ public class FlatUIUtils } public static Font nonUIResource( Font font ) { - return (font instanceof UIResource) ? new Font( font.getName(), font.getStyle(), font.getSize() ) : font; + return (font instanceof UIResource) ? font.deriveFont( font.getStyle() ) : font; } public static int minimumWidth( JComponent c, int minimumWidth ) { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index d0bb15b8..10d34ff5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -197,7 +197,7 @@ public class UIScale return font; int newFontSize = Math.round( (font.getSize() / fontScaleFactor) * scaleFactor ); - return new FontUIResource( font.getFamily(), font.getStyle(), newFontSize ); + return new FontUIResource( font.deriveFont( (float) newFontSize ) ); } /** @@ -205,7 +205,7 @@ public class UIScale */ public static FontUIResource scaleFont( FontUIResource font, float scaleFactor ) { int newFontSize = Math.round( font.getSize() * scaleFactor ); - return new FontUIResource( font.getFamily(), font.getStyle(), newFontSize ); + return new FontUIResource( font.deriveFont( (float) newFontSize ) ); } /** From 4aeabea3fe577ca2c365e7301d225f34985fb87e Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 15 Mar 2020 10:16:28 +0100 Subject: [PATCH 006/500] UI defaults: updated FlatLightLaf_InputMap_1.8.0_202-mac.txt on Mac --- .../FlatLightLaf_InputMap_1.8.0_202-mac.txt | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt index f680e51e..a958ea8c 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt @@ -22,17 +22,17 @@ CheckBox.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [ #---- ComboBox ---- ComboBox.ancestorInputMap [lazy] 11 javax.swing.plaf.InputMapUIResource [UI] - DOWN selectNext + DOWN selectNext2 END endPassThrough ENTER enterPressed ESCAPE hidePopup HOME homePassThrough - KP_DOWN selectNext - KP_UP selectPrevious + KP_DOWN selectNext2 + KP_UP selectPrevious2 PAGE_DOWN pageDownPassThrough PAGE_UP pageUpPassThrough SPACE spacePopup - UP selectPrevious + UP selectPrevious2 #---- Desktop ---- @@ -376,15 +376,39 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource #---- PopupMenu ---- -PopupMenu.selectedWindowInputMapBindings.RightToLeft length=8 [Ljava.lang.Object; - [0] LEFT - [1] selectChild - [2] KP_LEFT - [3] selectChild - [4] RIGHT - [5] selectParent - [6] KP_RIGHT - [7] selectParent +PopupMenu.selectedWindowInputMapBindings.RightToLeft length=32 [Ljava.lang.Object; + [0] ESCAPE + [1] cancel + [2] DOWN + [3] selectNext + [4] KP_DOWN + [5] selectNext + [6] UP + [7] selectPrevious + [8] KP_UP + [9] selectPrevious + [10] LEFT + [11] selectParent + [12] KP_LEFT + [13] selectParent + [14] RIGHT + [15] selectChild + [16] KP_RIGHT + [17] selectChild + [18] ENTER + [19] return + [20] ctrl ENTER + [21] return + [22] SPACE + [23] return + [24] LEFT + [25] selectChild + [26] KP_LEFT + [27] selectChild + [28] RIGHT + [29] selectParent + [30] KP_RIGHT + [31] selectParent PopupMenu.selectedWindowInputMapBindings length=24 [Ljava.lang.Object; [0] ESCAPE [1] cancel @@ -580,10 +604,10 @@ Table.ancestorInputMap [lazy] 38 javax.swing.plaf.InputMapUIResource COPY copy CUT cut DOWN selectNextRow - END selectLastColumn + END selectLastRow ENTER selectNextRowCell ESCAPE cancel - HOME selectFirstColumn + HOME selectFirstRow KP_DOWN selectNextRow KP_LEFT selectPreviousColumn KP_RIGHT selectNextColumn From df1634de3d8322013f3defbde8b9cbac3645f7d3 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 15 Mar 2020 10:21:28 +0100 Subject: [PATCH 007/500] FlatTestFrame: add JGoodies Windows LaF only when running on Windows --- .../main/java/com/formdev/flatlaf/testing/FlatTestFrame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java index 3d25767e..378b42f7 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java @@ -130,7 +130,7 @@ public class FlatTestFrame } String looksWindowsClassName = "com.jgoodies.looks.windows.WindowsLookAndFeel"; - if( isClassAvailable( looksWindowsClassName ) ) { + if( SystemInfo.IS_WINDOWS && isClassAvailable( looksWindowsClassName ) ) { lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Windows (F7)", looksWindowsClassName ) ); registerSwitchToLookAndFeel( KeyEvent.VK_F7, looksWindowsClassName ); } @@ -231,7 +231,7 @@ public class FlatTestFrame try { Class.forName( className, false, getClass().getClassLoader() ); return true; - } catch( ClassNotFoundException ex ) { + } catch( Throwable ex ) { return false; } } From 2608061d482ade2aa7fd86e434ba10ddf387eb70 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 16 Mar 2020 15:20:17 +0100 Subject: [PATCH 008/500] reviewed (and tested) all key bindings on macOS --- .../com/formdev/flatlaf/FlatInputMaps.java | 103 ++++++++++-------- .../formdev/flatlaf/ui/FlatComboBoxUI.java | 5 +- .../com/formdev/flatlaf/FlatLaf.properties | 1 + .../uidefaults/FlatDarkLaf_1.8.0_202-mac.txt | 1 + .../uidefaults/FlatLightLaf_1.8.0_202-mac.txt | 1 + .../FlatLightLaf_InputMap_1.8.0_202-mac.txt | 98 +++++------------ 6 files changed, 96 insertions(+), 113 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java index 40967801..ae2e2f15 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java @@ -48,10 +48,10 @@ class FlatInputMaps modifyInputMap( defaults, "ComboBox.ancestorInputMap", "SPACE", "spacePopup", - "UP", "selectPrevious2", - "DOWN", "selectNext2", - "KP_UP", "selectPrevious2", - "KP_DOWN", "selectNext2", + "UP", mac( "selectPrevious2", "selectPrevious" ), + "DOWN", mac( "selectNext2", "selectNext" ), + "KP_UP", mac( "selectPrevious2", "selectPrevious" ), + "KP_DOWN", mac( "selectNext2", "selectNext" ), mac( "alt UP", null ), "togglePopup", mac( "alt DOWN", null ), "togglePopup", @@ -182,7 +182,7 @@ class FlatInputMaps "ctrl A", beginLineAction, "ctrl E", endLineAction, - // move caret to document begin/end (without selecting text) + // move caret to document begin/end and select text "shift meta UP", selectionBeginAction, "shift meta DOWN", selectionEndAction, "shift meta KP_UP", selectionBeginAction, @@ -198,16 +198,6 @@ class FlatInputMaps "shift KP_UP", selectionBeginLineAction, "shift KP_DOWN", selectionEndLineAction, - // move caret one page (without selecting text) - "PAGE_UP", pageUpAction, - "PAGE_DOWN", pageDownAction, - - // move caret one page and select text - "shift PAGE_UP", "selection-page-up", // DefaultEditorKit.selectionPageUpAction - "shift PAGE_DOWN", "selection-page-down", // DefaultEditorKit.selectionPageDownAction - "shift meta PAGE_UP", "selection-page-left", // DefaultEditorKit.selectionPageLeftAction - "shift meta PAGE_DOWN", "selection-page-right", // DefaultEditorKit.selectionPageRightAction - // delete previous/next word "ctrl W", deletePrevWordAction, "ctrl D", deleteNextCharAction, @@ -350,6 +340,12 @@ class FlatInputMaps "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -370,8 +366,6 @@ class FlatInputMaps "ctrl UP", null, "ctrl V", null, "ctrl X", null, - "PAGE_DOWN", null, - "PAGE_UP", null, "SPACE", null, "shift ctrl DOWN", null, "shift ctrl END", null, @@ -390,10 +384,16 @@ class FlatInputMaps "shift INSERT", null, "shift SPACE", null ); - - // scrollbar - copyInputMap( defaults, "ScrollBar.ancestorInputMap", "ScrollBar.focusInputMap" ); - copyInputMap( defaults, "ScrollBar.ancestorInputMap.RightToLeft", "ScrollBar.focusInputMap.RightToLeft" ); + modifyInputMap( defaults, "List.focusInputMap.RightToLeft", + "ctrl KP_LEFT", null, + "ctrl KP_RIGHT", null, + "ctrl LEFT", null, + "ctrl RIGHT", null, + "shift ctrl KP_LEFT", null, + "shift ctrl KP_RIGHT", null, + "shift ctrl LEFT", null, + "shift ctrl RIGHT", null + ); // scrollpane modifyInputMap( defaults, "ScrollPane.ancestorInputMap", @@ -410,6 +410,16 @@ class FlatInputMaps "ctrl PAGE_UP", null ); + // tabbedpane + modifyInputMap( defaults, "TabbedPane.ancestorInputMap", + "ctrl UP", null, + "ctrl KP_UP", null + ); + modifyInputMap( defaults, "TabbedPane.focusInputMap", + "ctrl DOWN", null, + "ctrl KP_DOWN", null + ); + // table modifyInputMap( defaults, "Table.ancestorInputMap", "alt TAB", "focusHeader", @@ -419,6 +429,12 @@ class FlatInputMaps "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -476,27 +492,31 @@ class FlatInputMaps "RIGHT", "selectChild", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", + "shift LEFT", "selectParent", + "shift RIGHT", "selectChild", + "shift KP_LEFT", "selectParent", + "shift KP_RIGHT", "selectChild", + "alt LEFT", "selectParent", + "alt RIGHT", "selectChild", + "alt KP_LEFT", "selectParent", + "alt KP_RIGHT", "selectChild", "meta A", "selectAll", "meta C", "copy", "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl LEFT", null, "ctrl RIGHT", null, "ctrl KP_LEFT", null, "ctrl KP_RIGHT", null, - "shift LEFT", null, - "shift RIGHT", null, - "shift KP_LEFT", null, - "shift KP_RIGHT", null, - - "alt LEFT", null, - "alt RIGHT", null, - "alt KP_LEFT", null, - "alt KP_RIGHT", null, - "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -513,11 +533,7 @@ class FlatInputMaps "ctrl UP", null, "ctrl V", null, "ctrl X", null, - "END", null, "F2", null, - "HOME", null, - "PAGE_DOWN", null, - "PAGE_UP", null, "SPACE", null, "shift ctrl DOWN", null, "shift ctrl END", null, @@ -540,17 +556,18 @@ class FlatInputMaps "LEFT", "selectChild", "RIGHT", "selectParent", "KP_LEFT", "selectChild", - "KP_RIGHT", "selectParent" + "KP_RIGHT", "selectParent", + "shift LEFT", "selectChild", + "shift RIGHT", "selectParent", + "shift KP_LEFT", "selectChild", + "shift KP_RIGHT", "selectParent", + "alt LEFT", "selectChild", + "alt RIGHT", "selectParent", + "alt KP_LEFT", "selectChild", + "alt KP_RIGHT", "selectParent" } ) ); } - private static void copyInputMap( UIDefaults defaults, String srcKey, String destKey ) { - // Note: not using `defaults.get(key)` here because this would resolve the lazy value - Object inputMap = defaults.remove( srcKey ); - defaults.put( srcKey, inputMap ); - defaults.put( destKey, inputMap ); - } - private static void modifyInputMap( UIDefaults defaults, String key, Object... bindings ) { // Note: not using `defaults.get(key)` here because this would resolve the lazy value defaults.put( key, new LazyModifyInputMap( defaults.remove( key ), bindings ) ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index 166efa36..5d95d0a5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -281,13 +281,14 @@ public class FlatComboBoxUI // macOS if( SystemInfo.IS_MAC && editor instanceof JTextComponent ) { // delegate actions from editor text field to combobox, which is necessary - // because text field on macOS (based on Aqua LaF UI defaults) - // already handle those keys + // because text field on macOS already handle those keys InputMap inputMap = ((JTextComponent)editor).getInputMap(); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "UP" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_UP" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "DOWN" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_DOWN" ) ); + new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "HOME" ) ); + new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "END" ) ); } } diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 09e01416..955da633 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -178,6 +178,7 @@ ColorChooser.swatchesDefaultRecentColor=$control ComboBox.border=com.formdev.flatlaf.ui.FlatRoundBorder ComboBox.padding=2,6,2,6 +[mac]ComboBox.showPopupOnNavigation=true #---- Component ---- diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt index 069e8b8e..017b1fea 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt @@ -192,6 +192,7 @@ ComboBox.noActionOnKeyNavigation false ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] ComboBox.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] ComboBox.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +ComboBox.showPopupOnNavigation true ComboBox.timeFactor 1000 ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt index 15d57e48..45273420 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt @@ -193,6 +193,7 @@ ComboBox.noActionOnKeyNavigation false ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] ComboBox.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] ComboBox.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +ComboBox.showPopupOnNavigation true ComboBox.timeFactor 1000 ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt index a958ea8c..6d2b12d1 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt @@ -22,17 +22,17 @@ CheckBox.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [ #---- ComboBox ---- ComboBox.ancestorInputMap [lazy] 11 javax.swing.plaf.InputMapUIResource [UI] - DOWN selectNext2 + DOWN selectNext END endPassThrough ENTER enterPressed ESCAPE hidePopup HOME homePassThrough - KP_DOWN selectNext2 - KP_UP selectPrevious2 + KP_DOWN selectNext + KP_UP selectPrevious PAGE_DOWN pageDownPassThrough PAGE_UP pageUpPassThrough SPACE spacePopup - UP selectPrevious2 + UP selectPrevious #---- Desktop ---- @@ -166,7 +166,7 @@ FileChooser.ancestorInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [ #---- FormattedTextField ---- -FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResource [UI] +FormattedTextField.focusInputMap [lazy] 70 javax.swing.plaf.InputMapUIResource [UI] alt BACK_SPACE delete-previous-word alt DELETE delete-next-word alt KP_LEFT caret-previous-word @@ -210,8 +210,6 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc KP_RIGHT caret-forward KP_UP increment LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP increment @@ -226,8 +224,6 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -239,32 +235,22 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line #---- List ---- -List.focusInputMap.RightToLeft [lazy] 16 javax.swing.plaf.InputMapUIResource [UI] - ctrl KP_LEFT selectNextColumnChangeLead - ctrl KP_RIGHT selectPreviousColumnChangeLead - ctrl LEFT selectNextColumnChangeLead - ctrl RIGHT selectPreviousColumnChangeLead +List.focusInputMap.RightToLeft [lazy] 8 javax.swing.plaf.InputMapUIResource [UI] KP_LEFT selectNextColumn KP_RIGHT selectPreviousColumn LEFT selectNextColumn RIGHT selectPreviousColumn - shift ctrl KP_LEFT selectNextColumnExtendSelection - shift ctrl KP_RIGHT selectPreviousColumnExtendSelection - shift ctrl LEFT selectNextColumnExtendSelection - shift ctrl RIGHT selectPreviousColumnExtendSelection shift KP_LEFT selectNextColumnExtendSelection shift KP_RIGHT selectPreviousColumnExtendSelection shift LEFT selectNextColumnExtendSelection shift RIGHT selectPreviousColumnExtendSelection -List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource [UI] +List.focusInputMap [lazy] 27 javax.swing.plaf.InputMapUIResource [UI] meta A selectAll meta C copy meta V paste @@ -272,8 +258,6 @@ List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource COPY copy CUT cut DOWN selectNextRow - END selectLastRow - HOME selectFirstRow KP_DOWN selectNextRow KP_LEFT selectPreviousColumn KP_RIGHT selectNextColumn @@ -298,7 +282,7 @@ List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource #---- PasswordField ---- -PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource [UI] +PasswordField.focusInputMap [lazy] 67 javax.swing.plaf.InputMapUIResource [UI] alt KP_LEFT caret-begin-line alt KP_RIGHT caret-end-line alt LEFT caret-begin-line @@ -339,8 +323,6 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource KP_RIGHT caret-forward KP_UP caret-begin-line LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP caret-begin-line @@ -355,8 +337,6 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -368,8 +348,6 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line @@ -470,24 +448,6 @@ ScrollBar.ancestorInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource PAGE_UP negativeBlockIncrement RIGHT positiveUnitIncrement UP negativeUnitIncrement -ScrollBar.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] - KP_LEFT positiveUnitIncrement - KP_RIGHT negativeUnitIncrement - LEFT positiveUnitIncrement - RIGHT negativeUnitIncrement -ScrollBar.focusInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] - DOWN positiveUnitIncrement - END maxScroll - HOME minScroll - KP_DOWN positiveUnitIncrement - KP_LEFT negativeUnitIncrement - KP_RIGHT positiveUnitIncrement - KP_UP negativeUnitIncrement - LEFT negativeUnitIncrement - PAGE_DOWN positiveBlockIncrement - PAGE_UP negativeBlockIncrement - RIGHT positiveUnitIncrement - UP negativeUnitIncrement #---- ScrollPane ---- @@ -560,16 +520,12 @@ SplitPane.ancestorInputMap [lazy] 14 javax.swing.plaf.InputMapUIResource #---- TabbedPane ---- -TabbedPane.ancestorInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI] - ctrl KP_UP requestFocus +TabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] ctrl PAGE_DOWN navigatePageDown ctrl PAGE_UP navigatePageUp ctrl TAB navigateNext - ctrl UP requestFocus shift ctrl TAB navigatePrevious -TabbedPane.focusInputMap [lazy] 10 javax.swing.plaf.InputMapUIResource [UI] - ctrl DOWN requestFocusForVisibleComponent - ctrl KP_DOWN requestFocusForVisibleComponent +TabbedPane.focusInputMap [lazy] 8 javax.swing.plaf.InputMapUIResource [UI] DOWN navigateDown KP_DOWN navigateDown KP_LEFT navigateLeft @@ -595,7 +551,7 @@ Table.ancestorInputMap.RightToLeft [lazy] 12 javax.swing.plaf.InputMapUIResou shift KP_RIGHT selectPreviousColumnExtendSelection shift LEFT selectNextColumnExtendSelection shift RIGHT selectPreviousColumnExtendSelection -Table.ancestorInputMap [lazy] 38 javax.swing.plaf.InputMapUIResource [UI] +Table.ancestorInputMap [lazy] 34 javax.swing.plaf.InputMapUIResource [UI] alt TAB focusHeader meta A selectAll meta C copy @@ -604,17 +560,13 @@ Table.ancestorInputMap [lazy] 38 javax.swing.plaf.InputMapUIResource COPY copy CUT cut DOWN selectNextRow - END selectLastRow ENTER selectNextRowCell ESCAPE cancel - HOME selectFirstRow KP_DOWN selectNextRow KP_LEFT selectPreviousColumn KP_RIGHT selectNextColumn KP_UP selectPreviousRow LEFT selectPreviousColumn - PAGE_DOWN scrollDownChangeSelection - PAGE_UP scrollUpChangeSelection PASTE paste RIGHT selectNextColumn TAB selectNextColumnCell @@ -745,7 +697,7 @@ TextArea.focusInputMap [lazy] 83 javax.swing.plaf.InputMapUIResource #---- TextField ---- -TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource [UI] +TextField.focusInputMap [lazy] 69 javax.swing.plaf.InputMapUIResource [UI] alt BACK_SPACE delete-previous-word alt DELETE delete-next-word alt KP_LEFT caret-previous-word @@ -788,8 +740,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource KP_RIGHT caret-forward KP_UP caret-begin-line LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP caret-begin-line @@ -804,8 +754,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -817,8 +765,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line @@ -935,12 +881,24 @@ ToolBar.ancestorInputMap [lazy] 8 javax.swing.plaf.InputMapUIResource [ Tree.ancestorInputMap [lazy] 1 javax.swing.plaf.InputMapUIResource [UI] ESCAPE cancel -Tree.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] +Tree.focusInputMap.RightToLeft [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] + alt KP_LEFT selectChild + alt KP_RIGHT selectParent + alt LEFT selectChild + alt RIGHT selectParent KP_LEFT selectChild KP_RIGHT selectParent LEFT selectChild RIGHT selectParent -Tree.focusInputMap [lazy] 19 javax.swing.plaf.InputMapUIResource [UI] + shift KP_LEFT selectChild + shift KP_RIGHT selectParent + shift LEFT selectChild + shift RIGHT selectParent +Tree.focusInputMap [lazy] 27 javax.swing.plaf.InputMapUIResource [UI] + alt KP_LEFT selectParent + alt KP_RIGHT selectChild + alt LEFT selectParent + alt RIGHT selectChild meta A selectAll meta C copy meta V paste @@ -958,5 +916,9 @@ Tree.focusInputMap [lazy] 19 javax.swing.plaf.InputMapUIResource UP selectPrevious shift DOWN selectNextExtendSelection shift KP_DOWN selectNextExtendSelection + shift KP_LEFT selectParent + shift KP_RIGHT selectChild shift KP_UP selectPreviousExtendSelection + shift LEFT selectParent + shift RIGHT selectChild shift UP selectPreviousExtendSelection From c706a79f7457659eab04fd9a381c1e00dee86375 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 16 Mar 2020 22:46:33 +0100 Subject: [PATCH 009/500] UIScale: fixed NPE in getSystemScaleFactor() (occurred in progress bar on startup in NB) --- .../src/main/java/com/formdev/flatlaf/util/UIScale.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index 10d34ff5..9f7ac69b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -97,7 +97,7 @@ public class UIScale } public static double getSystemScaleFactor( GraphicsConfiguration gc ) { - return isSystemScalingEnabled() ? gc.getDefaultTransform().getScaleX() : 1; + return (isSystemScalingEnabled() && gc != null) ? gc.getDefaultTransform().getScaleX() : 1; } //---- user scaling (Java 8) ---------------------------------------------- From e51ffe2a1c790219402e2b32a3b82c1102b5742a Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 16 Mar 2020 22:47:44 +0100 Subject: [PATCH 010/500] release 0.28 --- CHANGELOG.md | 6 +++++- build.gradle.kts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deb99d01..c5be7528 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ FlatLaf Change Log ================== -## Unreleased +## 0.28 - PasswordField: Warn about enabled Caps Lock. - TabbedPane: Support Ctrl+TAB / Ctrl+Shift+TAB to switch @@ -11,6 +11,10 @@ FlatLaf Change Log - IntelliJ Themes: Added Gradianto themes to demo. - Button, CheckBox and RadioButton: Fixed NPE when button has children. (PR #68) - ScrollBar: Improved colors. +- Reviewed (and tested) all key bindings on Windows and macOS. Linux key + bindings are equal to Windows key bindings. macOS key bindings are slightly + different for platform specific behavior. +- UI default values are no longer based on Metal/Aqua UI defaults. ## 0.27 diff --git a/build.gradle.kts b/build.gradle.kts index 82af0dc3..9d44f41b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,8 @@ * limitations under the License. */ -val releaseVersion = "0.27" -val developmentVersion = "0.28-SNAPSHOT" +val releaseVersion = "0.28" +val developmentVersion = "0.29-SNAPSHOT" version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion From 1d9c8ca65e0c461dc528cce6a75640a55f8ba7a8 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 26 Mar 2020 13:06:12 +0100 Subject: [PATCH 011/500] Linux: fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime (issue #69) --- CHANGELOG.md | 6 ++++++ .../com/formdev/flatlaf/LinuxFontPolicy.java | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5be7528..71c17239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ FlatLaf Change Log ================== +## Unreleased + +- Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running + on JetBrains Runtime. (issue #69) + + ## 0.28 - PasswordField: Warn about enabled Caps Lock. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java index cee1e295..822e2ad5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java @@ -17,6 +17,7 @@ package com.formdev.flatlaf; import java.awt.Font; +import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.Toolkit; import java.io.BufferedReader; @@ -31,6 +32,7 @@ import java.util.logging.Level; import javax.swing.text.StyleContext; import com.formdev.flatlaf.util.StringUtils; import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; /** * @author Karl Tauber @@ -99,6 +101,10 @@ class LinuxFontPolicy } private static double getGnomeFontScale() { + // do not scale font here if JRE scales + if( isSystemScaling() ) + return 1; + // see class com.sun.java.swing.plaf.gtk.PangoFonts background information Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "gnome.Xft/DPI" ); @@ -168,7 +174,7 @@ class LinuxFontPolicy // font dpi int dpi = 96; - if( forceFontDPI != null ) { + if( forceFontDPI != null && !isSystemScaling() ) { try { dpi = Integer.parseInt( forceFontDPI ); if( dpi <= 0 ) @@ -247,4 +253,15 @@ class LinuxFontPolicy } return null; } + + /** + * Returns true if the JRE scales, which is the case if: + * - environment variable GDK_SCALE is set and running on Java 9 or later + * - running on JetBrains Runtime 11 or later and scaling is enabled in system Settings + */ + private static boolean isSystemScaling() { + GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice().getDefaultConfiguration(); + return UIScale.getSystemScaleFactor( gc ) > 1; + } } From 225b722b1b80ac2bbd5f11f1ac938e0db9beeb92 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 26 Mar 2020 17:20:09 +0100 Subject: [PATCH 012/500] Linux: fixed wrong font size if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime (issue #69) --- .../src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java index 822e2ad5..1da961d8 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java @@ -103,7 +103,7 @@ class LinuxFontPolicy private static double getGnomeFontScale() { // do not scale font here if JRE scales if( isSystemScaling() ) - return 1; + return 96. / 72.; // see class com.sun.java.swing.plaf.gtk.PangoFonts background information From 12af2de99ec239064d2683763ce1c5971c102877 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 27 Mar 2020 10:44:43 +0100 Subject: [PATCH 013/500] no longer use system property `sun.java2d.uiScale` (Java 8 only) --- CHANGELOG.md | 1 + .../src/main/java/com/formdev/flatlaf/util/UIScale.java | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71c17239..7901e4bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FlatLaf Change Log - Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime. (issue #69) +- No longer use system property `sun.java2d.uiScale`. (Java 8 only) ## 0.28 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index 9f7ac69b..8f89cad4 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -177,17 +177,14 @@ public class UIScale } /** - * Applies a custom scale factor given in system properties "flatlaf.uiScale" - * or "sun.java2d.uiScale" to the given font. + * Applies a custom scale factor given in system property "flatlaf.uiScale" + * to the given font. */ public static FontUIResource applyCustomScaleFactor( FontUIResource font ) { if( UIScale.isSystemScalingEnabled() ) return font; String uiScale = System.getProperty( "flatlaf.uiScale" ); - if( uiScale == null ) - uiScale = System.getProperty( "sun.java2d.uiScale" ); - float scaleFactor = parseScaleFactor( uiScale ); if( scaleFactor <= 0 ) return font; From a3788038bbbed7456d70e869183378183fef7987 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 27 Mar 2020 10:51:20 +0100 Subject: [PATCH 014/500] Tree: fixed repainting wide selection on focus gained/lost --- CHANGELOG.md | 1 + .../src/main/resources/com/formdev/flatlaf/FlatLaf.properties | 2 +- .../flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt | 1 + .../flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt | 1 + .../flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt | 1 + .../flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7901e4bb..2e9fd22f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FlatLaf Change Log - Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime. (issue #69) +- Tree: Fixed repainting wide selection on focus gained/lost. - No longer use system property `sun.java2d.uiScale`. (Java 8 only) diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 955da633..aa1521f4 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -269,7 +269,6 @@ InternalFrameTitlePane.border=0,8,0,0 #---- List ---- -List.border=1,0,1,0 List.border=0,0,0,0 List.cellMargins=1,6,1,6 List.cellFocusColor=@cellFocusColor @@ -599,6 +598,7 @@ Tree.dropLineColor=@dropLineColor Tree.rendererFillBackground=false Tree.rendererMargins=1,2,1,2 Tree.wideSelection=true +Tree.repaintWholeRow=true Tree.paintLines=false Tree.leftChildIndent=7 Tree.rightChildIndent=11 diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt index 017b1fea..76bfc81c 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt @@ -1124,6 +1124,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt index a9006f26..8ee08900 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -1122,6 +1122,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt index 45273420..cf2c102b 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt @@ -1126,6 +1126,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt index 0ddf06d9..d4ec7bc1 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -1124,6 +1124,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true From 4ac5ad06f2747838681b7a963add43753d451c34 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 27 Mar 2020 18:54:30 +0100 Subject: [PATCH 015/500] IntelliJ Themes: simplified applying theme properties to UI defaults --- .../src/main/java/com/formdev/flatlaf/FlatLaf.java | 12 +++++++----- .../main/java/com/formdev/flatlaf/IntelliJTheme.java | 9 +-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index c02ec1e1..55a8f087 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -280,16 +280,18 @@ public abstract class FlatLaf // initialize text antialiasing putAATextInfo( defaults ); - invokePostInitialization( defaults ); + // apply additional defaults (e.g. from IntelliJ themes) + applyAdditionalDefaults( defaults ); - return defaults; - } - - void invokePostInitialization( UIDefaults defaults ) { if( postInitialization != null ) { postInitialization.accept( defaults ); postInitialization = null; } + + return defaults; + } + + void applyAdditionalDefaults( UIDefaults defaults ) { } List> getLafClassesForDefaultsLoading() { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java index 33f7dfdc..c0304f4b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -513,15 +513,8 @@ public class IntelliJTheme } @Override - public UIDefaults getDefaults() { - UIDefaults defaults = super.getDefaults(); + void applyAdditionalDefaults( UIDefaults defaults ) { theme.applyProperties( defaults ); - super.invokePostInitialization( defaults ); - return defaults; - } - - @Override - void invokePostInitialization( UIDefaults defaults ) { } @Override From 93b82c0e97172f17fb3b53e6bb691bc7cf4bd92f Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 27 Mar 2020 23:21:55 +0100 Subject: [PATCH 016/500] FlatDefaultsAddon: added afterDefaultsLoading() method to allow modification of UI defaults by Addons --- .../formdev/flatlaf/FlatDefaultsAddon.java | 9 ++++++++ .../java/com/formdev/flatlaf/FlatLaf.java | 17 ++++++++++++-- .../com/formdev/flatlaf/UIDefaultsLoader.java | 22 ++++++++----------- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java index 4e469d8f..1737d8e3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java @@ -17,6 +17,8 @@ package com.formdev.flatlaf; import java.io.InputStream; +import javax.swing.LookAndFeel; +import javax.swing.UIDefaults; /** * Addon for FlatLaf UI defaults. @@ -50,6 +52,13 @@ public abstract class FlatDefaultsAddon return addonClass.getResourceAsStream( propertiesName ); } + /** + * Allows modifying UI defaults after loading UI defaults. + * The default implementation does nothing. + */ + public void afterDefaultsLoading( LookAndFeel laf, UIDefaults defaults ) { + } + /** * Returns the priority used to sort addon loading. * The order is only important if you want overwrite UI defaults of other addons. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 55a8f087..1f11462b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -31,8 +31,10 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.lang.ref.WeakReference; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.ServiceLoader; import java.util.function.Consumer; import java.util.logging.Level; import java.util.logging.Logger; @@ -266,12 +268,19 @@ public abstract class FlatLaf initIconColors( defaults, isDark() ); FlatInputMaps.initInputMaps( defaults ); + // get addons and sort them by priority + ServiceLoader addonLoader = ServiceLoader.load( FlatDefaultsAddon.class ); + List addons = new ArrayList<>(); + for( FlatDefaultsAddon addon : addonLoader ) + addons.add( addon ); + addons.sort( (addon1, addon2) -> addon1.getPriority() - addon2.getPriority() ); + // load defaults from properties List> lafClassesForDefaultsLoading = getLafClassesForDefaultsLoading(); if( lafClassesForDefaultsLoading != null ) - UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, addons, defaults ); else - UIDefaultsLoader.loadDefaultsFromProperties( getClass(), defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, defaults ); // use Aqua MenuBarUI if Mac screen menubar is enabled if( SystemInfo.IS_MAC && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) @@ -283,6 +292,10 @@ public abstract class FlatLaf // apply additional defaults (e.g. from IntelliJ themes) applyAdditionalDefaults( defaults ); + // allow addons modifying UI defaults + for( FlatDefaultsAddon addon : addons ) + addon.afterDefaultsLoading( this, defaults ); + if( postInitialization != null ) { postInitialization.accept( defaults ); postInitialization = null; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java index d19e0966..cc508fe2 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Properties; -import java.util.ServiceLoader; import java.util.function.Function; import java.util.logging.Level; import javax.swing.UIDefaults; @@ -69,7 +68,9 @@ class UIDefaultsLoader private static final String OPTIONAL_PREFIX = "?"; private static final String GLOBAL_PREFIX = "*."; - static void loadDefaultsFromProperties( Class lookAndFeelClass, UIDefaults defaults ) { + static void loadDefaultsFromProperties( Class lookAndFeelClass, List addons, + UIDefaults defaults ) + { // determine classes in class hierarchy in reverse order ArrayList> lafClasses = new ArrayList<>(); for( Class lafClass = lookAndFeelClass; @@ -79,10 +80,12 @@ class UIDefaultsLoader lafClasses.add( 0, lafClass ); } - loadDefaultsFromProperties( lafClasses, defaults ); + loadDefaultsFromProperties( lafClasses, addons, defaults ); } - static void loadDefaultsFromProperties( List> lafClasses, UIDefaults defaults ) { + static void loadDefaultsFromProperties( List> lafClasses, List addons, + UIDefaults defaults ) + { try { // load core properties files Properties properties = new Properties(); @@ -94,15 +97,8 @@ class UIDefaultsLoader } } - // get addons and sort them by priority - ServiceLoader addonLoader = ServiceLoader.load( FlatDefaultsAddon.class ); - List addonList = new ArrayList<>(); - for( FlatDefaultsAddon addon : addonLoader ) - addonList.add( addon ); - addonList.sort( (addon1, addon2) -> addon1.getPriority() - addon2.getPriority() ); - // load properties from addons - for( FlatDefaultsAddon addon : addonList ) { + for( FlatDefaultsAddon addon : addons ) { for( Class lafClass : lafClasses ) { try( InputStream in = addon.getDefaults( lafClass ) ) { if( in != null ) @@ -113,7 +109,7 @@ class UIDefaultsLoader // collect addon class loaders List addonClassLoaders = new ArrayList<>(); - for( FlatDefaultsAddon addon : addonList ) { + for( FlatDefaultsAddon addon : addons ) { ClassLoader addonClassLoader = addon.getClass().getClassLoader(); if( !addonClassLoaders.contains( addonClassLoader ) ) addonClassLoaders.add( addonClassLoader ); From f2ab848c46728a02c9842f514c5bd6b5fa28efe3 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 27 Mar 2020 23:49:25 +0100 Subject: [PATCH 017/500] FlatOptionPaneTest: scroll pane added --- .../formdev/flatlaf/demo/OptionPanePanel.jfd | 4 +- .../flatlaf/testing/FlatOptionPaneTest.java | 378 ++++++++------- .../flatlaf/testing/FlatOptionPaneTest.jfd | 454 +++++++++--------- 3 files changed, 424 insertions(+), 412 deletions(-) diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd index b0408f95..9c9e6980 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -243,7 +243,7 @@ new FormModel { } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 840 ) + "size": new java.awt.Dimension( 840, 900 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java index aed743a4..38b90638 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java @@ -21,13 +21,14 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.*; import javax.swing.border.*; +import com.formdev.flatlaf.demo.ScrollablePanel; import net.miginfocom.swing.*; /** * @author Karl Tauber */ public class FlatOptionPaneTest - extends FlatTestPanel + extends JScrollPane { public static void main( String[] args ) { SwingUtilities.invokeLater( () -> { @@ -55,6 +56,7 @@ public class FlatOptionPaneTest private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + ScrollablePanel panel9 = new ScrollablePanel(); JLabel plainLabel = new JLabel(); JPanel panel1 = new JPanel(); JOptionPane plainOptionPane = new JOptionPane(); @@ -89,194 +91,200 @@ public class FlatOptionPaneTest FlatOptionPaneTest.ShowDialogLinkLabel customShowDialogLabel = new FlatOptionPaneTest.ShowDialogLinkLabel(); //======== this ======== - setLayout(new MigLayout( - "flowy,ltr,insets dialog,hidemode 3", - // columns - "[]" + - "[]" + - "[fill]", - // rows - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]")); + setBorder(BorderFactory.createEmptyBorder()); - //---- plainLabel ---- - plainLabel.setText("Plain"); - add(plainLabel, "cell 0 0"); - - //======== panel1 ======== + //======== panel9 ======== { - panel1.setBorder(LineBorder.createGrayLineBorder()); - panel1.setLayout(new BorderLayout()); + panel9.setLayout(new MigLayout( + "flowy,ltr,insets dialog,hidemode 3", + // columns + "[]" + + "[]" + + "[fill]", + // rows + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]")); - //---- plainOptionPane ---- - plainOptionPane.setMessage("Hello world."); - panel1.add(plainOptionPane, BorderLayout.CENTER); + //---- plainLabel ---- + plainLabel.setText("Plain"); + panel9.add(plainLabel, "cell 0 0"); + + //======== panel1 ======== + { + panel1.setBorder(LineBorder.createGrayLineBorder()); + panel1.setLayout(new BorderLayout()); + + //---- plainOptionPane ---- + plainOptionPane.setMessage("Hello world."); + panel1.add(plainOptionPane, BorderLayout.CENTER); + } + panel9.add(panel1, "cell 1 0"); + + //---- plainShowDialogLabel ---- + plainShowDialogLabel.setOptionPane(plainOptionPane); + plainShowDialogLabel.setTitleLabel(plainLabel); + panel9.add(plainShowDialogLabel, "cell 2 0"); + + //---- errorLabel ---- + errorLabel.setText("Error"); + panel9.add(errorLabel, "cell 0 1"); + + //======== panel2 ======== + { + panel2.setBorder(LineBorder.createGrayLineBorder()); + panel2.setLayout(new BorderLayout()); + + //---- errorOptionPane ---- + errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); + errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); + panel2.add(errorOptionPane, BorderLayout.CENTER); + } + panel9.add(panel2, "cell 1 1"); + + //---- errorShowDialogLabel ---- + errorShowDialogLabel.setTitleLabel(errorLabel); + errorShowDialogLabel.setOptionPane(errorOptionPane); + panel9.add(errorShowDialogLabel, "cell 2 1"); + + //---- informationLabel ---- + informationLabel.setText("Information"); + panel9.add(informationLabel, "cell 0 2"); + + //======== panel3 ======== + { + panel3.setBorder(LineBorder.createGrayLineBorder()); + panel3.setLayout(new BorderLayout()); + + //---- informationOptionPane ---- + informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); + informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); + panel3.add(informationOptionPane, BorderLayout.CENTER); + } + panel9.add(panel3, "cell 1 2"); + + //---- informationShowDialogLabel ---- + informationShowDialogLabel.setOptionPane(informationOptionPane); + informationShowDialogLabel.setTitleLabel(informationLabel); + panel9.add(informationShowDialogLabel, "cell 2 2"); + + //---- questionLabel ---- + questionLabel.setText("Question"); + panel9.add(questionLabel, "cell 0 3"); + + //======== panel4 ======== + { + panel4.setBorder(LineBorder.createGrayLineBorder()); + panel4.setLayout(new BorderLayout()); + + //---- questionOptionPane ---- + questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); + questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); + questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); + panel4.add(questionOptionPane, BorderLayout.CENTER); + } + panel9.add(panel4, "cell 1 3"); + + //---- questionShowDialogLabel ---- + questionShowDialogLabel.setOptionPane(questionOptionPane); + questionShowDialogLabel.setTitleLabel(questionLabel); + panel9.add(questionShowDialogLabel, "cell 2 3"); + + //---- warningLabel ---- + warningLabel.setText("Warning"); + panel9.add(warningLabel, "cell 0 4"); + + //======== panel5 ======== + { + panel5.setBorder(LineBorder.createGrayLineBorder()); + panel5.setLayout(new BorderLayout()); + + //---- warningOptionPane ---- + warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); + warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); + panel5.add(warningOptionPane, BorderLayout.CENTER); + } + panel9.add(panel5, "cell 1 4"); + + //---- warningShowDialogLabel ---- + warningShowDialogLabel.setOptionPane(warningOptionPane); + warningShowDialogLabel.setTitleLabel(warningLabel); + panel9.add(warningShowDialogLabel, "cell 2 4"); + + //---- inputLabel ---- + inputLabel.setText("Input"); + panel9.add(inputLabel, "cell 0 5"); + + //======== panel7 ======== + { + panel7.setBorder(LineBorder.createGrayLineBorder()); + panel7.setLayout(new BorderLayout()); + + //---- inputOptionPane ---- + inputOptionPane.setWantsInput(true); + inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputOptionPane.setMessage("Enter whatever you want:"); + panel7.add(inputOptionPane, BorderLayout.CENTER); + } + panel9.add(panel7, "cell 1 5"); + + //---- inputShowDialogLabel ---- + inputShowDialogLabel.setOptionPane(inputOptionPane); + inputShowDialogLabel.setTitleLabel(inputLabel); + panel9.add(inputShowDialogLabel, "cell 2 5"); + + //---- inputIconLabel ---- + inputIconLabel.setText("Input + icon"); + panel9.add(inputIconLabel, "cell 0 6"); + + //======== panel8 ======== + { + panel8.setBorder(LineBorder.createGrayLineBorder()); + panel8.setLayout(new BorderLayout()); + + //---- inputIconOptionPane ---- + inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + inputIconOptionPane.setWantsInput(true); + inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputIconOptionPane.setMessage("Enter something:"); + panel8.add(inputIconOptionPane, BorderLayout.CENTER); + } + panel9.add(panel8, "cell 1 6"); + + //---- inputIconShowDialogLabel ---- + inputIconShowDialogLabel.setTitleLabel(inputIconLabel); + inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); + panel9.add(inputIconShowDialogLabel, "cell 2 6"); + + //---- customLabel ---- + customLabel.setText("Custom"); + panel9.add(customLabel, "cell 0 7"); + + //======== panel6 ======== + { + panel6.setBorder(LineBorder.createGrayLineBorder()); + panel6.setLayout(new BorderLayout()); + + //---- customOptionPane ---- + customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); + panel6.add(customOptionPane, BorderLayout.CENTER); + } + panel9.add(panel6, "cell 1 7"); + + //---- customShowDialogLabel ---- + customShowDialogLabel.setOptionPane(customOptionPane); + customShowDialogLabel.setTitleLabel(customLabel); + panel9.add(customShowDialogLabel, "cell 2 7"); } - add(panel1, "cell 1 0"); - - //---- plainShowDialogLabel ---- - plainShowDialogLabel.setOptionPane(plainOptionPane); - plainShowDialogLabel.setTitleLabel(plainLabel); - add(plainShowDialogLabel, "cell 2 0"); - - //---- errorLabel ---- - errorLabel.setText("Error"); - add(errorLabel, "cell 0 1"); - - //======== panel2 ======== - { - panel2.setBorder(LineBorder.createGrayLineBorder()); - panel2.setLayout(new BorderLayout()); - - //---- errorOptionPane ---- - errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); - errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); - panel2.add(errorOptionPane, BorderLayout.CENTER); - } - add(panel2, "cell 1 1"); - - //---- errorShowDialogLabel ---- - errorShowDialogLabel.setTitleLabel(errorLabel); - errorShowDialogLabel.setOptionPane(errorOptionPane); - add(errorShowDialogLabel, "cell 2 1"); - - //---- informationLabel ---- - informationLabel.setText("Information"); - add(informationLabel, "cell 0 2"); - - //======== panel3 ======== - { - panel3.setBorder(LineBorder.createGrayLineBorder()); - panel3.setLayout(new BorderLayout()); - - //---- informationOptionPane ---- - informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); - informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); - panel3.add(informationOptionPane, BorderLayout.CENTER); - } - add(panel3, "cell 1 2"); - - //---- informationShowDialogLabel ---- - informationShowDialogLabel.setOptionPane(informationOptionPane); - informationShowDialogLabel.setTitleLabel(informationLabel); - add(informationShowDialogLabel, "cell 2 2"); - - //---- questionLabel ---- - questionLabel.setText("Question"); - add(questionLabel, "cell 0 3"); - - //======== panel4 ======== - { - panel4.setBorder(LineBorder.createGrayLineBorder()); - panel4.setLayout(new BorderLayout()); - - //---- questionOptionPane ---- - questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); - questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); - questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); - panel4.add(questionOptionPane, BorderLayout.CENTER); - } - add(panel4, "cell 1 3"); - - //---- questionShowDialogLabel ---- - questionShowDialogLabel.setOptionPane(questionOptionPane); - questionShowDialogLabel.setTitleLabel(questionLabel); - add(questionShowDialogLabel, "cell 2 3"); - - //---- warningLabel ---- - warningLabel.setText("Warning"); - add(warningLabel, "cell 0 4"); - - //======== panel5 ======== - { - panel5.setBorder(LineBorder.createGrayLineBorder()); - panel5.setLayout(new BorderLayout()); - - //---- warningOptionPane ---- - warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); - warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); - panel5.add(warningOptionPane, BorderLayout.CENTER); - } - add(panel5, "cell 1 4"); - - //---- warningShowDialogLabel ---- - warningShowDialogLabel.setOptionPane(warningOptionPane); - warningShowDialogLabel.setTitleLabel(warningLabel); - add(warningShowDialogLabel, "cell 2 4"); - - //---- inputLabel ---- - inputLabel.setText("Input"); - add(inputLabel, "cell 0 5"); - - //======== panel7 ======== - { - panel7.setBorder(LineBorder.createGrayLineBorder()); - panel7.setLayout(new BorderLayout()); - - //---- inputOptionPane ---- - inputOptionPane.setWantsInput(true); - inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputOptionPane.setMessage("Enter whatever you want:"); - panel7.add(inputOptionPane, BorderLayout.CENTER); - } - add(panel7, "cell 1 5"); - - //---- inputShowDialogLabel ---- - inputShowDialogLabel.setOptionPane(inputOptionPane); - inputShowDialogLabel.setTitleLabel(inputLabel); - add(inputShowDialogLabel, "cell 2 5"); - - //---- inputIconLabel ---- - inputIconLabel.setText("Input + icon"); - add(inputIconLabel, "cell 0 6"); - - //======== panel8 ======== - { - panel8.setBorder(LineBorder.createGrayLineBorder()); - panel8.setLayout(new BorderLayout()); - - //---- inputIconOptionPane ---- - inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - inputIconOptionPane.setWantsInput(true); - inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputIconOptionPane.setMessage("Enter something:"); - panel8.add(inputIconOptionPane, BorderLayout.CENTER); - } - add(panel8, "cell 1 6"); - - //---- inputIconShowDialogLabel ---- - inputIconShowDialogLabel.setTitleLabel(inputIconLabel); - inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); - add(inputIconShowDialogLabel, "cell 2 6"); - - //---- customLabel ---- - customLabel.setText("Custom"); - add(customLabel, "cell 0 7"); - - //======== panel6 ======== - { - panel6.setBorder(LineBorder.createGrayLineBorder()); - panel6.setLayout(new BorderLayout()); - - //---- customOptionPane ---- - customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); - panel6.add(customOptionPane, BorderLayout.CENTER); - } - add(panel6, "cell 1 7"); - - //---- customShowDialogLabel ---- - customShowDialogLabel.setOptionPane(customOptionPane); - customShowDialogLabel.setTitleLabel(customLabel); - add(customShowDialogLabel, "cell 2 7"); + setViewportView(panel9); // JFormDesigner - End of component initialization //GEN-END:initComponents } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd index 529f099f..ff83c766 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -6,240 +6,244 @@ new FormModel { auxiliary() { "JavaCodeGenerator.defaultVariableLocal": true } - add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" - "$columnConstraints": "[][][fill]" - "$rowConstraints": "[top][top][top][top][top][top][top][top]" - } ) { + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "this" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "plainLabel" - "text": "Plain" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel1" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "plainOptionPane" - "message": "Hello world." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormContainer( "com.formdev.flatlaf.demo.ScrollablePanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" + "$columnConstraints": "[][][fill]" + "$rowConstraints": "[top][top][top][top][top][top][top][top]" + } ) { + name: "panel9" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "plainLabel" + "text": "Plain" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "plainShowDialogLabel" - "optionPane": new FormReference( "plainOptionPane" ) - "titleLabel": new FormReference( "plainLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "errorLabel" - "text": "Error" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel2" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "errorOptionPane" - "messageType": 0 - "optionType": 2 - "message": "Your PC ran into a problem. Buy a new one." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel1" + "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "plainOptionPane" + "message": "Hello world." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "errorShowDialogLabel" - "titleLabel": new FormReference( "errorLabel" ) - "optionPane": new FormReference( "errorOptionPane" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "informationLabel" - "text": "Information" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel3" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "informationOptionPane" - "messageType": 1 - "optionType": 0 - "message": "Text with\nmultiple lines\n(use \\n to separate lines)" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "informationShowDialogLabel" - "optionPane": new FormReference( "informationOptionPane" ) - "titleLabel": new FormReference( "informationLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "questionLabel" - "text": "Question" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 3" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel4" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "questionOptionPane" - "messageType": 3 - "optionType": 1 - "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "questionShowDialogLabel" - "optionPane": new FormReference( "questionOptionPane" ) - "titleLabel": new FormReference( "questionLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 3" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "warningLabel" - "text": "Warning" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 4" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel5" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "warningOptionPane" - "messageType": 2 - "optionType": 2 - "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 4" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "warningShowDialogLabel" - "optionPane": new FormReference( "warningOptionPane" ) - "titleLabel": new FormReference( "warningLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 4" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputLabel" - "text": "Input" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 5" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel7" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputOptionPane" - "wantsInput": true - "optionType": 2 - "message": "Enter whatever you want:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 5" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "inputShowDialogLabel" - "optionPane": new FormReference( "inputOptionPane" ) - "titleLabel": new FormReference( "inputLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 5" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputIconLabel" - "text": "Input + icon" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 6" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel8" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputIconOptionPane" - "messageType": 1 - "wantsInput": true - "optionType": 2 - "message": "Enter something:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 6" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "inputIconShowDialogLabel" - "titleLabel": new FormReference( "inputIconLabel" ) - "optionPane": new FormReference( "inputIconOptionPane" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 6" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "customLabel" - "text": "Custom" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 7" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel6" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "customOptionPane" - "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "plainShowDialogLabel" + "optionPane": new FormReference( "plainOptionPane" ) + "titleLabel": new FormReference( "plainLabel" ) auxiliary() { "JavaCodeGenerator.variableLocal": false } - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "errorLabel" + "text": "Error" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel2" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "errorOptionPane" + "messageType": 0 + "optionType": 2 + "message": "Your PC ran into a problem. Buy a new one." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "errorShowDialogLabel" + "titleLabel": new FormReference( "errorLabel" ) + "optionPane": new FormReference( "errorOptionPane" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "informationLabel" + "text": "Information" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel3" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "informationOptionPane" + "messageType": 1 + "optionType": 0 + "message": "Text with\nmultiple lines\n(use \\n to separate lines)" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "informationShowDialogLabel" + "optionPane": new FormReference( "informationOptionPane" ) + "titleLabel": new FormReference( "informationLabel" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "questionLabel" + "text": "Question" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel4" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "questionOptionPane" + "messageType": 3 + "optionType": 1 + "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "questionShowDialogLabel" + "optionPane": new FormReference( "questionOptionPane" ) + "titleLabel": new FormReference( "questionLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "warningLabel" + "text": "Warning" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel5" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "warningOptionPane" + "messageType": 2 + "optionType": 2 + "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "warningShowDialogLabel" + "optionPane": new FormReference( "warningOptionPane" ) + "titleLabel": new FormReference( "warningLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputLabel" + "text": "Input" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel7" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputOptionPane" + "wantsInput": true + "optionType": 2 + "message": "Enter whatever you want:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "inputShowDialogLabel" + "optionPane": new FormReference( "inputOptionPane" ) + "titleLabel": new FormReference( "inputLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputIconLabel" + "text": "Input + icon" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel8" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputIconOptionPane" + "messageType": 1 + "wantsInput": true + "optionType": 2 + "message": "Enter something:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "inputIconShowDialogLabel" + "titleLabel": new FormReference( "inputIconLabel" ) + "optionPane": new FormReference( "inputIconOptionPane" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "customLabel" + "text": "Custom" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel6" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "customOptionPane" + "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "customShowDialogLabel" + "optionPane": new FormReference( "customOptionPane" ) + "titleLabel": new FormReference( "customLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 7" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "customShowDialogLabel" - "optionPane": new FormReference( "customOptionPane" ) - "titleLabel": new FormReference( "customLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 7" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 920 ) + "size": new java.awt.Dimension( 840, 900 ) } ) } } From e2618c37a215a6557925291677d822a71109a6a7 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 28 Mar 2020 09:41:03 +0100 Subject: [PATCH 018/500] Testing: added "size variant" combobox to control bar if Aqua or Nimbus LaF are active --- .../flatlaf/testing/FlatTestFrame.java | 38 ++++++++++++++++++- .../formdev/flatlaf/testing/FlatTestFrame.jfd | 20 ++++++++-- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java index 378b42f7..af6722bf 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java @@ -142,6 +142,8 @@ public class FlatTestFrame if( scaleFactor != null ) scaleFactorComboBox.setSelectedItem( scaleFactor ); + updateSizeVariantComboBox(); + // register F1, F2, ... keys to switch to Light, Dark or other LaFs registerSwitchToLookAndFeel( KeyEvent.VK_F1, FlatLightLaf.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F2, FlatDarkLaf.class.getName() ); @@ -198,6 +200,9 @@ public class FlatTestFrame // enable/disable scale factor combobox updateScaleFactorComboBox(); + // show/hide size variant combobox + updateSizeVariantComboBox(); + // this is necessary because embedded JOptionPane's "steal" the default button getRootPane().setDefaultButton( closeButton ); } ); @@ -401,6 +406,23 @@ public class FlatTestFrame scaleFactorComboBox.setEnabled( !UIScale.isSystemScalingEnabled() && UIManager.getLookAndFeel() instanceof FlatLaf ); } + private void sizeVariantChanged() { + String sel = (String) sizeVariantComboBox.getSelectedItem(); + String sizeVariant = "default".equals( sel ) ? null : sel; + + updateComponentsRecur( content, (c, type) -> { + if( c instanceof JComponent ) + ((JComponent)c).putClientProperty( "JComponent.sizeVariant", sizeVariant ); + } ); + } + + private void updateSizeVariantComboBox() { + LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); + boolean visible = lookAndFeel instanceof NimbusLookAndFeel || + "com.apple.laf.AquaLookAndFeel".equals( lookAndFeel.getClass().getName() ); + sizeVariantComboBox.setVisible( visible ); + } + private void updateComponentsRecur( Container container, BiConsumer action ) { for( Component c : container.getComponents() ) { if( c instanceof JPanel || c instanceof JDesktopPane ) { @@ -471,6 +493,7 @@ public class FlatTestFrame explicitColorsCheckBox = new JCheckBox(); backgroundCheckBox = new JCheckBox(); opaqueTriStateCheckBox = new TriStateCheckBox(); + sizeVariantComboBox = new JComboBox<>(); closeButton = new JButton(); themesPanel = new IJThemesPanel(); @@ -508,6 +531,7 @@ public class FlatTestFrame "[fill]" + "[fill]" + "[fill]" + + "[fill]" + "[grow,fill]" + "[button,fill]", // rows @@ -573,9 +597,20 @@ public class FlatTestFrame opaqueTriStateCheckBox.addActionListener(e -> opaqueChanged()); buttonBar.add(opaqueTriStateCheckBox, "cell 7 0"); + //---- sizeVariantComboBox ---- + sizeVariantComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "mini", + "small", + "default", + "large" + })); + sizeVariantComboBox.setSelectedIndex(2); + sizeVariantComboBox.addActionListener(e -> sizeVariantChanged()); + buttonBar.add(sizeVariantComboBox, "cell 8 0"); + //---- closeButton ---- closeButton.setText("Close"); - buttonBar.add(closeButton, "cell 9 0"); + buttonBar.add(closeButton, "cell 10 0"); } dialogPane.add(buttonBar, BorderLayout.SOUTH); dialogPane.add(themesPanel, BorderLayout.EAST); @@ -596,6 +631,7 @@ public class FlatTestFrame private JCheckBox explicitColorsCheckBox; private JCheckBox backgroundCheckBox; private TriStateCheckBox opaqueTriStateCheckBox; + private JComboBox sizeVariantComboBox; private JButton closeButton; private IJThemesPanel themesPanel; // JFormDesigner - End of variables declaration //GEN-END:variables diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd index f92a2a2f..3b665f35 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -21,7 +21,7 @@ new FormModel { } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets dialog" - "$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]" + "$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]" "$rowSpecs": "[fill]" } ) { name: "buttonBar" @@ -105,11 +105,25 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 7 0" } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "sizeVariantComboBox" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "mini" + addElement( "mini" ) + addElement( "small" ) + addElement( "default" ) + addElement( "large" ) + } + "selectedIndex": 2 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "sizeVariantChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 8 0" + } ) add( new FormComponent( "javax.swing.JButton" ) { name: "closeButton" "text": "Close" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 9 0" + "value": "cell 10 0" } ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "South" From 1bebfe9cf27bff00b99b4a2a0a60a4893290acb7 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 28 Mar 2020 09:41:51 +0100 Subject: [PATCH 019/500] IntelliJ Themes Demo: updated Arc, Arc Orange and Hiberbee themes (used IJThemesUpdater) --- .../demo/intellijthemes/Hiberbee.theme.json | 319 ++++++++---------- .../arc-theme-orange.theme.json | 3 +- .../demo/intellijthemes/arc-theme.theme.json | 3 +- 3 files changed, 142 insertions(+), 183 deletions(-) diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json index d2dafd0b..79535329 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json @@ -1,114 +1,124 @@ { + "name": "Hiberbee", "author": "Vlad Volkov", + "dark": true, + "editorScheme": "/colors/Hiberbee.xml", "colors": { "accent": "#FFC83C", + "desaturatedBlue": "#1e282d", + "desaturatedOrange": "#8049117f", + "green": "#5B8021", "greyDot15": "#d8d8d8", + "greyDot20": "#cccccc", "greyDot25": "#bfbfbf", "greyDot33": "#aaaaaa", "greyDot50": "#7d7d7d", + "greyDot60": "#666666", "greyDot65": "#5a5a5a", "greyDot70": "#4d4d4d", "greyDot75": "#434343", "greyDot80": "#323232", "greyDot85": "#252525", - "greyDot90": "#191919", + "greyDot90": "#1f2021", + "lightBlue": "#57D1EB", "navyDot85": "#191d21", "navyDot90": "#1f2021", - "lightBlue": "#90dae6", - "green": "#5B8021", "red": "#800040", - "desaturatedBlue": "#1e282d", - "desaturatedOrange": "#8049117f", "transparentGreen": "#5B80217f", "transparentRed": "#8000407f", - "transparentYellow": "#8066357f", "transparentViolet": "#9478F67f", + "transparentYellow": "#8066357f", "yellow": "#806635" }, - "dark": true, - "editorScheme": "/Hiberbee.xml", "icons": { "ColorPalette": { + "Actions.Blue": "#57D1EB", + "Actions.Green": "#92D923", "Actions.Grey": "#afafaf", - "Actions.Red": "#ff0072", - "Actions.Yellow": "#f7cd46", - "Actions.Green": "#A6E22E", - "Actions.Blue": "#307bf6", - "Actions.GreyInline": "#afafaf", - "Actions.GreyInline.Dark": "#7d7d7d", - "Objects.Grey": "#c8c8c8", - "Objects.RedStatus": "#EC5F5D", - "Objects.Red": "#ff0072", + "Actions.GreyInline": "#7f7f7f", + "Actions.GreyInline.Dark": "#646464", + "Actions.Red": "#ff6188", + "Actions.Yellow": "#FFC83C", + "Objects.BlackText": "greyDot33", + "Objects.Blue": "#57D1EB", + "Objects.Green": "#92D923", + "Objects.GreenAndroid": "#92D923", + "Objects.Grey": "#7f7f7f", "Objects.Pink": "#ffa9ca", - "Objects.Yellow": "#f7cd46", - "Objects.Green": "#78b756", - "Objects.Purple": "#9478f6", - "Objects.BlackText": "#4d4d4d", - "Objects.Blue": "#49b0f1", - "Objects.YellowDark": "#fd971f", - "Objects.GreenAndroid": "#78c856" + "Objects.Purple": "#9380FF", + "Objects.Red": "#ed005c", + "Objects.RedStatus": "#EC5F5D", + "Objects.Yellow": "#FFC83C", + "Objects.YellowDark": "#FD971F" } }, - "name": "Hiberbee", "ui": { - "ActionButton.hoverBackground": "greyDot65", - "ActionButton.hoverBorderColor": "greyDot50", - "ActionButton.pressedBackground": "greyDot65", - "Borders.ContrastBorderColor": "greyDot65", - "ActionButton.pressedBorderColor": "lightBlue", - "Borders.color": "greyDot65", - "Button.arc": "5", - "Button.background": "greyDot80", + "*": { + "arc": "3", + "shadow": "greyDot75", + "background": "greyDot80", + "borderColor": "greyDot70", + "caretForeground": "accent", + "color": "greyDot50", + "foreground": "greyDot20", + "hoverBackground": "greyDot70", + "selectedBackground": "greyDot85", + "selectedForeground": "greyDot15", + "selectedInactiveBackground": "greyDot70", + "selectionBackground": "navyDot85", + "selectionForeground": "accent", + "separatorColor": "greyDot75", + "underlineHeight": 1 + }, + "ActionButton": { + "hoverBorderColor": "greyDot50", + "pressedBackground": "greyDot65", + "pressedBorderColor": "greyDot50" + }, + "Borders": { + "ContrastBorderColor": "greyDot65", + "color": "greyDot70" + }, "Button.default.endBackground": "greyDot80", "Button.default.endBorderColor": "greyDot65", - "Button.default.startBorderColor": "greyDot65", - "Button.default.focusColor": "greyDot50", - "Button.default.focusedBorderColor": "lightBlue", - "Button.default.foreground": "greyDot25", - "Button.default.shadowColor": "navyDot90", + "Button.default.focusColor": "greyDot80", + "Button.default.focusedBorderColor": "greyDot15", + "Button.default.foreground": "greyDot15", "Button.default.startBackground": "greyDot80", + "Button.default.startBorderColor": "greyDot65", "Button.endBackground": "greyDot80", - "Button.startBorderColor": "greyDot65", "Button.endBorderColor": "greyDot65", "Button.focusedBorderColor": "accent", - "Button.foreground": "greyDot25", - "Button.shadowColor": "navyDot90", - "Button.shadowWidth": "0", "Button.startBackground": "greyDot80", - "CheckBox.background": "greyDot80", - "CheckBoxMenuItem.background": "greyDot80", - "CheckBoxMenuItem.disabledBackground": "greyDot85", - "CheckBoxMenuItem.selectionForeground": "accent", + "Button.startBorderColor": "greyDot65", + "CheckBox.disabledText": "greyDot33", + "CheckBox.select": "greyDot50", + "CheckBoxMenuItem.disabledBackground": "greyDot80", "ComboBox.ArrowButton.disabledIconColor": "greyDot50", "ComboBox.ArrowButton.iconColor": "accent", "ComboBox.ArrowButton.nonEditableBackground": "greyDot70", - "ComboBox.background": "greyDot80", "ComboBox.modifiedItemForeground": "accent", + "ComboBox.disabledForeground": "greyDot70", "ComboBox.nonEditableBackground": "greyDot75", - "ComboPopup.border": "1,1,1,1,5a5a5a", - "CompletionPopup.foreground": "greyDot25", - "CompletionPopup.matchForeground": "accent", - "CompletionPopup.selectionBackground": "navyDot85", - "CompletionPopup.selectionInactiveBackground": "greyDot80", - "Component.arc": "5", - "Component.borderColor": "greyDot65", - "Component.errorFocusColor": "red", - "Component.focusColor": "accent", + "ComboPopup.border": "1,1,1,1,4d4d4d", + "CompletionPopup": { + "foreground": "greyDot20", + "matchForeground": "accent" + }, + "Component.arc": "3", + "Label.foreground": "greyDot15", + "Component.disabledBorderColor": "greyDot70", + "Component.infoForeground": "greyDot50", + "Component.errorFocusColor": "#F65F87", + "Component.focusColor": "greyDot50", "Component.focusWidth": "0", "Component.focusedBorderColor": "greyDot50", "Component.hoverIconColor": "accent", - "Component.iconColor": "lightBlue", "Component.inactiveErrorFocusColor": "transparentRed", "Component.inactiveWarningFocusColor": "transparentYellow", "Component.warningFocusColor": "yellow", - "Counter.background": "greyDot80", - "Counter.foreground": "greyDot25", "Debugger.Variables.changedValueForeground": "accent", "Debugger.Variables.evaluatingExpressionForeground": "lightBlue", - "DebuggerPopup.borderColor": "greyDot65", - "DefaultTabs.background": "greyDot80", - "DefaultTabs.borderColor": "greyDot65", - "DefaultTabs.hoverBackground": "navyDot85", "DefaultTabs.underlineColor": "accent", "DefaultTabs.underlineHeight": 1, "DefaultTabs.underlinedTabBackground": "greyDot75", @@ -116,14 +126,8 @@ "DragAndDrop.areaBackground": "greyDot75", "DragAndDrop.areaForeground": "greyDot25", "Editor.background": "greyDot90", - "Editor.foreground": "greyDot25", - "EditorPane.background": "greyDot80", - "EditorPane.caretForeground": "accent", - "EditorPane.foreground": "greyDot25", "EditorPane.inactiveBackground": "greyDot85", "EditorPane.inactiveForeground": "greyDot50", - "EditorPane.selectionBackground": "navyDot85", - "EditorPane.selectionForeground": "accent", "EditorTabs.underlineHeight": 1, "FileColor.Blue": "#23282d", "FileColor.Green": "#232d28", @@ -131,55 +135,45 @@ "FileColor.Rose": "#2d2323", "FileColor.Violet": "#2D232D", "FileColor.Yellow": "#2d2d23", + "FormattedTextField.inactiveBackground": "greyDot80", + "FormattedTextField.background": "greyDot75", "GutterTooltip.infoForeground": "greyDot50", - "InplaceRefactoringPopup.borderColor": "lightBlue", - "Label.background": "greyDot80", + "Label": { + "foreground": "greyDot25", + "infoForeground": "greyDot50" + }, "Link.activeForeground": "lightBlue", "Link.hoverForeground": "accent", "Link.pressedForeground": "lightBlue", "Link.visitedForeground": "greyDot25", - "List.background": "greyDot80", - "List.selectionBackground": "navyDot85", - "List.selectionForeground": "accent", "MemoryIndicator.allocatedBackground": "green", "MemoryIndicator.usedBackground": "red", "Menu.acceleratorForeground": "greyDot25", - "Menu.acceleratorSelectionForeground": "accent", - "Menu.background": "greyDot80", - "Menu.borderColor": "greyDot65", - "Menu.foreground": "greyDot25", - "Menu.selectionForeground": "accent", - "Menu.separatorColor": "greyDot65", - "MenuBar.borderColor": "greyDot65", - "MenuBar.selectionBackground": "navyDot85", - "MenuBar.shadow": "navyDot90", - "MenuItem.selectionForeground": "accent", - "Notification.MoreButton.background": "greyDot85", "Notification.MoreButton.innerBorderColor": "greyDot65", - "Notification.ToolWindow.errorBackground": "red", - "Notification.ToolWindow.errorBorderColor": "greyDot50", - "Notification.ToolWindow.errorForeground": "greyDot15", - "Notification.ToolWindow.informativeBackground": "#304000", - "Notification.ToolWindow.informativeBorderColor": "greyDot65", - "Notification.ToolWindow.informativeForeground": "greyDot15", - "Notification.ToolWindow.warningBackground": "yellow", - "Notification.ToolWindow.warningBorderColor": "greyDot65", - "Notification.ToolWindow.warningForeground": "greyDot15", + "Notification.ToolWindow.errorBackground": "greyDot85", + "Notification.ToolWindow.errorBorderColor": "#ed005c", + "Notification.ToolWindow.errorForeground": "#F65F87", + "Notification.ToolWindow.informativeBackground": "greyDot85", + "Notification.ToolWindow.informativeBorderColor": "#92D923", + "Notification.ToolWindow.informativeForeground": "#92D923", + "Notification.ToolWindow.warningBackground": "greyDot85", + "Notification.ToolWindow.warningBorderColor": "accent", + "Notification.ToolWindow.warningForeground": "accent", "Notification.background": "greyDot85", - "Notification.errorBackground": "red", - "Notification.errorBorderColor": "greyDot65", - "Notification.errorForeground": "greyDot15", - "Notification.foreground": "greyDot25", + "Notification.errorBackground": "greyDot85", + "Notification.errorBorderColor": "#ed005c", + "Notification.errorForeground": "#F65F87", "OptionPane.background": "greyDot80", - "OptionPane.foreground": "greyDot25", + "OptionPane.foreground": "greyDot33", "Panel.background": "greyDot80", - "Panel.foreground": "greyDot25", + "Panel.foreground": "greyDot20", "ParameterInfo.background": "greyDot85", - "ParameterInfo.currentOverloadBackground": "lightBlue", - "ParameterInfo.currentParameterForeground": "accent", "ParameterInfo.foreground": "greyDot25", + "ParameterInfo.currentOverloadBackground": "greyDot65", + "ParameterInfo.currentParameterForeground": "accent", "ParameterInfo.infoForeground": "greyDot33", - "ParameterInfo.lineSeparatorColor": "greyDot70", + "ParameterInfo.lineSeparatorColor": "greyDot75", + "PasswordField.background": "greyDot75", "Plugins.Button.installBackground": "greyDot80", "Plugins.Button.installBorderColor": "greyDot65", "Plugins.Button.installFillBackground": "greyDot80", @@ -187,136 +181,99 @@ "Plugins.Button.installForeground": "accent", "Plugins.SearchField.background": "greyDot75", "Plugins.SectionHeader.background": "greyDot75", - "Plugins.SectionHeader.foreground": "greyDot25", - "Plugins.Tab.hoverBackground": "navyDot85", - "Plugins.Tab.selectedBackground": "greyDot85", + "Plugins.Tab.hoverBackground": "greyDot65", "Plugins.background": "greyDot80", "Plugins.disabledForeground": "greyDot50", - "Plugins.lightSelectionBackground": "greyDot70", + "Plugins.lightSelectionBackground": "navyDot85", "Plugins.tagBackground": "greyDot85", - "Plugins.tagForeground": "greyDot25", "Popup.Advertiser.background": "greyDot85", "Popup.Advertiser.foreground": "greyDot50", "Popup.Header.activeBackground": "greyDot75", "Popup.Header.inactiveBackground": "greyDot85", "Popup.paintBorder": true, "PopupMenu.background": "greyDot80", - "PopupMenu.foreground": "greyDot25", - "PopupMenu.selectionBackground": "navyDot85", - "PopupMenu.selectionForeground": "lightBlue", "PopupMenuSeparator.stripeWidth": 1, - "ProgressBar.failedColor": "red", - "ProgressBar.failedEndColor": "greyDot65", - "ProgressBar.indeterminateEndColor": "greyDot25", + "ProgressBar.failedColor": "#ed005c", + "ProgressBar.failedEndColor": "greyDot75", "ProgressBar.indeterminateStartColor": "accent", - "ProgressBar.passedColor": "green", - "ProgressBar.passedEndColor": "greyDot65", + "ProgressBar.indeterminateEndColor": "#FD971F", + "ProgressBar.passedColor": "#92D923", + "ProgressBar.passedEndColor": "greyDot75", "ProgressBar.progressColor": "accent", "ProgressBar.trackColor": "greyDot75", - "RadioButton.background": "greyDot75", - "ScrollBar.Mac.hoverTrackColor": "greyDot75", - "ScrollBar.Mac.trackColor": "greyDot75", - "ScrollPane.background": "greyDot85", - "ScrollPane.foreground": "greyDot25", - "SearchEverywhere.Advertiser.background": "greyDot85", - "SearchEverywhere.Advertiser.foreground": "greyDot33", - "SearchEverywhere.Header.background": "greyDot85", - "SearchEverywhere.List.separatorColor": "greyDot70", - "SearchEverywhere.List.separatorForeground": "greyDot70", + "RadioButton.background": "greyDot80", + "RadioButtonMenuItem.disabledBackground": "greyDot80", + "ScrollPane.background": "greyDot80", + "SearchEverywhere.Advertiser.foreground": "greyDot50", + "SearchEverywhere.List.separatorForeground": "greyDot50", + "SearchEverywhere.SearchField.infoForeground": "greyDot33", "SearchEverywhere.SearchField.background": "greyDot75", - "SearchEverywhere.SearchField.borderColor": "greyDot70", - "SearchEverywhere.SearchField.infoForeground": "greyDot50", - "SearchEverywhere.Tab.selectedBackground": "greyDot70", - "SearchEverywhere.Tab.selectedForeground": "accent", + "SearchEverywhere.Header.background": "greyDot80", + "SearchEverywhere.Tab.selectedBackground": "greyDot80", "SearchMatch.endBackground": "accent", "SearchMatch.startBackground": "accent", - "Separator.separatorColor": "greyDot70", "SidePanel.background": "greyDot85", - "Slider.background": "greyDot80", - "Slider.focus": "greyDot65", - "SpeedSearch.background": "greyDot80", - "SpeedSearch.borderColor": "greyDot70", - "SpeedSearch.errorForeground": "red", + "SpeedSearch.errorForeground": "#F65F87", "SpeedSearch.foreground": "accent", - "SplitPane.background": "greyDot80", - "SplitPane.darkShadow": "navyDot90", "SplitPane.highlight": "accent", - "SplitPane.shadow": "navyDot90", - "TabbedPane.background": "greyDot80", - "TabbedPane.contentAreaColor": "greyDot80", - "TabbedPane.disabledUnderlineColor": "greyDot75", + "PopupMenu.translucentBackground": "greyDot50", + "TabbedPane.disabledUnderlineColor": "greyDot65", "TabbedPane.focusColor": "greyDot65", - "TabbedPane.foreground": "greyDot25", - "TabbedPane.hoverColor": "navyDot85", "TabbedPane.tabSelectionHeight": 1, "TabbedPane.underlineColor": "accent", - "Table.background": "greyDot80", "Table.dropLineColor": "greyDot75", "Table.dropLineShortColor": "greyDot70", + "Table.focusCellBackground": "greyDot85", "Table.focusCellForeground": "accent", - "Table.selectionBackground": "navyDot85", - "Table.selectionForeground": "accent", "Table.sortIconColor": "accent", "Table.stripeColor": "greyDot75", "TableHeader.background": "greyDot85", - "TableHeader.bottomSeparatorColor": "greyDot75", - "TableHeader.separatorColor": "greyDot70", - "TextArea.background": "greyDot85", + "TableHeader.bottomSeparatorColor": "greyDot65", + "TextArea.background": "greyDot75", "TextArea.caretForeground": "accent", - "TextArea.foreground": "greyDot25", - "TextArea.selectionBackground": "navyDot85", + "TextArea.inactiveBackground": "greyDot80", "TextField.background": "greyDot75", - "TextField.caretForeground": "accent", - "TextField.darkShadow": "navyDot90", "TextField.foreground": "greyDot25", + "TextField.caretForeground": "accent", "TextField.highlight": "greyDot15", - "TextField.selectionBackground": "navyDot85", - "TextPane.background": "greyDot80", + "TextField.inactiveForeground": "greyDot33", + "TextPane.inactiveBackground": "greyDot80", "TitlePane.background": "greyDot85", - "ToggleButton.borderColor": "greyDot70", - "ToggleButton.buttonColor": "greyDot75", + "ToggleButton.buttonColor": "greyDot65", "ToggleButton.offBackground": "greyDot75", "ToggleButton.offForeground": "greyDot25", - "ToggleButton.onBackground": "greyDot50", - "ToggleButton.onForeground": "accent", - "ToolBar.background": "greyDot80", - "ToolBar.borderHandleColor": "greyDot70", - "ToolBar.darkShadow": "navyDot90", - "ToolBar.shadow": "navyDot90", + "ToggleButton.onBackground": "accent", + "ToggleButton.onForeground": "greyDot80", + "ToolBar.borderHandleColor": "greyDot65", "ToolTip.Actions.background": "greyDot80", "ToolTip.Actions.infoForeground": "greyDot50", "ToolTip.background": "greyDot75", - "ToolTip.foreground": "greyDot25", "ToolTip.infoForeground": "greyDot50", - "ToolWindow.Button.hoverBackground": "navyDot85", - "ToolWindow.Button.selectedBackground": "greyDot70", - "ToolWindow.Button.selectedForeground": "accent", + "ToolWindow.Button.hoverBackground": "greyDot65", + "ToolWindow.Button.selectedBackground": "greyDot85", + "ToolWindow.Button.selectedForeground": "lightBlue", "ToolWindow.Header.background": "greyDot85", "ToolWindow.Header.inactiveBackground": "greyDot80", - "ToolWindow.HeaderTab.hoverBackground": "navyDot85", - "ToolWindow.HeaderTab.hoverInactiveBackground": "navyDot90", + "ToolWindow.HeaderTab.hoverBackground": "greyDot65", + "ToolWindow.HeaderTab.hoverInactiveBackground": "greyDot85", "ToolWindow.HeaderTab.inactiveUnderlineColor": "greyDot75", - "ToolWindow.HeaderTab.selectedInactiveBackground": "greyDot80", "ToolWindow.HeaderTab.underlineColor": "accent", "ToolWindow.HeaderTab.underlineHeight": 1, + "ToolWindow.HeaderTab.underlinedTabBackground": "greyDot90", "ToolWindow.HeaderTab.underlinedTabInactiveBackground": "greyDot75", "Tree.background": "greyDot85", + "Tree.foreground": "greyDot15", "Tree.modifiedItemForeground": "accent", - "Tree.paintLines": 0, - "Tree.rowHeight": 20, - "Tree.selectionBackground": "navyDot85", - "Tree.selectionForeground": "accent", - "Tree.selectionInactiveBackground": "navyDot90", - "ValidationTooltip.errorBackground": "red", - "ValidationTooltip.errorBorderColor": "greyDot65", - "ValidationTooltip.warningBackground": "#805e00", - "ValidationTooltip.warningBorderColor": "greyDot65", + "ValidationTooltip.errorBackground": "greyDot85", + "ValidationTooltip.errorBorderColor": "#ed005c", + "ValidationTooltip.warningBackground": "greyDot85", + "ValidationTooltip.warningBorderColor": "accent", "VersionControl.FileHistory.Commit.selectedBranchBackground": "greyDot70", "VersionControl.Log.Commit.currentBranchBackground": "greyDot85", "VersionControl.Log.Commit.unmatchedForeground": "greyDot25", "WelcomeScreen.Projects.selectionBackground": "navyDot85", "WelcomeScreen.Projects.selectionInactiveBackground": "navyDot90", "WelcomeScreen.separatorColor": "greyDot65", - "Window.border": "0,0,0,0,5a5a5a" + "Window.border": "1,1,1,1,4d4d4d" } } diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json index 46e3fa3f..505a3225 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json @@ -36,6 +36,8 @@ } }, + "ToolBar.background" : "#F5F5F5", + "Popup.Toolbar.background" : "#F5F5F5", "Panel.background": "#F5F5F5", "Panel.foreground" : "#5c616c", "Window.border" : "1,1,1,1,#5c616c", @@ -53,7 +55,6 @@ "Group.separatorColor" : "#9ba2ab", "Tree.background" : "#ffffff", - "Tree.rowHeight": "23", "ProgressBar.background" : "#f57900", "ProgressBar.foreground" : "#f57900", diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json index 81539b35..ab963ed0 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json @@ -36,6 +36,8 @@ } }, + "ToolBar.background" : "#F5F5F5", + "Popup.Toolbar.background" : "#F5F5F5", "Panel.background": "#F5F5F5", "Panel.foreground" : "#5c616c", "Window.border" : "1,1,1,1,#5c616c", @@ -53,7 +55,6 @@ "Group.separatorColor" : "#9ba2ab", "Tree.background" : "#ffffff", - "Tree.rowHeight": "23", "ProgressBar.background" : "#2679db", "ProgressBar.foreground" : "#2679db", From 5ed40cab1d7fb6dc02269d680a6849faa871e1e5 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 29 Mar 2020 18:02:35 +0200 Subject: [PATCH 020/500] Demo: support using own FlatLaf themes (`.properties` files) that are located in working directory of Demo application --- CHANGELOG.md | 3 + .../java/com/formdev/flatlaf/FlatLaf.java | 11 +- .../com/formdev/flatlaf/IntelliJTheme.java | 2 +- .../com/formdev/flatlaf/UIDefaultsLoader.java | 10 +- flatlaf-demo/DemoLaf.properties | 13 ++ .../com/formdev/flatlaf/demo/DemoPrefs.java | 32 +++-- .../demo/intellijthemes/IJThemesManager.java | 9 +- .../demo/intellijthemes/IJThemesPanel.java | 111 +++++++++++++++--- 8 files changed, 159 insertions(+), 32 deletions(-) create mode 100644 flatlaf-demo/DemoLaf.properties diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e9fd22f..b00180af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ FlatLaf Change Log on JetBrains Runtime. (issue #69) - Tree: Fixed repainting wide selection on focus gained/lost. - No longer use system property `sun.java2d.uiScale`. (Java 8 only) +- Demo: Support using own FlatLaf themes (`.properties` files) that are located + in working directory of Demo application. Shown in the "Themes" list under + category "Current Directory". ## 0.28 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 1f11462b..632d2db1 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -34,6 +34,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.ServiceLoader; import java.util.function.Consumer; import java.util.logging.Level; @@ -278,9 +279,9 @@ public abstract class FlatLaf // load defaults from properties List> lafClassesForDefaultsLoading = getLafClassesForDefaultsLoading(); if( lafClassesForDefaultsLoading != null ) - UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, addons, defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, addons, getAdditionalDefaults(), defaults ); else - UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, getAdditionalDefaults(), defaults ); // use Aqua MenuBarUI if Mac screen menubar is enabled if( SystemInfo.IS_MAC && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) @@ -307,7 +308,11 @@ public abstract class FlatLaf void applyAdditionalDefaults( UIDefaults defaults ) { } - List> getLafClassesForDefaultsLoading() { + protected List> getLafClassesForDefaultsLoading() { + return null; + } + + protected Properties getAdditionalDefaults() { return null; } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java index c0304f4b..15779ab5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -518,7 +518,7 @@ public class IntelliJTheme } @Override - ArrayList> getLafClassesForDefaultsLoading() { + protected ArrayList> getLafClassesForDefaultsLoading() { ArrayList> lafClasses = new ArrayList<>(); lafClasses.add( FlatLaf.class ); lafClasses.add( theme.dark ? FlatDarkLaf.class : FlatLightLaf.class ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java index cc508fe2..26a5a6b7 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java @@ -69,7 +69,7 @@ class UIDefaultsLoader private static final String GLOBAL_PREFIX = "*."; static void loadDefaultsFromProperties( Class lookAndFeelClass, List addons, - UIDefaults defaults ) + Properties additionalDefaults, UIDefaults defaults ) { // determine classes in class hierarchy in reverse order ArrayList> lafClasses = new ArrayList<>(); @@ -80,11 +80,11 @@ class UIDefaultsLoader lafClasses.add( 0, lafClass ); } - loadDefaultsFromProperties( lafClasses, addons, defaults ); + loadDefaultsFromProperties( lafClasses, addons, additionalDefaults, defaults ); } static void loadDefaultsFromProperties( List> lafClasses, List addons, - UIDefaults defaults ) + Properties additionalDefaults, UIDefaults defaults ) { try { // load core properties files @@ -115,6 +115,10 @@ class UIDefaultsLoader addonClassLoaders.add( addonClassLoader ); } + // add additional defaults + if( additionalDefaults != null ) + properties.putAll( additionalDefaults ); + // collect all platform specific keys (but do not modify properties) ArrayList platformSpecificKeys = new ArrayList<>(); for( Object key : properties.keySet() ) { diff --git a/flatlaf-demo/DemoLaf.properties b/flatlaf-demo/DemoLaf.properties new file mode 100644 index 00000000..6a76fcd6 --- /dev/null +++ b/flatlaf-demo/DemoLaf.properties @@ -0,0 +1,13 @@ +# This file demonstrates using a FlatLaf theme file in the FlatLaf Demo application. +# Must be in the working directory of the Demo application. +# Shown in the "Themes" list under category "Current Directory". +# +# Modifications to this file are automatically loaded by the FlatLaf Demo application +# when the Demo window is activated. + + +# base theme (light, dark, intellij or darcula) +@baseTheme=light + +# add you theme defaults here +@background=#ccc diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java index 5a0317fb..ffbfab7e 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java @@ -16,6 +16,7 @@ package com.formdev.flatlaf.demo; +import java.io.File; import java.io.FileInputStream; import java.util.prefs.Preferences; import javax.swing.UIManager; @@ -23,6 +24,8 @@ import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLightLaf; import com.formdev.flatlaf.IntelliJTheme; import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel; +import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel.PropertiesLaf; +import com.formdev.flatlaf.util.StringUtils; /** * @author Karl Tauber @@ -30,12 +33,12 @@ import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel; public class DemoPrefs { public static final String KEY_LAF = "laf"; - public static final String KEY_LAF_INTELLIJ_THEME = "lafIntelliJTheme"; + public static final String KEY_LAF_THEME = "lafTheme"; public static final String RESOURCE_PREFIX = "res:"; public static final String FILE_PREFIX = "file:"; - public static final String INTELLIJ_THEME_UI_KEY = "__FlatLaf.demo.intelliJTheme"; + public static final String THEME_UI_KEY = "__FlatLaf.demo.theme"; private static Preferences state; @@ -55,16 +58,27 @@ public class DemoPrefs else { String lafClassName = state.get( KEY_LAF, FlatLightLaf.class.getName() ); if( IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) ) { - String intelliJTheme = state.get( KEY_LAF_INTELLIJ_THEME, "" ); - if( intelliJTheme.startsWith( RESOURCE_PREFIX ) ) - IntelliJTheme.install( IJThemesPanel.class.getResourceAsStream( intelliJTheme.substring( RESOURCE_PREFIX.length() ) ) ); - else if( intelliJTheme.startsWith( FILE_PREFIX ) ) - FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( intelliJTheme.substring( FILE_PREFIX.length() ) ) ) ); + String theme = state.get( KEY_LAF_THEME, "" ); + if( theme.startsWith( RESOURCE_PREFIX ) ) + IntelliJTheme.install( IJThemesPanel.class.getResourceAsStream( theme.substring( RESOURCE_PREFIX.length() ) ) ); + else if( theme.startsWith( FILE_PREFIX ) ) + FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( theme.substring( FILE_PREFIX.length() ) ) ) ); else FlatLightLaf.install(); - if( !intelliJTheme.isEmpty() ) - UIManager.getLookAndFeelDefaults().put( INTELLIJ_THEME_UI_KEY, intelliJTheme ); + if( !theme.isEmpty() ) + UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme ); + } else if( IJThemesPanel.PropertiesLaf.class.getName().equals( lafClassName ) ) { + String theme = state.get( KEY_LAF_THEME, "" ); + if( theme.startsWith( FILE_PREFIX ) ) { + File themeFile = new File( theme.substring( FILE_PREFIX.length() ) ); + String themeName = StringUtils.removeTrailing( themeFile.getName(), ".properties" ); + FlatLaf.install( new PropertiesLaf( themeName, themeFile ) ); + } else + FlatLightLaf.install(); + + if( !theme.isEmpty() ) + UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme ); } else UIManager.setLookAndFeel( lafClassName ); } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java index 6e7969a2..22e568cd 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java @@ -68,7 +68,9 @@ class IJThemesManager // get current working directory File directory = new File( "" ).getAbsoluteFile(); - File[] themeFiles = directory.listFiles( (dir, name) -> name.endsWith( ".theme.json" ) ); + File[] themeFiles = directory.listFiles( (dir, name) -> { + return name.endsWith( ".theme.json" ) || name.endsWith( ".properties" ); + } ); if( themeFiles == null ) return; @@ -77,7 +79,10 @@ class IJThemesManager moreThemes.clear(); for( File f : themeFiles ) { - String name = StringUtils.removeTrailing( f.getName(), ".theme.json" ); + String fname = f.getName(); + String name = fname.endsWith( ".properties" ) + ? StringUtils.removeTrailing( fname, ".properties" ) + : StringUtils.removeTrailing( fname, ".theme.json" ); moreThemes.add( new IJThemeInfo( name, null, null, null, null, null, f, null ) ); lastModifiedMap.put( f, f.lastModified() ); } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java index d5b5269d..43b26e42 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java @@ -28,6 +28,7 @@ import java.beans.PropertyChangeListener; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Files; @@ -37,6 +38,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Objects; +import java.util.Properties; import java.util.function.Predicate; import javax.swing.*; import javax.swing.border.CompoundBorder; @@ -71,6 +73,7 @@ public class IJThemesPanel private Window window; private File lastDirectory; + private boolean isAdjustingThemesList; public IJThemesPanel() { initComponents(); @@ -134,6 +137,10 @@ public class IJThemesPanel themes.add( new IJThemeInfo( "Flat IntelliJ", null, null, null, null, null, null, FlatIntelliJLaf.class.getName() ) ); themes.add( new IJThemeInfo( "Flat Darcula", null, null, null, null, null, null, FlatDarculaLaf.class.getName() ) ); + // add themes from directory + categories.put( themes.size(), "Current Directory" ); + themes.addAll( themesManager.moreThemes ); + // add uncategorized bundled themes categories.put( themes.size(), "IntelliJ Themes" ); for( IJThemeInfo ti : themesManager.bundledThemes ) { @@ -157,10 +164,6 @@ public class IJThemesPanel themes.add( ti ); } - // add themes from directory - categories.put( themes.size(), "Current Directory" ); - themes.addAll( themesManager.moreThemes ); - // remember selection IJThemeInfo oldSel = themesList.getSelectedValue(); @@ -193,7 +196,7 @@ public class IJThemesPanel } private void themesListValueChanged( ListSelectionEvent e ) { - if( e.getValueIsAdjusting() ) + if( e.getValueIsAdjusting() || isAdjustingThemesList ) return; IJThemeInfo themeInfo = themesList.getSelectedValue(); @@ -223,15 +226,19 @@ public class IJThemesPanel } } else if( themeInfo.themeFile != null ) { try { - FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) ); - DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile ); + if( themeInfo.themeFile.getName().endsWith( ".properties" ) ) { + FlatLaf.install( new PropertiesLaf( themeInfo.name, themeInfo.themeFile ) ); + } else + FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) ); + + DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile ); } catch( Exception ex ) { ex.printStackTrace(); showInformationDialog( "Failed to load '" + themeInfo.themeFile + "'.", ex ); } } else { IntelliJTheme.install( getClass().getResourceAsStream( themeInfo.resourceName ) ); - DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName ); + DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName ); } // update all components @@ -331,17 +338,17 @@ public class IJThemesPanel private void selectedCurrentLookAndFeel() { LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); - String intelliJTheme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.INTELLIJ_THEME_UI_KEY ); + String theme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.THEME_UI_KEY ); - if( intelliJTheme == null && lookAndFeel instanceof IntelliJTheme.ThemeLaf ) + if( theme == null && (lookAndFeel instanceof IntelliJTheme.ThemeLaf || lookAndFeel instanceof PropertiesLaf) ) return; Predicate test; - if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) { - String resourceName = intelliJTheme.substring( DemoPrefs.RESOURCE_PREFIX.length() ); + if( theme != null && theme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) { + String resourceName = theme.substring( DemoPrefs.RESOURCE_PREFIX.length() ); test = ti -> Objects.equals( ti.resourceName, resourceName ); - } else if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.FILE_PREFIX ) ) { - File themeFile = new File( intelliJTheme.substring( DemoPrefs.FILE_PREFIX.length() ) ); + } else if( theme != null && theme.startsWith( DemoPrefs.FILE_PREFIX ) ) { + File themeFile = new File( theme.substring( DemoPrefs.FILE_PREFIX.length() ) ); test = ti -> Objects.equals( ti.themeFile, themeFile ); } else { String lafClassName = lookAndFeel.getClass().getName(); @@ -356,11 +363,13 @@ public class IJThemesPanel } } + isAdjustingThemesList = true; if( newSel >= 0 ) { if( newSel != themesList.getSelectedIndex() ) themesList.setSelectedIndex( newSel ); } else themesList.clearSelection(); + isAdjustingThemesList = false; } private void initComponents() { @@ -420,4 +429,78 @@ public class IJThemesPanel private JScrollPane themesScrollPane; private JList themesList; // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class PropertiesLaf ------------------------------------------------ + + public static class PropertiesLaf + extends FlatLaf + { + private final String name; + private final String baseTheme; + private final boolean dark; + private final Properties properties; + + public PropertiesLaf( String name, File propertiesFile ) + throws IOException + { + this.name = name; + + properties = new Properties(); + try( InputStream in = new FileInputStream( propertiesFile ) ) { + if( in != null ) + properties.load( in ); + } + + baseTheme = properties.getProperty( "@baseTheme", "light" ); + dark = "dark".equalsIgnoreCase( baseTheme ) || "darcula".equalsIgnoreCase( baseTheme ); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return name; + } + + @Override + public boolean isDark() { + return dark; + } + + @Override + protected ArrayList> getLafClassesForDefaultsLoading() { + ArrayList> lafClasses = new ArrayList<>(); + lafClasses.add( FlatLaf.class ); + switch( baseTheme.toLowerCase() ) { + default: + case "light": + lafClasses.add( FlatLightLaf.class ); + break; + + case "dark": + lafClasses.add( FlatDarkLaf.class ); + break; + + case "intellij": + lafClasses.add( FlatLightLaf.class ); + lafClasses.add( FlatIntelliJLaf.class ); + break; + + case "darcula": + lafClasses.add( FlatDarkLaf.class ); + lafClasses.add( FlatDarculaLaf.class ); + break; + } + lafClasses.add( PropertiesLaf.class ); + return lafClasses; + } + + @Override + protected Properties getAdditionalDefaults() { + return properties; + } + } } From 60c6c5b37a16f2fde4d99e22c7bbe4949c92bf50 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 29 Mar 2020 23:30:04 +0200 Subject: [PATCH 021/500] FlatLineBorder: support specifying painted line thickness --- .../java/com/formdev/flatlaf/UIDefaultsLoader.java | 7 ++++--- .../com/formdev/flatlaf/ui/FlatLineBorder.java | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java index 26a5a6b7..da3557d5 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java @@ -332,16 +332,17 @@ class UIDefaultsLoader private static Object parseBorder( String value, Function resolver, List addonClassLoaders ) { if( value.indexOf( ',' ) >= 0 ) { - // top,left,bottom,right[,lineColor] + // top,left,bottom,right[,lineColor[,lineThickness]] List parts = split( value, ',' ); Insets insets = parseInsets( value ); - ColorUIResource lineColor = (parts.size() == 5) + ColorUIResource lineColor = (parts.size() >= 5) ? (ColorUIResource) parseColorOrFunction( resolver.apply( parts.get( 4 ) ), resolver, true ) : null; + float lineThickness = (parts.size() >= 6) ? parseFloat( parts.get( 5 ), true ) : 1f; return (LazyValue) t -> { return (lineColor != null) - ? new FlatLineBorder( insets, lineColor ) + ? new FlatLineBorder( insets, lineColor, lineThickness ) : new FlatEmptyBorder( insets ); }; } else diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java index 355bf01d..5af4c531 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java @@ -26,9 +26,9 @@ import java.awt.Insets; /** * Line border for various components. * - * Paints a scaled 1px thick line around the component. - * The line thickness is not included in the border insets. - * The insets should be at least 1,1,1,1. + * Paints a scaled (usually 1px thick) line around the component. + * The line thickness is not added to the border insets. + * The insets should be at least have line thickness (usually 1,1,1,1). * * @author Karl Tauber */ @@ -36,10 +36,16 @@ public class FlatLineBorder extends FlatEmptyBorder { private final Color lineColor; + private final float lineThickness; public FlatLineBorder( Insets insets, Color lineColor ) { + this( insets, lineColor, 1f ); + } + + public FlatLineBorder( Insets insets, Color lineColor, float lineThickness ) { super( insets ); this.lineColor = lineColor; + this.lineThickness = lineThickness; } @Override @@ -48,7 +54,7 @@ public class FlatLineBorder try { FlatUIUtils.setRenderingHints( g2 ); g2.setColor( lineColor ); - FlatUIUtils.paintComponentBorder( g2, x, y, width, height, 0f, scale( 1f ), 0f ); + FlatUIUtils.paintComponentBorder( g2, x, y, width, height, 0f, scale( lineThickness ), 0f ); } finally { g2.dispose(); } From af89dd13c12f5a0ec8c33dedeff4797b8e42a7ad Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 31 Mar 2020 12:15:51 +0200 Subject: [PATCH 022/500] support changing default font used for all components with automatic scaling UI if using larger font --- CHANGELOG.md | 2 + .../java/com/formdev/flatlaf/FlatLaf.java | 52 ++++++++++- .../com/formdev/flatlaf/util/UIScale.java | 79 ++++++++++------ .../com/formdev/flatlaf/demo/ControlBar.java | 5 + .../com/formdev/flatlaf/demo/DemoFrame.java | 93 ++++++++++++++++++- .../com/formdev/flatlaf/demo/DemoFrame.jfd | 27 +++++- .../flatlaf/testing/FlatTestFrame.java | 7 +- .../testing/uidefaults/UIDefaultsDump.java | 11 ++- .../uidefaults/FlatDarkLaf_1.8.0_202-mac.txt | 79 ++++++++-------- .../uidefaults/FlatDarkLaf_1.8.0_202.txt | 79 ++++++++-------- .../uidefaults/FlatLightLaf_1.8.0_202-mac.txt | 79 ++++++++-------- .../uidefaults/FlatLightLaf_1.8.0_202.txt | 79 ++++++++-------- 12 files changed, 400 insertions(+), 192 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b00180af..6c2c165a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ FlatLaf Change Log - Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime. (issue #69) - Tree: Fixed repainting wide selection on focus gained/lost. +- Support changing default font used for all components with automatic scaling + UI if using larger font. Use `UIManager.put( "defaultFont", myFont );` - No longer use system property `sun.java2d.uiScale`. (Java 8 only) - Demo: Support using own FlatLaf themes (`.properties` files) that are located in working directory of Demo application. Shown in the "Themes" list under diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 632d2db1..c8865a15 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -49,8 +49,10 @@ import javax.swing.SwingUtilities; import javax.swing.UIDefaults; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.UIDefaults.ActiveValue; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; +import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicLookAndFeel; import javax.swing.text.html.HTMLEditorKit; import com.formdev.flatlaf.util.SystemInfo; @@ -345,14 +347,22 @@ public abstract class FlatLaf uiFont = UIScale.applyCustomScaleFactor( uiFont ); + // use active value for all fonts to allow changing fonts in all components + // (similar as in Nimbus L&F) with: + // UIManager.put( "defaultFont", myFont ); + Object activeFont = new ActiveFont( 1 ); + // override fonts for( Object key : defaults.keySet() ) { if( key instanceof String && (((String)key).endsWith( ".font" ) || ((String)key).endsWith( "Font" )) ) - defaults.put( key, uiFont ); + defaults.put( key, activeFont ); } // use smaller font for progress bar - defaults.put( "ProgressBar.font", UIScale.scaleFont( uiFont, 0.85f ) ); + defaults.put( "ProgressBar.font", new ActiveFont( 0.85f ) ); + + // set default font + defaults.put( "defaultFont", uiFont ); } /** @@ -562,4 +572,42 @@ public abstract class FlatLaf return false; } + + //---- class ActiveFont --------------------------------------------------- + + private static class ActiveFont + implements ActiveValue + { + private final float scaleFactor; + + // cache (scaled) font + private Font font; + private Font lastDefaultFont; + + ActiveFont( float scaleFactor ) { + this.scaleFactor = scaleFactor; + } + + @Override + public Object createValue( UIDefaults table ) { + Font defaultFont = UIManager.getFont( "defaultFont" ); + + if( lastDefaultFont != defaultFont ) { + lastDefaultFont = defaultFont; + + if( scaleFactor != 1 ) { + // scale font + int newFontSize = Math.round( defaultFont.getSize() * scaleFactor ); + font = new FontUIResource( defaultFont.deriveFont( (float) newFontSize ) ); + } else { + // make sure that font is a UIResource for LaF switching + font = (defaultFont instanceof UIResource) + ? defaultFont + : new FontUIResource( defaultFont ); + } + } + + return font; + } + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index 8f89cad4..8ae5250d 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -24,6 +24,7 @@ import java.awt.GraphicsEnvironment; import java.awt.Insets; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.lang.reflect.Method; import javax.swing.LookAndFeel; import javax.swing.UIManager; @@ -48,12 +49,15 @@ import javax.swing.plaf.UIResource; * * 2) user scaling mode * - * This mode is mainly for Java 8 compatibility, but is also used on Linux. + * This mode is mainly for Java 8 compatibility, but is also used on Linux + * or if the default font is changed. * The user scale factor is computed based on the used font. * The JRE does not scale anything. * So we have to invoke {@link #scale(float)} where necessary. * There is only one user scale factor for all displays. - * The user scale factor may change if the active LaF or "Label.font" has changed. + * The user scale factor may change if the active LaF, "defaultFont" or "Label.font" has changed. + * If system scaling mode is available the user scale factor is usually 1, + * but may be larger on Linux or if the default font is changed. * * @author Karl Tauber */ @@ -61,6 +65,20 @@ public class UIScale { private static final boolean DEBUG = false; + private static PropertyChangeSupport changeSupport; + + public static void addPropertyChangeListener( PropertyChangeListener listener ) { + if( changeSupport == null ) + changeSupport = new PropertyChangeSupport( UIScale.class ); + changeSupport.addPropertyChangeListener( listener ); + } + + public static void removePropertyChangeListener( PropertyChangeListener listener ) { + if( changeSupport == null ) + return; + changeSupport.removePropertyChangeListener( listener ); + } + //---- system scaling (Java 9) -------------------------------------------- private static Boolean jreHiDPI; @@ -110,27 +128,33 @@ public class UIScale return; initialized = true; - if( isUserScalingEnabled() ) { - // listener to update scale factor if LaF changed or if Label.font changed - // (e.g. option "Override default fonts" in IntelliJ IDEA) - PropertyChangeListener listener = new PropertyChangeListener() { - @Override - public void propertyChange( PropertyChangeEvent e ) { - String propName = e.getPropertyName(); - if( "lookAndFeel".equals( propName ) ) { + if( !isUserScalingEnabled() ) + return; + + // listener to update scale factor if LaF changed, "defaultFont" or "Label.font" changed + PropertyChangeListener listener = new PropertyChangeListener() { + @Override + public void propertyChange( PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case "lookAndFeel": // it is not necessary (and possible) to remove listener of old LaF defaults if( e.getNewValue() instanceof LookAndFeel ) UIManager.getLookAndFeelDefaults().addPropertyChangeListener( this ); updateScaleFactor(); - } else if( "Label.font".equals( propName ) ) - updateScaleFactor(); - } - }; - UIManager.addPropertyChangeListener( listener ); - UIManager.getLookAndFeelDefaults().addPropertyChangeListener( listener ); + break; - updateScaleFactor(); - } + case "defaultFont": + case "Label.font": + updateScaleFactor(); + break; + } + } + }; + UIManager.addPropertyChangeListener( listener ); + UIManager.getDefaults().addPropertyChangeListener( listener ); + UIManager.getLookAndFeelDefaults().addPropertyChangeListener( listener ); + + updateScaleFactor(); } private static void updateScaleFactor() { @@ -141,7 +165,9 @@ public class UIScale // because even if we are on a HiDPI display it is not sure // that a larger font size is set by the current LaF // (e.g. can avoid large icons with small text) - Font font = UIManager.getFont( "Label.font" ); + Font font = UIManager.getFont( "defaultFont" ); + if( font == null ) + font = UIManager.getFont( "Label.font" ); setUserScaleFactor( computeScaleFactor( font ) ); } @@ -168,9 +194,6 @@ public class UIScale } private static boolean isUserScalingEnabled() { - if( isSystemScalingEnabled() && !SystemInfo.IS_LINUX ) - return false; // disable user scaling if JRE scales - // same as in IntelliJ IDEA String hidpi = System.getProperty( "hidpi" ); return (hidpi != null) ? Boolean.parseBoolean( hidpi ) : true; @@ -197,14 +220,6 @@ public class UIScale return new FontUIResource( font.deriveFont( (float) newFontSize ) ); } - /** - * Scales the given font. - */ - public static FontUIResource scaleFont( FontUIResource font, float scaleFactor ) { - int newFontSize = Math.round( font.getSize() * scaleFactor ); - return new FontUIResource( font.deriveFont( (float) newFontSize ) ); - } - /** * Similar to sun.java2d.SunGraphicsEnvironment.getScaleFactor(String) */ @@ -242,10 +257,14 @@ public class UIScale else // round scale factor to 1/4 scaleFactor = Math.round( scaleFactor * 4f ) / 4f; + float oldScaleFactor = UIScale.scaleFactor; UIScale.scaleFactor = scaleFactor; if( DEBUG ) System.out.println( "HiDPI scale factor " + scaleFactor ); + + if( changeSupport != null ) + changeSupport.firePropertyChange( "userScaleFactor", oldScaleFactor, scaleFactor ); } public static float scale( float value ) { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java index f899266e..a698bccc 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java @@ -83,6 +83,11 @@ class ControlBar } ); } } ); + + UIScale.addPropertyChangeListener( e -> { + // update info label because user scale factor may change + updateInfoLabel(); + } ); } void initialize( JFrame frame, JTabbedPane tabbedPane ) { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java index 3b365b21..e204a15f 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java @@ -20,6 +20,7 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.DefaultEditorKit; +import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.demo.intellijthemes.*; import com.formdev.flatlaf.extras.FlatSVGIcon; import net.miginfocom.swing.*; @@ -52,12 +53,53 @@ class DemoFrame DemoPrefs.getState().putInt( FlatLafDemo.KEY_TAB, tabbedPane.getSelectedIndex() ); } - private void menuItemActionPerformed(ActionEvent e) { + private void menuItemActionPerformed( ActionEvent e ) { SwingUtilities.invokeLater( () -> { JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE ); } ); } + private void fontFamilyChanged( ActionEvent e ) { + String fontFamily = e.getActionCommand(); + + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = new Font( fontFamily, font.getStyle(), font.getSize() ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + } + + private void fontSizeChanged( ActionEvent e ) { + String fontSizeStr = e.getActionCommand(); + + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) Integer.parseInt( fontSizeStr ) ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + } + + private void restoreFont() { + UIManager.put( "defaultFont", null ); + FlatLaf.updateUI(); + } + + private void incrFont() { + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) (font.getSize() + 1) ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + } + + private void decrFont() { + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) Math.max( font.getSize() - 1, 8 ) ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JMenuBar menuBar1 = new JMenuBar(); @@ -86,6 +128,10 @@ class DemoFrame JRadioButtonMenuItem radioButtonMenuItem1 = new JRadioButtonMenuItem(); JRadioButtonMenuItem radioButtonMenuItem2 = new JRadioButtonMenuItem(); JRadioButtonMenuItem radioButtonMenuItem3 = new JRadioButtonMenuItem(); + fontMenu = new JMenu(); + JMenuItem restoreFontMenuItem = new JMenuItem(); + JMenuItem incrFontMenuItem = new JMenuItem(); + JMenuItem decrFontMenuItem = new JMenuItem(); JMenu helpMenu = new JMenu(); JMenuItem aboutMenuItem = new JMenuItem(); JToolBar toolBar1 = new JToolBar(); @@ -285,6 +331,30 @@ class DemoFrame } menuBar1.add(viewMenu); + //======== fontMenu ======== + { + fontMenu.setText("Font"); + + //---- restoreFontMenuItem ---- + restoreFontMenuItem.setText("Restore Font"); + restoreFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0, KeyEvent.CTRL_MASK)); + restoreFontMenuItem.addActionListener(e -> restoreFont()); + fontMenu.add(restoreFontMenuItem); + + //---- incrFontMenuItem ---- + incrFontMenuItem.setText("Increase Font Size"); + incrFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK)); + incrFontMenuItem.addActionListener(e -> incrFont()); + fontMenu.add(incrFontMenuItem); + + //---- decrFontMenuItem ---- + decrFontMenuItem.setText("Decrease Font Size"); + decrFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK)); + decrFontMenuItem.addActionListener(e -> decrFont()); + fontMenu.add(decrFontMenuItem); + } + menuBar1.add(fontMenu); + //======== helpMenu ======== { helpMenu.setText("Help"); @@ -387,9 +457,30 @@ class DemoFrame cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() ); copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() ); pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() ); + + // add font families + fontMenu.addSeparator(); + String[] fontFamilies = { "Arial", "Comic Sans MS", "Courier New", "Dialog", + "Monospaced", "SansSerif", "Serif", "Tahoma", "Verdana" }; + for( String fontFamily : fontFamilies ) { + JMenuItem fontItem = new JMenuItem( fontFamily ); + fontItem.addActionListener( this::fontFamilyChanged ); + fontMenu.add( fontItem ); + } + + // add font sizes + fontMenu.addSeparator(); + int[] fontSizes = { 8, 10, 12, 14, 16, 18, 20, 24, 28 }; + for( int fontSize : fontSizes ) { + String fontSizeStr = Integer.toString( fontSize ); + JMenuItem fontItem = new JMenuItem( fontSizeStr ); + fontItem.addActionListener( this::fontSizeChanged ); + fontMenu.add( fontItem ); + } } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JMenu fontMenu; private JTabbedPane tabbedPane; private ControlBar controlBar; // JFormDesigner - End of variables declaration //GEN-END:variables diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd index 179c618a..12717383 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -285,6 +285,31 @@ new FormModel { addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) } ) } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "fontMenu" + "text": "Font" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "restoreFontMenuItem" + "text": "Restore Font" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 48, 130, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "restoreFont", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "incrFontMenuItem" + "text": "Increase Font Size" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 521, 130, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "incrFont", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "decrFontMenuItem" + "text": "Decrease Font Size" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 45, 130, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decrFont", false ) ) + } ) + } ) add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { name: "helpMenu" "text": "Help" diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java index af6722bf..ab9f1051 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java @@ -208,6 +208,11 @@ public class FlatTestFrame } ); } } ); + + UIScale.addPropertyChangeListener( e -> { + // update title because user scale factor may change + updateTitle(); + } ); } private void updateTitle() { @@ -403,7 +408,7 @@ public class FlatTestFrame } private void updateScaleFactorComboBox() { - scaleFactorComboBox.setEnabled( !UIScale.isSystemScalingEnabled() && UIManager.getLookAndFeel() instanceof FlatLaf ); + scaleFactorComboBox.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf ); } private void sizeVariantChanged() { diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java index 30c96d2a..a21faf64 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java @@ -368,7 +368,16 @@ public class UIDefaultsDump private void dumpActiveValue( PrintWriter out, ActiveValue value ) { out.print( "[active] " ); - dumpValue( out, value.createValue( defaults ) ); + Object realValue = value.createValue( defaults ); + + if( realValue instanceof Font && realValue == UIManager.getFont( "defaultFont" ) ) { + // dump "$defaultFont" for the default font to make it easier to + // compare Windows/Linux dumps with macOS dumps + out.print( "$defaultFont" ); + if( realValue instanceof UIResource ) + out.print( " [UI]" ); + } else + dumpValue( out, realValue ); } private String dumpClass( Object value ) { diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt index 76bfc81c..3264077f 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt @@ -80,7 +80,7 @@ Button.defaultButtonFollowsFocus false Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] Button.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Button.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Button.highlight #242424 javax.swing.plaf.ColorUIResource [UI] Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] @@ -112,7 +112,7 @@ CheckBox.arc 4 CheckBox.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] CheckBox.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #43494a javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] @@ -137,7 +137,7 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] CheckBoxMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -146,7 +146,7 @@ CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] CheckBoxMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false @@ -163,7 +163,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #3c3f41 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -185,7 +185,7 @@ ComboBox.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #646464 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ComboBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false ComboBox.noActionOnKeyNavigation false @@ -246,7 +246,7 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -285,7 +285,7 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -352,7 +352,7 @@ InternalFrame.inactiveTitleBackground #303234 javax.swing.plaf.ColorUIResourc InternalFrame.inactiveTitleForeground #777777 javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -429,7 +429,7 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane Label.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] Label.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #646464 javax.swing.plaf.ColorUIResource [UI] -Label.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -447,7 +447,7 @@ List.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResourc List.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +List.font [active] $defaultFont [UI] List.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] @@ -460,7 +460,7 @@ ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] Menu.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] @@ -470,7 +470,7 @@ Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true Menu.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Menu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #606060 javax.swing.plaf.ColorUIResource [UI] @@ -492,7 +492,7 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #515151 javax.swing.plaf.ColorUIResource [UI] -MenuBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] MenuBar.hoverBackground #484c4f javax.swing.plaf.ColorUIResource [UI] @@ -507,7 +507,7 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- MenuItem.acceleratorDelimiter -MenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] MenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -515,7 +515,7 @@ MenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true MenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -MenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] MenuItem.opaque false @@ -569,7 +569,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -591,7 +591,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Panel.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -606,7 +606,7 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -624,7 +624,7 @@ PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.F PopupMenu.borderColor #5e5e5e javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -649,7 +649,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -665,7 +665,7 @@ RadioButton.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] RadioButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 @@ -681,7 +681,7 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] RadioButtonMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -690,7 +690,7 @@ RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] RadioButtonMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false @@ -751,7 +751,7 @@ ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI ScrollPane.background #3f4244 javax.swing.plaf.ColorUIResource [UI] ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -775,7 +775,7 @@ Slider.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #4c5052 javax.swing.plaf.ColorUIResource [UI] Slider.focus #7e7e7e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Slider.highlight #242424 javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension @@ -806,7 +806,7 @@ Spinner.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] Spinner.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -848,7 +848,7 @@ TabbedPane.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #3d4b5c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] @@ -887,7 +887,7 @@ Table.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Table.font [active] $defaultFont [UI] Table.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Table.gridColor #4c5152 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -908,7 +908,7 @@ TableHeader.background #45494a javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] -TableHeader.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] @@ -946,7 +946,7 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -970,7 +970,7 @@ TextField.caretBlinkRate 500 TextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.highlight #242424 javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] @@ -991,7 +991,7 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -1004,7 +1004,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI #---- TitledBorder ---- TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -1020,7 +1020,7 @@ ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F ToggleButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #525658 javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 @@ -1054,7 +1054,7 @@ ToolBar.dockingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ToolBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #adadad javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] @@ -1081,7 +1081,7 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI ToolTip.background #1e2123 javax.swing.plaf.ColorUIResource [UI] ToolTip.backgroundInactive #1e2123 javax.swing.plaf.ColorUIResource [UI] ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -ToolTip.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolTip.foregroundInactive #777777 javax.swing.plaf.ColorUIResource [UI] @@ -1109,7 +1109,7 @@ Tree.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResourc Tree.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.hash #505355 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #adadad javax.swing.plaf.ColorUIResource [UI] @@ -1143,7 +1143,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Viewport.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1159,6 +1159,7 @@ controlHighlight #313131 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #242424 javax.swing.plaf.ColorUIResource [UI] controlShadow #646464 javax.swing.plaf.ColorUIResource [UI] controlText #bbbbbb javax.swing.plaf.ColorUIResource [UI] +defaultFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] desktop #45494a javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt index 8ee08900..48c4e209 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -80,7 +80,7 @@ Button.defaultButtonFollowsFocus true Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] Button.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Button.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Button.highlight #242424 javax.swing.plaf.ColorUIResource [UI] Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] @@ -112,7 +112,7 @@ CheckBox.arc 4 CheckBox.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] CheckBox.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #43494a javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] @@ -137,7 +137,7 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] CheckBoxMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -146,7 +146,7 @@ CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] CheckBoxMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false @@ -163,7 +163,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #3c3f41 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -185,7 +185,7 @@ ComboBox.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #646464 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ComboBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false ComboBox.noActionOnKeyNavigation false @@ -245,7 +245,7 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -284,7 +284,7 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -351,7 +351,7 @@ InternalFrame.inactiveTitleBackground #303234 javax.swing.plaf.ColorUIResourc InternalFrame.inactiveTitleForeground #777777 javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -428,7 +428,7 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane Label.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] Label.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #646464 javax.swing.plaf.ColorUIResource [UI] -Label.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -446,7 +446,7 @@ List.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResourc List.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +List.font [active] $defaultFont [UI] List.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] @@ -459,7 +459,7 @@ ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] Menu.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] @@ -469,7 +469,7 @@ Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true Menu.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Menu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #606060 javax.swing.plaf.ColorUIResource [UI] @@ -491,7 +491,7 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #515151 javax.swing.plaf.ColorUIResource [UI] -MenuBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] MenuBar.hoverBackground #484c4f javax.swing.plaf.ColorUIResource [UI] @@ -506,7 +506,7 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- MenuItem.acceleratorDelimiter - -MenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] MenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -514,7 +514,7 @@ MenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true MenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -MenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] MenuItem.opaque false @@ -568,7 +568,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -589,7 +589,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Panel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -604,7 +604,7 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -622,7 +622,7 @@ PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.F PopupMenu.borderColor #5e5e5e javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -647,7 +647,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -663,7 +663,7 @@ RadioButton.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] RadioButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 @@ -679,7 +679,7 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] RadioButtonMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -688,7 +688,7 @@ RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] RadioButtonMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false @@ -749,7 +749,7 @@ ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI ScrollPane.background #3f4244 javax.swing.plaf.ColorUIResource [UI] ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -773,7 +773,7 @@ Slider.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #4c5052 javax.swing.plaf.ColorUIResource [UI] Slider.focus #7e7e7e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Slider.highlight #242424 javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension @@ -804,7 +804,7 @@ Spinner.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] Spinner.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -846,7 +846,7 @@ TabbedPane.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #3d4b5c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] @@ -885,7 +885,7 @@ Table.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Table.font [active] $defaultFont [UI] Table.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Table.gridColor #4c5152 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -906,7 +906,7 @@ TableHeader.background #45494a javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] -TableHeader.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] @@ -944,7 +944,7 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -968,7 +968,7 @@ TextField.caretBlinkRate 500 TextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.highlight #242424 javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] @@ -989,7 +989,7 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -1002,7 +1002,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI #---- TitledBorder ---- TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -1018,7 +1018,7 @@ ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F ToggleButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #525658 javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 @@ -1052,7 +1052,7 @@ ToolBar.dockingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ToolBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #adadad javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] @@ -1079,7 +1079,7 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI ToolTip.background #1e2123 javax.swing.plaf.ColorUIResource [UI] ToolTip.backgroundInactive #1e2123 javax.swing.plaf.ColorUIResource [UI] ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -ToolTip.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolTip.foregroundInactive #777777 javax.swing.plaf.ColorUIResource [UI] @@ -1107,7 +1107,7 @@ Tree.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResourc Tree.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.hash #505355 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #adadad javax.swing.plaf.ColorUIResource [UI] @@ -1141,7 +1141,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Viewport.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1157,6 +1157,7 @@ controlHighlight #313131 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #242424 javax.swing.plaf.ColorUIResource [UI] controlShadow #646464 javax.swing.plaf.ColorUIResource [UI] controlText #bbbbbb javax.swing.plaf.ColorUIResource [UI] +defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] desktop #45494a javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt index cf2c102b..06f41702 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt @@ -81,7 +81,7 @@ Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Button.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] @@ -113,7 +113,7 @@ CheckBox.arc 4 CheckBox.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] CheckBox.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] @@ -138,7 +138,7 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] CheckBoxMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -147,7 +147,7 @@ CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] CheckBoxMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false @@ -164,7 +164,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -186,7 +186,7 @@ ComboBox.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ComboBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false ComboBox.noActionOnKeyNavigation false @@ -247,7 +247,7 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -286,7 +286,7 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -354,7 +354,7 @@ InternalFrame.inactiveTitleBackground #fafafa javax.swing.plaf.ColorUIResourc InternalFrame.inactiveTitleForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -431,7 +431,7 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane Label.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Label.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Label.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #000000 javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -449,7 +449,7 @@ List.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResourc List.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +List.font [active] $defaultFont [UI] List.foreground #000000 javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] @@ -462,7 +462,7 @@ ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] Menu.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] @@ -472,7 +472,7 @@ Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true Menu.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Menu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #666666 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] @@ -494,7 +494,7 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #cdcdcd javax.swing.plaf.ColorUIResource [UI] -MenuBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.hoverBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI] @@ -509,7 +509,7 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- MenuItem.acceleratorDelimiter -MenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] MenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -517,7 +517,7 @@ MenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true MenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -MenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] MenuItem.opaque false @@ -571,7 +571,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -593,7 +593,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Panel.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -608,7 +608,7 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -626,7 +626,7 @@ PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.F PopupMenu.borderColor #adadad javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] @@ -651,7 +651,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #1e82e6 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -667,7 +667,7 @@ RadioButton.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] RadioButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 @@ -683,7 +683,7 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] RadioButtonMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -692,7 +692,7 @@ RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] RadioButtonMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false @@ -753,7 +753,7 @@ ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI ScrollPane.background #f5f5f5 javax.swing.plaf.ColorUIResource [UI] ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -777,7 +777,7 @@ Slider.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] Slider.focus #9e9e9e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension @@ -808,7 +808,7 @@ Spinner.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Spinner.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -850,7 +850,7 @@ TabbedPane.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #dae4ed javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -889,7 +889,7 @@ Table.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #000000 javax.swing.plaf.ColorUIResource [UI] Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Table.font [active] $defaultFont [UI] Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Table.gridColor #f7f7f7 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -910,7 +910,7 @@ TableHeader.background #ffffff javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -TableHeader.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] @@ -948,7 +948,7 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextArea.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -972,7 +972,7 @@ TextField.caretBlinkRate 500 TextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] @@ -993,7 +993,7 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -1006,7 +1006,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI #---- TitledBorder ---- TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #000000 javax.swing.plaf.ColorUIResource [UI] @@ -1022,7 +1022,7 @@ ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F ToggleButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 @@ -1056,7 +1056,7 @@ ToolBar.dockingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToolBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #afafaf javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -1083,7 +1083,7 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI ToolTip.background #fafafa javax.swing.plaf.ColorUIResource [UI] ToolTip.backgroundInactive #fafafa javax.swing.plaf.ColorUIResource [UI] ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -ToolTip.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToolTip.foregroundInactive #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -1111,7 +1111,7 @@ Tree.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResourc Tree.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Tree.hash #e6e6e6 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #afafaf javax.swing.plaf.ColorUIResource [UI] @@ -1145,7 +1145,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Viewport.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1161,6 +1161,7 @@ controlHighlight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] controlShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] controlText #000000 javax.swing.plaf.ColorUIResource [UI] +defaultFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] desktop #ffffff javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt index d4ec7bc1..163d5c60 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -81,7 +81,7 @@ Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Button.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] @@ -113,7 +113,7 @@ CheckBox.arc 4 CheckBox.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] CheckBox.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] @@ -138,7 +138,7 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] CheckBoxMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -147,7 +147,7 @@ CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] CheckBoxMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false @@ -164,7 +164,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -186,7 +186,7 @@ ComboBox.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ComboBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false ComboBox.noActionOnKeyNavigation false @@ -246,7 +246,7 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -285,7 +285,7 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -353,7 +353,7 @@ InternalFrame.inactiveTitleBackground #fafafa javax.swing.plaf.ColorUIResourc InternalFrame.inactiveTitleForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -430,7 +430,7 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane Label.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Label.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Label.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #000000 javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -448,7 +448,7 @@ List.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResourc List.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +List.font [active] $defaultFont [UI] List.foreground #000000 javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] @@ -461,7 +461,7 @@ ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] Menu.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] @@ -471,7 +471,7 @@ Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true Menu.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Menu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #666666 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] @@ -493,7 +493,7 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #cdcdcd javax.swing.plaf.ColorUIResource [UI] -MenuBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.hoverBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI] @@ -508,7 +508,7 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- MenuItem.acceleratorDelimiter - -MenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] MenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -516,7 +516,7 @@ MenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true MenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -MenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] MenuItem.opaque false @@ -570,7 +570,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -591,7 +591,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Panel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -606,7 +606,7 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -624,7 +624,7 @@ PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.F PopupMenu.borderColor #adadad javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] @@ -649,7 +649,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #1e82e6 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -665,7 +665,7 @@ RadioButton.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] RadioButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 @@ -681,7 +681,7 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] RadioButtonMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] @@ -690,7 +690,7 @@ RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] RadioButtonMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false @@ -751,7 +751,7 @@ ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI ScrollPane.background #f5f5f5 javax.swing.plaf.ColorUIResource [UI] ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -775,7 +775,7 @@ Slider.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] Slider.focus #9e9e9e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension @@ -806,7 +806,7 @@ Spinner.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Spinner.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -848,7 +848,7 @@ TabbedPane.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #dae4ed javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -887,7 +887,7 @@ Table.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #000000 javax.swing.plaf.ColorUIResource [UI] Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Table.font [active] $defaultFont [UI] Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Table.gridColor #f7f7f7 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -908,7 +908,7 @@ TableHeader.background #ffffff javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -TableHeader.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] @@ -946,7 +946,7 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -970,7 +970,7 @@ TextField.caretBlinkRate 500 TextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] @@ -991,7 +991,7 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -1004,7 +1004,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI #---- TitledBorder ---- TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #000000 javax.swing.plaf.ColorUIResource [UI] @@ -1020,7 +1020,7 @@ ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F ToggleButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 @@ -1054,7 +1054,7 @@ ToolBar.dockingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToolBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #afafaf javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -1081,7 +1081,7 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI ToolTip.background #fafafa javax.swing.plaf.ColorUIResource [UI] ToolTip.backgroundInactive #fafafa javax.swing.plaf.ColorUIResource [UI] ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -ToolTip.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToolTip.foregroundInactive #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -1109,7 +1109,7 @@ Tree.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResourc Tree.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Tree.hash #e6e6e6 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #afafaf javax.swing.plaf.ColorUIResource [UI] @@ -1143,7 +1143,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Viewport.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1159,6 +1159,7 @@ controlHighlight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] controlShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] controlText #000000 javax.swing.plaf.ColorUIResource [UI] +defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] desktop #ffffff javax.swing.plaf.ColorUIResource [UI] From 9429ba7d489d64d4547259ac85fb416dcf12ba67 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 31 Mar 2020 12:17:05 +0200 Subject: [PATCH 023/500] support specifying custom scale factor in system property `flatlaf.uiScale` also for Java 9 and later --- CHANGELOG.md | 2 ++ .../src/main/java/com/formdev/flatlaf/util/UIScale.java | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2c165a..ffa4d9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ FlatLaf Change Log - Support changing default font used for all components with automatic scaling UI if using larger font. Use `UIManager.put( "defaultFont", myFont );` - No longer use system property `sun.java2d.uiScale`. (Java 8 only) +- Support specifying custom scale factor in system property `flatlaf.uiScale` + also for Java 9 and later. - Demo: Support using own FlatLaf themes (`.properties` files) that are located in working directory of Demo application. Shown in the "Themes" list under category "Current Directory". diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index 8ae5250d..2338f25e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -204,9 +204,6 @@ public class UIScale * to the given font. */ public static FontUIResource applyCustomScaleFactor( FontUIResource font ) { - if( UIScale.isSystemScalingEnabled() ) - return font; - String uiScale = System.getProperty( "flatlaf.uiScale" ); float scaleFactor = parseScaleFactor( uiScale ); if( scaleFactor <= 0 ) From 97d5792341b91397d3fb647b8eaefacf7ecdbf0a Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 31 Mar 2020 17:29:12 +0200 Subject: [PATCH 024/500] ComboBox: made class FlatComboPopup protected to allow subclassing (issue #80) --- .../src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index 5d95d0a5..49143807 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -460,12 +460,12 @@ public class FlatComboBoxUI //---- class FlatComboPopup ----------------------------------------------- @SuppressWarnings( { "rawtypes", "unchecked" } ) - private class FlatComboPopup + protected class FlatComboPopup extends BasicComboPopup { private CellPaddingBorder paddingBorder; - FlatComboPopup( JComboBox combo ) { + protected FlatComboPopup( JComboBox combo ) { super( combo ); // BasicComboPopup listens to JComboBox.componentOrientation and updates From d094709dc86094bb55d0f3ee9358cf71be03b4d4 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 31 Mar 2020 18:53:55 +0200 Subject: [PATCH 025/500] ComboBox: no longer ignore `JComboBox.prototypeDisplayValue` when computing popup width (issue #80) --- CHANGELOG.md | 2 ++ .../main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java | 7 +------ .../com/formdev/flatlaf/demo/BasicComponentsPanel.java | 3 +-- .../java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd | 3 +-- .../com/formdev/flatlaf/testing/FlatComponentsTest.java | 3 +-- .../com/formdev/flatlaf/testing/FlatComponentsTest.jfd | 3 +-- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa4d9e9..20df43d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ FlatLaf Change Log - Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime. (issue #69) - Tree: Fixed repainting wide selection on focus gained/lost. +- ComboBox: No longer ignore `JComboBox.prototypeDisplayValue` when computing + popup width. (issue #80) - Support changing default font used for all components with automatic scaling UI if using larger font. Use `UIManager.put( "defaultFont", myFont );` - No longer use system property `sun.java2d.uiScale`. (Java 8 only) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index 49143807..c7730e34 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -480,13 +480,8 @@ public class FlatComboBoxUI @Override protected Rectangle computePopupBounds( int px, int py, int pw, int ph ) { - // get maximum display size of all items, ignoring prototype value - Object prototype = comboBox.getPrototypeDisplayValue(); - if( prototype != null ) - comboBox.setPrototypeDisplayValue( null ); + // get maximum display size of all items Dimension displaySize = getDisplaySize(); - if( prototype != null ) - comboBox.setPrototypeDisplayValue( prototype ); // make popup wider if necessary if( displaySize.width > pw ) { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java index 2e73567c..5fea98b5 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java @@ -310,14 +310,13 @@ class BasicComponentsPanel add(comboBox4, "cell 4 4,growx"); //---- comboBox5 ---- - comboBox5.setPrototypeDisplayValue("12345"); comboBox5.setModel(new DefaultComboBoxModel<>(new String[] { "wide popup if text is longer", "aa", "bbb", "cccc" })); - add(comboBox5, "cell 5 4,growx"); + add(comboBox5, "cell 5 4,growx,wmax 100"); //---- spinnerLabel ---- spinnerLabel.setText("JSpinner:"); diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd index 81c6bb83..cf19d4ca 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd @@ -242,7 +242,6 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox5" - "prototypeDisplayValue": "12345" "model": new javax.swing.DefaultComboBoxModel { selectedItem: "wide popup if text is longer" addElement( "wide popup if text is longer" ) @@ -251,7 +250,7 @@ new FormModel { addElement( "cccc" ) } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 4,growx" + "value": "cell 5 4,growx,wmax 100" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "spinnerLabel" diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java index 69847c07..c7767e1d 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java @@ -513,14 +513,13 @@ public class FlatComponentsTest add(comboBox4, "cell 4 5,growx"); //---- comboBox5 ---- - comboBox5.setPrototypeDisplayValue("12345"); comboBox5.setModel(new DefaultComboBoxModel<>(new String[] { "wide popup if text is longer", "aa", "bbb", "cccc" })); - add(comboBox5, "cell 5 5,growx"); + add(comboBox5, "cell 5 5,growx,wmax 100"); //---- spinnerLabel ---- spinnerLabel.setText("JSpinner:"); diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd index 28154222..1daebf5f 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd @@ -373,7 +373,6 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox5" - "prototypeDisplayValue": "12345" "model": new javax.swing.DefaultComboBoxModel { selectedItem: "wide popup if text is longer" addElement( "wide popup if text is longer" ) @@ -382,7 +381,7 @@ new FormModel { addElement( "cccc" ) } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 5,growx" + "value": "cell 5 5,growx,wmax 100" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "spinnerLabel" From 152f235ca189b6346a1f973501d6dcd1e52c96f2 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Wed, 1 Apr 2020 23:26:47 +0200 Subject: [PATCH 026/500] release 0.29 --- CHANGELOG.md | 2 +- build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20df43d0..47e6c334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ FlatLaf Change Log ================== -## Unreleased +## 0.29 - Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running on JetBrains Runtime. (issue #69) diff --git a/build.gradle.kts b/build.gradle.kts index 9d44f41b..41a504df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,8 @@ * limitations under the License. */ -val releaseVersion = "0.28" -val developmentVersion = "0.29-SNAPSHOT" +val releaseVersion = "0.29" +val developmentVersion = "0.30-SNAPSHOT" version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion From 204da2175b42bcaf8665a70a1d8b46bb1ad150f0 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 4 Apr 2020 14:13:20 +0200 Subject: [PATCH 027/500] Theme Editor: initial commit --- flatlaf-theme-editor/build.gradle.kts | 25 ++++++ .../themeeditor/FlatSyntaxTextArea.java | 31 +++++++ .../themeeditor/FlatThemeEditorPane.java | 66 ++++++++++++++ .../themeeditor/FlatThemeFileEditor.java | 87 +++++++++++++++++++ .../themeeditor/FlatThemeFileEditor.jfd | 27 ++++++ settings.gradle.kts | 1 + 6 files changed, 237 insertions(+) create mode 100644 flatlaf-theme-editor/build.gradle.kts create mode 100644 flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java create mode 100644 flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java create mode 100644 flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java create mode 100644 flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd diff --git a/flatlaf-theme-editor/build.gradle.kts b/flatlaf-theme-editor/build.gradle.kts new file mode 100644 index 00000000..e40fb7bc --- /dev/null +++ b/flatlaf-theme-editor/build.gradle.kts @@ -0,0 +1,25 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + `java-library` +} + +dependencies { + implementation( project( ":flatlaf-core" ) ) + + implementation( "com.fifesoft:rsyntaxtextarea:3.1.0" ) +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java new file mode 100644 index 00000000..755edbd5 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java @@ -0,0 +1,31 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import org.fife.ui.rsyntaxtextarea.TextEditorPane; + +/** + * A text area that supports editing FlatLaf themes. + * + * @author Karl Tauber + */ +class FlatSyntaxTextArea + extends TextEditorPane +{ + FlatSyntaxTextArea() { + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java new file mode 100644 index 00000000..8aa40543 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.BorderLayout; +import java.awt.Font; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import javax.swing.JPanel; +import org.fife.ui.rsyntaxtextarea.FileLocation; +import org.fife.ui.rtextarea.RTextScrollPane; +import com.formdev.flatlaf.util.UIScale; + +/** + * A pane that supports editing FlatLaf themes. + * + * @author Karl Tauber + */ +class FlatThemeEditorPane + extends JPanel +{ + private final RTextScrollPane scrollPane; + private final FlatSyntaxTextArea textArea; + + FlatThemeEditorPane() { + super( new BorderLayout() ); + + // create text area + textArea = new FlatSyntaxTextArea(); + + // create scroll pane + scrollPane = new RTextScrollPane( textArea ); + scrollPane.setLineNumbersEnabled( true ); + + // scale fonts + if( UIScale.getUserScaleFactor() != 1 ) { + textArea.setFont( scaleFont( textArea.getFont() ) ); + scrollPane.getGutter().setLineNumberFont( scaleFont( scrollPane.getGutter().getLineNumberFont() ) ); + } + + add( scrollPane, BorderLayout.CENTER ); + } + + private static Font scaleFont( Font font ) { + int newFontSize = UIScale.scale( font.getSize() ); + return font.deriveFont( (float) newFontSize ); + } + + public void load( FileLocation loc ) throws IOException { + textArea.load( loc, StandardCharsets.ISO_8859_1 ); + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java new file mode 100644 index 00000000..71f1e2b7 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import javax.swing.*; +import org.fife.ui.rsyntaxtextarea.FileLocation; +import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.util.UIScale; + +/** + * TODO + * + * @author Karl Tauber + */ +public class FlatThemeFileEditor + extends JFrame +{ + public static void main( String[] args ) { + File file = new File( args.length > 0 + ? args[0] + : "../flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties" ); // TODO + + SwingUtilities.invokeLater( () -> { + FlatLightLaf.install(); + + FlatThemeFileEditor frame = new FlatThemeFileEditor(); + + try { + frame.themeEditorArea.load( FileLocation.create( file ) ); + } catch( IOException ex ) { + ex.printStackTrace(); + } + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + frame.setSize( Math.min( UIScale.scale( 800 ), screenSize.width ), + screenSize.height - UIScale.scale( 100 ) ); + frame.setLocationRelativeTo( null ); + frame.setVisible( true ); + } ); + } + + public FlatThemeFileEditor() { + initComponents(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + dialogPane = new JPanel(); + themeEditorArea = new FlatThemeEditorPane(); + + //======== this ======== + setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + setTitle("FlatLaf Theme Editor"); + Container contentPane = getContentPane(); + contentPane.setLayout(new BorderLayout()); + + //======== dialogPane ======== + { + dialogPane.setLayout(new BorderLayout()); + dialogPane.add(themeEditorArea, BorderLayout.CENTER); + } + contentPane.add(dialogPane, BorderLayout.CENTER); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JPanel dialogPane; + private FlatThemeEditorPane themeEditorArea; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd new file mode 100644 index 00000000..be2a9cdd --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd @@ -0,0 +1,27 @@ +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.1" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "this" + "$locationPolicy": 2 + "$sizePolicy": 2 + "defaultCloseOperation": 2 + "title": "FlatLaf Theme Editor" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "dialogPane" + add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemeEditorPane" ) { + name: "themeEditorArea" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 535, 300 ) + } ) + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 1dfc5794..c325a9d7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,7 @@ include( "flatlaf-swingx" ) include( "flatlaf-jide-oss" ) include( "flatlaf-demo" ) include( "flatlaf-testing" ) +include( "flatlaf-theme-editor" ) pluginManagement { plugins { From d59d353c2e38d4195c6b33bb83ab66728e27f123 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 4 Apr 2020 23:32:48 +0200 Subject: [PATCH 028/500] Theme Editor: added token maker (based on .properties token maker) --- .../themeeditor/FlatThemeEditorPane.java | 9 + .../themeeditor/FlatThemeFileEditor.java | 2 +- .../themeeditor/FlatThemeTokenMaker.java | 191 ++++++++++++++++++ .../theme-editor-test.properties | 40 ++++ 4 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java create mode 100644 flatlaf-theme-editor/theme-editor-test.properties diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java index 8aa40543..99387bb2 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java @@ -21,7 +21,9 @@ import java.awt.Font; import java.io.IOException; import java.nio.charset.StandardCharsets; import javax.swing.JPanel; +import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory; import org.fife.ui.rsyntaxtextarea.FileLocation; +import org.fife.ui.rsyntaxtextarea.TokenMakerFactory; import org.fife.ui.rtextarea.RTextScrollPane; import com.formdev.flatlaf.util.UIScale; @@ -33,14 +35,21 @@ import com.formdev.flatlaf.util.UIScale; class FlatThemeEditorPane extends JPanel { + private static final String FLATLAF_STYLE = "text/flatlaf"; + private final RTextScrollPane scrollPane; private final FlatSyntaxTextArea textArea; FlatThemeEditorPane() { super( new BorderLayout() ); + // register FlatLaf token maker + AbstractTokenMakerFactory tmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance(); + tmf.putMapping( FLATLAF_STYLE, FlatThemeTokenMaker.class.getName() ); + // create text area textArea = new FlatSyntaxTextArea(); + textArea.setSyntaxEditingStyle( FLATLAF_STYLE ); // create scroll pane scrollPane = new RTextScrollPane( textArea ); diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java index 71f1e2b7..18e453aa 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -35,7 +35,7 @@ public class FlatThemeFileEditor public static void main( String[] args ) { File file = new File( args.length > 0 ? args[0] - : "../flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties" ); // TODO + : "theme-editor-test.properties" ); // TODO SwingUtilities.invokeLater( () -> { FlatLightLaf.install(); diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java new file mode 100644 index 00000000..47a51831 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java @@ -0,0 +1,191 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rsyntaxtextarea.TokenMap; +import org.fife.ui.rsyntaxtextarea.TokenTypes; +import org.fife.ui.rsyntaxtextarea.modes.PropertiesFileTokenMaker; + +/** + * Token maker for FlatLaf properties files. + *

+ * Lets the super class parse the properties file and modify the added tokens. + * The super class uses {@link TokenTypes#RESERVED_WORD} for property keys and + * {@link TokenTypes#LITERAL_STRING_DOUBLE_QUOTE} for property values. + * + * @author Karl Tauber + */ +public class FlatThemeTokenMaker + extends PropertiesFileTokenMaker +{ + private static final int TOKEN_PROPERTY = Token.IDENTIFIER; + private static final int TOKEN_VARIABLE = Token.VARIABLE; + private static final int TOKEN_NUMBER = Token.LITERAL_NUMBER_DECIMAL_INT; + private static final int TOKEN_COLOR = Token.LITERAL_NUMBER_HEXADECIMAL; + private static final int TOKEN_STRING = Token.LITERAL_STRING_DOUBLE_QUOTE; + private static final int TOKEN_FUNCTION = Token.FUNCTION; + private static final int TOKEN_TYPE = Token.DATA_TYPE; + + private final TokenMap tokenMap = new TokenMap(); + + public FlatThemeTokenMaker() { + // null, false, true + tokenMap.put( "null", Token.RESERVED_WORD ); + tokenMap.put( "false", Token.LITERAL_BOOLEAN ); + tokenMap.put( "true", Token.LITERAL_BOOLEAN ); + + // functions + tokenMap.put( "rgb", TOKEN_FUNCTION ); + tokenMap.put( "rgba", TOKEN_FUNCTION ); + tokenMap.put( "hsl", TOKEN_FUNCTION ); + tokenMap.put( "hsla", TOKEN_FUNCTION ); + tokenMap.put( "lighten", TOKEN_FUNCTION ); + tokenMap.put( "darken", TOKEN_FUNCTION ); + tokenMap.put( "lazy", TOKEN_FUNCTION ); + + // function options + tokenMap.put( "relative", Token.RESERVED_WORD ); + tokenMap.put( "autoInverse", Token.RESERVED_WORD ); + } + + /** + * This method is only invoked from the super class. + */ + @Override + public void addToken( char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink ) { +// debugInputToken( array, start, end, tokenType, startOffset, hyperlink ); + + // ignore invalid token + if( end < start ) + return; + + if( tokenType == Token.RESERVED_WORD ) { + // key + int newTokenType = (array[start] == '@') ? TOKEN_VARIABLE : TOKEN_PROPERTY; + super.addToken( array, start, end, newTokenType, startOffset, hyperlink ); + } else if( tokenType == Token.LITERAL_STRING_DOUBLE_QUOTE ) { + // value + tokenizeValue( array, start, end, startOffset ); + } else if( tokenType == Token.VARIABLE ) { + // '{variable}' + super.addToken( array, start, end, TOKEN_TYPE, startOffset, hyperlink ); + } else { + // comments or operators + super.addToken( array, start, end, tokenType, startOffset, hyperlink ); + } + } + + private void tokenizeValue( char[] array, int start, int end, int startOffset ) { + int newStartOffset = startOffset - start; + + int currentTokenStart = start; + int currentTokenType = Token.NULL; + + for( int i = start; i <= end; i++ ) { + int newTokenType; + char ch = array[i]; + if( ch <= ' ' ) + newTokenType = Token.WHITESPACE; + else if( ch == '#' || (currentTokenType == TOKEN_COLOR && RSyntaxUtilities.isHexCharacter( ch )) ) + newTokenType = TOKEN_COLOR; + else if( ch == '$' || (currentTokenType == TOKEN_PROPERTY && isPropertyChar( ch )) ) + newTokenType = TOKEN_PROPERTY; + else if( ch == '@' || (currentTokenType == TOKEN_VARIABLE && isPropertyChar( ch )) ) + newTokenType = TOKEN_VARIABLE; + else if( currentTokenType != TOKEN_STRING && (RSyntaxUtilities.isDigit( ch ) || (currentTokenType == TOKEN_NUMBER && ch == '.')) ) + newTokenType = TOKEN_NUMBER; + else if( ch == ',' || ch == '(' || ch == ')' || ch == '"' || ch == '%' ) + newTokenType = TokenTypes.OPERATOR; + else + newTokenType = TOKEN_STRING; + + if( currentTokenType == Token.NULL ) + currentTokenType = newTokenType; + else if( newTokenType != currentTokenType ) { + addTokenImpl( array, currentTokenStart, i - 1, currentTokenType, newStartOffset + currentTokenStart ); + currentTokenType = newTokenType; + currentTokenStart = i; + } + } + + if( currentTokenType != Token.NULL ) + addTokenImpl( array, currentTokenStart, end, currentTokenType, newStartOffset + currentTokenStart ); + } + + private void addTokenImpl( char[] array, int start, int end, int tokenType, int startOffset ) { + if( tokenType == TOKEN_STRING ) { + int type = tokenMap.get( array, start, end ); + if( type != -1 ) + tokenType = type; + } + +// debugOutputToken( array, start, end, tokenType ); + super.addToken( array, start, end, tokenType, startOffset, false ); + } + + private boolean isPropertyChar( char ch ) { + return RSyntaxUtilities.isLetterOrDigit( ch ) || ch == '.' || ch == '_' || ch == '-'; + } + +/*debug + private java.util.HashMap tokenTypeStrMap; + + private void debugInputToken( char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink ) { + if( tokenTypeStrMap == null ) { + tokenTypeStrMap = new java.util.HashMap<>(); + for( java.lang.reflect.Field f : TokenTypes.class.getFields() ) { + try { + tokenTypeStrMap.put( (Integer) f.get( null ), f.getName() ); + } catch( IllegalArgumentException | IllegalAccessException ex ) { + ex.printStackTrace(); + } + } + } + + String tokenTypeStr = tokenTypeStrMap.computeIfAbsent( tokenType, t -> { + return "(unknown " + t + ")"; + } ); + + System.out.printf( "%d-%d (%d) %-30s '%s'\n", + start, end, end - start, tokenTypeStr, new String( array, start, end - start + 1 ) ); + } + + private void debugOutputToken( char[] array, int start, int end, int tokenType ) { + String tokenTypeStr = null; + switch( tokenType ) { + case TOKEN_PROPERTY: tokenTypeStr = "PROPERTY"; break; + case TOKEN_VARIABLE: tokenTypeStr = "VARIABLE"; break; + case TOKEN_NUMBER: tokenTypeStr = "NUMBER"; break; + case TOKEN_COLOR: tokenTypeStr = "COLOR"; break; + case TOKEN_STRING: tokenTypeStr = "STRING"; break; + case TOKEN_FUNCTION: tokenTypeStr = "FUNCTION"; break; + case TOKEN_TYPE: tokenTypeStr = "TYPE"; break; + case TokenTypes.OPERATOR: tokenTypeStr = "OPERATOR"; break; + case TokenTypes.WHITESPACE: tokenTypeStr = "WHITESPACE"; break; + case TokenTypes.LITERAL_BOOLEAN: tokenTypeStr = "BOOLEAN"; break; + case TokenTypes.RESERVED_WORD: tokenTypeStr = "RESERVED_WORD"; break; + default: + throw new IllegalArgumentException( String.valueOf( tokenType ) ); + } + + System.out.printf( " %d-%d (%d) %-15s '%s'\n", + start, end, end - start, tokenTypeStr, new String( array, start, end - start + 1 ) ); + } +debug*/ +} diff --git a/flatlaf-theme-editor/theme-editor-test.properties b/flatlaf-theme-editor/theme-editor-test.properties new file mode 100644 index 00000000..18bf541b --- /dev/null +++ b/flatlaf-theme-editor/theme-editor-test.properties @@ -0,0 +1,40 @@ +# +# some comment +# + +ButtonUI=com.formdev.flatlaf.ui.FlatButtonUI + CheckBoxUI = com.formdev.flatlaf.ui.FlatCheckBoxUI + +Prop.string=some string +Prop.string2="some string 123 #f80" +Prop.char1=x +Prop.char2=\u2022 +Prop.integer=123 +Prop.float=456.123 +Prop.color1=#f80 +Prop.color2=#ff8800 +Prop.color3=#f804 +Prop.color4=#ff880044 +Prop.border=1,2,3,4 + +Prop.scaledInteger={scaledInteger}123 + +Prop.null=null +Prop.false=false +Prop.true=true + +@var1=123 +Prop.var=@var1 +Prop.ref=$Prop.string + +Prop.lazy=lazy(Prop.string) + +Prop.colorFunc1=rgb(12,34,56) +Prop.colorFunc2=rgba(12,34,56,78) +Prop.colorFunc3=hsl(12,34,56) +Prop.colorFunc4=hsla(12,34,56,78) + +Prop.colorFunc5=lighten(#fe1289,20%) +Prop.colorFunc6=darken(#fe1289,20%) +Prop.colorFunc7=lighten($Prop.colorFunc4,20%,relative autoInverse) +Prop.colorFunc8=lighten(Prop.colorFunc4,20%,lazy) From 54c14d0dc803ca0f4b19b548e4f5c8bcca7bc2b8 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 5 Apr 2020 11:52:31 +0200 Subject: [PATCH 029/500] Theme Editor: added editor theme --- .../themeeditor/FlatThemeEditorPane.java | 9 +++ .../com/formdev/flatlaf/themeeditor/light.xml | 78 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java index 99387bb2..b201452f 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java @@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets; import javax.swing.JPanel; import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory; import org.fife.ui.rsyntaxtextarea.FileLocation; +import org.fife.ui.rsyntaxtextarea.Theme; import org.fife.ui.rsyntaxtextarea.TokenMakerFactory; import org.fife.ui.rtextarea.RTextScrollPane; import com.formdev.flatlaf.util.UIScale; @@ -51,6 +52,14 @@ class FlatThemeEditorPane textArea = new FlatSyntaxTextArea(); textArea.setSyntaxEditingStyle( FLATLAF_STYLE ); + // theme + try { + Theme theme = Theme.load( getClass().getResourceAsStream( "light.xml" ) ); + theme.apply( textArea ); + } catch( IOException ex ) { + ex.printStackTrace(); + } + // create scroll pane scrollPane = new RTextScrollPane( textArea ); scrollPane.setLineNumbersEnabled( true ); diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml new file mode 100644 index 00000000..9b566345 --- /dev/null +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +