Compare commits

...

49 Commits

Author SHA1 Message Date
Karl Tauber
df6256d989 release 2.0.1 2022-01-25 18:46:29 +01:00
Karl Tauber
c27db56321 moved module-info.class from META-INF\versions\9\ to root folder of JARs (issue #466) 2022-01-25 16:59:31 +01:00
Karl Tauber
97bed8554a FlatSVGIcon: added copy constructor (issue #465) 2022-01-25 00:47:35 +01:00
Karl Tauber
751c0e16e9 ToolTip: fixed wrong tooltip location if component overrides JComponent.getToolTipLocation() and wants place tooltip under mouse location (issue #468) 2022-01-24 23:24:39 +01:00
Karl Tauber
936de60700 fixed memory leak in Panel, Separator and ToolBarSeparator (issue #471) 2022-01-24 18:28:38 +01:00
Karl Tauber
f6b64d48ec Merge PR #463: Updating MegaMek Suite Information 2022-01-19 17:27:12 +01:00
Justin Bowen
b043da7d4c Updating MegaMek Suite Information 2022-01-13 20:22:30 -05:00
Karl Tauber
7e47cc2443 updated sigtest for FlatLaf 2.0
(generated in clean workspace with gradle task `sigtestGenerate`)
2022-01-13 12:14:51 +01:00
Karl Tauber
b8b45f9442 Theme Editor: added to main readme 2022-01-11 16:17:17 +01:00
Karl Tauber
66337f9af6 release 2.0 2022-01-10 12:25:45 +01:00
Karl Tauber
54646706a0 README.md: added more documentation links 2022-01-10 12:13:30 +01:00
Karl Tauber
e8ee037d09 RootPane: uninstall background, foreground and font because not all Lafs set them 2022-01-10 11:58:49 +01:00
Karl Tauber
6d705e568a Extras: FlatInspector: fixed "NOT SET" for component foreground 2022-01-09 19:40:17 +01:00
Karl Tauber
e768791eba Native window decorations: updated hover and pressed colors of iconify/maximize/close buttons for Windows 11 style 2022-01-09 12:59:08 +01:00
Karl Tauber
2aff7c97f9 Demo: changed theme names from "Flat *" to "FlatLaf *" 2022-01-08 22:56:20 +01:00
Karl Tauber
ca6fc7773e README.md: added MooInfo to applications using FlatLaf (issue #460) 2022-01-06 16:05:28 +01:00
Karl Tauber
a1395a5490 TextField: leading/trailing components (PR #386):
- set cursor only on button and toolbar
- do not replace cursor on if already set (issue #461)
- updated client properties javadoc
2022-01-06 15:17:20 +01:00
Karl Tauber
61dd4d71d6 Theme Editor: added text field leading/trailing buttons/toolbar to preview 2022-01-05 19:43:06 +01:00
Karl Tauber
6beda53238 Button: if boolbar button is in leading/trailing component of a text field, increase toolbar button corner arc to match text field corner arc (issue #451) 2022-01-05 18:46:00 +01:00
Karl Tauber
941441d7e1 TextField: clear button has now component name TextField.clearButton
PasswordField: reveals button has now component name `PasswordField.revealButton` and additional style class `revealButton` (issue #173)
SwingUtils: added `getComponentByName()` for easy getting clear or reveal buttons
2022-01-05 18:32:05 +01:00
Karl Tauber
d10ea41b47 GitHub Actions:
- build on Java 17
- run natives.yml when Gradle version changed
2022-01-04 18:13:12 +01:00
Karl Tauber
9458870f70 update to Gradle 7.3.3
./gradlew wrapper --gradle-version=7.3.3
2022-01-04 16:06:37 +01:00
Karl Tauber
095794bbd1 GitHub Actions:
- use actions/setup-java@v2 (provides caching gradle files)
- use pre-installed Java 8 and 11
- no longer build on Java 9 and 14
- not yet build on Java 17 because used Gradle version 6.8.2 does not support it
  can not yet upgrade to Gradle 7.x because nokee plugins (for C++) does not support it
2022-01-04 12:26:13 +01:00
Karl Tauber
c7fc0aa936 Demo: removed unnecessary setting component name 2022-01-03 23:56:26 +01:00
Karl Tauber
a8d98ced61 Theme Editor:
- support multi-line styles in overlay color preview
- minor preview improvements
2022-01-03 21:51:02 +01:00
Karl Tauber
831b3d851a ColorFunctions: javadoc added; do not mix colors if they are equal 2022-01-03 19:04:28 +01:00
Karl Tauber
8c891c7016 UIDefaultsDump: output base color used for resolving derived color 2022-01-03 18:46:56 +01:00
Karl Tauber
5c4706cbc9 Merge remote-tracking branch 'origin/main' into main 2022-01-03 17:05:37 +01:00
Karl Tauber
db66a6c4f0 Unit tests: re-enable testing scaled UI
avoid using UI_SCALE_ENABLED = false because if this test is executed first, class UIScale does not register listeners to UIManager, which prevents updating user scale factor on font changes and testing scaled UI fails
2022-01-03 16:52:43 +01:00
Karl Tauber
0517e4fc02 Native window decorations: updated maximize and restore icons for Windows 11 style
(requires Java 8u321, 11.0.14, 17.0.2 or 18+)
2021-12-31 17:57:02 +01:00
Karl Tauber
dd7fa4a87d Slider: fixed/improved focused indicator color when changing accent color (PR #375) 2021-12-31 15:33:27 +01:00
Karl Tauber
e5956900ea FileChooser: use Windows system icons in Java 18+ 32bit (issue #403)
only Java 17 32bit does not use Windows system icons because of:
https://bugs.openjdk.java.net/browse/JDK-8277299
2021-12-31 12:59:22 +01:00
Karl Tauber
3755593c14 Windows 11: Native window decorations: do not paint top window border because Windows 11 now paints it (issue #431)
(requires Java 8u321, 11.0.14, 17.0.2 or 18+)
2021-12-31 10:35:19 +01:00
Karl Tauber
8ddd3b6d68 Native window decorations: fixed blurry iconify/maximize/close button hover rectangles at 125%, 150% or 175% scaling (issue #431) 2021-12-31 10:28:34 +01:00
Karl Tauber
840083940d Use FlatLaf native window decorations by default when running in
[JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime/wiki)
(instead of using JetBrains custom decorations). System variable
`flatlaf.useJetBrainsCustomDecorations` is now `false` by default (was `true` in FlatLaf 1.x). (issue #454)
2021-12-30 12:04:22 +01:00
Karl Tauber
0cdfd29ecf Extras: fixed concurrent loading of SVG icons on multiple threads (issue #459) 2021-12-30 11:24:48 +01:00
Karl Tauber
bb32c727b6 TextField:
- improved hover/pressed/selected colors of leading/trailing buttons
  (e.g. "reveal" button in password field) (issue #452)
- clear button no longer paints over round border (issue #451)
2021-12-28 20:24:43 +01:00
Karl Tauber
f978c04750 PasswordField: reveal button did not show password if JPasswordField.setEchoChar() was invoked from application (PR #442; issue #173) 2021-12-27 22:53:07 +01:00
Karl Tauber
b6a504e121 Theme Editor: fixed "Pick Color from Screen" on macOS
On macOS Big Sur (and later), to pick colors outside of theme editor window it is necessary to give "Screen Recording" permission to the application (or to the IDE started from).
For the arrow keys, "Accessibility" permission is necessary.
See "System Preferences > Security & Privacy > Privacy".
2021-12-27 21:49:49 +01:00
Karl Tauber
5fae367fab PasswordField: preserve reveal button state when switching theme (issue #173) 2021-12-27 20:07:27 +01:00
Karl Tauber
6e807f44b2 Search/clear icons: fixed colors for some IntelliJ themes (e.g. "Dark Flat") that use translucent color for Actions.GreyInline 2021-12-27 18:22:31 +01:00
Karl Tauber
53ebed7f89 CHANGELOG.md: added changes for #453 and #456 2021-12-26 22:44:55 +01:00
Karl Tauber
1c10c41808 Theme Editor: Preview: added style classes to all preview components (syntax flatlaf-preview-<componenttype>) to allow experimenting with styles in editor 2021-12-26 21:23:42 +01:00
Karl Tauber
01170b669b Theme Editor: Preview:
- reworked disabling to avoid disabling internal components
- do not disable labels
- removed special code for JTextPane and JEditorPane, which seems to be no longer needed
2021-12-26 20:30:36 +01:00
Karl Tauber
b56215e5e3 Demo: moved leading/trailing icons (on text field) code from end of initComponents() to constructor (so that it easier to find) 2021-12-26 19:57:15 +01:00
Karl Tauber
221e801561 support relative path in system property flatlaf.nativeLibraryPath (PR #453) 2021-12-23 22:19:29 +01:00
Karl Tauber
90edbe23d7 Merge PR #453: Add a system property to load pre-extracted native libraries from a directory 2021-12-23 22:10:11 +01:00
Karl Tauber
5b16a814c8 fixed "endless recursion in font" exception in FlatLaf$ActiveFont.createValue() if UIManager.getFont() is invoked from multiple threads (issue #456) 2021-12-23 21:16:07 +01:00
Ingo Kegel
ef01721464 Added the system property flatlaf.nativeLibraryPath to specify a directory where the native libraries have been extracted.
Avoiding extraction at runtime to the temporary directory is useful in order to prevent anti-virus software from blocking the library loading.
2021-12-21 11:13:40 +01:00
77 changed files with 1248 additions and 704 deletions

View File

@@ -19,40 +19,26 @@ jobs:
strategy: strategy:
matrix: matrix:
# test against # test against
# - Java 1.8 (minimum requirement) # - Java 8 (minimum requirement)
# - Java 9 (first version with JPMS)
# - Java LTS versions (11, 17, ...) # - Java LTS versions (11, 17, ...)
# - lastest Java version(s) # - lastest Java version(s)
java: java:
- 1.8 - 8
- 9
- 11 # LTS - 11 # LTS
- 14 - 17 # LTS
- 15
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1 - uses: gradle/wrapper-validation-action@v1
if: matrix.java == '1.8' if: matrix.java == '8'
- name: Setup Java ${{ matrix.java }} - name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
distribution: adopt # Java 8 and 11 are pre-installed on ubuntu-latest
- name: Cache Gradle wrapper cache: gradle
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build
@@ -80,22 +66,11 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Java 11 - name: Setup Java 11
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
java-version: 11 java-version: 11
distribution: adopt # pre-installed on ubuntu-latest
- name: Cache Gradle wrapper cache: gradle
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Publish snapshot to oss.sonatype.org - name: Publish snapshot to oss.sonatype.org
run: ./gradlew publish :flatlaf-theme-editor:build -Dorg.gradle.internal.publish.checksums.insecure=true run: ./gradlew publish :flatlaf-theme-editor:build -Dorg.gradle.internal.publish.checksums.insecure=true
@@ -127,22 +102,11 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Java 11 - name: Setup Java 11
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
java-version: 11 java-version: 11
distribution: adopt # pre-installed on ubuntu-latest
- name: Cache Gradle wrapper cache: gradle
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Release a new stable version to Maven Central - name: Release a new stable version to Maven Central
run: ./gradlew publish :flatlaf-demo:build :flatlaf-theme-editor:build -Drelease=true run: ./gradlew publish :flatlaf-demo:build :flatlaf-theme-editor:build -Drelease=true

View File

@@ -11,12 +11,14 @@ on:
paths: paths:
- 'flatlaf-natives/flatlaf-natives-windows/**' - 'flatlaf-natives/flatlaf-natives-windows/**'
- '.github/workflows/natives.yml' - '.github/workflows/natives.yml'
- 'gradle/wrapper/gradle-wrapper.properties'
pull_request: pull_request:
branches: branches:
- '*' - '*'
paths: paths:
- 'flatlaf-natives/flatlaf-natives-windows/**' - 'flatlaf-natives/flatlaf-natives-windows/**'
- '.github/workflows/natives.yml' - '.github/workflows/natives.yml'
- 'gradle/wrapper/gradle-wrapper.properties'
jobs: jobs:
Windows: Windows:
@@ -27,28 +29,17 @@ jobs:
- uses: gradle/wrapper-validation-action@v1 - uses: gradle/wrapper-validation-action@v1
- name: Setup Java 1.8 - name: Setup Java 11
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
java-version: 1.8 java-version: 11
distribution: adopt
- name: Cache Gradle wrapper cache: gradle
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
!~/.gradle/caches/modules-2/modules-2.lock
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew :flatlaf-natives-windows:build # --no-daemon is necessary on Windows otherwise caching Gradle would fail with:
# tar.exe: Couldn't open ~/.gradle/caches/modules-2/modules-2.lock: Permission denied
run: ./gradlew :flatlaf-natives-windows:build --no-daemon
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2

View File

@@ -1,6 +1,52 @@
FlatLaf Change Log FlatLaf Change Log
================== ==================
## 2.0.1
- Fixed memory leak in Panel, Separator and ToolBarSeparator. (issue #471;
regression in FlatLaf 2.0)
- ToolTip: Fixed wrong tooltip location if component overrides
`JComponent.getToolTipLocation()` and wants place tooltip under mouse
location. (issue #468)
- Extras: Added copy constructor to `FlatSVGIcon`. (issue #465)
- Moved `module-info.class` from `META-INF\versions\9\` to root folder of JARs.
(issue #466)
## 2.0
- Added system property `flatlaf.nativeLibraryPath` to load native libraries
from a directory. (PR #453)
- Fixed "endless recursion in font" exception in
`FlatLaf$ActiveFont.createValue()` if `UIManager.getFont()` is invoked from
multiple threads. (issue #456)
- PasswordField: Preserve reveal button state when switching theme. (PR #442;
issue #173)
- PasswordField: Reveal button did not show password if
`JPasswordField.setEchoChar()` was invoked from application. (PR #442; issue
#173)
- Slider: Fixed/improved focused indicator color when changing accent color. (PR
#375)
- TextField:
- Improved hover/pressed/selected colors of leading/trailing buttons (e.g.
"reveal" button in password field). (issue #452)
- Clear button no longer paints over round border. (issue #451)
- Extras: Fixed concurrent loading of SVG icons on multiple threads. (issue
#459)
- Use FlatLaf native window decorations by default when running in
[JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime/wiki)
(instead of using JetBrains custom decorations). System variable
`flatlaf.useJetBrainsCustomDecorations` is now `false` by default (was `true`
in FlatLaf 1.x). (issue #454)
- Native window decorations:
- Fixed blurry iconify/maximize/close button hover rectangles at 125%, 150% or
175% scaling. (issue #431)
- Updated maximize and restore icons for Windows 11 style. (requires Java
8u321, 11.0.14, 17.0.2 or 18+)
- Updated hover and pressed colors of iconify/maximize/close buttons for
Windows 11 style.
## 2.0-rc1 ## 2.0-rc1
#### New features and improvements #### New features and improvements

View File

@@ -11,9 +11,9 @@ scales on **HiDPI** displays and runs on Java 8 or newer.
The look is heavily inspired by **Darcula** and **IntelliJ** themes from The look is heavily inspired by **Darcula** and **IntelliJ** themes from
IntelliJ IDEA 2019.2+ and uses almost the same colors and icons. IntelliJ IDEA 2019.2+ and uses almost the same colors and icons.
![Flat Light](images/flat_light.png) ![FlatLaf Light](images/flat_light.png)
![Flat Dark](images/flat_dark.png) ![FlatLaf Dark](images/flat_dark.png)
IntelliJ Platform Themes IntelliJ Platform Themes
@@ -99,10 +99,22 @@ For more information and documentation visit
- [Customizing](https://www.formdev.com/flatlaf/customizing/) - [Customizing](https://www.formdev.com/flatlaf/customizing/)
- [How to Customize](https://www.formdev.com/flatlaf/how-to-customize/) - [How to Customize](https://www.formdev.com/flatlaf/how-to-customize/)
- [Properties Files](https://www.formdev.com/flatlaf/properties-files/) - [Properties Files](https://www.formdev.com/flatlaf/properties-files/)
- [Components UI Properties](https://www.formdev.com/flatlaf/components/)
- [Typography](https://www.formdev.com/flatlaf/typography/)
- [Client Properties](https://www.formdev.com/flatlaf/client-properties/) - [Client Properties](https://www.formdev.com/flatlaf/client-properties/)
- [System Properties](https://www.formdev.com/flatlaf/system-properties/) - [System Properties](https://www.formdev.com/flatlaf/system-properties/)
Theme Editor
------------
The Theme Editor that supports editing FlatLaf theme properties files. See
[Theme Editor documentation](https://www.formdev.com/flatlaf/theme-editor/) for
details and downloads.
![Theme Editor](images/theme-editor@1.5x.png)
Buzz Buzz
---- ----
@@ -114,6 +126,9 @@ Buzz
Applications using FlatLaf Applications using FlatLaf
-------------------------- --------------------------
- ![New](images/new.svg) [MooInfo](https://github.com/rememberber/MooInfo) -
visual implementation of OSHI, to view information about the system and
hardware
- ![New](images/new.svg) [Jailer](https://github.com/Wisser/Jailer) 11.2 - - ![New](images/new.svg) [Jailer](https://github.com/Wisser/Jailer) 11.2 -
database subsetting and relational data browsing tool database subsetting and relational data browsing tool
- [Apache NetBeans](https://netbeans.apache.org/) 11.3 - IDE for Java, PHP, HTML - [Apache NetBeans](https://netbeans.apache.org/) 11.3 - IDE for Java, PHP, HTML
@@ -149,9 +164,10 @@ Applications using FlatLaf
- [Total Validator](https://www.totalvalidator.com/) 15 (**commercial**) - - [Total Validator](https://www.totalvalidator.com/) 15 (**commercial**) -
checks your website checks your website
- [j-lawyer](https://github.com/jlawyerorg/j-lawyer-org) - Kanzleisoftware - [j-lawyer](https://github.com/jlawyerorg/j-lawyer-org) - Kanzleisoftware
- [MegaMek](https://github.com/MegaMek/megamek) v0.47.4 and - [MegaMek](https://github.com/MegaMek/megamek),
[MekHQ](https://github.com/MegaMek/mekhq) v0.47.5 - a turn-based sci-fi board [MegaMekLab](https://github.com/MegaMek/megameklab) and
game [MekHQ](https://github.com/MegaMek/mekhq) v0.47.5+ - a sci-fi tabletop
BattleTech simulator suite handling battles, unit building, and campaigns
- [GUIslice Builder](https://github.com/ImpulseAdventure/GUIslice-Builder) - [GUIslice Builder](https://github.com/ImpulseAdventure/GUIslice-Builder)
0.13.b024 - GUI builder for 0.13.b024 - GUI builder for
[GUIslice](https://github.com/ImpulseAdventure/GUIslice), a lightweight GUI [GUIslice](https://github.com/ImpulseAdventure/GUIslice), a lightweight GUI

View File

@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
val releaseVersion = "2.0-rc1" val releaseVersion = "2.0.1"
val developmentVersion = "2.0-SNAPSHOT" val developmentVersion = "2.1-SNAPSHOT"
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion

View File

@@ -28,7 +28,7 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
} }
dependencies { dependencies {
add( "java9Compile", sourceSets.main.get().output ) add( "java9Implementation", sourceSets.main.get().output )
} }
tasks { tasks {

View File

@@ -63,11 +63,9 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
jar { jar {
manifest.attributes( "Multi-Release" to "true" ) manifest.attributes( "Multi-Release" to "true" )
into( "META-INF/versions/9" ) {
from( sourceSets["module-info"].output ) { from( sourceSets["module-info"].output ) {
include( "module-info.class" ) include( "module-info.class" )
} }
} }
} }
} }
}

View File

@@ -1,5 +1,5 @@
#Signature file v4.1 #Signature file v4.1
#Version 1.6 #Version 2.0
CLSS public abstract interface com.formdev.flatlaf.FlatClientProperties CLSS public abstract interface com.formdev.flatlaf.FlatClientProperties
fld public final static java.lang.String BUTTON_TYPE = "JButton.buttonType" fld public final static java.lang.String BUTTON_TYPE = "JButton.buttonType"
@@ -31,6 +31,8 @@ fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ALWAYS = "al
fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_NEVER = "never" fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_NEVER = "never"
fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ONCE = "once" fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ONCE = "once"
fld public final static java.lang.String SQUARE_SIZE = "JButton.squareSize" fld public final static java.lang.String SQUARE_SIZE = "JButton.squareSize"
fld public final static java.lang.String STYLE = "FlatLaf.style"
fld public final static java.lang.String STYLE_CLASS = "FlatLaf.styleClass"
fld public final static java.lang.String TABBED_PANE_ALIGN_CENTER = "center" fld public final static java.lang.String TABBED_PANE_ALIGN_CENTER = "center"
fld public final static java.lang.String TABBED_PANE_ALIGN_FILL = "fill" fld public final static java.lang.String TABBED_PANE_ALIGN_FILL = "fill"
fld public final static java.lang.String TABBED_PANE_ALIGN_LEADING = "leading" fld public final static java.lang.String TABBED_PANE_ALIGN_LEADING = "leading"
@@ -59,6 +61,9 @@ fld public final static java.lang.String TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT = "JT
fld public final static java.lang.String TABBED_PANE_TAB_HEIGHT = "JTabbedPane.tabHeight" fld public final static java.lang.String TABBED_PANE_TAB_HEIGHT = "JTabbedPane.tabHeight"
fld public final static java.lang.String TABBED_PANE_TAB_ICON_PLACEMENT = "JTabbedPane.tabIconPlacement" fld public final static java.lang.String TABBED_PANE_TAB_ICON_PLACEMENT = "JTabbedPane.tabIconPlacement"
fld public final static java.lang.String TABBED_PANE_TAB_INSETS = "JTabbedPane.tabInsets" fld public final static java.lang.String TABBED_PANE_TAB_INSETS = "JTabbedPane.tabInsets"
fld public final static java.lang.String TABBED_PANE_TAB_TYPE = "JTabbedPane.tabType"
fld public final static java.lang.String TABBED_PANE_TAB_TYPE_CARD = "card"
fld public final static java.lang.String TABBED_PANE_TAB_TYPE_UNDERLINED = "underlined"
fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE = "JTabbedPane.tabWidthMode" fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE = "JTabbedPane.tabWidthMode"
fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_COMPACT = "compact" fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_COMPACT = "compact"
fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_EQUAL = "equal" fld public final static java.lang.String TABBED_PANE_TAB_WIDTH_MODE_EQUAL = "equal"
@@ -67,12 +72,20 @@ fld public final static java.lang.String TABBED_PANE_TRAILING_COMPONENT = "JTabb
fld public final static java.lang.String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground" fld public final static java.lang.String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground"
fld public final static java.lang.String TAB_BUTTON_UNDERLINE_COLOR = "JToggleButton.tab.underlineColor" fld public final static java.lang.String TAB_BUTTON_UNDERLINE_COLOR = "JToggleButton.tab.underlineColor"
fld public final static java.lang.String TAB_BUTTON_UNDERLINE_HEIGHT = "JToggleButton.tab.underlineHeight" fld public final static java.lang.String TAB_BUTTON_UNDERLINE_HEIGHT = "JToggleButton.tab.underlineHeight"
fld public final static java.lang.String TEXT_FIELD_CLEAR_CALLBACK = "JTextField.clearCallback"
fld public final static java.lang.String TEXT_FIELD_LEADING_COMPONENT = "JTextField.leadingComponent"
fld public final static java.lang.String TEXT_FIELD_LEADING_ICON = "JTextField.leadingIcon"
fld public final static java.lang.String TEXT_FIELD_PADDING = "JTextField.padding" fld public final static java.lang.String TEXT_FIELD_PADDING = "JTextField.padding"
fld public final static java.lang.String TEXT_FIELD_SHOW_CLEAR_BUTTON = "JTextField.showClearButton"
fld public final static java.lang.String TEXT_FIELD_TRAILING_COMPONENT = "JTextField.trailingComponent"
fld public final static java.lang.String TEXT_FIELD_TRAILING_ICON = "JTextField.trailingIcon"
fld public final static java.lang.String TITLE_BAR_BACKGROUND = "JRootPane.titleBarBackground" fld public final static java.lang.String TITLE_BAR_BACKGROUND = "JRootPane.titleBarBackground"
fld public final static java.lang.String TITLE_BAR_FOREGROUND = "JRootPane.titleBarForeground" fld public final static java.lang.String TITLE_BAR_FOREGROUND = "JRootPane.titleBarForeground"
fld public final static java.lang.String TITLE_BAR_SHOW_ICON = "JRootPane.titleBarShowIcon"
fld public final static java.lang.String TREE_PAINT_SELECTION = "JTree.paintSelection" fld public final static java.lang.String TREE_PAINT_SELECTION = "JTree.paintSelection"
fld public final static java.lang.String TREE_WIDE_SELECTION = "JTree.wideSelection" fld public final static java.lang.String TREE_WIDE_SELECTION = "JTree.wideSelection"
fld public final static java.lang.String USE_WINDOW_DECORATIONS = "JRootPane.useWindowDecorations" fld public final static java.lang.String USE_WINDOW_DECORATIONS = "JRootPane.useWindowDecorations"
meth public static <%0 extends java.lang.Object> {%%0} clientProperty(javax.swing.JComponent,java.lang.String,{%%0},java.lang.Class<{%%0}>)
meth public static boolean clientPropertyBoolean(javax.swing.JComponent,java.lang.String,boolean) meth public static boolean clientPropertyBoolean(javax.swing.JComponent,java.lang.String,boolean)
meth public static boolean clientPropertyEquals(javax.swing.JComponent,java.lang.String,java.lang.Object) meth public static boolean clientPropertyEquals(javax.swing.JComponent,java.lang.String,java.lang.Object)
meth public static int clientPropertyInt(javax.swing.JComponent,java.lang.String,int) meth public static int clientPropertyInt(javax.swing.JComponent,java.lang.String,int)
@@ -165,6 +178,7 @@ meth public boolean isSupportedLookAndFeel()
meth public final boolean equals(java.lang.Object) meth public final boolean equals(java.lang.Object)
meth public final int hashCode() meth public final int hashCode()
meth public java.lang.String getID() meth public java.lang.String getID()
meth public java.util.Map<java.lang.String,java.lang.String> getExtraDefaults()
meth public javax.swing.Icon getDisabledIcon(javax.swing.JComponent,javax.swing.Icon) meth public javax.swing.Icon getDisabledIcon(javax.swing.JComponent,javax.swing.Icon)
meth public javax.swing.UIDefaults getDefaults() meth public javax.swing.UIDefaults getDefaults()
meth public static boolean install(javax.swing.LookAndFeel) meth public static boolean install(javax.swing.LookAndFeel)
@@ -174,6 +188,8 @@ meth public static boolean isShowMnemonics()
meth public static boolean isUseNativeWindowDecorations() meth public static boolean isUseNativeWindowDecorations()
meth public static boolean setup(javax.swing.LookAndFeel) meth public static boolean setup(javax.swing.LookAndFeel)
meth public static boolean supportsNativeWindowDecorations() meth public static boolean supportsNativeWindowDecorations()
meth public static java.lang.Object parseDefaultsValue(java.lang.String,java.lang.String,java.lang.Class<?>)
meth public static java.util.Map<java.lang.String,java.lang.String> getGlobalExtraDefaults()
meth public static javax.swing.UIDefaults$ActiveValue createActiveFontValue(float) meth public static javax.swing.UIDefaults$ActiveValue createActiveFontValue(float)
meth public static void hideMnemonics() meth public static void hideMnemonics()
meth public static void initIconColors(javax.swing.UIDefaults,boolean) meth public static void initIconColors(javax.swing.UIDefaults,boolean)
@@ -181,22 +197,26 @@ meth public static void installLafInfo(java.lang.String,java.lang.Class<? extend
meth public static void registerCustomDefaultsSource(java.io.File) meth public static void registerCustomDefaultsSource(java.io.File)
meth public static void registerCustomDefaultsSource(java.lang.String) meth public static void registerCustomDefaultsSource(java.lang.String)
meth public static void registerCustomDefaultsSource(java.lang.String,java.lang.ClassLoader) meth public static void registerCustomDefaultsSource(java.lang.String,java.lang.ClassLoader)
meth public static void registerCustomDefaultsSource(java.net.URL)
meth public static void repaintAllFramesAndDialogs() meth public static void repaintAllFramesAndDialogs()
meth public static void revalidateAndRepaintAllFramesAndDialogs() meth public static void revalidateAndRepaintAllFramesAndDialogs()
meth public static void runWithUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>,java.lang.Runnable) meth public static void runWithUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>,java.lang.Runnable)
meth public static void setGlobalExtraDefaults(java.util.Map<java.lang.String,java.lang.String>)
meth public static void setUseNativeWindowDecorations(boolean) meth public static void setUseNativeWindowDecorations(boolean)
meth public static void showMnemonics(java.awt.Component) meth public static void showMnemonics(java.awt.Component)
meth public static void unregisterCustomDefaultsSource(java.io.File) meth public static void unregisterCustomDefaultsSource(java.io.File)
meth public static void unregisterCustomDefaultsSource(java.lang.String) meth public static void unregisterCustomDefaultsSource(java.lang.String)
meth public static void unregisterCustomDefaultsSource(java.lang.String,java.lang.ClassLoader) meth public static void unregisterCustomDefaultsSource(java.lang.String,java.lang.ClassLoader)
meth public static void unregisterCustomDefaultsSource(java.net.URL)
meth public static void updateUI() meth public static void updateUI()
meth public static void updateUILater() meth public static void updateUILater()
meth public void initialize() meth public void initialize()
meth public void registerUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>) meth public void registerUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>)
meth public void setExtraDefaults(java.util.Map<java.lang.String,java.lang.String>)
meth public void uninitialize() meth public void uninitialize()
meth public void unregisterUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>) meth public void unregisterUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>)
supr javax.swing.plaf.basic.BasicLookAndFeel supr javax.swing.plaf.basic.BasicLookAndFeel
hfds DESKTOPFONTHINTS,aquaLoaded,customDefaultsSources,desktopPropertyListener,desktopPropertyName,desktopPropertyName2,mnemonicHandler,oldPopupFactory,postInitialization,uiDefaultsGetters,updateUIPending hfds DESKTOPFONTHINTS,aquaLoaded,customDefaultsSources,desktopPropertyListener,desktopPropertyName,desktopPropertyName2,extraDefaults,globalExtraDefaults,mnemonicHandler,oldPopupFactory,postInitialization,uiDefaultsGetters,updateUIPending
hcls ActiveFont,FlatUIDefaults,ImageIconUIResource hcls ActiveFont,FlatUIDefaults,ImageIconUIResource
CLSS public abstract interface static com.formdev.flatlaf.FlatLaf$DisabledIconProvider CLSS public abstract interface static com.formdev.flatlaf.FlatLaf$DisabledIconProvider
@@ -231,6 +251,7 @@ hfds baseTheme,dark,name,properties
CLSS public abstract interface com.formdev.flatlaf.FlatSystemProperties CLSS public abstract interface com.formdev.flatlaf.FlatSystemProperties
fld public final static java.lang.String ANIMATION = "flatlaf.animation" fld public final static java.lang.String ANIMATION = "flatlaf.animation"
fld public final static java.lang.String MENUBAR_EMBEDDED = "flatlaf.menuBarEmbedded" fld public final static java.lang.String MENUBAR_EMBEDDED = "flatlaf.menuBarEmbedded"
fld public final static java.lang.String NATIVE_LIBRARY_PATH = "flatlaf.nativeLibraryPath"
fld public final static java.lang.String UI_SCALE = "flatlaf.uiScale" fld public final static java.lang.String UI_SCALE = "flatlaf.uiScale"
fld public final static java.lang.String UI_SCALE_ALLOW_SCALE_DOWN = "flatlaf.uiScale.allowScaleDown" fld public final static java.lang.String UI_SCALE_ALLOW_SCALE_DOWN = "flatlaf.uiScale.allowScaleDown"
fld public final static java.lang.String UI_SCALE_ENABLED = "flatlaf.uiScale.enabled" fld public final static java.lang.String UI_SCALE_ENABLED = "flatlaf.uiScale.enabled"
@@ -330,7 +351,15 @@ innr public static HSLIncreaseDecrease
innr public static Mix innr public static Mix
meth public !varargs static java.awt.Color applyFunctions(java.awt.Color,com.formdev.flatlaf.util.ColorFunctions$ColorFunction[]) meth public !varargs static java.awt.Color applyFunctions(java.awt.Color,com.formdev.flatlaf.util.ColorFunctions$ColorFunction[])
meth public static float clamp(float) meth public static float clamp(float)
meth public static float luma(java.awt.Color)
meth public static java.awt.Color darken(java.awt.Color,float)
meth public static java.awt.Color desaturate(java.awt.Color,float)
meth public static java.awt.Color lighten(java.awt.Color,float)
meth public static java.awt.Color mix(java.awt.Color,java.awt.Color,float) meth public static java.awt.Color mix(java.awt.Color,java.awt.Color,float)
meth public static java.awt.Color saturate(java.awt.Color,float)
meth public static java.awt.Color shade(java.awt.Color,float)
meth public static java.awt.Color spin(java.awt.Color,float)
meth public static java.awt.Color tint(java.awt.Color,float)
supr java.lang.Object supr java.lang.Object
CLSS public abstract interface static com.formdev.flatlaf.util.ColorFunctions$ColorFunction CLSS public abstract interface static com.formdev.flatlaf.util.ColorFunctions$ColorFunction
@@ -566,6 +595,7 @@ meth public static java.util.List<java.awt.Image> getResolutionVariants(java.awt
supr java.lang.Object supr java.lang.Object
CLSS public com.formdev.flatlaf.util.NativeLibrary CLSS public com.formdev.flatlaf.util.NativeLibrary
cons public init(java.io.File,boolean)
cons public init(java.lang.String,java.lang.ClassLoader,boolean) cons public init(java.lang.String,java.lang.ClassLoader,boolean)
meth public boolean isLoaded() meth public boolean isLoaded()
supr java.lang.Object supr java.lang.Object
@@ -589,18 +619,52 @@ meth public void paintIcon(java.awt.Component,java.awt.Graphics,int,int)
supr java.lang.Object supr java.lang.Object
hfds iconHeight,iconWidth,imageIcon,lastImage,lastSystemScaleFactor,lastUserScaleFactor hfds iconHeight,iconWidth,imageIcon,lastImage,lastSystemScaleFactor,lastUserScaleFactor
CLSS public com.formdev.flatlaf.util.SoftCache<%0 extends java.lang.Object, %1 extends java.lang.Object>
cons public init()
cons public init(int)
intf java.util.Map<{com.formdev.flatlaf.util.SoftCache%0},{com.formdev.flatlaf.util.SoftCache%1}>
meth public boolean containsKey(java.lang.Object)
meth public boolean containsValue(java.lang.Object)
meth public boolean isEmpty()
meth public int size()
meth public java.util.Collection<{com.formdev.flatlaf.util.SoftCache%1}> values()
meth public java.util.Set<java.util.Map$Entry<{com.formdev.flatlaf.util.SoftCache%0},{com.formdev.flatlaf.util.SoftCache%1}>> entrySet()
meth public java.util.Set<{com.formdev.flatlaf.util.SoftCache%0}> keySet()
meth public void clear()
meth public void forEach(java.util.function.BiConsumer<? super {com.formdev.flatlaf.util.SoftCache%0},? super {com.formdev.flatlaf.util.SoftCache%1}>)
meth public void putAll(java.util.Map<? extends {com.formdev.flatlaf.util.SoftCache%0},? extends {com.formdev.flatlaf.util.SoftCache%1}>)
meth public void replaceAll(java.util.function.BiFunction<? super {com.formdev.flatlaf.util.SoftCache%0},? super {com.formdev.flatlaf.util.SoftCache%1},? extends {com.formdev.flatlaf.util.SoftCache%1}>)
meth public {com.formdev.flatlaf.util.SoftCache%1} get(java.lang.Object)
meth public {com.formdev.flatlaf.util.SoftCache%1} put({com.formdev.flatlaf.util.SoftCache%0},{com.formdev.flatlaf.util.SoftCache%1})
meth public {com.formdev.flatlaf.util.SoftCache%1} remove(java.lang.Object)
supr java.lang.Object
hfds map,queue
hcls CacheReference
CLSS public com.formdev.flatlaf.util.StringUtils CLSS public com.formdev.flatlaf.util.StringUtils
cons public init() cons public init()
meth public static boolean isEmpty(java.lang.String) meth public static boolean isEmpty(java.lang.String)
meth public static boolean isTrimmedEmpty(java.lang.String)
meth public static java.lang.String removeLeading(java.lang.String,java.lang.String) meth public static java.lang.String removeLeading(java.lang.String,java.lang.String)
meth public static java.lang.String removeTrailing(java.lang.String,java.lang.String) meth public static java.lang.String removeTrailing(java.lang.String,java.lang.String)
meth public static java.lang.String substringTrimmed(java.lang.String,int)
meth public static java.lang.String substringTrimmed(java.lang.String,int,int)
meth public static java.util.List<java.lang.String> split(java.lang.String,char) meth public static java.util.List<java.lang.String> split(java.lang.String,char)
meth public static java.util.List<java.lang.String> split(java.lang.String,char,boolean,boolean)
supr java.lang.Object
CLSS public com.formdev.flatlaf.util.SwingUtils
cons public init()
meth public static <%0 extends java.awt.Component> {%%0} getComponentByName(java.awt.Container,java.lang.String)
supr java.lang.Object supr java.lang.Object
CLSS public com.formdev.flatlaf.util.SystemInfo CLSS public com.formdev.flatlaf.util.SystemInfo
cons public init() cons public init()
fld public final static boolean isAARCH64
fld public final static boolean isJava_11_orLater fld public final static boolean isJava_11_orLater
fld public final static boolean isJava_15_orLater fld public final static boolean isJava_15_orLater
fld public final static boolean isJava_17_orLater
fld public final static boolean isJava_18_orLater
fld public final static boolean isJava_9_orLater fld public final static boolean isJava_9_orLater
fld public final static boolean isJetBrainsJVM fld public final static boolean isJetBrainsJVM
fld public final static boolean isJetBrainsJVM_11_orLater fld public final static boolean isJetBrainsJVM_11_orLater
@@ -615,6 +679,8 @@ fld public final static boolean isWebswing
fld public final static boolean isWinPE fld public final static boolean isWinPE
fld public final static boolean isWindows fld public final static boolean isWindows
fld public final static boolean isWindows_10_orLater fld public final static boolean isWindows_10_orLater
fld public final static boolean isWindows_11_orLater
fld public final static boolean isX86
fld public final static boolean isX86_64 fld public final static boolean isX86_64
fld public final static long javaVersion fld public final static long javaVersion
fld public final static long osVersion fld public final static long osVersion
@@ -627,6 +693,7 @@ cons public init()
meth public static boolean isSystemScalingEnabled() meth public static boolean isSystemScalingEnabled()
meth public static double getSystemScaleFactor(java.awt.Graphics2D) meth public static double getSystemScaleFactor(java.awt.Graphics2D)
meth public static double getSystemScaleFactor(java.awt.GraphicsConfiguration) meth public static double getSystemScaleFactor(java.awt.GraphicsConfiguration)
meth public static float computeFontScaleFactor(java.awt.Font)
meth public static float getUserScaleFactor() meth public static float getUserScaleFactor()
meth public static float scale(float) meth public static float scale(float)
meth public static float unscale(float) meth public static float unscale(float)
@@ -933,6 +1000,34 @@ CLSS public abstract interface !annotation java.lang.annotation.Target
intf java.lang.annotation.Annotation intf java.lang.annotation.Annotation
meth public abstract java.lang.annotation.ElementType[] value() meth public abstract java.lang.annotation.ElementType[] value()
CLSS public abstract interface java.util.Map<%0 extends java.lang.Object, %1 extends java.lang.Object>
innr public abstract interface static Entry
meth public abstract boolean containsKey(java.lang.Object)
meth public abstract boolean containsValue(java.lang.Object)
meth public abstract boolean equals(java.lang.Object)
meth public abstract boolean isEmpty()
meth public abstract int hashCode()
meth public abstract int size()
meth public abstract java.util.Collection<{java.util.Map%1}> values()
meth public abstract java.util.Set<java.util.Map$Entry<{java.util.Map%0},{java.util.Map%1}>> entrySet()
meth public abstract java.util.Set<{java.util.Map%0}> keySet()
meth public abstract void clear()
meth public abstract void putAll(java.util.Map<? extends {java.util.Map%0},? extends {java.util.Map%1}>)
meth public abstract {java.util.Map%1} get(java.lang.Object)
meth public abstract {java.util.Map%1} put({java.util.Map%0},{java.util.Map%1})
meth public abstract {java.util.Map%1} remove(java.lang.Object)
meth public boolean remove(java.lang.Object,java.lang.Object)
meth public boolean replace({java.util.Map%0},{java.util.Map%1},{java.util.Map%1})
meth public void forEach(java.util.function.BiConsumer<? super {java.util.Map%0},? super {java.util.Map%1}>)
meth public void replaceAll(java.util.function.BiFunction<? super {java.util.Map%0},? super {java.util.Map%1},? extends {java.util.Map%1}>)
meth public {java.util.Map%1} compute({java.util.Map%0},java.util.function.BiFunction<? super {java.util.Map%0},? super {java.util.Map%1},? extends {java.util.Map%1}>)
meth public {java.util.Map%1} computeIfAbsent({java.util.Map%0},java.util.function.Function<? super {java.util.Map%0},? extends {java.util.Map%1}>)
meth public {java.util.Map%1} computeIfPresent({java.util.Map%0},java.util.function.BiFunction<? super {java.util.Map%0},? super {java.util.Map%1},? extends {java.util.Map%1}>)
meth public {java.util.Map%1} getOrDefault(java.lang.Object,{java.util.Map%1})
meth public {java.util.Map%1} merge({java.util.Map%0},{java.util.Map%1},java.util.function.BiFunction<? super {java.util.Map%1},? super {java.util.Map%1},? extends {java.util.Map%1}>)
meth public {java.util.Map%1} putIfAbsent({java.util.Map%0},{java.util.Map%1})
meth public {java.util.Map%1} replace({java.util.Map%0},{java.util.Map%1})
CLSS public abstract interface javax.swing.Icon CLSS public abstract interface javax.swing.Icon
meth public abstract int getIconHeight() meth public abstract int getIconHeight()
meth public abstract int getIconWidth() meth public abstract int getIconWidth()

View File

@@ -874,7 +874,26 @@ public interface FlatClientProperties
* The component should be not opaque because the text field border is painted * The component should be not opaque because the text field border is painted
* slightly inside the usually visible border in some cases. * slightly inside the usually visible border in some cases.
* E.g. when focused (in some themes) or when an outline color is specified * E.g. when focused (in some themes) or when an outline color is specified
* (see {@link #OUTLINE}. * (see {@link #OUTLINE}).
* <p>
* The component is prepared in the following way:
* <ul>
* <li>Component client property {@link #STYLE_CLASS} is set to {@code inTextField}.
* <li>If component is a button or toggle button, client property {@link #BUTTON_TYPE}
* is set to {@link #BUTTON_TYPE_TOOLBAR_BUTTON}
* and button cursor is set to default cursor (if not set).
* <li>If component is a toolbar, client property {@link #STYLE_CLASS}
* is set to {@code inTextField} on all toolbar children
* and toolbar cursor is set to default cursor (if not set).
* </ul>
* Because text fields use the text cursor by default and the cursor is inherited by child components,
* it may be necessary to explicitly set component cursor if you e.g. need the default arrow cursor.
* E.g. {@code comp.setCursor( Cursor.getDefaultCursor() )}.
* <p>
* Styling is used to modify insets/margins and appearance of buttons and toolbars
* so that they fit nicely into the text field and do not increase text field height.
* See styles {@code [style]Button.inTextField} and {@code [style]ToolBar.inTextField}
* in {@code Flat[Light|Dark]Laf.properties}.
* <p> * <p>
* <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses)<br> * <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses)<br>
* <strong>Value type</strong> {@link javax.swing.JComponent} * <strong>Value type</strong> {@link javax.swing.JComponent}
@@ -886,15 +905,7 @@ public interface FlatClientProperties
/** /**
* Specifies a component that will be placed at the trailing edge of the text field. * Specifies a component that will be placed at the trailing edge of the text field.
* <p> * <p>
* The component will be positioned inside and aligned to the visible text field border. * See {@link #TEXT_FIELD_LEADING_COMPONENT} for details.
* There is no gap between the visible border and the component.
* The laid out component size will be the preferred component width
* and the inner text field height.
* <p>
* The component should be not opaque because the text field border is painted
* slightly inside the usually visible border in some cases.
* E.g. when focused (in some themes) or when an outline color is specified
* (see {@link #OUTLINE}.
* <p> * <p>
* <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses)<br> * <strong>Component</strong> {@link javax.swing.JTextField} (and subclasses)<br>
* <strong>Value type</strong> {@link javax.swing.JComponent} * <strong>Value type</strong> {@link javax.swing.JComponent}

View File

@@ -1223,6 +1223,9 @@ public abstract class FlatLaf
} }
private Object getValue( Object key ) { private Object getValue( Object key ) {
// use local variable for getters to avoid potential multi-threading issues
List<Function<Object, Object>> uiDefaultsGetters = FlatLaf.this.uiDefaultsGetters;
if( uiDefaultsGetters == null ) if( uiDefaultsGetters == null )
return null; return null;
@@ -1276,8 +1279,9 @@ public abstract class FlatLaf
this.scaleSize = scaleSize; this.scaleSize = scaleSize;
} }
// using synchronized to avoid exception if invoked at the same time on multiple threads
@Override @Override
public Object createValue( UIDefaults table ) { public synchronized Object createValue( UIDefaults table ) {
if( inCreateValue ) if( inCreateValue )
throw new IllegalStateException( "FlatLaf: endless recursion in font" ); throw new IllegalStateException( "FlatLaf: endless recursion in font" );

View File

@@ -81,7 +81,7 @@ public interface FlatSystemProperties
* {@link FlatClientProperties#USE_WINDOW_DECORATIONS} and * {@link FlatClientProperties#USE_WINDOW_DECORATIONS} and
* UI default {@code TitlePane.useWindowDecorations}. * UI default {@code TitlePane.useWindowDecorations}.
* <p> * <p>
* (requires Window 10) * (requires Window 10/11)
* <p> * <p>
* <strong>Allowed Values</strong> {@code false} and {@code true}<br> * <strong>Allowed Values</strong> {@code false} and {@code true}<br>
* <strong>Default</strong> none * <strong>Default</strong> none
@@ -92,16 +92,16 @@ public interface FlatSystemProperties
* Specifies whether JetBrains Runtime custom window decorations should be used * Specifies whether JetBrains Runtime custom window decorations should be used
* when creating {@code JFrame} or {@code JDialog}. * when creating {@code JFrame} or {@code JDialog}.
* Requires that the application runs in a * Requires that the application runs in a
* <a href="https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime">JetBrains Runtime</a> * <a href="https://github.com/JetBrains/JetBrainsRuntime/wiki">JetBrains Runtime</a>
* (based on OpenJDK). * (based on OpenJDK).
* <p> * <p>
* Setting this to {@code false} disables using JetBrains Runtime custom window decorations. * Setting this to {@code false} disables using JetBrains Runtime custom window decorations.
* Then FlatLaf native window decorations are used. * Then FlatLaf native window decorations are used.
* <p> * <p>
* (requires Window 10) * (requires Window 10/11)
* <p> * <p>
* <strong>Allowed Values</strong> {@code false} and {@code true}<br> * <strong>Allowed Values</strong> {@code false} and {@code true}<br>
* <strong>Default</strong> {@code true} * <strong>Default</strong> {@code false} (since v2; was {@code true} in v1)
*/ */
String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations"; String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations";
@@ -116,7 +116,7 @@ public interface FlatSystemProperties
* {@link FlatClientProperties#MENU_BAR_EMBEDDED} and * {@link FlatClientProperties#MENU_BAR_EMBEDDED} and
* UI default {@code TitlePane.menuBarEmbedded}. * UI default {@code TitlePane.menuBarEmbedded}.
* <p> * <p>
* (requires Window 10) * (requires Window 10/11)
* <p> * <p>
* <strong>Allowed Values</strong> {@code false} and {@code true}<br> * <strong>Allowed Values</strong> {@code false} and {@code true}<br>
* <strong>Default</strong> none * <strong>Default</strong> none
@@ -139,6 +139,15 @@ public interface FlatSystemProperties
*/ */
String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection"; String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection";
/**
* Specifies a directory in which the native FlatLaf library have been extracted.
* The path can be absolute or relative to current application working directory.
* This can be used to avoid extraction of the native libraries to the temporary directory at runtime.
*
* @since 2
*/
String NATIVE_LIBRARY_PATH = "flatlaf.nativeLibraryPath";
/** /**
* Checks whether a system property is set and returns {@code true} if its value * Checks whether a system property is set and returns {@code true} if its value
* is {@code "true"} (case-insensitive), otherwise it returns {@code false}. * is {@code "true"} (case-insensitive), otherwise it returns {@code false}.

View File

@@ -902,21 +902,32 @@ class UIDefaultsLoader
* Syntax: fade(color,amount[,options]) * Syntax: fade(color,amount[,options])
* - color: a color (e.g. #f00) or a color function * - color: a color (e.g. #f00) or a color function
* - amount: percentage 0-100% * - amount: percentage 0-100%
* - options: [derived] * - options: [derived] [lazy]
*/ */
private static Object parseColorFade( List<String> params, Function<String, String> resolver, boolean reportError ) { private static Object parseColorFade( List<String> params, Function<String, String> resolver, boolean reportError ) {
String colorStr = params.get( 0 ); String colorStr = params.get( 0 );
int amount = parsePercentage( params.get( 1 ) ); int amount = parsePercentage( params.get( 1 ) );
boolean derived = false; boolean derived = false;
boolean lazy = false;
if( params.size() > 2 ) { if( params.size() > 2 ) {
String options = params.get( 2 ); String options = params.get( 2 );
derived = options.contains( "derived" ); derived = options.contains( "derived" );
lazy = options.contains( "lazy" );
} }
// create function // create function
ColorFunction function = new ColorFunctions.Fade( amount ); ColorFunction function = new ColorFunctions.Fade( amount );
if( lazy ) {
return (LazyValue) t -> {
Object color = lazyUIManagerGet( colorStr );
return (color instanceof Color)
? new ColorUIResource( ColorFunctions.applyFunctions( (Color) color, function ) )
: null;
};
}
// parse base color, apply function and create derived color // parse base color, apply function and create derived color
return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError ); return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError );
} }

View File

@@ -20,6 +20,7 @@ import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
@@ -65,8 +66,14 @@ public abstract class FlatWindowAbstractIcon
protected void paintBackground( Component c, Graphics2D g ) { protected void paintBackground( Component c, Graphics2D g ) {
Color background = FlatButtonUI.buttonStateColor( c, null, null, null, hoverBackground, pressedBackground ); Color background = FlatButtonUI.buttonStateColor( c, null, null, null, hoverBackground, pressedBackground );
if( background != null ) { if( background != null ) {
// disable antialiasing for background rectangle painting to avoid blury edges when scaled (e.g. at 125% or 175%)
Object oldHint = g.getRenderingHint( RenderingHints.KEY_ANTIALIASING );
g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF );
g.setColor( FlatUIUtils.deriveColor( background, c.getBackground() ) ); g.setColor( FlatUIUtils.deriveColor( background, c.getBackground() ) );
g.fillRect( 0, 0, width, height ); g.fillRect( 0, 0, width, height );
g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, oldHint );
} }
} }

View File

@@ -24,6 +24,7 @@ import java.awt.geom.Line2D;
import java.awt.geom.Path2D; import java.awt.geom.Path2D;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.util.SystemInfo;
/** /**
* "close" icon for windows (frames and dialogs). * "close" icon for windows (frames and dialogs).
@@ -54,7 +55,7 @@ public class FlatWindowCloseIcon
int iy = y + ((height - iwh) / 2); int iy = y + ((height - iwh) / 2);
int ix2 = ix + iwh - 1; int ix2 = ix + iwh - 1;
int iy2 = iy + iwh - 1; int iy2 = iy + iwh - 1;
int thickness = (int) scaleFactor; float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor;
Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD );
path.append( new Line2D.Float( ix, iy, ix2, iy2 ), false ); path.append( new Line2D.Float( ix, iy, ix2, iy2 ), false );

View File

@@ -18,6 +18,7 @@ package com.formdev.flatlaf.icons;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.SystemInfo;
/** /**
* "maximize" icon for windows (frames and dialogs). * "maximize" icon for windows (frames and dialogs).
@@ -35,8 +36,11 @@ public class FlatWindowMaximizeIcon
int iwh = (int) (10 * scaleFactor); int iwh = (int) (10 * scaleFactor);
int ix = x + ((width - iwh) / 2); int ix = x + ((width - iwh) / 2);
int iy = y + ((height - iwh) / 2); int iy = y + ((height - iwh) / 2);
int thickness = (int) scaleFactor; float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor;
int arc = Math.max( (int) (1.5 * scaleFactor), 2 );
g.fill( FlatUIUtils.createRectangle( ix, iy, iwh, iwh, thickness ) ); g.fill( SystemInfo.isWindows_11_orLater
? FlatUIUtils.createRoundRectangle( ix, iy, iwh, iwh, thickness, arc, arc, arc, arc )
: FlatUIUtils.createRectangle( ix, iy, iwh, iwh, thickness ) );
} }
} }

View File

@@ -21,6 +21,7 @@ import java.awt.geom.Area;
import java.awt.geom.Path2D; import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.SystemInfo;
/** /**
* "restore" icon for windows (frames and dialogs). * "restore" icon for windows (frames and dialogs).
@@ -38,18 +39,33 @@ public class FlatWindowRestoreIcon
int iwh = (int) (10 * scaleFactor); int iwh = (int) (10 * scaleFactor);
int ix = x + ((width - iwh) / 2); int ix = x + ((width - iwh) / 2);
int iy = y + ((height - iwh) / 2); int iy = y + ((height - iwh) / 2);
int thickness = (int) scaleFactor; float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor;
int arc = Math.max( (int) (1.5 * scaleFactor), 2 );
int arcOuter = (int) (arc + (1.5 * scaleFactor));
int rwh = (int) (8 * scaleFactor); int rwh = (int) (8 * scaleFactor);
int ro2 = iwh - rwh; int ro2 = iwh - rwh;
Path2D r1 = FlatUIUtils.createRectangle( ix + ro2, iy, rwh, rwh, thickness ); // upper-right rectangle
Path2D r2 = FlatUIUtils.createRectangle( ix, iy + ro2, rwh, rwh, thickness ); Path2D r1 = SystemInfo.isWindows_11_orLater
? FlatUIUtils.createRoundRectangle( ix + ro2, iy, rwh, rwh, thickness, arc, arcOuter, arc, arc )
: FlatUIUtils.createRectangle( ix + ro2, iy, rwh, rwh, thickness );
// lower-left rectangle
Path2D r2 = SystemInfo.isWindows_11_orLater
? FlatUIUtils.createRoundRectangle( ix, iy + ro2, rwh, rwh, thickness, arc, arc, arc, arc )
: FlatUIUtils.createRectangle( ix, iy + ro2, rwh, rwh, thickness );
// paint upper-right rectangle
Area area = new Area( r1 ); Area area = new Area( r1 );
if( SystemInfo.isWindows_11_orLater ) {
area.subtract( new Area( new Rectangle2D.Float( ix, (float) (iy + scaleFactor), rwh, rwh ) ) );
area.subtract( new Area( new Rectangle2D.Float( (float) (ix + scaleFactor), iy + ro2, rwh, rwh ) ) );
} else
area.subtract( new Area( new Rectangle2D.Float( ix, iy + ro2, rwh, rwh ) ) ); area.subtract( new Area( new Rectangle2D.Float( ix, iy + ro2, rwh, rwh ) ) );
g.fill( area ); g.fill( area );
// paint lower-left rectangle
g.fill( r2 ); g.fill( r2 );
} }
} }

View File

@@ -38,15 +38,18 @@ import javax.swing.ButtonModel;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JTextField;
import javax.swing.JToggleButton; import javax.swing.JToggleButton;
import javax.swing.JToolBar; import javax.swing.JToolBar;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ButtonUI; import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource; import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicButtonListener; import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.basic.BasicButtonUI; import javax.swing.plaf.basic.BasicButtonUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.icons.FlatHelpButtonIcon; import com.formdev.flatlaf.icons.FlatHelpButtonIcon;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
@@ -420,11 +423,21 @@ public class FlatButtonUI
try { try {
FlatUIUtils.setRenderingHints( g2 ); FlatUIUtils.setRenderingHints( g2 );
boolean def = isDefaultButton( c );
boolean isToolBarButton = isToolBarButton( c ); boolean isToolBarButton = isToolBarButton( c );
float focusWidth = isToolBarButton ? 0 : FlatUIUtils.getBorderFocusWidth( c ); float focusWidth = isToolBarButton ? 0 : FlatUIUtils.getBorderFocusWidth( c );
float arc = FlatUIUtils.getBorderArc( c ); float arc = FlatUIUtils.getBorderArc( c );
float textFieldArc = 0;
boolean def = isDefaultButton( c ); // if toolbar button is in leading/trailing component of a text field,
// increase toolbar button arc to match text field arc (if necessary)
if( isToolBarButton &&
FlatClientProperties.clientProperty( c, STYLE_CLASS, "", String.class ).contains( "inTextField" ) )
{
JTextField textField = (JTextField) SwingUtilities.getAncestorOfClass( JTextField.class, c );
if( textField != null )
textFieldArc = FlatUIUtils.getBorderArc( textField );
}
int x = 0; int x = 0;
int y = 0; int y = 0;
@@ -437,8 +450,15 @@ public class FlatButtonUI
y += spacing.top; y += spacing.top;
width -= spacing.left + spacing.right; width -= spacing.left + spacing.right;
height -= spacing.top + spacing.bottom; height -= spacing.top + spacing.bottom;
// reduce text field arc
textFieldArc -= spacing.top + spacing.bottom;
} }
// increase toolbar button arc to match text field arc (if necessary)
if( arc < textFieldArc )
arc = textFieldArc;
// paint shadow // paint shadow
Color shadowColor = def ? defaultShadowColor : this.shadowColor; Color shadowColor = def ? defaultShadowColor : this.shadowColor;
if( paintShadow && if( paintShadow &&

View File

@@ -275,7 +275,10 @@ public class FlatFileChooserUI
private boolean doNotUseSystemIcons() { private boolean doNotUseSystemIcons() {
// Java 17 32bit craches on Windows when using system icons // Java 17 32bit craches on Windows when using system icons
return SystemInfo.isWindows && SystemInfo.isJava_17_orLater && !SystemInfo.isX86_64; // fixed in Java 18+ (see https://bugs.openjdk.java.net/browse/JDK-8277299)
return SystemInfo.isWindows &&
SystemInfo.isX86 &&
(SystemInfo.isJava_17_orLater && !SystemInfo.isJava_18_orLater);
} }
//---- class FlatFileView ------------------------------------------------- //---- class FlatFileView -------------------------------------------------

View File

@@ -56,7 +56,7 @@ public class FlatNativeWindowBorder
private static final boolean canUseJBRCustomDecorations = private static final boolean canUseJBRCustomDecorations =
canUseWindowDecorations && canUseWindowDecorations &&
SystemInfo.isJetBrainsJVM_11_orLater && SystemInfo.isJetBrainsJVM_11_orLater &&
FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ); FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, false );
private static Boolean supported; private static Boolean supported;
private static Provider nativeProvider; private static Provider nativeProvider;
@@ -313,6 +313,10 @@ public class FlatNativeWindowBorder
//---- class WindowTopBorder ------------------------------------------- //---- class WindowTopBorder -------------------------------------------
/**
* Window top border used on Windows 10.
* No longer needed since Windows 11.
*/
static class WindowTopBorder static class WindowTopBorder
extends JBRCustomDecorations.JBRWindowTopBorder extends JBRCustomDecorations.JBRWindowTopBorder
{ {

View File

@@ -36,6 +36,7 @@ import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.basic.BasicOptionPaneUI; import javax.swing.plaf.basic.BasicOptionPaneUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.util.SwingUtils;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -156,7 +157,7 @@ public class FlatOptionPaneUI
// set icon-message gap // set icon-message gap
if( iconMessageGap > 0 ) { if( iconMessageGap > 0 ) {
Component iconMessageSeparator = findByName( messageArea, "OptionPane.separator" ); Component iconMessageSeparator = SwingUtils.getComponentByName( messageArea, "OptionPane.separator" );
if( iconMessageSeparator != null ) if( iconMessageSeparator != null )
iconMessageSeparator.setPreferredSize( new Dimension( UIScale.scale( iconMessageGap ), 1 ) ); iconMessageSeparator.setPreferredSize( new Dimension( UIScale.scale( iconMessageGap ), 1 ) );
} }
@@ -236,20 +237,6 @@ public class FlatOptionPaneUI
} }
} }
private Component findByName( Container c, String name ) {
for( Component child : c.getComponents() ) {
if( name.equals( child.getName() ) )
return child;
if( child instanceof Container ) {
Component c2 = findByName( (Container) child, name );
if( c2 != null )
return c2;
}
}
return null;
}
@Override @Override
protected boolean getSizeButtonsToSameWidth() { protected boolean getSizeButtonsToSameWidth() {
return sameSizeButtons; return sameSizeButtons;

View File

@@ -18,12 +18,14 @@ package com.formdev.flatlaf.ui;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.Map; import java.util.Map;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPanelUI; import javax.swing.plaf.basic.BasicPanelUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade; import com.formdev.flatlaf.util.LoggingFacade;
@@ -43,13 +45,12 @@ import com.formdev.flatlaf.util.UIScale;
*/ */
public class FlatPanelUI public class FlatPanelUI
extends BasicPanelUI extends BasicPanelUI
implements StyleableUI implements StyleableUI, PropertyChangeListener
{ {
// only used via styling (not in UI defaults) // only used via styling (not in UI defaults)
/** @since 2 */ @Styleable protected int arc = -1; /** @since 2 */ @Styleable protected int arc = -1;
private final boolean shared; private final boolean shared;
private PropertyChangeListener propertyChangeListener;
private Map<String, Object> oldStyleValues; private Map<String, Object> oldStyleValues;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
@@ -67,9 +68,7 @@ public class FlatPanelUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( c.addPropertyChangeListener( this );
c, () -> stylePropertyChange( (JPanel) c ), null );
c.addPropertyChangeListener( propertyChangeListener );
installStyle( (JPanel) c ); installStyle( (JPanel) c );
} }
@@ -78,13 +77,18 @@ public class FlatPanelUI
public void uninstallUI( JComponent c ) { public void uninstallUI( JComponent c ) {
super.uninstallUI( c ); super.uninstallUI( c );
c.removePropertyChangeListener( propertyChangeListener ); c.removePropertyChangeListener( this );
propertyChangeListener = null;
oldStyleValues = null; oldStyleValues = null;
} }
private void stylePropertyChange( JPanel c ) { /** @since 2.0.1 */
@Override
public void propertyChange( PropertyChangeEvent e ) {
switch( e.getPropertyName() ) {
case FlatClientProperties.STYLE:
case FlatClientProperties.STYLE_CLASS:
JPanel c = (JPanel) e.getSource();
if( shared && FlatStylingSupport.hasStyleProperty( c ) ) { if( shared && FlatStylingSupport.hasStyleProperty( c ) ) {
// unshare component UI if necessary // unshare component UI if necessary
// updateUI() invokes installStyle() from installUI() // updateUI() invokes installStyle() from installUI()
@@ -93,6 +97,8 @@ public class FlatPanelUI
installStyle( c ); installStyle( c );
c.revalidate(); c.revalidate();
c.repaint(); c.repaint();
break;
}
} }
/** @since 2 */ /** @since 2 */

View File

@@ -28,6 +28,7 @@ import javax.swing.Action;
import javax.swing.ActionMap; import javax.swing.ActionMap;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPasswordField;
import javax.swing.JToggleButton; import javax.swing.JToggleButton;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@@ -38,6 +39,7 @@ import javax.swing.text.Element;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import javax.swing.text.PasswordView; import javax.swing.text.PasswordView;
import javax.swing.text.View; import javax.swing.text.View;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.icons.FlatCapsLockIcon; import com.formdev.flatlaf.icons.FlatCapsLockIcon;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -83,6 +85,9 @@ import com.formdev.flatlaf.util.UIScale;
public class FlatPasswordFieldUI public class FlatPasswordFieldUI
extends FlatTextFieldUI extends FlatTextFieldUI
{ {
// used to preserve reveal button state when switching theme
private static final String KEY_REVEAL_SELECTED = "FlatLaf.internal.FlatPasswordFieldUI.revealSelected";
private Character echoChar; private Character echoChar;
@Styleable protected boolean showCapsLock; @Styleable protected boolean showCapsLock;
@@ -93,6 +98,7 @@ public class FlatPasswordFieldUI
private KeyListener capsLockListener; private KeyListener capsLockListener;
private boolean capsLockIconShared = true; private boolean capsLockIconShared = true;
private JToggleButton revealButton; private JToggleButton revealButton;
private boolean uninstallEchoChar;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
return new FlatPasswordFieldUI(); return new FlatPasswordFieldUI();
@@ -269,36 +275,65 @@ public class FlatPasswordFieldUI
if( !showCapsLock ) if( !showCapsLock )
return false; return false;
JTextComponent c = getComponent(); return FlatUIUtils.isPermanentFocusOwner( getComponent() ) &&
return FlatUIUtils.isPermanentFocusOwner( c ) &&
Toolkit.getDefaultToolkit().getLockingKeyState( KeyEvent.VK_CAPS_LOCK ); Toolkit.getDefaultToolkit().getLockingKeyState( KeyEvent.VK_CAPS_LOCK );
} }
/** @since 2 */ /** @since 2 */
protected void installRevealButton() { protected void installRevealButton() {
JTextComponent c = getComponent();
if( showRevealButton ) { if( showRevealButton ) {
revealButton = createRevealButton(); revealButton = createRevealButton();
installLayout(); installLayout();
c.add( revealButton ); getComponent().add( revealButton );
} }
} }
/** @since 2 */ /** @since 2 */
protected JToggleButton createRevealButton() { protected JToggleButton createRevealButton() {
JToggleButton button = new JToggleButton( revealIcon ); JToggleButton button = new JToggleButton( revealIcon );
button.setName( "PasswordField.revealButton" );
prepareLeadingOrTrailingComponent( button ); prepareLeadingOrTrailingComponent( button );
button.putClientProperty( FlatClientProperties.STYLE_CLASS, "inTextField revealButton" );
if( FlatClientProperties.clientPropertyBoolean( getComponent(), KEY_REVEAL_SELECTED, false ) ) {
button.setSelected( true );
updateEchoChar( true );
}
button.addActionListener( e -> { button.addActionListener( e -> {
LookAndFeel.installProperty( getComponent(), "echoChar", button.isSelected() boolean selected = button.isSelected();
? '\0' updateEchoChar( selected );
: (echoChar != null ? echoChar : '*')); getComponent().putClientProperty( KEY_REVEAL_SELECTED, selected );
} ); } );
return button; return button;
} }
private void updateEchoChar( boolean selected ) {
char newEchoChar = selected
? 0
: (echoChar != null ? echoChar : '*');
JPasswordField c = (JPasswordField) getComponent();
LookAndFeel.installProperty( c, "echoChar", newEchoChar );
// check whether was able to set echo char via LookAndFeel.installProperty()
// if not, then echo char was explicitly changed via JPasswordField.setEchoChar()
char actualEchoChar = c.getEchoChar();
if( actualEchoChar != newEchoChar ) {
if( selected && actualEchoChar != 0 ) {
// use explicitly set echo char
echoChar = actualEchoChar;
uninstallEchoChar = true;
}
c.setEchoChar( newEchoChar );
}
}
/** @since 2 */ /** @since 2 */
protected void uninstallRevealButton() { protected void uninstallRevealButton() {
if( revealButton != null ) { if( revealButton != null ) {
if( uninstallEchoChar && revealButton.isSelected() )
((JPasswordField)getComponent()).setEchoChar( echoChar );
getComponent().remove( revealButton ); getComponent().remove( revealButton );
revealButton = null; revealButton = null;
} }

View File

@@ -16,10 +16,12 @@
package com.formdev.flatlaf.ui; package com.formdev.flatlaf.ui;
import java.awt.AWTEvent;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GraphicsConfiguration; import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice; import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
@@ -33,6 +35,7 @@ import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ComponentEvent; import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener; import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import javax.swing.JComponent; import javax.swing.JComponent;
@@ -219,7 +222,7 @@ public class FlatPopupFactory
* and corrects the y-location so that the tooltip is placed above the mouse location. * and corrects the y-location so that the tooltip is placed above the mouse location.
*/ */
private Point fixToolTipLocation( Component owner, Component contents, int x, int y ) { private Point fixToolTipLocation( Component owner, Component contents, int x, int y ) {
if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() ) if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() || hasTipLocation( owner ) )
return null; return null;
PointerInfo pointerInfo = MouseInfo.getPointerInfo(); PointerInfo pointerInfo = MouseInfo.getPointerInfo();
@@ -264,6 +267,35 @@ public class FlatPopupFactory
return StackUtils.wasInvokedFrom( ToolTipManager.class.getName(), "showTipWindow", 8 ); return StackUtils.wasInvokedFrom( ToolTipManager.class.getName(), "showTipWindow", 8 );
} }
/**
* Checks whether the owner component returns a tooltip location in
* JComponent.getToolTipLocation(MouseEvent).
*/
private boolean hasTipLocation( Component owner ) {
if( !(owner instanceof JComponent) )
return false;
AWTEvent e = EventQueue.getCurrentEvent();
MouseEvent me;
if( e instanceof MouseEvent )
me = (MouseEvent) e;
else {
// no mouse event available because a timer is used to show the tooltip
// --> create mouse event from current mouse location
PointerInfo pointerInfo = MouseInfo.getPointerInfo();
if( pointerInfo == null )
return false;
Point location = new Point( pointerInfo.getLocation());
SwingUtilities.convertPointFromScreen( location, owner );
me = new MouseEvent( owner, MouseEvent.MOUSE_MOVED, System.currentTimeMillis(),
0, location.x, location.y, 0, false );
}
return me.getSource() == owner &&
((JComponent)owner).getToolTipLocation( me ) != null;
}
//---- class NonFlashingPopup --------------------------------------------- //---- class NonFlashingPopup ---------------------------------------------
private class NonFlashingPopup private class NonFlashingPopup

View File

@@ -161,6 +161,19 @@ public class FlatRootPaneUI
c.putClientProperty( "jetbrains.awt.windowDarkAppearance", FlatLaf.isLafDark() ); c.putClientProperty( "jetbrains.awt.windowDarkAppearance", FlatLaf.isLafDark() );
} }
@Override
protected void uninstallDefaults( JRootPane c ) {
super.uninstallDefaults( c );
// uninstall background, foreground and font because not all Lafs set them
if( c.isBackgroundSet() && c.getBackground() instanceof UIResource )
c.setBackground( null );
if( c.isForegroundSet() && c.getForeground() instanceof UIResource )
c.setForeground( null );
if( c.isFontSet() && c.getFont() instanceof UIResource )
c.setFont( null );
}
@Override @Override
protected void installListeners( JRootPane root ) { protected void installListeners( JRootPane root ) {
super.installListeners( root ); super.installListeners( root );

View File

@@ -21,6 +21,7 @@ import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.Map; import java.util.Map;
import javax.swing.JComponent; import javax.swing.JComponent;
@@ -28,6 +29,7 @@ import javax.swing.JSeparator;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSeparatorUI; import javax.swing.plaf.basic.BasicSeparatorUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade; import com.formdev.flatlaf.util.LoggingFacade;
@@ -50,7 +52,7 @@ import com.formdev.flatlaf.util.LoggingFacade;
*/ */
public class FlatSeparatorUI public class FlatSeparatorUI
extends BasicSeparatorUI extends BasicSeparatorUI
implements StyleableUI implements StyleableUI, PropertyChangeListener
{ {
@Styleable protected int height; @Styleable protected int height;
@Styleable protected int stripeWidth; @Styleable protected int stripeWidth;
@@ -58,7 +60,6 @@ public class FlatSeparatorUI
private final boolean shared; private final boolean shared;
private boolean defaults_initialized = false; private boolean defaults_initialized = false;
private PropertyChangeListener propertyChangeListener;
private Map<String, Object> oldStyleValues; private Map<String, Object> oldStyleValues;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
@@ -109,20 +110,23 @@ public class FlatSeparatorUI
protected void installListeners( JSeparator s ) { protected void installListeners( JSeparator s ) {
super.installListeners( s ); super.installListeners( s );
propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( s.addPropertyChangeListener( this );
s, () -> stylePropertyChange( s ), null );
s.addPropertyChangeListener( propertyChangeListener );
} }
@Override @Override
protected void uninstallListeners( JSeparator s ) { protected void uninstallListeners( JSeparator s ) {
super.uninstallListeners( s ); super.uninstallListeners( s );
s.removePropertyChangeListener( propertyChangeListener ); s.removePropertyChangeListener( this );
propertyChangeListener = null;
} }
private void stylePropertyChange( JSeparator s ) { /** @since 2.0.1 */
@Override
public void propertyChange( PropertyChangeEvent e ) {
switch( e.getPropertyName() ) {
case FlatClientProperties.STYLE:
case FlatClientProperties.STYLE_CLASS:
JSeparator s = (JSeparator) e.getSource();
if( shared && FlatStylingSupport.hasStyleProperty( s ) ) { if( shared && FlatStylingSupport.hasStyleProperty( s ) ) {
// unshare component UI if necessary // unshare component UI if necessary
// updateUI() invokes installStyle() from installUI() // updateUI() invokes installStyle() from installUI()
@@ -131,6 +135,8 @@ public class FlatSeparatorUI
installStyle( s ); installStyle( s );
s.revalidate(); s.revalidate();
s.repaint(); s.repaint();
break;
}
} }
/** @since 2 */ /** @since 2 */

View File

@@ -764,6 +764,7 @@ debug*/
/** @since 2 */ /** @since 2 */
protected JComponent createClearButton() { protected JComponent createClearButton() {
JButton button = new JButton(); JButton button = new JButton();
button.setName( "TextField.clearButton" );
button.putClientProperty( STYLE_CLASS, "clearButton" ); button.putClientProperty( STYLE_CLASS, "clearButton" );
button.putClientProperty( BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON ); button.putClientProperty( BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON );
button.setCursor( Cursor.getDefaultCursor() ); button.setCursor( Cursor.getDefaultCursor() );
@@ -825,15 +826,20 @@ debug*/
/** @since 2 */ /** @since 2 */
protected void prepareLeadingOrTrailingComponent( JComponent c ) { protected void prepareLeadingOrTrailingComponent( JComponent c ) {
c.putClientProperty( STYLE_CLASS, "inTextField" ); c.putClientProperty( STYLE_CLASS, "inTextField" );
c.setCursor( Cursor.getDefaultCursor() );
if( c instanceof JButton || c instanceof JToggleButton ) if( c instanceof JButton || c instanceof JToggleButton ) {
c.putClientProperty( BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON ); c.putClientProperty( BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON );
else if( c instanceof JToolBar ) {
if( !c.isCursorSet() )
c.setCursor( Cursor.getDefaultCursor() );
} else if( c instanceof JToolBar ) {
for( Component child : c.getComponents() ) { for( Component child : c.getComponents() ) {
if( child instanceof JComponent ) if( child instanceof JComponent )
((JComponent)child).putClientProperty( STYLE_CLASS, "inTextField" ); ((JComponent)child).putClientProperty( STYLE_CLASS, "inTextField" );
} }
if( !c.isCursorSet() )
c.setCursor( Cursor.getDefaultCursor() );
} }
} }
@@ -937,6 +943,7 @@ debug*/
((LayoutManager2)delegate).invalidateLayout( target ); ((LayoutManager2)delegate).invalidateLayout( target );
} }
} }
//---- class FlatDocumentListener ----------------------------------------- //---- class FlatDocumentListener -----------------------------------------
private class FlatDocumentListener private class FlatDocumentListener

View File

@@ -854,7 +854,7 @@ debug*/
} else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) ) } else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) )
insets.bottom += UIScale.scale( 1 ); insets.bottom += UIScale.scale( 1 );
if( hasNativeCustomDecoration() && !isWindowMaximized( c ) ) if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized( c ) )
insets = FlatUIUtils.addInsets( insets, WindowTopBorder.getInstance().getBorderInsets() ); insets = FlatUIUtils.addInsets( insets, WindowTopBorder.getInstance().getBorderInsets() );
return insets; return insets;
@@ -873,7 +873,7 @@ debug*/
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight ); FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
} }
if( hasNativeCustomDecoration() && !isWindowMaximized( c ) ) if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized( c ) )
WindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height ); WindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height );
} }
@@ -966,7 +966,7 @@ debug*/
activeChanged( true ); activeChanged( true );
updateNativeTitleBarHeightAndHitTestSpots(); updateNativeTitleBarHeightAndHitTestSpots();
if( hasNativeCustomDecoration() ) if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() )
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this ); WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
repaintWindowBorder(); repaintWindowBorder();
@@ -977,7 +977,7 @@ debug*/
activeChanged( false ); activeChanged( false );
updateNativeTitleBarHeightAndHitTestSpots(); updateNativeTitleBarHeightAndHitTestSpots();
if( hasNativeCustomDecoration() ) if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() )
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this ); WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
repaintWindowBorder(); repaintWindowBorder();

View File

@@ -22,6 +22,7 @@ import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.Map; import java.util.Map;
import javax.swing.JComponent; import javax.swing.JComponent;
@@ -31,6 +32,7 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarSeparatorUI; import javax.swing.plaf.basic.BasicToolBarSeparatorUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade; import com.formdev.flatlaf.util.LoggingFacade;
@@ -47,7 +49,7 @@ import com.formdev.flatlaf.util.LoggingFacade;
*/ */
public class FlatToolBarSeparatorUI public class FlatToolBarSeparatorUI
extends BasicToolBarSeparatorUI extends BasicToolBarSeparatorUI
implements StyleableUI implements StyleableUI, PropertyChangeListener
{ {
private static final int LINE_WIDTH = 1; private static final int LINE_WIDTH = 1;
@@ -56,7 +58,6 @@ public class FlatToolBarSeparatorUI
private final boolean shared; private final boolean shared;
private boolean defaults_initialized = false; private boolean defaults_initialized = false;
private PropertyChangeListener propertyChangeListener;
private Map<String, Object> oldStyleValues; private Map<String, Object> oldStyleValues;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
@@ -105,20 +106,23 @@ public class FlatToolBarSeparatorUI
protected void installListeners( JSeparator s ) { protected void installListeners( JSeparator s ) {
super.installListeners( s ); super.installListeners( s );
propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( s.addPropertyChangeListener( this );
s, () -> stylePropertyChange( s ), null );
s.addPropertyChangeListener( propertyChangeListener );
} }
@Override @Override
protected void uninstallListeners( JSeparator s ) { protected void uninstallListeners( JSeparator s ) {
super.uninstallListeners( s ); super.uninstallListeners( s );
s.removePropertyChangeListener( propertyChangeListener ); s.removePropertyChangeListener( this );
propertyChangeListener = null;
} }
private void stylePropertyChange( JSeparator s ) { /** @since 2.0.1 */
@Override
public void propertyChange( PropertyChangeEvent e ) {
switch( e.getPropertyName() ) {
case FlatClientProperties.STYLE:
case FlatClientProperties.STYLE_CLASS:
JSeparator s = (JSeparator) e.getSource();
if( shared && FlatStylingSupport.hasStyleProperty( s ) ) { if( shared && FlatStylingSupport.hasStyleProperty( s ) ) {
// unshare component UI if necessary // unshare component UI if necessary
// updateUI() invokes installStyle() from installUI() // updateUI() invokes installStyle() from installUI()
@@ -127,6 +131,8 @@ public class FlatToolBarSeparatorUI
installStyle( s ); installStyle( s );
s.revalidate(); s.revalidate();
s.repaint(); s.repaint();
break;
}
} }
/** @since 2 */ /** @since 2 */

View File

@@ -21,6 +21,7 @@ import java.awt.FontMetrics;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Insets; import java.awt.Insets;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.List; import java.util.List;
import javax.swing.JComponent; import javax.swing.JComponent;
@@ -49,9 +50,8 @@ import com.formdev.flatlaf.util.StringUtils;
*/ */
public class FlatToolTipUI public class FlatToolTipUI
extends BasicToolTipUI extends BasicToolTipUI
implements PropertyChangeListener
{ {
private static PropertyChangeListener sharedPropertyChangedListener;
public static ComponentUI createUI( JComponent c ) { public static ComponentUI createUI( JComponent c ) {
return FlatUIUtils.createSharedUI( FlatToolTipUI.class, FlatToolTipUI::new ); return FlatUIUtils.createSharedUI( FlatToolTipUI.class, FlatToolTipUI::new );
} }
@@ -68,24 +68,24 @@ public class FlatToolTipUI
protected void installListeners( JComponent c ) { protected void installListeners( JComponent c ) {
super.installListeners( c ); super.installListeners( c );
if( sharedPropertyChangedListener == null ) { c.addPropertyChangeListener( this );
sharedPropertyChangedListener = e -> {
String name = e.getPropertyName();
if( name == "tiptext" || name == "font" || name == "foreground" ) {
JToolTip toolTip = (JToolTip) e.getSource();
FlatLabelUI.updateHTMLRenderer( toolTip, toolTip.getTipText(), false );
}
};
}
c.addPropertyChangeListener( sharedPropertyChangedListener );
} }
@Override @Override
protected void uninstallListeners( JComponent c ) { protected void uninstallListeners( JComponent c ) {
super.uninstallListeners( c ); super.uninstallListeners( c );
c.removePropertyChangeListener( sharedPropertyChangedListener ); c.removePropertyChangeListener( this );
}
/** @since 2.0.1 */
@Override
public void propertyChange( PropertyChangeEvent e ) {
String name = e.getPropertyName();
if( name == "tiptext" || name == "font" || name == "foreground" ) {
JToolTip toolTip = (JToolTip) e.getSource();
FlatLabelUI.updateHTMLRenderer( toolTip, toolTip.getTipText(), false );
}
} }
@Override @Override

View File

@@ -27,6 +27,7 @@ import java.awt.Window;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.io.File;
import java.util.Collections; import java.util.Collections;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.List; import java.util.List;
@@ -37,6 +38,7 @@ import javax.swing.Timer;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
import com.formdev.flatlaf.FlatSystemProperties;
import com.formdev.flatlaf.util.LoggingFacade; import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.NativeLibrary; import com.formdev.flatlaf.util.NativeLibrary;
import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.SystemInfo;
@@ -114,11 +116,7 @@ class FlatWindowsNativeWindowBorder
} }
} }
String libraryName = "com/formdev/flatlaf/natives/flatlaf-windows-x86"; nativeLibrary = createNativeLibrary();
if( SystemInfo.isX86_64 )
libraryName += "_64";
nativeLibrary = new NativeLibrary( libraryName, null, true );
} }
// check whether native library was successfully loaded // check whether native library was successfully loaded
@@ -131,6 +129,23 @@ class FlatWindowsNativeWindowBorder
return instance; return instance;
} }
private static NativeLibrary createNativeLibrary() {
String libraryName = "flatlaf-windows-x86";
if( SystemInfo.isX86_64 )
libraryName += "_64";
String libraryPath = System.getProperty( FlatSystemProperties.NATIVE_LIBRARY_PATH );
if( libraryPath != null ) {
File libraryFile = new File( libraryPath, libraryName + ".dll" );
if( libraryFile.exists() )
return new NativeLibrary( libraryFile, true );
else
LoggingFacade.INSTANCE.logSevere( "Did not find external library " + libraryFile + ", using extracted library instead", null );
}
return new NativeLibrary( "com/formdev/flatlaf/natives/" + libraryName, null, true );
}
private FlatWindowsNativeWindowBorder() { private FlatWindowsNativeWindowBorder() {
} }

View File

@@ -298,7 +298,7 @@ public class JBRCustomDecorations
} }
private void paintImpl( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { private void paintImpl( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) {
g.drawRect( x, y, width - 1, 0 ); g.fillRect( x, y, width, 1 );
} }
void repaintBorder( Component c ) { void repaintBorder( Component c ) {

View File

@@ -122,6 +122,8 @@ public class ColorFunctions
return color1; return color1;
if( weight <= 0 ) if( weight <= 0 )
return color2; return color2;
if( color1.equals( color2 ) )
return color1;
int r1 = color1.getRed(); int r1 = color1.getRed();
int g1 = color1.getGreen(); int g1 = color1.getGreen();
@@ -196,6 +198,9 @@ public class ColorFunctions
: (float) Math.pow( (value + 0.055) / 1.055, 2.4 ); : (float) Math.pow( (value + 0.055) / 1.055, 2.4 );
} }
/**
* Applies the given color functions to the given color and returns the new color.
*/
public static Color applyFunctions( Color color, ColorFunction... functions ) { public static Color applyFunctions( Color color, ColorFunction... functions ) {
// if having only a single function of type Mix, then avoid four unnecessary conversions: // if having only a single function of type Mix, then avoid four unnecessary conversions:
// 1. RGB to HSL in this method // 1. RGB to HSL in this method
@@ -221,6 +226,9 @@ public class ColorFunctions
return HSLColor.toRGB( hsla[0], hsla[1], hsla[2], hsla[3] / 100 ); return HSLColor.toRGB( hsla[0], hsla[1], hsla[2], hsla[3] / 100 );
} }
/**
* Clamps the given value between 0 and 100.
*/
public static float clamp( float value ) { public static float clamp( float value ) {
return (value < 0) return (value < 0)
? 0 ? 0

View File

@@ -60,6 +60,19 @@ public class NativeLibrary
: false; : false;
} }
/**
* Load native library from given file.
*
* @param libraryFile the file of the native library
* @param supported whether the native library is supported on the current platform
* @since 2
*/
public NativeLibrary( File libraryFile, boolean supported ) {
this.loaded = supported
? loadLibraryFromFile( libraryFile )
: false;
}
/** /**
* Returns whether the native library is loaded. * Returns whether the native library is loaded.
* <p> * <p>
@@ -120,6 +133,16 @@ public class NativeLibrary
} }
} }
private boolean loadLibraryFromFile( File libraryFile ) {
try {
System.load( libraryFile.getAbsolutePath() );
return true;
} catch( Throwable ex ) {
log( null, ex );
return false;
}
}
private static String decorateLibraryName( String libraryName ) { private static String decorateLibraryName( String libraryName ) {
if( SystemInfo.isWindows ) if( SystemInfo.isWindows )
return libraryName.concat( ".dll" ); return libraryName.concat( ".dll" );

View File

@@ -0,0 +1,50 @@
/*
* Copyright 2022 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.util;
import java.awt.Component;
import java.awt.Container;
/**
* Utility methods for Swing.
*
* @author Karl Tauber
* @since 2
*/
public class SwingUtils
{
/**
* Search for a (grand) child component with the given name.
*
* @return a component; or {@code null}
*/
@SuppressWarnings( "unchecked" )
public static <T extends Component> T getComponentByName( Container parent, String name ) {
for( Component child : parent.getComponents() ) {
if( name.equals( child.getName() ) )
return (T) child;
if( child instanceof Container ) {
T c = getComponentByName( (Container) child, name );
if( c != null )
return c;
}
}
return null;
}
}

View File

@@ -34,6 +34,9 @@ public class SystemInfo
// OS versions // OS versions
public static final long osVersion; public static final long osVersion;
public static final boolean isWindows_10_orLater; public static final boolean isWindows_10_orLater;
/** <strong>Note</strong>: This requires Java 8u321, 11.0.14, 17.0.2 or 18 (or later).
* (see https://bugs.openjdk.java.net/browse/JDK-8274840)
* @since 2 */ public static final boolean isWindows_11_orLater;
public static final boolean isMacOS_10_11_ElCapitan_orLater; public static final boolean isMacOS_10_11_ElCapitan_orLater;
public static final boolean isMacOS_10_14_Mojave_orLater; public static final boolean isMacOS_10_14_Mojave_orLater;
public static final boolean isMacOS_10_15_Catalina_orLater; public static final boolean isMacOS_10_15_Catalina_orLater;
@@ -49,6 +52,7 @@ public class SystemInfo
public static final boolean isJava_11_orLater; public static final boolean isJava_11_orLater;
public static final boolean isJava_15_orLater; public static final boolean isJava_15_orLater;
/** @since 2 */ public static final boolean isJava_17_orLater; /** @since 2 */ public static final boolean isJava_17_orLater;
/** @since 2 */ public static final boolean isJava_18_orLater;
// Java VMs // Java VMs
public static final boolean isJetBrainsJVM; public static final boolean isJetBrainsJVM;
@@ -72,6 +76,8 @@ public class SystemInfo
// OS versions // OS versions
osVersion = scanVersion( System.getProperty( "os.version" ) ); osVersion = scanVersion( System.getProperty( "os.version" ) );
isWindows_10_orLater = (isWindows && osVersion >= toVersion( 10, 0, 0, 0 )); isWindows_10_orLater = (isWindows && osVersion >= toVersion( 10, 0, 0, 0 ));
isWindows_11_orLater = (isWindows_10_orLater && osName.length() > "windows ".length() &&
scanVersion( osName.substring( "windows ".length() ) ) >= toVersion( 11, 0, 0, 0 ));
isMacOS_10_11_ElCapitan_orLater = (isMacOS && osVersion >= toVersion( 10, 11, 0, 0 )); isMacOS_10_11_ElCapitan_orLater = (isMacOS && osVersion >= toVersion( 10, 11, 0, 0 ));
isMacOS_10_14_Mojave_orLater = (isMacOS && osVersion >= toVersion( 10, 14, 0, 0 )); isMacOS_10_14_Mojave_orLater = (isMacOS && osVersion >= toVersion( 10, 14, 0, 0 ));
isMacOS_10_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 )); isMacOS_10_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 ));
@@ -88,6 +94,7 @@ public class SystemInfo
isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 )); isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 ));
isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 )); isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 ));
isJava_17_orLater = (javaVersion >= toVersion( 17, 0, 0, 0 )); isJava_17_orLater = (javaVersion >= toVersion( 17, 0, 0, 0 ));
isJava_18_orLater = (javaVersion >= toVersion( 18, 0, 0, 0 ));
// Java VMs // Java VMs
isJetBrainsJVM = System.getProperty( "java.vm.vendor", "Unknown" ) isJetBrainsJVM = System.getProperty( "java.vm.vendor", "Unknown" )

View File

@@ -289,7 +289,7 @@ Slider.trackValueColor = @accentSliderColor
Slider.trackColor = lighten(@background,15%) Slider.trackColor = lighten(@background,15%)
Slider.thumbColor = $Slider.trackValueColor Slider.thumbColor = $Slider.trackValueColor
Slider.tickColor = @disabledForeground Slider.tickColor = @disabledForeground
Slider.focusedColor = fade($Component.focusColor,70%,derived) Slider.focusedColor = fade(changeLightness($Component.focusColor,60%,derived),30%,derived)
Slider.hoverThumbColor = lighten($Slider.thumbColor,5%,derived) Slider.hoverThumbColor = lighten($Slider.thumbColor,5%,derived)
Slider.pressedThumbColor = lighten($Slider.thumbColor,8%,derived) Slider.pressedThumbColor = lighten($Slider.thumbColor,8%,derived)
Slider.disabledTrackColor = lighten(@background,10%) Slider.disabledTrackColor = lighten(@background,10%)
@@ -334,8 +334,8 @@ TableHeader.bottomSeparatorColor = $TableHeader.separatorColor
#---- TitlePane ---- #---- TitlePane ----
TitlePane.embeddedForeground = darken($TitlePane.foreground,15%) TitlePane.embeddedForeground = darken($TitlePane.foreground,15%)
TitlePane.buttonHoverBackground = lighten($TitlePane.background,10%,derived) TitlePane.buttonHoverBackground = lighten($TitlePane.background,15%,derived)
TitlePane.buttonPressedBackground = lighten($TitlePane.background,20%,derived) TitlePane.buttonPressedBackground = lighten($TitlePane.background,10%,derived)
#---- ToggleButton ---- #---- ToggleButton ----
@@ -367,7 +367,6 @@ Tree.hash = lighten($Tree.background,5%)
focusable: false; \ focusable: false; \
toolbar.margin: 1,1,1,1; \ toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \
background: $TextField.background; \ toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); \
toolbar.hoverBackground: lighten($TextField.background,4%,derived); \ toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); \
toolbar.pressedBackground: lighten($TextField.background,6%,derived); \ toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)
toolbar.selectedBackground: lighten($TextField.background,12%,derived)

View File

@@ -589,13 +589,13 @@ ScrollPane.smoothScrolling = true
#---- SearchField ---- #---- SearchField ----
SearchField.searchIconColor = fadeout(Actions.GreyInline,10%,lazy) SearchField.searchIconColor = fade(Actions.GreyInline,90%,lazy)
SearchField.searchIconHoverColor = fadeout(Actions.GreyInline,30%,lazy) SearchField.searchIconHoverColor = fade(Actions.GreyInline,70%,lazy)
SearchField.searchIconPressedColor = fadeout(Actions.GreyInline,50%,lazy) SearchField.searchIconPressedColor = fade(Actions.GreyInline,50%,lazy)
SearchField.clearIconColor = fadeout(Actions.GreyInline,50%,lazy) SearchField.clearIconColor = fade(Actions.GreyInline,50%,lazy)
SearchField.clearIconHoverColor = $SearchField.clearIconColor SearchField.clearIconHoverColor = $SearchField.clearIconColor
SearchField.clearIconPressedColor = fadeout(Actions.GreyInline,20%,lazy) SearchField.clearIconPressedColor = fade(Actions.GreyInline,80%,lazy)
#---- Separator ---- #---- Separator ----
@@ -802,8 +802,8 @@ TitlePane.inactiveBackground = $TitlePane.background
TitlePane.foreground = @foreground TitlePane.foreground = @foreground
TitlePane.inactiveForeground = @disabledForeground TitlePane.inactiveForeground = @disabledForeground
TitlePane.closeHoverBackground = #e81123 TitlePane.closeHoverBackground = #c42b1c
TitlePane.closePressedBackground = fade($TitlePane.closeHoverBackground,60%) TitlePane.closePressedBackground = fade($TitlePane.closeHoverBackground,90%)
TitlePane.closeHoverForeground = #fff TitlePane.closeHoverForeground = #fff
TitlePane.closePressedForeground = #fff TitlePane.closePressedForeground = #fff
@@ -920,6 +920,5 @@ Tree.icon.openColor = @icon
focusable: false; \ focusable: false; \
toolbar.margin: 1,1,1,1; \ toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \
background: $TextField.background; \ toolbar.hoverBackground: null; \
toolbar.hoverBackground: $TextField.background; \ toolbar.pressedBackground: null
toolbar.pressedBackground: $TextField.background

View File

@@ -296,7 +296,7 @@ Slider.trackValueColor = @accentSliderColor
Slider.trackColor = darken(@background,18%) Slider.trackColor = darken(@background,18%)
Slider.thumbColor = $Slider.trackValueColor Slider.thumbColor = $Slider.trackValueColor
Slider.tickColor = @disabledForeground Slider.tickColor = @disabledForeground
Slider.focusedColor = fade($Component.focusColor,50%,derived) Slider.focusedColor = fade(changeLightness($Component.focusColor,75%,derived),50%,derived)
Slider.hoverThumbColor = darken($Slider.thumbColor,5%,derived) Slider.hoverThumbColor = darken($Slider.thumbColor,5%,derived)
Slider.pressedThumbColor = darken($Slider.thumbColor,8%,derived) Slider.pressedThumbColor = darken($Slider.thumbColor,8%,derived)
Slider.disabledTrackColor = darken(@background,13%) Slider.disabledTrackColor = darken(@background,13%)
@@ -342,7 +342,7 @@ TableHeader.bottomSeparatorColor = $TableHeader.separatorColor
TitlePane.embeddedForeground = lighten($TitlePane.foreground,35%) TitlePane.embeddedForeground = lighten($TitlePane.foreground,35%)
TitlePane.buttonHoverBackground = darken($TitlePane.background,10%,derived) TitlePane.buttonHoverBackground = darken($TitlePane.background,10%,derived)
TitlePane.buttonPressedBackground = darken($TitlePane.background,20%,derived) TitlePane.buttonPressedBackground = darken($TitlePane.background,8%,derived)
#---- ToggleButton ---- #---- ToggleButton ----
@@ -374,7 +374,6 @@ Tree.hash = darken($Tree.background,10%)
focusable: false; \ focusable: false; \
toolbar.margin: 1,1,1,1; \ toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \
background: $TextField.background; \ toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); \
toolbar.hoverBackground: darken($TextField.background,4%,derived); \ toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); \
toolbar.pressedBackground: darken($TextField.background,8%,derived); \ toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy)
toolbar.selectedBackground: darken($TextField.background,12%,derived)

View File

@@ -40,7 +40,7 @@ public class TestFlatStyleClasses
@BeforeAll @BeforeAll
static void setup() { static void setup() {
System.setProperty( FlatSystemProperties.UI_SCALE_ENABLED, "false" ); System.setProperty( FlatSystemProperties.UI_SCALE, "1x" );
TestUtils.setup( false ); TestUtils.setup( false );
UIManager.put( "[style]Button.primary", BUTTON_PRIMARY ); UIManager.put( "[style]Button.primary", BUTTON_PRIMARY );
@@ -100,7 +100,7 @@ public class TestFlatStyleClasses
@AfterAll @AfterAll
static void cleanup() { static void cleanup() {
TestUtils.cleanup(); TestUtils.cleanup();
System.clearProperty( FlatSystemProperties.UI_SCALE_ENABLED ); System.clearProperty( FlatSystemProperties.UI_SCALE );
} }
@Test @Test

View File

@@ -30,7 +30,7 @@ import com.formdev.flatlaf.FlatSystemProperties;
*/ */
public class TestUtils public class TestUtils
{ {
public static final float[] FACTORS = new float[] { 1f }; //, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f }; public static final float[] FACTORS = new float[] { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.25f, 3.5f, 3.75f, 4f, 5f, 6f };
public static void setup( boolean withFocus ) { public static void setup( boolean withFocus ) {
System.setProperty( FlatSystemProperties.UI_SCALE, "1x" ); System.setProperty( FlatSystemProperties.UI_SCALE, "1x" );

View File

@@ -43,6 +43,17 @@ class BasicComponentsPanel
// UIManager.put( "PasswordField.showRevealButton", true ); // UIManager.put( "PasswordField.showRevealButton", true );
passwordField1.putClientProperty( FlatClientProperties.STYLE, "showRevealButton: true" ); passwordField1.putClientProperty( FlatClientProperties.STYLE, "showRevealButton: true" );
// add leading/trailing icons to text fields
leadingIconTextField.putClientProperty( FlatClientProperties.PLACEHOLDER_TEXT, "Search" );
leadingIconTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_LEADING_ICON,
new FlatSearchIcon() );
trailingIconTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_TRAILING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/DataTables.svg" ) );
iconsTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_LEADING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/user.svg" ) );
iconsTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_TRAILING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/bookmarkGroup.svg" ) );
// search history button // search history button
JButton searchHistoryButton = new JButton( new FlatSearchWithHistoryIcon( true ) ); JButton searchHistoryButton = new JButton( new FlatSearchWithHistoryIcon( true ) );
searchHistoryButton.setToolTipText( "Search History" ); searchHistoryButton.setToolTipText( "Search History" );
@@ -177,9 +188,9 @@ class BasicComponentsPanel
JComboBox<String> warningHintsComboBox = new JComboBox<>(); JComboBox<String> warningHintsComboBox = new JComboBox<>();
JSpinner warningHintsSpinner = new JSpinner(); JSpinner warningHintsSpinner = new JSpinner();
JLabel iconsLabel = new JLabel(); JLabel iconsLabel = new JLabel();
JTextField leadingIconTextField = new JTextField(); leadingIconTextField = new JTextField();
JTextField trailingIconTextField = new JTextField(); trailingIconTextField = new JTextField();
JTextField iconsTextField = new JTextField(); iconsTextField = new JTextField();
JLabel compsLabel = new JLabel(); JLabel compsLabel = new JLabel();
compsTextField = new JTextField(); compsTextField = new JTextField();
clearTextField = new JTextField(); clearTextField = new JTextField();
@@ -851,17 +862,6 @@ class BasicComponentsPanel
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() ); copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() ); pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
// add leading/trailing icons to text fields
leadingIconTextField.putClientProperty( FlatClientProperties.PLACEHOLDER_TEXT, "Search" );
leadingIconTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_LEADING_ICON,
new FlatSearchIcon() );
trailingIconTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_TRAILING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/DataTables.svg" ) );
iconsTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_LEADING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/user.svg" ) );
iconsTextField.putClientProperty( FlatClientProperties.TEXT_FIELD_TRAILING_ICON,
new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/bookmarkGroup.svg" ) );
if( FlatLafDemo.screenshotsMode ) { if( FlatLafDemo.screenshotsMode ) {
// hide some components // hide some components
Component[] hiddenComponents = { Component[] hiddenComponents = {
@@ -919,6 +919,9 @@ class BasicComponentsPanel
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JPasswordField passwordField1; private JPasswordField passwordField1;
private JTextField leadingIconTextField;
private JTextField trailingIconTextField;
private JTextField iconsTextField;
private JTextField compsTextField; private JTextField compsTextField;
private JTextField clearTextField; private JTextField clearTextField;
// JFormDesigner - End of variables declaration //GEN-END:variables // JFormDesigner - End of variables declaration //GEN-END:variables

View File

@@ -659,18 +659,27 @@ new FormModel {
} ) } )
add( new FormComponent( "javax.swing.JTextField" ) { add( new FormComponent( "javax.swing.JTextField" ) {
name: "leadingIconTextField" name: "leadingIconTextField"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 14,growx" "value": "cell 1 14,growx"
} ) } )
add( new FormComponent( "javax.swing.JTextField" ) { add( new FormComponent( "javax.swing.JTextField" ) {
name: "trailingIconTextField" name: "trailingIconTextField"
"text": "text" "text": "text"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 14,growx" "value": "cell 2 14,growx"
} ) } )
add( new FormComponent( "javax.swing.JTextField" ) { add( new FormComponent( "javax.swing.JTextField" ) {
name: "iconsTextField" name: "iconsTextField"
"text": "text" "text": "text"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 14,growx" "value": "cell 3 14,growx"
} ) } )

View File

@@ -62,10 +62,10 @@ class ControlBar
// initialize look and feels combo box // initialize look and feels combo box
DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>(); DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>();
lafModel.addElement( new LookAndFeelInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Light (F1)", FlatLightLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat Dark (F2)", FlatDarkLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Dark (F2)", FlatDarkLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat IntelliJ (F3)", FlatIntelliJLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf IntelliJ (F3)", FlatIntelliJLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat Darcula (F4)", FlatDarculaLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Darcula (F4)", FlatDarculaLaf.class.getName() ) );
UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels(); UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels();
for( UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels ) { for( UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels ) {

View File

@@ -412,7 +412,6 @@ class TabsPanel
cardTabTypeButton = new JToggleButton(); cardTabTypeButton = new JToggleButton();
//======== this ======== //======== this ========
setName("this");
setLayout(new MigLayout( setLayout(new MigLayout(
"insets dialog,hidemode 3", "insets dialog,hidemode 3",
// columns // columns
@@ -426,7 +425,6 @@ class TabsPanel
//======== panel1 ======== //======== panel1 ========
{ {
panel1.setName("panel1");
panel1.setLayout(new MigLayout( panel1.setLayout(new MigLayout(
"insets 0,hidemode 3", "insets 0,hidemode 3",
// columns // columns
@@ -445,41 +443,35 @@ class TabsPanel
//---- tabPlacementLabel ---- //---- tabPlacementLabel ----
tabPlacementLabel.setText("Tab placement"); tabPlacementLabel.setText("Tab placement");
tabPlacementLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabPlacementLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabPlacementLabel.setName("tabPlacementLabel");
panel1.add(tabPlacementLabel, "cell 0 0"); panel1.add(tabPlacementLabel, "cell 0 0");
//======== tabPlacementToolBar ======== //======== tabPlacementToolBar ========
{ {
tabPlacementToolBar.setFloatable(false); tabPlacementToolBar.setFloatable(false);
tabPlacementToolBar.setBorder(BorderFactory.createEmptyBorder()); tabPlacementToolBar.setBorder(BorderFactory.createEmptyBorder());
tabPlacementToolBar.setName("tabPlacementToolBar");
//---- topPlacementButton ---- //---- topPlacementButton ----
topPlacementButton.setText("top"); topPlacementButton.setText("top");
topPlacementButton.setSelected(true); topPlacementButton.setSelected(true);
topPlacementButton.putClientProperty("FlatLaf.styleClass", "small"); topPlacementButton.putClientProperty("FlatLaf.styleClass", "small");
topPlacementButton.setName("topPlacementButton");
topPlacementButton.addActionListener(e -> tabPlacementChanged()); topPlacementButton.addActionListener(e -> tabPlacementChanged());
tabPlacementToolBar.add(topPlacementButton); tabPlacementToolBar.add(topPlacementButton);
//---- bottomPlacementButton ---- //---- bottomPlacementButton ----
bottomPlacementButton.setText("bottom"); bottomPlacementButton.setText("bottom");
bottomPlacementButton.putClientProperty("FlatLaf.styleClass", "small"); bottomPlacementButton.putClientProperty("FlatLaf.styleClass", "small");
bottomPlacementButton.setName("bottomPlacementButton");
bottomPlacementButton.addActionListener(e -> tabPlacementChanged()); bottomPlacementButton.addActionListener(e -> tabPlacementChanged());
tabPlacementToolBar.add(bottomPlacementButton); tabPlacementToolBar.add(bottomPlacementButton);
//---- leftPlacementButton ---- //---- leftPlacementButton ----
leftPlacementButton.setText("left"); leftPlacementButton.setText("left");
leftPlacementButton.putClientProperty("FlatLaf.styleClass", "small"); leftPlacementButton.putClientProperty("FlatLaf.styleClass", "small");
leftPlacementButton.setName("leftPlacementButton");
leftPlacementButton.addActionListener(e -> tabPlacementChanged()); leftPlacementButton.addActionListener(e -> tabPlacementChanged());
tabPlacementToolBar.add(leftPlacementButton); tabPlacementToolBar.add(leftPlacementButton);
//---- rightPlacementButton ---- //---- rightPlacementButton ----
rightPlacementButton.setText("right"); rightPlacementButton.setText("right");
rightPlacementButton.putClientProperty("FlatLaf.styleClass", "small"); rightPlacementButton.putClientProperty("FlatLaf.styleClass", "small");
rightPlacementButton.setName("rightPlacementButton");
rightPlacementButton.addActionListener(e -> tabPlacementChanged()); rightPlacementButton.addActionListener(e -> tabPlacementChanged());
tabPlacementToolBar.add(rightPlacementButton); tabPlacementToolBar.add(rightPlacementButton);
tabPlacementToolBar.addSeparator(); tabPlacementToolBar.addSeparator();
@@ -487,49 +479,38 @@ class TabsPanel
//---- scrollButton ---- //---- scrollButton ----
scrollButton.setText("scroll"); scrollButton.setText("scroll");
scrollButton.putClientProperty("FlatLaf.styleClass", "small"); scrollButton.putClientProperty("FlatLaf.styleClass", "small");
scrollButton.setName("scrollButton");
scrollButton.addActionListener(e -> scrollChanged()); scrollButton.addActionListener(e -> scrollChanged());
tabPlacementToolBar.add(scrollButton); tabPlacementToolBar.add(scrollButton);
//---- borderButton ---- //---- borderButton ----
borderButton.setText("border"); borderButton.setText("border");
borderButton.putClientProperty("FlatLaf.styleClass", "small"); borderButton.putClientProperty("FlatLaf.styleClass", "small");
borderButton.setName("borderButton");
borderButton.addActionListener(e -> borderChanged()); borderButton.addActionListener(e -> borderChanged());
tabPlacementToolBar.add(borderButton); tabPlacementToolBar.add(borderButton);
} }
panel1.add(tabPlacementToolBar, "cell 0 0,alignx right,growx 0"); panel1.add(tabPlacementToolBar, "cell 0 0,alignx right,growx 0");
//======== tabPlacementTabbedPane ========
{
tabPlacementTabbedPane.setName("tabPlacementTabbedPane");
}
panel1.add(tabPlacementTabbedPane, "cell 0 1,width 300:300,height 100:100"); panel1.add(tabPlacementTabbedPane, "cell 0 1,width 300:300,height 100:100");
//---- tabLayoutLabel ---- //---- tabLayoutLabel ----
tabLayoutLabel.setText("Tab layout"); tabLayoutLabel.setText("Tab layout");
tabLayoutLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabLayoutLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabLayoutLabel.setName("tabLayoutLabel");
panel1.add(tabLayoutLabel, "cell 0 2"); panel1.add(tabLayoutLabel, "cell 0 2");
//======== tabLayoutToolBar ======== //======== tabLayoutToolBar ========
{ {
tabLayoutToolBar.setFloatable(false); tabLayoutToolBar.setFloatable(false);
tabLayoutToolBar.setBorder(BorderFactory.createEmptyBorder()); tabLayoutToolBar.setBorder(BorderFactory.createEmptyBorder());
tabLayoutToolBar.setName("tabLayoutToolBar");
//---- scrollTabLayoutButton ---- //---- scrollTabLayoutButton ----
scrollTabLayoutButton.setText("scroll"); scrollTabLayoutButton.setText("scroll");
scrollTabLayoutButton.setSelected(true); scrollTabLayoutButton.setSelected(true);
scrollTabLayoutButton.putClientProperty("FlatLaf.styleClass", "small"); scrollTabLayoutButton.putClientProperty("FlatLaf.styleClass", "small");
scrollTabLayoutButton.setName("scrollTabLayoutButton");
scrollTabLayoutButton.addActionListener(e -> tabLayoutChanged()); scrollTabLayoutButton.addActionListener(e -> tabLayoutChanged());
tabLayoutToolBar.add(scrollTabLayoutButton); tabLayoutToolBar.add(scrollTabLayoutButton);
//---- wrapTabLayoutButton ---- //---- wrapTabLayoutButton ----
wrapTabLayoutButton.setText("wrap"); wrapTabLayoutButton.setText("wrap");
wrapTabLayoutButton.putClientProperty("FlatLaf.styleClass", "small"); wrapTabLayoutButton.putClientProperty("FlatLaf.styleClass", "small");
wrapTabLayoutButton.setName("wrapTabLayoutButton");
wrapTabLayoutButton.addActionListener(e -> tabLayoutChanged()); wrapTabLayoutButton.addActionListener(e -> tabLayoutChanged());
tabLayoutToolBar.add(wrapTabLayoutButton); tabLayoutToolBar.add(wrapTabLayoutButton);
} }
@@ -539,87 +520,62 @@ class TabsPanel
scrollLayoutNoteLabel.setText("(use mouse wheel to scroll; arrow button shows hidden tabs)"); scrollLayoutNoteLabel.setText("(use mouse wheel to scroll; arrow button shows hidden tabs)");
scrollLayoutNoteLabel.setEnabled(false); scrollLayoutNoteLabel.setEnabled(false);
scrollLayoutNoteLabel.putClientProperty("FlatLaf.styleClass", "small"); scrollLayoutNoteLabel.putClientProperty("FlatLaf.styleClass", "small");
scrollLayoutNoteLabel.setName("scrollLayoutNoteLabel");
panel1.add(scrollLayoutNoteLabel, "cell 0 3"); panel1.add(scrollLayoutNoteLabel, "cell 0 3");
//---- wrapLayoutNoteLabel ---- //---- wrapLayoutNoteLabel ----
wrapLayoutNoteLabel.setText("(probably better to use scroll layout?)"); wrapLayoutNoteLabel.setText("(probably better to use scroll layout?)");
wrapLayoutNoteLabel.setEnabled(false); wrapLayoutNoteLabel.setEnabled(false);
wrapLayoutNoteLabel.putClientProperty("FlatLaf.styleClass", "small"); wrapLayoutNoteLabel.putClientProperty("FlatLaf.styleClass", "small");
wrapLayoutNoteLabel.setName("wrapLayoutNoteLabel");
panel1.add(wrapLayoutNoteLabel, "cell 0 3"); panel1.add(wrapLayoutNoteLabel, "cell 0 3");
//======== scrollLayoutTabbedPane ========
{
scrollLayoutTabbedPane.setName("scrollLayoutTabbedPane");
}
panel1.add(scrollLayoutTabbedPane, "cell 0 4"); panel1.add(scrollLayoutTabbedPane, "cell 0 4");
//======== wrapLayoutTabbedPane ========
{
wrapLayoutTabbedPane.setName("wrapLayoutTabbedPane");
}
panel1.add(wrapLayoutTabbedPane, "cell 0 4,width 100:100,height pref*2px"); panel1.add(wrapLayoutTabbedPane, "cell 0 4,width 100:100,height pref*2px");
//---- closableTabsLabel ---- //---- closableTabsLabel ----
closableTabsLabel.setText("Closable tabs"); closableTabsLabel.setText("Closable tabs");
closableTabsLabel.putClientProperty("FlatLaf.styleClass", "h3"); closableTabsLabel.putClientProperty("FlatLaf.styleClass", "h3");
closableTabsLabel.setName("closableTabsLabel");
panel1.add(closableTabsLabel, "cell 0 5"); panel1.add(closableTabsLabel, "cell 0 5");
//======== closableTabsToolBar ======== //======== closableTabsToolBar ========
{ {
closableTabsToolBar.setFloatable(false); closableTabsToolBar.setFloatable(false);
closableTabsToolBar.setBorder(BorderFactory.createEmptyBorder()); closableTabsToolBar.setBorder(BorderFactory.createEmptyBorder());
closableTabsToolBar.setName("closableTabsToolBar");
//---- squareCloseButton ---- //---- squareCloseButton ----
squareCloseButton.setText("square"); squareCloseButton.setText("square");
squareCloseButton.setSelected(true); squareCloseButton.setSelected(true);
squareCloseButton.putClientProperty("FlatLaf.styleClass", "small"); squareCloseButton.putClientProperty("FlatLaf.styleClass", "small");
squareCloseButton.setName("squareCloseButton");
squareCloseButton.addActionListener(e -> closeButtonStyleChanged()); squareCloseButton.addActionListener(e -> closeButtonStyleChanged());
closableTabsToolBar.add(squareCloseButton); closableTabsToolBar.add(squareCloseButton);
//---- circleCloseButton ---- //---- circleCloseButton ----
circleCloseButton.setText("circle"); circleCloseButton.setText("circle");
circleCloseButton.putClientProperty("FlatLaf.styleClass", "small"); circleCloseButton.putClientProperty("FlatLaf.styleClass", "small");
circleCloseButton.setName("circleCloseButton");
circleCloseButton.addActionListener(e -> closeButtonStyleChanged()); circleCloseButton.addActionListener(e -> closeButtonStyleChanged());
closableTabsToolBar.add(circleCloseButton); closableTabsToolBar.add(circleCloseButton);
//---- redCrossCloseButton ---- //---- redCrossCloseButton ----
redCrossCloseButton.setText("red cross"); redCrossCloseButton.setText("red cross");
redCrossCloseButton.putClientProperty("FlatLaf.styleClass", "small"); redCrossCloseButton.putClientProperty("FlatLaf.styleClass", "small");
redCrossCloseButton.setName("redCrossCloseButton");
redCrossCloseButton.addActionListener(e -> closeButtonStyleChanged()); redCrossCloseButton.addActionListener(e -> closeButtonStyleChanged());
closableTabsToolBar.add(redCrossCloseButton); closableTabsToolBar.add(redCrossCloseButton);
} }
panel1.add(closableTabsToolBar, "cell 0 5,alignx right,growx 0"); panel1.add(closableTabsToolBar, "cell 0 5,alignx right,growx 0");
//======== closableTabsTabbedPane ========
{
closableTabsTabbedPane.setName("closableTabsTabbedPane");
}
panel1.add(closableTabsTabbedPane, "cell 0 6"); panel1.add(closableTabsTabbedPane, "cell 0 6");
//---- tabAreaComponentsLabel ---- //---- tabAreaComponentsLabel ----
tabAreaComponentsLabel.setText("Custom tab area components"); tabAreaComponentsLabel.setText("Custom tab area components");
tabAreaComponentsLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabAreaComponentsLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabAreaComponentsLabel.setName("tabAreaComponentsLabel");
panel1.add(tabAreaComponentsLabel, "cell 0 7"); panel1.add(tabAreaComponentsLabel, "cell 0 7");
//======== tabAreaComponentsToolBar ======== //======== tabAreaComponentsToolBar ========
{ {
tabAreaComponentsToolBar.setFloatable(false); tabAreaComponentsToolBar.setFloatable(false);
tabAreaComponentsToolBar.setBorder(BorderFactory.createEmptyBorder()); tabAreaComponentsToolBar.setBorder(BorderFactory.createEmptyBorder());
tabAreaComponentsToolBar.setName("tabAreaComponentsToolBar");
//---- leadingComponentButton ---- //---- leadingComponentButton ----
leadingComponentButton.setText("leading"); leadingComponentButton.setText("leading");
leadingComponentButton.setSelected(true); leadingComponentButton.setSelected(true);
leadingComponentButton.putClientProperty("FlatLaf.styleClass", "small"); leadingComponentButton.putClientProperty("FlatLaf.styleClass", "small");
leadingComponentButton.setName("leadingComponentButton");
leadingComponentButton.addActionListener(e -> customComponentsChanged()); leadingComponentButton.addActionListener(e -> customComponentsChanged());
tabAreaComponentsToolBar.add(leadingComponentButton); tabAreaComponentsToolBar.add(leadingComponentButton);
@@ -627,23 +583,16 @@ class TabsPanel
trailingComponentButton.setText("trailing"); trailingComponentButton.setText("trailing");
trailingComponentButton.setSelected(true); trailingComponentButton.setSelected(true);
trailingComponentButton.putClientProperty("FlatLaf.styleClass", "small"); trailingComponentButton.putClientProperty("FlatLaf.styleClass", "small");
trailingComponentButton.setName("trailingComponentButton");
trailingComponentButton.addActionListener(e -> customComponentsChanged()); trailingComponentButton.addActionListener(e -> customComponentsChanged());
tabAreaComponentsToolBar.add(trailingComponentButton); tabAreaComponentsToolBar.add(trailingComponentButton);
} }
panel1.add(tabAreaComponentsToolBar, "cell 0 7,alignx right,growx 0"); panel1.add(tabAreaComponentsToolBar, "cell 0 7,alignx right,growx 0");
//======== customComponentsTabbedPane ========
{
customComponentsTabbedPane.setName("customComponentsTabbedPane");
}
panel1.add(customComponentsTabbedPane, "cell 0 8"); panel1.add(customComponentsTabbedPane, "cell 0 8");
} }
add(panel1, "cell 0 0"); add(panel1, "cell 0 0");
//======== panel2 ======== //======== panel2 ========
{ {
panel2.setName("panel2");
panel2.setLayout(new MigLayout( panel2.setLayout(new MigLayout(
"insets 0,hidemode 3", "insets 0,hidemode 3",
// columns // columns
@@ -665,82 +614,37 @@ class TabsPanel
//---- tabIconPlacementLabel ---- //---- tabIconPlacementLabel ----
tabIconPlacementLabel.setText("Tab icon placement"); tabIconPlacementLabel.setText("Tab icon placement");
tabIconPlacementLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabIconPlacementLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabIconPlacementLabel.setName("tabIconPlacementLabel");
panel2.add(tabIconPlacementLabel, "cell 0 0"); panel2.add(tabIconPlacementLabel, "cell 0 0");
//---- tabIconPlacementNodeLabel ---- //---- tabIconPlacementNodeLabel ----
tabIconPlacementNodeLabel.setText("(top/bottom/leading/trailing)"); tabIconPlacementNodeLabel.setText("(top/bottom/leading/trailing)");
tabIconPlacementNodeLabel.setEnabled(false); tabIconPlacementNodeLabel.setEnabled(false);
tabIconPlacementNodeLabel.putClientProperty("FlatLaf.styleClass", "small"); tabIconPlacementNodeLabel.putClientProperty("FlatLaf.styleClass", "small");
tabIconPlacementNodeLabel.setName("tabIconPlacementNodeLabel");
panel2.add(tabIconPlacementNodeLabel, "cell 0 1"); panel2.add(tabIconPlacementNodeLabel, "cell 0 1");
//======== iconTopTabbedPane ========
{
iconTopTabbedPane.setName("iconTopTabbedPane");
}
panel2.add(iconTopTabbedPane, "cell 0 2"); panel2.add(iconTopTabbedPane, "cell 0 2");
//======== iconBottomTabbedPane ========
{
iconBottomTabbedPane.setName("iconBottomTabbedPane");
}
panel2.add(iconBottomTabbedPane, "cell 0 3"); panel2.add(iconBottomTabbedPane, "cell 0 3");
//======== iconLeadingTabbedPane ========
{
iconLeadingTabbedPane.setName("iconLeadingTabbedPane");
}
panel2.add(iconLeadingTabbedPane, "cell 0 4"); panel2.add(iconLeadingTabbedPane, "cell 0 4");
//======== iconTrailingTabbedPane ========
{
iconTrailingTabbedPane.setName("iconTrailingTabbedPane");
}
panel2.add(iconTrailingTabbedPane, "cell 0 5"); panel2.add(iconTrailingTabbedPane, "cell 0 5");
//---- tabAreaAlignmentLabel ---- //---- tabAreaAlignmentLabel ----
tabAreaAlignmentLabel.setText("Tab area alignment"); tabAreaAlignmentLabel.setText("Tab area alignment");
tabAreaAlignmentLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabAreaAlignmentLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabAreaAlignmentLabel.setName("tabAreaAlignmentLabel");
panel2.add(tabAreaAlignmentLabel, "cell 0 6"); panel2.add(tabAreaAlignmentLabel, "cell 0 6");
//---- tabAreaAlignmentNoteLabel ---- //---- tabAreaAlignmentNoteLabel ----
tabAreaAlignmentNoteLabel.setText("(leading/center/trailing/fill)"); tabAreaAlignmentNoteLabel.setText("(leading/center/trailing/fill)");
tabAreaAlignmentNoteLabel.setEnabled(false); tabAreaAlignmentNoteLabel.setEnabled(false);
tabAreaAlignmentNoteLabel.putClientProperty("FlatLaf.styleClass", "small"); tabAreaAlignmentNoteLabel.putClientProperty("FlatLaf.styleClass", "small");
tabAreaAlignmentNoteLabel.setName("tabAreaAlignmentNoteLabel");
panel2.add(tabAreaAlignmentNoteLabel, "cell 0 7"); panel2.add(tabAreaAlignmentNoteLabel, "cell 0 7");
//======== alignLeadingTabbedPane ========
{
alignLeadingTabbedPane.setName("alignLeadingTabbedPane");
}
panel2.add(alignLeadingTabbedPane, "cell 0 8"); panel2.add(alignLeadingTabbedPane, "cell 0 8");
//======== alignCenterTabbedPane ========
{
alignCenterTabbedPane.setName("alignCenterTabbedPane");
}
panel2.add(alignCenterTabbedPane, "cell 0 9"); panel2.add(alignCenterTabbedPane, "cell 0 9");
//======== alignTrailingTabbedPane ========
{
alignTrailingTabbedPane.setName("alignTrailingTabbedPane");
}
panel2.add(alignTrailingTabbedPane, "cell 0 10"); panel2.add(alignTrailingTabbedPane, "cell 0 10");
//======== alignFillTabbedPane ========
{
alignFillTabbedPane.setName("alignFillTabbedPane");
}
panel2.add(alignFillTabbedPane, "cell 0 11"); panel2.add(alignFillTabbedPane, "cell 0 11");
} }
add(panel2, "cell 1 0,growy"); add(panel2, "cell 1 0,growy");
//======== panel3 ======== //======== panel3 ========
{ {
panel3.setName("panel3");
panel3.setLayout(new MigLayout( panel3.setLayout(new MigLayout(
"insets 0,hidemode 3", "insets 0,hidemode 3",
// columns // columns
@@ -760,61 +664,31 @@ class TabsPanel
//---- tabWidthModeLabel ---- //---- tabWidthModeLabel ----
tabWidthModeLabel.setText("Tab width mode"); tabWidthModeLabel.setText("Tab width mode");
tabWidthModeLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabWidthModeLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabWidthModeLabel.setName("tabWidthModeLabel");
panel3.add(tabWidthModeLabel, "cell 0 0"); panel3.add(tabWidthModeLabel, "cell 0 0");
//---- tabWidthModeNoteLabel ---- //---- tabWidthModeNoteLabel ----
tabWidthModeNoteLabel.setText("(preferred/equal/compact)"); tabWidthModeNoteLabel.setText("(preferred/equal/compact)");
tabWidthModeNoteLabel.setEnabled(false); tabWidthModeNoteLabel.setEnabled(false);
tabWidthModeNoteLabel.putClientProperty("FlatLaf.styleClass", "small"); tabWidthModeNoteLabel.putClientProperty("FlatLaf.styleClass", "small");
tabWidthModeNoteLabel.setName("tabWidthModeNoteLabel");
panel3.add(tabWidthModeNoteLabel, "cell 0 1"); panel3.add(tabWidthModeNoteLabel, "cell 0 1");
//======== widthPreferredTabbedPane ========
{
widthPreferredTabbedPane.setName("widthPreferredTabbedPane");
}
panel3.add(widthPreferredTabbedPane, "cell 0 2"); panel3.add(widthPreferredTabbedPane, "cell 0 2");
//======== widthEqualTabbedPane ========
{
widthEqualTabbedPane.setName("widthEqualTabbedPane");
}
panel3.add(widthEqualTabbedPane, "cell 0 3"); panel3.add(widthEqualTabbedPane, "cell 0 3");
//======== widthCompactTabbedPane ========
{
widthCompactTabbedPane.setName("widthCompactTabbedPane");
}
panel3.add(widthCompactTabbedPane, "cell 0 4"); panel3.add(widthCompactTabbedPane, "cell 0 4");
//---- minMaxTabWidthLabel ---- //---- minMaxTabWidthLabel ----
minMaxTabWidthLabel.setText("Minimum/maximum tab width"); minMaxTabWidthLabel.setText("Minimum/maximum tab width");
minMaxTabWidthLabel.putClientProperty("FlatLaf.styleClass", "h3"); minMaxTabWidthLabel.putClientProperty("FlatLaf.styleClass", "h3");
minMaxTabWidthLabel.setName("minMaxTabWidthLabel");
panel3.add(minMaxTabWidthLabel, "cell 0 5"); panel3.add(minMaxTabWidthLabel, "cell 0 5");
//======== minimumTabWidthTabbedPane ========
{
minimumTabWidthTabbedPane.setName("minimumTabWidthTabbedPane");
}
panel3.add(minimumTabWidthTabbedPane, "cell 0 6"); panel3.add(minimumTabWidthTabbedPane, "cell 0 6");
//======== maximumTabWidthTabbedPane ========
{
maximumTabWidthTabbedPane.setName("maximumTabWidthTabbedPane");
}
panel3.add(maximumTabWidthTabbedPane, "cell 0 7"); panel3.add(maximumTabWidthTabbedPane, "cell 0 7");
//---- tabAlignmentLabel ---- //---- tabAlignmentLabel ----
tabAlignmentLabel.setText("Tab title alignment"); tabAlignmentLabel.setText("Tab title alignment");
tabAlignmentLabel.putClientProperty("FlatLaf.styleClass", "h3"); tabAlignmentLabel.putClientProperty("FlatLaf.styleClass", "h3");
tabAlignmentLabel.setName("tabAlignmentLabel");
panel3.add(tabAlignmentLabel, "cell 0 8"); panel3.add(tabAlignmentLabel, "cell 0 8");
//======== panel5 ======== //======== panel5 ========
{ {
panel5.setName("panel5");
panel5.setLayout(new MigLayout( panel5.setLayout(new MigLayout(
"insets 0,hidemode 3", "insets 0,hidemode 3",
// columns // columns
@@ -830,52 +704,30 @@ class TabsPanel
tabAlignmentNoteLabel.setText("(leading/center/trailing)"); tabAlignmentNoteLabel.setText("(leading/center/trailing)");
tabAlignmentNoteLabel.setEnabled(false); tabAlignmentNoteLabel.setEnabled(false);
tabAlignmentNoteLabel.putClientProperty("FlatLaf.styleClass", "small"); tabAlignmentNoteLabel.putClientProperty("FlatLaf.styleClass", "small");
tabAlignmentNoteLabel.setName("tabAlignmentNoteLabel");
panel5.add(tabAlignmentNoteLabel, "cell 0 0"); panel5.add(tabAlignmentNoteLabel, "cell 0 0");
//---- tabAlignmentNoteLabel2 ---- //---- tabAlignmentNoteLabel2 ----
tabAlignmentNoteLabel2.setText("(trailing)"); tabAlignmentNoteLabel2.setText("(trailing)");
tabAlignmentNoteLabel2.setEnabled(false); tabAlignmentNoteLabel2.setEnabled(false);
tabAlignmentNoteLabel2.putClientProperty("FlatLaf.styleClass", "small"); tabAlignmentNoteLabel2.putClientProperty("FlatLaf.styleClass", "small");
tabAlignmentNoteLabel2.setName("tabAlignmentNoteLabel2");
panel5.add(tabAlignmentNoteLabel2, "cell 1 0,alignx right,growx 0"); panel5.add(tabAlignmentNoteLabel2, "cell 1 0,alignx right,growx 0");
//======== tabAlignLeadingTabbedPane ========
{
tabAlignLeadingTabbedPane.setName("tabAlignLeadingTabbedPane");
}
panel5.add(tabAlignLeadingTabbedPane, "cell 0 1"); panel5.add(tabAlignLeadingTabbedPane, "cell 0 1");
//======== tabAlignVerticalTabbedPane ======== //======== tabAlignVerticalTabbedPane ========
{ {
tabAlignVerticalTabbedPane.setTabPlacement(SwingConstants.LEFT); tabAlignVerticalTabbedPane.setTabPlacement(SwingConstants.LEFT);
tabAlignVerticalTabbedPane.setName("tabAlignVerticalTabbedPane");
} }
panel5.add(tabAlignVerticalTabbedPane, "cell 1 1 1 3,growy"); panel5.add(tabAlignVerticalTabbedPane, "cell 1 1 1 3,growy");
//======== tabAlignCenterTabbedPane ========
{
tabAlignCenterTabbedPane.setName("tabAlignCenterTabbedPane");
}
panel5.add(tabAlignCenterTabbedPane, "cell 0 2"); panel5.add(tabAlignCenterTabbedPane, "cell 0 2");
//======== tabAlignTrailingTabbedPane ========
{
tabAlignTrailingTabbedPane.setName("tabAlignTrailingTabbedPane");
}
panel5.add(tabAlignTrailingTabbedPane, "cell 0 3"); panel5.add(tabAlignTrailingTabbedPane, "cell 0 3");
} }
panel3.add(panel5, "cell 0 9"); panel3.add(panel5, "cell 0 9");
} }
add(panel3, "cell 2 0"); add(panel3, "cell 2 0");
//---- separator2 ----
separator2.setName("separator2");
add(separator2, "cell 0 1 3 1"); add(separator2, "cell 0 1 3 1");
//======== panel4 ======== //======== panel4 ========
{ {
panel4.setName("panel4");
panel4.setLayout(new MigLayout( panel4.setLayout(new MigLayout(
"insets 0,hidemode 3", "insets 0,hidemode 3",
// columns // columns
@@ -890,34 +742,29 @@ class TabsPanel
//---- scrollButtonsPolicyLabel ---- //---- scrollButtonsPolicyLabel ----
scrollButtonsPolicyLabel.setText("Scroll buttons policy:"); scrollButtonsPolicyLabel.setText("Scroll buttons policy:");
scrollButtonsPolicyLabel.setName("scrollButtonsPolicyLabel");
panel4.add(scrollButtonsPolicyLabel, "cell 0 0"); panel4.add(scrollButtonsPolicyLabel, "cell 0 0");
//======== scrollButtonsPolicyToolBar ======== //======== scrollButtonsPolicyToolBar ========
{ {
scrollButtonsPolicyToolBar.setFloatable(false); scrollButtonsPolicyToolBar.setFloatable(false);
scrollButtonsPolicyToolBar.setBorder(BorderFactory.createEmptyBorder()); scrollButtonsPolicyToolBar.setBorder(BorderFactory.createEmptyBorder());
scrollButtonsPolicyToolBar.setName("scrollButtonsPolicyToolBar");
//---- scrollAsNeededSingleButton ---- //---- scrollAsNeededSingleButton ----
scrollAsNeededSingleButton.setText("asNeededSingle"); scrollAsNeededSingleButton.setText("asNeededSingle");
scrollAsNeededSingleButton.setSelected(true); scrollAsNeededSingleButton.setSelected(true);
scrollAsNeededSingleButton.putClientProperty("FlatLaf.styleClass", "small"); scrollAsNeededSingleButton.putClientProperty("FlatLaf.styleClass", "small");
scrollAsNeededSingleButton.setName("scrollAsNeededSingleButton");
scrollAsNeededSingleButton.addActionListener(e -> scrollButtonsPolicyChanged()); scrollAsNeededSingleButton.addActionListener(e -> scrollButtonsPolicyChanged());
scrollButtonsPolicyToolBar.add(scrollAsNeededSingleButton); scrollButtonsPolicyToolBar.add(scrollAsNeededSingleButton);
//---- scrollAsNeededButton ---- //---- scrollAsNeededButton ----
scrollAsNeededButton.setText("asNeeded"); scrollAsNeededButton.setText("asNeeded");
scrollAsNeededButton.putClientProperty("FlatLaf.styleClass", "small"); scrollAsNeededButton.putClientProperty("FlatLaf.styleClass", "small");
scrollAsNeededButton.setName("scrollAsNeededButton");
scrollAsNeededButton.addActionListener(e -> scrollButtonsPolicyChanged()); scrollAsNeededButton.addActionListener(e -> scrollButtonsPolicyChanged());
scrollButtonsPolicyToolBar.add(scrollAsNeededButton); scrollButtonsPolicyToolBar.add(scrollAsNeededButton);
//---- scrollNeverButton ---- //---- scrollNeverButton ----
scrollNeverButton.setText("never"); scrollNeverButton.setText("never");
scrollNeverButton.putClientProperty("FlatLaf.styleClass", "small"); scrollNeverButton.putClientProperty("FlatLaf.styleClass", "small");
scrollNeverButton.setName("scrollNeverButton");
scrollNeverButton.addActionListener(e -> scrollButtonsPolicyChanged()); scrollNeverButton.addActionListener(e -> scrollButtonsPolicyChanged());
scrollButtonsPolicyToolBar.add(scrollNeverButton); scrollButtonsPolicyToolBar.add(scrollNeverButton);
} }
@@ -925,27 +772,23 @@ class TabsPanel
//---- scrollButtonsPlacementLabel ---- //---- scrollButtonsPlacementLabel ----
scrollButtonsPlacementLabel.setText("Scroll buttons placement:"); scrollButtonsPlacementLabel.setText("Scroll buttons placement:");
scrollButtonsPlacementLabel.setName("scrollButtonsPlacementLabel");
panel4.add(scrollButtonsPlacementLabel, "cell 2 0"); panel4.add(scrollButtonsPlacementLabel, "cell 2 0");
//======== scrollButtonsPlacementToolBar ======== //======== scrollButtonsPlacementToolBar ========
{ {
scrollButtonsPlacementToolBar.setFloatable(false); scrollButtonsPlacementToolBar.setFloatable(false);
scrollButtonsPlacementToolBar.setBorder(BorderFactory.createEmptyBorder()); scrollButtonsPlacementToolBar.setBorder(BorderFactory.createEmptyBorder());
scrollButtonsPlacementToolBar.setName("scrollButtonsPlacementToolBar");
//---- scrollBothButton ---- //---- scrollBothButton ----
scrollBothButton.setText("both"); scrollBothButton.setText("both");
scrollBothButton.setSelected(true); scrollBothButton.setSelected(true);
scrollBothButton.putClientProperty("FlatLaf.styleClass", "small"); scrollBothButton.putClientProperty("FlatLaf.styleClass", "small");
scrollBothButton.setName("scrollBothButton");
scrollBothButton.addActionListener(e -> scrollButtonsPlacementChanged()); scrollBothButton.addActionListener(e -> scrollButtonsPlacementChanged());
scrollButtonsPlacementToolBar.add(scrollBothButton); scrollButtonsPlacementToolBar.add(scrollBothButton);
//---- scrollTrailingButton ---- //---- scrollTrailingButton ----
scrollTrailingButton.setText("trailing"); scrollTrailingButton.setText("trailing");
scrollTrailingButton.putClientProperty("FlatLaf.styleClass", "small"); scrollTrailingButton.putClientProperty("FlatLaf.styleClass", "small");
scrollTrailingButton.setName("scrollTrailingButton");
scrollTrailingButton.addActionListener(e -> scrollButtonsPlacementChanged()); scrollTrailingButton.addActionListener(e -> scrollButtonsPlacementChanged());
scrollButtonsPlacementToolBar.add(scrollTrailingButton); scrollButtonsPlacementToolBar.add(scrollTrailingButton);
} }
@@ -953,33 +796,28 @@ class TabsPanel
//---- showTabSeparatorsCheckBox ---- //---- showTabSeparatorsCheckBox ----
showTabSeparatorsCheckBox.setText("Show tab separators"); showTabSeparatorsCheckBox.setText("Show tab separators");
showTabSeparatorsCheckBox.setName("showTabSeparatorsCheckBox");
showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged()); showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged());
panel4.add(showTabSeparatorsCheckBox, "cell 4 0"); panel4.add(showTabSeparatorsCheckBox, "cell 4 0");
//---- tabsPopupPolicyLabel ---- //---- tabsPopupPolicyLabel ----
tabsPopupPolicyLabel.setText("Tabs popup policy:"); tabsPopupPolicyLabel.setText("Tabs popup policy:");
tabsPopupPolicyLabel.setName("tabsPopupPolicyLabel");
panel4.add(tabsPopupPolicyLabel, "cell 0 1"); panel4.add(tabsPopupPolicyLabel, "cell 0 1");
//======== tabsPopupPolicyToolBar ======== //======== tabsPopupPolicyToolBar ========
{ {
tabsPopupPolicyToolBar.setFloatable(false); tabsPopupPolicyToolBar.setFloatable(false);
tabsPopupPolicyToolBar.setBorder(BorderFactory.createEmptyBorder()); tabsPopupPolicyToolBar.setBorder(BorderFactory.createEmptyBorder());
tabsPopupPolicyToolBar.setName("tabsPopupPolicyToolBar");
//---- popupAsNeededButton ---- //---- popupAsNeededButton ----
popupAsNeededButton.setText("asNeeded"); popupAsNeededButton.setText("asNeeded");
popupAsNeededButton.setSelected(true); popupAsNeededButton.setSelected(true);
popupAsNeededButton.putClientProperty("FlatLaf.styleClass", "small"); popupAsNeededButton.putClientProperty("FlatLaf.styleClass", "small");
popupAsNeededButton.setName("popupAsNeededButton");
popupAsNeededButton.addActionListener(e -> tabsPopupPolicyChanged()); popupAsNeededButton.addActionListener(e -> tabsPopupPolicyChanged());
tabsPopupPolicyToolBar.add(popupAsNeededButton); tabsPopupPolicyToolBar.add(popupAsNeededButton);
//---- popupNeverButton ---- //---- popupNeverButton ----
popupNeverButton.setText("never"); popupNeverButton.setText("never");
popupNeverButton.putClientProperty("FlatLaf.styleClass", "small"); popupNeverButton.putClientProperty("FlatLaf.styleClass", "small");
popupNeverButton.setName("popupNeverButton");
popupNeverButton.addActionListener(e -> tabsPopupPolicyChanged()); popupNeverButton.addActionListener(e -> tabsPopupPolicyChanged());
tabsPopupPolicyToolBar.add(popupNeverButton); tabsPopupPolicyToolBar.add(popupNeverButton);
} }
@@ -987,26 +825,22 @@ class TabsPanel
//---- tabTypeLabel ---- //---- tabTypeLabel ----
tabTypeLabel.setText("Tab type:"); tabTypeLabel.setText("Tab type:");
tabTypeLabel.setName("tabTypeLabel");
panel4.add(tabTypeLabel, "cell 2 1"); panel4.add(tabTypeLabel, "cell 2 1");
//======== tabTypeToolBar ======== //======== tabTypeToolBar ========
{ {
tabTypeToolBar.setFloatable(false); tabTypeToolBar.setFloatable(false);
tabTypeToolBar.setName("tabTypeToolBar");
//---- underlinedTabTypeButton ---- //---- underlinedTabTypeButton ----
underlinedTabTypeButton.setText("underlined"); underlinedTabTypeButton.setText("underlined");
underlinedTabTypeButton.setSelected(true); underlinedTabTypeButton.setSelected(true);
underlinedTabTypeButton.putClientProperty("FlatLaf.styleClass", "small"); underlinedTabTypeButton.putClientProperty("FlatLaf.styleClass", "small");
underlinedTabTypeButton.setName("underlinedTabTypeButton");
underlinedTabTypeButton.addActionListener(e -> tabTypeChanged()); underlinedTabTypeButton.addActionListener(e -> tabTypeChanged());
tabTypeToolBar.add(underlinedTabTypeButton); tabTypeToolBar.add(underlinedTabTypeButton);
//---- cardTabTypeButton ---- //---- cardTabTypeButton ----
cardTabTypeButton.setText("card"); cardTabTypeButton.setText("card");
cardTabTypeButton.putClientProperty("FlatLaf.styleClass", "small"); cardTabTypeButton.putClientProperty("FlatLaf.styleClass", "small");
cardTabTypeButton.setName("cardTabTypeButton");
cardTabTypeButton.addActionListener(e -> tabTypeChanged()); cardTabTypeButton.addActionListener(e -> tabTypeChanged());
tabTypeToolBar.add(cardTabTypeButton); tabTypeToolBar.add(cardTabTypeButton);
} }

View File

@@ -1,9 +1,8 @@
JFDML JFormDesigner: "7.0.5.0.382" Java: "16" encoding: "UTF-8" JFDML JFormDesigner: "7.0.5.0.404" Java: "17" encoding: "UTF-8"
new FormModel { new FormModel {
contentType: "form/swing" contentType: "form/swing"
root: new FormRoot { root: new FormRoot {
"$setComponentNames": true
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets dialog,hidemode 3" "$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[grow,fill]para[fill]para[fill]" "$columnConstraints": "[grow,fill]para[fill]para[fill]"

View File

@@ -144,13 +144,13 @@ public class IJThemesPanel
// add core themes at beginning // add core themes at beginning
categories.put( themes.size(), "Core Themes" ); categories.put( themes.size(), "Core Themes" );
if( showLight ) if( showLight )
themes.add( new IJThemeInfo( "Flat Light", null, false, null, null, null, null, null, FlatLightLaf.class.getName() ) ); themes.add( new IJThemeInfo( "FlatLaf Light", null, false, null, null, null, null, null, FlatLightLaf.class.getName() ) );
if( showDark ) if( showDark )
themes.add( new IJThemeInfo( "Flat Dark", null, true, null, null, null, null, null, FlatDarkLaf.class.getName() ) ); themes.add( new IJThemeInfo( "FlatLaf Dark", null, true, null, null, null, null, null, FlatDarkLaf.class.getName() ) );
if( showLight ) if( showLight )
themes.add( new IJThemeInfo( "Flat IntelliJ", null, false, null, null, null, null, null, FlatIntelliJLaf.class.getName() ) ); themes.add( new IJThemeInfo( "FlatLaf IntelliJ", null, false, null, null, null, null, null, FlatIntelliJLaf.class.getName() ) );
if( showDark ) if( showDark )
themes.add( new IJThemeInfo( "Flat Darcula", null, true, null, null, null, null, null, FlatDarculaLaf.class.getName() ) ); themes.add( new IJThemeInfo( "FlatLaf Darcula", null, true, null, null, null, null, null, FlatDarculaLaf.class.getName() ) );
// add themes from directory // add themes from directory
categories.put( themes.size(), "Current Directory" ); categories.put( themes.size(), "Current Directory" );

View File

@@ -475,7 +475,7 @@ public class FlatInspector
appendRow( buf, "Border", toString( ((JComponent)c).getBorder(), classHierarchy ) ); appendRow( buf, "Border", toString( ((JComponent)c).getBorder(), classHierarchy ) );
appendRow( buf, "Background", toString( c.getBackground() ) + (c.isBackgroundSet() ? "" : " NOT SET") ); appendRow( buf, "Background", toString( c.getBackground() ) + (c.isBackgroundSet() ? "" : " NOT SET") );
appendRow( buf, "Foreground", toString( c.getForeground() ) + (c.isBackgroundSet() ? "" : " NOT SET") ); appendRow( buf, "Foreground", toString( c.getForeground() ) + (c.isForegroundSet() ? "" : " NOT SET") );
appendRow( buf, "Font", toString( c.getFont() ) + (c.isFontSet() ? "" : " NOT SET") ); appendRow( buf, "Font", toString( c.getFont() ) + (c.isFontSet() ? "" : " NOT SET") );
if( c instanceof JComponent ) { if( c instanceof JComponent ) {

View File

@@ -273,15 +273,31 @@ public class FlatSVGIcon
// since the input stream is already loaded and parsed, // since the input stream is already loaded and parsed,
// get diagram here and remove it from cache // get diagram here and remove it from cache
update(); update();
synchronized( FlatSVGIcon.class ) {
svgCache.remove( uri ); svgCache.remove( uri );
} }
}
private static URI loadFromStream( InputStream in ) throws IOException { private static synchronized URI loadFromStream( InputStream in ) throws IOException {
try( InputStream in2 = in ) { try( InputStream in2 = in ) {
return svgUniverse.loadSVG( in2, "/flatlaf-stream-" + (streamNumber++) ); return svgUniverse.loadSVG( in2, "/flatlaf-stream-" + (streamNumber++) );
} }
} }
/**
* Creates a copy of the given icon.
* <p>
* If the icon has a color filter, then it is shared with the new icon.
*
* @since 2.0.1
*/
public FlatSVGIcon( FlatSVGIcon icon ) {
this( icon.name, icon.width, icon.height, icon.scale, icon.disabled, icon.classLoader, icon.uri );
colorFilter = icon.colorFilter;
diagram = icon.diagram;
dark = icon.dark;
}
protected FlatSVGIcon( String name, int width, int height, float scale, boolean disabled, ClassLoader classLoader, URI uri ) { protected FlatSVGIcon( String name, int width, int height, float scale, boolean disabled, ClassLoader classLoader, URI uri ) {
this.name = name; this.name = name;
this.width = width; this.width = width;
@@ -475,7 +491,7 @@ public class FlatSVGIcon
loadFailed = (diagram == null); loadFailed = (diagram == null);
} }
static SVGDiagram loadSVG( URI uri ) { static synchronized SVGDiagram loadSVG( URI uri ) {
// get from our cache // get from our cache
SVGDiagram diagram = svgCache.get( uri ); SVGDiagram diagram = svgCache.get( uri );
if( diagram != null ) if( diagram != null )

View File

@@ -21,8 +21,9 @@
# a variable base color (usually the current background color of a component). # a variable base color (usually the current background color of a component).
# This works only for a limited set of UI keys. # This works only for a limited set of UI keys.
# #
# The property key is the UI key of a color, which is computed at runtime. # In this properties file:
# The property value is the UI key of the base color. # - The property key is the UI key of a color, which is computed at runtime.
# - The property value is the UI key of the base color.
# #
# This file is not used at runtime. # This file is not used at runtime.
# It is only used in tooling (e.g. UI Defaults Inspector or UIDefaultsDump). # It is only used in tooling (e.g. UI Defaults Inspector or UIDefaultsDump).

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -932,7 +932,7 @@ Slider.disabledTrackColor #54595c HSL 203 5 35 javax.swing.plaf.Colo
Slider.focus #7a7d7f HSL 204 2 49 javax.swing.plaf.ColorUIResource [UI] Slider.focus #7a7d7f HSL 204 2 49 javax.swing.plaf.ColorUIResource [UI]
Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
Slider.focusWidth 4 Slider.focusWidth 4
Slider.focusedColor #3c628cb3 70% HSLA 212 40 39 70 com.formdev.flatlaf.util.DerivedColor [UI] fade(70%) Slider.focusedColor #7097c24d 30% HSLA 211 40 60 30 com.formdev.flatlaf.util.DerivedColor [UI] changeLightness(60%) fade(30%)
Slider.font [active] $defaultFont [UI] Slider.font [active] $defaultFont [UI]
Slider.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] Slider.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI]
Slider.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI]
@@ -1207,16 +1207,16 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
#---- TitlePane ---- #---- TitlePane ----
TitlePane.background #303234 HSL 210 4 20 javax.swing.plaf.ColorUIResource [UI] TitlePane.background #303234 HSL 210 4 20 javax.swing.plaf.ColorUIResource [UI]
TitlePane.buttonHoverBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) TitlePane.buttonHoverBackground #55585c HSL 214 4 35 com.formdev.flatlaf.util.DerivedColor [UI] lighten(15% autoInverse)
TitlePane.buttonMaximizedHeight 22 TitlePane.buttonMaximizedHeight 22
TitlePane.buttonPressedBackground #616569 HSL 210 4 40 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse) TitlePane.buttonPressedBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
TitlePane.centerTitle false TitlePane.centerTitle false
TitlePane.centerTitleIfMenuBarEmbedded true TitlePane.centerTitleIfMenuBarEmbedded true
TitlePane.closeHoverBackground #e81123 HSL 355 86 49 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverBackground #c42b1c HSL 5 75 44 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
TitlePane.closePressedBackground #e8112399 60% HSLA 355 86 49 60 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedBackground #c42b1ce6 90% HSLA 5 75 44 90 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.embeddedForeground #959595 HSL 0 0 58 javax.swing.plaf.ColorUIResource [UI] TitlePane.embeddedForeground #959595 HSL 0 0 58 javax.swing.plaf.ColorUIResource [UI]
TitlePane.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] TitlePane.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI]
@@ -1424,13 +1424,13 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
#---- [style]Button ---- #---- [style]Button ----
[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: $TextField.background; toolbar.pressedBackground: $TextField.background [style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: null; toolbar.pressedBackground: null
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived) [style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)
#---- [style]ToggleButton ---- #---- [style]ToggleButton ----
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived) [style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)
#---- [style]ToolBar ---- #---- [style]ToolBar ----

View File

@@ -937,7 +937,7 @@ Slider.disabledTrackColor #d1d1d1 HSL 0 0 82 javax.swing.plaf.Colo
Slider.focus #9c9c9c HSL 0 0 61 javax.swing.plaf.ColorUIResource [UI] Slider.focus #9c9c9c HSL 0 0 61 javax.swing.plaf.ColorUIResource [UI]
Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
Slider.focusWidth 4 Slider.focusWidth 4
Slider.focusedColor #98c3eb80 50% HSLA 209 67 76 50 com.formdev.flatlaf.util.DerivedColor [UI] fade(50%) Slider.focusedColor #94c1ea80 50% HSLA 209 67 75 50 com.formdev.flatlaf.util.DerivedColor [UI] changeLightness(75%) fade(50%)
Slider.font [active] $defaultFont [UI] Slider.font [active] $defaultFont [UI]
Slider.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] Slider.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
Slider.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
@@ -1214,14 +1214,14 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
TitlePane.background #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.background #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.buttonHoverBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) TitlePane.buttonHoverBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
TitlePane.buttonMaximizedHeight 22 TitlePane.buttonMaximizedHeight 22
TitlePane.buttonPressedBackground #cccccc HSL 0 0 80 com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) TitlePane.buttonPressedBackground #ebebeb HSL 0 0 92 com.formdev.flatlaf.util.DerivedColor [UI] darken(8% autoInverse)
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
TitlePane.centerTitle false TitlePane.centerTitle false
TitlePane.centerTitleIfMenuBarEmbedded true TitlePane.centerTitleIfMenuBarEmbedded true
TitlePane.closeHoverBackground #e81123 HSL 355 86 49 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverBackground #c42b1c HSL 5 75 44 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
TitlePane.closePressedBackground #e8112399 60% HSLA 355 86 49 60 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedBackground #c42b1ce6 90% HSLA 5 75 44 90 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.embeddedForeground #595959 HSL 0 0 35 javax.swing.plaf.ColorUIResource [UI] TitlePane.embeddedForeground #595959 HSL 0 0 35 javax.swing.plaf.ColorUIResource [UI]
TitlePane.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] TitlePane.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
@@ -1429,13 +1429,13 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
#---- [style]Button ---- #---- [style]Button ----
[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: $TextField.background; toolbar.pressedBackground: $TextField.background [style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: null; toolbar.pressedBackground: null
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived) [style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy)
#---- [style]ToggleButton ---- #---- [style]ToggleButton ----
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived) [style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy)
#---- [style]ToolBar ---- #---- [style]ToolBar ----

View File

@@ -1,6 +1,6 @@
Class com.formdev.flatlaf.testing.FlatTestLaf Class com.formdev.flatlaf.testing.FlatTestLaf
ID FlatLaf - Flat Test ID FlatLaf - FlatLaf Test
Name Flat Test Name FlatLaf Test
Java 1.8.0_202 Java 1.8.0_202
OS Windows 10 OS Windows 10
@@ -1233,10 +1233,10 @@ TitlePane.buttonMaximizedHeight 22
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
TitlePane.centerTitle false TitlePane.centerTitle false
TitlePane.centerTitleIfMenuBarEmbedded true TitlePane.centerTitleIfMenuBarEmbedded true
TitlePane.closeHoverBackground #e81123 HSL 355 86 49 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverBackground #c42b1c HSL 5 75 44 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closeHoverForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
TitlePane.closePressedBackground #e8112399 60% HSLA 355 86 49 60 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedBackground #c42b1ce6 90% HSLA 5 75 44 90 javax.swing.plaf.ColorUIResource [UI]
TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] TitlePane.closePressedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
TitlePane.foreground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI] TitlePane.foreground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
TitlePane.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) TitlePane.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage)
@@ -1442,7 +1442,7 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
#---- [style]Button ---- #---- [style]Button ----
[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: $TextField.background; toolbar.pressedBackground: $TextField.background [style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: null; toolbar.pressedBackground: null
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1 [style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1

View File

@@ -22,9 +22,12 @@ import java.util.Random;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLightLaf; import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.extras.FlatSVGIcon;
/** /**
* @author Karl Tauber * @author Karl Tauber
@@ -54,6 +57,8 @@ public class FlatStressTest
private JComponent createStressTest() { private JComponent createStressTest() {
return createComboBoxStressTest(); return createComboBoxStressTest();
// return createGetFontStressTest();
// return createSVGIconTest();
} }
// for https://github.com/JFormDesigner/FlatLaf/issues/432 // for https://github.com/JFormDesigner/FlatLaf/issues/432
@@ -80,4 +85,57 @@ public class FlatStressTest
return comboBox; return comboBox;
} }
// for https://github.com/JFormDesigner/FlatLaf/issues/456
@SuppressWarnings( "unused" )
private JComponent createGetFontStressTest() {
JLabel label = new JLabel( "test" );
Runnable runnable = () -> {
for(;;) {
UIManager.getFont( "Label.font" );
}
};
Thread thread1 = new Thread( runnable);
thread1.setDaemon( true );
thread1.start();
Thread thread2 = new Thread( runnable);
thread2.setDaemon( true );
thread2.start();
Thread thread3 = new Thread( runnable);
thread3.setDaemon( true );
thread3.start();
return label;
}
// for https://github.com/JFormDesigner/FlatLaf/issues/459
@SuppressWarnings( "unused" )
private JComponent createSVGIconTest() {
JLabel label = new JLabel( "test" );
Runnable runnable = () -> {
for(;;) {
FlatSVGIcon icon = new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/back.svg" );
icon.getIconHeight();
}
};
Thread thread1 = new Thread( runnable);
thread1.setDaemon( true );
thread1.start();
Thread thread2 = new Thread( runnable);
thread2.setDaemon( true );
thread2.start();
Thread thread3 = new Thread( runnable);
thread3.setDaemon( true );
thread3.start();
return label;
}
} }

View File

@@ -111,11 +111,11 @@ public class FlatTestFrame
// initialize look and feels combo box // initialize look and feels combo box
DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>(); DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>();
lafModel.addElement( new LookAndFeelInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Light (F1)", FlatLightLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat Dark (F2)", FlatDarkLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Dark (F2)", FlatDarkLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat IntelliJ (F3)", FlatIntelliJLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf IntelliJ (F3)", FlatIntelliJLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat Darcula (F4)", FlatDarculaLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Darcula (F4)", FlatDarculaLaf.class.getName() ) );
lafModel.addElement( new LookAndFeelInfo( "Flat Test (F8)", FlatTestLaf.class.getName() ) ); lafModel.addElement( new LookAndFeelInfo( "FlatLaf Test (F8)", FlatTestLaf.class.getName() ) );
UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels(); UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels();
for( UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels ) { for( UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels ) {

View File

@@ -32,12 +32,12 @@ public class FlatTestLaf
{ {
@Override @Override
public String getName() { public String getName() {
return "Flat Test"; return "FlatLaf Test";
} }
@Override @Override
public String getDescription() { public String getDescription() {
return "Flat Test Look and Feel"; return "FlatLaf Test Look and Feel";
} }
@Override @Override

View File

@@ -234,7 +234,6 @@ public class FlatTextComponentsTest
JMenuItem pasteMenuItem = new JMenuItem(); JMenuItem pasteMenuItem = new JMenuItem();
//======== this ======== //======== this ========
setName("this");
setLayout(new MigLayout( setLayout(new MigLayout(
"ltr,insets dialog,hidemode 3", "ltr,insets dialog,hidemode 3",
// columns // columns
@@ -267,21 +266,18 @@ public class FlatTextComponentsTest
textFieldLabel.setText("JTextField:"); textFieldLabel.setText("JTextField:");
textFieldLabel.setDisplayedMnemonic('T'); textFieldLabel.setDisplayedMnemonic('T');
textFieldLabel.setLabelFor(textField1); textFieldLabel.setLabelFor(textField1);
textFieldLabel.setName("textFieldLabel");
add(textFieldLabel, "cell 0 0"); add(textFieldLabel, "cell 0 0");
//---- textField1 ---- //---- textField1 ----
textField1.setText("editable"); textField1.setText("editable");
textField1.setComponentPopupMenu(popupMenu1); textField1.setComponentPopupMenu(popupMenu1);
textField1.putClientProperty("JTextField.placeholderText", "place"); textField1.putClientProperty("JTextField.placeholderText", "place");
textField1.setName("textField1");
add(textField1, "cell 1 0,growx"); add(textField1, "cell 1 0,growx");
//---- textField3 ---- //---- textField3 ----
textField3.setText("longer text for testing horizontal scrolling"); textField3.setText("longer text for testing horizontal scrolling");
textField3.setComponentPopupMenu(popupMenu1); textField3.setComponentPopupMenu(popupMenu1);
textField3.putClientProperty("JTextField.placeholderText", "place"); textField3.putClientProperty("JTextField.placeholderText", "place");
textField3.setName("textField3");
add(textField3, "cell 2 0,growx"); add(textField3, "cell 2 0,growx");
//---- textField2 ---- //---- textField2 ----
@@ -290,34 +286,29 @@ public class FlatTextComponentsTest
textField2.setSelectionEnd(4); textField2.setSelectionEnd(4);
textField2.setComponentPopupMenu(popupMenu1); textField2.setComponentPopupMenu(popupMenu1);
textField2.putClientProperty("JTextField.placeholderText", "place"); textField2.putClientProperty("JTextField.placeholderText", "place");
textField2.setName("textField2");
add(textField2, "cell 3 0"); add(textField2, "cell 3 0");
//---- formattedTextFieldLabel ---- //---- formattedTextFieldLabel ----
formattedTextFieldLabel.setText("JFormattedTextField:"); formattedTextFieldLabel.setText("JFormattedTextField:");
formattedTextFieldLabel.setDisplayedMnemonic('F'); formattedTextFieldLabel.setDisplayedMnemonic('F');
formattedTextFieldLabel.setLabelFor(formattedTextField1); formattedTextFieldLabel.setLabelFor(formattedTextField1);
formattedTextFieldLabel.setName("formattedTextFieldLabel");
add(formattedTextFieldLabel, "cell 0 1"); add(formattedTextFieldLabel, "cell 0 1");
//---- formattedTextField1 ---- //---- formattedTextField1 ----
formattedTextField1.setText("editable"); formattedTextField1.setText("editable");
formattedTextField1.setComponentPopupMenu(popupMenu1); formattedTextField1.setComponentPopupMenu(popupMenu1);
formattedTextField1.putClientProperty("JTextField.placeholderText", "place"); formattedTextField1.putClientProperty("JTextField.placeholderText", "place");
formattedTextField1.setName("formattedTextField1");
add(formattedTextField1, "cell 1 1,growx"); add(formattedTextField1, "cell 1 1,growx");
//---- formattedTextField3 ---- //---- formattedTextField3 ----
formattedTextField3.setText("longer text for testing horizontal scrolling"); formattedTextField3.setText("longer text for testing horizontal scrolling");
formattedTextField3.setComponentPopupMenu(popupMenu1); formattedTextField3.setComponentPopupMenu(popupMenu1);
formattedTextField3.putClientProperty("JTextField.placeholderText", "place"); formattedTextField3.putClientProperty("JTextField.placeholderText", "place");
formattedTextField3.setName("formattedTextField3");
add(formattedTextField3, "cell 2 1,growx"); add(formattedTextField3, "cell 2 1,growx");
//======== panel1 ======== //======== panel1 ========
{ {
panel1.setBorder(new TitledBorder("Control")); panel1.setBorder(new TitledBorder("Control"));
panel1.setName("panel1");
panel1.setLayout(new MigLayout( panel1.setLayout(new MigLayout(
"hidemode 3", "hidemode 3",
// columns // columns
@@ -340,97 +331,80 @@ public class FlatTextComponentsTest
//---- button1 ---- //---- button1 ----
button1.setText("change text"); button1.setText("change text");
button1.setName("button1");
button1.addActionListener(e -> changeText()); button1.addActionListener(e -> changeText());
panel1.add(button1, "cell 0 0 2 1,alignx left,growx 0"); panel1.add(button1, "cell 0 0 2 1,alignx left,growx 0");
//---- leftPaddingLabel ---- //---- leftPaddingLabel ----
leftPaddingLabel.setText("Left padding:"); leftPaddingLabel.setText("Left padding:");
leftPaddingLabel.setName("leftPaddingLabel");
panel1.add(leftPaddingLabel, "cell 0 1"); panel1.add(leftPaddingLabel, "cell 0 1");
//---- leftPaddingField ---- //---- leftPaddingField ----
leftPaddingField.setName("leftPaddingField");
leftPaddingField.addChangeListener(e -> paddingChanged()); leftPaddingField.addChangeListener(e -> paddingChanged());
panel1.add(leftPaddingField, "cell 1 1"); panel1.add(leftPaddingField, "cell 1 1");
//---- rightPaddingLabel ---- //---- rightPaddingLabel ----
rightPaddingLabel.setText("Right padding:"); rightPaddingLabel.setText("Right padding:");
rightPaddingLabel.setName("rightPaddingLabel");
panel1.add(rightPaddingLabel, "cell 0 2"); panel1.add(rightPaddingLabel, "cell 0 2");
//---- rightPaddingField ---- //---- rightPaddingField ----
rightPaddingField.setName("rightPaddingField");
rightPaddingField.addChangeListener(e -> paddingChanged()); rightPaddingField.addChangeListener(e -> paddingChanged());
panel1.add(rightPaddingField, "cell 1 2"); panel1.add(rightPaddingField, "cell 1 2");
//---- topPaddingLabel ---- //---- topPaddingLabel ----
topPaddingLabel.setText("Top padding:"); topPaddingLabel.setText("Top padding:");
topPaddingLabel.setName("topPaddingLabel");
panel1.add(topPaddingLabel, "cell 0 3"); panel1.add(topPaddingLabel, "cell 0 3");
//---- topPaddingField ---- //---- topPaddingField ----
topPaddingField.setName("topPaddingField");
topPaddingField.addChangeListener(e -> paddingChanged()); topPaddingField.addChangeListener(e -> paddingChanged());
panel1.add(topPaddingField, "cell 1 3"); panel1.add(topPaddingField, "cell 1 3");
//---- bottomPaddingLabel ---- //---- bottomPaddingLabel ----
bottomPaddingLabel.setText("Bottom padding:"); bottomPaddingLabel.setText("Bottom padding:");
bottomPaddingLabel.setName("bottomPaddingLabel");
panel1.add(bottomPaddingLabel, "cell 0 4"); panel1.add(bottomPaddingLabel, "cell 0 4");
//---- bottomPaddingField ---- //---- bottomPaddingField ----
bottomPaddingField.setName("bottomPaddingField");
bottomPaddingField.addChangeListener(e -> paddingChanged()); bottomPaddingField.addChangeListener(e -> paddingChanged());
panel1.add(bottomPaddingField, "cell 1 4"); panel1.add(bottomPaddingField, "cell 1 4");
//---- leadingIconCheckBox ---- //---- leadingIconCheckBox ----
leadingIconCheckBox.setText("leading icon"); leadingIconCheckBox.setText("leading icon");
leadingIconCheckBox.setName("leadingIconCheckBox");
leadingIconCheckBox.addActionListener(e -> leadingIcon()); leadingIconCheckBox.addActionListener(e -> leadingIcon());
panel1.add(leadingIconCheckBox, "cell 0 5 2 1,alignx left,growx 0"); panel1.add(leadingIconCheckBox, "cell 0 5 2 1,alignx left,growx 0");
//---- trailingIconCheckBox ---- //---- trailingIconCheckBox ----
trailingIconCheckBox.setText("trailing icon"); trailingIconCheckBox.setText("trailing icon");
trailingIconCheckBox.setName("trailingIconCheckBox");
trailingIconCheckBox.addActionListener(e -> trailingIcon()); trailingIconCheckBox.addActionListener(e -> trailingIcon());
panel1.add(trailingIconCheckBox, "cell 0 6 2 1,alignx left,growx 0"); panel1.add(trailingIconCheckBox, "cell 0 6 2 1,alignx left,growx 0");
//---- leadingComponentCheckBox ---- //---- leadingComponentCheckBox ----
leadingComponentCheckBox.setText("leading component"); leadingComponentCheckBox.setText("leading component");
leadingComponentCheckBox.setName("leadingComponentCheckBox");
leadingComponentCheckBox.addActionListener(e -> leadingComponent()); leadingComponentCheckBox.addActionListener(e -> leadingComponent());
panel1.add(leadingComponentCheckBox, "cell 0 7 2 1,alignx left,growx 0"); panel1.add(leadingComponentCheckBox, "cell 0 7 2 1,alignx left,growx 0");
//---- trailingComponentCheckBox ---- //---- trailingComponentCheckBox ----
trailingComponentCheckBox.setText("trailing component"); trailingComponentCheckBox.setText("trailing component");
trailingComponentCheckBox.setName("trailingComponentCheckBox");
trailingComponentCheckBox.addActionListener(e -> trailingComponent()); trailingComponentCheckBox.addActionListener(e -> trailingComponent());
panel1.add(trailingComponentCheckBox, "cell 0 8 2 1,alignx left,growx 0"); panel1.add(trailingComponentCheckBox, "cell 0 8 2 1,alignx left,growx 0");
//---- leadingComponentVisibleCheckBox ---- //---- leadingComponentVisibleCheckBox ----
leadingComponentVisibleCheckBox.setText("leading component visible"); leadingComponentVisibleCheckBox.setText("leading component visible");
leadingComponentVisibleCheckBox.setSelected(true); leadingComponentVisibleCheckBox.setSelected(true);
leadingComponentVisibleCheckBox.setName("leadingComponentVisibleCheckBox");
leadingComponentVisibleCheckBox.addActionListener(e -> leadingComponentVisible()); leadingComponentVisibleCheckBox.addActionListener(e -> leadingComponentVisible());
panel1.add(leadingComponentVisibleCheckBox, "cell 0 9 2 1,alignx left,growx 0"); panel1.add(leadingComponentVisibleCheckBox, "cell 0 9 2 1,alignx left,growx 0");
//---- trailingComponentVisibleCheckBox ---- //---- trailingComponentVisibleCheckBox ----
trailingComponentVisibleCheckBox.setText("trailing component visible"); trailingComponentVisibleCheckBox.setText("trailing component visible");
trailingComponentVisibleCheckBox.setSelected(true); trailingComponentVisibleCheckBox.setSelected(true);
trailingComponentVisibleCheckBox.setName("trailingComponentVisibleCheckBox");
trailingComponentVisibleCheckBox.addActionListener(e -> trailingComponentVisible()); trailingComponentVisibleCheckBox.addActionListener(e -> trailingComponentVisible());
panel1.add(trailingComponentVisibleCheckBox, "cell 0 10 2 1,alignx left,growx 0"); panel1.add(trailingComponentVisibleCheckBox, "cell 0 10 2 1,alignx left,growx 0");
//---- showClearButtonCheckBox ---- //---- showClearButtonCheckBox ----
showClearButtonCheckBox.setText("clear button"); showClearButtonCheckBox.setText("clear button");
showClearButtonCheckBox.setName("showClearButtonCheckBox");
showClearButtonCheckBox.addActionListener(e -> showClearButton()); showClearButtonCheckBox.addActionListener(e -> showClearButton());
panel1.add(showClearButtonCheckBox, "cell 0 11 2 1,alignx left,growx 0"); panel1.add(showClearButtonCheckBox, "cell 0 11 2 1,alignx left,growx 0");
//---- showRevealButtonCheckBox ---- //---- showRevealButtonCheckBox ----
showRevealButtonCheckBox.setText("password reveal button"); showRevealButtonCheckBox.setText("password reveal button");
showRevealButtonCheckBox.setName("showRevealButtonCheckBox");
showRevealButtonCheckBox.addActionListener(e -> showRevealButton()); showRevealButtonCheckBox.addActionListener(e -> showRevealButton());
panel1.add(showRevealButtonCheckBox, "cell 0 12 2 1,alignx left,growx 0"); panel1.add(showRevealButtonCheckBox, "cell 0 12 2 1,alignx left,growx 0");
} }
@@ -440,50 +414,42 @@ public class FlatTextComponentsTest
passwordFieldLabel.setText("JPasswordField:"); passwordFieldLabel.setText("JPasswordField:");
passwordFieldLabel.setDisplayedMnemonic('P'); passwordFieldLabel.setDisplayedMnemonic('P');
passwordFieldLabel.setLabelFor(passwordField1); passwordFieldLabel.setLabelFor(passwordField1);
passwordFieldLabel.setName("passwordFieldLabel");
add(passwordFieldLabel, "cell 0 2"); add(passwordFieldLabel, "cell 0 2");
//---- passwordField1 ---- //---- passwordField1 ----
passwordField1.setText("editable"); passwordField1.setText("editable");
passwordField1.setComponentPopupMenu(popupMenu1); passwordField1.setComponentPopupMenu(popupMenu1);
passwordField1.putClientProperty("JTextField.placeholderText", "place"); passwordField1.putClientProperty("JTextField.placeholderText", "place");
passwordField1.setName("passwordField1");
add(passwordField1, "cell 1 2,growx"); add(passwordField1, "cell 1 2,growx");
//---- passwordField3 ---- //---- passwordField3 ----
passwordField3.setText("longer text for testing horizontal scrolling"); passwordField3.setText("longer text for testing horizontal scrolling");
passwordField3.setComponentPopupMenu(popupMenu1); passwordField3.setComponentPopupMenu(popupMenu1);
passwordField3.putClientProperty("JTextField.placeholderText", "place"); passwordField3.putClientProperty("JTextField.placeholderText", "place");
passwordField3.setName("passwordField3");
add(passwordField3, "cell 2 2,growx"); add(passwordField3, "cell 2 2,growx");
//---- textAreaLabel ---- //---- textAreaLabel ----
textAreaLabel.setText("JTextArea:"); textAreaLabel.setText("JTextArea:");
textAreaLabel.setDisplayedMnemonic('A'); textAreaLabel.setDisplayedMnemonic('A');
textAreaLabel.setLabelFor(textArea1); textAreaLabel.setLabelFor(textArea1);
textAreaLabel.setName("textAreaLabel");
add(textAreaLabel, "cell 0 3"); add(textAreaLabel, "cell 0 3");
//======== scrollPane1 ======== //======== scrollPane1 ========
{ {
scrollPane1.setName("scrollPane1");
//---- textArea1 ---- //---- textArea1 ----
textArea1.setText("editable"); textArea1.setText("editable");
textArea1.setComponentPopupMenu(popupMenu1); textArea1.setComponentPopupMenu(popupMenu1);
textArea1.setName("textArea1");
scrollPane1.setViewportView(textArea1); scrollPane1.setViewportView(textArea1);
} }
add(scrollPane1, "cell 1 3,growx"); add(scrollPane1, "cell 1 3,growx");
//======== scrollPane3 ======== //======== scrollPane3 ========
{ {
scrollPane3.setName("scrollPane3");
//---- textArea3 ---- //---- textArea3 ----
textArea3.setText("longer text for testing horizontal scrolling"); textArea3.setText("longer text for testing horizontal scrolling");
textArea3.setComponentPopupMenu(popupMenu1); textArea3.setComponentPopupMenu(popupMenu1);
textArea3.setName("textArea3");
scrollPane3.setViewportView(textArea3); scrollPane3.setViewportView(textArea3);
} }
add(scrollPane3, "cell 2 3,growx"); add(scrollPane3, "cell 2 3,growx");
@@ -492,29 +458,24 @@ public class FlatTextComponentsTest
editorPaneLabel.setText("JEditorPane"); editorPaneLabel.setText("JEditorPane");
editorPaneLabel.setDisplayedMnemonic('J'); editorPaneLabel.setDisplayedMnemonic('J');
editorPaneLabel.setLabelFor(editorPane1); editorPaneLabel.setLabelFor(editorPane1);
editorPaneLabel.setName("editorPaneLabel");
add(editorPaneLabel, "cell 0 4"); add(editorPaneLabel, "cell 0 4");
//======== scrollPane5 ======== //======== scrollPane5 ========
{ {
scrollPane5.setName("scrollPane5");
//---- editorPane1 ---- //---- editorPane1 ----
editorPane1.setText("editable"); editorPane1.setText("editable");
editorPane1.setComponentPopupMenu(popupMenu1); editorPane1.setComponentPopupMenu(popupMenu1);
editorPane1.setName("editorPane1");
scrollPane5.setViewportView(editorPane1); scrollPane5.setViewportView(editorPane1);
} }
add(scrollPane5, "cell 1 4,growx"); add(scrollPane5, "cell 1 4,growx");
//======== scrollPane7 ======== //======== scrollPane7 ========
{ {
scrollPane7.setName("scrollPane7");
//---- editorPane3 ---- //---- editorPane3 ----
editorPane3.setText("longer text for testing horizontal scrolling"); editorPane3.setText("longer text for testing horizontal scrolling");
editorPane3.setComponentPopupMenu(popupMenu1); editorPane3.setComponentPopupMenu(popupMenu1);
editorPane3.setName("editorPane3");
scrollPane7.setViewportView(editorPane3); scrollPane7.setViewportView(editorPane3);
} }
add(scrollPane7, "cell 2 4,growx"); add(scrollPane7, "cell 2 4,growx");
@@ -523,29 +484,24 @@ public class FlatTextComponentsTest
textPaneLabel.setText("JTextPane:"); textPaneLabel.setText("JTextPane:");
textPaneLabel.setDisplayedMnemonic('N'); textPaneLabel.setDisplayedMnemonic('N');
textPaneLabel.setLabelFor(textPane1); textPaneLabel.setLabelFor(textPane1);
textPaneLabel.setName("textPaneLabel");
add(textPaneLabel, "cell 0 5"); add(textPaneLabel, "cell 0 5");
//======== scrollPane9 ======== //======== scrollPane9 ========
{ {
scrollPane9.setName("scrollPane9");
//---- textPane1 ---- //---- textPane1 ----
textPane1.setText("editable"); textPane1.setText("editable");
textPane1.setComponentPopupMenu(popupMenu1); textPane1.setComponentPopupMenu(popupMenu1);
textPane1.setName("textPane1");
scrollPane9.setViewportView(textPane1); scrollPane9.setViewportView(textPane1);
} }
add(scrollPane9, "cell 1 5,growx"); add(scrollPane9, "cell 1 5,growx");
//======== scrollPane11 ======== //======== scrollPane11 ========
{ {
scrollPane11.setName("scrollPane11");
//---- textPane3 ---- //---- textPane3 ----
textPane3.setText("longer text for testing horizontal scrolling"); textPane3.setText("longer text for testing horizontal scrolling");
textPane3.setComponentPopupMenu(popupMenu1); textPane3.setComponentPopupMenu(popupMenu1);
textPane3.setName("textPane3");
scrollPane11.setViewportView(textPane3); scrollPane11.setViewportView(textPane3);
} }
add(scrollPane11, "cell 2 5,growx"); add(scrollPane11, "cell 2 5,growx");
@@ -554,7 +510,6 @@ public class FlatTextComponentsTest
comboBoxLabel.setText("JComboBox:"); comboBoxLabel.setText("JComboBox:");
comboBoxLabel.setDisplayedMnemonic('C'); comboBoxLabel.setDisplayedMnemonic('C');
comboBoxLabel.setLabelFor(comboBox1); comboBoxLabel.setLabelFor(comboBox1);
comboBoxLabel.setName("comboBoxLabel");
add(comboBoxLabel, "cell 0 6"); add(comboBoxLabel, "cell 0 6");
//---- comboBox1 ---- //---- comboBox1 ----
@@ -566,7 +521,6 @@ public class FlatTextComponentsTest
"ccc" "ccc"
})); }));
comboBox1.setComponentPopupMenu(popupMenu1); comboBox1.setComponentPopupMenu(popupMenu1);
comboBox1.setName("comboBox1");
add(comboBox1, "cell 1 6,growx"); add(comboBox1, "cell 1 6,growx");
//---- comboBox3 ---- //---- comboBox3 ----
@@ -579,154 +533,121 @@ public class FlatTextComponentsTest
comboBox3.setEditable(true); comboBox3.setEditable(true);
comboBox3.setPrototypeDisplayValue("12345"); comboBox3.setPrototypeDisplayValue("12345");
comboBox3.setComponentPopupMenu(popupMenu1); comboBox3.setComponentPopupMenu(popupMenu1);
comboBox3.setName("comboBox3");
add(comboBox3, "cell 2 6,growx,wmin 50"); add(comboBox3, "cell 2 6,growx,wmin 50");
//---- spinnerLabel ---- //---- spinnerLabel ----
spinnerLabel.setText("JSpinner:"); spinnerLabel.setText("JSpinner:");
spinnerLabel.setDisplayedMnemonic('S'); spinnerLabel.setDisplayedMnemonic('S');
spinnerLabel.setLabelFor(spinner1); spinnerLabel.setLabelFor(spinner1);
spinnerLabel.setName("spinnerLabel");
add(spinnerLabel, "cell 0 7"); add(spinnerLabel, "cell 0 7");
//---- spinner1 ---- //---- spinner1 ----
spinner1.setComponentPopupMenu(popupMenu1); spinner1.setComponentPopupMenu(popupMenu1);
spinner1.setName("spinner1");
add(spinner1, "cell 1 7,growx"); add(spinner1, "cell 1 7,growx");
//---- label2 ---- //---- label2 ----
label2.setText("<html>Large row height:<br>(default pref height)</html>"); label2.setText("<html>Large row height:<br>(default pref height)</html>");
label2.setName("label2");
add(label2, "cell 0 8,aligny top,growy 0"); add(label2, "cell 0 8,aligny top,growy 0");
//---- comboBox2 ---- //---- comboBox2 ----
comboBox2.setEditable(true); comboBox2.setEditable(true);
comboBox2.setName("comboBox2");
add(comboBox2, "cell 1 8,grow"); add(comboBox2, "cell 1 8,grow");
//---- spinner2 ----
spinner2.setName("spinner2");
add(spinner2, "cell 1 9,grow"); add(spinner2, "cell 1 9,grow");
//---- label1 ---- //---- label1 ----
label1.setText("Large pref height:"); label1.setText("Large pref height:");
label1.setName("label1");
add(label1, "cell 0 10,aligny top,growy 0"); add(label1, "cell 0 10,aligny top,growy 0");
//---- comboBox5 ---- //---- comboBox5 ----
comboBox5.setPreferredSize(new Dimension(60, 40)); comboBox5.setPreferredSize(new Dimension(60, 40));
comboBox5.setEditable(true); comboBox5.setEditable(true);
comboBox5.setName("comboBox5");
add(comboBox5, "cell 1 10,growx"); add(comboBox5, "cell 1 10,growx");
//---- spinner4 ---- //---- spinner4 ----
spinner4.setPreferredSize(new Dimension(60, 40)); spinner4.setPreferredSize(new Dimension(60, 40));
spinner4.setName("spinner4");
add(spinner4, "cell 1 11,growx"); add(spinner4, "cell 1 11,growx");
//---- label3 ---- //---- label3 ----
label3.setText("<html>Small row height:<br>(default pref height)</html>"); label3.setText("<html>Small row height:<br>(default pref height)</html>");
label3.setName("label3");
add(label3, "cell 0 12 1 2,aligny top,growy 0"); add(label3, "cell 0 12 1 2,aligny top,growy 0");
//---- comboBox4 ---- //---- comboBox4 ----
comboBox4.setEditable(true); comboBox4.setEditable(true);
comboBox4.setName("comboBox4");
add(comboBox4, "cell 1 12,growx"); add(comboBox4, "cell 1 12,growx");
//---- spinner3 ----
spinner3.setName("spinner3");
add(spinner3, "cell 1 13,growx"); add(spinner3, "cell 1 13,growx");
//---- label4 ---- //---- label4 ----
label4.setText("Small pref height:"); label4.setText("Small pref height:");
label4.setName("label4");
add(label4, "cell 0 14 1 2,aligny top,growy 0"); add(label4, "cell 0 14 1 2,aligny top,growy 0");
//---- comboBox6 ---- //---- comboBox6 ----
comboBox6.setEditable(true); comboBox6.setEditable(true);
comboBox6.setPreferredSize(new Dimension(60, 14)); comboBox6.setPreferredSize(new Dimension(60, 14));
comboBox6.setMinimumSize(new Dimension(60, 14)); comboBox6.setMinimumSize(new Dimension(60, 14));
comboBox6.setName("comboBox6");
add(comboBox6, "cell 1 14,growx"); add(comboBox6, "cell 1 14,growx");
//---- spinner5 ---- //---- spinner5 ----
spinner5.setMinimumSize(new Dimension(60, 14)); spinner5.setMinimumSize(new Dimension(60, 14));
spinner5.setPreferredSize(new Dimension(60, 14)); spinner5.setPreferredSize(new Dimension(60, 14));
spinner5.setName("spinner5");
add(spinner5, "cell 1 15,growx,hmax 14"); add(spinner5, "cell 1 15,growx,hmax 14");
//---- label5 ---- //---- label5 ----
label5.setText("Double-click-and-drag:"); label5.setText("Double-click-and-drag:");
label5.setName("label5");
add(label5, "cell 0 16"); add(label5, "cell 0 16");
//---- textField ---- //---- textField ----
textField.setText("123 456 789 abc def"); textField.setText("123 456 789 abc def");
textField.setName("textField");
add(textField, "cell 1 16 2 1,growx"); add(textField, "cell 1 16 2 1,growx");
//---- dragEnabledCheckBox ---- //---- dragEnabledCheckBox ----
dragEnabledCheckBox.setText("Drag enabled"); dragEnabledCheckBox.setText("Drag enabled");
dragEnabledCheckBox.setName("dragEnabledCheckBox");
dragEnabledCheckBox.addActionListener(e -> dragEnabledChanged()); dragEnabledCheckBox.addActionListener(e -> dragEnabledChanged());
add(dragEnabledCheckBox, "cell 3 16 2 1,alignx left,growx 0"); add(dragEnabledCheckBox, "cell 3 16 2 1,alignx left,growx 0");
//---- label6 ---- //---- label6 ----
label6.setText("<html>JTextArea<br>JTextPane<br>JEditorPane</html>"); label6.setText("<html>JTextArea<br>JTextPane<br>JEditorPane</html>");
label6.setName("label6");
add(label6, "cell 0 17,align right top,grow 0 0"); add(label6, "cell 0 17,align right top,grow 0 0");
//======== scrollPane2 ======== //======== scrollPane2 ========
{ {
scrollPane2.setName("scrollPane2");
//---- textArea ---- //---- textArea ----
textArea.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def"); textArea.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def");
textArea.setName("textArea");
scrollPane2.setViewportView(textArea); scrollPane2.setViewportView(textArea);
} }
add(scrollPane2, "cell 1 17 4 1,growx"); add(scrollPane2, "cell 1 17 4 1,growx");
//======== scrollPane4 ======== //======== scrollPane4 ========
{ {
scrollPane4.setName("scrollPane4");
//---- textPane ---- //---- textPane ----
textPane.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def"); textPane.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def");
textPane.setName("textPane");
scrollPane4.setViewportView(textPane); scrollPane4.setViewportView(textPane);
} }
add(scrollPane4, "cell 1 17 4 1,growx"); add(scrollPane4, "cell 1 17 4 1,growx");
//======== scrollPane6 ======== //======== scrollPane6 ========
{ {
scrollPane6.setName("scrollPane6");
//---- editorPane ---- //---- editorPane ----
editorPane.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def"); editorPane.setText("1 123 456 789 abc def\n2 123 456 789 abc def\n3 123 456 789 abc def\n4 123 456 789 abc def\n5 123 456 789 abc def\n6 123 456 789 abc def\n7 123 456 789 abc def\n8 123 456 789 abc def");
editorPane.setName("editorPane");
scrollPane6.setViewportView(editorPane); scrollPane6.setViewportView(editorPane);
} }
add(scrollPane6, "cell 1 17 4 1,growx"); add(scrollPane6, "cell 1 17 4 1,growx");
//======== popupMenu1 ======== //======== popupMenu1 ========
{ {
popupMenu1.setName("popupMenu1");
//---- cutMenuItem ---- //---- cutMenuItem ----
cutMenuItem.setText("Cut"); cutMenuItem.setText("Cut");
cutMenuItem.setName("cutMenuItem");
popupMenu1.add(cutMenuItem); popupMenu1.add(cutMenuItem);
//---- copyMenuItem ---- //---- copyMenuItem ----
copyMenuItem.setText("Copy"); copyMenuItem.setText("Copy");
copyMenuItem.setName("copyMenuItem");
popupMenu1.add(copyMenuItem); popupMenu1.add(copyMenuItem);
//---- pasteMenuItem ---- //---- pasteMenuItem ----
pasteMenuItem.setText("Paste"); pasteMenuItem.setText("Paste");
pasteMenuItem.setName("pasteMenuItem");
popupMenu1.add(pasteMenuItem); popupMenu1.add(pasteMenuItem);
} }
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents

View File

@@ -1,9 +1,8 @@
JFDML JFormDesigner: "7.0.4.0.360" Java: "17" encoding: "UTF-8" JFDML JFormDesigner: "7.0.5.0.404" Java: "17" encoding: "UTF-8"
new FormModel { new FormModel {
contentType: "form/swing" contentType: "form/swing"
root: new FormRoot { root: new FormRoot {
"$setComponentNames": true
auxiliary() { auxiliary() {
"JavaCodeGenerator.defaultVariableLocal": true "JavaCodeGenerator.defaultVariableLocal": true
} }

View File

@@ -458,12 +458,14 @@ public class UIDefaultsDump
} }
private void dumpColor( PrintWriter out, String key, Color color ) { private void dumpColor( PrintWriter out, String key, Color color ) {
Color resolvedColor = resolveDerivedColor( key, color ); Color[] retBaseColor = new Color[1];
Color resolvedColor = resolveDerivedColor( key, color, retBaseColor );
if( resolvedColor != color && resolvedColor.getRGB() != color.getRGB() ) { if( resolvedColor != color && resolvedColor.getRGB() != color.getRGB() ) {
if( !isIntelliJTheme ) { if( !isIntelliJTheme ) {
System.err.println( "Key '" + key + "': derived colors not equal" ); System.err.println( "Key '" + key + "': derived colors not equal" );
System.err.println( " Default color: " + dumpColorHexAndHSL( color ) ); System.err.println( " Default color: " + dumpColorHexAndHSL( color ) );
System.err.println( " Resolved color: " + dumpColorHexAndHSL( resolvedColor ) ); System.err.println( " Resolved color: " + dumpColorHexAndHSL( resolvedColor ) );
System.err.println( " Base of resolved color: " + dumpColorHexAndHSL( retBaseColor[0] ) );
} }
out.printf( "%s / ", out.printf( "%s / ",
@@ -672,7 +674,7 @@ public class UIDefaultsDump
return properties; return properties;
} }
private Color resolveDerivedColor( String key, Color color ) { private Color resolveDerivedColor( String key, Color color, Color[] retBaseColor ) {
if( !(color instanceof DerivedColor) ) if( !(color instanceof DerivedColor) )
return color; return color;
@@ -693,7 +695,9 @@ public class UIDefaultsDump
throw new IllegalStateException( "Missing base color '" + baseKey + "' for key '" + key + "'." ); throw new IllegalStateException( "Missing base color '" + baseKey + "' for key '" + key + "'." );
if( baseColor instanceof DerivedColor ) if( baseColor instanceof DerivedColor )
baseColor = resolveDerivedColor( (String) baseKey, baseColor ); baseColor = resolveDerivedColor( (String) baseKey, baseColor, retBaseColor );
retBaseColor[0] = baseColor;
Color newColor = FlatUIUtils.deriveColor( color, baseColor ); Color newColor = FlatUIUtils.deriveColor( color, baseColor );

View File

@@ -2,15 +2,23 @@ FlatLaf Theme Editor
==================== ====================
This sub-project contains the FlatLaf Theme Editor that supports editing FlatLaf This sub-project contains the FlatLaf Theme Editor that supports editing FlatLaf
theme properties files. theme properties files. See
[Theme Editor documentation](https://www.formdev.com/flatlaf/theme-editor/) for
details and downloads.
![Theme Editor](../images/theme-editor@1.5x.png)
Download Download
-------- --------
[![Download Demo](https://download.formdev.com/flatlaf/images/download-theme-editor.svg)](https://download.formdev.com/flatlaf/flatlaf-theme-editor-latest.jar)
Run with `java -jar flatlaf-theme-editor-<version>.jar` (or double-click it).
Requires Java 8 or newer.
### Snapshot ### Snapshot
[![Download Demo](https://download.formdev.com/flatlaf/images/download-theme-editor-snapshot.svg)](https://download.formdev.com/flatlaf/snapshots/flatlaf-theme-editor-latest.jar) [![Download Demo](https://download.formdev.com/flatlaf/images/download-theme-editor-snapshot.svg)](https://download.formdev.com/flatlaf/snapshots/flatlaf-theme-editor-latest.jar)
Run with `java -jar flatlaf-theme-editor-<version>.jar` (or double-click it).
Requires Java 8 or newer.

View File

@@ -44,6 +44,7 @@ import com.formdev.flatlaf.icons.FlatAbstractIcon;
import com.formdev.flatlaf.ui.FlatEmptyBorder; import com.formdev.flatlaf.ui.FlatEmptyBorder;
import com.formdev.flatlaf.ui.FlatLineBorder; import com.formdev.flatlaf.ui.FlatLineBorder;
import com.formdev.flatlaf.util.HSLColor; import com.formdev.flatlaf.util.HSLColor;
import com.formdev.flatlaf.util.SystemInfo;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -93,7 +94,9 @@ class FlatColorPipette
setAlwaysOnTop( true ); setAlwaysOnTop( true );
setUndecorated( true ); setUndecorated( true );
setOpacity( 0.005f ); // macOS: windows with opacity smaller than 0.05 does not receive
// mouse clicked/pressed/released events (but mouse moved events)
setOpacity( SystemInfo.isMacOS ? 0.05f : 0.005f );
setBounds( owner.getGraphicsConfiguration().getBounds() ); setBounds( owner.getGraphicsConfiguration().getBounds() );
robot = new Robot( owner.getGraphicsConfiguration().getDevice() ); robot = new Robot( owner.getGraphicsConfiguration().getDevice() );
@@ -109,6 +112,8 @@ class FlatColorPipette
// (temporary change opacity to zero to get correct color from robot) // (temporary change opacity to zero to get correct color from robot)
float oldOpacity = getOpacity(); float oldOpacity = getOpacity();
setOpacity( 0 ); setOpacity( 0 );
if( SystemInfo.isMacOS )
robot.delay( 20 ); // give macOS some time to update the opacity
Color color = robot.getPixelColor( lastX, lastY ); Color color = robot.getPixelColor( lastX, lastY );
setOpacity( oldOpacity ); setOpacity( oldOpacity );
@@ -120,10 +125,17 @@ class FlatColorPipette
public void mouseClicked( MouseEvent e ) { public void mouseClicked( MouseEvent e ) {
dispose(); dispose();
if( SwingUtilities.isLeftMouseButton( e ) ) Color color = null;
pick( robot.getPixelColor( e.getX(), e.getY() ) ); if( SwingUtilities.isLeftMouseButton( e ) ) {
else // on macOS, robot not always returns correct color
pick( null ); // in mouse clicked event (sometimes black; sometimes
// includes opacity of disposed window)
// --> use last hover color on macOS
color = SystemInfo.isMacOS
? lastHoverColor
: robot.getPixelColor( e.getX(), e.getY() );
}
pick( color );
} }
}; };

View File

@@ -31,7 +31,9 @@ import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeModel;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.extras.components.*; import com.formdev.flatlaf.extras.components.*;
import com.formdev.flatlaf.icons.FlatSearchWithHistoryIcon;
import com.formdev.flatlaf.ui.FlatTabbedPaneUI; import com.formdev.flatlaf.ui.FlatTabbedPaneUI;
import net.miginfocom.swing.*; import net.miginfocom.swing.*;
@@ -53,6 +55,28 @@ class FlatThemePreviewAll
initComponents(); initComponents();
textField2.setLeadingComponent( new JButton( new FlatSearchWithHistoryIcon( true ) ) );
// whole words button
JToggleButton wordsButton = new JToggleButton( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/words.svg" ) );
wordsButton.setRolloverIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/wordsHovered.svg" ) );
wordsButton.setSelectedIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/wordsSelected.svg" ) );
wordsButton.setToolTipText( "Whole Words" );
// regex button
JToggleButton regexButton = new JToggleButton( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/regex.svg" ) );
regexButton.setRolloverIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/regexHovered.svg" ) );
regexButton.setSelectedIcon( new FlatSVGIcon( "com/formdev/flatlaf/themeeditor/icons/preview/regexSelected.svg" ) );
regexButton.setSelected( true );
regexButton.setToolTipText( "Regular Expression" );
// search toolbar
JToolBar searchToolbar = new JToolBar();
searchToolbar.add( wordsButton );
searchToolbar.addSeparator();
searchToolbar.add( regexButton );
textField2.setTrailingComponent( searchToolbar );
tabbedPane1.uiDefaultsGetter = preview::getUIDefaultProperty; tabbedPane1.uiDefaultsGetter = preview::getUIDefaultProperty;
tabbedPane1.setTabLayoutPolicy( JTabbedPane.SCROLL_TAB_LAYOUT ); tabbedPane1.setTabLayoutPolicy( JTabbedPane.SCROLL_TAB_LAYOUT );
tabbedPane1.addTab( "Tab 1", null ); tabbedPane1.addTab( "Tab 1", null );
@@ -128,26 +152,25 @@ class FlatThemePreviewAll
} }
private void enableDisable( Component comp, boolean enabled ) { private void enableDisable( Component comp, boolean enabled ) {
if( !isControlComponent( comp ) ) if( comp instanceof JScrollPane )
comp.setEnabled( enabled ); comp = ((JScrollPane)comp).getViewport().getView();
if( !(comp instanceof Container) || comp instanceof JInternalFrame ) if( comp == null || (comp instanceof JLabel && comp != label1) )
return; return;
for( Component c : ((Container)comp).getComponents() ) { // enable/disable component
if( c instanceof JScrollPane ) if( !isControlComponent( comp ) && comp != menu2 )
c = ((JScrollPane)c).getViewport().getView(); comp.setEnabled( enabled );
// make sure that background is updated correctly in BasicTextUI.updateBackground()
if( c instanceof JTextPane )
c.setBackground( UIManager.getColor( "TextPane.background" ) );
else if( c instanceof JEditorPane )
c.setBackground( UIManager.getColor( "EditorPane.background" ) );
// enable/disable children
if( comp instanceof JPanel || comp instanceof JToolBar || comp instanceof JMenuBar ) {
for( Component c : ((Container)comp).getComponents() )
enableDisable( c, enabled ); enableDisable( c, enabled );
} } else if( comp instanceof JSplitPane ) {
JSplitPane splitPane = (JSplitPane) comp;
if( comp instanceof JMenu ) { enableDisable( splitPane.getLeftComponent(), enabled );
enableDisable( splitPane.getRightComponent(), enabled );
} else if( comp instanceof JMenu ) {
JMenu menu = (JMenu) comp; JMenu menu = (JMenu) comp;
int count = menu.getMenuComponentCount(); int count = menu.getMenuComponentCount();
for( int i = 0; i < count; i++ ) for( int i = 0; i < count; i++ )
@@ -160,14 +183,12 @@ class FlatThemePreviewAll
preview.runWithUIDefaultsGetter( () -> { preview.runWithUIDefaultsGetter( () -> {
textField1.setEditable( editable ); textField1.setEditable( editable );
textField2.setEditable( editable );
formattedTextField1.setEditable( editable ); formattedTextField1.setEditable( editable );
passwordField1.setEditable( editable ); passwordField1.setEditable( editable );
textArea1.setEditable( editable ); textArea1.setEditable( editable );
editorPane1.setEditable( editable ); editorPane1.setEditable( editable );
textPane1.setEditable( editable ); textPane1.setEditable( editable );
editorPane1.updateUI();
textPane1.updateUI();
} ); } );
FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_EDITABLE, editable, true ); FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_EDITABLE, editable, true );
@@ -186,20 +207,24 @@ class FlatThemePreviewAll
} }
private void focusComponent( Component comp, Object value ) { private void focusComponent( Component comp, Object value ) {
if( comp instanceof JScrollPane )
comp = ((JScrollPane)comp).getViewport().getView();
if( comp == null )
return;
// focus component
if( !isControlComponent( comp ) && comp instanceof JComponent ) if( !isControlComponent( comp ) && comp instanceof JComponent )
((JComponent)comp).putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER, value ); ((JComponent)comp).putClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER, value );
if( !(comp instanceof Container) || // focus children
comp instanceof JComboBox || if( comp instanceof JPanel || comp instanceof JToolBar ) {
comp instanceof JSpinner || for( Component c : ((Container)comp).getComponents() )
comp instanceof JInternalFrame )
return;
for( Component c : ((Container)comp).getComponents() ) {
if( c instanceof JScrollPane )
c = ((JScrollPane)c).getViewport().getView();
focusComponent( c, value ); focusComponent( c, value );
} else if( comp instanceof JSplitPane ) {
JSplitPane splitPane = (JSplitPane) comp;
focusComponent( splitPane.getLeftComponent(), value );
focusComponent( splitPane.getRightComponent(), value );
} }
} }
@@ -207,8 +232,7 @@ class FlatThemePreviewAll
return c == enabledCheckBox || return c == enabledCheckBox ||
c == editableCheckBox || c == editableCheckBox ||
c == focusedCheckBox || c == focusedCheckBox ||
c == menuUnderlineSelectionButton || c == menuUnderlineSelectionButton;
c == menu2;
} }
private void menuUnderlineSelectionChanged() { private void menuUnderlineSelectionChanged() {
@@ -246,7 +270,7 @@ class FlatThemePreviewAll
editableCheckBox = new JCheckBox(); editableCheckBox = new JCheckBox();
focusedCheckBox = new JCheckBox(); focusedCheckBox = new JCheckBox();
JLabel labelLabel = new JLabel(); JLabel labelLabel = new JLabel();
JLabel label1 = new JLabel(); label1 = new JLabel();
FlatButton flatButton1 = new FlatButton(); FlatButton flatButton1 = new FlatButton();
JLabel buttonLabel = new JLabel(); JLabel buttonLabel = new JLabel();
JButton button1 = new JButton(); JButton button1 = new JButton();
@@ -267,6 +291,7 @@ class FlatThemePreviewAll
JSpinner spinner1 = new JSpinner(); JSpinner spinner1 = new JSpinner();
JLabel textFieldLabel = new JLabel(); JLabel textFieldLabel = new JLabel();
textField1 = new FlatTextField(); textField1 = new FlatTextField();
textField2 = new FlatTextField();
formattedTextField1 = new FlatFormattedTextField(); formattedTextField1 = new FlatFormattedTextField();
passwordField1 = new FlatPasswordField(); passwordField1 = new FlatPasswordField();
JLabel textAreaLabel = new JLabel(); JLabel textAreaLabel = new JLabel();
@@ -389,6 +414,7 @@ class FlatThemePreviewAll
//---- label1 ---- //---- label1 ----
label1.setText("Some Text"); label1.setText("Some Text");
label1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-label");
add(label1, "cell 1 1 2 1"); add(label1, "cell 1 1 2 1");
//---- flatButton1 ---- //---- flatButton1 ----
@@ -403,10 +429,12 @@ class FlatThemePreviewAll
//---- button1 ---- //---- button1 ----
button1.setText("OK"); button1.setText("OK");
button1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-button");
add(button1, "cell 1 2"); add(button1, "cell 1 2");
//---- testDefaultButton1 ---- //---- testDefaultButton1 ----
testDefaultButton1.setText("Default"); testDefaultButton1.setText("Default");
testDefaultButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-button");
add(testDefaultButton1, "cell 2 2"); add(testDefaultButton1, "cell 2 2");
//---- toggleButtonLabel ---- //---- toggleButtonLabel ----
@@ -415,11 +443,13 @@ class FlatThemePreviewAll
//---- toggleButton1 ---- //---- toggleButton1 ----
toggleButton1.setText("Unselected"); toggleButton1.setText("Unselected");
toggleButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-togglebutton");
add(toggleButton1, "cell 1 3"); add(toggleButton1, "cell 1 3");
//---- toggleButton3 ---- //---- toggleButton3 ----
toggleButton3.setText("Selected"); toggleButton3.setText("Selected");
toggleButton3.setSelected(true); toggleButton3.setSelected(true);
toggleButton3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-togglebutton");
add(toggleButton3, "cell 2 3"); add(toggleButton3, "cell 2 3");
//---- checkBoxLabel ---- //---- checkBoxLabel ----
@@ -428,11 +458,13 @@ class FlatThemePreviewAll
//---- checkBox1 ---- //---- checkBox1 ----
checkBox1.setText("Unselected"); checkBox1.setText("Unselected");
checkBox1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkbox");
add(checkBox1, "cell 1 4,alignx left,growx 0"); add(checkBox1, "cell 1 4,alignx left,growx 0");
//---- checkBox3 ---- //---- checkBox3 ----
checkBox3.setText("Selected"); checkBox3.setText("Selected");
checkBox3.setSelected(true); checkBox3.setSelected(true);
checkBox3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkbox");
add(checkBox3, "cell 2 4,alignx left,growx 0"); add(checkBox3, "cell 2 4,alignx left,growx 0");
//---- radioButtonLabel ---- //---- radioButtonLabel ----
@@ -441,11 +473,13 @@ class FlatThemePreviewAll
//---- radioButton1 ---- //---- radioButton1 ----
radioButton1.setText("Unselected"); radioButton1.setText("Unselected");
radioButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobutton");
add(radioButton1, "cell 1 5,alignx left,growx 0"); add(radioButton1, "cell 1 5,alignx left,growx 0");
//---- radioButton3 ---- //---- radioButton3 ----
radioButton3.setText("Selected"); radioButton3.setText("Selected");
radioButton3.setSelected(true); radioButton3.setSelected(true);
radioButton3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobutton");
add(radioButton3, "cell 2 5,alignx left,growx 0"); add(radioButton3, "cell 2 5,alignx left,growx 0");
//---- comboBoxLabel ---- //---- comboBoxLabel ----
@@ -470,6 +504,7 @@ class FlatThemePreviewAll
})); }));
comboBox1.setMaximumRowCount(6); comboBox1.setMaximumRowCount(6);
comboBox1.setPlaceholderText("placeholder text"); comboBox1.setPlaceholderText("placeholder text");
comboBox1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-combobox");
add(comboBox1, "cell 1 6"); add(comboBox1, "cell 1 6");
//---- comboBox3 ---- //---- comboBox3 ----
@@ -488,11 +523,15 @@ class FlatThemePreviewAll
"kkk" "kkk"
})); }));
comboBox3.setMaximumRowCount(6); comboBox3.setMaximumRowCount(6);
comboBox3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-combobox");
add(comboBox3, "cell 2 6"); add(comboBox3, "cell 2 6");
//---- spinnerLabel ---- //---- spinnerLabel ----
spinnerLabel.setText("JSpinner:"); spinnerLabel.setText("JSpinner:");
add(spinnerLabel, "cell 0 7"); add(spinnerLabel, "cell 0 7");
//---- spinner1 ----
spinner1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-spinner");
add(spinner1, "cell 1 7 2 1"); add(spinner1, "cell 1 7 2 1");
//---- textFieldLabel ---- //---- textFieldLabel ----
@@ -502,16 +541,25 @@ class FlatThemePreviewAll
//---- textField1 ---- //---- textField1 ----
textField1.setText("Some Text"); textField1.setText("Some Text");
textField1.setPlaceholderText("placeholder text"); textField1.setPlaceholderText("placeholder text");
add(textField1, "cell 1 8 2 1"); textField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textfield");
add(textField1, "cell 1 8");
//---- textField2 ----
textField2.setText("Txt");
textField2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textfield");
add(textField2, "cell 2 8");
//---- formattedTextField1 ---- //---- formattedTextField1 ----
formattedTextField1.setText("Some Text"); formattedTextField1.setText("Some Text");
formattedTextField1.setPlaceholderText("placeholder text"); formattedTextField1.setPlaceholderText("placeholder text");
formattedTextField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-formattedtextfield");
add(formattedTextField1, "cell 1 9"); add(formattedTextField1, "cell 1 9");
//---- passwordField1 ---- //---- passwordField1 ----
passwordField1.setText("Some Text"); passwordField1.setText("Some Text");
passwordField1.setPlaceholderText("placeholder text"); passwordField1.setPlaceholderText("placeholder text");
passwordField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-passwordfield");
passwordField1.setShowClearButton(true);
add(passwordField1, "cell 2 9"); add(passwordField1, "cell 2 9");
//---- textAreaLabel ---- //---- textAreaLabel ----
@@ -526,6 +574,7 @@ class FlatThemePreviewAll
//---- textArea1 ---- //---- textArea1 ----
textArea1.setText("Text"); textArea1.setText("Text");
textArea1.setRows(2); textArea1.setRows(2);
textArea1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textarea");
scrollPane1.setViewportView(textArea1); scrollPane1.setViewportView(textArea1);
} }
add(scrollPane1, "cell 1 10 2 1,width 40"); add(scrollPane1, "cell 1 10 2 1,width 40");
@@ -537,6 +586,7 @@ class FlatThemePreviewAll
//---- editorPane1 ---- //---- editorPane1 ----
editorPane1.setText("Text"); editorPane1.setText("Text");
editorPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-editorpane");
scrollPane5.setViewportView(editorPane1); scrollPane5.setViewportView(editorPane1);
} }
add(scrollPane5, "cell 1 10 2 1,width 40"); add(scrollPane5, "cell 1 10 2 1,width 40");
@@ -548,6 +598,7 @@ class FlatThemePreviewAll
//---- textPane1 ---- //---- textPane1 ----
textPane1.setText("Text"); textPane1.setText("Text");
textPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textpane");
scrollPane9.setViewportView(textPane1); scrollPane9.setViewportView(textPane1);
} }
add(scrollPane9, "cell 1 10 2 1,width 40"); add(scrollPane9, "cell 1 10 2 1,width 40");
@@ -567,46 +618,56 @@ class FlatThemePreviewAll
//======== menuBar1 ======== //======== menuBar1 ========
{ {
menuBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menubar");
//======== menu2 ======== //======== menu2 ========
{ {
menu2.setText("JMenu"); menu2.setText("JMenu");
menu2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem3 ---- //---- menuItem3 ----
menuItem3.setText("JMenuItem"); menuItem3.setText("JMenuItem");
menuItem3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu2.add(menuItem3); menu2.add(menuItem3);
//---- menuItem4 ---- //---- menuItem4 ----
menuItem4.setText("JMenuItem"); menuItem4.setText("JMenuItem");
menuItem4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu2.add(menuItem4); menu2.add(menuItem4);
menu2.addSeparator(); menu2.addSeparator();
//---- checkBoxMenuItem2 ---- //---- checkBoxMenuItem2 ----
checkBoxMenuItem2.setText("JCheckBoxMenuItem"); checkBoxMenuItem2.setText("JCheckBoxMenuItem");
checkBoxMenuItem2.setSelected(true); checkBoxMenuItem2.setSelected(true);
checkBoxMenuItem2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkboxmenuitem");
menu2.add(checkBoxMenuItem2); menu2.add(checkBoxMenuItem2);
//---- checkBoxMenuItem3 ---- //---- checkBoxMenuItem3 ----
checkBoxMenuItem3.setText("JCheckBoxMenuItem"); checkBoxMenuItem3.setText("JCheckBoxMenuItem");
checkBoxMenuItem3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkboxmenuitem");
menu2.add(checkBoxMenuItem3); menu2.add(checkBoxMenuItem3);
menu2.addSeparator(); menu2.addSeparator();
//---- radioButtonMenuItem4 ---- //---- radioButtonMenuItem4 ----
radioButtonMenuItem4.setText("JRadioButtonMenuItem"); radioButtonMenuItem4.setText("JRadioButtonMenuItem");
radioButtonMenuItem4.setSelected(true); radioButtonMenuItem4.setSelected(true);
radioButtonMenuItem4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobuttonmenuitem");
menu2.add(radioButtonMenuItem4); menu2.add(radioButtonMenuItem4);
//---- radioButtonMenuItem5 ---- //---- radioButtonMenuItem5 ----
radioButtonMenuItem5.setText("JRadioButtonMenuItem"); radioButtonMenuItem5.setText("JRadioButtonMenuItem");
radioButtonMenuItem5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobuttonmenuitem");
menu2.add(radioButtonMenuItem5); menu2.add(radioButtonMenuItem5);
menu2.addSeparator(); menu2.addSeparator();
//======== menu4 ======== //======== menu4 ========
{ {
menu4.setText("JMenu"); menu4.setText("JMenu");
menu4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem6 ---- //---- menuItem6 ----
menuItem6.setText("JMenuItem"); menuItem6.setText("JMenuItem");
menuItem6.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu4.add(menuItem6); menu4.add(menuItem6);
} }
menu2.add(menu4); menu2.add(menu4);
@@ -614,9 +675,11 @@ class FlatThemePreviewAll
//======== menu5 ======== //======== menu5 ========
{ {
menu5.setText("JMenu"); menu5.setText("JMenu");
menu5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem7 ---- //---- menuItem7 ----
menuItem7.setText("JMenuItem"); menuItem7.setText("JMenuItem");
menuItem7.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu5.add(menuItem7); menu5.add(menuItem7);
} }
menu2.add(menu5); menu2.add(menu5);
@@ -626,18 +689,22 @@ class FlatThemePreviewAll
//======== menu3 ======== //======== menu3 ========
{ {
menu3.setText("JMenu"); menu3.setText("JMenu");
menu3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem5 ---- //---- menuItem5 ----
menuItem5.setText("JMenuItem"); menuItem5.setText("JMenuItem");
menuItem5.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK|KeyEvent.SHIFT_DOWN_MASK)); menuItem5.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK|KeyEvent.SHIFT_DOWN_MASK));
menuItem5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem5); menu3.add(menuItem5);
//---- menuItem8 ---- //---- menuItem8 ----
menuItem8.setText("JMenuItem"); menuItem8.setText("JMenuItem");
menuItem8.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem8); menu3.add(menuItem8);
//---- menuItem9 ---- //---- menuItem9 ----
menuItem9.setText("JMenuItem"); menuItem9.setText("JMenuItem");
menuItem9.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem9); menu3.add(menuItem9);
} }
menuBar1.add(menu3); menuBar1.add(menu3);
@@ -650,16 +717,23 @@ class FlatThemePreviewAll
//---- scrollBar1 ---- //---- scrollBar1 ----
scrollBar1.setOrientation(Adjustable.HORIZONTAL); scrollBar1.setOrientation(Adjustable.HORIZONTAL);
scrollBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
scrollBar1.setVisibleAmount(50);
add(scrollBar1, "cell 1 12 2 1"); add(scrollBar1, "cell 1 12 2 1");
//---- scrollBar5 ---- //---- scrollBar5 ----
scrollBar5.setOrientation(Adjustable.HORIZONTAL); scrollBar5.setOrientation(Adjustable.HORIZONTAL);
scrollBar5.setShowButtons(true); scrollBar5.setShowButtons(true);
scrollBar5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
scrollBar5.setVisibleAmount(50);
add(scrollBar5, "cell 1 13 2 1"); add(scrollBar5, "cell 1 13 2 1");
//---- separatorLabel ---- //---- separatorLabel ----
separatorLabel.setText("JSeparator:"); separatorLabel.setText("JSeparator:");
add(separatorLabel, "cell 0 14"); add(separatorLabel, "cell 0 14");
//---- separator1 ----
separator1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-separator");
add(separator1, "cell 1 14 2 1"); add(separator1, "cell 1 14 2 1");
//---- sliderLabel ---- //---- sliderLabel ----
@@ -667,7 +741,7 @@ class FlatThemePreviewAll
add(sliderLabel, "cell 0 15"); add(sliderLabel, "cell 0 15");
//---- slider1 ---- //---- slider1 ----
slider1.setValue(30); slider1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
add(slider1, "cell 1 15 2 1,width 100"); add(slider1, "cell 1 15 2 1,width 100");
//---- slider3 ---- //---- slider3 ----
@@ -675,7 +749,7 @@ class FlatThemePreviewAll
slider3.setPaintTicks(true); slider3.setPaintTicks(true);
slider3.setMajorTickSpacing(50); slider3.setMajorTickSpacing(50);
slider3.setPaintLabels(true); slider3.setPaintLabels(true);
slider3.setValue(30); slider3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
slider3.addChangeListener(e -> changeProgress()); slider3.addChangeListener(e -> changeProgress());
add(slider3, "cell 1 16 2 1,width 100"); add(slider3, "cell 1 16 2 1,width 100");
@@ -684,12 +758,14 @@ class FlatThemePreviewAll
add(progressBarLabel, "cell 0 17"); add(progressBarLabel, "cell 0 17");
//---- progressBar1 ---- //---- progressBar1 ----
progressBar1.setValue(60); progressBar1.setValue(50);
progressBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
add(progressBar1, "cell 1 17 2 1"); add(progressBar1, "cell 1 17 2 1");
//---- progressBar2 ---- //---- progressBar2 ----
progressBar2.setValue(50); progressBar2.setValue(50);
progressBar2.setStringPainted(true); progressBar2.setStringPainted(true);
progressBar2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
add(progressBar2, "cell 1 18 2 1"); add(progressBar2, "cell 1 18 2 1");
//---- toolTipLabel ---- //---- toolTipLabel ----
@@ -698,6 +774,7 @@ class FlatThemePreviewAll
//---- toolTip1 ---- //---- toolTip1 ----
toolTip1.setTipText("Some text in tool tip."); toolTip1.setTipText("Some text in tool tip.");
toolTip1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tooltip");
add(toolTip1, "cell 1 19 2 1,alignx left,growx 0"); add(toolTip1, "cell 1 19 2 1,alignx left,growx 0");
//---- toolBarLabel ---- //---- toolBarLabel ----
@@ -706,28 +783,34 @@ class FlatThemePreviewAll
//======== toolBar1 ======== //======== toolBar1 ========
{ {
toolBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar");
//---- button4 ---- //---- button4 ----
button4.setIcon(UIManager.getIcon("Tree.closedIcon")); button4.setIcon(UIManager.getIcon("Tree.closedIcon"));
button4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-button");
toolBar1.add(button4); toolBar1.add(button4);
//---- button6 ---- //---- button6 ----
button6.setIcon(UIManager.getIcon("Tree.openIcon")); button6.setIcon(UIManager.getIcon("Tree.openIcon"));
button6.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-button");
toolBar1.add(button6); toolBar1.add(button6);
toolBar1.addSeparator(); toolBar1.addSeparator();
//---- button7 ---- //---- button7 ----
button7.setIcon(UIManager.getIcon("Tree.leafIcon")); button7.setIcon(UIManager.getIcon("Tree.leafIcon"));
button7.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button7); toolBar1.add(button7);
//---- button8 ---- //---- button8 ----
button8.setIcon(UIManager.getIcon("Tree.leafIcon")); button8.setIcon(UIManager.getIcon("Tree.leafIcon"));
button8.setSelected(true); button8.setSelected(true);
button8.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button8); toolBar1.add(button8);
//---- button9 ---- //---- button9 ----
button9.setIcon(UIManager.getIcon("Tree.leafIcon")); button9.setIcon(UIManager.getIcon("Tree.leafIcon"));
button9.setSelected(true); button9.setSelected(true);
button9.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button9); toolBar1.add(button9);
} }
add(toolBar1, "cell 1 20 2 1"); add(toolBar1, "cell 1 20 2 1");
@@ -735,6 +818,11 @@ class FlatThemePreviewAll
//---- tabbedPaneLabel ---- //---- tabbedPaneLabel ----
tabbedPaneLabel.setText("JTabbedPane:"); tabbedPaneLabel.setText("JTabbedPane:");
add(tabbedPaneLabel, "cell 0 21"); add(tabbedPaneLabel, "cell 0 21");
//======== tabbedPane1 ========
{
tabbedPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tabbedpane");
}
add(tabbedPane1, "cell 1 21 2 1"); add(tabbedPane1, "cell 1 21 2 1");
//---- listTreeLabel ---- //---- listTreeLabel ----
@@ -744,6 +832,7 @@ class FlatThemePreviewAll
//======== splitPane1 ======== //======== splitPane1 ========
{ {
splitPane1.setResizeWeight(0.5); splitPane1.setResizeWeight(0.5);
splitPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-splitpane");
//======== scrollPane2 ======== //======== scrollPane2 ========
{ {
@@ -761,6 +850,7 @@ class FlatThemePreviewAll
@Override @Override
public String getElementAt(int i) { return values[i]; } public String getElementAt(int i) { return values[i]; }
}); });
list1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-list");
scrollPane2.setViewportView(list1); scrollPane2.setViewportView(list1);
} }
splitPane1.setLeftComponent(scrollPane2); splitPane1.setLeftComponent(scrollPane2);
@@ -781,6 +871,7 @@ class FlatThemePreviewAll
add(node1); add(node1);
} }
})); }));
tree1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tree");
scrollPane3.setViewportView(tree1); scrollPane3.setViewportView(tree1);
} }
splitPane1.setRightComponent(scrollPane3); splitPane1.setRightComponent(scrollPane3);
@@ -804,6 +895,7 @@ class FlatThemePreviewAll
"Column 1", "Column 2" "Column 1", "Column 2"
} }
)); ));
table1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-table");
scrollPane4.setViewportView(table1); scrollPane4.setViewportView(table1);
} }
add(scrollPane4, "cell 1 23 2 1,width 100,height 70"); add(scrollPane4, "cell 1 23 2 1,width 100,height 70");
@@ -814,6 +906,7 @@ class FlatThemePreviewAll
//======== desktopPane1 ======== //======== desktopPane1 ========
{ {
desktopPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-desktoppane");
//======== internalFrame1 ======== //======== internalFrame1 ========
{ {
@@ -823,6 +916,7 @@ class FlatThemePreviewAll
internalFrame1.setMaximizable(true); internalFrame1.setMaximizable(true);
internalFrame1.setIconifiable(true); internalFrame1.setIconifiable(true);
internalFrame1.setResizable(true); internalFrame1.setResizable(true);
internalFrame1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-internalframe");
Container internalFrame1ContentPane = internalFrame1.getContentPane(); Container internalFrame1ContentPane = internalFrame1.getContentPane();
internalFrame1ContentPane.setLayout(new BorderLayout()); internalFrame1ContentPane.setLayout(new BorderLayout());
} }
@@ -837,6 +931,7 @@ class FlatThemePreviewAll
internalFrame2.setMaximizable(true); internalFrame2.setMaximizable(true);
internalFrame2.setResizable(true); internalFrame2.setResizable(true);
internalFrame2.setTitle("Inactive"); internalFrame2.setTitle("Inactive");
internalFrame2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-internalframe");
Container internalFrame2ContentPane = internalFrame2.getContentPane(); Container internalFrame2ContentPane = internalFrame2.getContentPane();
internalFrame2ContentPane.setLayout(new BorderLayout()); internalFrame2ContentPane.setLayout(new BorderLayout());
} }
@@ -861,7 +956,9 @@ class FlatThemePreviewAll
private JCheckBox enabledCheckBox; private JCheckBox enabledCheckBox;
private JCheckBox editableCheckBox; private JCheckBox editableCheckBox;
private JCheckBox focusedCheckBox; private JCheckBox focusedCheckBox;
private JLabel label1;
private FlatTextField textField1; private FlatTextField textField1;
private FlatTextField textField2;
private FlatFormattedTextField formattedTextField1; private FlatFormattedTextField formattedTextField1;
private FlatPasswordField passwordField1; private FlatPasswordField passwordField1;
private JTextArea textArea1; private JTextArea textArea1;

View File

@@ -1,4 +1,4 @@
JFDML JFormDesigner: "999.9.9.9.9999" Java: "1.8.0_202" encoding: "UTF-8" JFDML JFormDesigner: "7.0.5.0.404" Java: "17" encoding: "UTF-8"
new FormModel { new FormModel {
contentType: "form/swing" contentType: "form/swing"
@@ -58,6 +58,10 @@ new FormModel {
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1" name: "label1"
"text": "Some Text" "text": "Some Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-label"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1 2 1" "value": "cell 1 1 2 1"
} ) } )
@@ -78,12 +82,14 @@ new FormModel {
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "button1" name: "button1"
"text": "OK" "text": "OK"
"$client.FlatLaf.styleClass": "flatlaf-preview-button"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2" "value": "cell 1 2"
} ) } )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewDefaultButton" ) { add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewDefaultButton" ) {
name: "testDefaultButton1" name: "testDefaultButton1"
"text": "Default" "text": "Default"
"$client.FlatLaf.styleClass": "flatlaf-preview-button"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 2" "value": "cell 2 2"
} ) } )
@@ -96,6 +102,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JToggleButton" ) { add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "toggleButton1" name: "toggleButton1"
"text": "Unselected" "text": "Unselected"
"$client.FlatLaf.styleClass": "flatlaf-preview-togglebutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3" "value": "cell 1 3"
} ) } )
@@ -103,6 +110,7 @@ new FormModel {
name: "toggleButton3" name: "toggleButton3"
"text": "Selected" "text": "Selected"
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-togglebutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 3" "value": "cell 2 3"
} ) } )
@@ -115,6 +123,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "checkBox1" name: "checkBox1"
"text": "Unselected" "text": "Unselected"
"$client.FlatLaf.styleClass": "flatlaf-preview-checkbox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4,alignx left,growx 0" "value": "cell 1 4,alignx left,growx 0"
} ) } )
@@ -122,6 +131,7 @@ new FormModel {
name: "checkBox3" name: "checkBox3"
"text": "Selected" "text": "Selected"
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-checkbox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 4,alignx left,growx 0" "value": "cell 2 4,alignx left,growx 0"
} ) } )
@@ -135,6 +145,7 @@ new FormModel {
name: "radioButton1" name: "radioButton1"
"text": "Unselected" "text": "Unselected"
"$buttonGroup": new FormReference( "buttonGroup1" ) "$buttonGroup": new FormReference( "buttonGroup1" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5,alignx left,growx 0" "value": "cell 1 5,alignx left,growx 0"
} ) } )
@@ -143,6 +154,7 @@ new FormModel {
"text": "Selected" "text": "Selected"
"selected": true "selected": true
"$buttonGroup": new FormReference( "buttonGroup1" ) "$buttonGroup": new FormReference( "buttonGroup1" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 5,alignx left,growx 0" "value": "cell 2 5,alignx left,growx 0"
} ) } )
@@ -172,6 +184,7 @@ new FormModel {
} }
"maximumRowCount": 6 "maximumRowCount": 6
"placeholderText": "placeholder text" "placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-combobox"
auxiliary() { auxiliary() {
"JavaCodeGenerator.typeParameters": "String" "JavaCodeGenerator.typeParameters": "String"
} }
@@ -196,6 +209,7 @@ new FormModel {
addElement( "kkk" ) addElement( "kkk" )
} }
"maximumRowCount": 6 "maximumRowCount": 6
"$client.FlatLaf.styleClass": "flatlaf-preview-combobox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 6" "value": "cell 2 6"
} ) } )
@@ -207,6 +221,7 @@ new FormModel {
} ) } )
add( new FormComponent( "javax.swing.JSpinner" ) { add( new FormComponent( "javax.swing.JSpinner" ) {
name: "spinner1" name: "spinner1"
"$client.FlatLaf.styleClass": "flatlaf-preview-spinner"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7 2 1" "value": "cell 1 7 2 1"
} ) } )
@@ -220,16 +235,28 @@ new FormModel {
name: "textField1" name: "textField1"
"text": "Some Text" "text": "Some Text"
"placeholderText": "placeholder text" "placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-textfield"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 8 2 1" "value": "cell 1 8"
} )
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTextField" ) {
name: "textField2"
"text": "Txt"
"$client.FlatLaf.styleClass": "flatlaf-preview-textfield"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 8"
} ) } )
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatFormattedTextField" ) { add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatFormattedTextField" ) {
name: "formattedTextField1" name: "formattedTextField1"
"text": "Some Text" "text": "Some Text"
"placeholderText": "placeholder text" "placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-formattedtextfield"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -240,6 +267,8 @@ new FormModel {
name: "passwordField1" name: "passwordField1"
"text": "Some Text" "text": "Some Text"
"placeholderText": "placeholder text" "placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-passwordfield"
"showClearButton": true
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -260,6 +289,7 @@ new FormModel {
name: "textArea1" name: "textArea1"
"text": "Text" "text": "Text"
"rows": 2 "rows": 2
"$client.FlatLaf.styleClass": "flatlaf-preview-textarea"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -274,6 +304,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JEditorPane" ) { add( new FormComponent( "javax.swing.JEditorPane" ) {
name: "editorPane1" name: "editorPane1"
"text": "Text" "text": "Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-editorpane"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -288,6 +319,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JTextPane" ) { add( new FormComponent( "javax.swing.JTextPane" ) {
name: "textPane1" name: "textPane1"
"text": "Text" "text": "Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-textpane"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -317,19 +349,23 @@ new FormModel {
} ) } )
add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) {
name: "menuBar1" name: "menuBar1"
"$client.FlatLaf.styleClass": "flatlaf-preview-menubar"
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu2" name: "menu2"
"text": "JMenu" "text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem3" name: "menuItem3"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem4" name: "menuItem4"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator7" name: "separator7"
@@ -338,10 +374,12 @@ new FormModel {
name: "checkBoxMenuItem2" name: "checkBoxMenuItem2"
"text": "JCheckBoxMenuItem" "text": "JCheckBoxMenuItem"
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-checkboxmenuitem"
} ) } )
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
name: "checkBoxMenuItem3" name: "checkBoxMenuItem3"
"text": "JCheckBoxMenuItem" "text": "JCheckBoxMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-checkboxmenuitem"
} ) } )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator9" name: "separator9"
@@ -351,11 +389,13 @@ new FormModel {
"text": "JRadioButtonMenuItem" "text": "JRadioButtonMenuItem"
"$buttonGroup": new FormReference( "buttonGroup2" ) "$buttonGroup": new FormReference( "buttonGroup2" )
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobuttonmenuitem"
} ) } )
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
name: "radioButtonMenuItem5" name: "radioButtonMenuItem5"
"text": "JRadioButtonMenuItem" "text": "JRadioButtonMenuItem"
"$buttonGroup": new FormReference( "buttonGroup2" ) "$buttonGroup": new FormReference( "buttonGroup2" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobuttonmenuitem"
} ) } )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator3" name: "separator3"
@@ -363,35 +403,43 @@ new FormModel {
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu4" name: "menu4"
"text": "JMenu" "text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem6" name: "menuItem6"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
} ) } )
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu5" name: "menu5"
"text": "JMenu" "text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem7" name: "menuItem7"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
} ) } )
} ) } )
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu3" name: "menu3"
"text": "JMenu" "text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem5" name: "menuItem5"
"text": "JMenuItem" "text": "JMenuItem"
"accelerator": static javax.swing.KeyStroke getKeyStroke( 80, 715, false ) "accelerator": static javax.swing.KeyStroke getKeyStroke( 80, 715, false )
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem8" name: "menuItem8"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
add( new FormComponent( "javax.swing.JMenuItem" ) { add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem9" name: "menuItem9"
"text": "JMenuItem" "text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} ) } )
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
@@ -406,6 +454,8 @@ new FormModel {
add( new FormComponent( "javax.swing.JScrollBar" ) { add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar1" name: "scrollBar1"
"orientation": 0 "orientation": 0
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
"visibleAmount": 50
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 12 2 1" "value": "cell 1 12 2 1"
} ) } )
@@ -413,6 +463,8 @@ new FormModel {
name: "scrollBar5" name: "scrollBar5"
"orientation": 0 "orientation": 0
"showButtons": true "showButtons": true
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
"visibleAmount": 50
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 13 2 1" "value": "cell 1 13 2 1"
} ) } )
@@ -424,6 +476,7 @@ new FormModel {
} ) } )
add( new FormComponent( "javax.swing.JSeparator" ) { add( new FormComponent( "javax.swing.JSeparator" ) {
name: "separator1" name: "separator1"
"$client.FlatLaf.styleClass": "flatlaf-preview-separator"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 14 2 1" "value": "cell 1 14 2 1"
} ) } )
@@ -435,7 +488,7 @@ new FormModel {
} ) } )
add( new FormComponent( "javax.swing.JSlider" ) { add( new FormComponent( "javax.swing.JSlider" ) {
name: "slider1" name: "slider1"
"value": 30 "$client.FlatLaf.styleClass": "flatlaf-preview-slider"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -448,7 +501,7 @@ new FormModel {
"paintTicks": true "paintTicks": true
"majorTickSpacing": 50 "majorTickSpacing": 50
"paintLabels": true "paintLabels": true
"value": 30 "$client.FlatLaf.styleClass": "flatlaf-preview-slider"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -464,7 +517,8 @@ new FormModel {
} ) } )
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) { add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) {
name: "progressBar1" name: "progressBar1"
"value": 60 "value": 50
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -475,6 +529,7 @@ new FormModel {
name: "progressBar2" name: "progressBar2"
"value": 50 "value": 50
"stringPainted": true "stringPainted": true
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -490,6 +545,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JToolTip" ) { add( new FormComponent( "javax.swing.JToolTip" ) {
name: "toolTip1" name: "toolTip1"
"tipText": "Some text in tool tip." "tipText": "Some text in tool tip."
"$client.FlatLaf.styleClass": "flatlaf-preview-tooltip"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 19 2 1,alignx left,growx 0" "value": "cell 1 19 2 1,alignx left,growx 0"
} ) } )
@@ -501,16 +557,19 @@ new FormModel {
} ) } )
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
name: "toolBar1" name: "toolBar1"
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "button4" name: "button4"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" ) "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-button"
} ) } )
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "button6" name: "button6"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.openIcon" ) "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.openIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-button"
} ) } )
add( new FormComponent( "javax.swing.JToolBar$Separator" ) { add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
name: "separator4" name: "separator4"
@@ -518,16 +577,19 @@ new FormModel {
add( new FormComponent( "javax.swing.JToggleButton" ) { add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button7" name: "button7"
"icon": &SwingIcon0 new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) "icon": &SwingIcon0 new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} ) } )
add( new FormComponent( "javax.swing.JToggleButton" ) { add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button8" name: "button8"
"icon": #SwingIcon0 "icon": #SwingIcon0
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} ) } )
add( new FormComponent( "javax.swing.JToggleButton" ) { add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button9" name: "button9"
"icon": #SwingIcon0 "icon": #SwingIcon0
"selected": true "selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 20 2 1" "value": "cell 1 20 2 1"
@@ -540,6 +602,7 @@ new FormModel {
} ) } )
add( new FormContainer( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { add( new FormContainer( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) {
name: "tabbedPane1" name: "tabbedPane1"
"$client.FlatLaf.styleClass": "flatlaf-preview-tabbedpane"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -555,6 +618,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane1" name: "splitPane1"
"resizeWeight": 0.5 "resizeWeight": 0.5
"$client.FlatLaf.styleClass": "flatlaf-preview-splitpane"
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane2" name: "scrollPane2"
"preferredSize": new java.awt.Dimension( 50, 50 ) "preferredSize": new java.awt.Dimension( 50, 50 )
@@ -565,6 +629,7 @@ new FormModel {
addElement( "Item 2" ) addElement( "Item 2" )
addElement( "Item 3" ) addElement( "Item 3" )
} }
"$client.FlatLaf.styleClass": "flatlaf-preview-list"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -593,6 +658,7 @@ new FormModel {
} ) } )
} ) } )
} ) } )
"$client.FlatLaf.styleClass": "flatlaf-preview-tree"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -635,6 +701,7 @@ new FormModel {
add( null ) add( null )
add( null ) add( null )
} ) } )
"$client.FlatLaf.styleClass": "flatlaf-preview-table"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -650,6 +717,7 @@ new FormModel {
} ) } )
add( new FormContainer( "javax.swing.JDesktopPane", new FormLayoutManager( class javax.swing.JDesktopPane ) ) { add( new FormContainer( "javax.swing.JDesktopPane", new FormLayoutManager( class javax.swing.JDesktopPane ) ) {
name: "desktopPane1" name: "desktopPane1"
"$client.FlatLaf.styleClass": "flatlaf-preview-desktoppane"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -661,6 +729,7 @@ new FormModel {
"maximizable": true "maximizable": true
"iconifiable": true "iconifiable": true
"resizable": true "resizable": true
"$client.FlatLaf.styleClass": "flatlaf-preview-internalframe"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -676,6 +745,7 @@ new FormModel {
"maximizable": true "maximizable": true
"resizable": true "resizable": true
"title": "Inactive" "title": "Inactive"
"$client.FlatLaf.styleClass": "flatlaf-preview-internalframe"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
@@ -688,7 +758,7 @@ new FormModel {
} ) } )
}, new FormLayoutConstraints( null ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 ) "location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 400, 1070 ) "size": new java.awt.Dimension( 430, 1070 )
} ) } )
add( new FormNonVisual( "javax.swing.ButtonGroup" ) { add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
name: "buttonGroup1" name: "buttonGroup1"

View File

@@ -591,6 +591,11 @@ class FlatThemePreviewSwitches
buttonGroup1.add(zoom2xButton); buttonGroup1.add(zoom2xButton);
buttonGroup1.add(zoom3xButton); buttonGroup1.add(zoom3xButton);
buttonGroup1.add(zoom4xButton); buttonGroup1.add(zoom4xButton);
//---- buttonGroup2 ----
ButtonGroup buttonGroup2 = new ButtonGroup();
buttonGroup2.add(radioButton1);
buttonGroup2.add(radioButton2);
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents
} }

View File

@@ -510,12 +510,14 @@ new FormModel {
} ) } )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) { add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton1" name: "radioButton1"
"$buttonGroup": new FormReference( "buttonGroup2" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 16" "value": "cell 1 16"
} ) } )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) { add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton2" name: "radioButton2"
"selected": true "selected": true
"$buttonGroup": new FormReference( "buttonGroup2" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 16" "value": "cell 2 16"
} ) } )
@@ -528,5 +530,10 @@ new FormModel {
}, new FormLayoutConstraints( null ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 580 ) "location": new java.awt.Point( 0, 580 )
} ) } )
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
name: "buttonGroup2"
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 634 )
} )
} }
} }

View File

@@ -117,6 +117,21 @@ class FlatThemePropertiesSupport
int endOffset = textArea.getLineEndOffset( line ); int endOffset = textArea.getLineEndOffset( line );
String text = textArea.getText( startOffset, endOffset - startOffset ); String text = textArea.getText( startOffset, endOffset - startOffset );
// remove trailing backslash from multi-line properties usually used for styles
if( text.endsWith( "\\\n" ) )
text = text.substring( 0, text.length() - 2 ).trim();
// remove trailing semicolon from styles
if( text.endsWith( ";" ) )
text = text.substring( 0, text.length() - 1 ).trim();
// remove key starting with "[style]" so that first property name
// in CSS styled value is used as key to detect value type
if( text.startsWith( "[style]" ) ) {
int sepIndex = text.indexOf( '=' );
if( sepIndex >= 0 )
text = text.substring( sepIndex + 1 );
}
Properties properties = new Properties(); Properties properties = new Properties();
properties.load( new StringReader( text ) ); properties.load( new StringReader( text ) );
if( properties.isEmpty() ) if( properties.isEmpty() )

View File

@@ -0,0 +1,7 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".5" fill-rule="evenodd">
<rect width="2" height="2" x="3" y="11" fill="#7F8B91"/>
<path fill="#7F8B91" d="M9.8339746,5.61435935 L12.0980762,4.30717968 L12.8980762,5.69282032 L10.6339746,7 L12.8980762,8.30717968 L12.0980762,9.69282032 L9.8339746,8.38564065 L9.8339746,11 L8.2339746,11 L8.2339746,8.38564065 L5.96987298,9.69282032 L5.16987298,8.30717968 L7.4339746,7 L5.16987298,5.69282032 L5.96987298,4.30717968 L8.2339746,5.61435935 L8.2339746,3 L9.8339746,3 L9.8339746,5.61435935 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 770 B

View File

@@ -0,0 +1,7 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".9" fill-rule="evenodd">
<rect width="2" height="2" x="3" y="11" fill="#7F8B91"/>
<path fill="#7F8B91" d="M9.8339746,5.61435935 L12.0980762,4.30717968 L12.8980762,5.69282032 L10.6339746,7 L12.8980762,8.30717968 L12.0980762,9.69282032 L9.8339746,8.38564065 L9.8339746,11 L8.2339746,11 L8.2339746,8.38564065 L5.96987298,9.69282032 L5.16987298,8.30717968 L7.4339746,7 L5.16987298,5.69282032 L5.96987298,4.30717968 L8.2339746,5.61435935 L8.2339746,3 L9.8339746,3 L9.8339746,5.61435935 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 770 B

View File

@@ -0,0 +1,7 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="2" height="2" x="3" y="11" fill="#40B6E0"/>
<path fill="#40B6E0" d="M9.8339746,5.61435935 L12.0980762,4.30717968 L12.8980762,5.69282032 L10.6339746,7 L12.8980762,8.30717968 L12.0980762,9.69282032 L9.8339746,8.38564065 L9.8339746,11 L8.2339746,11 L8.2339746,8.38564065 L5.96987298,9.69282032 L5.16987298,8.30717968 L7.4339746,7 L5.16987298,5.69282032 L5.96987298,4.30717968 L8.2339746,5.61435935 L8.2339746,3 L9.8339746,3 L9.8339746,5.61435935 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 752 B

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="words">
<path id="W" d="M14.5213 3.01418L11.6986 13H9.82624L8.01064 6.68794L6.19504 13H4.3227L1.5 3.01418H3.67021L5.3156 9.53901L7.14539 3H8.93262L10.7482 9.53901L12.4078 3.01418H14.5213Z" fill="#7F8B91" fill-opacity="0.5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 487 B

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="wordsHovered">
<path id="W" d="M14.5213 3.01418L11.6986 13H9.82624L8.01064 6.68794L6.19504 13H4.3227L1.5 3.01418H3.67021L5.3156 9.53901L7.14539 3H8.93262L10.7482 9.53901L12.4078 3.01418H14.5213Z" fill="#7F8B91" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 494 B

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="wordsSelected">
<path id="W" d="M14.5213 3.01418L11.6986 13H9.82624L8.01064 6.68794L6.19504 13H4.3227L1.5 3.01418H3.67021L5.3156 9.53901L7.14539 3H8.93262L10.7482 9.53901L12.4078 3.01418H14.5213Z" fill="#40B6E0"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 476 B

View File

@@ -122,3 +122,9 @@ Prop.7.selectionForeground = contrast($Prop.7.selectionBackground,#000,#fff)
@varStyle1 = #f0f @varStyle1 = #f0f
[style].style1 = background: @varStyle1 [style].style1 = background: @varStyle1
[style].style2 = background: darken(#f00,10%); \
foreground: #0f0; \
foreground: darken(@background,30%); \
toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); \
toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

269
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -17,67 +17,101 @@
# #
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
@@ -106,80 +140,95 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD=$( ulimit -H -n ) ||
MAX_FD="$MAX_FD_LIMIT" warn "Could not query maximum file descriptor limit"
fi esac
ulimit -n $MAX_FD case $MAX_FD in #(
if [ $? -ne 0 ] ; then '' | soft) :;; #(
warn "Could not set maximum file descriptor limit: $MAX_FD" *)
fi ulimit -n "$MAX_FD" ||
else warn "Could not set maximum file descriptor limit to $MAX_FD"
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=`save "$@"` # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB