diff --git a/.travis.yml b/.travis.yml index 72bf17ea..5f64d6a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ jdk: - openjdk8 - openjdk9 - openjdk11 - - openjdk13 + - openjdk14 + - openjdk15 before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index deb99d01..6d911aec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,369 @@ FlatLaf Change Log ================== -## Unreleased +## 0.44-SNAPSHOT + +#### New features and improvements + +- TabbedPane: Replaced forward/backward scrolling arrow buttons with "Show + Hidden Tabs" button. If pressed, it shows a popup menu that contains (partly) + hidden tabs and selecting one activates that tab. If you prefer + forward/backward buttons, use `UIManager.put( + "TabbedPane.hiddenTabsNavigation", "arrowButtons" )`. (PR #190; issue #40) +- TabbedPane: Support scrolling tabs with mouse wheel (if `tabLayoutPolicy` is + `SCROLL_TAB_LAYOUT`). (PR #187; issue #40) +- TabbedPane: Repeat scrolling as long as arrow buttons are pressed. (PR #187; + issue #40) +- TabbedPane: Support adding custom components to left and right sides of tabs + area. (set client property `JTabbedPane.leadingComponent` or + `JTabbedPane.trailingComponent` to a `java.awt.Component`) (PR #192; issue + #40) +- TabbedPane: Support closable tabs. (PR #193; issues #31 and #40) +- TabbedPane: Support minimum or maximum tab widths. (set client property + `JTabbedPane.minimumTabWidth` or `JTabbedPane.maximumTabWidth` to an integer) + (PR #199) +- TabbedPane: Support alignment of tab area. (set client property + `JTabbedPane.tabAreaAlignment` to `"leading"`, `"trailing"`, `"center"` or + `"fill"`) (PR #199) +- TabbedPane: Support equal and compact tab width modes. (set client property + `JTabbedPane.tabWidthMode` to `"preferred"`, `"equal"` or `"compact"`) (PR + #199) +- TabbedPane: Support left, right, top and bottom tab icon placement. (set + client property `JTabbedPane.tabIconPlacement` to `SwingConstants.LEADING`, + `SwingConstants.TRAILING`, `SwingConstants.TOP` or `SwingConstants.BOTTOM`) + (PR #199) +- Support painting separator line between window title and content (use UI value + `TitlePane.borderColor`). (issue #184) +- Extras: `FlatSVGIcon` now allows specifying icon width and height in + constructors. (issue #196) +- SplitPane: Hide not applicable expand/collapse buttons. Added tooltips to + expand/collapse buttons. (issue #198) + + +#### Fixed bugs + +- Custom window decorations: Not visible menu bar is now ignored in layout. +- Popups using `JToolTip` components did not respect their location. (issue + #188; regression in 0.42 in fix for #164) + + +## 0.43 + +#### New features and improvements + +- TabbedPane: Made tabs separator color lighter in dark themes so that it is + easier to recognize the tabbed pane. +- TabbedPane: Added top and bottom tab insets to avoid that large tab icons are + painted over active tab underline. +- TabbedPane: Support hiding separator between tabs and content area (set client + property `JTabbedPane.showContentSeparator` to `false`). +- CheckBoxMenuItem and RadioButtonMenuItem: Improved checkmark background colors + of selected menu items that have also an icon. This makes it is easier to + recognize selected menu items. +- Windows: Made scaling compatible with Windows OS scaling, which distinguish + between "screen scaling" and "text scaling". (issue #175) + +#### Fixed bugs + +- ComboBox: If using own `JTextField` as editor, default text field border is + now removed to avoid duplicate border. +- ComboBox: Limit popup width to screen width for very long items. (issue #182) +- FileChooser: Fixed localizing special Windows folders (e.g. "Documents") and + enabled hiding known file extensions (if enabled in Windows Explorer). (issue + #178) +- Spinner: Fixed `NullPointerException` in case that arrow buttons were removed + to create button-less spinner. (issue #181) + + +## 0.42 + +#### New features and improvements + +- Demo: Improved "SplitPane & Tabs" and "Data Components" tabs. +- Demo: Menu items "File > Open" and "File > Save As" now show file choosers. +- InternalFrame: Support draggable border for resizing frame inside of the + visible frame border. (issue #121) +- `FlatUIDefaultsInspector` added (see [FlatLaf Extras](flatlaf-extras)). A + simple UI defaults inspector that shows a window with all UI defaults used in + current theme (look and feel). +- Made disabled text color slightly lighter in dark themes for better + readability. (issue #174) +- PasswordField: Support disabling Caps Lock warning icon. (issue #172) + +#### Fixed bugs + +- TextComponents: Fixed text color of disabled text components in dark themes. +- Custom window decorations: Fixed wrong window placement when moving window to + another screen with different scaling factor. (issue #166) +- Custom window decorations: Fixed wrong window bounds when resizing window to + another screen with different scaling factor. (issue #166) +- Fixed occasional wrong positioning of heavy weight popups when using multiple + screens with different scaling factors. (issue #166) +- ToolTip: Avoid that tooltip hides owner component. (issue #164) + + +## 0.41 + +#### New features and improvements + +- Added API to register packages or folders where FlatLaf searches for + application specific properties files with custom UI defaults (see + `FlatLaf.registerCustomDefaultsSource(...)` methods). +- Demo: Show hint popups to guide users to some features of the FlatLaf Demo + application. +- Extras: `FlatSVGIcon` now allows specifying `ClassLoader` that is used to load + SVG file. (issue #163) +- Smoother transition from old to new theme, independent of UI complexity, when + using animated theme change (see [FlatLaf Extras](flatlaf-extras)). + +#### Fixed bugs + +- Button: "selected" state was not shown. (issue #161) +- TextArea: Update background color property if enabled or editable state + changes in the same way as Swing does it for all other text components. (issue + #147) +- Demo: Fixed restoring last used theme on startup. (regression in 0.39) +- Custom window decorations: Fixed iconify, maximize and close icon colors if + window is inactive. +- Custom window decorations: Fixed title pane background color in IntelliJ + themes if window is inactive. +- Fixed sub-pixel text rendering in animated theme change (see + [FlatLaf Extras](flatlaf-extras)). + +#### Other Changes + +- Extras: Updated dependency + [svgSalamander](https://github.com/JFormDesigner/svgSalamander) to version + 1.1.2.3. + + +## 0.40 + +#### New features + +- Table: Detect whether component is used in cell editor and automatically + disable round border style and reduce cell editor outer border width (used for + focus indicator) to zero. (issue #148) +- ComboBox, Spinner and TextField: Support disabling round border style per + component, if globally enabled (set client property `JComponent.roundRect` to + `false`). (issue #148) + +#### Fixed bugs + +- Custom window decorations: Embedded menu bar did not always respond to mouse + events after adding menus and when running in JetBrains Runtime. (issue #151) +- IntelliJ Themes: Fixed NPE in Solarized themes on scroll bar hover. + + +## 0.39 + +#### New features + +- Animated theme change (see [FlatLaf Extras](flatlaf-extras)). Used in Demo. +- Demo: Added combo box above themes list to show only light or dark themes. +- IntelliJ Themes: + - Added "Arc Dark", "Arc Dark - Orange", "Carbon" and "Cobalt 2" themes. + - Replaced "Solarized" themes with much better ones from 4lex4. + - Updated "Arc", "One Dark" and "Vuesion" themes. +- ScrollPane: Enable/disable smooth scrolling per component if client property + "JScrollPane.smoothScrolling" is set to a `Boolean` on `JScrollPane`. +- ScrollBar: Increased minimum thumb size on macOS and Linux from 8 to 18 + pixels. On Windows, it is now 10 pixels. (issue #131) +- Button: Support specifying button border width. +- ComboBox: Changed maximum row count of popup list to 15 (was 20). Set UI value + `ComboBox.maximumRowCount` to any integer to use a different value. + +#### Fixed bugs + +- Custom window decorations: Fixed maximized window bounds when programmatically + maximizing window. E.g. restoring window state at startup. (issue #129) +- InternalFrame: Title pane height was too small when iconify, maximize and + close buttons are hidden. (issue #132) +- ToolTip: Do not show empty tooltip component if tooltip text is an empty + string. (issue #134) +- ToolTip: Fixed truncated text in HTML formatted tooltip on HiDPI displays. + (issue #142) +- ComboBox: Fixed width of popup, which was too small if popup is wider than + combo box and vertical scroll bar is visible. (issue #137) +- MenuItem on macOS: Removed plus characters from accelerator text and made + modifier key order conform with macOS standard. (issue #141) +- FileChooser: Fixed too small text field when renaming a file/directory in Flat + IntelliJ/Darcula themes. (issue #143) +- IntelliJ Themes: Fixed text colors in ProgressBar. (issue #138) + + +## 0.38 + +- Hide focus indicator when window is inactive. +- Custom window decorations: Improved/fixed window border color in dark themes. +- Custom window decorations: Hide window border if window is maximized. +- Custom window decorations: Center title if menu bar is embedded. +- Custom window decorations: Cursor of components (e.g. TextField) was not + changed. (issue #125) +- CheckBox: Fixed colors in light IntelliJ themes. (issue #126; regression in + 0.37) +- InternalFrame: Use default icon in internal frames. (issue #122) + + +## 0.37 + +- Custom window decorations (Windows 10 only; PR #108; issues #47 and #82) + support: + - dark window title panes + - embedding menu bar into window title pane + - native Windows 10 borders and behavior when running in + [JetBrains Runtime 11](https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime) + or later (the JRE that IntelliJ IDEA uses) +- CheckBox and RadioButton: Support changing selected icon style from outline to + filled (as in FlatLaf IntelliJ theme) with `UIManager.put( + "CheckBox.icon.style", "filled" );`. +- Button and ToggleButton: Support disabled background color (use UI values + `Button.disabledBackground` and `ToggleButton.disabledBackground`). (issue + #112) +- Button and ToggleButton: Support making buttons square (set client property + `JButton.squareSize` to `true`). (issue #118) +- ScrollBar: Support pressed track, thumb and button colors (use UI values + `ScrollBar.pressedTrackColor`, `ScrollBar.pressedThumbColor` and + `ScrollBar.pressedButtonBackground`). (issue #115) +- ComboBox: Support changing arrow button style (set UI value + `ComboBox.buttonStyle` to `auto` (default), `button` or `none`). (issue #114) +- Spinner: Support changing arrows button style (set UI value + `Spinner.buttonStyle` to `button` (default) or `none`). +- TableHeader: Support top/bottom/left positioned sort arrow when using + [Glazed Lists](https://github.com/glazedlists/glazedlists). (issue #113) +- Button, CheckBox, RadioButton and ToggleButton: Do not paint focus indicator + if `AbstractButton.isFocusPainted()` returns `false`. +- ComboBox: Increase maximum row count of popup list to 20 (was 8). Set UI value + `ComboBox.maximumRowCount` to any integer to use a different value. +- Fixed/improved vertical position of text when scaled on HiDPI screens on + Windows. +- IntelliJ Themes: Updated Gradianto Themes. +- IntelliJ Themes: Fixed menu bar and menu item margins in all Material UI Lite + themes. + + +## 0.36 + +- ScrollBar: Made styling more flexible by supporting insets and arc for track + and thumb. (issue #103) +- ScrollBar: Use round thumb on macOS and Linux to make it look similar to + native platform scroll bars. (issue #103) +- ComboBox: Minimum width is now 72 pixels (was ~50 for non-editable and ~130 + for editable comboboxes). +- ComboBox: Support custom borders in combobox editors. (issue #102) +- Button: Support non-square icon-only buttons. (issue #110) +- Ubuntu Linux: Fixed poorly rendered font. (issue #105) +- macOS Catalina: Use Helvetica Neue font. +- `FlatInspector` added (see [FlatLaf Extras](flatlaf-extras)). + + +## 0.35 + +- Added drop shadows to popup menus, combobox popups, tooltips and internal + frames. (issue #94) +- Support different component border colors to indicate errors, warnings or + custom state (set client property `JComponent.outline` to `error`, `warning` + or any `java.awt.Color`). +- Button and ToggleButton: Support round button style (set client property + `JButton.buttonType` to `roundRect`). +- ComboBox, Spinner and TextField: Support round border style (set client + property `JComponent.roundRect` to `true`). +- Paint nicely rounded buttons, comboboxes, spinners and text fields when + setting `Button.arc`, `Component.arc` or `TextComponent.arc` to a large value + (e.g. 1000). +- Added Java 9 module descriptor to `flatlaf-extras-.jar` and + `flatlaf-swingx-.jar`. +- CheckBox and RadioButton: Flag `opaque` is no longer ignored when checkbox or + radio button is used as table cell renderer. (issue #77) +- FileChooser: Use system icons. (issue #100) +- FileChooser: Fixed missing labels in file chooser when running on Java 9 or + later. (issue #98) +- PasswordField: Do not apply minimum width if `columns` property is greater + than zero. + + +## 0.34 + +- Menus: New menu item renderer brings stable left margins, right aligned + accelerators and larger gap between text and accelerator. This makes menus + look more modern and more similar to native platform menus. +- New underline menu selection style that displays selected menu items similar + to tabs (to enable use `UIManager.put( "MenuItem.selectionType", "underline" + );`). +- Menus: Fixed text color of selected menu items that use HTML. (issue #87) +- Menus: On Windows, pressing F10 now activates the menu bar without + showing a menu popup (as usual on Windows platform). On other platforms the + first menu popup is shown. +- Menus: On Windows, releasing Alt key now activates the menu bar (as + usual on Windows platform). (issue #43) +- Menus: Fixed inconsistent left padding in menu items. (issue #3) +- Menus: Fixed: Setting `iconTextGap` property on a menu item did increase left + and right margins. (issue #54) +- Hide mnemonics if window is deactivated (e.g. Alt+Tab to another + window). (issue #43) +- macOS: Enabled drop shadows for popup menus and combobox popups. (issue #94) +- macOS: Fixed NPE if using `JMenuBar` in `JInternalFrame` and macOS screen menu + bar is enabled (with `-Dapple.laf.useScreenMenuBar=true`). (issue #90) + + +## 0.33 + +- Improved creation of disabled grayscale icons used in disabled buttons, labels + and tabs. They now have more contrast and are lighter in light themes and + darker in dark themes. (issue #70) +- IntelliJ Themes: Fixed ComboBox size and Spinner border in all Material UI + Lite themes and limit tree row height in all Material UI Lite themes and some + other themes. +- IntelliJ Themes: Material UI Lite themes did not work when using + [IntelliJ Themes Pack](flatlaf-intellij-themes) addon. (PR #88, issue #89) +- IntelliJ Themes: Added Java 9 module descriptor to + `flatlaf-intellij-themes-.jar`. + + +## 0.32 + +- New [IntelliJ Themes Pack](flatlaf-intellij-themes) addon bundles many popular + open-source 3rd party themes from JetBrains Plugins Repository into a JAR and + provides Java classes to use them. +- IntelliJ Themes: Fixed button and toggle button colors. (issue #86) +- Updated IntelliJ Themes in demo to the latest versions. +- ToggleButton: Compute selected background color based on current component + background. (issue #32) + + +## 0.31 + +- Focus indication border (or background) no longer hidden when temporary + loosing focus (e.g. showing a popup menu). +- List, Table and Tree: Item selection color of focused components no longer + change from blue to gray when temporary loosing focus (e.g. showing a popup + menu). + + +## 0.30 + +- Windows: Fixed rendering of Unicode characters. Previously not all Unicode + characters were rendered on Windows. (issue #81) + + +## 0.29 + +- Linux: Fixed scaling if `GDK_SCALE` environment variable is set or if running + on JetBrains Runtime. (issue #69) +- Tree: Fixed repainting wide selection on focus gained/lost. +- ComboBox: No longer ignore `JComboBox.prototypeDisplayValue` when computing + popup width. (issue #80) +- Support changing default font used for all components with automatic scaling + UI if using larger font. Use `UIManager.put( "defaultFont", myFont );` +- No longer use system property `sun.java2d.uiScale`. (Java 8 only) +- Support specifying custom scale factor in system property `flatlaf.uiScale` + also for Java 9 and later. +- Demo: Support using own FlatLaf themes (`.properties` files) that are located + in working directory of Demo application. Shown in the "Themes" list under + category "Current Directory". + + +## 0.28 - PasswordField: Warn about enabled Caps Lock. - TabbedPane: Support Ctrl+TAB / Ctrl+Shift+TAB to switch @@ -11,6 +373,10 @@ FlatLaf Change Log - IntelliJ Themes: Added Gradianto themes to demo. - Button, CheckBox and RadioButton: Fixed NPE when button has children. (PR #68) - ScrollBar: Improved colors. +- Reviewed (and tested) all key bindings on Windows and macOS. Linux key + bindings are equal to Windows key bindings. macOS key bindings are slightly + different for platform specific behavior. +- UI default values are no longer based on Metal/Aqua UI defaults. ## 0.27 diff --git a/README.md b/README.md index c23a53b4..7a1ca28f 100644 --- a/README.md +++ b/README.md @@ -11,19 +11,18 @@ scales on **HiDPI** displays and runs on Java 8 or newer. The look is heavily inspired by **Darcula** and **IntelliJ** themes from IntelliJ IDEA 2019.2+ and uses almost the same colors and icons. -![Flat Light Demo](images/FlatLightDemo.png) +![Flat Light](images/flat_light.png) -![Flat Dark Demo](images/FlatDarkDemo.png) +![Flat Dark](images/flat_dark.png) IntelliJ Platform Themes ------------------------ -FlatLaf can use 3rd party themes created for IntelliJ Platform: +FlatLaf can use 3rd party themes created for IntelliJ Platform (see +[IntelliJ Themes Pack](flatlaf-intellij-themes)): -![Cyan Light Demo](images/CyanLightDemo.png) - -![Dark Purple Demo](images/DarkPurpleDemo.png) +![IntelliJ Platform Themes](images/intellij_platform_themes.png) Demo @@ -68,6 +67,8 @@ docs). Addons ------ +- [IntelliJ Themes Pack](flatlaf-intellij-themes) +- [Extras](flatlaf-extras) - [SwingX](flatlaf-swingx) - [JIDE Common Layer](flatlaf-jide-oss) @@ -77,7 +78,16 @@ Projects using FlatLaf - [NetBeans](https://netbeans.apache.org/) 11.3 - [jclasslib bytecode viewer](https://github.com/ingokegel/jclasslib) 5.5 +- [KeyStore Explorer](https://keystore-explorer.org/) 5.4.3 +- [OWASP Zed Attack Proxy (ZAP)](https://www.zaproxy.org/) (in weekly releases) +- ![New](images/new.svg) [jAlbum](https://jalbum.net/) 21 (commercial) +- [XMLmind XML Editor](https://www.xmlmind.com/xmleditor/) 9.3 (commercial) +- [Total Validator](https://www.totalvalidator.com/) 15 (commercial) - [j-lawyer](https://github.com/jlawyerorg/j-lawyer-org) +- [MegaMek](https://github.com/MegaMek/megamek) v0.47.4 and + [MekHQ](https://github.com/MegaMek/mekhq) v0.47.5 +- [GUIslice Builder](https://github.com/ImpulseAdventure/GUIslice-Builder) + 0.13.b024 - [Rest Suite](https://github.com/supanadit/restsuite) - [ControllerBuddy](https://github.com/bwRavencl/ControllerBuddy) - [SpringRemote](https://github.com/HaleyWang/SpringRemote) @@ -87,6 +97,15 @@ Projects using FlatLaf [mendelson AS2](https://mendelson-e-c.com/as2/), [AS4](https://mendelson-e-c.com/as4/) and [OFTP2](https://mendelson-e-c.com/oftp2) (commercial) +- [MeteoInfo](https://github.com/meteoinfo/MeteoInfo) 2.2 +- [lsfusion platform](https://github.com/lsfusion/platform) +- [Jes - Die Java-EÜR](https://www.jes-eur.de) +- [Mapton](https://mapton.org/) 2.0 + ([source code](https://github.com/trixon/mapton)) based on NetBeans platform +- [Pseudo Assembler IDE](https://github.com/tomasz-herman/PseudoAssemblerIDE) +- [Sound Analysis](https://github.com/tomasz-herman/SoundAnalysis) +- [RemoteLight](https://github.com/Drumber/RemoteLight) - Multifunctional LED + Control Software - and more... diff --git a/build.gradle.kts b/build.gradle.kts index 82af0dc3..925c878a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,8 @@ * limitations under the License. */ -val releaseVersion = "0.27" -val developmentVersion = "0.28-SNAPSHOT" +val releaseVersion = "0.43" +val developmentVersion = "0.44-SNAPSHOT" version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..cd322038 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,34 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + `kotlin-dsl` +} + +// required for kotlin-dsl or embedded-kotlin plugins +repositories { + jcenter() +} + +dependencies { + // NOTE: keep plugin versions in sync with settings.gradle.kts + + // "com.jfrog.bintray" plugin + implementation( "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4" ) + + // "com.jfrog.artifactory" plugin + implementation( "org.jfrog.buildinfo:build-info-extractor-gradle:4.13.0" ) +} diff --git a/buildSrc/src/main/java/ReorderJarEntries.java b/buildSrc/src/main/java/ReorderJarEntries.java new file mode 100644 index 00000000..457dae9b --- /dev/null +++ b/buildSrc/src/main/java/ReorderJarEntries.java @@ -0,0 +1,80 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.StandardOpenOption; +import java.util.function.Predicate; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +/** + * Reorders entries in a JAR file so that .properties files are placed before .class files, + * which is necessary to workaround an issue in NetBeans 11.3 (and older). + * See issues #13 and #93. + * + * @author Karl Tauber + */ +public class ReorderJarEntries +{ + public static void reorderJarEntries( File jarFile ) + throws IOException + { + ByteArrayOutputStream outStream = new ByteArrayOutputStream( (int) jarFile.length() + 1000 ); + + try( ZipOutputStream zipOutStream = new ZipOutputStream( outStream ) ) { + // 1st pass: copy .properties files + copyFiles( zipOutStream, jarFile, name -> name.endsWith( ".properties" ) ); + + // 2st pass: copy other files + copyFiles( zipOutStream, jarFile, name -> !name.endsWith( ".properties" ) ); + } + + // replace JAR + Files.write( jarFile.toPath(), outStream.toByteArray(), + StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); + } + + private static void copyFiles( ZipOutputStream dest, File jarFile, Predicate filter ) + throws IOException + { + try( ZipInputStream zipInputStream = new ZipInputStream( new FileInputStream( jarFile ) ) ) { + ZipEntry entry; + while( (entry = zipInputStream.getNextEntry()) != null ) { + if( filter.test( entry.getName() ) ) { + dest.putNextEntry( entry ); + copyFile( zipInputStream, dest ); + } + } + } + } + + private static void copyFile( InputStream src, OutputStream dest ) + throws IOException + { + byte[] buf = new byte[8*1024]; + int len; + while( (len = src.read( buf )) > 0 ) + dest.write( buf, 0, len ); + dest.flush(); + } +} diff --git a/buildSrc/src/main/kotlin/flatlaf-java9.gradle.kts b/buildSrc/src/main/kotlin/flatlaf-java9.gradle.kts new file mode 100644 index 00000000..7e5b2ceb --- /dev/null +++ b/buildSrc/src/main/kotlin/flatlaf-java9.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + java +} + +if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { + sourceSets { + create( "java9" ) { + java { + setSrcDirs( listOf( "src/main/java9" ) ) + } + } + } + + tasks { + named( "compileJava9Java" ) { + sourceCompatibility = "9" + targetCompatibility = "9" + } + + jar { + manifest.attributes( "Multi-Release" to "true" ) + + into( "META-INF/versions/9" ) { + from( sourceSets["java9"].output ) + } + } + } +} diff --git a/buildSrc/src/main/kotlin/flatlaf-module-info.gradle.kts b/buildSrc/src/main/kotlin/flatlaf-module-info.gradle.kts new file mode 100644 index 00000000..a78879c6 --- /dev/null +++ b/buildSrc/src/main/kotlin/flatlaf-module-info.gradle.kts @@ -0,0 +1,64 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +open class ModuleInfoExtension { + var paths: ArrayList = ArrayList() + + fun dependsOn( vararg paths: String ) { + this.paths.addAll( paths ) + } +} + +val extension = project.extensions.create( "flatlafModuleInfo" ) + + +plugins { + java +} + +if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { + sourceSets { + create( "module-info" ) { + java { + // include "src/main/java" here to get compile errors if classes are + // used from other modules that are not specified in module dependencies + setSrcDirs( listOf( "src/main/module-info", "src/main/java" ) ) + } + } + } + + tasks { + named( "compileModuleInfoJava" ) { + sourceCompatibility = "9" + targetCompatibility = "9" + + dependsOn( extension.paths ) + + options.compilerArgs.add( "--module-path" ) + options.compilerArgs.add( configurations.runtimeClasspath.get().asPath ) + } + + jar { + manifest.attributes( "Multi-Release" to "true" ) + + into( "META-INF/versions/9" ) { + from( sourceSets["module-info"].output ) { + include( "module-info.class" ) + } + } + } + } +} diff --git a/buildSrc/src/main/kotlin/flatlaf-publish.gradle.kts b/buildSrc/src/main/kotlin/flatlaf-publish.gradle.kts new file mode 100644 index 00000000..dee9ff6a --- /dev/null +++ b/buildSrc/src/main/kotlin/flatlaf-publish.gradle.kts @@ -0,0 +1,116 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +open class PublishExtension { + var artifactId: String? = null + var name: String? = null + var description: String? = null +} + +val extension = project.extensions.create( "flatlafPublish" ) + + +plugins { + `maven-publish` + id( "com.jfrog.bintray" ) + id( "com.jfrog.artifactory" ) +} + +publishing { + publications { + create( "maven" ) { + afterEvaluate { + artifactId = extension.artifactId + } + groupId = "com.formdev" + + from( components["java"] ) + + pom { + afterEvaluate { + this@pom.name.set( extension.name ) + this@pom.description.set( extension.description ) + } + url.set( "https://github.com/JFormDesigner/FlatLaf" ) + + licenses { + license { + name.set( "The Apache License, Version 2.0" ) + url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" ) + } + } + + developers { + developer { + name.set( "Karl Tauber" ) + organization.set( "FormDev Software GmbH" ) + organizationUrl.set( "https://www.formdev.com/" ) + } + } + + scm { + url.set( "https://github.com/JFormDesigner/FlatLaf" ) + } + } + } + } +} + +bintray { + user = rootProject.extra["bintray.user"] as String? + key = rootProject.extra["bintray.key"] as String? + + setPublications( "maven" ) + + with( pkg ) { + repo = "flatlaf" + afterEvaluate { + this@with.name = extension.artifactId + } + setLicenses( "Apache-2.0" ) + vcsUrl = "https://github.com/JFormDesigner/FlatLaf" + + with( version ) { + name = project.version.toString() + } + + publish = rootProject.extra["bintray.publish"] as Boolean + dryRun = rootProject.extra["bintray.dryRun"] as Boolean + } +} + +artifactory { + setContextUrl( "https://oss.jfrog.org" ) + + publish( closureOf { + repository( delegateClosureOf { + setProperty( "repoKey", "oss-snapshot-local" ) + setProperty( "username", rootProject.extra["bintray.user"] as String? ) + setProperty( "password", rootProject.extra["bintray.key"] as String? ) + } ) + + defaults( delegateClosureOf { + invokeMethod( "publications", "maven" ) + setProperty( "publishArtifacts", true ) + setProperty( "publishPom", true ) + } ) + } ) + + resolve( delegateClosureOf { + setProperty( "repoKey", "jcenter" ) + } ) +} diff --git a/flatlaf-core/.settings/org.eclipse.jdt.core.prefs b/flatlaf-core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-core/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-core/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-core/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-core/build.gradle.kts b/flatlaf-core/build.gradle.kts index c66bd8f5..7d6c5038 100644 --- a/flatlaf-core/build.gradle.kts +++ b/flatlaf-core/build.gradle.kts @@ -16,150 +16,46 @@ plugins { `java-library` - `maven-publish` - id( "com.jfrog.bintray" ) - id( "com.jfrog.artifactory" ) + `flatlaf-module-info` + `flatlaf-java9` + `flatlaf-publish` } -if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { - sourceSets { - create( "module-info" ) { - java { - // include "src/main/java" here to get compile errors if classes are - // used from other modules that are not specified in module dependencies - setSrcDirs( listOf( "src/main/module-info", "src/main/java" ) ) - } - } - } +java { + withSourcesJar() + withJavadocJar() } tasks { - assemble { - dependsOn( - "sourcesJar", - "javadocJar" - ) - } - - if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { - named( "compileModuleInfoJava" ) { - sourceCompatibility = "9" - targetCompatibility = "9" - } - } - jar { archiveBaseName.set( "flatlaf" ) - if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { - from( sourceSets["module-info"].output ) { - include( "module-info.class" ) - } + doLast { + ReorderJarEntries.reorderJarEntries( outputs.files.singleFile ); } } javadoc { options { this as StandardJavadocDocletOptions + use( true ) tags = listOf( "uiDefault", "clientProperty" ) addStringOption( "Xdoclint:all,-missing", "-Xdoclint:all,-missing" ) } isFailOnError = false } - register( "sourcesJar", Jar::class ) { + named("sourcesJar" ) { archiveBaseName.set( "flatlaf" ) - archiveClassifier.set( "sources" ) - - from( sourceSets.main.get().allJava ) } - register( "javadocJar", Jar::class ) { + named("javadocJar" ) { archiveBaseName.set( "flatlaf" ) - archiveClassifier.set( "javadoc" ) - - from( javadoc ) } } -publishing { - publications { - create( "maven" ) { - artifactId = "flatlaf" - groupId = "com.formdev" - - from( components["java"] ) - - artifact( tasks["sourcesJar"] ) - artifact( tasks["javadocJar"] ) - - pom { - name.set( "FlatLaf" ) - description.set( "Flat Look and Feel" ) - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - - licenses { - license { - name.set( "The Apache License, Version 2.0" ) - url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" ) - } - } - - developers { - developer { - name.set( "Karl Tauber" ) - organization.set( "FormDev Software GmbH" ) - organizationUrl.set( "https://www.formdev.com/" ) - } - } - - scm { - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - } - } - } - } -} - -bintray { - user = rootProject.extra["bintray.user"] as String? - key = rootProject.extra["bintray.key"] as String? - - setPublications( "maven" ) - - with( pkg ) { - repo = "flatlaf" - name = "flatlaf" - setLicenses( "Apache-2.0" ) - vcsUrl = "https://github.com/JFormDesigner/FlatLaf" - - with( version ) { - name = project.version.toString() - } - - publish = rootProject.extra["bintray.publish"] as Boolean - dryRun = rootProject.extra["bintray.dryRun"] as Boolean - } -} - -artifactory { - setContextUrl( "https://oss.jfrog.org" ) - - publish( closureOf { - repository( delegateClosureOf { - setProperty( "repoKey", "oss-snapshot-local" ) - setProperty( "username", rootProject.extra["bintray.user"] as String? ) - setProperty( "password", rootProject.extra["bintray.key"] as String? ) - } ) - - defaults( delegateClosureOf { - invokeMethod( "publications", "maven" ) - setProperty( "publishArtifacts", true ) - setProperty( "publishPom", true ) - } ) - } ) - - resolve( delegateClosureOf { - setProperty( "repoKey", "jcenter" ) - } ) +flatlafPublish { + artifactId = "flatlaf" + name = "FlatLaf" + description = "Flat Look and Feel" } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java index a1dca00d..2cbf1ab4 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java @@ -19,18 +19,22 @@ package com.formdev.flatlaf; import java.awt.Color; import java.util.Objects; import javax.swing.JComponent; +import javax.swing.SwingConstants; /** * @author Karl Tauber */ public interface FlatClientProperties { + //---- JButton ------------------------------------------------------------ + /** * Specifies type of a button. *

* Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}
* Value type {@link java.lang.String}
- * Allowed Values {@link #BUTTON_TYPE_SQUARE} and {@link #BUTTON_TYPE_HELP} + * Allowed Values {@link #BUTTON_TYPE_SQUARE}, {@link #BUTTON_TYPE_ROUND_RECT}, + * {@link #BUTTON_TYPE_TAB}, {@link #BUTTON_TYPE_HELP} and {@link BUTTON_TYPE_TOOLBAR_BUTTON} */ String BUTTON_TYPE = "JButton.buttonType"; @@ -43,6 +47,15 @@ public interface FlatClientProperties */ String BUTTON_TYPE_SQUARE = "square"; + /** + * Paint the button with round edges. + *

+ * Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton} + * + * @see #BUTTON_TYPE + */ + String BUTTON_TYPE_ROUND_RECT = "roundRect"; + /** * Paint the toggle button in tab style. *

@@ -61,6 +74,15 @@ public interface FlatClientProperties */ String BUTTON_TYPE_HELP = "help"; + /** + * Paint the button in toolbar style. + *

+ * Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton} + * + * @see #BUTTON_TYPE + */ + String BUTTON_TYPE_TOOLBAR_BUTTON = "toolBarButton"; + /** * Specifies selected state of a checkbox. *

@@ -77,11 +99,22 @@ public interface FlatClientProperties */ String SELECTED_STATE_INDETERMINATE = "indeterminate"; + /** + * Specifies whether the button preferred size will be made square (quadratically). + *

+ * Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}
+ * Value type {@link java.lang.Boolean} + */ + String SQUARE_SIZE = "JButton.squareSize"; + + //---- JComponent --------------------------------------------------------- + /** * Specifies minimum width of a component. *

- * Component {@link javax.swing.JButton}, {@link javax.swing.JToggleButton} and {@link javax.swing.text.JTextComponent}
- * Value type {@link java.lang.Integer}
+ * Component {@link javax.swing.JButton}, {@link javax.swing.JToggleButton}, + * {@link javax.swing.JComboBox}, {@link javax.swing.JSpinner} and {@link javax.swing.text.JTextComponent}
+ * Value type {@link java.lang.Integer} */ String MINIMUM_WIDTH = "JComponent.minimumWidth"; @@ -89,10 +122,60 @@ public interface FlatClientProperties * Specifies minimum height of a component. *

* Component {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}
- * Value type {@link java.lang.Integer}
+ * Value type {@link java.lang.Integer} */ String MINIMUM_HEIGHT = "JComponent.minimumHeight"; + /** + * Specifies the outline color of the component border. + *

+ * Components {@link javax.swing.JButton}, {@link javax.swing.JComboBox}, + * {@link javax.swing.JFormattedTextField}, {@link javax.swing.JPasswordField}, + * {@link javax.swing.JScrollPane}, {@link javax.swing.JSpinner}, + * {@link javax.swing.JTextField} and {@link javax.swing.JToggleButton}
+ * Value type {@link java.lang.String} or {@link java.awt.Color} or {@link java.awt.Color}[2]
+ * Allowed Values {@link #OUTLINE_ERROR}, {@link #OUTLINE_WARNING}, + * any color (type {@link java.awt.Color}) or an array of two colors (type {@link java.awt.Color}[2]) + * where the first color is for focused state and the second for unfocused state + */ + String OUTLINE = "JComponent.outline"; + + /** + * Paint the component border in another color (usually reddish) to indicate an error. + * + * @see #OUTLINE + */ + String OUTLINE_ERROR = "error"; + + /** + * Paint the component border in another color (usually yellowish) to indicate a warning. + * + * @see #OUTLINE + */ + String OUTLINE_WARNING = "warning"; + + /** + * Paint the component with round edges. + *

+ * Components {@link javax.swing.JComboBox}, {@link javax.swing.JSpinner}, + * {@link javax.swing.JTextField}, {@link javax.swing.JFormattedTextField} and {@link javax.swing.JPasswordField}
+ * Value type {@link java.lang.Boolean} + */ + String COMPONENT_ROUND_RECT = "JComponent.roundRect"; + + //---- Popup -------------------------------------------------------------- + + /** + * Specifies whether a drop shadow is painted if the component is shown in a popup + * or if the component is the owner of another component that is shown in a popup. + *

+ * Component {@link javax.swing.JComponent}
+ * Value type {@link java.lang.Boolean} + */ + String POPUP_DROP_SHADOW_PAINTED = "Popup.dropShadowPainted"; + + //---- JProgressBar ------------------------------------------------------- + /** * Specifies whether the progress bar has always the larger height even if no string is painted. *

@@ -109,6 +192,19 @@ public interface FlatClientProperties */ String PROGRESS_BAR_SQUARE = "JProgressBar.square"; + //---- JRootPane ---------------------------------------------------------- + + /** + * Specifies whether the menu bar is embedded into the title pane if custom + * window decorations are enabled. Default is {@code true}. + *

+ * Component {@link javax.swing.JRootPane}
+ * Value type {@link java.lang.Boolean} + */ + String MENU_BAR_EMBEDDED = "JRootPane.menuBarEmbedded"; + + //---- JScrollBar --------------------------------------------------------- + /** * Specifies whether the decrease/increase arrow buttons of a scrollbar are shown. *

@@ -117,6 +213,16 @@ public interface FlatClientProperties */ String SCROLL_BAR_SHOW_BUTTONS = "JScrollBar.showButtons"; + /** + * Specifies whether the scroll pane uses smooth scrolling. + *

+ * Component {{@link javax.swing.JScrollPane}
+ * Value type {@link java.lang.Boolean} + */ + String SCROLL_PANE_SMOOTH_SCROLLING = "JScrollPane.smoothScrolling"; + + //---- JTabbedPane -------------------------------------------------------- + /** * Specifies whether separators are shown between tabs. *

@@ -125,6 +231,14 @@ public interface FlatClientProperties */ String TABBED_PANE_SHOW_TAB_SEPARATORS = "JTabbedPane.showTabSeparators"; + /** + * Specifies whether the separator between tabs area and content area should be shown. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.lang.Boolean} + */ + String TABBED_PANE_SHOW_CONTENT_SEPARATOR = "JTabbedPane.showContentSeparator"; + /** * Specifies whether a full border is painted around a tabbed pane. *

@@ -133,6 +247,27 @@ public interface FlatClientProperties */ String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder"; + /** + * Specifies the minimum width of a tab. + *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.lang.Integer} + */ + String TABBED_PANE_MINIMUM_TAB_WIDTH = "JTabbedPane.minimumTabWidth"; + + /** + * Specifies the maximum width of a tab. + *

+ * Applied only if tab does not have a custom tab component + * (see {@link javax.swing.JTabbedPane#setTabComponentAt(int, java.awt.Component)}). + *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.lang.Integer} + */ + String TABBED_PANE_MAXIMUM_TAB_WIDTH = "JTabbedPane.maximumTabWidth"; + /** * Specifies the height of a tab. *

@@ -141,6 +276,220 @@ public interface FlatClientProperties */ String TABBED_PANE_TAB_HEIGHT = "JTabbedPane.tabHeight"; + /** + * Specifies the insets of a tab. + *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.awt.Insets} + */ + String TABBED_PANE_TAB_INSETS = "JTabbedPane.tabInsets"; + + /** + * Specifies the insets of the tab area. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.awt.Insets} + */ + String TABBED_PANE_TAB_AREA_INSETS = "JTabbedPane.tabAreaInsets"; + + /** + * Specifies whether tabs are closable. + * If set to {@code true} on a tabbed pane component, all tabs in that tabbed pane are closable. + * To make individual tabs closable, set it to {@code true} on a tab content component. + *

+ * Note that you have to specify a callback (see {@link #TABBED_PANE_TAB_CLOSABLE}) + * that is invoked when the user clicks a tab close button. + * The callback is responsible for closing the tab. + *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.lang.Boolean} + * + * @see #TABBED_PANE_TAB_CLOSE_CALLBACK + */ + String TABBED_PANE_TAB_CLOSABLE = "JTabbedPane.tabClosable"; + + /** + * Specifies the tooltip text used for tab close buttons. + *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.lang.String} + */ + String TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT = "JTabbedPane.tabCloseToolTipText"; + + /** + * Specifies the callback that is invoked when a tab close button is clicked. + * The callback is responsible for closing the tab. + *

+ * Either use a {@link java.util.function.IntConsumer} that received the tab index as parameter: + *

{@code
+	 * myTabbedPane.putClientProperty( "JTabbedPane.tabCloseCallback",
+	 *     (IntConsumer) tabIndex -> {
+	 *         // close tab here
+	 *     } );
+	 * }
+ * Or use a {@link java.util.function.BiConsumer}<javax.swing.JTabbedPane, Integer> + * that received the tabbed pane and the tab index as parameters: + *
{@code
+	 * myTabbedPane.putClientProperty( "JTabbedPane.tabCloseCallback",
+	 *     (BiConsumer) (tabbedPane, tabIndex) -> {
+	 *         // close tab here
+	 *     } );
+	 * }
+ * If you need to check whether a modifier key (e.g. Alt or Shift) was pressed + * while the user clicked the tab close button, use {@link java.awt.EventQueue#getCurrentEvent} + * to get current event, check whether it is a {@link java.awt.event.MouseEvent} + * and invoke its methods. E.g. + *
{@code
+	 * AWTEvent e = EventQueue.getCurrentEvent();
+	 * boolean shift = (e instanceof MouseEvent) ? ((MouseEvent)e).isShiftDown() : false;
+	 * }
+ *

+ * Component {@link javax.swing.JTabbedPane} + * or tab content components (see {@link javax.swing.JTabbedPane#setComponentAt(int, java.awt.Component)})
+ * Value type {@link java.util.function.IntConsumer} + * or {@link java.util.function.BiConsumer}<javax.swing.JTabbedPane, Integer> + * + * @see #TABBED_PANE_TAB_CLOSABLE + */ + String TABBED_PANE_TAB_CLOSE_CALLBACK = "JTabbedPane.tabCloseCallback"; + + /** + * Specifies how to navigate to hidden tabs. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.lang.String}
+ * Allowed Values {@link #TABBED_PANE_HIDDEN_TABS_NAVIGATION_MORE_TABS_BUTTON} + * or {@link #TABBED_PANE_HIDDEN_TABS_NAVIGATION_ARROW_BUTTONS} + */ + String TABBED_PANE_HIDDEN_TABS_NAVIGATION = "JTabbedPane.hiddenTabsNavigation"; + + /** + * Use "more tabs" button for navigation to hidden tabs. + * + * @see #TABBED_PANE_HIDDEN_TABS_NAVIGATION + */ + String TABBED_PANE_HIDDEN_TABS_NAVIGATION_MORE_TABS_BUTTON = "moreTabsButton"; + + /** + * Use forward/backward buttons for navigation to hidden tabs. + * + * @see #TABBED_PANE_HIDDEN_TABS_NAVIGATION + */ + String TABBED_PANE_HIDDEN_TABS_NAVIGATION_ARROW_BUTTONS = "arrowButtons"; + + /** + * Specifies the alignment of the tab area. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.lang.String}
+ * Allowed Values {@link #TABBED_PANE_TAB_AREA_ALIGN_LEADING} (default), + * {@link #TABBED_PANE_TAB_AREA_ALIGN_TRAILING}, {@link #TABBED_PANE_TAB_AREA_ALIGN_CENTER} + * or {@link #TABBED_PANE_TAB_AREA_ALIGN_FILL} + */ + String TABBED_PANE_TAB_AREA_ALIGNMENT = "JTabbedPane.tabAreaAlignment"; + + /** + * Align the tab area to the leading edge. + * + * @see #TABBED_PANE_TAB_AREA_ALIGNMENT + */ + String TABBED_PANE_TAB_AREA_ALIGN_LEADING = "leading"; + + /** + * Align the tab area to the trailing edge. + * + * @see #TABBED_PANE_TAB_AREA_ALIGNMENT + */ + String TABBED_PANE_TAB_AREA_ALIGN_TRAILING = "trailing"; + + /** + * Align the tab area to center. + * + * @see #TABBED_PANE_TAB_AREA_ALIGNMENT + */ + String TABBED_PANE_TAB_AREA_ALIGN_CENTER = "center"; + + /** + * Stretch tabs to fill all available space. + * + * @see #TABBED_PANE_TAB_AREA_ALIGNMENT + */ + String TABBED_PANE_TAB_AREA_ALIGN_FILL = "fill"; + + /** + * Specifies how the tabs should be sized. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.lang.String}
+ * Allowed Values {@link #TABBED_PANE_TAB_WIDTH_MODE_PREFERRED} (default), + * {@link #TABBED_PANE_TAB_WIDTH_MODE_EQUAL} or {@link #TABBED_PANE_TAB_WIDTH_MODE_COMPACT} + */ + String TABBED_PANE_TAB_WIDTH_MODE = "JTabbedPane.tabWidthMode"; + + /** + * Tab width is adjusted to tab icon and title. + * + * @see #TABBED_PANE_TAB_WIDTH_MODE + */ + String TABBED_PANE_TAB_WIDTH_MODE_PREFERRED = "preferred"; + + /** + * All tabs in a tabbed pane has same width. + * + * @see #TABBED_PANE_TAB_WIDTH_MODE + */ + String TABBED_PANE_TAB_WIDTH_MODE_EQUAL = "equal"; + + /** + * Unselected tabs are smaller because they show only the tab icon, but no tab title. + * Selected tabs show both. + * + * @see #TABBED_PANE_TAB_WIDTH_MODE + */ + String TABBED_PANE_TAB_WIDTH_MODE_COMPACT = "compact"; + + /** + * Specifies the tab icon placement (relative to tab title). + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.lang.Integer}
+ * Allowed Values {@link SwingConstants#LEADING} (default), + * {@link SwingConstants#TRAILING}, {@link SwingConstants#TOP} + * or {@link SwingConstants#BOTTOM} + */ + String TABBED_PANE_TAB_ICON_PLACEMENT = "JTabbedPane.tabIconPlacement"; + + /** + * Specifies a component that will be placed at the leading edge of the tabs area. + *

+ * For top and bottom tab placement, the layed out component size will be + * the preferred component width and the tab area height.
+ * For left and right tab placement, the layed out component size will be + * the tab area width and the preferred component height. + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.awt.Component} + */ + String TABBED_PANE_LEADING_COMPONENT = "JTabbedPane.leadingComponent"; + + /** + * Specifies a component that will be placed at the trailing edge of the tabs area. + *

+ * For top and bottom tab placement, the layed out component size will be + * the available horizontal space (minimum is preferred component width) and the tab area height.
+ * For left and right tab placement, the layed out component size will be + * the tab area width and the available vertical space (minimum is preferred component height). + *

+ * Component {@link javax.swing.JTabbedPane}
+ * Value type {@link java.awt.Component} + */ + String TABBED_PANE_TRAILING_COMPONENT = "JTabbedPane.trailingComponent"; + + //---- JTextField --------------------------------------------------------- + /** * Specifies whether all text is selected when the text component gains focus. *

@@ -183,6 +532,8 @@ public interface FlatClientProperties */ String PLACEHOLDER_TEXT = "JTextField.placeholderText"; + //---- JToggleButton ------------------------------------------------------ + /** * Height of underline if toggle button type is {@link #BUTTON_TYPE_TAB}. *

@@ -207,6 +558,8 @@ public interface FlatClientProperties */ String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground"; + //---- helper methods ----------------------------------------------------- + /** * Checks whether a client property of a component has the given value. */ @@ -223,6 +576,15 @@ public interface FlatClientProperties return (value instanceof Boolean) ? (boolean) value : defaultValue; } + /** + * Checks whether a client property of a component is a {@link Boolean} and returns its value. + * If the client property is not set, or not a {@link Boolean}, defaultValue is returned. + */ + static Boolean clientPropertyBooleanStrict( JComponent c, String key, Boolean defaultValue ) { + Object value = c.getClientProperty( key ); + return (value instanceof Boolean) ? (Boolean) value : defaultValue; + } + /** * Checks whether a client property of a component is an integer and returns its value. * If the client property is not set, or not an integer, defaultValue is returned. @@ -240,4 +602,14 @@ public interface FlatClientProperties Object value = c.getClientProperty( key ); return (value instanceof Color) ? (Color) value : defaultValue; } + + static int clientPropertyChoice( JComponent c, String key, String... choices ) { + Object value = c.getClientProperty( key ); + for( int i = 0; i < choices.length; i++ ) { + if( choices[i].equals( value ) ) + return i; + + } + return -1; + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java index 8e3927ec..608d8cda 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java @@ -32,11 +32,11 @@ public class FlatDarculaLaf @Override public String getName() { - return "Flat Darcula"; + return "FlatLaf Darcula"; } @Override public String getDescription() { - return "Flat Darcula Look and Feel"; + return "FlatLaf Darcula Look and Feel"; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarkLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarkLaf.java index 57b421c1..ed5f33a6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarkLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarkLaf.java @@ -32,12 +32,12 @@ public class FlatDarkLaf @Override public String getName() { - return "Flat Dark"; + return "FlatLaf Dark"; } @Override public String getDescription() { - return "Flat Dark Look and Feel"; + return "FlatLaf Dark Look and Feel"; } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java index 4e469d8f..1737d8e3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDefaultsAddon.java @@ -17,6 +17,8 @@ package com.formdev.flatlaf; import java.io.InputStream; +import javax.swing.LookAndFeel; +import javax.swing.UIDefaults; /** * Addon for FlatLaf UI defaults. @@ -50,6 +52,13 @@ public abstract class FlatDefaultsAddon return addonClass.getResourceAsStream( propertiesName ); } + /** + * Allows modifying UI defaults after loading UI defaults. + * The default implementation does nothing. + */ + public void afterDefaultsLoading( LookAndFeel laf, UIDefaults defaults ) { + } + /** * Returns the priority used to sort addon loading. * The order is only important if you want overwrite UI defaults of other addons. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIconColors.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIconColors.java new file mode 100644 index 00000000..5cda400c --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIconColors.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf; + +/** + * Default color palette for action icons and object icons. + *

+ * The idea is to use only this well defined set of colors in SVG icons and + * then they are replaced at runtime to dark variants or to other theme colors. + * Then a single SVG icon (light variant) can be used for dark themes too. + * IntelliJ Platform uses this mechanism to allow themes to change IntelliJ Platform icons. + *

+ * Use the {@code *_DARK} colors only in {@code *_dark.svg} files. + *

+ * The colors are based on IntelliJ Platform + * Action icons + * and + * Noun icons + *

+ * These colors may be changed by IntelliJ Platform themes. + *

+ * You may use these colors also in your application (outside of SVG icons), but do + * not use the RGB values defined in this enum.
+ * Instead use {@code UIManager.getColor( FlatIconColors.ACTIONS_GREY.key )}. + * + * @author Karl Tauber + */ +public enum FlatIconColors +{ + // colors for action icons + // see https://jetbrains.design/intellij/principles/icons/#action-icons + ACTIONS_RED ( 0xDB5860, "Actions.Red", true, false ), + ACTIONS_RED_DARK ( 0xC75450, "Actions.Red", false, true ), + ACTIONS_YELLOW ( 0xEDA200, "Actions.Yellow", true, false ), + ACTIONS_YELLOW_DARK ( 0xF0A732, "Actions.Yellow", false, true ), + ACTIONS_GREEN ( 0x59A869, "Actions.Green", true, false ), + ACTIONS_GREEN_DARK ( 0x499C54, "Actions.Green", false, true ), + ACTIONS_BLUE ( 0x389FD6, "Actions.Blue", true, false ), + ACTIONS_BLUE_DARK ( 0x3592C4, "Actions.Blue", false, true ), + ACTIONS_GREY ( 0x6E6E6E, "Actions.Grey", true, false ), + ACTIONS_GREY_DARK ( 0xAFB1B3, "Actions.Grey", false, true ), + ACTIONS_GREYINLINE ( 0x7F8B91, "Actions.GreyInline", true, false ), + ACTIONS_GREYINLINE_DARK ( 0x7F8B91, "Actions.GreyInline", false, true ), + + // colors for object icons + // see https://jetbrains.design/intellij/principles/icons/#noun-icons + OBJECTS_GREY ( 0x9AA7B0, "Objects.Grey" ), + OBJECTS_BLUE ( 0x40B6E0, "Objects.Blue" ), + OBJECTS_GREEN ( 0x62B543, "Objects.Green" ), + OBJECTS_YELLOW ( 0xF4AF3D, "Objects.Yellow" ), + OBJECTS_YELLOW_DARK ( 0xD9A343, "Objects.YellowDark" ), + OBJECTS_PURPLE ( 0xB99BF8, "Objects.Purple" ), + OBJECTS_PINK ( 0xF98B9E, "Objects.Pink" ), + OBJECTS_RED ( 0xF26522, "Objects.Red" ), + OBJECTS_RED_STATUS ( 0xE05555, "Objects.RedStatus" ), + OBJECTS_GREEN_ANDROID ( 0xA4C639, "Objects.GreenAndroid" ), + OBJECTS_BLACK_TEXT ( 0x231F20, "Objects.BlackText" ); + + public final int rgb; + public final String key; + + public final boolean light; + public final boolean dark; + + FlatIconColors( int rgb, String key ) { + this( rgb, key, true, true ); + } + + FlatIconColors( int rgb, String key, boolean light, boolean dark ) { + this.rgb = rgb; + this.key = key; + this.light = light; + this.dark = dark; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java index 40967801..7a463291 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatInputMaps.java @@ -22,9 +22,11 @@ import javax.swing.KeyStroke; import javax.swing.LookAndFeel; import javax.swing.UIDefaults; import javax.swing.UIDefaults.LazyValue; +import javax.swing.UIManager; import javax.swing.plaf.InputMapUIResource; import com.formdev.flatlaf.util.SystemInfo; import static javax.swing.text.DefaultEditorKit.*; +import java.util.function.BooleanSupplier; /** * @author Karl Tauber @@ -35,7 +37,7 @@ class FlatInputMaps initBasicInputMaps( defaults ); initTextComponentInputMaps( defaults ); - if( SystemInfo.IS_MAC ) + if( SystemInfo.isMacOS ) initMacInputMaps( defaults ); } @@ -48,10 +50,10 @@ class FlatInputMaps modifyInputMap( defaults, "ComboBox.ancestorInputMap", "SPACE", "spacePopup", - "UP", "selectPrevious2", - "DOWN", "selectNext2", - "KP_UP", "selectPrevious2", - "KP_DOWN", "selectNext2", + "UP", mac( "selectPrevious2", "selectPrevious" ), + "DOWN", mac( "selectNext2", "selectNext" ), + "KP_UP", mac( "selectPrevious2", "selectPrevious" ), + "KP_DOWN", mac( "selectNext2", "selectNext" ), mac( "alt UP", null ), "togglePopup", mac( "alt DOWN", null ), "togglePopup", @@ -59,7 +61,7 @@ class FlatInputMaps mac( "alt KP_DOWN", null ), "togglePopup" ); - if( !SystemInfo.IS_MAC ) { + if( !SystemInfo.isMacOS ) { modifyInputMap( defaults, "FileChooser.ancestorInputMap", "F2", "editFileName", "BACK_SPACE", "Go Up" @@ -81,15 +83,22 @@ class FlatInputMaps "shift ctrl TAB", "navigatePrevious" ); - modifyInputMap( defaults, "Table.ancestorInputMap", - // swap to make it consistent with List and Tree + // swap Home/End with Ctrl+Home/End to make it consistent with List and Tree + modifyInputMap( () -> { + return UIManager.getBoolean( "Table.consistentHomeEndKeyBehavior" ); + }, + defaults, "Table.ancestorInputMap", "HOME", "selectFirstRow", "END", "selectLastRow", + "shift HOME", "selectFirstRowExtendSelection", + "shift END", "selectLastRowExtendSelection", mac( "ctrl HOME", null ), "selectFirstColumn", - mac( "ctrl END", null ), "selectLastColumn" + mac( "ctrl END", null ), "selectLastColumn", + mac( "shift ctrl HOME", null ), "selectFirstColumnExtendSelection", + mac( "shift ctrl END", null ), "selectLastColumnExtendSelection" ); - if( !SystemInfo.IS_MAC ) { + if( !SystemInfo.isMacOS ) { modifyInputMap( defaults, "Tree.focusInputMap", "ADD", "expand", "SUBTRACT", "collapse" @@ -160,7 +169,7 @@ class FlatInputMaps "control shift O", "toggle-componentOrientation", // DefaultEditorKit.toggleComponentOrientation }; - Object[] macCommonTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { + Object[] macCommonTextComponentBindings = SystemInfo.isMacOS ? new Object[] { // move caret one character (without selecting text) "ctrl B", backwardAction, "ctrl F", forwardAction, @@ -182,7 +191,7 @@ class FlatInputMaps "ctrl A", beginLineAction, "ctrl E", endLineAction, - // move caret to document begin/end (without selecting text) + // move caret to document begin/end and select text "shift meta UP", selectionBeginAction, "shift meta DOWN", selectionEndAction, "shift meta KP_UP", selectionBeginAction, @@ -198,16 +207,6 @@ class FlatInputMaps "shift KP_UP", selectionBeginLineAction, "shift KP_DOWN", selectionEndLineAction, - // move caret one page (without selecting text) - "PAGE_UP", pageUpAction, - "PAGE_DOWN", pageDownAction, - - // move caret one page and select text - "shift PAGE_UP", "selection-page-up", // DefaultEditorKit.selectionPageUpAction - "shift PAGE_DOWN", "selection-page-down", // DefaultEditorKit.selectionPageDownAction - "shift meta PAGE_UP", "selection-page-left", // DefaultEditorKit.selectionPageLeftAction - "shift meta PAGE_DOWN", "selection-page-right", // DefaultEditorKit.selectionPageRightAction - // delete previous/next word "ctrl W", deletePrevWordAction, "ctrl D", deleteNextCharAction, @@ -217,7 +216,7 @@ class FlatInputMaps "ENTER", JTextField.notifyAction, }; - Object[] macSingleLineTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { + Object[] macSingleLineTextComponentBindings = SystemInfo.isMacOS ? new Object[] { // move caret to line begin/end (without selecting text) "UP", beginLineAction, "DOWN", endLineAction, @@ -295,7 +294,7 @@ class FlatInputMaps mac( "ctrl SPACE", "meta SPACE" ), "activate-link-action", }; - Object[] macMultiLineTextComponentBindings = SystemInfo.IS_MAC ? new Object[] { + Object[] macMultiLineTextComponentBindings = SystemInfo.isMacOS ? new Object[] { // move caret one line (without selecting text) "ctrl N", downAction, "ctrl P", upAction, @@ -350,6 +349,12 @@ class FlatInputMaps "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -370,8 +375,6 @@ class FlatInputMaps "ctrl UP", null, "ctrl V", null, "ctrl X", null, - "PAGE_DOWN", null, - "PAGE_UP", null, "SPACE", null, "shift ctrl DOWN", null, "shift ctrl END", null, @@ -390,10 +393,16 @@ class FlatInputMaps "shift INSERT", null, "shift SPACE", null ); - - // scrollbar - copyInputMap( defaults, "ScrollBar.ancestorInputMap", "ScrollBar.focusInputMap" ); - copyInputMap( defaults, "ScrollBar.ancestorInputMap.RightToLeft", "ScrollBar.focusInputMap.RightToLeft" ); + modifyInputMap( defaults, "List.focusInputMap.RightToLeft", + "ctrl KP_LEFT", null, + "ctrl KP_RIGHT", null, + "ctrl LEFT", null, + "ctrl RIGHT", null, + "shift ctrl KP_LEFT", null, + "shift ctrl KP_RIGHT", null, + "shift ctrl LEFT", null, + "shift ctrl RIGHT", null + ); // scrollpane modifyInputMap( defaults, "ScrollPane.ancestorInputMap", @@ -410,6 +419,16 @@ class FlatInputMaps "ctrl PAGE_UP", null ); + // tabbedpane + modifyInputMap( defaults, "TabbedPane.ancestorInputMap", + "ctrl UP", null, + "ctrl KP_UP", null + ); + modifyInputMap( defaults, "TabbedPane.focusInputMap", + "ctrl DOWN", null, + "ctrl KP_DOWN", null + ); + // table modifyInputMap( defaults, "Table.ancestorInputMap", "alt TAB", "focusHeader", @@ -419,6 +438,12 @@ class FlatInputMaps "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -476,27 +501,34 @@ class FlatInputMaps "RIGHT", "selectChild", "KP_LEFT", "selectParent", "KP_RIGHT", "selectChild", + "shift LEFT", "selectParent", + "shift RIGHT", "selectChild", + "shift KP_LEFT", "selectParent", + "shift KP_RIGHT", "selectChild", + "alt LEFT", "selectParent", + "alt RIGHT", "selectChild", + "alt KP_LEFT", "selectParent", + "alt KP_RIGHT", "selectChild", + + "shift HOME", "selectFirstExtendSelection", + "shift END", "selectLastExtendSelection", "meta A", "selectAll", "meta C", "copy", "meta V", "paste", "meta X", "cut", + // let parent scroll pane do the macOS typical scrolling without changing selection + "HOME", null, + "END", null, + "PAGE_UP", null, + "PAGE_DOWN", null, + "ctrl LEFT", null, "ctrl RIGHT", null, "ctrl KP_LEFT", null, "ctrl KP_RIGHT", null, - "shift LEFT", null, - "shift RIGHT", null, - "shift KP_LEFT", null, - "shift KP_RIGHT", null, - - "alt LEFT", null, - "alt RIGHT", null, - "alt KP_LEFT", null, - "alt KP_RIGHT", null, - "ctrl A", null, "ctrl BACK_SLASH", null, "ctrl C", null, @@ -513,11 +545,7 @@ class FlatInputMaps "ctrl UP", null, "ctrl V", null, "ctrl X", null, - "END", null, "F2", null, - "HOME", null, - "PAGE_DOWN", null, - "PAGE_UP", null, "SPACE", null, "shift ctrl DOWN", null, "shift ctrl END", null, @@ -529,8 +557,6 @@ class FlatInputMaps "shift ctrl SPACE", null, "shift ctrl UP", null, "shift DELETE", null, - "shift END", null, - "shift HOME", null, "shift INSERT", null, "shift PAGE_DOWN", null, "shift PAGE_UP", null, @@ -540,24 +566,29 @@ class FlatInputMaps "LEFT", "selectChild", "RIGHT", "selectParent", "KP_LEFT", "selectChild", - "KP_RIGHT", "selectParent" + "KP_RIGHT", "selectParent", + "shift LEFT", "selectChild", + "shift RIGHT", "selectParent", + "shift KP_LEFT", "selectChild", + "shift KP_RIGHT", "selectParent", + "alt LEFT", "selectChild", + "alt RIGHT", "selectParent", + "alt KP_LEFT", "selectChild", + "alt KP_RIGHT", "selectParent" } ) ); } - private static void copyInputMap( UIDefaults defaults, String srcKey, String destKey ) { - // Note: not using `defaults.get(key)` here because this would resolve the lazy value - Object inputMap = defaults.remove( srcKey ); - defaults.put( srcKey, inputMap ); - defaults.put( destKey, inputMap ); + private static void modifyInputMap( UIDefaults defaults, String key, Object... bindings ) { + modifyInputMap( null, defaults, key, bindings ); } - private static void modifyInputMap( UIDefaults defaults, String key, Object... bindings ) { - // Note: not using `defaults.get(key)` here because this would resolve the lazy value - defaults.put( key, new LazyModifyInputMap( defaults.remove( key ), bindings ) ); + private static void modifyInputMap( BooleanSupplier condition, UIDefaults defaults, String key, Object... bindings ) { + // Note: not using `defaults.get(key)` here because this would resolve a lazy value + defaults.put( key, new LazyModifyInputMap( condition, defaults.remove( key ), bindings ) ); } private static T mac( T value, T macValue ) { - return SystemInfo.IS_MAC ? macValue : value; + return SystemInfo.isMacOS ? macValue : value; } //---- class LazyInputMapEx ----------------------------------------------- @@ -592,10 +623,12 @@ class FlatInputMaps private static class LazyModifyInputMap implements LazyValue { + private final BooleanSupplier condition; private final Object baseInputMap; private final Object[] bindings; - LazyModifyInputMap( Object baseInputMap, Object[] bindings ) { + LazyModifyInputMap( BooleanSupplier condition, Object baseInputMap, Object[] bindings ) { + this.condition = condition; this.baseInputMap = baseInputMap; this.bindings = bindings; } @@ -607,6 +640,9 @@ class FlatInputMaps ? (InputMap) ((LazyValue)baseInputMap).createValue( table ) : (InputMap) baseInputMap; + if( condition != null && !condition.getAsBoolean() ) + return inputMap; + // modify input map (replace or remove) for( int i = 0; i < bindings.length; i += 2 ) { KeyStroke keyStroke = KeyStroke.getKeyStroke( (String) bindings[i] ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java index b5836570..778096f0 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java @@ -32,11 +32,11 @@ public class FlatIntelliJLaf @Override public String getName() { - return "Flat IntelliJ"; + return "FlatLaf IntelliJ"; } @Override public String getDescription() { - return "Flat IntelliJ Look and Feel"; + return "FlatLaf IntelliJ Look and Feel"; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index c02ec1e1..69af8217 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -18,38 +18,51 @@ package com.formdev.flatlaf; import java.awt.Color; import java.awt.Component; -import java.awt.Container; import java.awt.EventQueue; import java.awt.Font; -import java.awt.KeyEventPostProcessor; -import java.awt.KeyboardFocusManager; +import java.awt.Image; import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.Window; -import java.awt.event.KeyEvent; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageFilter; +import java.awt.image.ImageProducer; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.lang.ref.WeakReference; +import java.io.File; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Properties; +import java.util.ServiceLoader; import java.util.function.Consumer; +import java.util.function.Function; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.AbstractButton; -import javax.swing.JLabel; -import javax.swing.JRootPane; -import javax.swing.JTabbedPane; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.LookAndFeel; import javax.swing.PopupFactory; import javax.swing.SwingUtilities; import javax.swing.UIDefaults; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.UIDefaults.ActiveValue; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; +import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicLookAndFeel; +import javax.swing.text.StyleContext; import javax.swing.text.html.HTMLEditorKit; +import com.formdev.flatlaf.ui.FlatPopupFactory; +import com.formdev.flatlaf.ui.JBRCustomDecorations; +import com.formdev.flatlaf.util.GrayFilter; +import com.formdev.flatlaf.util.MultiResolutionImageSupport; import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.UIScale; @@ -64,18 +77,23 @@ public abstract class FlatLaf static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() ); private static final String DESKTOPFONTHINTS = "awt.font.desktophints"; + private static List customDefaultsSources; + private String desktopPropertyName; + private String desktopPropertyName2; private PropertyChangeListener desktopPropertyListener; private static boolean aquaLoaded; private static boolean updateUIPending; - private KeyEventPostProcessor mnemonicListener; - private static boolean showMnemonics; - private static WeakReference lastShowMnemonicWindow; + private PopupFactory oldPopupFactory; + private MnemonicHandler mnemonicHandler; private Consumer postInitialization; + private Boolean oldFrameWindowDecorated; + private Boolean oldDialogWindowDecorated; + public static boolean install( LookAndFeel newLookAndFeel ) { try { UIManager.setLookAndFeel( newLookAndFeel ); @@ -101,6 +119,45 @@ public abstract class FlatLaf public abstract boolean isDark(); + /** + * Checks whether the current look and feel is dark. + */ + public static boolean isLafDark() { + LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); + return lookAndFeel instanceof FlatLaf && ((FlatLaf)lookAndFeel).isDark(); + } + + /** + * Returns whether FlatLaf supports custom window decorations. + * This depends on the operating system and on the used Java runtime. + *

+ * To use custom window decorations in your application, enable them with + * following code (before creating any frames or dialogs). Then custom window + * decorations are only enabled if this method returns {@code true}. + *

+	 * JFrame.setDefaultLookAndFeelDecorated( true );
+	 * JDialog.setDefaultLookAndFeelDecorated( true );
+	 * 
+ *

+ * Returns {@code true} on Windows 10, {@code false} otherwise. + *

+ * Return also {@code false} if running on Windows 10 in + * JetBrains Runtime 11 (or later) + * (source code on github) + * and JBR supports custom window decorations. In this case, JBR custom decorations + * are enabled if {@link JFrame#isDefaultLookAndFeelDecorated()} or + * {@link JDialog#isDefaultLookAndFeelDecorated()} return {@code true}. + */ + @Override + public boolean getSupportsWindowDecorations() { + if( SystemInfo.isJetBrainsJVM_11_orLater && + SystemInfo.isWindows_10_orLater && + JBRCustomDecorations.isSupported() ) + return false; + + return SystemInfo.isWindows_10_orLater; + } + @Override public boolean isNativeLookAndFeel() { return false; @@ -111,35 +168,60 @@ public abstract class FlatLaf return true; } + @Override + public Icon getDisabledIcon( JComponent component, Icon icon ) { + if( icon instanceof ImageIcon ) { + Object grayFilter = UIManager.get( "Component.grayFilter" ); + ImageFilter filter = (grayFilter instanceof ImageFilter) + ? (ImageFilter) grayFilter + : GrayFilter.createDisabledIconFilter( isDark() ); // fallback + + Function mapper = img -> { + ImageProducer producer = new FilteredImageSource( img.getSource(), filter ); + return Toolkit.getDefaultToolkit().createImage( producer ); + }; + + Image image = ((ImageIcon)icon).getImage(); + return new ImageIconUIResource( MultiResolutionImageSupport.map( image, mapper ) ); + } + + return null; + } + @Override public void initialize() { - if( SystemInfo.IS_MAC ) + if( SystemInfo.isMacOS ) initializeAqua(); super.initialize(); - // add mnemonic listener - mnemonicListener = e -> { - checkShowMnemonics( e ); - return false; - }; - KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor( mnemonicListener ); + // install popup factory + oldPopupFactory = PopupFactory.getSharedInstance(); + PopupFactory.setSharedInstance( new FlatPopupFactory() ); + + // install mnemonic handler + mnemonicHandler = new MnemonicHandler(); + mnemonicHandler.install(); // listen to desktop property changes to update UI if system font or scaling changes - if( SystemInfo.IS_WINDOWS ) { + if( SystemInfo.isWindows ) { // Windows 10 allows increasing font size independent of scaling: // Settings > Ease of Access > Display > Make text bigger (100% - 225%) desktopPropertyName = "win.messagebox.font"; - } else if( SystemInfo.IS_LINUX ) { + } else if( SystemInfo.isLinux ) { + // Linux/Gnome allows changing font in "Tweaks" app + desktopPropertyName = "gnome.Gtk/FontName"; + // Linux/Gnome allows extra scaling and larger text: // Settings > Devices > Displays > Scale (100% or 200%) // Settings > Universal access > Large Text (off or on, 125%) - desktopPropertyName = "gnome.Xft/DPI"; + // "Tweaks" app > Fonts > Scaling Factor (0,5 - 3) + desktopPropertyName2 = "gnome.Xft/DPI"; } if( desktopPropertyName != null ) { desktopPropertyListener = e -> { String propertyName = e.getPropertyName(); - if( desktopPropertyName.equals( propertyName ) ) + if( desktopPropertyName.equals( propertyName ) || propertyName.equals( desktopPropertyName2 ) ) reSetLookAndFeel(); else if( DESKTOPFONTHINTS.equals( propertyName ) ) { if( UIManager.getLookAndFeel() instanceof FlatLaf ) { @@ -150,6 +232,8 @@ public abstract class FlatLaf }; Toolkit toolkit = Toolkit.getDefaultToolkit(); toolkit.addPropertyChangeListener( desktopPropertyName, desktopPropertyListener ); + if( desktopPropertyName2 != null ) + toolkit.addPropertyChangeListener( desktopPropertyName2, desktopPropertyListener ); toolkit.addPropertyChangeListener( DESKTOPFONTHINTS, desktopPropertyListener ); } @@ -164,6 +248,16 @@ public abstract class FlatLaf String.format( "a { color: #%06x; }", linkColor.getRGB() & 0xffffff ) ); } }; + + // enable/disable window decorations, but only if system property is either + // "true" or "false"; in other cases it is not changed + Boolean useWindowDecorations = FlatSystemProperties.getBooleanStrict( FlatSystemProperties.USE_WINDOW_DECORATIONS, null ); + if( useWindowDecorations != null ) { + oldFrameWindowDecorated = JFrame.isDefaultLookAndFeelDecorated(); + oldDialogWindowDecorated = JDialog.isDefaultLookAndFeelDecorated(); + JFrame.setDefaultLookAndFeelDecorated( useWindowDecorations ); + JDialog.setDefaultLookAndFeelDecorated( useWindowDecorations ); + } } @Override @@ -172,21 +266,38 @@ public abstract class FlatLaf if( desktopPropertyListener != null ) { Toolkit toolkit = Toolkit.getDefaultToolkit(); toolkit.removePropertyChangeListener( desktopPropertyName, desktopPropertyListener ); + if( desktopPropertyName2 != null ) + toolkit.removePropertyChangeListener( desktopPropertyName2, desktopPropertyListener ); toolkit.removePropertyChangeListener( DESKTOPFONTHINTS, desktopPropertyListener ); desktopPropertyName = null; + desktopPropertyName2 = null; desktopPropertyListener = null; } - // remove mnemonic listener - if( mnemonicListener != null ) { - KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor( mnemonicListener ); - mnemonicListener = null; + // uninstall popup factory + if( oldPopupFactory != null ) { + PopupFactory.setSharedInstance( oldPopupFactory ); + oldPopupFactory = null; + } + + // uninstall mnemonic handler + if( mnemonicHandler != null ) { + mnemonicHandler.uninstall(); + mnemonicHandler = null; } // restore default link color new HTMLEditorKit().getStyleSheet().addRule( "a { color: blue; }" ); postInitialization = null; + // restore enable/disable window decorations + if( oldFrameWindowDecorated != null ) { + JFrame.setDefaultLookAndFeelDecorated( oldFrameWindowDecorated ); + JDialog.setDefaultLookAndFeelDecorated( oldDialogWindowDecorated ); + oldFrameWindowDecorated = null; + oldDialogWindowDecorated = null; + } + super.uninitialize(); } @@ -207,7 +318,7 @@ public abstract class FlatLaf String aquaLafClassName = "com.apple.laf.AquaLookAndFeel"; BasicLookAndFeel aquaLaf; try { - if( SystemInfo.IS_JAVA_9_OR_LATER ) { + if( SystemInfo.isJava_9_orLater ) { Method m = UIManager.class.getMethod( "createLookAndFeel", String.class ); aquaLaf = (BasicLookAndFeel) m.invoke( null, "Mac OS X" ); } else @@ -233,12 +344,17 @@ public abstract class FlatLaf public UIDefaults getDefaults() { UIDefaults defaults = super.getDefaults(); - // add Metal resource bundle, which is required for FlatFileChooserUI - defaults.addResourceBundle( "com.sun.swing.internal.plaf.metal.resources.metal" ); + // add flag that indicates whether the LaF is light or dark + // (can be queried without using FlatLaf API) + defaults.put( "laf.dark", isDark() ); + + // add resource bundle for localized texts + defaults.addResourceBundle( "com.formdev.flatlaf.resources.Bundle" ); // initialize some defaults (for overriding) that are used in UI delegates, // but are not set in BasicLookAndFeel putDefaults( defaults, defaults.getColor( "control" ), + "Button.disabledBackground", "EditorPane.disabledBackground", "EditorPane.inactiveBackground", "FormattedTextField.disabledBackground", @@ -248,7 +364,8 @@ public abstract class FlatLaf "TextArea.inactiveBackground", "TextField.disabledBackground", "TextPane.disabledBackground", - "TextPane.inactiveBackground" ); + "TextPane.inactiveBackground", + "ToggleButton.disabledBackground" ); putDefaults( defaults, defaults.getColor( "textInactiveText" ), "Button.disabledText", "CheckBox.disabledText", @@ -266,73 +383,121 @@ public abstract class FlatLaf initIconColors( defaults, isDark() ); FlatInputMaps.initInputMaps( defaults ); + // get addons and sort them by priority + ServiceLoader addonLoader = ServiceLoader.load( FlatDefaultsAddon.class ); + List addons = new ArrayList<>(); + for( FlatDefaultsAddon addon : addonLoader ) + addons.add( addon ); + addons.sort( (addon1, addon2) -> addon1.getPriority() - addon2.getPriority() ); + // load defaults from properties List> lafClassesForDefaultsLoading = getLafClassesForDefaultsLoading(); if( lafClassesForDefaultsLoading != null ) - UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( lafClassesForDefaultsLoading, addons, getAdditionalDefaults(), isDark(), defaults ); else - UIDefaultsLoader.loadDefaultsFromProperties( getClass(), defaults ); + UIDefaultsLoader.loadDefaultsFromProperties( getClass(), addons, getAdditionalDefaults(), isDark(), defaults ); // use Aqua MenuBarUI if Mac screen menubar is enabled - if( SystemInfo.IS_MAC && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) + if( SystemInfo.isMacOS && Boolean.getBoolean( "apple.laf.useScreenMenuBar" ) ) { defaults.put( "MenuBarUI", "com.apple.laf.AquaMenuBarUI" ); + // add defaults necessary for AquaMenuBarUI + defaults.put( "MenuBar.backgroundPainter", BorderFactory.createEmptyBorder() ); + } + // initialize text antialiasing putAATextInfo( defaults ); - invokePostInitialization( defaults ); + // apply additional defaults (e.g. from IntelliJ themes) + applyAdditionalDefaults( defaults ); - return defaults; - } + // allow addons modifying UI defaults + for( FlatDefaultsAddon addon : addons ) + addon.afterDefaultsLoading( this, defaults ); + + // add user scale factor to allow layout managers (e.g. MigLayout) to use it + defaults.put( "laf.scaleFactor", (ActiveValue) t -> { + return UIScale.getUserScaleFactor(); + } ); - void invokePostInitialization( UIDefaults defaults ) { if( postInitialization != null ) { postInitialization.accept( defaults ); postInitialization = null; } + + return defaults; } - List> getLafClassesForDefaultsLoading() { + void applyAdditionalDefaults( UIDefaults defaults ) { + } + + protected List> getLafClassesForDefaultsLoading() { + return null; + } + + protected Properties getAdditionalDefaults() { return null; } private void initFonts( UIDefaults defaults ) { FontUIResource uiFont = null; - if( SystemInfo.IS_WINDOWS ) { + if( SystemInfo.isWindows ) { Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty( "win.messagebox.font" ); if( winFont != null ) - uiFont = new FontUIResource( winFont ); + uiFont = createCompositeFont( winFont.getFamily(), winFont.getStyle(), winFont.getSize() ); - } else if( SystemInfo.IS_MAC ) { + } else if( SystemInfo.isMacOS ) { String fontName; - if( SystemInfo.IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER ) { + if( SystemInfo.isMacOS_10_15_Catalina_orLater ) { + // use Helvetica Neue font + fontName = "Helvetica Neue"; + } else if( SystemInfo.isMacOS_10_11_ElCapitan_orLater ) { // use San Francisco Text font fontName = ".SF NS Text"; } else { // default font on older systems (see com.apple.laf.AquaFonts) fontName = "Lucida Grande"; } - uiFont = new FontUIResource( fontName, Font.PLAIN, 13 ); - } else if( SystemInfo.IS_LINUX ) { + uiFont = createCompositeFont( fontName, Font.PLAIN, 13 ); + + } else if( SystemInfo.isLinux ) { Font font = LinuxFontPolicy.getFont(); uiFont = (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font ); } + // fallback if( uiFont == null ) - return; + uiFont = createCompositeFont( Font.SANS_SERIF, Font.PLAIN, 12 ); + // increase font size if system property "flatlaf.uiScale" is set uiFont = UIScale.applyCustomScaleFactor( uiFont ); + // use active value for all fonts to allow changing fonts in all components + // (similar as in Nimbus L&F) with: + // UIManager.put( "defaultFont", myFont ); + Object activeFont = new ActiveFont( 1 ); + // override fonts for( Object key : defaults.keySet() ) { if( key instanceof String && (((String)key).endsWith( ".font" ) || ((String)key).endsWith( "Font" )) ) - defaults.put( key, uiFont ); + defaults.put( key, activeFont ); } // use smaller font for progress bar - defaults.put( "ProgressBar.font", UIScale.scaleFont( uiFont, 0.85f ) ); + defaults.put( "ProgressBar.font", new ActiveFont( 0.85f ) ); + + // set default font + defaults.put( "defaultFont", uiFont ); + } + + static FontUIResource createCompositeFont( String family, int style, int size ) { + // using StyleContext.getFont() here because it uses + // sun.font.FontUtilities.getCompositeFontUIResource() + // and creates a composite font that is able to display all Unicode characters + Font font = StyleContext.getDefaultStyleContext().getFont( family, style, size ); + return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font ); } /** @@ -348,34 +513,18 @@ public abstract class FlatLaf * Action icons * and * Noun icons + *

+ * These colors may be changed by IntelliJ Platform themes. */ public static void initIconColors( UIDefaults defaults, boolean dark ) { - // colors for action icons - // see https://jetbrains.design/intellij/principles/icons/#action-icons - defaults.put( "Actions.Red", new ColorUIResource( !dark ? 0xDB5860 : 0xC75450 ) ); - defaults.put( "Actions.Yellow", new ColorUIResource( !dark ? 0xEDA200 : 0xF0A732 ) ); - defaults.put( "Actions.Green", new ColorUIResource( !dark ? 0x59A869 : 0x499C54 ) ); - defaults.put( "Actions.Blue", new ColorUIResource( !dark ? 0x389FD6 : 0x3592C4 ) ); - defaults.put( "Actions.Grey", new ColorUIResource( !dark ? 0x6E6E6E : 0xAFB1B3 ) ); - defaults.put( "Actions.GreyInline", new ColorUIResource( !dark ? 0x7F8B91 : 0x7F8B91 ) ); - - // colors for object icons - // see https://jetbrains.design/intellij/principles/icons/#noun-icons - defaults.put( "Objects.Grey", new ColorUIResource( 0x9AA7B0 ) ); - defaults.put( "Objects.Blue", new ColorUIResource( 0x40B6E0 ) ); - defaults.put( "Objects.Green", new ColorUIResource( 0x62B543 ) ); - defaults.put( "Objects.Yellow", new ColorUIResource( 0xF4AF3D ) ); - defaults.put( "Objects.YellowDark", new ColorUIResource( 0xD9A343 ) ); - defaults.put( "Objects.Purple", new ColorUIResource( 0xB99BF8 ) ); - defaults.put( "Objects.Pink", new ColorUIResource( 0xF98B9E ) ); - defaults.put( "Objects.Red", new ColorUIResource( 0xF26522 ) ); - defaults.put( "Objects.RedStatus", new ColorUIResource( 0xE05555 ) ); - defaults.put( "Objects.GreenAndroid", new ColorUIResource( 0xA4C639 ) ); - defaults.put( "Objects.BlackText", new ColorUIResource( 0x231F20 ) ); + for( FlatIconColors c : FlatIconColors.values() ) { + if( c.light == !dark || c.dark == dark ) + defaults.put( c.key, new ColorUIResource( c.rgb ) ); + } } private void putAATextInfo( UIDefaults defaults ) { - if( SystemInfo.IS_JAVA_9_OR_LATER ) { + if( SystemInfo.isJava_9_orLater ) { Object desktopHints = Toolkit.getDefaultToolkit().getDesktopProperty( DESKTOPFONTHINTS ); if( desktopHints instanceof Map ) { @SuppressWarnings( "unchecked" ) @@ -412,6 +561,87 @@ public abstract class FlatLaf defaults.put( key, value ); } + static List getCustomDefaultsSources() { + return customDefaultsSources; + } + + /** + * Registers a package where FlatLaf searches for properties files with custom UI defaults. + *

+ * This can be used to specify application specific UI defaults that override UI values + * of existing themes or to define own UI values used in custom controls. + *

+ * There may be multiple properties files in that package for multiple themes. + * The properties file name must match the used theme class names. + * E.g. {@code FlatLightLaf.properties} for class {@link FlatLightLaf} + * or {@code FlatDarkLaf.properties} for class {@link FlatDarkLaf}. + * {@code FlatLaf.properties} is loaded first for all themes. + *

+ * These properties files are loaded after theme and addon properties files + * and can therefore override all UI defaults. + *

+ * Invoke this method before setting the look and feel. + * + * @param packageName a package name (e.g. "com.myapp.resources") + */ + public static void registerCustomDefaultsSource( String packageName ) { + registerCustomDefaultsSource( packageName, null ); + } + + public static void unregisterCustomDefaultsSource( String packageName ) { + unregisterCustomDefaultsSource( packageName, null ); + } + + /** + * Registers a package where FlatLaf searches for properties files with custom UI defaults. + *

+ * See {@link #registerCustomDefaultsSource(String)} for details. + * + * @param packageName a package name (e.g. "com.myapp.resources") + * @param classLoader a class loader used to find resources, or {@code null} + */ + public static void registerCustomDefaultsSource( String packageName, ClassLoader classLoader ) { + if( customDefaultsSources == null ) + customDefaultsSources = new ArrayList<>(); + customDefaultsSources.add( packageName ); + customDefaultsSources.add( classLoader ); + } + + public static void unregisterCustomDefaultsSource( String packageName, ClassLoader classLoader ) { + if( customDefaultsSources == null ) + return; + + int size = customDefaultsSources.size(); + for( int i = 0; i < size - 1; i++ ) { + Object source = customDefaultsSources.get( i ); + if( packageName.equals( source ) && customDefaultsSources.get( i + 1 ) == classLoader ) { + customDefaultsSources.remove( i + 1 ); + customDefaultsSources.remove( i ); + break; + } + } + } + + /** + * Registers a folder where FlatLaf searches for properties files with custom UI defaults. + *

+ * See {@link #registerCustomDefaultsSource(String)} for details. + * + * @param folder a folder + */ + public static void registerCustomDefaultsSource( File folder ) { + if( customDefaultsSources == null ) + customDefaultsSources = new ArrayList<>(); + customDefaultsSources.add( folder ); + } + + public static void unregisterCustomDefaultsSource( File folder ) { + if( customDefaultsSources == null ) + return; + + customDefaultsSources.remove( folder ); + } + private static void reSetLookAndFeel() { EventQueue.invokeLater( () -> { LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); @@ -461,85 +691,75 @@ public abstract class FlatLaf } public static boolean isShowMnemonics() { - return showMnemonics || !UIManager.getBoolean( "Component.hideMnemonics" ); + return MnemonicHandler.isShowMnemonics(); } - private static void checkShowMnemonics( KeyEvent e ) { - int keyCode = e.getKeyCode(); - if( SystemInfo.IS_MAC ) { - // Ctrl+Alt keys must be pressed on Mac - if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT ) - showMnemonics( e.getID() == KeyEvent.KEY_PRESSED && e.isControlDown() && e.isAltDown(), e.getComponent() ); - } else { - // Alt key must be pressed on Windows and Linux - if( keyCode == KeyEvent.VK_ALT ) - showMnemonics( e.getID() == KeyEvent.KEY_PRESSED, e.getComponent() ); + public static void showMnemonics( Component c ) { + MnemonicHandler.showMnemonics( true, c ); + } + + public static void hideMnemonics() { + MnemonicHandler.showMnemonics( false, null ); + } + + // do not allow overriding to avoid issues in FlatUIUtils.createSharedUI() + @Override + public final boolean equals( Object obj ) { + return super.equals( obj ); + } + + // do not allow overriding to avoid issues in FlatUIUtils.createSharedUI() + @Override + public final int hashCode() { + return super.hashCode(); + } + + //---- class ActiveFont --------------------------------------------------- + + private static class ActiveFont + implements ActiveValue + { + private final float scaleFactor; + + // cache (scaled) font + private Font font; + private Font lastDefaultFont; + + ActiveFont( float scaleFactor ) { + this.scaleFactor = scaleFactor; } - } - private static void showMnemonics( boolean show, Component c ) { - if( show == showMnemonics ) - return; + @Override + public Object createValue( UIDefaults table ) { + Font defaultFont = UIManager.getFont( "defaultFont" ); - showMnemonics = show; + if( lastDefaultFont != defaultFont ) { + lastDefaultFont = defaultFont; - // check whether it is necessary to repaint - if( !UIManager.getBoolean( "Component.hideMnemonics" ) ) - return; - - if( show ) { - // get root pane - JRootPane rootPane = SwingUtilities.getRootPane( c ); - if( rootPane == null ) - return; - - // get window - Window window = SwingUtilities.getWindowAncestor( rootPane ); - if( window == null ) - return; - - // repaint components with mnemonics in focused window - repaintMnemonics( window ); - - lastShowMnemonicWindow = new WeakReference<>( window ); - } else if( lastShowMnemonicWindow != null ) { - Window window = lastShowMnemonicWindow.get(); - if( window != null ) - repaintMnemonics( window ); - - lastShowMnemonicWindow = null; - } - } - - private static void repaintMnemonics( Container container ) { - for( Component c : container.getComponents() ) { - if( !c.isVisible() ) - continue; - - if( hasMnemonic( c ) ) - c.repaint(); - - if( c instanceof Container ) - repaintMnemonics( (Container) c ); - } - } - - private static boolean hasMnemonic( Component c ) { - if( c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() >= 0 ) - return true; - - if( c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() >= 0 ) - return true; - - if( c instanceof JTabbedPane ) { - JTabbedPane tabPane = (JTabbedPane) c; - int tabCount = tabPane.getTabCount(); - for( int i = 0; i < tabCount; i++ ) { - if( tabPane.getDisplayedMnemonicIndexAt( i ) >= 0 ) - return true; + if( scaleFactor != 1 ) { + // scale font + int newFontSize = Math.round( defaultFont.getSize() * scaleFactor ); + font = new FontUIResource( defaultFont.deriveFont( (float) newFontSize ) ); + } else { + // make sure that font is a UIResource for LaF switching + font = (defaultFont instanceof UIResource) + ? defaultFont + : new FontUIResource( defaultFont ); + } } - } - return false; + return font; + } + } + + //---- class ImageIconUIResource ------------------------------------------ + + private static class ImageIconUIResource + extends ImageIcon + implements UIResource + { + ImageIconUIResource( Image image ) { + super( image ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLightLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLightLaf.java index a02d6edc..b9ac12ac 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLightLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLightLaf.java @@ -32,12 +32,12 @@ public class FlatLightLaf @Override public String getName() { - return "Flat Light"; + return "FlatLaf Light"; } @Override public String getDescription() { - return "Flat Light Look and Feel"; + return "FlatLaf Light Look and Feel"; } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatPropertiesLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatPropertiesLaf.java new file mode 100644 index 00000000..534f2115 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatPropertiesLaf.java @@ -0,0 +1,122 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Properties; + +/** + * A Flat LaF that is able to load UI defaults from properties passed to the constructor. + *

+ * Specify the base theme in the properties with {@code @baseTheme=}. + * Allowed values for {@code } are {@code light} (the default), {@code dark}, + * {@code intellij} or {@code darcula}. + *

+ * The properties are applied after loading the base theme and may overwrite base properties. + * All features of FlatLaf properties files are available. + * + * @author Karl Tauber + */ +public class FlatPropertiesLaf + extends FlatLaf +{ + private final String name; + private final String baseTheme; + private final boolean dark; + private final Properties properties; + + public FlatPropertiesLaf( String name, File propertiesFile ) + throws IOException + { + this( name, new FileInputStream( propertiesFile ) ); + } + + public FlatPropertiesLaf( String name, InputStream in ) + throws IOException + { + this( name, loadProperties( in ) ); + } + + private static Properties loadProperties( InputStream in ) + throws IOException + { + Properties properties = new Properties(); + try( InputStream in2 = in ) { + properties.load( in2 ); + } + return properties; + } + + public FlatPropertiesLaf( String name, Properties properties ) { + this.name = name; + this.properties = properties; + + baseTheme = properties.getProperty( "@baseTheme", "light" ); + dark = "dark".equalsIgnoreCase( baseTheme ) || "darcula".equalsIgnoreCase( baseTheme ); + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return name; + } + + @Override + public boolean isDark() { + return dark; + } + + @Override + protected ArrayList> getLafClassesForDefaultsLoading() { + ArrayList> lafClasses = new ArrayList<>(); + lafClasses.add( FlatLaf.class ); + switch( baseTheme.toLowerCase() ) { + default: + case "light": + lafClasses.add( FlatLightLaf.class ); + break; + + case "dark": + lafClasses.add( FlatDarkLaf.class ); + break; + + case "intellij": + lafClasses.add( FlatLightLaf.class ); + lafClasses.add( FlatIntelliJLaf.class ); + break; + + case "darcula": + lafClasses.add( FlatDarkLaf.class ); + lafClasses.add( FlatDarculaLaf.class ); + break; + } + return lafClasses; + } + + @Override + protected Properties getAdditionalDefaults() { + return properties; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java new file mode 100644 index 00000000..eb52cf12 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf; + +import javax.swing.JDialog; +import javax.swing.JFrame; + +/** + * Defines/documents own system properties used in FlatLaf. + * + * @author Karl Tauber + */ +public interface FlatSystemProperties +{ + /** + * Specifies a custom scale factor used to scale the UI. + *

+ * If Java runtime scales (Java 9 or later), this scale factor is applied on top + * of the Java system scale factor. Java 8 does not scale and this scale factor + * replaces the user scale factor that FlatLaf computes based on the font. + * To replace the Java 9+ system scale factor, use system property "sun.java2d.uiScale", + * which has the same syntax as this one. + *

+ * Allowed Values e.g. {@code 1.5}, {@code 1.5x}, {@code 150%} or {@code 144dpi} (96dpi is 100%)
+ */ + String UI_SCALE = "flatlaf.uiScale"; + + /** + * Specifies whether user scaling mode is enabled. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code true} + */ + String UI_SCALE_ENABLED = "flatlaf.uiScale.enabled"; + + /** + * Specifies whether Ubuntu font should be used on Ubuntu Linux. + * By default, if not running in a JetBrains Runtime, the Liberation Sans font + * is used because there are rendering issues (in Java) with Ubuntu fonts. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code false} + */ + String USE_UBUNTU_FONT = "flatlaf.useUbuntuFont"; + + /** + * Specifies whether custom look and feel window decorations should be used + * when creating {@code JFrame} or {@code JDialog}. + *

+ * If this system property is set, FlatLaf invokes {@link JFrame#setDefaultLookAndFeelDecorated(boolean)} + * and {@link JDialog#setDefaultLookAndFeelDecorated(boolean)} on LaF initialization. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default none + */ + String USE_WINDOW_DECORATIONS = "flatlaf.useWindowDecorations"; + + /** + * Specifies whether JetBrains Runtime custom window decorations should be used + * when creating {@code JFrame} or {@code JDialog}. + * Requires that the application runs in a + * JetBrains Runtime + * (based on OpenJDK). + *

+ * Setting this to {@code true} forces using JetBrains Runtime custom window decorations + * even if they are not enabled by the application. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code true} + */ + String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations"; + + /** + * Specifies whether menubar is embedded into custom window decorations. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code true} + */ + String MENUBAR_EMBEDDED = "flatlaf.menuBarEmbedded"; + + /** + * Specifies whether animations are enabled. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code true} + */ + String ANIMATION = "flatlaf.animation"; + + /** + * Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens. + *

+ * Allowed Values {@code false} and {@code true}
+ * Default {@code true} + */ + String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection"; + + /** + * Checks whether a system property is set and returns {@code true} if its value + * is {@code "true"} (case-insensitive), otherwise it returns {@code false}. + * If the system property is not set, {@code defaultValue} is returned. + */ + static boolean getBoolean( String key, boolean defaultValue ) { + String value = System.getProperty( key ); + return (value != null) ? Boolean.parseBoolean( value ) : defaultValue; + } + + /** + * Checks whether a system property is set and returns {@code Boolean.TRUE} if its value + * is {@code "true"} (case-insensitive) or returns {@code Boolean.FALSE} if its value + * is {@code "false"} (case-insensitive). Otherwise {@code defaultValue} is returned. + */ + static Boolean getBooleanStrict( String key, Boolean defaultValue ) { + String value = System.getProperty( key ); + if( "true".equalsIgnoreCase( value ) ) + return Boolean.TRUE; + if( "false".equalsIgnoreCase( value ) ) + return Boolean.FALSE; + return defaultValue; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java index 33f7dfdc..89daf814 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -86,7 +86,7 @@ public class IntelliJTheme * Using a buffered input stream is not necessary. */ public static FlatLaf createLaf( InputStream in ) - throws IOException, ParseException + throws IOException { return createLaf( new IntelliJTheme( in ) ); } @@ -106,11 +106,13 @@ public class IntelliJTheme */ @SuppressWarnings( "unchecked" ) public IntelliJTheme( InputStream in ) - throws IOException, ParseException + throws IOException { Map json; try( Reader reader = new InputStreamReader( in, StandardCharsets.UTF_8 ) ) { json = (Map) Json.parse( reader ); + } catch( ParseException ex ) { + throw new IOException( ex.getMessage(), ex ); } name = (String) json.get( "name" ); @@ -132,6 +134,8 @@ public class IntelliJTheme defaults.put( "Button.paintShadow", true ); defaults.put( "Button.shadowWidth", dark ? 2 : 1 ); + Map themeSpecificDefaults = removeThemeSpecificDefaults( defaults ); + loadNamedColors( defaults ); // convert Json "ui" structure to UI defaults @@ -143,6 +147,15 @@ public class IntelliJTheme applyColorPalette( defaults ); applyCheckBoxColors( defaults ); + // copy values + for( Map.Entry e : uiKeyCopying.entrySet() ) + defaults.put( e.getKey(), defaults.get( e.getValue() ) ); + + // IDEA does not paint button background if disabled, but FlatLaf does + Object panelBackground = defaults.get( "Panel.background" ); + defaults.put( "Button.disabledBackground", panelBackground ); + defaults.put( "ToggleButton.disabledBackground", panelBackground ); + // IDEA uses a SVG icon for the help button, but paints the background with Button.startBackground and Button.endBackground Object helpButtonBackground = defaults.get( "Button.startBackground" ); Object helpButtonBorderColor = defaults.get( "Button.startBorderColor" ); @@ -152,7 +165,7 @@ public class IntelliJTheme helpButtonBorderColor = defaults.get( "Button.borderColor" ); defaults.put( "HelpButton.background", helpButtonBackground ); defaults.put( "HelpButton.borderColor", helpButtonBorderColor ); - defaults.put( "HelpButton.disabledBackground", defaults.get( "Panel.background" ) ); + defaults.put( "HelpButton.disabledBackground", panelBackground ); defaults.put( "HelpButton.disabledBorderColor", defaults.get( "Button.disabledBorderColor" ) ); defaults.put( "HelpButton.focusedBorderColor", defaults.get( "Button.focusedBorderColor" ) ); defaults.put( "HelpButton.focusedBackground", defaults.get( "Button.focusedBackground" ) ); @@ -183,6 +196,42 @@ public class IntelliJTheme if( !uiKeys.contains( "Spinner.background" ) ) defaults.put( "Spinner.background", textFieldBackground ); } + + // fix ToggleButton + if( !uiKeys.contains( "ToggleButton.startBackground" ) && !uiKeys.contains( "*.startBackground" ) ) + defaults.put( "ToggleButton.startBackground", defaults.get( "Button.startBackground" ) ); + if( !uiKeys.contains( "ToggleButton.endBackground" ) && !uiKeys.contains( "*.endBackground" ) ) + defaults.put( "ToggleButton.endBackground", defaults.get( "Button.endBackground" ) ); + if( !uiKeys.contains( "ToggleButton.foreground" ) && uiKeys.contains( "Button.foreground" ) ) + defaults.put( "ToggleButton.foreground", defaults.get( "Button.foreground" ) ); + + // limit tree row height + int rowHeight = defaults.getInt( "Tree.rowHeight" ); + if( rowHeight > 22 ) + defaults.put( "Tree.rowHeight", 22 ); + + // apply theme specific UI defaults at the end to allow overwriting + defaults.putAll( themeSpecificDefaults ); + } + + private Map removeThemeSpecificDefaults( UIDefaults defaults ) { + // search for theme specific UI defaults keys + ArrayList themeSpecificKeys = new ArrayList<>(); + for( Object key : defaults.keySet() ) { + if( key instanceof String && ((String)key).startsWith( "[" ) ) + themeSpecificKeys.add( (String) key ); + } + + // remove theme specific UI defaults and remember only those for current theme + Map themeSpecificDefaults = new HashMap<>(); + String currentThemePrefix = '[' + name.replace( ' ', '_' ) + ']'; + for( String key : themeSpecificKeys ) { + Object value = defaults.remove( key ); + if( key.startsWith( currentThemePrefix ) ) + themeSpecificDefaults.put( key.substring( currentThemePrefix.length() ), value ); + } + + return themeSpecificDefaults; } /** @@ -200,7 +249,7 @@ public class IntelliJTheme if( color != null ) { String key = e.getKey(); namedColors.put( key, color ); - defaults.put( "ColorPalette." + e.getKey(), color ); + defaults.put( "ColorPalette." + key, color ); } } } @@ -214,8 +263,16 @@ public class IntelliJTheme for( Map.Entry e : ((Map)value).entrySet() ) apply( key + '.' + e.getKey(), e.getValue(), defaults, defaultsKeysCache, uiKeys ); } else { + if( "".equals( value ) ) + return; // ignore empty value + uiKeys.add( key ); + // fix ComboBox size and Spinner border in all Material UI Lite themes + boolean isMaterialUILite = author.equals( "Mallowigi" ); + if( isMaterialUILite && (key.equals( "ComboBox.padding" ) || key.equals( "Spinner.border" )) ) + return; // ignore + // map keys key = uiKeyMapping.getOrDefault( key, key ); if( key.isEmpty() ) @@ -270,7 +327,7 @@ public class IntelliJTheme // (e.g. set ComboBox.buttonEditableBackground to *.background // because it is mapped from ComboBox.ArrowButton.background) String km = uiKeyInverseMapping.getOrDefault( k, (String) k ); - if( km.endsWith( tail ) && !noWildcardReplace.contains( k ) && !((String)k).startsWith( "CheckBox.icon." ) ) + if( km.endsWith( tail ) && !((String)k).startsWith( "CheckBox.icon." ) ) defaults.put( k, uiValue ); } } @@ -362,6 +419,10 @@ public class IntelliJTheme String newKey = checkboxKeyMapping.get( key ); if( newKey != null ) { + String checkBoxIconPrefix = "CheckBox.icon."; + if( !dark && newKey.startsWith( checkBoxIconPrefix ) ) + newKey = "CheckBox.icon[filled].".concat( newKey.substring( checkBoxIconPrefix.length() ) ); + ColorUIResource color = toColor( (String) value ); if( color != null ) { defaults.put( newKey, color ); @@ -394,17 +455,24 @@ public class IntelliJTheme // remove hover and pressed colors if( checkboxModified ) { + defaults.remove( "CheckBox.icon.focusWidth" ); defaults.remove( "CheckBox.icon.hoverBorderColor" ); defaults.remove( "CheckBox.icon.focusedBackground" ); defaults.remove( "CheckBox.icon.hoverBackground" ); defaults.remove( "CheckBox.icon.pressedBackground" ); + defaults.remove( "CheckBox.icon.selectedFocusedBackground" ); defaults.remove( "CheckBox.icon.selectedHoverBackground" ); defaults.remove( "CheckBox.icon.selectedPressedBackground" ); - } - // copy values - for( Map.Entry e : uiKeyCopying.entrySet() ) - defaults.put( e.getKey(), defaults.get( e.getValue() ) ); + defaults.remove( "CheckBox.icon[filled].focusWidth" ); + defaults.remove( "CheckBox.icon[filled].hoverBorderColor" ); + defaults.remove( "CheckBox.icon[filled].focusedBackground" ); + defaults.remove( "CheckBox.icon[filled].hoverBackground" ); + defaults.remove( "CheckBox.icon[filled].pressedBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedFocusedBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedHoverBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedPressedBackground" ); + } } private static Map uiKeyMapping = new HashMap<>(); @@ -412,7 +480,6 @@ public class IntelliJTheme private static Map uiKeyInverseMapping = new HashMap<>(); private static Map checkboxKeyMapping = new HashMap<>(); private static Map checkboxDuplicateColors = new HashMap<>(); - private static Set noWildcardReplace = new HashSet<>(); static { // ComboBox @@ -423,14 +490,35 @@ public class IntelliJTheme uiKeyMapping.put( "ComboBox.ArrowButton.iconColor", "ComboBox.buttonArrowColor" ); uiKeyMapping.put( "ComboBox.ArrowButton.nonEditableBackground", "ComboBox.buttonBackground" ); + // Component + uiKeyMapping.put( "Component.inactiveErrorFocusColor", "Component.error.borderColor" ); + uiKeyMapping.put( "Component.errorFocusColor", "Component.error.focusedBorderColor" ); + uiKeyMapping.put( "Component.inactiveWarningFocusColor", "Component.warning.borderColor" ); + uiKeyMapping.put( "Component.warningFocusColor", "Component.warning.focusedBorderColor" ); + // Link uiKeyMapping.put( "Link.activeForeground", "Component.linkColor" ); + // Menu + uiKeyMapping.put( "Menu.border", "Menu.margin" ); + uiKeyMapping.put( "MenuItem.border", "MenuItem.margin" ); + uiKeyCopying.put( "CheckBoxMenuItem.margin", "MenuItem.margin" ); + uiKeyCopying.put( "RadioButtonMenuItem.margin", "MenuItem.margin" ); + uiKeyMapping.put( "PopupMenu.border", "PopupMenu.borderInsets" ); + + // IDEA uses List.selectionBackground also for menu selection + uiKeyCopying.put( "Menu.selectionBackground", "List.selectionBackground" ); + uiKeyCopying.put( "MenuItem.selectionBackground", "List.selectionBackground" ); + uiKeyCopying.put( "CheckBoxMenuItem.selectionBackground", "List.selectionBackground" ); + uiKeyCopying.put( "RadioButtonMenuItem.selectionBackground", "List.selectionBackground" ); + // ProgressBar uiKeyMapping.put( "ProgressBar.background", "" ); // ignore uiKeyMapping.put( "ProgressBar.foreground", "" ); // ignore uiKeyMapping.put( "ProgressBar.trackColor", "ProgressBar.background" ); uiKeyMapping.put( "ProgressBar.progressColor", "ProgressBar.foreground" ); + uiKeyCopying.put( "ProgressBar.selectionForeground", "ProgressBar.background" ); + uiKeyCopying.put( "ProgressBar.selectionBackground", "ProgressBar.foreground" ); // ScrollBar uiKeyMapping.put( "ScrollBar.trackColor", "ScrollBar.track" ); @@ -442,6 +530,11 @@ public class IntelliJTheme // Slider uiKeyMapping.put( "Slider.trackWidth", "" ); // ignore (used in Material Theme UI Lite) + // TitlePane + uiKeyCopying.put( "TitlePane.inactiveBackground", "TitlePane.background" ); + uiKeyMapping.put( "TitlePane.infoForeground", "TitlePane.foreground" ); + uiKeyMapping.put( "TitlePane.inactiveInfoForeground", "TitlePane.inactiveForeground" ); + for( Map.Entry e : uiKeyMapping.entrySet() ) uiKeyInverseMapping.put( e.getValue(), e.getKey() ); @@ -456,7 +549,7 @@ public class IntelliJTheme checkboxKeyMapping.put( "Checkbox.Border.Default", "CheckBox.icon.borderColor" ); checkboxKeyMapping.put( "Checkbox.Border.Disabled", "CheckBox.icon.disabledBorderColor" ); checkboxKeyMapping.put( "Checkbox.Focus.Thin.Default", "CheckBox.icon.focusedBorderColor" ); - checkboxKeyMapping.put( "Checkbox.Focus.Wide", "CheckBox.icon.focusedColor" ); + checkboxKeyMapping.put( "Checkbox.Focus.Wide", "CheckBox.icon.focusColor" ); checkboxKeyMapping.put( "Checkbox.Foreground.Disabled", "CheckBox.icon.disabledCheckmarkColor" ); checkboxKeyMapping.put( "Checkbox.Background.Selected", "CheckBox.icon.selectedBackground" ); checkboxKeyMapping.put( "Checkbox.Border.Selected", "CheckBox.icon.selectedBorderColor" ); @@ -470,16 +563,6 @@ public class IntelliJTheme Map.Entry[] entries = checkboxDuplicateColors.entrySet().toArray( new Map.Entry[checkboxDuplicateColors.size()] ); for( Map.Entry e : entries ) checkboxDuplicateColors.put( e.getValue(), e.getKey() ); - - // because FlatLaf uses Button.background and Button.borderColor, - // but IDEA uses Button.startBackground and Button.startBorderColor, - // our default button background and border colors may be replaced by - // wildcard *.background and *.borderColor colors - noWildcardReplace.add( "Button.background" ); - noWildcardReplace.add( "Button.borderColor" ); - noWildcardReplace.add( "Button.default.background" ); - noWildcardReplace.add( "Button.default.borderColor" ); - noWildcardReplace.add( "ToggleButton.background" ); } //---- class ThemeLaf ----------------------------------------------------- @@ -513,19 +596,12 @@ public class IntelliJTheme } @Override - public UIDefaults getDefaults() { - UIDefaults defaults = super.getDefaults(); + void applyAdditionalDefaults( UIDefaults defaults ) { theme.applyProperties( defaults ); - super.invokePostInitialization( defaults ); - return defaults; } @Override - void invokePostInitialization( UIDefaults defaults ) { - } - - @Override - ArrayList> getLafClassesForDefaultsLoading() { + protected ArrayList> getLafClassesForDefaultsLoading() { ArrayList> lafClasses = new ArrayList<>(); lafClasses.add( FlatLaf.class ); lafClasses.add( theme.dark ? FlatDarkLaf.class : FlatLightLaf.class ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java index cee1e295..fbd7f8c0 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java @@ -17,6 +17,7 @@ package com.formdev.flatlaf; import java.awt.Font; +import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.Toolkit; import java.io.BufferedReader; @@ -28,9 +29,9 @@ import java.util.Collections; import java.util.List; import java.util.StringTokenizer; import java.util.logging.Level; -import javax.swing.text.StyleContext; import com.formdev.flatlaf.util.StringUtils; import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; /** * @author Karl Tauber @@ -38,7 +39,7 @@ import com.formdev.flatlaf.util.SystemInfo; class LinuxFontPolicy { static Font getFont() { - return SystemInfo.IS_KDE ? getKDEFont() : getGnomeFont(); + return SystemInfo.isKDE ? getKDEFont() : getGnomeFont(); } /** @@ -73,6 +74,13 @@ class LinuxFontPolicy family = family.isEmpty() ? word : (family + ' ' + word); } + // Ubuntu font is rendered poorly (except if running in JetBrains VM) + // --> use Liberation Sans font + if( family.startsWith( "Ubuntu" ) && + !SystemInfo.isJetBrainsJVM && + !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_UBUNTU_FONT, false ) ) + family = "Liberation Sans"; + // scale font size double dsize = size * getGnomeFontScale(); size = (int) (dsize + 0.5); @@ -88,9 +96,7 @@ class LinuxFontPolicy } private static Font createFont( String family, int style, int size, double dsize ) { - // using StyleContext.getFont() here because it uses - // sun.font.FontUtilities.getCompositeFontUIResource() - Font font = new StyleContext().getFont( family, style, size ); + Font font = FlatLaf.createCompositeFont( family, style, size ); // set font size in floating points font = font.deriveFont( style, (float) dsize ); @@ -99,6 +105,10 @@ class LinuxFontPolicy } private static double getGnomeFontScale() { + // do not scale font here if JRE scales + if( isSystemScaling() ) + return 96. / 72.; + // see class com.sun.java.swing.plaf.gtk.PangoFonts background information Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "gnome.Xft/DPI" ); @@ -168,7 +178,7 @@ class LinuxFontPolicy // font dpi int dpi = 96; - if( forceFontDPI != null ) { + if( forceFontDPI != null && !isSystemScaling() ) { try { dpi = Integer.parseInt( forceFontDPI ); if( dpi <= 0 ) @@ -247,4 +257,15 @@ class LinuxFontPolicy } return null; } + + /** + * Returns true if the JRE scales, which is the case if: + * - environment variable GDK_SCALE is set and running on Java 9 or later + * - running on JetBrains Runtime 11 or later and scaling is enabled in system Settings + */ + private static boolean isSystemScaling() { + GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice().getDefaultConfiguration(); + return UIScale.getSystemScaleFactor( gc ) > 1; + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/MnemonicHandler.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/MnemonicHandler.java new file mode 100644 index 00000000..5606ae0c --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/MnemonicHandler.java @@ -0,0 +1,259 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf; + +import java.awt.Component; +import java.awt.Container; +import java.awt.EventQueue; +import java.awt.KeyEventPostProcessor; +import java.awt.KeyboardFocusManager; +import java.awt.Window; +import java.awt.event.KeyEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import java.lang.ref.WeakReference; +import javax.swing.AbstractButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JRootPane; +import javax.swing.JTabbedPane; +import javax.swing.MenuElement; +import javax.swing.MenuSelectionManager; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import com.formdev.flatlaf.util.SystemInfo; + +/** + * Show/hide mnemonics. + * + * @author Karl Tauber + */ +class MnemonicHandler + implements KeyEventPostProcessor, ChangeListener +{ + private static boolean showMnemonics; + private static WeakReference lastShowMnemonicWindow; + private static WindowListener windowListener; + + static boolean isShowMnemonics() { + return showMnemonics || !UIManager.getBoolean( "Component.hideMnemonics" ); + } + + void install() { + KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor( this ); + MenuSelectionManager.defaultManager().addChangeListener( this ); + } + + void uninstall() { + KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor( this ); + MenuSelectionManager.defaultManager().removeChangeListener( this ); + } + + @Override + public boolean postProcessKeyEvent( KeyEvent e ) { + int keyCode = e.getKeyCode(); + if( SystemInfo.isMacOS ) { + // Ctrl+Alt keys must be pressed on Mac + if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_ALT ) + showMnemonics( shouldShowMnemonics( e ) && e.isControlDown() && e.isAltDown(), e.getComponent() ); + } else { + // Alt key must be pressed on Windows and Linux + if( SystemInfo.isWindows ) + return processKeyEventOnWindows( e ); + + if( keyCode == KeyEvent.VK_ALT ) + showMnemonics( shouldShowMnemonics( e ), e.getComponent() ); + } + + return false; + } + + private boolean shouldShowMnemonics( KeyEvent e ) { + return e.getID() == KeyEvent.KEY_PRESSED || + MenuSelectionManager.defaultManager().getSelectedPath().length > 0; + } + + private static int altPressedEventCount; + private static boolean selectMenuOnAltReleased; + + /** + * Special Alt key behavior on Windows. + * + * Press-and-release Alt key selects first menu (if available) and moves focus + * temporary to menu bar. If menu bar has focus (some menu is selected), + * pressing Alt key unselects menu and moves focus back to permanent focus owner. + */ + private boolean processKeyEventOnWindows( KeyEvent e ) { + if( e.getKeyCode() != KeyEvent.VK_ALT ) { + selectMenuOnAltReleased = false; + return false; + } + + if( e.getID() == KeyEvent.KEY_PRESSED ) { + altPressedEventCount++; + + if( altPressedEventCount == 1 && !e.isConsumed() ) { + MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager(); + selectMenuOnAltReleased = (menuSelectionManager.getSelectedPath().length == 0); + + // if menu is selected when Alt key is pressed then clear menu selection + if( !selectMenuOnAltReleased ) + menuSelectionManager.clearSelectedPath(); + } + + // show mnemonics + showMnemonics( shouldShowMnemonics( e ), e.getComponent() ); + + // avoid that the system menu of the window gets focus + e.consume(); + return true; + + } else if( e.getID() == KeyEvent.KEY_RELEASED ) { + altPressedEventCount = 0; + + boolean mnemonicsShown = false; + if( selectMenuOnAltReleased && !e.isConsumed() ) { + MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager(); + if( menuSelectionManager.getSelectedPath().length == 0 ) { + // get menu bar and first menu + Component c = e.getComponent(); + JRootPane rootPane = SwingUtilities.getRootPane( c ); + Window window = (rootPane != null) ? SwingUtilities.getWindowAncestor( rootPane ) : null; + JMenuBar menuBar = (rootPane != null) ? rootPane.getJMenuBar() : null; + if( menuBar == null && window instanceof JFrame ) + menuBar = ((JFrame)window).getJMenuBar(); + JMenu firstMenu = (menuBar != null) ? menuBar.getMenu( 0 ) : null; + + // select first menu and show mnemonics + if( firstMenu != null ) { + menuSelectionManager.setSelectedPath( new MenuElement[] { menuBar, firstMenu } ); + showMnemonics( true, c ); + mnemonicsShown = true; + } + } + } + selectMenuOnAltReleased = false; + + // hide mnemonics + if( !mnemonicsShown ) + showMnemonics( shouldShowMnemonics( e ), e.getComponent() ); + } + return false; + } + + @Override + public void stateChanged( ChangeEvent e ) { + MenuElement[] selectedPath = MenuSelectionManager.defaultManager().getSelectedPath(); + if( selectedPath.length == 0 && altPressedEventCount == 0 ) { + // hide mnemonics when menu selection was canceled + showMnemonics( false, null ); + } + } + + static void showMnemonics( boolean show, Component c ) { + if( show == showMnemonics ) + return; + + showMnemonics = show; + + // check whether it is necessary to repaint + if( !UIManager.getBoolean( "Component.hideMnemonics" ) ) + return; + + if( show ) { + // get root pane + JRootPane rootPane = SwingUtilities.getRootPane( c ); + if( rootPane == null ) + return; + + // get window + Window window = SwingUtilities.getWindowAncestor( rootPane ); + if( window == null ) + return; + + // repaint components with mnemonics in focused window + repaintMnemonics( window ); + + // hide mnemonics if window is deactivated (e.g. Alt+Tab to another window) + windowListener = new WindowAdapter() { + @Override + public void windowDeactivated( WindowEvent e ) { + altPressedEventCount = 0; + selectMenuOnAltReleased = false; + + // use invokeLater() to avoid that the listener is removed + // while the listener queue is iterated to fire this event + EventQueue.invokeLater( () -> { + showMnemonics( false, null ); + } ); + } + }; + window.addWindowListener( windowListener ); + + lastShowMnemonicWindow = new WeakReference<>( window ); + } else if( lastShowMnemonicWindow != null ) { + Window window = lastShowMnemonicWindow.get(); + if( window != null ) { + repaintMnemonics( window ); + + if( windowListener != null ) { + window.removeWindowListener( windowListener ); + windowListener = null; + } + } + + lastShowMnemonicWindow = null; + } + } + + private static void repaintMnemonics( Container container ) { + for( Component c : container.getComponents() ) { + if( !c.isVisible() ) + continue; + + if( hasMnemonic( c ) ) + c.repaint(); + + if( c instanceof Container ) + repaintMnemonics( (Container) c ); + } + } + + private static boolean hasMnemonic( Component c ) { + if( c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() >= 0 ) + return true; + + if( c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() >= 0 ) + return true; + + if( c instanceof JTabbedPane ) { + JTabbedPane tabPane = (JTabbedPane) c; + int tabCount = tabPane.getTabCount(); + for( int i = 0; i < tabCount; i++ ) { + if( tabPane.getDisplayedMnemonicIndexAt( i ) >= 0 ) + return true; + } + } + + return false; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java index d19e0966..396b4d97 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java @@ -19,16 +19,19 @@ package com.formdev.flatlaf; import java.awt.Color; import java.awt.Dimension; import java.awt.Insets; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Map.Entry; import java.util.Properties; -import java.util.ServiceLoader; import java.util.function.Function; import java.util.logging.Level; import javax.swing.UIDefaults; @@ -41,7 +44,9 @@ import javax.swing.plaf.InsetsUIResource; import com.formdev.flatlaf.ui.FlatEmptyBorder; import com.formdev.flatlaf.ui.FlatLineBorder; import com.formdev.flatlaf.util.ColorFunctions; +import com.formdev.flatlaf.util.ColorFunctions.ColorFunction; import com.formdev.flatlaf.util.DerivedColor; +import com.formdev.flatlaf.util.GrayFilter; import com.formdev.flatlaf.util.HSLColor; import com.formdev.flatlaf.util.StringUtils; import com.formdev.flatlaf.util.SystemInfo; @@ -63,13 +68,13 @@ class UIDefaultsLoader private static final String TYPE_PREFIX = "{"; private static final String TYPE_PREFIX_END = "}"; private static final String VARIABLE_PREFIX = "@"; - @Deprecated - private static final String REF_PREFIX = VARIABLE_PREFIX + "@"; private static final String PROPERTY_PREFIX = "$"; private static final String OPTIONAL_PREFIX = "?"; private static final String GLOBAL_PREFIX = "*."; - static void loadDefaultsFromProperties( Class lookAndFeelClass, UIDefaults defaults ) { + static void loadDefaultsFromProperties( Class lookAndFeelClass, List addons, + Properties additionalDefaults, boolean dark, UIDefaults defaults ) + { // determine classes in class hierarchy in reverse order ArrayList> lafClasses = new ArrayList<>(); for( Class lafClass = lookAndFeelClass; @@ -79,10 +84,12 @@ class UIDefaultsLoader lafClasses.add( 0, lafClass ); } - loadDefaultsFromProperties( lafClasses, defaults ); + loadDefaultsFromProperties( lafClasses, addons, additionalDefaults, dark, defaults ); } - static void loadDefaultsFromProperties( List> lafClasses, UIDefaults defaults ) { + static void loadDefaultsFromProperties( List> lafClasses, List addons, + Properties additionalDefaults, boolean dark, UIDefaults defaults ) + { try { // load core properties files Properties properties = new Properties(); @@ -94,15 +101,8 @@ class UIDefaultsLoader } } - // get addons and sort them by priority - ServiceLoader addonLoader = ServiceLoader.load( FlatDefaultsAddon.class ); - List addonList = new ArrayList<>(); - for( FlatDefaultsAddon addon : addonLoader ) - addonList.add( addon ); - addonList.sort( (addon1, addon2) -> addon1.getPriority() - addon2.getPriority() ); - // load properties from addons - for( FlatDefaultsAddon addon : addonList ) { + for( FlatDefaultsAddon addon : addons ) { for( Class lafClass : lafClasses ) { try( InputStream in = addon.getDefaults( lafClass ) ) { if( in != null ) @@ -113,26 +113,84 @@ class UIDefaultsLoader // collect addon class loaders List addonClassLoaders = new ArrayList<>(); - for( FlatDefaultsAddon addon : addonList ) { + for( FlatDefaultsAddon addon : addons ) { ClassLoader addonClassLoader = addon.getClass().getClassLoader(); if( !addonClassLoaders.contains( addonClassLoader ) ) addonClassLoaders.add( addonClassLoader ); } + // load custom properties files (usually provides by applications) + List customDefaultsSources = FlatLaf.getCustomDefaultsSources(); + int size = (customDefaultsSources != null) ? customDefaultsSources.size() : 0; + for( int i = 0; i < size; i++ ) { + Object source = customDefaultsSources.get( i ); + if( source instanceof String && i + 1 < size ) { + // load from package in classloader + String packageName = (String) source; + ClassLoader classLoader = (ClassLoader) customDefaultsSources.get( ++i ); + + // use class loader also for instantiating classes specified in values + if( classLoader != null && !addonClassLoaders.contains( classLoader ) ) + addonClassLoaders.add( classLoader ); + + packageName = packageName.replace( '.', '/' ); + if( classLoader == null ) + classLoader = FlatLaf.class.getClassLoader(); + + for( Class lafClass : lafClasses ) { + String propertiesName = packageName + '/' + lafClass.getSimpleName() + ".properties"; + try( InputStream in = classLoader.getResourceAsStream( propertiesName ) ) { + if( in != null ) + properties.load( in ); + } + } + } else if( source instanceof File ) { + // load from folder + File folder = (File) source; + for( Class lafClass : lafClasses ) { + File propertiesFile = new File( folder, lafClass.getSimpleName() + ".properties" ); + if( !propertiesFile.isFile() ) + continue; + + try( InputStream in = new FileInputStream( propertiesFile ) ) { + properties.load( in ); + } + } + } + } + + // add additional defaults + if( additionalDefaults != null ) + properties.putAll( additionalDefaults ); + // collect all platform specific keys (but do not modify properties) ArrayList platformSpecificKeys = new ArrayList<>(); - for( Object key : properties.keySet() ) { - if( ((String)key).startsWith( "[" ) ) - platformSpecificKeys.add( (String) key ); + for( Object okey : properties.keySet() ) { + String key = (String) okey; + if( key.startsWith( "[" ) && + (key.startsWith( "[win]" ) || + key.startsWith( "[mac]" ) || + key.startsWith( "[linux]" ) || + key.startsWith( "[light]" ) || + key.startsWith( "[dark]" )) ) + platformSpecificKeys.add( key ); } // remove platform specific properties and re-add only properties // for current platform, but with platform prefix removed if( !platformSpecificKeys.isEmpty() ) { + // handle light/dark specific properties + String lightOrDarkPrefix = dark ? "[dark]" : "[light]"; + for( String key : platformSpecificKeys ) { + if( key.startsWith( lightOrDarkPrefix ) ) + properties.put( key.substring( lightOrDarkPrefix.length() ), properties.remove( key ) ); + } + + // handle platform specific properties String platformPrefix = - SystemInfo.IS_WINDOWS ? "[win]" : - SystemInfo.IS_MAC ? "[mac]" : - SystemInfo.IS_LINUX ? "[linux]" : "[unknown]"; + SystemInfo.isWindows ? "[win]" : + SystemInfo.isMacOS ? "[mac]" : + SystemInfo.isLinux ? "[linux]" : "[unknown]"; for( String key : platformSpecificKeys ) { Object value = properties.remove( key ); if( key.startsWith( platformPrefix ) ) @@ -140,45 +198,45 @@ class UIDefaultsLoader } } - Function resolver = value -> { - return resolveValue( properties, value ); - }; - - // get globals, which override all other defaults that end with same suffix - HashMap globals = new HashMap<>(); - for( Map.Entry e : properties.entrySet() ) { + // get (and remove) globals, which override all other defaults that end with same suffix + HashMap globals = new HashMap<>(); + Iterator> it = properties.entrySet().iterator(); + while( it.hasNext() ) { + Entry e = it.next(); String key = (String) e.getKey(); - if( !key.startsWith( GLOBAL_PREFIX ) ) - continue; - - String value = resolveValue( properties, (String) e.getValue() ); - try { - globals.put( key.substring( GLOBAL_PREFIX.length() ), parseValue( key, value, resolver, addonClassLoaders ) ); - } catch( RuntimeException ex ) { - logParseError( Level.SEVERE, key, value, ex ); + if( key.startsWith( GLOBAL_PREFIX ) ) { + globals.put( key.substring( GLOBAL_PREFIX.length() ), (String) e.getValue() ); + it.remove(); } } // override UI defaults with globals - for( Object key : defaults.keySet() ) { - if( key instanceof String && ((String)key).contains( "." ) ) { - String skey = (String) key; - String globalKey = skey.substring( skey.lastIndexOf( '.' ) + 1 ); - Object globalValue = globals.get( globalKey ); - if( globalValue != null ) - defaults.put( key, globalValue ); + for( Object okey : defaults.keySet() ) { + if( okey instanceof String && ((String)okey).contains( "." ) ) { + String key = (String) okey; + String globalKey = key.substring( key.lastIndexOf( '.' ) + 1 ); + String globalValue = globals.get( globalKey ); + if( globalValue != null && !properties.containsKey( key ) ) + properties.put( key, globalValue ); } } - // add non-global properties to UI defaults + Function propertiesGetter = key -> { + return properties.getProperty( key ); + }; + Function resolver = value -> { + return resolveValue( value, propertiesGetter ); + }; + + // parse and add properties to UI defaults for( Map.Entry e : properties.entrySet() ) { String key = (String) e.getKey(); - if( key.startsWith( VARIABLE_PREFIX ) || key.startsWith( GLOBAL_PREFIX ) ) + if( key.startsWith( VARIABLE_PREFIX ) ) continue; - String value = resolveValue( properties, (String) e.getValue() ); + String value = resolveValue( (String) e.getValue(), propertiesGetter ); try { - defaults.put( key, parseValue( key, value, resolver, addonClassLoaders ) ); + defaults.put( key, parseValue( key, value, null, resolver, addonClassLoaders ) ); } catch( RuntimeException ex ) { logParseError( Level.SEVERE, key, value, ex ); } @@ -192,25 +250,22 @@ class UIDefaultsLoader FlatLaf.LOG.log( level, "FlatLaf: Failed to parse: '" + key + '=' + value + '\'', ex ); } - private static String resolveValue( Properties properties, String value ) { + static String resolveValue( String value, Function propertiesGetter ) { + value = value.trim(); + String value0 = value; + if( value.startsWith( PROPERTY_PREFIX ) ) value = value.substring( PROPERTY_PREFIX.length() ); else if( !value.startsWith( VARIABLE_PREFIX ) ) return value; - // for compatibility - if( value.startsWith( REF_PREFIX ) ) { - FlatLaf.LOG.log( Level.WARNING, "FlatLaf: Usage of '@@' in .properties files is deprecated. Use '$' instead." ); - value = value.substring( REF_PREFIX.length() ); - } - boolean optional = false; if( value.startsWith( OPTIONAL_PREFIX ) ) { value = value.substring( OPTIONAL_PREFIX.length() ); optional = true; } - String newValue = properties.getProperty( value ); + String newValue = propertiesGetter.apply( value ); if( newValue == null ) { if( optional ) return "null"; @@ -218,29 +273,40 @@ class UIDefaultsLoader throw new IllegalArgumentException( "variable or property '" + value + "' not found" ); } - return resolveValue( properties, newValue ); + if( newValue.equals( value0 ) ) + throw new IllegalArgumentException( "endless recursion in variable or property '" + value + "'" ); + + return resolveValue( newValue, propertiesGetter ); } - private enum ValueType { UNKNOWN, STRING, CHARACTER, INTEGER, FLOAT, BORDER, ICON, INSETS, DIMENSION, COLOR, - SCALEDINTEGER, SCALEDFLOAT, SCALEDINSETS, SCALEDDIMENSION, INSTANCE, CLASS } + enum ValueType { UNKNOWN, STRING, BOOLEAN, CHARACTER, INTEGER, FLOAT, BORDER, ICON, INSETS, DIMENSION, COLOR, + SCALEDINTEGER, SCALEDFLOAT, SCALEDINSETS, SCALEDDIMENSION, INSTANCE, CLASS, GRAYFILTER, NULL, LAZY } + + private static ValueType[] tempResultValueType = new ValueType[1]; static Object parseValue( String key, String value ) { - return parseValue( key, value, v -> v, Collections.emptyList() ); + return parseValue( key, value, null, v -> v, Collections.emptyList() ); } - private static Object parseValue( String key, String value, Function resolver, List addonClassLoaders ) { + static Object parseValue( String key, String value, ValueType[] resultValueType, + Function resolver, List addonClassLoaders ) + { + if( resultValueType == null ) + resultValueType = tempResultValueType; + value = value.trim(); // null, false, true switch( value ) { - case "null": return null; - case "false": return false; - case "true": return true; + case "null": resultValueType[0] = ValueType.NULL; return null; + case "false": resultValueType[0] = ValueType.BOOLEAN; return false; + case "true": resultValueType[0] = ValueType.BOOLEAN; return true; } // check for function "lazy" // Syntax: lazy(uiKey) if( value.startsWith( "lazy(" ) && value.endsWith( ")" ) ) { + resultValueType[0] = ValueType.LAZY; String uiKey = value.substring( 5, value.length() - 1 ).trim(); return (LazyValue) t -> { return lazyUIManagerGet( uiKey ); @@ -289,8 +355,12 @@ class UIDefaultsLoader valueType = ValueType.CHARACTER; else if( key.endsWith( "UI" ) ) valueType = ValueType.STRING; + else if( key.endsWith( "grayFilter" ) ) + valueType = ValueType.GRAYFILTER; } + resultValueType[0] = valueType; + // parse value switch( valueType ) { case STRING: return value; @@ -308,40 +378,49 @@ class UIDefaultsLoader case SCALEDDIMENSION:return parseScaledDimension( value ); case INSTANCE: return parseInstance( value, addonClassLoaders ); case CLASS: return parseClass( value, addonClassLoaders ); + case GRAYFILTER: return parseGrayFilter( value ); case UNKNOWN: default: // colors Object color = parseColorOrFunction( value, resolver, false ); - if( color != null ) + if( color != null ) { + resultValueType[0] = ValueType.COLOR; return color; + } // integer Integer integer = parseInteger( value, false ); - if( integer != null ) + if( integer != null ) { + resultValueType[0] = ValueType.INTEGER; return integer; + } // float Float f = parseFloat( value, false ); - if( f != null ) + if( f != null ) { + resultValueType[0] = ValueType.FLOAT; return f; + } // string + resultValueType[0] = ValueType.STRING; return value; } } private static Object parseBorder( String value, Function resolver, List addonClassLoaders ) { if( value.indexOf( ',' ) >= 0 ) { - // top,left,bottom,right[,lineColor] + // top,left,bottom,right[,lineColor[,lineThickness]] List parts = split( value, ',' ); Insets insets = parseInsets( value ); - ColorUIResource lineColor = (parts.size() == 5) + ColorUIResource lineColor = (parts.size() >= 5) ? (ColorUIResource) parseColorOrFunction( resolver.apply( parts.get( 4 ) ), resolver, true ) : null; + float lineThickness = (parts.size() >= 6) ? parseFloat( parts.get( 5 ), true ) : 1f; return (LazyValue) t -> { return (lineColor != null) - ? new FlatLineBorder( insets, lineColor ) + ? new FlatLineBorder( insets, lineColor, lineThickness ) : new FlatEmptyBorder( insets ); }; } else @@ -496,29 +575,42 @@ class UIDefaultsLoader throw new IllegalArgumentException( "missing parameters in function '" + value + "'" ); switch( function ) { - case "rgb": return parseColorRgbOrRgba( false, params ); - case "rgba": return parseColorRgbOrRgba( true, params ); + case "rgb": return parseColorRgbOrRgba( false, params, resolver, reportError ); + case "rgba": return parseColorRgbOrRgba( true, params, resolver, reportError ); case "hsl": return parseColorHslOrHsla( false, params ); case "hsla": return parseColorHslOrHsla( true, params ); - case "lighten": return parseColorLightenOrDarken( true, params, resolver, reportError ); - case "darken": return parseColorLightenOrDarken( false, params, resolver, reportError ); + case "lighten": return parseColorHSLIncreaseDecrease( 2, true, params, resolver, reportError ); + case "darken": return parseColorHSLIncreaseDecrease( 2, false, params, resolver, reportError ); + case "saturate": return parseColorHSLIncreaseDecrease( 1, true, params, resolver, reportError ); + case "desaturate": return parseColorHSLIncreaseDecrease( 1, false, params, resolver, reportError ); } throw new IllegalArgumentException( "unknown color function '" + value + "'" ); } /** - * Syntax: rgb(red,green,blue) or rgba(red,green,blue,alpha) - * - red: an integer 0-255 - * - green: an integer 0-255 - * - blue: an integer 0-255 - * - alpha: an integer 0-255 + * Syntax: rgb(red,green,blue) or rgba(red,green,blue,alpha) or rgba(color,alpha) + * - red: an integer 0-255 or a percentage 0-100% + * - green: an integer 0-255 or a percentage 0-100% + * - blue: an integer 0-255 or a percentage 0-100% + * - alpha: an integer 0-255 or a percentage 0-100% */ - private static ColorUIResource parseColorRgbOrRgba( boolean hasAlpha, List params ) { - int red = parseInteger( params.get( 0 ), 0, 255 ); - int green = parseInteger( params.get( 1 ), 0, 255 ); - int blue = parseInteger( params.get( 2 ), 0, 255 ); - int alpha = hasAlpha ? parseInteger( params.get( 3 ), 0, 255 ) : 255; + private static ColorUIResource parseColorRgbOrRgba( boolean hasAlpha, List params, + Function resolver, boolean reportError ) + { + if( hasAlpha && params.size() == 2 ) { + // syntax rgba(color,alpha), which allows adding alpha to any color + String colorStr = params.get( 0 ); + int alpha = parseInteger( params.get( 1 ), 0, 255, true ); + + ColorUIResource color = (ColorUIResource) parseColorOrFunction( resolver.apply( colorStr ), resolver, reportError ); + return new ColorUIResource( new Color( ((alpha & 0xff) << 24) | (color.getRGB() & 0xffffff), true ) ); + } + + int red = parseInteger( params.get( 0 ), 0, 255, true ); + int green = parseInteger( params.get( 1 ), 0, 255, true ); + int blue = parseInteger( params.get( 2 ), 0, 255, true ); + int alpha = hasAlpha ? parseInteger( params.get( 3 ), 0, 255, true ) : 255; return hasAlpha ? new ColorUIResource( new Color( red, green, blue, alpha ) ) @@ -533,7 +625,7 @@ class UIDefaultsLoader * - alpha: a percentage 0-100% */ private static ColorUIResource parseColorHslOrHsla( boolean hasAlpha, List params ) { - int hue = parseInteger( params.get( 0 ), 0, 360 ); + int hue = parseInteger( params.get( 0 ), 0, 360, false ); int saturation = parsePercentage( params.get( 1 ) ); int lightness = parsePercentage( params.get( 2 ) ); int alpha = hasAlpha ? parsePercentage( params.get( 3 ) ) : 100; @@ -543,35 +635,37 @@ class UIDefaultsLoader } /** - * Syntax: lighten([color,]amount[,options]) or darken([color,]amount[,options]) + * Syntax: lighten(color,amount[,options]) or darken(color,amount[,options]) or + * saturate(color,amount[,options]) or desaturate(color,amount[,options]) * - color: a color (e.g. #f00) or a color function * - amount: percentage 0-100% - * - options: [relative] [autoInverse] [lazy] + * - options: [relative] [autoInverse] [noAutoInverse] [lazy] [derived] */ - private static Object parseColorLightenOrDarken( boolean lighten, List params, - Function resolver, boolean reportError ) + private static Object parseColorHSLIncreaseDecrease( int hslIndex, boolean increase, + List params, Function resolver, boolean reportError ) { - boolean isDerived = params.get( 0 ).endsWith( "%" ); - String colorStr = isDerived ? null : params.get( 0 ); - int nextParam = isDerived ? 0 : 1; - int amount = parsePercentage( params.get( nextParam++ ) ); + String colorStr = params.get( 0 ); + int amount = parsePercentage( params.get( 1 ) ); boolean relative = false; boolean autoInverse = false; boolean lazy = false; + boolean derived = false; - if( params.size() > nextParam ) { - String options = params.get( nextParam++ ); + if( params.size() > 2 ) { + String options = params.get( 2 ); relative = options.contains( "relative" ); autoInverse = options.contains( "autoInverse" ); lazy = options.contains( "lazy" ); + derived = options.contains( "derived" ); + + // use autoInverse by default for derived colors, except if noAutoInverse is set + if( derived && !options.contains( "noAutoInverse" ) ) + autoInverse = true; } - ColorFunctions.ColorFunction function = lighten - ? new ColorFunctions.Lighten( amount, relative, autoInverse ) - : new ColorFunctions.Darken( amount, relative, autoInverse ); - - if( isDerived ) - return new DerivedColor( function ); + // create function + ColorFunction function = new ColorFunctions.HSLIncreaseDecrease( + hslIndex, increase, amount, relative, autoInverse ); if( lazy ) { return (LazyValue) t -> { @@ -582,8 +676,31 @@ class UIDefaultsLoader }; } - ColorUIResource color = (ColorUIResource) parseColorOrFunction( resolver.apply( colorStr ), resolver, reportError ); - return new ColorUIResource( ColorFunctions.applyFunctions( color, function ) ); + // parse base color + String resolvedColorStr = resolver.apply( colorStr ); + ColorUIResource baseColor = (ColorUIResource) parseColorOrFunction( resolvedColorStr, resolver, reportError ); + if( baseColor == null ) + return null; + + // apply this function to base color + Color newColor = ColorFunctions.applyFunctions( baseColor, function ); + + if( derived ) { + ColorFunction[] functions; + if( baseColor instanceof DerivedColor && resolvedColorStr == colorStr ) { + // if the base color is also derived, join the color functions + // but only if base color function is specified directly in this function + ColorFunction[] baseFunctions = ((DerivedColor)baseColor).getFunctions(); + functions = new ColorFunction[baseFunctions.length + 1]; + System.arraycopy( baseFunctions, 0, functions, 0, baseFunctions.length ); + functions[baseFunctions.length] = function; + } else + functions = new ColorFunction[] { function }; + + return new DerivedColor( newColor, functions ); + } + + return new ColorUIResource( newColor ); } private static int parsePercentage( String value ) { @@ -608,7 +725,12 @@ class UIDefaultsLoader return value.charAt( 0 ); } - private static Integer parseInteger( String value, int min, int max ) { + private static Integer parseInteger( String value, int min, int max, boolean allowPercentage ) { + if( allowPercentage && value.endsWith( "%" ) ) { + int percent = parsePercentage( value ); + return (max * percent) / 100; + } + Integer integer = parseInteger( value, true ); if( integer.intValue() < min || integer.intValue() > max ) throw new NumberFormatException( "integer '" + value + "' out of range (" + min + '-' + max + ')' ); @@ -663,6 +785,21 @@ class UIDefaultsLoader }; } + private static Object parseGrayFilter( String value ) { + List numbers = split( value, ',' ); + try { + int brightness = Integer.parseInt( numbers.get( 0 ) ); + int contrast = Integer.parseInt( numbers.get( 1 ) ); + int alpha = Integer.parseInt( numbers.get( 2 ) ); + + return (LazyValue) t -> { + return new GrayFilter( brightness, contrast, alpha ); + }; + } catch( NumberFormatException ex ) { + throw new IllegalArgumentException( "invalid gray filter '" + value + "'" ); + } + } + /** * Split string and trim parts. */ diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java index e54787ed..4b4a74e6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxIcon.java @@ -36,25 +36,28 @@ import com.formdev.flatlaf.ui.FlatUIUtils; * is painted outside of the icon bounds. Make sure that the checkbox * has margins, which are equal or greater than focusWidth. * + * @uiDefault CheckBox.icon.style String optional; "outline"/null (default) or "filled" * @uiDefault Component.focusWidth int * @uiDefault Component.focusColor Color - * @uiDefault CheckBox.icon.focusedColor Color optional; defaults to Component.focusColor + * @uiDefault CheckBox.icon.focusWidth int optional; defaults to Component.focusWidth + * @uiDefault CheckBox.icon.focusColor Color optional; defaults to Component.focusColor * @uiDefault CheckBox.icon.borderColor Color - * @uiDefault CheckBox.icon.disabledBorderColor Color - * @uiDefault CheckBox.icon.selectedBorderColor Color - * @uiDefault CheckBox.icon.focusedBorderColor Color - * @uiDefault CheckBox.icon.hoverBorderColor Color optional - * @uiDefault CheckBox.icon.selectedFocusedBorderColor Color optional * @uiDefault CheckBox.icon.background Color - * @uiDefault CheckBox.icon.disabledBackground Color - * @uiDefault CheckBox.icon.focusedBackground Color optional - * @uiDefault CheckBox.icon.hoverBackground Color optional - * @uiDefault CheckBox.icon.pressedBackground Color optional + * @uiDefault CheckBox.icon.selectedBorderColor Color * @uiDefault CheckBox.icon.selectedBackground Color - * @uiDefault CheckBox.icon.selectedHoverBackground Color optional - * @uiDefault CheckBox.icon.selectedPressedBackground Color optional * @uiDefault CheckBox.icon.checkmarkColor Color + * @uiDefault CheckBox.icon.disabledBorderColor Color + * @uiDefault CheckBox.icon.disabledBackground Color * @uiDefault CheckBox.icon.disabledCheckmarkColor Color + * @uiDefault CheckBox.icon.focusedBorderColor Color + * @uiDefault CheckBox.icon.focusedBackground Color optional + * @uiDefault CheckBox.icon.selectedFocusedBorderColor Color optional + * @uiDefault CheckBox.icon.selectedFocusedBackground Color optional + * @uiDefault CheckBox.icon.hoverBorderColor Color optional + * @uiDefault CheckBox.icon.hoverBackground Color optional + * @uiDefault CheckBox.icon.selectedHoverBackground Color optional + * @uiDefault CheckBox.icon.pressedBackground Color optional + * @uiDefault CheckBox.icon.selectedPressedBackground Color optional * @uiDefault CheckBox.arc int * * @author Karl Tauber @@ -62,27 +65,62 @@ import com.formdev.flatlaf.ui.FlatUIUtils; public class FlatCheckBoxIcon extends FlatAbstractIcon { - public final int focusWidth = UIManager.getInt( "Component.focusWidth" ); - protected final Color focusColor = FlatUIUtils.getUIColor( "CheckBox.icon.focusedColor", + protected final String style = UIManager.getString( "CheckBox.icon.style" ); + public final int focusWidth = getUIInt( "CheckBox.icon.focusWidth", + UIManager.getInt( "Component.focusWidth" ), style ); + protected final Color focusColor = FlatUIUtils.getUIColor( "CheckBox.icon.focusColor", UIManager.getColor( "Component.focusColor" ) ); protected final int arc = FlatUIUtils.getUIInt( "CheckBox.arc", 2 ); - protected final Color borderColor = UIManager.getColor( "CheckBox.icon.borderColor" ); - protected final Color disabledBorderColor = UIManager.getColor( "CheckBox.icon.disabledBorderColor" ); - protected final Color selectedBorderColor = UIManager.getColor( "CheckBox.icon.selectedBorderColor" ); - protected final Color focusedBorderColor = UIManager.getColor( "CheckBox.icon.focusedBorderColor" ); - protected final Color hoverBorderColor = UIManager.getColor( "CheckBox.icon.hoverBorderColor" ); - protected final Color selectedFocusedBorderColor = UIManager.getColor( "CheckBox.icon.selectedFocusedBorderColor" ); - protected final Color background = UIManager.getColor( "CheckBox.icon.background" ); - protected final Color disabledBackground = UIManager.getColor( "CheckBox.icon.disabledBackground" ); - protected final Color focusedBackground = UIManager.getColor( "CheckBox.icon.focusedBackground" ); - protected final Color hoverBackground = UIManager.getColor( "CheckBox.icon.hoverBackground" ); - protected final Color pressedBackground = UIManager.getColor( "CheckBox.icon.pressedBackground" ); - protected final Color selectedBackground = UIManager.getColor( "CheckBox.icon.selectedBackground" ); - protected final Color selectedHoverBackground = UIManager.getColor( "CheckBox.icon.selectedHoverBackground" ); - protected final Color selectedPressedBackground = UIManager.getColor( "CheckBox.icon.selectedPressedBackground" ); - protected final Color checkmarkColor = UIManager.getColor( "CheckBox.icon.checkmarkColor" ); - protected final Color disabledCheckmarkColor = UIManager.getColor( "CheckBox.icon.disabledCheckmarkColor" ); + // enabled + protected final Color borderColor = getUIColor( "CheckBox.icon.borderColor", style ); + protected final Color background = getUIColor( "CheckBox.icon.background", style ); + protected final Color selectedBorderColor = getUIColor( "CheckBox.icon.selectedBorderColor", style ); + protected final Color selectedBackground = getUIColor( "CheckBox.icon.selectedBackground", style ); + protected final Color checkmarkColor = getUIColor( "CheckBox.icon.checkmarkColor", style ); + + // disabled + protected final Color disabledBorderColor = getUIColor( "CheckBox.icon.disabledBorderColor", style ); + protected final Color disabledBackground = getUIColor( "CheckBox.icon.disabledBackground", style ); + protected final Color disabledCheckmarkColor = getUIColor( "CheckBox.icon.disabledCheckmarkColor", style ); + + // focused + protected final Color focusedBorderColor = getUIColor( "CheckBox.icon.focusedBorderColor", style ); + protected final Color focusedBackground = getUIColor( "CheckBox.icon.focusedBackground", style ); + protected final Color selectedFocusedBorderColor = getUIColor( "CheckBox.icon.selectedFocusedBorderColor", style ); + protected final Color selectedFocusedBackground = getUIColor( "CheckBox.icon.selectedFocusedBackground", style ); + protected final Color selectedFocusedCheckmarkColor = getUIColor( "CheckBox.icon.selectedFocusedCheckmarkColor", style ); + + // hover + protected final Color hoverBorderColor = getUIColor( "CheckBox.icon.hoverBorderColor", style ); + protected final Color hoverBackground = getUIColor( "CheckBox.icon.hoverBackground", style ); + protected final Color selectedHoverBackground = getUIColor( "CheckBox.icon.selectedHoverBackground", style ); + + // pressed + protected final Color pressedBackground = getUIColor( "CheckBox.icon.pressedBackground", style ); + protected final Color selectedPressedBackground = getUIColor( "CheckBox.icon.selectedPressedBackground", style ); + + protected static Color getUIColor( String key, String style ) { + if( style != null ) { + Color color = UIManager.getColor( styleKey( key, style ) ); + if( color != null ) + return color; + } + return UIManager.getColor( key ); + } + + protected static int getUIInt( String key, int defaultValue, String style ) { + if( style != null ) { + Object value = UIManager.get( styleKey( key, style ) ); + if( value instanceof Integer ) + return (Integer) value; + } + return FlatUIUtils.getUIInt( key, defaultValue ); + } + + private static String styleKey( String key, String style ) { + return key.replace( ".icon.", ".icon[" + style + "]." ); + } static final int ICON_SIZE = 15; @@ -94,9 +132,10 @@ public class FlatCheckBoxIcon protected void paintIcon( Component c, Graphics2D g2 ) { boolean indeterminate = c instanceof JComponent && clientPropertyEquals( (JComponent) c, SELECTED_STATE, SELECTED_STATE_INDETERMINATE ); boolean selected = indeterminate || (c instanceof AbstractButton && ((AbstractButton)c).isSelected()); + boolean isFocused = FlatUIUtils.isPermanentFocusOwner( c ); // paint focused border - if( c.hasFocus() && focusWidth > 0 ) { + if( isFocused && focusWidth > 0 && FlatButtonUI.isFocusPainted( c ) ) { g2.setColor( focusColor ); paintFocusBorder( g2 ); } @@ -111,18 +150,22 @@ public class FlatCheckBoxIcon paintBorder( g2 ); // paint background - FlatUIUtils.setColor( g2, FlatButtonUI.buttonStateColor( c, + g2.setColor( FlatUIUtils.deriveColor( FlatButtonUI.buttonStateColor( c, selected ? selectedBackground : background, disabledBackground, - focusedBackground, - selected && selectedHoverBackground != null ? selectedHoverBackground : hoverBackground, - selected && selectedPressedBackground != null ? selectedPressedBackground : pressedBackground ), - background ); + (selected && selectedFocusedBackground != null) ? selectedFocusedBackground : focusedBackground, + (selected && selectedHoverBackground != null) ? selectedHoverBackground : hoverBackground, + (selected && selectedPressedBackground != null) ? selectedPressedBackground : pressedBackground ), + background ) ); paintBackground( g2 ); // paint checkmark if( selected || indeterminate ) { - g2.setColor( c.isEnabled() ? checkmarkColor : disabledCheckmarkColor ); + g2.setColor( c.isEnabled() + ? ((selected && isFocused && selectedFocusedCheckmarkColor != null) + ? selectedFocusedCheckmarkColor + : checkmarkColor) + : disabledCheckmarkColor ); if( indeterminate ) paintIndeterminate( g2 ); else diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxMenuItemIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxMenuItemIcon.java index f49ac08e..501602b6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxMenuItemIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatCheckBoxMenuItemIcon.java @@ -30,7 +30,8 @@ import javax.swing.UIManager; * * @uiDefault MenuItemCheckBox.icon.checkmarkColor Color * @uiDefault MenuItemCheckBox.icon.disabledCheckmarkColor Color - * @uiDefault Menu.selectionForeground Color + * @uiDefault MenuItem.selectionForeground Color + * @uiDefault MenuItem.selectionType String * * @author Karl Tauber */ @@ -39,7 +40,7 @@ public class FlatCheckBoxMenuItemIcon { protected final Color checkmarkColor = UIManager.getColor( "MenuItemCheckBox.icon.checkmarkColor" ); protected final Color disabledCheckmarkColor = UIManager.getColor( "MenuItemCheckBox.icon.disabledCheckmarkColor" ); - protected final Color selectionForeground = UIManager.getColor( "Menu.selectionForeground" ); + protected final Color selectionForeground = UIManager.getColor( "MenuItem.selectionForeground" ); public FlatCheckBoxMenuItemIcon() { super( 15, 15, null ); @@ -66,10 +67,15 @@ public class FlatCheckBoxMenuItemIcon g2.draw( path ); } - private Color getCheckmarkColor( Component c ) { - if( c instanceof JMenuItem && ((JMenuItem)c).isArmed() ) + protected Color getCheckmarkColor( Component c ) { + if( c instanceof JMenuItem && ((JMenuItem)c).isArmed() && !isUnderlineSelection() ) return selectionForeground; return c.isEnabled() ? checkmarkColor : disabledCheckmarkColor; } + + protected boolean isUnderlineSelection() { + // not storing value of "MenuItem.selectionType" in class to allow changing at runtime + return "underline".equals( UIManager.getString( "MenuItem.selectionType" ) ); + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatHelpButtonIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatHelpButtonIcon.java index 25ecc920..e996f785 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatHelpButtonIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatHelpButtonIcon.java @@ -82,10 +82,10 @@ public class FlatHelpButtonIcon */ boolean enabled = c.isEnabled(); - boolean focused = c.hasFocus(); + boolean focused = FlatUIUtils.isPermanentFocusOwner( c ); // paint focused border - if( focused ) { + if( focused && FlatButtonUI.isFocusPainted( c ) ) { g2.setColor( focusColor ); g2.fill( new Ellipse2D.Float( 0.5f, 0.5f, iconSize - 1, iconSize - 1 ) ); } @@ -100,12 +100,12 @@ public class FlatHelpButtonIcon g2.fill( new Ellipse2D.Float( focusWidth + 0.5f, focusWidth + 0.5f, 21, 21 ) ); // paint background - FlatUIUtils.setColor( g2, FlatButtonUI.buttonStateColor( c, + g2.setColor( FlatUIUtils.deriveColor( FlatButtonUI.buttonStateColor( c, background, disabledBackground, focusedBackground, hoverBackground, - pressedBackground ), background ); + pressedBackground ), background ) ); g2.fill( new Ellipse2D.Float( focusWidth + 1.5f, focusWidth + 1.5f, 19, 19 ) ); // paint question mark diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameAbstractIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameAbstractIcon.java index cc455c6a..1c993ab1 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameAbstractIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameAbstractIcon.java @@ -27,6 +27,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils; /** * Base class for internal frame icons. * + * @uiDefault InternalFrame.buttonSize Dimension * @uiDefault InternalFrame.buttonHoverBackground Color * @uiDefault InternalFrame.buttonPressedBackground Color * @@ -53,7 +54,7 @@ public abstract class FlatInternalFrameAbstractIcon protected void paintBackground( Component c, Graphics2D g ) { Color background = FlatButtonUI.buttonStateColor( c, null, null, null, hoverBackground, pressedBackground ); if( background != null ) { - FlatUIUtils.setColor( g, background, c.getBackground() ); + g.setColor( FlatUIUtils.deriveColor( background, c.getBackground() ) ); g.fillRect( 0, 0, width, height ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameCloseIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameCloseIcon.java index 2461480d..db6526fd 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameCloseIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameCloseIcon.java @@ -28,8 +28,11 @@ import com.formdev.flatlaf.ui.FlatButtonUI; /** * "close" icon for {@link javax.swing.JInternalFrame}. * - * @uiDefault InternalFrame.buttonHoverBackground Color - * @uiDefault InternalFrame.buttonPressedBackground Color + * @uiDefault InternalFrame.buttonSize Dimension + * @uiDefault InternalFrame.closeHoverBackground Color + * @uiDefault InternalFrame.closePressedBackground Color + * @uiDefault InternalFrame.closeHoverForeground Color + * @uiDefault InternalFrame.closePressedForeground Color * * @author Karl Tauber */ diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameMinimizeIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameRestoreIcon.java similarity index 89% rename from flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameMinimizeIcon.java rename to flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameRestoreIcon.java index 7256d1a2..dcf79e71 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameMinimizeIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatInternalFrameRestoreIcon.java @@ -24,14 +24,14 @@ import java.awt.geom.Rectangle2D; import com.formdev.flatlaf.ui.FlatUIUtils; /** - * "minimize" (actually "restore") icon for {@link javax.swing.JInternalFrame}. + * "restore" (or "minimize") icon for {@link javax.swing.JInternalFrame}. * * @author Karl Tauber */ -public class FlatInternalFrameMinimizeIcon +public class FlatInternalFrameRestoreIcon extends FlatInternalFrameAbstractIcon { - public FlatInternalFrameMinimizeIcon() { + public FlatInternalFrameRestoreIcon() { } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatMenuArrowIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatMenuArrowIcon.java index 0e6b41f8..2c401f61 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatMenuArrowIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatMenuArrowIcon.java @@ -32,6 +32,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils; * @uiDefault Menu.icon.arrowColor Color * @uiDefault Menu.icon.disabledArrowColor Color * @uiDefault Menu.selectionForeground Color + * @uiDefault MenuItem.selectionType String * * @author Karl Tauber */ @@ -64,10 +65,15 @@ public class FlatMenuArrowIcon } } - private Color getArrowColor( Component c ) { - if( c instanceof JMenu && ((JMenu)c).isSelected() ) + protected Color getArrowColor( Component c ) { + if( c instanceof JMenu && ((JMenu)c).isSelected() && !isUnderlineSelection() ) return selectionForeground; return c.isEnabled() ? arrowColor : disabledArrowColor; } + + protected boolean isUnderlineSelection() { + // not storing value of "MenuItem.selectionType" in class to allow changing at runtime + return "underline".equals( UIManager.getString( "MenuItem.selectionType" ) ); + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java index 5d05a2cf..16c74bf8 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java @@ -18,7 +18,6 @@ package com.formdev.flatlaf.icons; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; -import com.formdev.flatlaf.ui.FlatUIUtils; /** * Icon for {@link javax.swing.JRadioButton}. @@ -34,7 +33,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils; public class FlatRadioButtonIcon extends FlatCheckBoxIcon { - protected final int centerDiameter = FlatUIUtils.getUIInt( "RadioButton.icon.centerDiameter", 8 ); + protected final int centerDiameter = getUIInt( "RadioButton.icon.centerDiameter", 8, style ); @Override protected void paintFocusBorder( Graphics2D g2 ) { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java new file mode 100644 index 00000000..fa5f5114 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatTabbedPaneCloseIcon.java @@ -0,0 +1,90 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatButtonUI; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "close" icon for closable tabs in {@link javax.swing.JTabbedPane}. + * + * @uiDefault TabbedPane.closeSize Dimension + * @uiDefault TabbedPane.closeArc int + * @uiDefault TabbedPane.closeCrossPlainSize float + * @uiDefault TabbedPane.closeCrossFilledSize float + * @uiDefault TabbedPane.closeCrossLineWidth float + * @uiDefault TabbedPane.closeBackground Color + * @uiDefault TabbedPane.closeForeground Color + * @uiDefault TabbedPane.closeHoverBackground Color + * @uiDefault TabbedPane.closeHoverForeground Color + * @uiDefault TabbedPane.closePressedBackground Color + * @uiDefault TabbedPane.closePressedForeground Color + * + * @author Karl Tauber + */ +public class FlatTabbedPaneCloseIcon + extends FlatAbstractIcon +{ + protected final Dimension size = UIManager.getDimension( "TabbedPane.closeSize" ); + protected final int arc = UIManager.getInt( "TabbedPane.closeArc" ); + protected final float crossPlainSize = FlatUIUtils.getUIFloat( "TabbedPane.closeCrossPlainSize", 7.5f ); + protected final float crossFilledSize = FlatUIUtils.getUIFloat( "TabbedPane.closeCrossFilledSize", crossPlainSize ); + protected final float closeCrossLineWidth = FlatUIUtils.getUIFloat( "TabbedPane.closeCrossLineWidth", 1f ); + protected final Color background = UIManager.getColor( "TabbedPane.closeBackground" ); + protected final Color foreground = UIManager.getColor( "TabbedPane.closeForeground" ); + protected final Color hoverBackground = UIManager.getColor( "TabbedPane.closeHoverBackground" ); + protected final Color hoverForeground = UIManager.getColor( "TabbedPane.closeHoverForeground" ); + protected final Color pressedBackground = UIManager.getColor( "TabbedPane.closePressedBackground" ); + protected final Color pressedForeground = UIManager.getColor( "TabbedPane.closePressedForeground" ); + + public FlatTabbedPaneCloseIcon() { + super( 16, 16, null ); + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + // paint background + Color bg = FlatButtonUI.buttonStateColor( c, background, null, null, hoverBackground, pressedBackground ); + if( bg != null ) { + g.setColor( bg ); + g.fillRoundRect( (width - size.width) / 2, (height - size.height) / 2, + size.width, size.height, arc, arc ); + } + + // set cross color + g.setColor( FlatButtonUI.buttonStateColor( c, foreground, null, null, hoverForeground, pressedForeground ) ); + + float mx = width / 2; + float my = height / 2; + float r = ((bg != null) ? crossFilledSize : crossPlainSize) / 2; + + // paint cross + Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); + path.append( new Line2D.Float( mx - r, my - r, mx + r, my + r ), false ); + path.append( new Line2D.Float( mx - r, my + r, mx + r, my - r ), false ); + g.setStroke( new BasicStroke( closeCrossLineWidth ) ); + g.draw( path ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowAbstractIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowAbstractIcon.java new file mode 100644 index 00000000..15a8d6ab --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowAbstractIcon.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatButtonUI; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.HiDPIUtils; + +/** + * Base class for window icons. + * + * @uiDefault TitlePane.buttonSize Dimension + * @uiDefault TitlePane.buttonHoverBackground Color + * @uiDefault TitlePane.buttonPressedBackground Color + * + * @author Karl Tauber + */ +public abstract class FlatWindowAbstractIcon + extends FlatAbstractIcon +{ + private final Color hoverBackground; + private final Color pressedBackground; + + public FlatWindowAbstractIcon() { + this( UIManager.getDimension( "TitlePane.buttonSize" ), + UIManager.getColor( "TitlePane.buttonHoverBackground" ), + UIManager.getColor( "TitlePane.buttonPressedBackground" ) ); + } + + public FlatWindowAbstractIcon( Dimension size, Color hoverBackground, Color pressedBackground ) { + super( size.width, size.height, null ); + this.hoverBackground = hoverBackground; + this.pressedBackground = pressedBackground; + } + + @Override + protected void paintIcon( Component c, Graphics2D g ) { + paintBackground( c, g ); + + g.setColor( getForeground( c ) ); + HiDPIUtils.paintAtScale1x( g, 0, 0, width, height, this::paintIconAt1x ); + } + + protected abstract void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ); + + protected void paintBackground( Component c, Graphics2D g ) { + Color background = FlatButtonUI.buttonStateColor( c, null, null, null, hoverBackground, pressedBackground ); + if( background != null ) { + g.setColor( FlatUIUtils.deriveColor( background, c.getBackground() ) ); + g.fillRect( 0, 0, width, height ); + } + } + + protected Color getForeground( Component c ) { + return c.getForeground(); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java new file mode 100644 index 00000000..f4bdc5ca --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java @@ -0,0 +1,70 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import javax.swing.UIManager; +import com.formdev.flatlaf.ui.FlatButtonUI; + +/** + * "close" icon for windows (frames and dialogs). + * + * @uiDefault TitlePane.closeHoverBackground Color + * @uiDefault TitlePane.closePressedBackground Color + * @uiDefault TitlePane.closeHoverForeground Color + * @uiDefault TitlePane.closePressedForeground Color + * + * @author Karl Tauber + */ +public class FlatWindowCloseIcon + extends FlatWindowAbstractIcon +{ + private final Color hoverForeground = UIManager.getColor( "TitlePane.closeHoverForeground" ); + private final Color pressedForeground = UIManager.getColor( "TitlePane.closePressedForeground" ); + + public FlatWindowCloseIcon() { + super( UIManager.getDimension( "TitlePane.buttonSize" ), + UIManager.getColor( "TitlePane.closeHoverBackground" ), + UIManager.getColor( "TitlePane.closePressedBackground" ) ); + } + + @Override + protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + int iwh = (int) (10 * scaleFactor); + int ix = x + ((width - iwh) / 2); + int iy = y + ((height - iwh) / 2); + int ix2 = ix + iwh - 1; + int iy2 = iy + iwh - 1; + int thickness = (int) scaleFactor; + + 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, iy2, ix2, iy ), false ); + g.setStroke( new BasicStroke( thickness ) ); + g.draw( path ); + } + + @Override + protected Color getForeground( Component c ) { + return FlatButtonUI.buttonStateColor( c, c.getForeground(), null, null, hoverForeground, pressedForeground ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java new file mode 100644 index 00000000..54cab7d7 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java @@ -0,0 +1,41 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Graphics2D; + +/** + * "iconify" icon for windows (frames and dialogs). + * + * @author Karl Tauber + */ +public class FlatWindowIconifyIcon + extends FlatWindowAbstractIcon +{ + public FlatWindowIconifyIcon() { + } + + @Override + protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + int iw = (int) (10 * scaleFactor); + int ih = (int) scaleFactor; + int ix = x + ((width - iw) / 2); + int iy = y + ((height - ih) / 2); + + g.fillRect( ix, iy, iw, ih ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java new file mode 100644 index 00000000..5035d43d --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Graphics2D; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "maximize" icon for windows (frames and dialogs). + * + * @author Karl Tauber + */ +public class FlatWindowMaximizeIcon + extends FlatWindowAbstractIcon +{ + public FlatWindowMaximizeIcon() { + } + + @Override + protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + int iwh = (int) (10 * scaleFactor); + int ix = x + ((width - iwh) / 2); + int iy = y + ((height - iwh) / 2); + int thickness = (int) scaleFactor; + + g.fill( FlatUIUtils.createRectangle( ix, iy, iwh, iwh, thickness ) ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java new file mode 100644 index 00000000..b62087ef --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java @@ -0,0 +1,55 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.icons; + +import java.awt.Graphics2D; +import java.awt.geom.Area; +import java.awt.geom.Path2D; +import java.awt.geom.Rectangle2D; +import com.formdev.flatlaf.ui.FlatUIUtils; + +/** + * "restore" icon for windows (frames and dialogs). + * + * @author Karl Tauber + */ +public class FlatWindowRestoreIcon + extends FlatWindowAbstractIcon +{ + public FlatWindowRestoreIcon() { + } + + @Override + protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + int iwh = (int) (10 * scaleFactor); + int ix = x + ((width - iwh) / 2); + int iy = y + ((height - iwh) / 2); + int thickness = (int) scaleFactor; + + int rwh = (int) (8 * scaleFactor); + int ro2 = iwh - rwh; + + Path2D r1 = FlatUIUtils.createRectangle( ix + ro2, iy, rwh, rwh, thickness ); + Path2D r2 = FlatUIUtils.createRectangle( ix, iy + ro2, rwh, rwh, thickness ); + + Area area = new Area( r1 ); + area.subtract( new Area( new Rectangle2D.Float( ix, iy + ro2, rwh, rwh ) ) ); + g.fill( area ); + + g.fill( r2 ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java index 00443224..172f07d1 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatArrowButton.java @@ -19,6 +19,7 @@ package com.formdev.flatlaf.ui; import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.BasicStroke; import java.awt.Color; +import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; @@ -26,6 +27,7 @@ import java.awt.Shape; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Path2D; +import javax.swing.JComponent; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicArrowButton; @@ -45,15 +47,23 @@ public class FlatArrowButton private final Color disabledForeground; private final Color hoverForeground; private final Color hoverBackground; + private final Color pressedBackground; private int arrowWidth = DEFAULT_ARROW_WIDTH; private int xOffset = 0; private int yOffset = 0; private boolean hover; + private boolean pressed; public FlatArrowButton( int direction, String type, Color foreground, Color disabledForeground, Color hoverForeground, Color hoverBackground ) + { + this( direction, type, foreground, disabledForeground, hoverForeground, hoverBackground, null ); + } + + public FlatArrowButton( int direction, String type, Color foreground, Color disabledForeground, + Color hoverForeground, Color hoverBackground, Color pressedBackground ) { super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE ); @@ -62,11 +72,12 @@ public class FlatArrowButton this.disabledForeground = disabledForeground; this.hoverForeground = hoverForeground; this.hoverBackground = hoverBackground; + this.pressedBackground = pressedBackground; setOpaque( false ); setBorder( null ); - if( hoverForeground != null || hoverBackground != null ) { + if( hoverForeground != null || hoverBackground != null || pressedBackground != null ) { addMouseListener( new MouseAdapter() { @Override public void mouseEntered( MouseEvent e ) { @@ -79,6 +90,18 @@ public class FlatArrowButton hover = false; repaint(); } + + @Override + public void mousePressed( MouseEvent e ) { + pressed = true; + repaint(); + } + + @Override + public void mouseReleased( MouseEvent e ) { + pressed = false; + repaint(); + } } ); } } @@ -95,6 +118,10 @@ public class FlatArrowButton return hover; } + protected boolean isPressed() { + return pressed; + } + public int getXOffset() { return xOffset; } @@ -111,6 +138,10 @@ public class FlatArrowButton this.yOffset = yOffset; } + protected Color deriveBackground( Color background ) { + return background; + } + @Override public Dimension getPreferredSize() { return scale( super.getPreferredSize() ); @@ -130,33 +161,54 @@ public class FlatArrowButton int height = getHeight(); boolean enabled = isEnabled(); - // paint hover background - if( enabled && isHover() && hoverBackground != null ) { - g.setColor( hoverBackground ); - g.fillRect( 0, 0, width, height ); + // paint hover or pressed background + if( enabled ) { + Color background = (pressedBackground != null && isPressed()) + ? deriveBackground( pressedBackground ) + : ((hoverBackground != null && isHover()) + ? deriveBackground( hoverBackground ) + : null); + + if( background != null ) { + g.setColor( background ); + g.fillRect( 0, 0, width, height ); + } } int direction = getDirection(); boolean vert = (direction == NORTH || direction == SOUTH); + // compute width/height int w = scale( arrowWidth + (chevron ? 0 : 1) ); int h = scale( (arrowWidth / 2) + (chevron ? 0 : 1) ); + + // rotate width/height int rw = vert ? w : h; int rh = vert ? h : w; + + // chevron lines end 1px outside of width/height + if( chevron ) { + // add 1px to width/height for position calculation only + rw++; + rh++; + } + int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) ); int y = Math.round( (height - rh) / 2f + scale( (float) yOffset ) ); - // optimization for small chevron arrows (e.g. OneTouchButtons in SplitPane) - if( x + rw >= width && x > 0 ) - x--; - if( y + rh >= height && y > 0 ) - y--; + // move arrow for round borders + Container parent = getParent(); + if( vert && parent instanceof JComponent && FlatUIUtils.hasRoundBorder( (JComponent) parent ) ) + x -= scale( parent.getComponentOrientation().isLeftToRight() ? 1 : -1 ); // paint arrow g.setColor( enabled ? (isHover() && hoverForeground != null ? hoverForeground : foreground) : disabledForeground ); g.translate( x, y ); +/*debug + debugPaint( g2, vert, rw, rh ); +debug*/ Shape arrowShape = createArrowShape( direction, chevron, w, h ); if( chevron ) { g2.setStroke( new BasicStroke( scale( 1f ) ) ); @@ -177,4 +229,22 @@ public class FlatArrowButton default: return new Path2D.Float(); } } + +/*debug + private void debugPaint( Graphics g, boolean vert, int w, int h ) { + Color oldColor = g.getColor(); + g.setColor( Color.red ); + g.drawRect( 0, 0, w - 1, h - 1 ); + + int xy1 = -2; + int xy2 = h + 1; + for( int i = 0; i < 20; i++ ) { + g.drawRect( vert ? 0 : xy1, vert ? xy1 : 0, 0, 0 ); + g.drawRect( vert ? 0 : xy2, vert ? xy2 : 0, 0, 0 ); + xy1 -= 2; + xy2 += 2; + } + g.setColor( oldColor ); + } +debug*/ } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java index 0cf2b7ea..c435aed4 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java @@ -36,23 +36,31 @@ import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.basic.BasicBorders; import javax.swing.text.JTextComponent; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.DerivedColor; /** * Border for various components (e.g. {@link javax.swing.JTextField}). * * There is empty space around the component border, if Component.focusWidth is greater than zero, - * which is used to paint focus border. + * which is used to paint outer focus border. * - * Because there is empty space (if focus border is not painted), + * Because there is empty space (if outer focus border is not painted), * UI delegates that use this border (or subclasses) must invoke * {@link FlatUIUtils#paintParentBackground} to paint the empty space correctly. * - * @uiDefault Component.focusWidth int - * @uiDefault Component.innerFocusWidth int or float - * @uiDefault Component.focusColor Color - * @uiDefault Component.borderColor Color - * @uiDefault Component.disabledBorderColor Color - * @uiDefault Component.focusedBorderColor Color + * @uiDefault Component.focusWidth int + * @uiDefault Component.innerFocusWidth int or float + * @uiDefault Component.focusColor Color + * @uiDefault Component.borderColor Color + * @uiDefault Component.disabledBorderColor Color + * @uiDefault Component.focusedBorderColor Color + * + * @uiDefault Component.error.borderColor Color + * @uiDefault Component.error.focusedBorderColor Color + * @uiDefault Component.warning.borderColor Color + * @uiDefault Component.warning.focusedBorderColor Color + * @uiDefault Component.custom.borderColor Color * * @author Karl Tauber */ @@ -61,37 +69,77 @@ public class FlatBorder { protected final int focusWidth = UIManager.getInt( "Component.focusWidth" ); protected final float innerFocusWidth = FlatUIUtils.getUIFloat( "Component.innerFocusWidth", 0 ); + protected final float innerOutlineWidth = FlatUIUtils.getUIFloat( "Component.innerOutlineWidth", 0 ); protected final Color focusColor = UIManager.getColor( "Component.focusColor" ); protected final Color borderColor = UIManager.getColor( "Component.borderColor" ); protected final Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" ); protected final Color focusedBorderColor = UIManager.getColor( "Component.focusedBorderColor" ); + protected final Color errorBorderColor = UIManager.getColor( "Component.error.borderColor" ); + protected final Color errorFocusedBorderColor = UIManager.getColor( "Component.error.focusedBorderColor" ); + protected final Color warningBorderColor = UIManager.getColor( "Component.warning.borderColor" ); + protected final Color warningFocusedBorderColor = UIManager.getColor( "Component.warning.focusedBorderColor" ); + protected final Color customBorderColor = UIManager.getColor( "Component.custom.borderColor" ); + @Override public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { Graphics2D g2 = (Graphics2D) g.create(); try { FlatUIUtils.setRenderingHints( g2 ); - boolean isCellEditor = isTableCellEditor( c ); - float focusWidth = isCellEditor ? 0 : getFocusWidth( c ); - float borderWidth = getBorderWidth( c ); - float arc = isCellEditor ? 0 : getArc( c ); + float focusWidth = scale( (float) getFocusWidth( c ) ); + float borderWidth = scale( (float) getBorderWidth( c ) ); + float arc = scale( (float) getArc( c ) ); + Color outlineColor = getOutlineColor( c ); - if( isFocused( c ) ) { - float innerFocusWidth = !(c instanceof JScrollPane) ? this.innerFocusWidth : 0; + // paint outer border + if( outlineColor != null || isFocused( c ) ) { + float innerWidth = !isCellEditor( c ) && !(c instanceof JScrollPane) + ? (outlineColor != null ? innerOutlineWidth : innerFocusWidth) + : 0; - g2.setColor( getFocusColor( c ) ); - FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height, focusWidth, - getLineWidth( c ) + scale( innerFocusWidth ), arc ); + g2.setColor( (outlineColor != null) ? outlineColor : getFocusColor( c ) ); + FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height, + focusWidth, borderWidth + scale( innerWidth ), arc ); } - g2.setPaint( getBorderColor( c ) ); + // paint border + g2.setPaint( (outlineColor != null) ? outlineColor : getBorderColor( c ) ); FlatUIUtils.paintComponentBorder( g2, x, y, width, height, focusWidth, borderWidth, arc ); } finally { g2.dispose(); } } + /** + * Returns the outline color of the component border specified in client property + * {@link FlatClientProperties#OUTLINE}. + */ + protected Color getOutlineColor( Component c ) { + if( !(c instanceof JComponent) ) + return null; + + Object outline = ((JComponent)c).getClientProperty( FlatClientProperties.OUTLINE ); + if( outline instanceof String ) { + switch( (String) outline ) { + case FlatClientProperties.OUTLINE_ERROR: + return isFocused( c ) ? errorFocusedBorderColor : errorBorderColor; + + case FlatClientProperties.OUTLINE_WARNING: + return isFocused( c ) ? warningFocusedBorderColor : warningBorderColor; + } + } else if( outline instanceof Color ) { + Color color = (Color) outline; + // use color functions to compute color for unfocused state + if( !isFocused( c ) && customBorderColor instanceof DerivedColor ) + color = ((DerivedColor)customBorderColor).derive( color ); + return color; + } else if( outline instanceof Color[] && ((Color[])outline).length >= 2 ) + return ((Color[])outline)[isFocused( c ) ? 0 : 1]; + + return null; + } + protected Color getFocusColor( Component c ) { return focusColor; } @@ -119,7 +167,7 @@ public class FlatBorder JViewport viewport = ((JScrollPane)c).getViewport(); Component view = (viewport != null) ? viewport.getView() : null; if( view != null ) { - if( view.hasFocus() ) + if( FlatUIUtils.isPermanentFocusOwner( view ) ) return true; if( (view instanceof JTable && ((JTable)view).isEditing()) || @@ -133,49 +181,81 @@ public class FlatBorder return false; } else if( c instanceof JComboBox && ((JComboBox)c).isEditable() ) { Component editorComponent = ((JComboBox)c).getEditor().getEditorComponent(); - return (editorComponent != null) ? editorComponent.hasFocus() : false; + return (editorComponent != null) ? FlatUIUtils.isPermanentFocusOwner( editorComponent ) : false; } else if( c instanceof JSpinner ) { + if( FlatUIUtils.isPermanentFocusOwner( c ) ) + return true; + JComponent editor = ((JSpinner)c).getEditor(); if( editor instanceof JSpinner.DefaultEditor ) { JTextField textField = ((JSpinner.DefaultEditor)editor).getTextField(); if( textField != null ) - return textField.hasFocus(); + return FlatUIUtils.isPermanentFocusOwner( textField ); } return false; } else - return c.hasFocus(); + return FlatUIUtils.isPermanentFocusOwner( c ); } - protected boolean isTableCellEditor( Component c ) { - return FlatUIUtils.isTableCellEditor( c ); + protected boolean isCellEditor( Component c ) { + return FlatUIUtils.isCellEditor( c ); } @Override public Insets getBorderInsets( Component c, Insets insets ) { - boolean isCellEditor = isTableCellEditor( c ); - float ow = (isCellEditor ? 0 : getFocusWidth( c )) + getLineWidth( c ); + float focusWidth = scale( (float) getFocusWidth( c ) ); + float ow = focusWidth + scale( (float) getLineWidth( c ) ); insets = super.getBorderInsets( c, insets ); insets.top = Math.round( scale( (float) insets.top ) + ow ); insets.left = Math.round( scale( (float) insets.left ) + ow ); insets.bottom = Math.round( scale( (float) insets.bottom ) + ow ); insets.right = Math.round( scale( (float) insets.right ) + ow ); + + if( isCellEditor( c ) ) { + // remove top and bottom insets if used as cell editor + insets.top = insets.bottom = 0; + + // remove right/left insets to avoid that text is truncated (e.g. in file chooser) + if( c.getComponentOrientation().isLeftToRight() ) + insets.right = 0; + else + insets.left = 0; + } + return insets; } - protected float getFocusWidth( Component c ) { - return scale( (float) focusWidth ); + /** + * Returns the (unscaled) thickness of the outer focus border. + */ + protected int getFocusWidth( Component c ) { + if( isCellEditor( c ) ) + return 0; + + return focusWidth; } - protected float getLineWidth( Component c ) { - return scale( 1f ); + /** + * Returns the (unscaled) line thickness used to compute the border insets. + * This may be different to {@link #getBorderWidth}. + */ + protected int getLineWidth( Component c ) { + return 1; } - protected float getBorderWidth( Component c ) { + /** + * Returns the (unscaled) line thickness used to paint the border. + * This may be different to {@link #getLineWidth}. + */ + protected int getBorderWidth( Component c ) { return getLineWidth( c ); } - protected float getArc( Component c ) { + /** + * Returns the (unscaled) arc diameter of the border. + */ + protected int getArc( Component c ) { return 0; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java index df8dac7e..d379c177 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java @@ -16,7 +16,6 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Color; import java.awt.Component; import java.awt.GradientPaint; @@ -43,6 +42,7 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Button.default.hoverBorderColor Color optional * @uiDefault Button.default.focusedBorderColor Color * @uiDefault Button.default.focusColor Color + * @uiDefault Button.borderWidth int * @uiDefault Button.default.borderWidth int * @uiDefault Button.toolbar.margin Insets * @uiDefault Button.toolbar.spacingInsets Insets @@ -63,6 +63,7 @@ public class FlatButtonBorder protected final Color defaultHoverBorderColor = UIManager.getColor( "Button.default.hoverBorderColor" ); protected final Color defaultFocusedBorderColor = UIManager.getColor( "Button.default.focusedBorderColor" ); protected final Color defaultFocusColor = UIManager.getColor( "Button.default.focusColor" ); + protected final int borderWidth = UIManager.getInt( "Button.borderWidth" ); protected final int defaultBorderWidth = UIManager.getInt( "Button.default.borderWidth" ); protected final Insets toolbarMargin = UIManager.getInsets( "Button.toolbar.margin" ); protected final Insets toolbarSpacingInsets = UIManager.getInsets( "Button.toolbar.spacingInsets" ); @@ -82,6 +83,11 @@ public class FlatButtonBorder return FlatButtonUI.isDefaultButton( c ) ? defaultFocusColor : super.getFocusColor( c ); } + @Override + protected boolean isFocused( Component c ) { + return FlatButtonUI.isFocusPainted( c ) && super.isFocused( c ); + } + @Override protected Paint getBorderColor( Component c ) { boolean def = FlatButtonUI.isDefaultButton( c ); @@ -115,8 +121,8 @@ public class FlatButtonBorder } else { insets = super.getBorderInsets( c, insets ); - // use smaller left and right insets for icon-only buttons (so that they are square) - if( FlatButtonUI.isIconOnlyButton( c ) && ((AbstractButton)c).getMargin() instanceof UIResource ) + // use smaller left and right insets for icon-only or single-character buttons (so that they are square) + if( FlatButtonUI.isIconOnlyOrSingleCharacterButton( c ) && ((AbstractButton)c).getMargin() instanceof UIResource ) insets.left = insets.right = Math.min( insets.top, insets.bottom ); } @@ -124,17 +130,24 @@ public class FlatButtonBorder } @Override - protected float getFocusWidth( Component c ) { - return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth(c ); + protected int getFocusWidth( Component c ) { + return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth( c ); } @Override - protected float getBorderWidth( Component c ) { - return FlatButtonUI.isDefaultButton( c ) ? scale( (float) defaultBorderWidth ) : super.getBorderWidth( c ); + protected int getBorderWidth( Component c ) { + return FlatButtonUI.isDefaultButton( c ) ? defaultBorderWidth : borderWidth; } @Override - protected float getArc( Component c ) { - return FlatButtonUI.isSquareButton( c ) ? 0 : scale( (float) arc ); + protected int getArc( Component c ) { + if( isCellEditor( c ) ) + return 0; + + switch( FlatButtonUI.getButtonType( c ) ) { + case FlatButtonUI.TYPE_SQUARE: return 0; + case FlatButtonUI.TYPE_ROUND_RECT: return Short.MAX_VALUE; + default: return arc; + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java index 6055b3bd..54b0fd3f 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java @@ -39,7 +39,6 @@ import javax.swing.JToggleButton; import javax.swing.JToolBar; import javax.swing.LookAndFeel; import javax.swing.UIManager; -import javax.swing.border.Border; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicButtonListener; @@ -61,8 +60,6 @@ import com.formdev.flatlaf.util.UIScale; * * * - * @uiDefault Component.focusWidth int - * @uiDefault Button.arc int * @uiDefault Button.minimumWidth int * @uiDefault Button.iconTextGap int * @uiDefault Button.startBackground Color optional; if set, a gradient paint is used and Button.background is ignored @@ -70,7 +67,11 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Button.focusedBackground Color optional * @uiDefault Button.hoverBackground Color optional * @uiDefault Button.pressedBackground Color optional + * @uiDefault Button.selectedBackground Color + * @uiDefault Button.selectedForeground Color + * @uiDefault Button.disabledBackground Color optional * @uiDefault Button.disabledText Color + * @uiDefault Button.disabledSelectedBackground Color * @uiDefault Button.default.background Color * @uiDefault Button.default.startBackground Color optional; if set, a gradient paint is used and Button.default.background is ignored * @uiDefault Button.default.endBackground Color optional; if set, a gradient paint is used @@ -86,23 +87,29 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Button.toolbar.spacingInsets Insets * @uiDefault Button.toolbar.hoverBackground Color * @uiDefault Button.toolbar.pressedBackground Color + * @uiDefault Button.toolbar.selectedBackground Color * * @author Karl Tauber */ public class FlatButtonUI extends BasicButtonUI { - protected int focusWidth; - protected int arc; protected int minimumWidth; protected int iconTextGap; + protected Color background; + protected Color foreground; + protected Color startBackground; protected Color endBackground; protected Color focusedBackground; protected Color hoverBackground; protected Color pressedBackground; + protected Color selectedBackground; + protected Color selectedForeground; + protected Color disabledBackground; protected Color disabledText; + protected Color disabledSelectedBackground; protected Color defaultBackground; protected Color defaultEndBackground; @@ -119,17 +126,14 @@ public class FlatButtonUI protected Insets toolbarSpacingInsets; protected Color toolbarHoverBackground; protected Color toolbarPressedBackground; + protected Color toolbarSelectedBackground; private Icon helpButtonIcon; private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatButtonUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatButtonUI.class, FlatButtonUI::new ); } @Override @@ -139,17 +143,22 @@ public class FlatButtonUI if( !defaults_initialized ) { String prefix = getPropertyPrefix(); - focusWidth = UIManager.getInt( "Component.focusWidth" ); - arc = UIManager.getInt( "Button.arc" ); minimumWidth = UIManager.getInt( prefix + "minimumWidth" ); iconTextGap = FlatUIUtils.getUIInt( prefix + "iconTextGap", 4 ); + background = UIManager.getColor( prefix + "background" ); + foreground = UIManager.getColor( prefix + "foreground" ); + startBackground = UIManager.getColor( prefix + "startBackground" ); endBackground = UIManager.getColor( prefix + "endBackground" ); focusedBackground = UIManager.getColor( prefix + "focusedBackground" ); hoverBackground = UIManager.getColor( prefix + "hoverBackground" ); pressedBackground = UIManager.getColor( prefix + "pressedBackground" ); + selectedBackground = UIManager.getColor( prefix + "selectedBackground" ); + selectedForeground = UIManager.getColor( prefix + "selectedForeground" ); + disabledBackground = UIManager.getColor( prefix + "disabledBackground" ); disabledText = UIManager.getColor( prefix + "disabledText" ); + disabledSelectedBackground = UIManager.getColor( prefix + "disabledSelectedBackground" ); if( UIManager.getBoolean( "Button.paintShadow" ) ) { shadowWidth = FlatUIUtils.getUIInt( "Button.shadowWidth", 2 ); @@ -172,6 +181,7 @@ public class FlatButtonUI toolbarSpacingInsets = UIManager.getInsets( "Button.toolbar.spacingInsets" ); toolbarHoverBackground = UIManager.getColor( prefix + "toolbar.hoverBackground" ); toolbarPressedBackground = UIManager.getColor( prefix + "toolbar.pressedBackground" ); + toolbarSelectedBackground = UIManager.getColor( prefix + "toolbar.selectedBackground" ); helpButtonIcon = UIManager.getIcon( "HelpButton.icon" ); @@ -187,7 +197,7 @@ public class FlatButtonUI LookAndFeel.installProperty( b, "opaque", false ); LookAndFeel.installProperty( b, "iconTextGap", scale( iconTextGap ) ); - MigLayoutVisualPadding.install( b, getFocusWidth( b ) ); + MigLayoutVisualPadding.install( b ); } @Override @@ -200,21 +210,21 @@ public class FlatButtonUI @Override protected BasicButtonListener createButtonListener( AbstractButton b ) { - return new BasicButtonListener( b ) { - @Override - public void propertyChange( PropertyChangeEvent e ) { - super.propertyChange( e ); - FlatButtonUI.this.propertyChange( b, e ); - } - }; + return new FlatButtonListener( b ); } protected void propertyChange( AbstractButton b, PropertyChangeEvent e ) { switch( e.getPropertyName() ) { + case SQUARE_SIZE: case MINIMUM_WIDTH: case MINIMUM_HEIGHT: b.revalidate(); break; + + case BUTTON_TYPE: + b.revalidate(); + b.repaint(); + break; } } @@ -222,11 +232,19 @@ public class FlatButtonUI return !(c instanceof AbstractButton) || ((AbstractButton)c).isContentAreaFilled(); } + public static boolean isFocusPainted( Component c ) { + return !(c instanceof AbstractButton) || ((AbstractButton)c).isFocusPainted(); + } + static boolean isDefaultButton( Component c ) { return c instanceof JButton && ((JButton)c).isDefaultButton(); } - static boolean isIconOnlyButton( Component c ) { + /** + * Returns true if the button has an icon but no text, + * or it it does not have an icon and the text is either "..." or one character. + */ + static boolean isIconOnlyOrSingleCharacterButton( Component c ) { if( !(c instanceof JButton) && !(c instanceof JToggleButton) ) return false; @@ -236,8 +254,15 @@ public class FlatButtonUI (icon == null && text != null && ("...".equals( text ) || text.length() == 1)); } - static boolean isSquareButton( Component c ) { - return c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_SQUARE ); + // same indices as in parameters to clientPropertyChoice() + static final int TYPE_OTHER = -1; + static final int TYPE_SQUARE = 0; + static final int TYPE_ROUND_RECT = 1; + + static int getButtonType( Component c ) { + return (c instanceof AbstractButton) + ? clientPropertyChoice( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_SQUARE, BUTTON_TYPE_ROUND_RECT ) + : TYPE_OTHER; } static boolean isHelpButton( Component c ) { @@ -245,7 +270,8 @@ public class FlatButtonUI } static boolean isToolBarButton( Component c ) { - return c.getParent() instanceof JToolBar; + return c.getParent() instanceof JToolBar || + (c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_TOOLBAR_BUTTON )); } @Override @@ -267,54 +293,61 @@ public class FlatButtonUI protected void paintBackground( Graphics g, JComponent c ) { Color background = getBackground( c ); - if( background != null ) { - Graphics2D g2 = (Graphics2D) g.create(); - try { - FlatUIUtils.setRenderingHints( g2 ); + if( background == null ) + return; - Border border = c.getBorder(); - boolean isToolBarButton = isToolBarButton( c ); - float focusWidth = (border instanceof FlatBorder && !isToolBarButton) ? scale( (float) getFocusWidth( c ) ) : 0; - float arc = ((border instanceof FlatButtonBorder && !isSquareButton( c )) || isToolBarButton) - ? scale( (float) this.arc ) : 0; - boolean def = isDefaultButton( c ); + Graphics2D g2 = (Graphics2D) g.create(); + try { + FlatUIUtils.setRenderingHints( g2 ); - int x = 0; - int y = 0; - int width = c.getWidth(); - int height = c.getHeight(); + boolean isToolBarButton = isToolBarButton( c ); + float focusWidth = isToolBarButton ? 0 : FlatUIUtils.getBorderFocusWidth( c ); + float arc = FlatUIUtils.getBorderArc( c ); - if( isToolBarButton ) { - Insets spacing = UIScale.scale( toolbarSpacingInsets ); - x += spacing.left; - y += spacing.top; - width -= spacing.left + spacing.right; - height -= spacing.top + spacing.bottom; - } + boolean def = isDefaultButton( c ); - // paint shadow - Color shadowColor = def ? defaultShadowColor : this.shadowColor; - if( !isToolBarButton && shadowColor != null && shadowWidth > 0 && focusWidth > 0 && !c.hasFocus() && c.isEnabled() ) { - g2.setColor( shadowColor ); - g2.fill( new RoundRectangle2D.Float( focusWidth, focusWidth + UIScale.scale( (float) shadowWidth ), - width - focusWidth * 2, height - focusWidth * 2, arc, arc ) ); - } + int x = 0; + int y = 0; + int width = c.getWidth(); + int height = c.getHeight(); - // paint background - Color startBg = def ? defaultBackground : startBackground; - Color endBg = def ? defaultEndBackground : endBackground; - if( background == startBg && endBg != null && !startBg.equals( endBg ) ) - g2.setPaint( new GradientPaint( 0, 0, startBg, 0, height, endBg ) ); - else - FlatUIUtils.setColor( g2, background, def ? defaultBackground : c.getBackground() ); - - FlatUIUtils.paintComponentBackground( g2, x, y, width, height, focusWidth, arc ); - } finally { - g2.dispose(); + if( isToolBarButton ) { + Insets spacing = UIScale.scale( toolbarSpacingInsets ); + x += spacing.left; + y += spacing.top; + width -= spacing.left + spacing.right; + height -= spacing.top + spacing.bottom; } + + // paint shadow + Color shadowColor = def ? defaultShadowColor : this.shadowColor; + if( !isToolBarButton && shadowColor != null && shadowWidth > 0 && focusWidth > 0 && + !(isFocusPainted( c ) && FlatUIUtils.isPermanentFocusOwner( c )) && c.isEnabled() ) + { + g2.setColor( shadowColor ); + g2.fill( new RoundRectangle2D.Float( focusWidth, focusWidth + UIScale.scale( (float) shadowWidth ), + width - focusWidth * 2, height - focusWidth * 2, arc, arc ) ); + } + + // paint background + Color startBg = def ? defaultBackground : startBackground; + Color endBg = def ? defaultEndBackground : endBackground; + if( background == startBg && endBg != null && !startBg.equals( endBg ) ) + g2.setPaint( new GradientPaint( 0, 0, startBg, 0, height, endBg ) ); + else + g2.setColor( FlatUIUtils.deriveColor( background, getBackgroundBase( c, def ) ) ); + + FlatUIUtils.paintComponentBackground( g2, x, y, width, height, focusWidth, arc ); + } finally { + g2.dispose(); } } + @Override + public void paint( Graphics g, JComponent c ) { + super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c ); + } + @Override protected void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text ) { if( isHelpButton( b ) ) @@ -331,7 +364,7 @@ public class FlatButtonUI } } - paintText( g, b, textRect, text, b.isEnabled() ? getForeground( b ) : disabledText ); + paintText( g, b, textRect, text, getForeground( b ) ); } public static void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text, Color foreground ) { @@ -344,8 +377,19 @@ public class FlatButtonUI } protected Color getBackground( JComponent c ) { + if( ((AbstractButton)c).isSelected() ) { + // in toolbar use same colors for disabled and enabled because + // we assume that toolbar icon is shown disabled + boolean toolBarButton = isToolBarButton( c ); + return buttonStateColor( c, + toolBarButton ? toolbarSelectedBackground : selectedBackground, + toolBarButton ? toolbarSelectedBackground : disabledSelectedBackground, + null, null, + toolBarButton ? toolbarPressedBackground : pressedBackground ); + } + if( !c.isEnabled() ) - return null; + return disabledBackground; // toolbar button if( isToolBarButton( c ) ) { @@ -361,13 +405,26 @@ public class FlatButtonUI boolean def = isDefaultButton( c ); return buttonStateColor( c, - def ? defaultBackground : c.getBackground(), + getBackgroundBase( c, def ), null, - def ? defaultFocusedBackground : focusedBackground, + isCustomBackground( c.getBackground() ) ? null : (def ? defaultFocusedBackground : focusedBackground), def ? defaultHoverBackground : hoverBackground, def ? defaultPressedBackground : pressedBackground ); } + protected Color getBackgroundBase( JComponent c, boolean def ) { + // use component background if explicitly set + Color bg = c.getBackground(); + if( isCustomBackground( bg ) ) + return bg; + + return def ? defaultBackground : bg; + } + + protected boolean isCustomBackground( Color bg ) { + return bg != background && (startBackground == null || bg != startBackground); + } + public static Color buttonStateColor( Component c, Color enabledColor, Color disabledColor, Color focusedColor, Color hoverColor, Color pressedColor ) { @@ -382,15 +439,30 @@ public class FlatButtonUI if( hoverColor != null && b != null && b.getModel().isRollover() ) return hoverColor; - if( focusedColor != null && c.hasFocus() ) + if( focusedColor != null && isFocusPainted( c ) && FlatUIUtils.isPermanentFocusOwner( c ) ) return focusedColor; return enabledColor; } protected Color getForeground( JComponent c ) { + if( !c.isEnabled() ) + return disabledText; + + if( ((AbstractButton)c).isSelected() && !isToolBarButton( c ) ) + return selectedForeground; + + // use component foreground if explicitly set + Color fg = c.getForeground(); + if( isCustomForeground( fg ) ) + return fg; + boolean def = isDefaultButton( c ); - return def ? defaultForeground : c.getForeground(); + return def ? defaultForeground : fg; + } + + protected boolean isCustomForeground( Color fg ) { + return fg != foreground; } @Override @@ -399,23 +471,43 @@ public class FlatButtonUI return new Dimension( helpButtonIcon.getIconWidth(), helpButtonIcon.getIconHeight() ); Dimension prefSize = super.getPreferredSize( c ); - if ( prefSize == null ) + if( prefSize == null ) return null; - // make button square if it is a icon-only button - // or apply minimum width, if not in toolbar and not a icon-only button - if( isIconOnlyButton( c ) ) + // make square or apply minimum width/height + boolean isIconOnlyOrSingleCharacter = isIconOnlyOrSingleCharacterButton( c ); + if( clientPropertyBoolean( c, SQUARE_SIZE, false ) ) { + // make button square (increase width or height so that they are equal) + prefSize.width = prefSize.height = Math.max( prefSize.width, prefSize.height ); + } else if( isIconOnlyOrSingleCharacter && ((AbstractButton)c).getIcon() == null ) { + // make single-character-no-icon button square (increase width) prefSize.width = Math.max( prefSize.width, prefSize.height ); - else if( !isToolBarButton( c ) && c.getBorder() instanceof FlatButtonBorder ) { - int focusWidth = getFocusWidth( c ); - prefSize.width = Math.max( prefSize.width, scale( FlatUIUtils.minimumWidth( c, minimumWidth ) + (focusWidth * 2) ) ); - prefSize.height = Math.max( prefSize.height, scale( FlatUIUtils.minimumHeight( c, 0 ) + (focusWidth * 2) ) ); + } else if( !isIconOnlyOrSingleCharacter && !isToolBarButton( c ) && c.getBorder() instanceof FlatButtonBorder ) { + // apply minimum width/height + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + prefSize.width = Math.max( prefSize.width, scale( FlatUIUtils.minimumWidth( c, minimumWidth ) ) + Math.round( focusWidth * 2 ) ); + prefSize.height = Math.max( prefSize.height, scale( FlatUIUtils.minimumHeight( c, 0 ) ) + Math.round( focusWidth * 2 ) ); } return prefSize; } - protected int getFocusWidth( JComponent c ) { - return focusWidth; + //---- class FlatButtonListener ------------------------------------------- + + protected class FlatButtonListener + extends BasicButtonListener + { + private final AbstractButton b; + + protected FlatButtonListener( AbstractButton b ) { + super( b ); + this.b = b; + } + + @Override + public void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + FlatButtonUI.this.propertyChange( b, e ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java index 5704135c..39ae87ee 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java @@ -31,7 +31,7 @@ import javax.swing.text.JTextComponent; * * @author Karl Tauber */ -class FlatCaret +public class FlatCaret extends DefaultCaret implements UIResource { @@ -41,7 +41,7 @@ class FlatCaret private boolean wasTemporaryLost; private boolean isMousePressed; - FlatCaret( String selectAllOnFocusPolicy ) { + public FlatCaret( String selectAllOnFocusPolicy ) { this.selectAllOnFocusPolicy = selectAllOnFocusPolicy; } @@ -87,7 +87,7 @@ class FlatCaret super.mouseReleased( e ); } - private void selectAllOnFocusGained() { + protected void selectAllOnFocusGained() { JTextComponent c = getComponent(); Document doc = c.getDocument(); if( doc == null || !c.isEnabled() || !c.isEditable() ) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java index f1cb3767..5bcb2f88 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxMenuItemUI.java @@ -16,12 +16,11 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; +import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Rectangle; -import java.beans.PropertyChangeListener; +import javax.swing.Icon; import javax.swing.JComponent; -import javax.swing.JMenuItem; +import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; @@ -30,29 +29,34 @@ import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; * * * - * @uiDefault CheckBoxMenuItem.font Font - * @uiDefault CheckBoxMenuItem.background Color - * @uiDefault CheckBoxMenuItem.foreground Color - * @uiDefault CheckBoxMenuItem.disabledForeground Color - * @uiDefault CheckBoxMenuItem.selectionBackground Color - * @uiDefault CheckBoxMenuItem.selectionForeground Color - * @uiDefault CheckBoxMenuItem.acceleratorForeground Color - * @uiDefault CheckBoxMenuItem.acceleratorSelectionForeground Color - * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font - * @uiDefault MenuItem.acceleratorDelimiter String - * @uiDefault CheckBoxMenuItem.border Border - * @uiDefault CheckBoxMenuItem.borderPainted boolean - * @uiDefault CheckBoxMenuItem.margin Insets - * @uiDefault CheckBoxMenuItem.arrowIcon Icon - * @uiDefault CheckBoxMenuItem.checkIcon Icon - * @uiDefault CheckBoxMenuItem.opaque boolean - * @uiDefault CheckBoxMenuItem.evenHeight boolean + * @uiDefault CheckBoxMenuItem.font Font + * @uiDefault CheckBoxMenuItem.background Color + * @uiDefault CheckBoxMenuItem.foreground Color + * @uiDefault CheckBoxMenuItem.disabledForeground Color + * @uiDefault CheckBoxMenuItem.selectionBackground Color + * @uiDefault CheckBoxMenuItem.selectionForeground Color + * @uiDefault CheckBoxMenuItem.acceleratorForeground Color + * @uiDefault CheckBoxMenuItem.acceleratorSelectionForeground Color + * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font + * @uiDefault MenuItem.acceleratorDelimiter String + * @uiDefault CheckBoxMenuItem.border Border + * @uiDefault CheckBoxMenuItem.borderPainted boolean + * @uiDefault CheckBoxMenuItem.margin Insets + * @uiDefault CheckBoxMenuItem.arrowIcon Icon + * @uiDefault CheckBoxMenuItem.checkIcon Icon + * @uiDefault CheckBoxMenuItem.opaque boolean + * + * + * + * @uiDefault MenuItem.iconTextGap int * * @author Karl Tauber */ public class FlatCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI { + private FlatMenuItemRenderer renderer; + public static ComponentUI createUI( JComponent c ) { return new FlatCheckBoxMenuItemUI(); } @@ -61,25 +65,30 @@ public class FlatCheckBoxMenuItemUI protected void installDefaults() { super.installDefaults(); - // scale - defaultTextIconGap = scale( defaultTextIconGap ); - } + LookAndFeel.installProperty( menuItem, "iconTextGap", FlatUIUtils.getUIInt( "MenuItem.iconTextGap", 4 ) ); - /** - * Scale defaultTextIconGap again if iconTextGap property has changed. - */ - @Override - protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { - PropertyChangeListener superListener = super.createPropertyChangeListener( c ); - return e -> { - superListener.propertyChange( e ); - if( e.getPropertyName() == "iconTextGap" ) - defaultTextIconGap = scale( defaultTextIconGap ); - }; + renderer = createRenderer(); } @Override - protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) { - FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground ); + protected void uninstallDefaults() { + super.uninstallDefaults(); + + renderer = null; + } + + protected FlatMenuItemRenderer createRenderer() { + return new FlatMenuItemRenderer( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); + } + + @Override + protected Dimension getPreferredMenuItemSize( JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap ) { + return renderer.getPreferredMenuItemSize(); + } + + @Override + public void paint( Graphics g, JComponent c ) { + renderer.paintMenuItem( g, selectionBackground, selectionForeground, disabledForeground, + acceleratorForeground, acceleratorSelectionForeground ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxUI.java index 3d37473e..e545fa66 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCheckBoxUI.java @@ -42,12 +42,8 @@ import javax.swing.plaf.ComponentUI; public class FlatCheckBoxUI extends FlatRadioButtonUI { - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatCheckBoxUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatCheckBoxUI.class, FlatCheckBoxUI::new ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java index 166efa36..194ef287 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatComboBoxUI.java @@ -24,10 +24,12 @@ import java.awt.Container; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; import java.awt.Insets; import java.awt.LayoutManager; import java.awt.Rectangle; import java.awt.Shape; +import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -39,6 +41,7 @@ import java.beans.PropertyChangeListener; import java.lang.ref.WeakReference; import javax.swing.AbstractAction; import javax.swing.BorderFactory; +import javax.swing.ComboBoxEditor; import javax.swing.DefaultListCellRenderer; import javax.swing.InputMap; import javax.swing.JButton; @@ -46,6 +49,8 @@ import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JTextField; import javax.swing.KeyStroke; import javax.swing.ListCellRenderer; import javax.swing.LookAndFeel; @@ -76,8 +81,10 @@ import com.formdev.flatlaf.util.UIScale; * * * - * @uiDefault Component.focusWidth int - * @uiDefault Component.arc int + * @uiDefault ComboBox.minimumWidth int + * @uiDefault ComboBox.editorColumns int + * @uiDefault ComboBox.maximumRowCount int + * @uiDefault ComboBox.buttonStyle String auto (default), button or none * @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.isIntelliJTheme boolean * @uiDefault Component.borderColor Color @@ -96,8 +103,9 @@ import com.formdev.flatlaf.util.UIScale; public class FlatComboBoxUI extends BasicComboBoxUI { - protected int focusWidth; - protected int arc; + protected int minimumWidth; + protected int editorColumns; + protected String buttonStyle; protected String arrowType; protected boolean isIntelliJTheme; protected Color borderColor; @@ -114,7 +122,7 @@ public class FlatComboBoxUI protected Color buttonHoverArrowColor; private MouseListener hoverListener; - private boolean hover; + protected boolean hover; private WeakReference lastRendererComponent; @@ -150,8 +158,9 @@ public class FlatComboBoxUI LookAndFeel.installProperty( comboBox, "opaque", false ); - focusWidth = UIManager.getInt( "Component.focusWidth" ); - arc = UIManager.getInt( "Component.arc" ); + minimumWidth = UIManager.getInt( "ComboBox.minimumWidth" ); + editorColumns = UIManager.getInt( "ComboBox.editorColumns" ); + buttonStyle = UIManager.getString( "ComboBox.buttonStyle" ); arrowType = UIManager.getString( "Component.arrowType" ); isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" ); borderColor = UIManager.getColor( "Component.borderColor" ); @@ -167,10 +176,15 @@ public class FlatComboBoxUI buttonDisabledArrowColor = UIManager.getColor( "ComboBox.buttonDisabledArrowColor" ); buttonHoverArrowColor = UIManager.getColor( "ComboBox.buttonHoverArrowColor" ); + // set maximumRowCount + int maximumRowCount = UIManager.getInt( "ComboBox.maximumRowCount" ); + if( maximumRowCount > 0 && maximumRowCount != 8 && comboBox.getMaximumRowCount() == 8 ) + comboBox.setMaximumRowCount( maximumRowCount ); + // scale padding = UIScale.scale( padding ); - MigLayoutVisualPadding.install( comboBox, focusWidth ); + MigLayoutVisualPadding.install( comboBox ); } @Override @@ -249,6 +263,10 @@ public class FlatComboBoxUI editor.applyComponentOrientation( o ); } else if( editor != null && FlatClientProperties.PLACEHOLDER_TEXT.equals( propertyName ) ) editor.repaint(); + else if( FlatClientProperties.COMPONENT_ROUND_RECT.equals( propertyName ) ) + comboBox.repaint(); + else if( FlatClientProperties.MINIMUM_WIDTH.equals( propertyName ) ) + comboBox.revalidate(); } }; } @@ -258,17 +276,33 @@ public class FlatComboBoxUI return new FlatComboPopup( comboBox ); } + @Override + protected ComboBoxEditor createEditor() { + ComboBoxEditor comboBoxEditor = super.createEditor(); + + Component editor = comboBoxEditor.getEditorComponent(); + if( editor instanceof JTextField ) { + JTextField textField = (JTextField) editor; + textField.setColumns( editorColumns ); + + // assign a non-null and non-javax.swing.plaf.UIResource border to the text field, + // otherwise it is replaced with default text field border when switching LaF + // because javax.swing.plaf.basic.BasicComboBoxEditor.BorderlessTextField.setBorder() + // uses "border instanceof javax.swing.plaf.basic.BasicComboBoxEditor.UIResource" + // instead of "border instanceof javax.swing.plaf.UIResource" + textField.setBorder( BorderFactory.createEmptyBorder() ); + } + + return comboBoxEditor; + } + @Override protected void configureEditor() { super.configureEditor(); - // assign a non-javax.swing.plaf.UIResource border to the text field, - // otherwise it is replaced with default text field border when switching LaF - // because javax.swing.plaf.basic.BasicComboBoxEditor.BorderlessTextField.setBorder() - // uses "border instanceof javax.swing.plaf.basic.BasicComboBoxEditor.UIResource" - // instead of "border instanceof javax.swing.plaf.UIResource" - if( editor instanceof JTextComponent ) - ((JTextComponent)editor).setBorder( BorderFactory.createEmptyBorder() ); + // remove default text field border from editor + if( editor instanceof JTextField && ((JTextField)editor).getBorder() instanceof FlatTextBorder ) + ((JTextField)editor).setBorder( BorderFactory.createEmptyBorder() ); // explicitly make non-opaque if( editor instanceof JComponent ) @@ -279,15 +313,16 @@ public class FlatComboBoxUI updateEditorColors(); // macOS - if( SystemInfo.IS_MAC && editor instanceof JTextComponent ) { + if( SystemInfo.isMacOS && editor instanceof JTextComponent ) { // delegate actions from editor text field to combobox, which is necessary - // because text field on macOS (based on Aqua LaF UI defaults) - // already handle those keys + // because text field on macOS already handle those keys InputMap inputMap = ((JTextComponent)editor).getInputMap(); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "UP" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_UP" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "DOWN" ) ); new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "KP_DOWN" ) ); + new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "HOME" ) ); + new EditorDelegateAction( inputMap, KeyStroke.getKeyStroke( "END" ) ); } } @@ -295,30 +330,25 @@ public class FlatComboBoxUI // use non-UIResource colors because when SwingUtilities.updateComponentTreeUI() // is used, then the editor is updated after the combobox and the // colors are again replaced with default colors - boolean enabled = editor.isEnabled(); - editor.setForeground( FlatUIUtils.nonUIResource( (enabled || editor instanceof JTextComponent) - ? comboBox.getForeground() - : disabledForeground ) ); - if( editor instanceof JTextComponent ) - ((JTextComponent)editor).setDisabledTextColor( FlatUIUtils.nonUIResource( disabledForeground ) ); + boolean isTextComponent = editor instanceof JTextComponent; + editor.setForeground( FlatUIUtils.nonUIResource( getForeground( isTextComponent || editor.isEnabled() ) ) ); + + if( isTextComponent ) + ((JTextComponent)editor).setDisabledTextColor( FlatUIUtils.nonUIResource( getForeground( false ) ) ); } @Override protected JButton createArrowButton() { - return new FlatArrowButton( SwingConstants.SOUTH, arrowType, buttonArrowColor, - buttonDisabledArrowColor, buttonHoverArrowColor, null ) - { - @Override - protected boolean isHover() { - return super.isHover() || (!comboBox.isEditable() ? hover : false); - } - }; + return new FlatComboBoxButton(); } @Override public void update( Graphics g, JComponent c ) { + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + float arc = FlatUIUtils.getBorderArc( c ); + // fill background if opaque to avoid garbage if user sets opaque to true - if( c.isOpaque() && (focusWidth > 0 || arc != 0) ) + if( c.isOpaque() && (focusWidth > 0 || arc > 0) ) FlatUIUtils.paintParentBackground( g, c ); Graphics2D g2 = (Graphics2D) g; @@ -326,22 +356,19 @@ public class FlatComboBoxUI int width = c.getWidth(); int height = c.getHeight(); - float focusWidth = (c.getBorder() instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0; - float arc = (c.getBorder() instanceof FlatRoundBorder) ? scale( (float) this.arc ) : 0; int arrowX = arrowButton.getX(); int arrowWidth = arrowButton.getWidth(); + boolean paintButton = (comboBox.isEditable() || "button".equals( buttonStyle )) && !"none".equals( buttonStyle ); boolean enabled = comboBox.isEnabled(); boolean isLeftToRight = comboBox.getComponentOrientation().isLeftToRight(); // paint background - g2.setColor( enabled - ? (editableBackground != null && comboBox.isEditable() ? editableBackground : c.getBackground()) - : getDisabledBackground( comboBox ) ); + g2.setColor( getBackground( enabled ) ); FlatUIUtils.paintComponentBackground( g2, 0, 0, width, height, focusWidth, arc ); // paint arrow button background if( enabled ) { - g2.setColor( comboBox.isEditable() ? buttonEditableBackground : buttonBackground ); + g2.setColor( paintButton ? buttonEditableBackground : buttonBackground ); Shape oldClip = g2.getClip(); if( isLeftToRight ) g2.clipRect( arrowX, 0, width - arrowX, height ); @@ -352,7 +379,7 @@ public class FlatComboBoxUI } // paint vertical line between value and arrow button - if( comboBox.isEditable() ) { + if( paintButton ) { g2.setColor( enabled ? borderColor : disabledBorderColor ); float lw = scale( 1f ); float lx = isLeftToRight ? arrowX : arrowX + arrowWidth - lw; @@ -375,8 +402,8 @@ public class FlatComboBoxUI uninstallCellPaddingBorder( c ); boolean enabled = comboBox.isEnabled(); - c.setForeground( enabled ? comboBox.getForeground() : disabledForeground ); - c.setBackground( enabled ? comboBox.getBackground() : getDisabledBackground( comboBox ) ); + c.setBackground( getBackground( enabled ) ); + c.setForeground( getForeground( enabled ) ); boolean shouldValidate = (c instanceof JPanel); if( padding != null ) @@ -393,12 +420,24 @@ public class FlatComboBoxUI @Override public void paintCurrentValueBackground( Graphics g, Rectangle bounds, boolean hasFocus ) { - g.setColor( comboBox.isEnabled() ? comboBox.getBackground() : getDisabledBackground( comboBox ) ); - g.fillRect( bounds.x, bounds.y, bounds.width, bounds.height ); + // not necessary because already painted in update() } - private Color getDisabledBackground( JComponent c ) { - return isIntelliJTheme ? FlatUIUtils.getParentBackground( c ) : disabledBackground; + protected Color getBackground( boolean enabled ) { + return enabled + ? (editableBackground != null && comboBox.isEditable() ? editableBackground : comboBox.getBackground()) + : (isIntelliJTheme ? FlatUIUtils.getParentBackground( comboBox ) : disabledBackground); + } + + protected Color getForeground( boolean enabled ) { + return enabled ? comboBox.getForeground() : disabledForeground; + } + + @Override + public Dimension getMinimumSize( JComponent c ) { + Dimension minimumSize = super.getMinimumSize( c ); + minimumSize.width = Math.max( minimumSize.width, scale( FlatUIUtils.minimumWidth( c, minimumWidth ) ) ); + return minimumSize; } @Override @@ -421,6 +460,18 @@ public class FlatComboBoxUI Dimension displaySize = super.getDisplaySize(); + // recalculate width without hardcoded 100 under special conditions + if( displaySize.width == 100 + padding.left + padding.right && + comboBox.isEditable() && + comboBox.getItemCount() == 0 && + comboBox.getPrototypeDisplayValue() == null ) + { + int width = getDefaultSize().width; + width = Math.max( width, editor.getPreferredSize().width ); + width += padding.left + padding.right; + displaySize = new Dimension( width, displaySize.height ); + } + uninstallCellPaddingBorder( renderer ); return displaySize; } @@ -456,15 +507,36 @@ public class FlatComboBoxUI } } + //---- class FlatComboBoxButton ------------------------------------------- + + protected class FlatComboBoxButton + extends FlatArrowButton + { + protected FlatComboBoxButton() { + this( SwingConstants.SOUTH, arrowType, buttonArrowColor, buttonDisabledArrowColor, buttonHoverArrowColor, null, null ); + } + + protected FlatComboBoxButton( int direction, String type, Color foreground, Color disabledForeground, + Color hoverForeground, Color hoverBackground, Color pressedBackground ) + { + super( direction, type, foreground, disabledForeground, hoverForeground, hoverBackground, pressedBackground ); + } + + @Override + protected boolean isHover() { + return super.isHover() || (!comboBox.isEditable() ? hover : false); + } + } + //---- class FlatComboPopup ----------------------------------------------- @SuppressWarnings( { "rawtypes", "unchecked" } ) - private class FlatComboPopup + protected class FlatComboPopup extends BasicComboPopup { private CellPaddingBorder paddingBorder; - FlatComboPopup( JComboBox combo ) { + protected FlatComboPopup( JComboBox combo ) { super( combo ); // BasicComboPopup listens to JComboBox.componentOrientation and updates @@ -479,18 +551,37 @@ public class FlatComboBoxUI @Override protected Rectangle computePopupBounds( int px, int py, int pw, int ph ) { - // get maximum display size of all items, ignoring prototype value - Object prototype = comboBox.getPrototypeDisplayValue(); - if( prototype != null ) - comboBox.setPrototypeDisplayValue( null ); - Dimension displaySize = getDisplaySize(); - if( prototype != null ) - comboBox.setPrototypeDisplayValue( prototype ); + // get maximum display width of all items + int displayWidth = getDisplaySize().width; + + // add border insets + for( Border border : new Border[] { scroller.getViewportBorder(), scroller.getBorder() } ) { + if( border != null ) { + Insets borderInsets = border.getBorderInsets( null ); + displayWidth += borderInsets.left + borderInsets.right; + } + } + + // add width of vertical scroll bar + JScrollBar verticalScrollBar = scroller.getVerticalScrollBar(); + if( verticalScrollBar != null ) + displayWidth += verticalScrollBar.getPreferredSize().width; // make popup wider if necessary - if( displaySize.width > pw ) { - int diff = displaySize.width - pw; - pw = displaySize.width; + if( displayWidth > pw ) { + // limit popup width to screen width + GraphicsConfiguration gc = comboBox.getGraphicsConfiguration(); + if( gc != null ) { + Rectangle screenBounds = gc.getBounds(); + Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets( gc ); + displayWidth = Math.min( displayWidth, screenBounds.width - screenInsets.left - screenInsets.right ); + } else { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + displayWidth = Math.min( displayWidth, screenSize.width ); + } + + int diff = displayWidth - pw; + pw = displayWidth; if( !comboBox.getComponentOrientation().isLeftToRight() ) px -= diff; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDropShadowBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDropShadowBorder.java new file mode 100644 index 00000000..505b9276 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatDropShadowBorder.java @@ -0,0 +1,223 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Insets; +import java.awt.RadialGradientPaint; +import java.awt.image.BufferedImage; +import com.formdev.flatlaf.util.HiDPIUtils; +import com.formdev.flatlaf.util.UIScale; + +/** + * Paints a drop shadow border around the component. + * Supports 1-sided, 2-side, 3-sided or 4-sided drop shadows. + *

+ * The shadow insets allow specifying drop shadow thickness for each side. + * A zero or negative value hides the drop shadow on that side. + * A negative value can be used to indent the drop shadow on corners. + * E.g. -4 on left indents drop shadow at top-left and bottom-left corners by 4 pixels. + * + * @author Karl Tauber + */ +public class FlatDropShadowBorder + extends FlatEmptyBorder +{ + private final Color shadowColor; + private final Insets shadowInsets; + private final float shadowOpacity; + + private final int shadowSize; + private Image shadowImage; + private Color lastShadowColor; + private double lastSystemScaleFactor; + private float lastUserScaleFactor; + + public FlatDropShadowBorder() { + this( null ); + } + + public FlatDropShadowBorder( Color shadowColor ) { + this( shadowColor, 4, 0.5f ); + } + + public FlatDropShadowBorder( Color shadowColor, int shadowSize, float shadowOpacity ) { + this( shadowColor, new Insets( -shadowSize, -shadowSize, shadowSize, shadowSize ), shadowOpacity ); + } + + public FlatDropShadowBorder( Color shadowColor, Insets shadowInsets, float shadowOpacity ) { + super( Math.max( shadowInsets.top, 0 ), Math.max( shadowInsets.left, 0 ), + Math.max( shadowInsets.bottom, 0 ), Math.max( shadowInsets.right, 0 ) ); + this.shadowColor = shadowColor; + this.shadowInsets = shadowInsets; + this.shadowOpacity = shadowOpacity; + + shadowSize = Math.max( + Math.max( shadowInsets.left, shadowInsets.right ), + Math.max( shadowInsets.top, shadowInsets.bottom ) ); + } + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + if( shadowSize <= 0 ) + return; + + HiDPIUtils.paintAtScale1x( (Graphics2D) g, x, y, width, height, this::paintImpl ); + } + + private void paintImpl( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + Color shadowColor = (this.shadowColor != null) ? this.shadowColor : g.getColor(); + int shadowSize = scale( this.shadowSize, scaleFactor ); + + // create and cache shadow image + float userScaleFactor = UIScale.getUserScaleFactor(); + if( shadowImage == null || + !shadowColor.equals( lastShadowColor ) || + lastSystemScaleFactor != scaleFactor || + lastUserScaleFactor != userScaleFactor ) + { + shadowImage = createShadowImage( shadowColor, shadowSize, shadowOpacity, + (float) (scaleFactor * userScaleFactor) ); + lastShadowColor = shadowColor; + lastSystemScaleFactor = scaleFactor; + lastUserScaleFactor = userScaleFactor; + } + +/*debug + int m = shadowImage.getWidth( null ); + Color oldColor = g.getColor(); + g.setColor( Color.lightGray ); + g.drawRect( x - m - 1, y - m - 1, m + 1, m + 1 ); + g.setColor( Color.white ); + g.fillRect( x - m, y - m, m, m ); + g.drawImage( shadowImage, x - m, y - m, null ); + g.setColor( oldColor ); +debug*/ + + int left = scale( shadowInsets.left, scaleFactor ); + int right = scale( shadowInsets.right, scaleFactor ); + int top = scale( shadowInsets.top, scaleFactor ); + int bottom = scale( shadowInsets.bottom, scaleFactor ); + + // shadow outer coordinates + int x1o = x - Math.min( left, 0 ); + int y1o = y - Math.min( top, 0 ); + int x2o = x + width + Math.min( right, 0 ); + int y2o = y + height + Math.min( bottom, 0 ); + + // shadow inner coordinates + int x1i = x1o + shadowSize; + int y1i = y1o + shadowSize; + int x2i = x2o - shadowSize; + int y2i = y2o - shadowSize; + + int wh = (shadowSize * 2) - 1; + int center = shadowSize - 1; + + // left-top edge + if( left > 0 || top > 0 ) { + g.drawImage( shadowImage, x1o, y1o, x1i, y1i, + 0, 0, center, center, null ); + } + + // top shadow + if( top > 0 ) { + g.drawImage( shadowImage, x1i, y1o, x2i, y1i, + center, 0, center + 1, center, null ); + } + + // right-top edge + if( right > 0 || top > 0 ) { + g.drawImage( shadowImage, x2i, y1o, x2o, y1i, + center, 0, wh, center, null ); + } + + // left shadow + if( left > 0 ) { + g.drawImage( shadowImage, x1o, y1i, x1i, y2i, + 0, center, center, center + 1, null ); + } + + // right shadow + if( right > 0 ) { + g.drawImage( shadowImage, x2i, y1i, x2o, y2i, + center, center, wh, center + 1, null ); + } + + // left-bottom edge + if( left > 0 || bottom > 0 ) { + g.drawImage( shadowImage, x1o, y2i, x1i, y2o, + 0, center, center, wh, null ); + } + + // bottom shadow + if( bottom > 0 ) { + g.drawImage( shadowImage, x1i, y2i, x2i, y2o, + center, center, center + 1, wh, null ); + } + + // right-bottom edge + if( right > 0 || bottom > 0 ) { + g.drawImage( shadowImage, x2i, y2i, x2o, y2o, + center, center, wh, wh, null ); + } + } + + private int scale( int value, double scaleFactor ) { + return (int) Math.ceil( UIScale.scale( value ) * scaleFactor ); + } + + private static BufferedImage createShadowImage( Color shadowColor, int shadowSize, + float shadowOpacity, float scaleFactor ) + { + int shadowRGB = shadowColor.getRGB() & 0xffffff; + int shadowAlpha = (int) (255 * shadowOpacity); + Color startColor = new Color( shadowRGB | ((shadowAlpha & 0xff) << 24), true ); + Color midColor = new Color( shadowRGB | (((shadowAlpha / 2) & 0xff) << 24), true ); + Color endColor = new Color( shadowRGB, true ); + +/*debug + startColor = Color.red; + midColor = Color.green; + endColor = Color.blue; +debug*/ + + int wh = (shadowSize * 2) - 1; + int center = shadowSize - 1; + + RadialGradientPaint p = new RadialGradientPaint( center, center, + shadowSize - (0.75f * scaleFactor), + new float[] { 0, 0.35f, 1 }, + new Color[] { startColor, midColor, endColor } ); + + BufferedImage image = new BufferedImage( wh, wh, BufferedImage.TYPE_INT_ARGB ); + + Graphics2D g = image.createGraphics(); + try { + g.setPaint( p ); + g.fillRect( 0, 0, wh, wh ); + } finally { + g.dispose(); + } + + return image; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEditorPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEditorPaneUI.java index 0bfe034b..45484034 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEditorPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEditorPaneUI.java @@ -19,6 +19,8 @@ package com.formdev.flatlaf.ui; import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Graphics2D; +import java.beans.PropertyChangeEvent; import javax.swing.JComponent; import javax.swing.JEditorPane; import javax.swing.UIManager; @@ -26,6 +28,8 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicEditorPaneUI; import javax.swing.text.JTextComponent; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.HiDPIUtils; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JEditorPane}. @@ -83,26 +87,45 @@ public class FlatEditorPaneUI getComponent().putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, oldHonorDisplayProperties ); } + @Override + protected void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + propertyChange( getComponent(), e ); + } + + static void propertyChange( JTextComponent c, PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case FlatClientProperties.MINIMUM_WIDTH: + c.revalidate(); + break; + } + } + @Override public Dimension getPreferredSize( JComponent c ) { - return applyMinimumWidth( super.getPreferredSize( c ) ); + return applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth ); } @Override public Dimension getMinimumSize( JComponent c ) { - return applyMinimumWidth( super.getMinimumSize( c ) ); + return applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth ); } - private Dimension applyMinimumWidth( Dimension size ) { + static Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth ) { // Assume that text area is in a scroll pane (that displays the border) // and subtract 1px border line width. // Using "(scale( 1 ) * 2)" instead of "scale( 2 )" to deal with rounding // issues. E.g. at scale factor 1.5 the first returns 4, but the second 3. - int minimumWidth = FlatUIUtils.minimumWidth( getComponent(), this.minimumWidth ); + minimumWidth = FlatUIUtils.minimumWidth( c, minimumWidth ); size.width = Math.max( size.width, scale( minimumWidth ) - (scale( 1 ) * 2) ); return size; } + @Override + protected void paintSafely( Graphics g ) { + super.paintSafely( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) ); + } + @Override protected void paintBackground( Graphics g ) { JTextComponent c = getComponent(); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEmptyBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEmptyBorder.java index 9a51c9c5..55d08c72 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEmptyBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatEmptyBorder.java @@ -57,4 +57,8 @@ public class FlatEmptyBorder insets.bottom = scale( bottom ); return insets; } + + public Insets getUnscaledBorderInsets() { + return super.getBorderInsets(); + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java index 0736c33e..b109f152 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java @@ -16,11 +16,28 @@ package com.formdev.flatlaf.ui; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Dimension; +import java.awt.Insets; +import java.io.File; +import javax.swing.AbstractButton; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.UIManager; +import javax.swing.filechooser.FileView; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.metal.MetalFileChooserUI; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.ScaledImageIcon; import com.formdev.flatlaf.util.UIScale; /** @@ -86,6 +103,7 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault FileChooser.folderNameLabelText String * @uiDefault FileChooser.filesOfTypeLabelMnemonic String * @uiDefault FileChooser.filesOfTypeLabelText String + * * @uiDefault FileChooser.upFolderToolTipText String * @uiDefault FileChooser.upFolderAccessibleName String * @uiDefault FileChooser.homeFolderToolTipText String @@ -97,11 +115,27 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault FileChooser.detailsViewButtonToolTipText String * @uiDefault FileChooser.detailsViewButtonAccessibleName String * + * + * + * @uiDefault FileChooser.fileNameHeaderText String + * @uiDefault FileChooser.fileSizeHeaderText String + * @uiDefault FileChooser.fileTypeHeaderText String + * @uiDefault FileChooser.fileDateHeaderText String + * @uiDefault FileChooser.fileAttrHeaderText String + * + * @uiDefault FileChooser.viewMenuLabelText String + * @uiDefault FileChooser.refreshActionLabelText String + * @uiDefault FileChooser.newFolderActionLabelText String + * @uiDefault FileChooser.listViewActionLabelText String + * @uiDefault FileChooser.detailsViewActionLabelText String + * * @author Karl Tauber */ public class FlatFileChooserUI extends MetalFileChooserUI { + private final FlatFileView fileView = new FlatFileView(); + public static ComponentUI createUI( JComponent c ) { return new FlatFileChooserUI( (JFileChooser) c ); } @@ -110,6 +144,52 @@ public class FlatFileChooserUI super( filechooser ); } + @Override + public void installComponents( JFileChooser fc ) { + super.installComponents( fc ); + + patchUI( fc ); + } + + private void patchUI( JFileChooser fc ) { + // turn top-right buttons into toolbar buttons + Component topPanel = fc.getComponent( 0 ); + if( (topPanel instanceof JPanel) && + (((JPanel)topPanel).getLayout() instanceof BorderLayout) ) + { + Component topButtonPanel = ((JPanel)topPanel).getComponent( 0 ); + if( (topButtonPanel instanceof JPanel) && + (((JPanel)topButtonPanel).getLayout() instanceof BoxLayout) ) + { + Insets margin = UIManager.getInsets( "Button.margin" ); + Component[] comps = ((JPanel)topButtonPanel).getComponents(); + for( int i = comps.length - 1; i >= 0; i-- ) { + Component c = comps[i]; + if( c instanceof JButton || c instanceof JToggleButton ) { + AbstractButton b = (AbstractButton)c; + b.putClientProperty( FlatClientProperties.BUTTON_TYPE, + FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON ); + b.setMargin( margin ); + b.setFocusable( false ); + } else if( c instanceof Box.Filler ) + ((JPanel)topButtonPanel).remove( i ); + } + } + } + + // increase maximum row count of directory combo box popup list + try { + Component directoryComboBox = ((JPanel)topPanel).getComponent( 2 ); + if( directoryComboBox instanceof JComboBox ) { + int maximumRowCount = UIManager.getInt( "ComboBox.maximumRowCount" ); + if( maximumRowCount > 0 ) + ((JComboBox)directoryComboBox).setMaximumRowCount( maximumRowCount ); + } + } catch( ArrayIndexOutOfBoundsException ex ) { + // ignore + } + } + @Override public Dimension getPreferredSize( JComponent c ) { return UIScale.scale( super.getPreferredSize( c ) ); @@ -119,4 +199,50 @@ public class FlatFileChooserUI public Dimension getMinimumSize( JComponent c ) { return UIScale.scale( super.getMinimumSize( c ) ); } + + @Override + public FileView getFileView( JFileChooser fc ) { + return fileView; + } + + @Override + public void clearIconCache() { + fileView.clearIconCache(); + } + + //---- class FlatFileView ------------------------------------------------- + + private class FlatFileView + extends BasicFileView + { + @Override + public Icon getIcon( File f ) { + // get cached icon + Icon icon = getCachedIcon( f ); + if( icon != null ) + return icon; + + // get system icon + if( f != null ) { + icon = getFileChooser().getFileSystemView().getSystemIcon( f ); + + if( icon != null ) { + if( icon instanceof ImageIcon ) + icon = new ScaledImageIcon( (ImageIcon) icon ); + cacheIcon( f, icon ); + return icon; + } + } + + // get default icon + icon = super.getIcon( f ); + + if( icon instanceof ImageIcon ) { + icon = new ScaledImageIcon( (ImageIcon) icon ); + cacheIcon( f, icon ); + } + + return icon; + } + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameTitlePane.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameTitlePane.java index 30596cf6..3e4f7c1a 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameTitlePane.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameTitlePane.java @@ -26,13 +26,14 @@ import java.beans.PropertyChangeListener; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.JInternalFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.LookAndFeel; -import javax.swing.UIManager; import javax.swing.border.Border; import javax.swing.plaf.basic.BasicInternalFrameTitlePane; +import com.formdev.flatlaf.util.ScaledImageIcon; import com.formdev.flatlaf.util.UIScale; /** @@ -91,7 +92,21 @@ public class FlatInternalFrameTitlePane updateFrameIcon(); updateColors(); - buttonPanel = new JPanel(); + buttonPanel = new JPanel() { + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + int height = size.height; + // use height of invisible buttons to always have same title pane height + if( !iconButton.isVisible() ) + height = Math.max( height, iconButton.getPreferredSize().height ); + if( !maxButton.isVisible() ) + height = Math.max( height, maxButton.getPreferredSize().height ); + if( !closeButton.isVisible() ) + height = Math.max( height, closeButton.getPreferredSize().height ); + return new Dimension( size.width, height ); + } + }; buttonPanel.setLayout( new BoxLayout( buttonPanel, BoxLayout.LINE_AXIS ) ); buttonPanel.setOpaque( false ); @@ -103,14 +118,16 @@ public class FlatInternalFrameTitlePane add( buttonPanel, BorderLayout.LINE_END ); } - private void updateFrameIcon() { + protected void updateFrameIcon() { Icon frameIcon = frame.getFrameIcon(); - if( frameIcon == UIManager.getIcon( "InternalFrame.icon" ) ) + if( frameIcon != null && (frameIcon.getIconWidth() == 0 || frameIcon.getIconHeight() == 0) ) frameIcon = null; + else if( frameIcon instanceof ImageIcon ) + frameIcon = new ScaledImageIcon( (ImageIcon) frameIcon ); titleLabel.setIcon( frameIcon ); } - private void updateColors() { + protected void updateColors() { Color background = FlatUIUtils.nonUIResource( frame.isSelected() ? selectedTitleColor : notSelectedTitleColor ); Color foreground = FlatUIUtils.nonUIResource( frame.isSelected() ? selectedTextColor : notSelectedTextColor ); @@ -123,7 +140,7 @@ public class FlatInternalFrameTitlePane closeButton.setForeground( foreground ); } - private void updateButtonsVisibility() { + protected void updateButtonsVisibility() { iconButton.setVisible( frame.isIconifiable() ); maxButton.setVisible( frame.isMaximizable() ); closeButton.setVisible( frame.isClosable() ); @@ -150,7 +167,7 @@ public class FlatInternalFrameTitlePane //---- class FlatPropertyChangeHandler ------------------------------------ - private class FlatPropertyChangeHandler + protected class FlatPropertyChangeHandler extends PropertyChangeHandler { @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java index 5d60fd17..efc3bfaf 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java @@ -84,6 +84,8 @@ import javax.swing.plaf.basic.BasicInternalFrameUI; public class FlatInternalFrameUI extends BasicInternalFrameUI { + protected FlatWindowResizer windowResizer; + public static ComponentUI createUI( JComponent c ) { return new FlatInternalFrameUI( (JInternalFrame) c ); } @@ -97,6 +99,18 @@ public class FlatInternalFrameUI super.installUI( c ); LookAndFeel.installProperty( frame, "opaque", false ); + + windowResizer = createWindowResizer(); + } + + @Override + public void uninstallUI( JComponent c ) { + super.uninstallUI( c ); + + if( windowResizer != null ) { + windowResizer.uninstall(); + windowResizer = null; + } } @Override @@ -104,6 +118,10 @@ public class FlatInternalFrameUI return new FlatInternalFrameTitlePane( w ); } + protected FlatWindowResizer createWindowResizer() { + return new FlatWindowResizer.InternalFrameResizer( frame, this::getDesktopManager ); + } + //---- class FlatInternalFrameBorder -------------------------------------- public static class FlatInternalFrameBorder @@ -112,6 +130,16 @@ public class FlatInternalFrameUI private final Color activeBorderColor = UIManager.getColor( "InternalFrame.activeBorderColor" ); private final Color inactiveBorderColor = UIManager.getColor( "InternalFrame.inactiveBorderColor" ); private final int borderLineWidth = FlatUIUtils.getUIInt( "InternalFrame.borderLineWidth", 1 ); + private final boolean dropShadowPainted = UIManager.getBoolean( "InternalFrame.dropShadowPainted" ); + + private final FlatDropShadowBorder activeDropShadowBorder = new FlatDropShadowBorder( + UIManager.getColor( "InternalFrame.activeDropShadowColor" ), + UIManager.getInsets( "InternalFrame.activeDropShadowInsets" ), + FlatUIUtils.getUIFloat( "InternalFrame.activeDropShadowOpacity", 0.5f ) ); + private final FlatDropShadowBorder inactiveDropShadowBorder = new FlatDropShadowBorder( + UIManager.getColor( "InternalFrame.inactiveDropShadowColor" ), + UIManager.getInsets( "InternalFrame.inactiveDropShadowInsets" ), + FlatUIUtils.getUIFloat( "InternalFrame.inactiveDropShadowOpacity", 0.5f ) ); public FlatInternalFrameBorder() { super( UIManager.getInsets( "InternalFrame.borderMargins" ) ); @@ -137,16 +165,31 @@ public class FlatInternalFrameUI Insets insets = getBorderInsets( c ); float lineWidth = scale( (float) borderLineWidth ); + float rx = x + insets.left - lineWidth; + float ry = y + insets.top - lineWidth; + float rwidth = width - insets.left - insets.right + (lineWidth * 2); + float rheight = height - insets.top - insets.bottom + (lineWidth * 2); + Graphics2D g2 = (Graphics2D) g.create(); try { FlatUIUtils.setRenderingHints( g2 ); g2.setColor( f.isSelected() ? activeBorderColor : inactiveBorderColor ); - g2.fill( FlatUIUtils.createRectangle( - x + insets.left - lineWidth, - y + insets.top - lineWidth, - width - insets.left - insets.right + (lineWidth * 2), - height - insets.top - insets.bottom + (lineWidth * 2), - lineWidth ) ); + + // paint drop shadow + if( dropShadowPainted ) { + FlatDropShadowBorder dropShadowBorder = f.isSelected() + ? activeDropShadowBorder : inactiveDropShadowBorder; + + Insets dropShadowInsets = dropShadowBorder.getBorderInsets(); + dropShadowBorder.paintBorder( c, g2, + (int) rx - dropShadowInsets.left, + (int) ry - dropShadowInsets.top, + (int) rwidth + dropShadowInsets.left + dropShadowInsets.right, + (int) rheight + dropShadowInsets.top + dropShadowInsets.bottom ); + } + + // paint border + g2.fill( FlatUIUtils.createRectangle( rx, ry, rwidth, rheight, lineWidth ) ); } finally { g2.dispose(); } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java index 6ed86360..2bfafc52 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLabelUI.java @@ -19,6 +19,7 @@ package com.formdev.flatlaf.ui; import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.Rectangle; import java.beans.PropertyChangeEvent; import javax.swing.Icon; @@ -30,6 +31,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.basic.BasicLabelUI; import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.UIScale; /** @@ -54,12 +56,8 @@ public class FlatLabelUI private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatLabelUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatLabelUI.class, FlatLabelUI::new ); } @Override @@ -124,6 +122,17 @@ public class FlatLabelUI BasicHTML.updateRenderer( c, text ); } + static Graphics createGraphicsHTMLTextYCorrection( Graphics g, JComponent c ) { + return (c.getClientProperty( BasicHTML.propertyKey ) != null) + ? HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) + : g; + } + + @Override + public void paint( Graphics g, JComponent c ) { + super.paint( createGraphicsHTMLTextYCorrection( g, c ), c ); + } + @Override protected void paintEnabledText( JLabel l, Graphics g, String s, int textX, int textY ) { int mnemIndex = FlatLaf.isShowMnemonics() ? l.getDisplayedMnemonicIndex() : -1; diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java index 355bf01d..a529f096 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatLineBorder.java @@ -26,9 +26,9 @@ import java.awt.Insets; /** * Line border for various components. * - * Paints a scaled 1px thick line around the component. - * The line thickness is not included in the border insets. - * The insets should be at least 1,1,1,1. + * Paints a scaled (usually 1px thick) line around the component. + * The line thickness is not added to the border insets. + * The insets should be at least have line thickness (usually 1,1,1,1). * * @author Karl Tauber */ @@ -36,10 +36,24 @@ public class FlatLineBorder extends FlatEmptyBorder { private final Color lineColor; + private final float lineThickness; public FlatLineBorder( Insets insets, Color lineColor ) { + this( insets, lineColor, 1f ); + } + + public FlatLineBorder( Insets insets, Color lineColor, float lineThickness ) { super( insets ); this.lineColor = lineColor; + this.lineThickness = lineThickness; + } + + public Color getLineColor() { + return lineColor; + } + + public float getLineThickness() { + return lineThickness; } @Override @@ -48,7 +62,7 @@ public class FlatLineBorder try { FlatUIUtils.setRenderingHints( g2 ); g2.setColor( lineColor ); - FlatUIUtils.paintComponentBorder( g2, x, y, width, height, 0f, scale( 1f ), 0f ); + FlatUIUtils.paintComponentBorder( g2, x, y, width, height, 0f, scale( lineThickness ), 0f ); } finally { g2.dispose(); } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java index 329eca2b..d639ecb3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java @@ -17,6 +17,7 @@ package com.formdev.flatlaf.ui; import java.awt.Color; +import java.awt.EventQueue; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import javax.swing.JComponent; @@ -81,7 +82,7 @@ public class FlatListUI selectionInactiveBackground = UIManager.getColor( "List.selectionInactiveBackground" ); selectionInactiveForeground = UIManager.getColor( "List.selectionInactiveForeground" ); - toggleSelectionColors( list.hasFocus() ); + toggleSelectionColors(); } @Override @@ -100,13 +101,17 @@ public class FlatListUI @Override public void focusGained( FocusEvent e ) { super.focusGained( e ); - toggleSelectionColors( true ); + toggleSelectionColors(); } @Override public void focusLost( FocusEvent e ) { super.focusLost( e ); - toggleSelectionColors( false ); + + // use invokeLater for the case that the window is deactivated + EventQueue.invokeLater( () -> { + toggleSelectionColors(); + } ); } }; } @@ -120,8 +125,11 @@ public class FlatListUI * already used in applications. Then either the inactive colors are not used, * or the application has to be changed to extend a FlatLaf renderer. */ - private void toggleSelectionColors( boolean focused ) { - if( focused ) { + private void toggleSelectionColors() { + if( list == null ) + return; + + if( FlatUIUtils.isPermanentFocusOwner( list ) ) { if( list.getSelectionBackground() == selectionInactiveBackground ) list.setSelectionBackground( selectionBackground ); if( list.getSelectionForeground() == selectionInactiveForeground ) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarBorder.java index b98ebe5f..5701f935 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarBorder.java @@ -20,9 +20,7 @@ import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Insets; -import java.awt.geom.Rectangle2D; import javax.swing.JMenuBar; import javax.swing.UIManager; @@ -40,16 +38,8 @@ public class FlatMenuBarBorder @Override public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { - Graphics2D g2 = (Graphics2D) g.create(); - try { - float lineHeight = scale( (float) 1 ); - - FlatUIUtils.setRenderingHints( g2 ); - g2.setColor( borderColor ); - g2.fill( new Rectangle2D.Float( x, y + height - lineHeight, width, lineHeight ) ); - } finally { - g2.dispose(); - } + float lineHeight = scale( (float) 1 ); + FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java index dabcdd6f..09af41dd 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java @@ -16,9 +16,20 @@ package com.formdev.flatlaf.ui; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; import javax.swing.JComponent; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.MenuElement; +import javax.swing.MenuSelectionManager; +import javax.swing.SwingUtilities; +import javax.swing.plaf.ActionMapUIResource; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicMenuBarUI; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.SystemInfo; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JMenuBar}. @@ -38,4 +49,45 @@ public class FlatMenuBarUI public static ComponentUI createUI( JComponent c ) { return new FlatMenuBarUI(); } + + /* + * WARNING: This class is not used on macOS if screen menu bar is enabled. + * Do not add any functionality here. + */ + + @Override + protected void installKeyboardActions() { + super.installKeyboardActions(); + + ActionMap map = SwingUtilities.getUIActionMap( menuBar ); + if( map == null ) { + map = new ActionMapUIResource(); + SwingUtilities.replaceUIActionMap( menuBar, map ); + } + map.put( "takeFocus", new TakeFocus() ); + } + + //---- class TakeFocus ---------------------------------------------------- + + /** + * Activates the menu bar and shows mnemonics. + * On Windows, the popup of the first menu is not shown. + * On other platforms, the popup of the first menu is shown. + */ + private static class TakeFocus + extends AbstractAction + { + @Override + public void actionPerformed( ActionEvent e ) { + JMenuBar menuBar = (JMenuBar) e.getSource(); + JMenu menu = menuBar.getMenu( 0 ); + if( menu != null ) { + MenuSelectionManager.defaultManager().setSelectedPath( SystemInfo.isWindows + ? new MenuElement[] { menuBar, menu } + : new MenuElement[] { menuBar, menu, menu.getPopupMenu() } ); + + FlatLaf.showMnemonics( menuBar ); + } + } + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemBorder.java index 9d51a5af..aa8079a6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemBorder.java @@ -40,7 +40,7 @@ public class FlatMenuItemBorder if( c.getParent() instanceof JMenuBar ) { insets.top = scale( menuBarItemMargins.top ); insets.left = scale( menuBarItemMargins.left ); - insets.bottom = scale( menuBarItemMargins.bottom + 1 ); + insets.bottom = scale( menuBarItemMargins.bottom ); insets.right = scale( menuBarItemMargins.right ); return insets; } else diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemRenderer.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemRenderer.java new file mode 100644 index 00000000..b49d2df1 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemRenderer.java @@ -0,0 +1,574 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import static com.formdev.flatlaf.util.UIScale.scale; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.text.AttributedCharacterIterator; +import javax.swing.Icon; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.plaf.basic.BasicHTML; +import javax.swing.text.View; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.Graphics2DProxy; +import com.formdev.flatlaf.util.HiDPIUtils; +import com.formdev.flatlaf.util.SystemInfo; + +/** + * Renderer for menu items. + * + * @uiDefault MenuItem.minimumWidth int + * @uiDefault MenuItem.minimumIconSize Dimension + * @uiDefault MenuItem.textAcceleratorGap int + * @uiDefault MenuItem.textNoAcceleratorGap int + * @uiDefault MenuItem.acceleratorArrowGap int + * @uiDefault MenuItem.checkBackground Color + * @uiDefault MenuItem.underlineSelectionBackground Color + * @uiDefault MenuItem.underlineSelectionCheckBackground Color + * @uiDefault MenuItem.underlineSelectionColor Color + * @uiDefault MenuItem.underlineSelectionHeight Color + * + * @author Karl Tauber + */ +public class FlatMenuItemRenderer +{ + protected final JMenuItem menuItem; + protected final Icon checkIcon; + protected final Icon arrowIcon; + protected final Font acceleratorFont; + protected final String acceleratorDelimiter; + + protected final int minimumWidth = UIManager.getInt( "MenuItem.minimumWidth" ); + protected final Dimension minimumIconSize; + protected final int textAcceleratorGap = FlatUIUtils.getUIInt( "MenuItem.textAcceleratorGap", 28 ); + protected final int textNoAcceleratorGap = FlatUIUtils.getUIInt( "MenuItem.textNoAcceleratorGap", 6 ); + protected final int acceleratorArrowGap = FlatUIUtils.getUIInt( "MenuItem.acceleratorArrowGap", 2 ); + + protected final Color checkBackground = UIManager.getColor( "MenuItem.checkBackground" ); + protected final Insets checkMargins = UIManager.getInsets( "MenuItem.checkMargins" ); + + protected final Color underlineSelectionBackground = UIManager.getColor( "MenuItem.underlineSelectionBackground" ); + protected final Color underlineSelectionCheckBackground = UIManager.getColor( "MenuItem.underlineSelectionCheckBackground" ); + protected final Color underlineSelectionColor = UIManager.getColor( "MenuItem.underlineSelectionColor" ); + protected final int underlineSelectionHeight = UIManager.getInt( "MenuItem.underlineSelectionHeight" ); + + protected FlatMenuItemRenderer( JMenuItem menuItem, Icon checkIcon, Icon arrowIcon, + Font acceleratorFont, String acceleratorDelimiter ) + { + this.menuItem = menuItem; + this.checkIcon = checkIcon; + this.arrowIcon = arrowIcon; + this.acceleratorFont = acceleratorFont; + this.acceleratorDelimiter = acceleratorDelimiter; + + Dimension minimumIconSize = UIManager.getDimension( "MenuItem.minimumIconSize" ); + this.minimumIconSize = (minimumIconSize != null) ? minimumIconSize : new Dimension( 16, 16 ); + } + + protected Dimension getPreferredMenuItemSize() { + int width = 0; + int height = 0; + boolean isTopLevelMenu = isTopLevelMenu( menuItem ); + + Rectangle viewRect = new Rectangle( 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE ); + Rectangle iconRect = new Rectangle(); + Rectangle textRect = new Rectangle(); + + // layout icon and text + SwingUtilities.layoutCompoundLabel( menuItem, + menuItem.getFontMetrics( menuItem.getFont() ), menuItem.getText(), getIconForLayout(), + menuItem.getVerticalAlignment(), menuItem.getHorizontalAlignment(), + menuItem.getVerticalTextPosition(), menuItem.getHorizontalTextPosition(), + viewRect, iconRect, textRect, scale( menuItem.getIconTextGap() ) ); + + // union icon and text rectangles + Rectangle labelRect = iconRect.union( textRect ); + width += labelRect.width; + height = Math.max( labelRect.height, height ); + + // accelerator size + String accelText = getAcceleratorText(); + if( accelText != null ) { + // gap between text and accelerator + width += scale( !isTopLevelMenu ? textAcceleratorGap : menuItem.getIconTextGap() ); + + FontMetrics accelFm = menuItem.getFontMetrics( acceleratorFont ); + width += SwingUtilities.computeStringWidth( accelFm, accelText ); + height = Math.max( accelFm.getHeight(), height ); + } + + // arrow size + if( !isTopLevelMenu && arrowIcon != null ) { + // gap between text and arrow + if( accelText == null ) + width += scale( textNoAcceleratorGap ); + + // gap between accelerator and arrow + width += scale( acceleratorArrowGap ); + + width += arrowIcon.getIconWidth(); + height = Math.max( arrowIcon.getIconHeight(), height ); + } + + // add insets + Insets insets = menuItem.getInsets(); + width += insets.left + insets.right; + height += insets.top + insets.bottom; + + // minimum width + if( !isTopLevelMenu ) { + int minimumWidth = FlatUIUtils.minimumWidth( menuItem, this.minimumWidth ); + width = Math.max( width, scale( minimumWidth ) ); + } + + return new Dimension( width, height ); + } + + private void layout( Rectangle viewRect, Rectangle iconRect, Rectangle textRect, + Rectangle accelRect, Rectangle arrowRect, Rectangle labelRect ) + { + boolean isTopLevelMenu = isTopLevelMenu( menuItem ); + + // layout arrow + if( !isTopLevelMenu && arrowIcon != null ) { + arrowRect.width = arrowIcon.getIconWidth(); + arrowRect.height = arrowIcon.getIconHeight(); + } else + arrowRect.setSize( 0, 0 ); + arrowRect.y = viewRect.y + centerOffset( viewRect.height, arrowRect.height ); + + // layout accelerator + String accelText = getAcceleratorText(); + if( accelText != null ) { + FontMetrics accelFm = menuItem.getFontMetrics( acceleratorFont ); + accelRect.width = SwingUtilities.computeStringWidth( accelFm, accelText ); + accelRect.height = accelFm.getHeight(); + + accelRect.y = viewRect.y + centerOffset( viewRect.height, accelRect.height ); + } else + accelRect.setBounds( 0, 0, 0, 0 ); + + // compute horizontal positions of accelerator and arrow + int accelArrowGap = !isTopLevelMenu ? scale( acceleratorArrowGap ) : 0; + if( menuItem.getComponentOrientation().isLeftToRight() ) { + // left-to-right + arrowRect.x = viewRect.x + viewRect.width - arrowRect.width; + accelRect.x = arrowRect.x - accelArrowGap - accelRect.width; + } else { + // right-to-left + arrowRect.x = viewRect.x; + accelRect.x = arrowRect.x + accelArrowGap + arrowRect.width; + } + + // width of accelerator, arrow and gap + int accelArrowWidth = accelRect.width + arrowRect.width; + if( accelText != null ) + accelArrowWidth += scale( !isTopLevelMenu ? textAcceleratorGap : menuItem.getIconTextGap() ); + if( !isTopLevelMenu && arrowIcon != null ) { + if( accelText == null ) + accelArrowWidth += scale( textNoAcceleratorGap ); + accelArrowWidth += scale( acceleratorArrowGap ); + } + + // label rectangle is view rectangle subtracted by accelerator, arrow and gap + labelRect.setBounds( viewRect ); + labelRect.width -= accelArrowWidth; + if( !menuItem.getComponentOrientation().isLeftToRight() ) + labelRect.x += accelArrowWidth; + + // layout icon and text + SwingUtilities.layoutCompoundLabel( menuItem, + menuItem.getFontMetrics( menuItem.getFont() ), menuItem.getText(), getIconForLayout(), + menuItem.getVerticalAlignment(), menuItem.getHorizontalAlignment(), + menuItem.getVerticalTextPosition(), menuItem.getHorizontalTextPosition(), + labelRect, iconRect, textRect, scale( menuItem.getIconTextGap() ) ); + } + + private static int centerOffset( int wh1, int wh2 ) { + return (wh1 / 2) - (wh2 / 2); + } + + protected void paintMenuItem( Graphics g, Color selectionBackground, Color selectionForeground, + Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground ) + { + Rectangle viewRect = new Rectangle( menuItem.getWidth(), menuItem.getHeight() ); + + // subtract insets + Insets insets = menuItem.getInsets(); + viewRect.x += insets.left; + viewRect.y += insets.top; + viewRect.width -= (insets.left + insets.right); + viewRect.height -= (insets.top + insets.bottom); + + Rectangle iconRect = new Rectangle(); + Rectangle textRect = new Rectangle(); + Rectangle accelRect = new Rectangle(); + Rectangle arrowRect = new Rectangle(); + Rectangle labelRect = new Rectangle(); + + layout( viewRect, iconRect, textRect, accelRect, arrowRect, labelRect ); + +/*debug + g.setColor( Color.green ); g.drawRect( viewRect.x, viewRect.y, viewRect.width - 1, viewRect.height - 1 ); + g.setColor( Color.red ); g.drawRect( labelRect.x, labelRect.y, labelRect.width - 1, labelRect.height - 1 ); + g.setColor( Color.blue ); g.drawRect( iconRect.x, iconRect.y, iconRect.width - 1, iconRect.height - 1 ); + g.setColor( Color.cyan ); g.drawRect( textRect.x, textRect.y, textRect.width - 1, textRect.height - 1 ); + g.setColor( Color.magenta ); g.drawRect( accelRect.x, accelRect.y, accelRect.width - 1, accelRect.height - 1 ); + g.setColor( Color.orange ); g.drawRect( arrowRect.x, arrowRect.y, arrowRect.width - 1, arrowRect.height - 1 ); +debug*/ + + paintBackground( g, selectionBackground ); + paintIcon( g, iconRect, getIconForPainting() ); + paintText( g, textRect, menuItem.getText(), selectionForeground, disabledForeground ); + paintAccelerator( g, accelRect, getAcceleratorText(), acceleratorForeground, acceleratorSelectionForeground, disabledForeground ); + if( !isTopLevelMenu( menuItem ) ) + paintArrowIcon( g, arrowRect, arrowIcon ); + } + + protected void paintBackground( Graphics g, Color selectionBackground ) { + boolean armedOrSelected = isArmedOrSelected( menuItem ); + if( menuItem.isOpaque() || armedOrSelected ) { + int width = menuItem.getWidth(); + int height = menuItem.getHeight(); + + // paint background + g.setColor( armedOrSelected + ? (isUnderlineSelection() + ? deriveBackground( underlineSelectionBackground ) + : selectionBackground) + : menuItem.getBackground() ); + g.fillRect( 0, 0, width, height ); + + // paint underline + if( armedOrSelected && isUnderlineSelection() ) { + int underlineHeight = scale( underlineSelectionHeight ); + g.setColor( underlineSelectionColor ); + if( isTopLevelMenu( menuItem ) ) { + // paint underline at bottom + g.fillRect( 0, height - underlineHeight, width, underlineHeight ); + } else if( menuItem.getComponentOrientation().isLeftToRight() ) { + // paint underline at left side + g.fillRect( 0, 0, underlineHeight, height ); + } else { + // paint underline at right side + g.fillRect( width - underlineHeight, 0, underlineHeight, height ); + } + } + } + } + + protected Color deriveBackground( Color background ) { + Color baseColor = menuItem.isOpaque() + ? menuItem.getBackground() + : FlatUIUtils.getParentBackground( menuItem ); + + return FlatUIUtils.deriveColor( background, baseColor ); + } + + protected void paintIcon( Graphics g, Rectangle iconRect, Icon icon ) { + // if checkbox/radiobutton menu item is selected and also has a custom icon, + // then use filled icon background to indicate selection (instead of using checkIcon) + if( menuItem.isSelected() && checkIcon != null && icon != checkIcon ) { + Rectangle r = FlatUIUtils.addInsets( iconRect, scale( checkMargins ) ); + g.setColor( deriveBackground( isUnderlineSelection() ? underlineSelectionCheckBackground : checkBackground ) ); + g.fillRect( r.x, r.y, r.width, r.height ); + } + + paintIcon( g, menuItem, icon, iconRect ); + } + + protected void paintText( Graphics g, Rectangle textRect, String text, Color selectionForeground, Color disabledForeground ) { + View htmlView = (View) menuItem.getClientProperty( BasicHTML.propertyKey ); + if( htmlView != null ) { + paintHTMLText( g, menuItem, textRect, htmlView, isUnderlineSelection() ? null : selectionForeground ); + return; + } + + int mnemonicIndex = FlatLaf.isShowMnemonics() ? menuItem.getDisplayedMnemonicIndex() : -1; + Color foreground = (isTopLevelMenu( menuItem ) ? menuItem.getParent() : menuItem).getForeground(); + + paintText( g, menuItem, textRect, text, mnemonicIndex, menuItem.getFont(), + foreground, isUnderlineSelection() ? foreground : selectionForeground, disabledForeground ); + } + + protected void paintAccelerator( Graphics g, Rectangle accelRect, String accelText, + Color foreground, Color selectionForeground, Color disabledForeground ) + { + paintText( g, menuItem, accelRect, accelText, -1, acceleratorFont, + foreground, isUnderlineSelection() ? foreground : selectionForeground, disabledForeground ); + } + + protected void paintArrowIcon( Graphics g, Rectangle arrowRect, Icon arrowIcon ) { + paintIcon( g, menuItem, arrowIcon, arrowRect ); + } + + protected static void paintIcon( Graphics g, JMenuItem menuItem, Icon icon, Rectangle iconRect ) { + if( icon == null ) + return; + + // center because the real icon may be smaller than dimension in iconRect + int x = iconRect.x + centerOffset( iconRect.width, icon.getIconWidth() ); + int y = iconRect.y + centerOffset( iconRect.height, icon.getIconHeight() ); + + // paint + icon.paintIcon( menuItem, g, x, y ); + } + + protected static void paintText( Graphics g, JMenuItem menuItem, + Rectangle textRect, String text, int mnemonicIndex, Font font, + Color foreground, Color selectionForeground, Color disabledForeground ) + { + if( text == null || text.isEmpty() ) + return; + + FontMetrics fm = menuItem.getFontMetrics( font ); + + Font oldFont = g.getFont(); + g.setFont( font ); + g.setColor( !menuItem.isEnabled() + ? disabledForeground + : (isArmedOrSelected( menuItem ) + ? selectionForeground + : foreground) ); + + FlatUIUtils.drawStringUnderlineCharAt( menuItem, g, text, mnemonicIndex, + textRect.x, textRect.y + fm.getAscent() ); + + g.setFont( oldFont ); + } + + protected static void paintHTMLText( Graphics g, JMenuItem menuItem, + Rectangle textRect, View htmlView, Color selectionForeground ) + { + if( isArmedOrSelected( menuItem ) && selectionForeground != null ) + g = new GraphicsProxyWithTextColor( (Graphics2D) g, selectionForeground ); + + htmlView.paint( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ), textRect ); + } + + protected static boolean isArmedOrSelected( JMenuItem menuItem ) { + return menuItem.isArmed() || (menuItem instanceof JMenu && menuItem.isSelected()); + } + + protected static boolean isTopLevelMenu( JMenuItem menuItem ) { + return menuItem instanceof JMenu && ((JMenu)menuItem).isTopLevelMenu(); + } + + protected boolean isUnderlineSelection() { + return "underline".equals( UIManager.getString( "MenuItem.selectionType" ) ); + } + + private Icon getIconForPainting() { + Icon icon = menuItem.getIcon(); + + if( icon == null && checkIcon != null && !isTopLevelMenu( menuItem ) ) + return checkIcon; + + if( icon == null ) + return null; + + if( !menuItem.isEnabled() ) + return menuItem.getDisabledIcon(); + + if( menuItem.getModel().isPressed() && menuItem.isArmed() ) { + Icon pressedIcon = menuItem.getPressedIcon(); + if( pressedIcon != null ) + return pressedIcon; + } + + return icon; + } + + private Icon getIconForLayout() { + Icon icon = menuItem.getIcon(); + + if( isTopLevelMenu( menuItem ) ) + return (icon != null) ? new MinSizeIcon( icon ) : null; + + return new MinSizeIcon( (icon != null) ? icon : checkIcon ); + } + + private KeyStroke cachedAccelerator; + private String cachedAcceleratorText; + private boolean cachedAcceleratorLeftToRight; + + private String getAcceleratorText() { + KeyStroke accelerator = menuItem.getAccelerator(); + if( accelerator == null ) + return null; + + boolean leftToRight = menuItem.getComponentOrientation().isLeftToRight(); + + if( accelerator == cachedAccelerator && leftToRight == cachedAcceleratorLeftToRight ) + return cachedAcceleratorText; + + cachedAccelerator = accelerator; + cachedAcceleratorText = getTextForAccelerator( accelerator ); + cachedAcceleratorLeftToRight = leftToRight; + + return cachedAcceleratorText; + } + + protected String getTextForAccelerator( KeyStroke accelerator ) { + StringBuilder buf = new StringBuilder(); + boolean leftToRight = menuItem.getComponentOrientation().isLeftToRight(); + + // modifiers + int modifiers = accelerator.getModifiers(); + if( modifiers != 0 ) { + if( SystemInfo.isMacOS ) { + if( leftToRight ) + buf.append( getMacOSModifiersExText( modifiers, leftToRight ) ); + } else + buf.append( InputEvent.getModifiersExText( modifiers ) ).append( acceleratorDelimiter ); + } + + // key + int keyCode = accelerator.getKeyCode(); + if( keyCode != 0 ) + buf.append( KeyEvent.getKeyText( keyCode ) ); + else + buf.append( accelerator.getKeyChar() ); + + // modifiers if right-to-left on macOS + if( modifiers != 0 && !leftToRight && SystemInfo.isMacOS ) + buf.append( getMacOSModifiersExText( modifiers, leftToRight ) ); + + return buf.toString(); + } + + protected String getMacOSModifiersExText( int modifiers, boolean leftToRight ) { + StringBuilder buf = new StringBuilder(); + + if( (modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) + buf.append( controlGlyph ); + if( (modifiers & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_GRAPH_DOWN_MASK)) != 0 ) + buf.append( optionGlyph ); + if( (modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) + buf.append( shiftGlyph ); + if( (modifiers & InputEvent.META_DOWN_MASK) != 0 ) + buf.append( commandGlyph ); + + // reverse order for right-to-left + if( !leftToRight ) + buf.reverse(); + + return buf.toString(); + } + + private static final char + controlGlyph = 0x2303, + optionGlyph = 0x2325, + shiftGlyph = 0x21E7, + commandGlyph = 0x2318; + + //---- class MinSizeIcon -------------------------------------------------- + + private class MinSizeIcon + implements Icon + { + private final Icon delegate; + + MinSizeIcon( Icon delegate ) { + this.delegate = delegate; + } + + @Override + public int getIconWidth() { + int iconWidth = (delegate != null) ? delegate.getIconWidth() : 0; + return Math.max( iconWidth, scale( minimumIconSize.width ) ); + } + + @Override + public int getIconHeight() { + int iconHeight = (delegate != null) ? delegate.getIconHeight() : 0; + return Math.max( iconHeight, scale( minimumIconSize.height ) ); + } + + @Override + public void paintIcon( Component c, Graphics g, int x, int y ) { + } + } + + //---- class GraphicsProxyWithTextColor ----------------------------------- + + private static class GraphicsProxyWithTextColor + extends Graphics2DProxy + { + private final Color textColor; + + GraphicsProxyWithTextColor( Graphics2D delegate, Color textColor ) { + super( delegate ); + this.textColor = textColor; + } + + @Override + public void drawString( String str, int x, int y ) { + Paint oldPaint = getPaint(); + setPaint( textColor ); + super.drawString( str, x, y ); + setPaint( oldPaint ); + } + + @Override + public void drawString( String str, float x, float y ) { + Paint oldPaint = getPaint(); + setPaint( textColor ); + super.drawString( str, x, y ); + setPaint( oldPaint ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, int x, int y ) { + Paint oldPaint = getPaint(); + setPaint( textColor ); + super.drawString( iterator, x, y ); + setPaint( oldPaint ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, float x, float y ) { + Paint oldPaint = getPaint(); + setPaint( textColor ); + super.drawString( iterator, x, y ); + setPaint( oldPaint ); + } + + @Override + public void drawChars( char[] data, int offset, int length, int x, int y ) { + Paint oldPaint = getPaint(); + setPaint( textColor ); + super.drawChars( data, offset, length, x, y ); + setPaint( oldPaint ); + } + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemUI.java index 28c76999..78ae0d9e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemUI.java @@ -16,48 +16,47 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; -import java.awt.Color; -import java.awt.FontMetrics; +import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Rectangle; -import java.beans.PropertyChangeListener; -import javax.swing.ButtonModel; +import javax.swing.Icon; import javax.swing.JComponent; -import javax.swing.JMenu; -import javax.swing.JMenuItem; +import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicMenuItemUI; -import com.formdev.flatlaf.FlatLaf; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JMenuItem}. * * * - * @uiDefault MenuItem.font Font - * @uiDefault MenuItem.background Color - * @uiDefault MenuItem.foreground Color - * @uiDefault MenuItem.disabledForeground Color - * @uiDefault MenuItem.selectionBackground Color - * @uiDefault MenuItem.selectionForeground Color - * @uiDefault MenuItem.acceleratorForeground Color - * @uiDefault MenuItem.acceleratorSelectionForeground Color - * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font - * @uiDefault MenuItem.acceleratorDelimiter String - * @uiDefault MenuItem.border Border - * @uiDefault MenuItem.borderPainted boolean - * @uiDefault MenuItem.margin Insets - * @uiDefault MenuItem.arrowIcon Icon - * @uiDefault MenuItem.checkIcon Icon - * @uiDefault MenuItem.opaque boolean - * @uiDefault MenuItem.evenHeight boolean + * @uiDefault MenuItem.font Font + * @uiDefault MenuItem.background Color + * @uiDefault MenuItem.foreground Color + * @uiDefault MenuItem.disabledForeground Color + * @uiDefault MenuItem.selectionBackground Color + * @uiDefault MenuItem.selectionForeground Color + * @uiDefault MenuItem.acceleratorForeground Color + * @uiDefault MenuItem.acceleratorSelectionForeground Color + * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font + * @uiDefault MenuItem.acceleratorDelimiter String + * @uiDefault MenuItem.border Border + * @uiDefault MenuItem.borderPainted boolean + * @uiDefault MenuItem.margin Insets + * @uiDefault MenuItem.arrowIcon Icon + * @uiDefault MenuItem.checkIcon Icon + * @uiDefault MenuItem.opaque boolean + * + * + * + * @uiDefault MenuItem.iconTextGap int * * @author Karl Tauber */ public class FlatMenuItemUI extends BasicMenuItemUI { + private FlatMenuItemRenderer renderer; + public static ComponentUI createUI( JComponent c ) { return new FlatMenuItemUI(); } @@ -66,42 +65,30 @@ public class FlatMenuItemUI protected void installDefaults() { super.installDefaults(); - // scale - defaultTextIconGap = scale( defaultTextIconGap ); - } + LookAndFeel.installProperty( menuItem, "iconTextGap", FlatUIUtils.getUIInt( "MenuItem.iconTextGap", 4 ) ); - /** - * Scale defaultTextIconGap again if iconTextGap property has changed. - */ - @Override - protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { - PropertyChangeListener superListener = super.createPropertyChangeListener( c ); - return e -> { - superListener.propertyChange( e ); - if( e.getPropertyName() == "iconTextGap" ) - defaultTextIconGap = scale( defaultTextIconGap ); - }; + renderer = createRenderer(); } @Override - protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) { - paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground ); + protected void uninstallDefaults() { + super.uninstallDefaults(); + + renderer = null; } - public static void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, - String text, Color disabledForeground, Color selectionForeground ) - { - FontMetrics fm = menuItem.getFontMetrics( menuItem.getFont() ); - int mnemonicIndex = FlatLaf.isShowMnemonics() ? menuItem.getDisplayedMnemonicIndex() : -1; + protected FlatMenuItemRenderer createRenderer() { + return new FlatMenuItemRenderer( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); + } - ButtonModel model = menuItem.getModel(); - g.setColor( !model.isEnabled() - ? disabledForeground - : (model.isArmed() || (menuItem instanceof JMenu && model.isSelected()) - ? selectionForeground - : menuItem.getForeground()) ); + @Override + protected Dimension getPreferredMenuItemSize( JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap ) { + return renderer.getPreferredMenuItemSize(); + } - FlatUIUtils.drawStringUnderlineCharAt( menuItem, g, text, mnemonicIndex, - textRect.x, textRect.y + fm.getAscent() ); + @Override + public void paint( Graphics g, JComponent c ) { + renderer.paintMenuItem( g, selectionBackground, selectionForeground, disabledForeground, + acceleratorForeground, acceleratorSelectionForeground ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuUI.java index aa282875..503e3981 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuUI.java @@ -16,16 +16,17 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; import java.awt.Graphics; -import java.awt.Rectangle; import java.awt.event.MouseEvent; -import java.beans.PropertyChangeListener; import javax.swing.ButtonModel; +import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JMenu; import javax.swing.JMenuItem; +import javax.swing.LookAndFeel; import javax.swing.UIManager; import javax.swing.event.MouseInputListener; import javax.swing.plaf.ComponentUI; @@ -36,30 +37,30 @@ import javax.swing.plaf.basic.BasicMenuUI; * * * - * @uiDefault Menu.font Font - * @uiDefault Menu.background Color - * @uiDefault Menu.foreground Color - * @uiDefault Menu.disabledForeground Color - * @uiDefault Menu.selectionBackground Color - * @uiDefault Menu.selectionForeground Color - * @uiDefault Menu.acceleratorForeground Color - * @uiDefault Menu.acceleratorSelectionForeground Color - * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font - * @uiDefault MenuItem.acceleratorDelimiter String - * @uiDefault Menu.border Border - * @uiDefault Menu.borderPainted boolean - * @uiDefault Menu.margin Insets - * @uiDefault Menu.arrowIcon Icon - * @uiDefault Menu.checkIcon Icon - * @uiDefault Menu.opaque boolean - * @uiDefault Menu.evenHeight boolean - * @uiDefault Menu.crossMenuMnemonic boolean default is false - * @uiDefault Menu.useMenuBarBackgroundForTopLevel boolean default is false - * @uiDefault MenuBar.background Color used if Menu.useMenuBarBackgroundForTopLevel is true + * @uiDefault Menu.font Font + * @uiDefault Menu.background Color + * @uiDefault Menu.foreground Color + * @uiDefault Menu.disabledForeground Color + * @uiDefault Menu.selectionBackground Color + * @uiDefault Menu.selectionForeground Color + * @uiDefault Menu.acceleratorForeground Color + * @uiDefault Menu.acceleratorSelectionForeground Color + * @uiDefault MenuItem.acceleratorFont Font defaults to MenuItem.font + * @uiDefault MenuItem.acceleratorDelimiter String + * @uiDefault Menu.border Border + * @uiDefault Menu.borderPainted boolean + * @uiDefault Menu.margin Insets + * @uiDefault Menu.arrowIcon Icon + * @uiDefault Menu.checkIcon Icon + * @uiDefault Menu.opaque boolean + * @uiDefault Menu.crossMenuMnemonic boolean default is false + * @uiDefault Menu.useMenuBarBackgroundForTopLevel boolean default is false + * @uiDefault MenuBar.background Color used if Menu.useMenuBarBackgroundForTopLevel is true * * * - * @uiDefault MenuBar.hoverBackground Color + * @uiDefault MenuItem.iconTextGap int + * @uiDefault MenuBar.hoverBackground Color * * @author Karl Tauber */ @@ -67,6 +68,7 @@ public class FlatMenuUI extends BasicMenuUI { private Color hoverBackground; + private FlatMenuItemRenderer renderer; public static ComponentUI createUI( JComponent c ) { return new FlatMenuUI(); @@ -76,12 +78,12 @@ public class FlatMenuUI protected void installDefaults() { super.installDefaults(); + LookAndFeel.installProperty( menuItem, "iconTextGap", FlatUIUtils.getUIInt( "MenuItem.iconTextGap", 4 ) ); + menuItem.setRolloverEnabled( true ); hoverBackground = UIManager.getColor( "MenuBar.hoverBackground" ); - - // scale - defaultTextIconGap = scale( defaultTextIconGap ); + renderer = createRenderer(); } @Override @@ -89,19 +91,11 @@ public class FlatMenuUI super.uninstallDefaults(); hoverBackground = null; + renderer = null; } - /** - * Scale defaultTextIconGap again if iconTextGap property has changed. - */ - @Override - protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { - PropertyChangeListener superListener = super.createPropertyChangeListener( c ); - return e -> { - superListener.propertyChange( e ); - if( e.getPropertyName() == "iconTextGap" ) - defaultTextIconGap = scale( defaultTextIconGap ); - }; + protected FlatMenuItemRenderer createRenderer() { + return new FlatMenuRenderer( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); } @Override @@ -130,19 +124,45 @@ public class FlatMenuUI } @Override - protected void paintBackground( Graphics g, JMenuItem menuItem, Color bgColor ) { - ButtonModel model = menuItem.getModel(); - if( model.isArmed() || model.isSelected() ) { - super.paintBackground( g, menuItem, bgColor ); - } else if( model.isRollover() && model.isEnabled() && ((JMenu)menuItem).isTopLevelMenu() ) { - FlatUIUtils.setColor( g, hoverBackground, menuItem.getBackground() ); - g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() ); - } else - super.paintBackground( g, menuItem, bgColor ); + public Dimension getMinimumSize( JComponent c ) { + // avoid that top-level menus (in menu bar) are made smaller if horizontal space is rare + // same code is in BasicMenuUI since Java 10 + // see https://bugs.openjdk.java.net/browse/JDK-8178430 + return ((JMenu)menuItem).isTopLevelMenu() ? c.getPreferredSize() : null; } @Override - protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) { - FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground ); + protected Dimension getPreferredMenuItemSize( JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap ) { + return renderer.getPreferredMenuItemSize(); + } + + @Override + public void paint( Graphics g, JComponent c ) { + renderer.paintMenuItem( g, selectionBackground, selectionForeground, disabledForeground, + acceleratorForeground, acceleratorSelectionForeground ); + } + + //---- class FlatMenuRenderer --------------------------------------------- + + protected class FlatMenuRenderer + extends FlatMenuItemRenderer + { + protected FlatMenuRenderer( JMenuItem menuItem, Icon checkIcon, Icon arrowIcon, + Font acceleratorFont, String acceleratorDelimiter ) + { + super( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); + } + + @Override + protected void paintBackground( Graphics g, Color selectionBackground ) { + ButtonModel model = menuItem.getModel(); + if( model.isRollover() && !model.isArmed() && !model.isSelected() && + model.isEnabled() && ((JMenu)menuItem).isTopLevelMenu() ) + { + g.setColor( deriveBackground( hoverBackground ) ); + g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() ); + } else + super.paintBackground( g, selectionBackground ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPanelUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPanelUI.java index cc931df6..bbf15601 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPanelUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPanelUI.java @@ -35,11 +35,7 @@ import javax.swing.plaf.basic.BasicPanelUI; public class FlatPanelUI extends BasicPanelUI { - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatPanelUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatPanelUI.class, FlatPanelUI::new ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPasswordFieldUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPasswordFieldUI.java index abccabea..d4e615c3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPasswordFieldUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPasswordFieldUI.java @@ -16,10 +16,10 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.Toolkit; import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; @@ -34,7 +34,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicPasswordFieldUI; import javax.swing.text.Caret; import javax.swing.text.JTextComponent; -import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.HiDPIUtils; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JPasswordField}. @@ -57,11 +57,10 @@ import com.formdev.flatlaf.FlatClientProperties; * * * - * @uiDefault TextComponent.arc int - * @uiDefault Component.focusWidth int * @uiDefault Component.minimumWidth int * @uiDefault Component.isIntelliJTheme boolean * @uiDefault PasswordField.placeholderForeground Color + * @uiDefault PasswordField.showCapsLock boolean * @uiDefault PasswordField.capsLockIcon Icon * @uiDefault TextComponent.selectAllOnFocusPolicy String never, once (default) or always * @@ -70,11 +69,10 @@ import com.formdev.flatlaf.FlatClientProperties; public class FlatPasswordFieldUI extends BasicPasswordFieldUI { - protected int arc; - protected int focusWidth; protected int minimumWidth; protected boolean isIntelliJTheme; protected Color placeholderForeground; + protected boolean showCapsLock; protected Icon capsLockIcon; private FocusListener focusListener; @@ -89,16 +87,15 @@ public class FlatPasswordFieldUI super.installDefaults(); String prefix = getPropertyPrefix(); - arc = UIManager.getInt( "TextComponent.arc" ); - focusWidth = UIManager.getInt( "Component.focusWidth" ); minimumWidth = UIManager.getInt( "Component.minimumWidth" ); isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" ); placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" ); + showCapsLock = UIManager.getBoolean( "PasswordField.showCapsLock" ); capsLockIcon = UIManager.getIcon( "PasswordField.capsLockIcon" ); - LookAndFeel.installProperty( getComponent(), "opaque", focusWidth == 0 ); + LookAndFeel.installProperty( getComponent(), "opaque", false ); - MigLayoutVisualPadding.install( getComponent(), focusWidth ); + MigLayoutVisualPadding.install( getComponent() ); } @Override @@ -153,22 +150,24 @@ public class FlatPasswordFieldUI @Override protected void propertyChange( PropertyChangeEvent e ) { super.propertyChange( e ); - - if( FlatClientProperties.PLACEHOLDER_TEXT.equals( e.getPropertyName() ) ) - getComponent().repaint(); + FlatTextFieldUI.propertyChange( getComponent(), e ); } @Override protected void paintSafely( Graphics g ) { - FlatTextFieldUI.paintBackground( g, getComponent(), focusWidth, arc, isIntelliJTheme ); + FlatTextFieldUI.paintBackground( g, getComponent(), isIntelliJTheme ); FlatTextFieldUI.paintPlaceholder( g, getComponent(), placeholderForeground ); paintCapsLock( g ); - super.paintSafely( g ); + + super.paintSafely( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) ); } protected void paintCapsLock( Graphics g ) { + if( !showCapsLock ) + return; + JTextComponent c = getComponent(); - if( !c.isFocusOwner() || + if( !FlatUIUtils.isPermanentFocusOwner( c ) || !Toolkit.getDefaultToolkit().getLockingKeyState( KeyEvent.VK_CAPS_LOCK ) ) return; @@ -184,18 +183,11 @@ public class FlatPasswordFieldUI @Override public Dimension getPreferredSize( JComponent c ) { - return applyMinimumWidth( super.getPreferredSize( c ), c ); + return FlatTextFieldUI.applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth ); } @Override public Dimension getMinimumSize( JComponent c ) { - return applyMinimumWidth( super.getMinimumSize( c ), c ); - } - - private Dimension applyMinimumWidth( Dimension size, JComponent c ) { - int minimumWidth = FlatUIUtils.minimumWidth( getComponent(), this.minimumWidth ); - int focusWidth = (c.getBorder() instanceof FlatBorder) ? this.focusWidth : 0; - size.width = Math.max( size.width, scale( minimumWidth + (focusWidth * 2) ) ); - return size; + return FlatTextFieldUI.applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java new file mode 100644 index 00000000..bf1fcd24 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java @@ -0,0 +1,512 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.MouseInfo; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import javax.swing.JComponent; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JToolTip; +import javax.swing.JWindow; +import javax.swing.Popup; +import javax.swing.PopupFactory; +import javax.swing.RootPaneContainer; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.Border; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; + +/** + * A popup factory that adds drop shadows to popups on Windows. + * On macOS and Linux, heavy weight popups (without drop shadow) are produced and the + * operating system automatically adds drop shadows. + * + * @author Karl Tauber + */ +public class FlatPopupFactory + extends PopupFactory +{ + private Method java8getPopupMethod; + private Method java9getPopupMethod; + + @Override + public Popup getPopup( Component owner, Component contents, int x, int y ) + throws IllegalArgumentException + { + Point pt = fixToolTipLocation( owner, contents, x, y ); + if( pt != null ) { + x = pt.x; + y = pt.y; + } + + if( !isDropShadowPainted( owner, contents ) ) + return new NonFlashingPopup( getPopupForScreenOfOwner( owner, contents, x, y, false ), contents ); + + // macOS and Linux adds drop shadow to heavy weight popups + if( SystemInfo.isMacOS || SystemInfo.isLinux ) { + Popup popup = getPopupForScreenOfOwner( owner, contents, x, y, true ); + if( popup == null ) + popup = getPopupForScreenOfOwner( owner, contents, x, y, false ); + return new NonFlashingPopup( popup, contents ); + } + + // create drop shadow popup + return new DropShadowPopup( getPopupForScreenOfOwner( owner, contents, x, y, false ), owner, contents ); + } + + /** + * Creates a popup for the screen that the owner component is on. + *

+ * PopupFactory caches heavy weight popup windows and reuses them. + * On a dual screen setup, if the popup owner has moved from one screen to the other one, + * then the cached heavy weight popup window may be connected to the wrong screen. + * If the two screens use different scaling factors, then the popup location and size + * is scaled when the popup becomes visible, which shows the popup in the wrong location + * (or on wrong screen). The re-scaling is done in WWindowPeer.setBounds() (Java 9+). + *

+ * To fix this, dispose popup windows that are on wrong screen and get new popup. + *

+ * This is a workaround for https://bugs.openjdk.java.net/browse/JDK-8224608 + */ + private Popup getPopupForScreenOfOwner( Component owner, Component contents, int x, int y, boolean forceHeavyWeight ) + throws IllegalArgumentException + { + int count = 0; + + for(;;) { + // create new or get cached popup + Popup popup = forceHeavyWeight + ? getHeavyWeightPopup( owner, contents, x, y ) + : super.getPopup( owner, contents, x, y ); + + // get heavy weight popup window; is null for non-heavy weight popup + Window popupWindow = SwingUtilities.windowForComponent( contents ); + + // check whether heavy weight popup window is on same screen as owner component + if( popupWindow == null || + popupWindow.getGraphicsConfiguration() == owner.getGraphicsConfiguration() ) + return popup; + + // remove contents component from popup window + if( popupWindow instanceof JWindow ) + ((JWindow)popupWindow).getContentPane().removeAll(); + + // dispose unused popup + // (do not invoke popup.hide() because this would cache the popup window) + popupWindow.dispose(); + + // avoid endless loop (should newer happen; PopupFactory cache size is 5) + if( ++count > 10 ) + return popup; + } + } + + /** + * Shows the given popup and, if necessary, fixes the location of a heavy weight popup window. + *

+ * On a dual screen setup, where screens use different scale factors, it may happen + * that the window location changes when showing a heavy weight popup window. + * E.g. when opening an dialog on the secondary screen and making combobox popup visible. + *

+ * This is a workaround for https://bugs.openjdk.java.net/browse/JDK-8224608 + */ + private static void showPopupAndFixLocation( Popup popup, Window popupWindow ) { + if( popupWindow != null ) { + // remember location of heavy weight popup window + int x = popupWindow.getX(); + int y = popupWindow.getY(); + + popup.show(); + + // restore popup window location if it has changed + // (probably scaled when screens use different scale factors) + if( popupWindow.getX() != x || popupWindow.getY() != y ) + popupWindow.setLocation( x, y ); + } else + popup.show(); + } + + private boolean isDropShadowPainted( Component owner, Component contents ) { + Boolean b = isDropShadowPainted( owner ); + if( b != null ) + return b; + + b = isDropShadowPainted( contents ); + if( b != null ) + return b; + + return UIManager.getBoolean( "Popup.dropShadowPainted" ); + } + + private Boolean isDropShadowPainted( Component c ) { + if( !(c instanceof JComponent) ) + return null; + + Object value = ((JComponent)c).getClientProperty( FlatClientProperties.POPUP_DROP_SHADOW_PAINTED ); + return (value instanceof Boolean ) ? (Boolean) value : null; + } + + /** + * There is no API in Java 8 to force creation of heavy weight popups, + * but it is possible with reflection. Java 9 provides a new method. + * + * When changing FlatLaf system requirements to Java 9+, + * then this method can be replaced with: + * return getPopup( owner, contents, x, y, true ); + */ + private Popup getHeavyWeightPopup( Component owner, Component contents, int x, int y ) + throws IllegalArgumentException + { + try { + if( SystemInfo.isJava_9_orLater ) { + if( java9getPopupMethod == null ) { + java9getPopupMethod = PopupFactory.class.getDeclaredMethod( + "getPopup", Component.class, Component.class, int.class, int.class, boolean.class ); + } + return (Popup) java9getPopupMethod.invoke( this, owner, contents, x, y, true ); + } else { + // Java 8 + if( java8getPopupMethod == null ) { + java8getPopupMethod = PopupFactory.class.getDeclaredMethod( + "getPopup", Component.class, Component.class, int.class, int.class, int.class ); + java8getPopupMethod.setAccessible( true ); + } + return (Popup) java8getPopupMethod.invoke( this, owner, contents, x, y, /*HEAVY_WEIGHT_POPUP*/ 2 ); + } + } catch( NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException ex ) { + // ignore + return null; + } + } + + /** + * Usually ToolTipManager places a tooltip at (mouseLocation.x, mouseLocation.y + 20). + * In case that the tooltip would be partly outside of the screen, + * ToolTipManagerthe changes the location so that the entire tooltip fits on screen. + * But this can place the tooltip under the mouse location and hide the owner component. + *

+ * This method checks whether the current mouse location is within tooltip bounds + * 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 ) { + if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() ) + return null; + + Point mouseLocation = MouseInfo.getPointerInfo().getLocation(); + Dimension tipSize = contents.getPreferredSize(); + + // check whether mouse location is within tooltip bounds + Rectangle tipBounds = new Rectangle( x, y, tipSize.width, tipSize.height ); + if( !tipBounds.contains( mouseLocation ) ) + return null; + + // place tooltip above mouse location + return new Point( x, mouseLocation.y - tipSize.height - UIScale.scale( 20 ) ); + } + + private boolean wasInvokedFromToolTipManager() { + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + for( StackTraceElement stackTraceElement : stackTrace ) { + if( "javax.swing.ToolTipManager".equals( stackTraceElement.getClassName() ) && + "showTipWindow".equals( stackTraceElement.getMethodName() ) ) + return true; + } + return false; + } + + //---- class NonFlashingPopup --------------------------------------------- + + private class NonFlashingPopup + extends Popup + { + private Popup delegate; + private Component contents; + + // heavy weight + protected Window popupWindow; + private Color oldPopupWindowBackground; + + NonFlashingPopup( Popup delegate, Component contents ) { + this.delegate = delegate; + this.contents = contents; + + popupWindow = SwingUtilities.windowForComponent( contents ); + if( popupWindow != null ) { + // heavy weight popup + + // fix background flashing which may occur on some platforms + // (e.g. macOS and Linux) when using dark theme + oldPopupWindowBackground = popupWindow.getBackground(); + popupWindow.setBackground( contents.getBackground() ); + } + } + + @Override + public void show() { + if( delegate != null ) { + showPopupAndFixLocation( delegate, popupWindow ); + + // increase tooltip size if necessary because it may be too small on HiDPI screens + // https://bugs.openjdk.java.net/browse/JDK-8213535 + if( contents instanceof JToolTip ) { + Container parent = contents.getParent(); + if( parent instanceof JPanel ) { + Dimension prefSize = parent.getPreferredSize(); + if( !prefSize.equals( parent.getSize() ) ) { + Container panel = SwingUtilities.getAncestorOfClass( Panel.class, parent ); + if( panel != null ) + panel.setSize( prefSize ); // for medium weight popup + else + parent.setSize( prefSize ); // for light weight popup + } + } + } + } + } + + @Override + public void hide() { + if( delegate != null ) { + delegate.hide(); + delegate = null; + contents = null; + } + + if( popupWindow != null ) { + // restore background so that it can not affect other LaFs (when switching) + // because popup windows are cached and reused + popupWindow.setBackground( oldPopupWindowBackground ); + popupWindow = null; + } + } + } + + //---- class DropShadowPopup ---------------------------------------------- + + private class DropShadowPopup + extends NonFlashingPopup + { + private final Component owner; + + // light weight + private JComponent lightComp; + private Border oldBorder; + private boolean oldOpaque; + + // medium weight + private boolean mediumWeightShown; + private Panel mediumWeightPanel; + private JPanel dropShadowPanel; + private ComponentListener mediumPanelListener; + + // heavy weight + private Popup dropShadowDelegate; + private Window dropShadowWindow; + private Color oldDropShadowWindowBackground; + + DropShadowPopup( Popup delegate, Component owner, Component contents ) { + super( delegate, contents ); + this.owner = owner; + + Dimension size = contents.getPreferredSize(); + if( size.width <= 0 || size.height <= 0 ) + return; + + if( popupWindow != null ) { + // heavy weight popup + + // Since Java has a problem with sub-pixel text rendering on translucent + // windows, we can not make the popup window translucent for the drop shadow. + // (see https://bugs.openjdk.java.net/browse/JDK-8215980) + // The solution is to create a second translucent window that paints + // the drop shadow and is positioned behind the popup window. + + // create panel that paints the drop shadow + JPanel dropShadowPanel = new JPanel(); + dropShadowPanel.setBorder( createDropShadowBorder() ); + dropShadowPanel.setOpaque( false ); + + // set preferred size of drop shadow panel + Dimension prefSize = popupWindow.getPreferredSize(); + Insets insets = dropShadowPanel.getInsets(); + dropShadowPanel.setPreferredSize( new Dimension( + prefSize.width + insets.left + insets.right, + prefSize.height + insets.top + insets.bottom ) ); + + // create heavy weight popup for drop shadow + int x = popupWindow.getX() - insets.left; + int y = popupWindow.getY() - insets.top; + dropShadowDelegate = getPopupForScreenOfOwner( owner, dropShadowPanel, x, y, true ); + + // make drop shadow popup window translucent + dropShadowWindow = SwingUtilities.windowForComponent( dropShadowPanel ); + if( dropShadowWindow != null ) { + oldDropShadowWindowBackground = dropShadowWindow.getBackground(); + dropShadowWindow.setBackground( new Color( 0, true ) ); + } + } else { + mediumWeightPanel = (Panel) SwingUtilities.getAncestorOfClass( Panel.class, contents ); + if( mediumWeightPanel != null ) { + // medium weight popup + dropShadowPanel = new JPanel(); + dropShadowPanel.setBorder( createDropShadowBorder() ); + dropShadowPanel.setOpaque( false ); + dropShadowPanel.setSize( FlatUIUtils.addInsets( mediumWeightPanel.getSize(), dropShadowPanel.getInsets() ) ); + } else { + // light weight popup + Container p = contents.getParent(); + if( !(p instanceof JComponent) ) + return; + + lightComp = (JComponent) p; + oldBorder = lightComp.getBorder(); + oldOpaque = lightComp.isOpaque(); + lightComp.setBorder( createDropShadowBorder() ); + lightComp.setOpaque( false ); + lightComp.setSize( lightComp.getPreferredSize() ); + } + } + } + + private Border createDropShadowBorder() { + return new FlatDropShadowBorder( + UIManager.getColor( "Popup.dropShadowColor" ), + UIManager.getInsets( "Popup.dropShadowInsets" ), + FlatUIUtils.getUIFloat( "Popup.dropShadowOpacity", 0.5f ) ); + } + + @Override + public void show() { + if( dropShadowDelegate != null ) + showPopupAndFixLocation( dropShadowDelegate, dropShadowWindow ); + + if( mediumWeightPanel != null ) + showMediumWeightDropShadow(); + + super.show(); + + // fix location of light weight popup in case it has left or top drop shadow + if( lightComp != null ) { + Insets insets = lightComp.getInsets(); + if( insets.left != 0 || insets.top != 0 ) + lightComp.setLocation( lightComp.getX() - insets.left, lightComp.getY() - insets.top ); + } + } + + @Override + public void hide() { + if( dropShadowDelegate != null ) { + dropShadowDelegate.hide(); + dropShadowDelegate = null; + } + + if( mediumWeightPanel != null ) { + hideMediumWeightDropShadow(); + dropShadowPanel = null; + mediumWeightPanel = null; + } + + super.hide(); + + if( dropShadowWindow != null ) { + dropShadowWindow.setBackground( oldDropShadowWindowBackground ); + dropShadowWindow = null; + } + + if( lightComp != null ) { + lightComp.setBorder( oldBorder ); + lightComp.setOpaque( oldOpaque ); + lightComp = null; + } + } + + private void showMediumWeightDropShadow() { + if( mediumWeightShown ) + return; + + mediumWeightShown = true; + + Window window = SwingUtilities.windowForComponent( owner ); + if( window == null ) + return; + + if( !(window instanceof RootPaneContainer) ) + return; + + dropShadowPanel.setVisible( false ); + + JLayeredPane layeredPane = ((RootPaneContainer)window).getLayeredPane(); + layeredPane.add( dropShadowPanel, JLayeredPane.POPUP_LAYER, 0 ); + + mediumPanelListener = new ComponentListener() { + @Override + public void componentShown( ComponentEvent e ) { + if( dropShadowPanel != null ) + dropShadowPanel.setVisible( true ); + } + + @Override + public void componentHidden( ComponentEvent e ) { + if( dropShadowPanel != null ) + dropShadowPanel.setVisible( false ); + } + + @Override + public void componentMoved( ComponentEvent e ) { + if( dropShadowPanel != null && mediumWeightPanel != null ) { + Point location = mediumWeightPanel.getLocation(); + Insets insets = dropShadowPanel.getInsets(); + dropShadowPanel.setLocation( location.x - insets.left, location.y - insets.top ); + } + } + + @Override + public void componentResized( ComponentEvent e ) { + if( dropShadowPanel != null ) + dropShadowPanel.setSize( FlatUIUtils.addInsets( mediumWeightPanel.getSize(), dropShadowPanel.getInsets() ) ); + } + }; + mediumWeightPanel.addComponentListener( mediumPanelListener ); + } + + private void hideMediumWeightDropShadow() { + mediumWeightPanel.removeComponentListener( mediumPanelListener ); + + Container parent = dropShadowPanel.getParent(); + if( parent != null ) { + Rectangle bounds = dropShadowPanel.getBounds(); + parent.remove( dropShadowPanel ); + parent.repaint( bounds.x, bounds.y, bounds.width, bounds.height ); + } + } + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupMenuSeparatorUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupMenuSeparatorUI.java index 3bc8931b..a51fcd54 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupMenuSeparatorUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupMenuSeparatorUI.java @@ -38,12 +38,8 @@ import javax.swing.plaf.ComponentUI; public class FlatPopupMenuSeparatorUI extends FlatSeparatorUI { - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatPopupMenuSeparatorUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatPopupMenuSeparatorUI.class, FlatPopupMenuSeparatorUI::new ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java index 705725fd..4ac1efbd 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatProgressBarUI.java @@ -31,6 +31,7 @@ import javax.swing.LookAndFeel; import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicProgressBarUI; +import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.UIScale; /** @@ -194,6 +195,11 @@ public class FlatProgressBarUI } } + @Override + protected void paintString( Graphics g, int x, int y, int width, int height, int amountFull, Insets b ) { + super.paintString( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ), x, y, width, height, amountFull, b ); + } + @Override protected void setAnimationIndex( int newValue ) { super.setAnimationIndex( newValue ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonMenuItemUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonMenuItemUI.java index ef55d3ec..5f65012c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonMenuItemUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonMenuItemUI.java @@ -16,12 +16,11 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; +import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Rectangle; -import java.beans.PropertyChangeListener; +import javax.swing.Icon; import javax.swing.JComponent; -import javax.swing.JMenuItem; +import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI; @@ -46,13 +45,18 @@ import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI; * @uiDefault RadioButtonMenuItem.arrowIcon Icon * @uiDefault RadioButtonMenuItem.checkIcon Icon * @uiDefault RadioButtonMenuItem.opaque boolean - * @uiDefault RadioButtonMenuItem.evenHeight boolean + * + * + * + * @uiDefault MenuItem.iconTextGap int * * @author Karl Tauber */ public class FlatRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI { + private FlatMenuItemRenderer renderer; + public static ComponentUI createUI( JComponent c ) { return new FlatRadioButtonMenuItemUI(); } @@ -61,25 +65,30 @@ public class FlatRadioButtonMenuItemUI protected void installDefaults() { super.installDefaults(); - // scale - defaultTextIconGap = scale( defaultTextIconGap ); - } + LookAndFeel.installProperty( menuItem, "iconTextGap", FlatUIUtils.getUIInt( "MenuItem.iconTextGap", 4 ) ); - /** - * Scale defaultTextIconGap again if iconTextGap property has changed. - */ - @Override - protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { - PropertyChangeListener superListener = super.createPropertyChangeListener( c ); - return e -> { - superListener.propertyChange( e ); - if( e.getPropertyName() == "iconTextGap" ) - defaultTextIconGap = scale( defaultTextIconGap ); - }; + renderer = createRenderer(); } @Override - protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) { - FlatMenuItemUI.paintText( g, menuItem, textRect, text, disabledForeground, selectionForeground ); + protected void uninstallDefaults() { + super.uninstallDefaults(); + + renderer = null; + } + + protected FlatMenuItemRenderer createRenderer() { + return new FlatMenuItemRenderer( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); + } + + @Override + protected Dimension getPreferredMenuItemSize( JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap ) { + return renderer.getPreferredMenuItemSize(); + } + + @Override + public void paint( Graphics g, JComponent c ) { + renderer.paintMenuItem( g, selectionBackground, selectionForeground, disabledForeground, + acceleratorForeground, acceleratorSelectionForeground ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonUI.java index c7cdd4bf..e1329a9c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRadioButtonUI.java @@ -23,7 +23,6 @@ import java.awt.Graphics; import java.awt.Insets; import java.awt.Rectangle; import javax.swing.AbstractButton; -import javax.swing.CellRendererPane; import javax.swing.JComponent; import javax.swing.LookAndFeel; import javax.swing.UIManager; @@ -61,12 +60,8 @@ public class FlatRadioButtonUI private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatRadioButtonUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatRadioButtonUI.class, FlatRadioButtonUI::new ); } @Override @@ -122,11 +117,10 @@ public class FlatRadioButtonUI public void paint( Graphics g, JComponent c ) { // fill background even if not opaque if // - contentAreaFilled is true and - // - used as cell renderer (because of selection background) - // - or if background was explicitly set to a non-UIResource color + // - if background was explicitly set to a non-UIResource color if( !c.isOpaque() && ((AbstractButton)c).isContentAreaFilled() && - (c.getParent() instanceof CellRendererPane || !(c.getBackground() instanceof UIResource))) + !(c.getBackground() instanceof UIResource) ) { g.setColor( c.getBackground() ); g.fillRect( 0, 0, c.getWidth(), c.getHeight() ); @@ -155,7 +149,7 @@ public class FlatRadioButtonUI } } - super.paint( g, c ); + super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java index 1f473487..82098cda 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java @@ -16,23 +16,411 @@ package com.formdev.flatlaf.ui; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.LayoutManager; +import java.awt.LayoutManager2; +import java.awt.Window; +import java.beans.PropertyChangeEvent; +import java.util.function.Function; import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLayeredPane; +import javax.swing.JMenuBar; +import javax.swing.JRootPane; +import javax.swing.LookAndFeel; +import javax.swing.UIManager; +import javax.swing.border.Border; +import javax.swing.plaf.BorderUIResource; import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicRootPaneUI; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.HiDPIUtils; +import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JRootPane}. * + * + * + * @uiDefault RootPane.border Border + * @uiDefault RootPane.activeBorderColor Color + * @uiDefault RootPane.inactiveBorderColor Color + * @uiDefault TitlePane.borderColor Color optional + * + * + * + * @uiDefault RootPane.borderDragThickness int + * @uiDefault RootPane.cornerDragWidth int + * @uiDefault RootPane.honorFrameMinimumSizeOnResize boolean + * @uiDefault RootPane.honorDialogMinimumSizeOnResize boolean + * * @author Karl Tauber */ public class FlatRootPaneUI extends BasicRootPaneUI { - private static ComponentUI instance; + // check this field before using class JBRCustomDecorations to avoid unnecessary loading of that class + static final boolean canUseJBRCustomDecorations + = SystemInfo.isJetBrainsJVM_11_orLater && SystemInfo.isWindows_10_orLater; + + protected final Color borderColor = UIManager.getColor( "TitlePane.borderColor" ); + + protected JRootPane rootPane; + protected FlatTitlePane titlePane; + protected FlatWindowResizer windowResizer; + + private LayoutManager oldLayout; public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatRootPaneUI(); - return instance; + return new FlatRootPaneUI(); + } + + @Override + public void installUI( JComponent c ) { + super.installUI( c ); + + rootPane = (JRootPane) c; + + if( rootPane.getWindowDecorationStyle() != JRootPane.NONE ) + installClientDecorations(); + else + installBorder(); + + if( canUseJBRCustomDecorations ) + JBRCustomDecorations.install( rootPane ); + } + + protected void installBorder() { + if( borderColor != null ) { + Border b = rootPane.getBorder(); + if( b == null || b instanceof UIResource ) + rootPane.setBorder( new FlatWindowTitleBorder( borderColor ) ); + } + } + + @Override + public void uninstallUI( JComponent c ) { + super.uninstallUI( c ); + + uninstallClientDecorations(); + rootPane = null; + } + + @Override + protected void installDefaults( JRootPane c ) { + super.installDefaults( c ); + + // Update background color of JFrame or JDialog parent to avoid bad border + // on HiDPI screens when switching from light to dark Laf. + // The background of JFrame is initialized in JFrame.frameInit() and + // the background of JDialog in JDialog.dialogInit(), + // but it was not updated when switching Laf. + Container parent = c.getParent(); + if( parent instanceof JFrame || parent instanceof JDialog ) { + Color background = parent.getBackground(); + if( background == null || background instanceof UIResource ) + parent.setBackground( UIManager.getColor( "control" ) ); + } + + // enable dark window appearance on macOS when running in JetBrains Runtime + if( SystemInfo.isJetBrainsJVM && SystemInfo.isMacOS_10_14_Mojave_orLater ) + c.putClientProperty( "jetbrains.awt.windowDarkAppearance", FlatLaf.isLafDark() ); + } + + protected void installClientDecorations() { + boolean isJBRSupported = canUseJBRCustomDecorations && JBRCustomDecorations.isSupported(); + + // install border + if( rootPane.getWindowDecorationStyle() != JRootPane.NONE && !isJBRSupported ) + LookAndFeel.installBorder( rootPane, "RootPane.border" ); + else + LookAndFeel.uninstallBorder( rootPane ); + + // install title pane + setTitlePane( createTitlePane() ); + + // install layout + oldLayout = rootPane.getLayout(); + rootPane.setLayout( createRootLayout() ); + + // install window resizer + if( !isJBRSupported ) + windowResizer = createWindowResizer(); + } + + protected void uninstallClientDecorations() { + LookAndFeel.uninstallBorder( rootPane ); + setTitlePane( null ); + + if( windowResizer != null ) { + windowResizer.uninstall(); + windowResizer = null; + } + + if( oldLayout != null ) { + rootPane.setLayout( oldLayout ); + oldLayout = null; + } + + if( rootPane.getWindowDecorationStyle() == JRootPane.NONE ) { + rootPane.revalidate(); + rootPane.repaint(); + } + } + + protected FlatRootLayout createRootLayout() { + return new FlatRootLayout(); + } + + protected FlatWindowResizer createWindowResizer() { + return new FlatWindowResizer.WindowResizer( rootPane ); + } + + protected FlatTitlePane createTitlePane() { + return new FlatTitlePane( rootPane ); + } + + // layer title pane under frame content layer to allow placing menu bar over title pane + protected final static Integer TITLE_PANE_LAYER = JLayeredPane.FRAME_CONTENT_LAYER - 1; + + protected void setTitlePane( FlatTitlePane newTitlePane ) { + JLayeredPane layeredPane = rootPane.getLayeredPane(); + + if( titlePane != null ) + layeredPane.remove( titlePane ); + + if( newTitlePane != null ) + layeredPane.add( newTitlePane, TITLE_PANE_LAYER ); + + titlePane = newTitlePane; + } + + @Override + public void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + + switch( e.getPropertyName() ) { + case "windowDecorationStyle": + uninstallClientDecorations(); + if( rootPane.getWindowDecorationStyle() != JRootPane.NONE ) + installClientDecorations(); + else + installBorder(); + break; + + case FlatClientProperties.MENU_BAR_EMBEDDED: + if( titlePane != null ) { + titlePane.menuBarChanged(); + rootPane.revalidate(); + rootPane.repaint(); + } + break; + } + } + + //---- class FlatRootLayout ----------------------------------------------- + + protected class FlatRootLayout + implements LayoutManager2 + { + @Override public void addLayoutComponent( String name, Component comp ) {} + @Override public void addLayoutComponent( Component comp, Object constraints ) {} + @Override public void removeLayoutComponent( Component comp ) {} + + @Override + public Dimension preferredLayoutSize( Container parent ) { + return computeLayoutSize( parent, c -> c.getPreferredSize() ); + } + + @Override + public Dimension minimumLayoutSize( Container parent ) { + return computeLayoutSize( parent, c -> c.getMinimumSize() ); + } + + @Override + public Dimension maximumLayoutSize( Container parent ) { + return new Dimension( Integer.MAX_VALUE, Integer.MAX_VALUE ); + } + + private Dimension computeLayoutSize( Container parent, Function getSizeFunc ) { + JRootPane rootPane = (JRootPane) parent; + + Dimension titlePaneSize = (titlePane != null) + ? getSizeFunc.apply( titlePane ) + : new Dimension(); + Dimension contentSize = (rootPane.getContentPane() != null) + ? getSizeFunc.apply( rootPane.getContentPane() ) + : rootPane.getSize(); + + int width = Math.max( titlePaneSize.width, contentSize.width ); + int height = titlePaneSize.height + contentSize.height; + if( titlePane == null || !titlePane.isMenuBarEmbedded() ) { + JMenuBar menuBar = rootPane.getJMenuBar(); + Dimension menuBarSize = (menuBar != null && menuBar.isVisible()) + ? getSizeFunc.apply( menuBar ) + : new Dimension(); + + width = Math.max( width, menuBarSize.width ); + height += menuBarSize.height; + } + + Insets insets = rootPane.getInsets(); + + return new Dimension( + width + insets.left + insets.right, + height + insets.top + insets.bottom ); + } + + @Override + public void layoutContainer( Container parent ) { + JRootPane rootPane = (JRootPane) parent; + + Insets insets = rootPane.getInsets(); + int x = insets.left; + int y = insets.top; + int width = rootPane.getWidth() - insets.left - insets.right; + int height = rootPane.getHeight() - insets.top - insets.bottom; + + if( rootPane.getLayeredPane() != null ) + rootPane.getLayeredPane().setBounds( x, y, width, height ); + if( rootPane.getGlassPane() != null ) + rootPane.getGlassPane().setBounds( x, y, width, height ); + + int nextY = 0; + if( titlePane != null ) { + Dimension prefSize = titlePane.getPreferredSize(); + titlePane.setBounds( 0, 0, width, prefSize.height ); + nextY += prefSize.height; + } + + JMenuBar menuBar = rootPane.getJMenuBar(); + if( menuBar != null && menuBar.isVisible() ) { + if( titlePane != null && titlePane.isMenuBarEmbedded() ) { + titlePane.validate(); + menuBar.setBounds( titlePane.getMenuBarBounds() ); + } else { + Dimension prefSize = menuBar.getPreferredSize(); + menuBar.setBounds( 0, nextY, width, prefSize.height ); + nextY += prefSize.height; + } + } + + Container contentPane = rootPane.getContentPane(); + if( contentPane != null ) + contentPane.setBounds( 0, nextY, width, Math.max( height - nextY, 0 ) ); + + if( titlePane != null ) + titlePane.menuBarLayouted(); + } + + @Override + public void invalidateLayout( Container parent ) { + if( titlePane != null ) + titlePane.menuBarChanged(); + } + + @Override + public float getLayoutAlignmentX( Container target ) { + return 0; + } + + @Override + public float getLayoutAlignmentY( Container target ) { + return 0; + } + } + + //---- class FlatWindowBorder --------------------------------------------- + + public static class FlatWindowBorder + extends BorderUIResource.EmptyBorderUIResource + { + protected final Color activeBorderColor = UIManager.getColor( "RootPane.activeBorderColor" ); + protected final Color inactiveBorderColor = UIManager.getColor( "RootPane.inactiveBorderColor" ); + protected final Color baseBorderColor = UIManager.getColor( "Panel.background" ); + + public FlatWindowBorder() { + super( 1, 1, 1, 1 ); + } + + @Override + public Insets getBorderInsets( Component c, Insets insets ) { + if( isWindowMaximized( c ) ) { + // hide border if window is maximized + insets.top = insets.left = insets.bottom = insets.right = 0; + return insets; + } else + return super.getBorderInsets( c, insets ); + } + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + if( isWindowMaximized( c ) ) + return; + + Container parent = c.getParent(); + boolean active = parent instanceof Window ? ((Window)parent).isActive() : false; + + g.setColor( FlatUIUtils.deriveColor( active ? activeBorderColor : inactiveBorderColor, baseBorderColor ) ); + HiDPIUtils.paintAtScale1x( (Graphics2D) g, x, y, width, height, this::paintImpl ); + } + + private void paintImpl( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + g.drawRect( x, y, width - 1, height - 1 ); + } + + protected boolean isWindowMaximized( Component c ) { + Container parent = c.getParent(); + return parent instanceof Frame + ? (((Frame)parent).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0 + : false; + } + } + + //---- class FlatWindowTitleBorder ---------------------------------------- + + private static class FlatWindowTitleBorder + extends BorderUIResource.EmptyBorderUIResource + { + private final Color borderColor; + + FlatWindowTitleBorder( Color borderColor ) { + super( 0, 0, 0, 0 ); + this.borderColor = borderColor; + } + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + if( showBorder( c ) ) { + float lineHeight = UIScale.scale( (float) 1 ); + FlatUIUtils.paintFilledRectangle( g, borderColor, x, y, width, lineHeight ); + } + } + + @Override + public Insets getBorderInsets( Component c, Insets insets ) { + insets.set( showBorder( c ) ? 1 : 0, 0, 0, 0 ); + return insets; + } + + private boolean showBorder( Component c ) { + Container parent = c.getParent(); + return + (parent instanceof JFrame && + (((JFrame)parent).getJMenuBar() == null || + !((JFrame)parent).getJMenuBar().isVisible())) || + parent instanceof JDialog; + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRoundBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRoundBorder.java index 0eced1f2..3703be9c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRoundBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRoundBorder.java @@ -16,7 +16,6 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Component; import javax.swing.UIManager; @@ -33,7 +32,11 @@ public class FlatRoundBorder protected final int arc = UIManager.getInt( "Component.arc" ); @Override - protected float getArc( Component c ) { - return scale( (float) arc ); + protected int getArc( Component c ) { + if( isCellEditor( c ) ) + return 0; + + Boolean roundRect = FlatUIUtils.isRoundRect( c ); + return roundRect != null ? (roundRect ? Short.MAX_VALUE : 0) : arc; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollBarUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollBarUI.java index feacfa2b..a54421fb 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollBarUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollBarUI.java @@ -19,6 +19,8 @@ package com.formdev.flatlaf.ui; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; import java.awt.Rectangle; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -28,6 +30,7 @@ import java.util.Objects; import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JComponent; +import javax.swing.JScrollBar; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; @@ -52,29 +55,49 @@ import com.formdev.flatlaf.util.UIScale; * * * - * @uiDefault ScrollBar.hoverTrackColor Color - * @uiDefault ScrollBar.hoverThumbColor Color + * @uiDefault ScrollBar.trackInsets Insets + * @uiDefault ScrollBar.thumbInsets Insets + * @uiDefault ScrollBar.trackArc int + * @uiDefault ScrollBar.thumbArc int + * @uiDefault ScrollBar.hoverTrackColor Color optional + * @uiDefault ScrollBar.hoverThumbColor Color optional + * @uiDefault ScrollBar.hoverThumbWithTrack boolean + * @uiDefault ScrollBar.pressedTrackColor Color optional + * @uiDefault ScrollBar.pressedThumbColor Color optional + * @uiDefault ScrollBar.pressedThumbWithTrack boolean * @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault ScrollBar.showButtons boolean * @uiDefault ScrollBar.buttonArrowColor Color * @uiDefault ScrollBar.buttonDisabledArrowColor Color + * @uiDefault ScrollBar.hoverButtonBackground Color optional + * @uiDefault ScrollBar.pressedButtonBackground Color optional * * @author Karl Tauber */ public class FlatScrollBarUI extends BasicScrollBarUI { + protected Insets trackInsets; + protected Insets thumbInsets; + protected int trackArc; + protected int thumbArc; protected Color hoverTrackColor; protected Color hoverThumbColor; + protected boolean hoverThumbWithTrack; + protected Color pressedTrackColor; + protected Color pressedThumbColor; + protected boolean pressedThumbWithTrack; protected boolean showButtons; protected String arrowType; protected Color buttonArrowColor; protected Color buttonDisabledArrowColor; + protected Color hoverButtonBackground; + protected Color pressedButtonBackground; private MouseAdapter hoverListener; - private boolean hoverTrack; - private boolean hoverThumb; + protected boolean hoverTrack; + protected boolean hoverThumb; public static ComponentUI createUI( JComponent c ) { return new FlatScrollBarUI(); @@ -102,24 +125,40 @@ public class FlatScrollBarUI protected void installDefaults() { super.installDefaults(); + trackInsets = UIManager.getInsets( "ScrollBar.trackInsets" ); + thumbInsets = UIManager.getInsets( "ScrollBar.thumbInsets" ); + trackArc = UIManager.getInt( "ScrollBar.trackArc" ); + thumbArc = UIManager.getInt( "ScrollBar.thumbArc" ); hoverTrackColor = UIManager.getColor( "ScrollBar.hoverTrackColor" ); hoverThumbColor = UIManager.getColor( "ScrollBar.hoverThumbColor" ); + hoverThumbWithTrack = UIManager.getBoolean( "ScrollBar.hoverThumbWithTrack" ); + pressedTrackColor = UIManager.getColor( "ScrollBar.pressedTrackColor" ); + pressedThumbColor = UIManager.getColor( "ScrollBar.pressedThumbColor" ); + pressedThumbWithTrack = UIManager.getBoolean( "ScrollBar.pressedThumbWithTrack" ); showButtons = UIManager.getBoolean( "ScrollBar.showButtons" ); arrowType = UIManager.getString( "Component.arrowType" ); buttonArrowColor = UIManager.getColor( "ScrollBar.buttonArrowColor" ); buttonDisabledArrowColor = UIManager.getColor( "ScrollBar.buttonDisabledArrowColor" ); + hoverButtonBackground = UIManager.getColor( "ScrollBar.hoverButtonBackground" ); + pressedButtonBackground = UIManager.getColor( "ScrollBar.pressedButtonBackground" ); } @Override protected void uninstallDefaults() { super.uninstallDefaults(); + trackInsets = null; + thumbInsets = null; hoverTrackColor = null; hoverThumbColor = null; + pressedTrackColor = null; + pressedThumbColor = null; buttonArrowColor = null; buttonDisabledArrowColor = null; + hoverButtonBackground = null; + pressedButtonBackground = null; } @Override @@ -159,50 +198,61 @@ public class FlatScrollBarUI @Override protected JButton createDecreaseButton( int orientation ) { - return createArrowButton( orientation ); + return new FlatScrollBarButton( orientation ); } @Override protected JButton createIncreaseButton( int orientation ) { - return createArrowButton( orientation ); + return new FlatScrollBarButton( orientation ); } - private JButton createArrowButton( int orientation ) { - FlatArrowButton button = new FlatArrowButton( orientation, - arrowType, buttonArrowColor, buttonDisabledArrowColor, null, hoverTrackColor ) - { - @Override - public Dimension getPreferredSize() { - if( isShowButtons() ) { - int w = UIScale.scale( scrollBarWidth ); - return new Dimension( w, w ); - } else - return new Dimension(); - } - - @Override - public Dimension getMinimumSize() { - return isShowButtons() ? super.getMinimumSize() : new Dimension(); - } - - @Override - public Dimension getMaximumSize() { - return isShowButtons() ? super.getMaximumSize() : new Dimension(); - } - }; - button.setArrowWidth( FlatArrowButton.DEFAULT_ARROW_WIDTH - 2 ); - button.setFocusable( false ); - button.setRequestFocusEnabled( false ); - return button; - } - - private boolean isShowButtons() { + protected boolean isShowButtons() { Object showButtons = scrollbar.getClientProperty( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS ); if( showButtons == null && scrollbar.getParent() instanceof JScrollPane ) showButtons = ((JScrollPane)scrollbar.getParent()).getClientProperty( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS ); return (showButtons != null) ? Objects.equals( showButtons, true ) : this.showButtons; } + @Override + public void paint( Graphics g, JComponent c ) { + FlatUIUtils.setRenderingHints( (Graphics2D) g ); + super.paint( g, c ); + } + + @Override + protected void paintTrack( Graphics g, JComponent c, Rectangle trackBounds ) { + g.setColor( getTrackColor( c, hoverTrack, isPressed && hoverTrack && !hoverThumb ) ); + paintTrackOrThumb( g, c, trackBounds, trackInsets, trackArc ); + } + + @Override + protected void paintThumb( Graphics g, JComponent c, Rectangle thumbBounds ) { + if( thumbBounds.isEmpty() || !scrollbar.isEnabled() ) + return; + + g.setColor( getThumbColor( c, hoverThumb || (hoverThumbWithTrack && hoverTrack), + isPressed && (hoverThumb || (pressedThumbWithTrack && hoverTrack)) ) ); + paintTrackOrThumb( g, c, thumbBounds, thumbInsets, thumbArc ); + } + + protected void paintTrackOrThumb( Graphics g, JComponent c, Rectangle bounds, Insets insets, int arc ) { + // rotate insets for horizontal orientation because they are given for vertical orientation + if( scrollbar.getOrientation() == JScrollBar.HORIZONTAL ) + insets = new Insets( insets.right, insets.top, insets.left, insets.bottom ); + + // subtract insets from bounds + bounds = FlatUIUtils.subtractInsets( bounds, UIScale.scale( insets ) ); + + if( arc <= 0 ) { + // paint rectangle + g.fillRect( bounds.x, bounds.y, bounds.width, bounds.height ); + } else { + // paint round rectangle + arc = Math.min( UIScale.scale( arc ), Math.min( bounds.width, bounds.height ) ); + g.fillRoundRect( bounds.x, bounds.y, bounds.width, bounds.height, arc, arc ); + } + } + @Override protected void paintDecreaseHighlight( Graphics g ) { // do not paint @@ -213,29 +263,33 @@ public class FlatScrollBarUI // do not paint } - @Override - protected void paintTrack( Graphics g, JComponent c, Rectangle trackBounds ) { - g.setColor( hoverTrack ? hoverTrackColor : trackColor ); - g.fillRect( trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height ); + protected Color getTrackColor( JComponent c, boolean hover, boolean pressed ) { + Color trackColor = FlatUIUtils.deriveColor( this.trackColor, c.getBackground() ); + return (pressed && pressedTrackColor != null) + ? FlatUIUtils.deriveColor( pressedTrackColor, trackColor ) + : ((hover && hoverTrackColor != null) + ? FlatUIUtils.deriveColor( hoverTrackColor, trackColor ) + : trackColor); } - @Override - protected void paintThumb( Graphics g, JComponent c, Rectangle thumbBounds ) { - if( thumbBounds.isEmpty() || !scrollbar.isEnabled() ) - return; - - g.setColor( hoverThumb ? hoverThumbColor : thumbColor ); - g.fillRect( thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height ); + protected Color getThumbColor( JComponent c, boolean hover, boolean pressed ) { + Color trackColor = FlatUIUtils.deriveColor( this.trackColor, c.getBackground() ); + Color thumbColor = FlatUIUtils.deriveColor( this.thumbColor, trackColor ); + return (pressed && pressedThumbColor != null) + ? FlatUIUtils.deriveColor( pressedThumbColor, thumbColor ) + : ((hover && hoverThumbColor != null) + ? FlatUIUtils.deriveColor( hoverThumbColor, thumbColor ) + : thumbColor); } @Override protected Dimension getMinimumThumbSize() { - return UIScale.scale( super.getMinimumThumbSize() ); + return UIScale.scale( FlatUIUtils.addInsets( super.getMinimumThumbSize(), thumbInsets ) ); } @Override protected Dimension getMaximumThumbSize() { - return UIScale.scale( super.getMaximumThumbSize() ); + return UIScale.scale( FlatUIUtils.addInsets( super.getMaximumThumbSize(), thumbInsets ) ); } //---- class ScrollBarHoverListener --------------------------------------- @@ -263,11 +317,14 @@ public class FlatScrollBarUI @Override public void mousePressed( MouseEvent e ) { isPressed = true; + repaint(); } @Override public void mouseReleased( MouseEvent e ) { isPressed = false; + repaint(); + update( e.getX(), e.getY() ); } @@ -286,4 +343,49 @@ public class FlatScrollBarUI scrollbar.repaint(); } } + + //---- class FlatScrollBarButton ------------------------------------------ + + protected class FlatScrollBarButton + extends FlatArrowButton + { + protected FlatScrollBarButton( int direction ) { + this( direction, arrowType, buttonArrowColor, buttonDisabledArrowColor, + null, hoverButtonBackground, pressedButtonBackground ); + } + + protected FlatScrollBarButton( int direction, String type, Color foreground, Color disabledForeground, + Color hoverForeground, Color hoverBackground, Color pressedBackground ) + { + super( direction, type, foreground, disabledForeground, hoverForeground, hoverBackground, pressedBackground ); + + setArrowWidth( FlatArrowButton.DEFAULT_ARROW_WIDTH - 2 ); + setFocusable( false ); + setRequestFocusEnabled( false ); + } + + @Override + protected Color deriveBackground( Color background ) { + return FlatUIUtils.deriveColor( background, scrollbar.getBackground() ); + } + + @Override + public Dimension getPreferredSize() { + if( isShowButtons() ) { + int w = UIScale.scale( scrollBarWidth ); + return new Dimension( w, w ); + } else + return new Dimension(); + } + + @Override + public Dimension getMinimumSize() { + return isShowButtons() ? super.getMinimumSize() : new Dimension(); + } + + @Override + public Dimension getMaximumSize() { + return isShowButtons() ? super.getMaximumSize() : new Dimension(); + } + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollPaneUI.java index 1a118dbb..13c3ea8c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollPaneUI.java @@ -83,7 +83,7 @@ public class FlatScrollPaneUI int focusWidth = UIManager.getInt( "Component.focusWidth" ); LookAndFeel.installProperty( c, "opaque", focusWidth == 0 ); - MigLayoutVisualPadding.install( scrollpane, focusWidth ); + MigLayoutVisualPadding.install( scrollpane ); } @Override @@ -114,10 +114,7 @@ public class FlatScrollPaneUI return new BasicScrollPaneUI.MouseWheelHandler() { @Override public void mouseWheelMoved( MouseWheelEvent e ) { - // Note: Getting UI value "ScrollPane.smoothScrolling" here to allow - // applications to turn smooth scrolling on or off at any time - // (e.g. in application options dialog). - if( UIManager.getBoolean( "ScrollPane.smoothScrolling" ) && + if( isSmoothScrollingEnabled() && scrollpane.isWheelScrollingEnabled() && e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL && e.getPreciseWheelRotation() != 0 && @@ -130,6 +127,17 @@ public class FlatScrollPaneUI }; } + protected boolean isSmoothScrollingEnabled() { + Object smoothScrolling = scrollpane.getClientProperty( FlatClientProperties.SCROLL_PANE_SMOOTH_SCROLLING ); + if( smoothScrolling instanceof Boolean ) + return (Boolean) smoothScrolling; + + // Note: Getting UI value "ScrollPane.smoothScrolling" here to allow + // applications to turn smooth scrolling on or off at any time + // (e.g. in application options dialog). + return UIManager.getBoolean( "ScrollPane.smoothScrolling" ); + } + private static final double EPSILON = 1e-5d; private void mouseWheelMovedSmooth( MouseWheelEvent e ) { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSeparatorUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSeparatorUI.java index 94031480..7ace822b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSeparatorUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSeparatorUI.java @@ -52,12 +52,8 @@ public class FlatSeparatorUI private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatSeparatorUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatSeparatorUI.class, FlatSeparatorUI::new ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java index 0e3fa2f9..9115a87e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java @@ -201,7 +201,7 @@ public class FlatSliderUI } if( coloredTrack != null ) { - FlatUIUtils.setColor( g, slider.hasFocus() ? focusColor : (hover ? hoverColor : thumbColor), thumbColor ); + g.setColor( FlatUIUtils.deriveColor( FlatUIUtils.isPermanentFocusOwner( slider ) ? focusColor : (hover ? hoverColor : thumbColor), thumbColor ) ); ((Graphics2D)g).fill( coloredTrack ); } @@ -211,10 +211,10 @@ public class FlatSliderUI @Override public void paintThumb( Graphics g ) { - FlatUIUtils.setColor( g, slider.isEnabled() - ? (slider.hasFocus() ? focusColor : (hover ? hoverColor : thumbColor)) + g.setColor( FlatUIUtils.deriveColor( slider.isEnabled() + ? (FlatUIUtils.isPermanentFocusOwner( slider ) ? focusColor : (hover ? hoverColor : thumbColor)) : disabledForeground, - thumbColor ); + thumbColor ) ); if( isRoundThumb() ) g.fillOval( thumbRect.x, thumbRect.y, thumbRect.width, thumbRect.height ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java index 8c0e20ee..44fb16da 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSpinnerUI.java @@ -40,6 +40,7 @@ import javax.swing.SwingConstants; import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicSpinnerUI; +import com.formdev.flatlaf.FlatClientProperties; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JSpinner}. @@ -56,9 +57,8 @@ import javax.swing.plaf.basic.BasicSpinnerUI; * * * - * @uiDefault Component.focusWidth int - * @uiDefault Component.arc int * @uiDefault Component.minimumWidth int + * @uiDefault Spinner.buttonStyle String button (default) or none * @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.isIntelliJTheme boolean * @uiDefault Component.borderColor Color @@ -78,9 +78,8 @@ public class FlatSpinnerUI { private Handler handler; - protected int focusWidth; - protected int arc; protected int minimumWidth; + protected String buttonStyle; protected String arrowType; protected boolean isIntelliJTheme; protected Color borderColor; @@ -103,9 +102,8 @@ public class FlatSpinnerUI LookAndFeel.installProperty( spinner, "opaque", false ); - focusWidth = UIManager.getInt( "Component.focusWidth" ); - arc = UIManager.getInt( "Component.arc" ); minimumWidth = UIManager.getInt( "Component.minimumWidth" ); + buttonStyle = UIManager.getString( "Spinner.buttonStyle" ); arrowType = UIManager.getString( "Component.arrowType" ); isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" ); borderColor = UIManager.getColor( "Component.borderColor" ); @@ -121,7 +119,7 @@ public class FlatSpinnerUI // scale padding = scale( padding ); - MigLayoutVisualPadding.install( spinner, focusWidth ); + MigLayoutVisualPadding.install( spinner ); } @Override @@ -146,6 +144,7 @@ public class FlatSpinnerUI super.installListeners(); addEditorFocusListener( spinner.getEditor() ); + spinner.addFocusListener( getHandler() ); spinner.addPropertyChangeListener( getHandler() ); } @@ -154,6 +153,7 @@ public class FlatSpinnerUI super.uninstallListeners(); removeEditorFocusListener( spinner.getEditor() ); + spinner.removeFocusListener( getHandler() ); spinner.removePropertyChangeListener( getHandler() ); handler = null; @@ -206,17 +206,27 @@ public class FlatSpinnerUI // use non-UIResource colors because when SwingUtilities.updateComponentTreeUI() // is used, then the text field is updated after the spinner and the // colors are again replaced with default colors - textField.setForeground( FlatUIUtils.nonUIResource( spinner.getForeground() ) ); - textField.setDisabledTextColor( FlatUIUtils.nonUIResource( disabledForeground ) ); + textField.setForeground( FlatUIUtils.nonUIResource( getForeground( true ) ) ); + textField.setDisabledTextColor( FlatUIUtils.nonUIResource( getForeground( false ) ) ); } } - private JTextField getEditorTextField( JComponent editor ) { + private static JTextField getEditorTextField( JComponent editor ) { return editor instanceof JSpinner.DefaultEditor ? ((JSpinner.DefaultEditor)editor).getTextField() : null; } + protected Color getBackground( boolean enabled ) { + return enabled + ? spinner.getBackground() + : (isIntelliJTheme ? FlatUIUtils.getParentBackground( spinner ) : disabledBackground); + } + + protected Color getForeground( boolean enabled ) { + return enabled ? spinner.getForeground() : disabledForeground; + } + @Override protected LayoutManager createLayout() { return getHandler(); @@ -246,8 +256,11 @@ public class FlatSpinnerUI @Override public void update( Graphics g, JComponent c ) { + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + float arc = FlatUIUtils.getBorderArc( c ); + // fill background if opaque to avoid garbage if user sets opaque to true - if( c.isOpaque() && (focusWidth > 0 || arc != 0) ) + if( c.isOpaque() && (focusWidth > 0 || arc > 0) ) FlatUIUtils.paintParentBackground( g, c ); Graphics2D g2 = (Graphics2D) g; @@ -255,37 +268,39 @@ public class FlatSpinnerUI int width = c.getWidth(); int height = c.getHeight(); - float focusWidth = (c.getBorder() instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0; - float arc = (c.getBorder() instanceof FlatRoundBorder) ? scale( (float) this.arc ) : 0; - Component nextButton = getHandler().nextButton; - int arrowX = nextButton.getX(); - int arrowWidth = nextButton.getWidth(); boolean enabled = spinner.isEnabled(); - boolean isLeftToRight = spinner.getComponentOrientation().isLeftToRight(); // paint background - g2.setColor( enabled - ? c.getBackground() - : (isIntelliJTheme ? FlatUIUtils.getParentBackground( c ) : disabledBackground) ); + g2.setColor( getBackground( enabled ) ); FlatUIUtils.paintComponentBackground( g2, 0, 0, width, height, focusWidth, arc ); - // paint arrow buttons background - if( enabled ) { - g2.setColor( buttonBackground ); - Shape oldClip = g2.getClip(); - if( isLeftToRight ) - g2.clipRect( arrowX, 0, width - arrowX, height ); - else - g2.clipRect( 0, 0, arrowX + arrowWidth, height ); - FlatUIUtils.paintComponentBackground( g2, 0, 0, width, height, focusWidth, arc ); - g2.setClip( oldClip ); - } + // paint button background and separator + boolean paintButton = !"none".equals( buttonStyle ); + Handler handler = getHandler(); + if( paintButton && (handler.nextButton != null || handler.previousButton != null) ) { + Component button = (handler.nextButton != null) ? handler.nextButton : handler.previousButton; + int arrowX = button.getX(); + int arrowWidth = button.getWidth(); + boolean isLeftToRight = spinner.getComponentOrientation().isLeftToRight(); - // paint vertical line between value and arrow buttons - g2.setColor( enabled ? borderColor : disabledBorderColor ); - float lw = scale( 1f ); - float lx = isLeftToRight ? arrowX : arrowX + arrowWidth - lw; - g2.fill( new Rectangle2D.Float( lx, focusWidth, lw, height - 1 - (focusWidth * 2) ) ); + // paint arrow buttons background + if( enabled ) { + g2.setColor( buttonBackground ); + Shape oldClip = g2.getClip(); + if( isLeftToRight ) + g2.clipRect( arrowX, 0, width - arrowX, height ); + else + g2.clipRect( 0, 0, arrowX + arrowWidth, height ); + FlatUIUtils.paintComponentBackground( g2, 0, 0, width, height, focusWidth, arc ); + g2.setClip( oldClip ); + } + + // paint vertical line between value and arrow buttons + g2.setColor( enabled ? borderColor : disabledBorderColor ); + float lw = scale( 1f ); + float lx = isLeftToRight ? arrowX : arrowX + arrowWidth - lw; + g2.fill( new Rectangle2D.Float( lx, focusWidth, lw, height - 1 - (focusWidth * 2) ) ); + } paint( g, c ); } @@ -328,8 +343,9 @@ public class FlatSpinnerUI // the arrows width is the same as the inner height so that the arrows area is square int minimumWidth = FlatUIUtils.minimumWidth( spinner, FlatSpinnerUI.this.minimumWidth ); int innerHeight = editorSize.height + padding.top + padding.bottom; + float focusWidth = FlatUIUtils.getBorderFocusWidth( spinner ); return new Dimension( - Math.max( insets.left + insets.right + editorSize.width + padding.left + padding.right + innerHeight, scale( minimumWidth + (focusWidth * 2) ) ), + Math.max( insets.left + insets.right + editorSize.width + padding.left + padding.right + innerHeight, scale( minimumWidth ) + Math.round( focusWidth * 2 ) ), insets.top + insets.bottom + innerHeight ); } @@ -346,7 +362,7 @@ public class FlatSpinnerUI if( nextButton == null && previousButton == null ) { if( editor != null ) - editor.setBounds( r ); + editor.setBounds( FlatUIUtils.subtractInsets( r, padding ) ); return; } @@ -368,12 +384,14 @@ public class FlatSpinnerUI if( editor != null ) editor.setBounds( FlatUIUtils.subtractInsets( editorRect, padding ) ); - int nextHeight = Math.round( buttonsRect.height / 2f ); + int nextHeight = (buttonsRect.height / 2) + (buttonsRect.height % 2); // round up if( nextButton != null ) nextButton.setBounds( buttonsRect.x, buttonsRect.y, buttonsRect.width, nextHeight ); if( previousButton != null ) { - previousButton.setBounds( buttonsRect.x, buttonsRect.y + nextHeight, - buttonsRect.width, buttonsRect.height - nextHeight ); + // for precise layout of arrows, the "previous" button has the same height + // as the "next" button and may overlap on uneven buttonsRect.height + int previousY = buttonsRect.y + buttonsRect.height - nextHeight; + previousButton.setBounds( buttonsRect.x, previousY, buttonsRect.width, nextHeight ); } } @@ -382,6 +400,13 @@ public class FlatSpinnerUI @Override public void focusGained( FocusEvent e ) { spinner.repaint(); + + // if spinner gained focus, transfer it to the editor text field + if( e.getComponent() == spinner ) { + JTextField textField = getEditorTextField( spinner.getEditor() ); + if( textField != null ) + textField.requestFocusInWindow(); + } } @Override @@ -398,6 +423,14 @@ public class FlatSpinnerUI case "enabled": updateEditorColors(); break; + + case FlatClientProperties.COMPONENT_ROUND_RECT: + spinner.repaint(); + break; + + case FlatClientProperties.MINIMUM_WIDTH: + spinner.revalidate(); + break; } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java index 9ede9583..e8dbd7f9 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java @@ -17,11 +17,16 @@ package com.formdev.flatlaf.ui; import java.awt.Color; +import java.awt.Container; import java.awt.Cursor; +import java.awt.Insets; +import java.awt.event.MouseEvent; +import java.beans.PropertyChangeEvent; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JSplitPane; import javax.swing.SwingConstants; +import javax.swing.ToolTipManager; import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicSplitPaneDivider; @@ -54,8 +59,8 @@ public class FlatSplitPaneUI { protected String arrowType; private Boolean continuousLayout; - private Color oneTouchArrowColor; - private Color oneTouchHoverArrowColor; + protected Color oneTouchArrowColor; + protected Color oneTouchHoverArrowColor; public static ComponentUI createUI( JComponent c ) { return new FlatSplitPaneUI(); @@ -87,11 +92,13 @@ public class FlatSplitPaneUI //---- class FlatSplitPaneDivider ----------------------------------------- - private class FlatSplitPaneDivider + protected class FlatSplitPaneDivider extends BasicSplitPaneDivider { - public FlatSplitPaneDivider( BasicSplitPaneUI ui ) { + protected FlatSplitPaneDivider( BasicSplitPaneUI ui ) { super( ui ); + + setLayout( new FlatDividerLayout() ); } @Override @@ -109,16 +116,45 @@ public class FlatSplitPaneUI return new FlatOneTouchButton( false ); } + @Override + public void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + + switch( e.getPropertyName() ) { + case JSplitPane.DIVIDER_LOCATION_PROPERTY: + // necessary to show/hide one-touch buttons on expand/collapse + revalidate(); + break; + } + } + + protected boolean isLeftCollapsed() { + int location = splitPane.getDividerLocation(); + Insets insets = splitPane.getInsets(); + return (orientation == JSplitPane.VERTICAL_SPLIT) + ? location == insets.top + : location == insets.left; + } + + protected boolean isRightCollapsed() { + int location = splitPane.getDividerLocation(); + Insets insets = splitPane.getInsets(); + return (orientation == JSplitPane.VERTICAL_SPLIT) + ? location == (splitPane.getHeight() - getHeight() - insets.bottom) + : location == (splitPane.getWidth() - getWidth() - insets.right); + } + //---- class FlatOneTouchButton --------------------------------------- - private class FlatOneTouchButton + protected class FlatOneTouchButton extends FlatArrowButton { - private final boolean left; + protected final boolean left; - public FlatOneTouchButton( boolean left ) { + protected FlatOneTouchButton( boolean left ) { super( SwingConstants.NORTH, arrowType, oneTouchArrowColor, null, oneTouchHoverArrowColor, null ); setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) ); + ToolTipManager.sharedInstance().registerComponent( this ); this.left = left; } @@ -129,7 +165,67 @@ public class FlatSplitPaneUI ? (left ? SwingConstants.NORTH : SwingConstants.SOUTH) : (left ? SwingConstants.WEST : SwingConstants.EAST); } + + @Override + public String getToolTipText( MouseEvent e ) { + String key = (orientation == JSplitPane.VERTICAL_SPLIT) + ? (left + ? (isRightCollapsed() + ? "SplitPaneDivider.expandBottomToolTipText" + : "SplitPaneDivider.collapseTopToolTipText") + : (isLeftCollapsed() + ? "SplitPaneDivider.expandTopToolTipText" + : "SplitPaneDivider.collapseBottomToolTipText")) + : (left + ? (isRightCollapsed() + ? "SplitPaneDivider.expandRightToolTipText" + : "SplitPaneDivider.collapseLeftToolTipText") + : (isLeftCollapsed() + ? "SplitPaneDivider.expandLeftToolTipText" + : "SplitPaneDivider.collapseRightToolTipText")); + + // get text from client property + Object value = splitPane.getClientProperty( key ); + if( value instanceof String ) + return (String) value; + + // get text from bundle + return UIManager.getString( key, getLocale() ); + } + } + + //---- class FlatDividerLayout ---------------------------------------- + + protected class FlatDividerLayout + extends DividerLayout + { + @Override + public void layoutContainer( Container c ) { + super.layoutContainer( c ); + + if( leftButton == null || rightButton == null || !splitPane.isOneTouchExpandable() ) + return; + + // increase side of buttons, which makes them easier to hit by the user + // and avoids cut arrows at small divider sizes + int extraSize = UIScale.scale( 4 ); + if( orientation == JSplitPane.VERTICAL_SPLIT ) { + leftButton.setSize( leftButton.getWidth() + extraSize, leftButton.getHeight() ); + rightButton.setBounds( leftButton.getX() + leftButton.getWidth(), rightButton.getY(), + rightButton.getWidth() + extraSize, rightButton.getHeight() ); + } else { + leftButton.setSize( leftButton.getWidth(), leftButton.getHeight() + extraSize ); + rightButton.setBounds( rightButton.getX(), leftButton.getY() + leftButton.getHeight(), + rightButton.getWidth(), rightButton.getHeight() + extraSize ); + } + + // hide buttons if not applicable + boolean leftCollapsed = isLeftCollapsed(); + if( leftCollapsed ) + rightButton.setLocation( leftButton.getLocation() ); + leftButton.setVisible( !leftCollapsed ); + rightButton.setVisible( !isRightCollapsed() ); + } } } - } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java index b4861f2b..0e02555b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java @@ -18,35 +18,69 @@ package com.formdev.flatlaf.ui; import static com.formdev.flatlaf.util.UIScale.scale; import static com.formdev.flatlaf.FlatClientProperties.*; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; +import java.awt.Dimension; +import java.awt.EventQueue; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.KeyboardFocusManager; +import java.awt.LayoutManager; +import java.awt.Point; import java.awt.Rectangle; import java.awt.Shape; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.ContainerEvent; +import java.awt.event.ContainerListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collections; +import java.util.Locale; import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.IntConsumer; +import javax.swing.ButtonModel; +import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JComponent; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.JTabbedPane; +import javax.swing.JViewport; import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.Timer; import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicTabbedPaneUI; import javax.swing.text.View; import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.Animator; +import com.formdev.flatlaf.util.CubicBezierEasing; +import com.formdev.flatlaf.util.JavaCompatibility; import com.formdev.flatlaf.util.UIScale; /** @@ -63,7 +97,7 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault TabbedPane.shadow Color used for scroll arrows and cropped line * @uiDefault TabbedPane.textIconGap int * @uiDefault TabbedPane.tabInsets Insets - * @uiDefault TabbedPane.selectedTabPadInsets Insets + * @uiDefault TabbedPane.selectedTabPadInsets Insets unused * @uiDefault TabbedPane.tabAreaInsets Insets * @uiDefault TabbedPane.tabsOverlapBorder boolean * @uiDefault TabbedPane.tabRunOverlay int @@ -84,18 +118,41 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault TabbedPane.focusColor Color * @uiDefault TabbedPane.tabSeparatorColor Color optional; defaults to TabbedPane.contentAreaColor * @uiDefault TabbedPane.contentAreaColor Color + * @uiDefault TabbedPane.minimumTabWidth int optional + * @uiDefault TabbedPane.maximumTabWidth int optional * @uiDefault TabbedPane.tabHeight int * @uiDefault TabbedPane.tabSelectionHeight int * @uiDefault TabbedPane.contentSeparatorHeight int * @uiDefault TabbedPane.showTabSeparators boolean * @uiDefault TabbedPane.tabSeparatorsFullHeight boolean * @uiDefault TabbedPane.hasFullBorder boolean + * @uiDefault TabbedPane.hiddenTabsNavigation String moreTabsButton (default) or arrowButtons + * @uiDefault TabbedPane.tabAreaAlignment String leading (default), center, trailing or fill + * @uiDefault TabbedPane.tabWidthMode String preferred (default), equal or compact + * @uiDefault ScrollPane.smoothScrolling boolean + * @uiDefault TabbedPane.closeIcon Icon + * + * @uiDefault TabbedPane.moreTabsButtonToolTipText String * * @author Karl Tauber */ public class FlatTabbedPaneUI extends BasicTabbedPaneUI { + // hidden tabs navigation types + protected static final int MORE_TABS_BUTTON = 0; + protected static final int ARROW_BUTTONS = 1; + + // tab area alignment + protected static final int ALIGN_LEADING = 0; + protected static final int ALIGN_TRAILING = 1; + protected static final int ALIGN_CENTER = 2; + protected static final int ALIGN_FILL = 3; + + protected static final int WIDTH_MODE_PREFERRED = 0; + protected static final int WIDTH_MODE_EQUAL = 1; + protected static final int WIDTH_MODE_COMPACT = 2; + private static Set focusForwardTraversalKeys; private static Set focusBackwardTraversalKeys; @@ -109,13 +166,36 @@ public class FlatTabbedPaneUI protected Color tabSeparatorColor; protected Color contentAreaColor; + private int textIconGapUnscaled; + protected int minimumTabWidth; + protected int maximumTabWidth; protected int tabHeight; protected int tabSelectionHeight; protected int contentSeparatorHeight; protected boolean showTabSeparators; protected boolean tabSeparatorsFullHeight; protected boolean hasFullBorder; - protected boolean tabsOverlapBorder; + protected boolean tabsOpaque = true; + + private String hiddenTabsNavigationStr; + private String tabAreaAlignmentStr; + private String tabWidthModeStr; + protected Icon closeIcon; + + protected String moreTabsButtonToolTipText; + + protected JViewport tabViewport; + protected FlatWheelTabScroller wheelTabScroller; + + private JButton tabCloseButton; + private JButton moreTabsButton; + private Container leadingComponent; + private Container trailingComponent; + + private Handler handler; + private boolean blockRollover; + private boolean rolloverTabClose; + private boolean pressedTabClose; public static ComponentUI createUI( JComponent c ) { return new FlatTabbedPaneUI(); @@ -123,7 +203,27 @@ public class FlatTabbedPaneUI @Override protected void installDefaults() { - super.installDefaults(); + if( UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" ) ) { + // Force BasicTabbedPaneUI.tabsOverlapBorder to false, + // which is necessary for "more tabs" button to work correctly. + // + // If it would be true, class TabbedPaneScrollLayout would invoke TabbedPaneLayout.padSelectedTab(), + // which would modify rectangle of selected tab in a wrong way (for wrap tab layout policy). + // This would cause tab painting issues when scrolled and + // missing "more tabs" button if last tab is selected. + // + // All methods of BasicTabbedPaneUI that use tabsOverlapBorder (except + // the one method mentioned above) are overridden. + // + // This is normally not invoked because the default value for + // TabbedPane.tabsOverlapBorder is false in all FlatLaf themes. + // Anyway, 3rd party themes may have changed it. + // So make sure that it works anyway to avoid issues. + Object oldValue = UIManager.put( "TabbedPane.tabsOverlapBorder", false ); + super.installDefaults(); + UIManager.put( "TabbedPane.tabsOverlapBorder", oldValue ); + } else + super.installDefaults(); disabledForeground = UIManager.getColor( "TabbedPane.disabledForeground" ); selectedBackground = UIManager.getColor( "TabbedPane.selectedBackground" ); @@ -135,21 +235,26 @@ public class FlatTabbedPaneUI tabSeparatorColor = UIManager.getColor( "TabbedPane.tabSeparatorColor" ); contentAreaColor = UIManager.getColor( "TabbedPane.contentAreaColor" ); + textIconGapUnscaled = UIManager.getInt( "TabbedPane.textIconGap" ); + minimumTabWidth = UIManager.getInt( "TabbedPane.minimumTabWidth" ); + maximumTabWidth = UIManager.getInt( "TabbedPane.maximumTabWidth" ); tabHeight = UIManager.getInt( "TabbedPane.tabHeight" ); tabSelectionHeight = UIManager.getInt( "TabbedPane.tabSelectionHeight" ); contentSeparatorHeight = UIManager.getInt( "TabbedPane.contentSeparatorHeight" ); showTabSeparators = UIManager.getBoolean( "TabbedPane.showTabSeparators" ); tabSeparatorsFullHeight = UIManager.getBoolean( "TabbedPane.tabSeparatorsFullHeight" ); hasFullBorder = UIManager.getBoolean( "TabbedPane.hasFullBorder" ); - tabsOverlapBorder = UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" ); + tabsOpaque = UIManager.getBoolean( "TabbedPane.tabsOpaque" ); + hiddenTabsNavigationStr = UIManager.getString( "TabbedPane.hiddenTabsNavigation" ); + tabAreaAlignmentStr = UIManager.getString( "TabbedPane.tabAreaAlignment" ); + tabWidthModeStr = UIManager.getString( "TabbedPane.tabWidthMode" ); + closeIcon = UIManager.getIcon( "TabbedPane.closeIcon" ); + + Locale l = tabPane.getLocale(); + moreTabsButtonToolTipText = UIManager.getString( "TabbedPane.moreTabsButtonToolTipText", l ); // scale - textIconGap = scale( textIconGap ); - tabInsets = scale( tabInsets ); - selectedTabPadInsets = scale( selectedTabPadInsets ); - tabAreaInsets = scale( tabAreaInsets ); - tabHeight = scale( tabHeight ); - tabSelectionHeight = scale( tabSelectionHeight ); + textIconGap = scale( textIconGapUnscaled ); // replace focus forward/backward traversal keys with TAB/Shift+TAB because // the default also includes Ctrl+TAB/Ctrl+Shift+TAB, which we need to switch tabs @@ -184,39 +289,209 @@ public class FlatTabbedPaneUI tabSeparatorColor = null; contentAreaColor = null; + closeIcon = null; + MigLayoutVisualPadding.uninstall( tabPane ); } @Override - protected PropertyChangeListener createPropertyChangeListener() { - return new BasicTabbedPaneUI.PropertyChangeHandler() { - @Override - public void propertyChange( PropertyChangeEvent e ) { - super.propertyChange( e ); + protected void installComponents() { + super.installComponents(); - switch( e.getPropertyName() ) { - case TABBED_PANE_SHOW_TAB_SEPARATORS: - case TABBED_PANE_HAS_FULL_BORDER: - case TABBED_PANE_TAB_HEIGHT: - tabPane.revalidate(); - tabPane.repaint(); - break; + // create tab close button + tabCloseButton = new TabCloseButton(); + tabCloseButton.setVisible( false ); + tabPane.add( tabCloseButton ); + + // find scrollable tab viewport + tabViewport = null; + if( isScrollTabLayout() ) { + for( Component c : tabPane.getComponents() ) { + if( c instanceof JViewport && c.getClass().getName().equals( "javax.swing.plaf.basic.BasicTabbedPaneUI$ScrollableTabViewport" ) ) { + tabViewport = (JViewport) c; + break; } } - }; + } + + installHiddenTabsNavigation(); + installLeadingComponent(); + installTrailingComponent(); + } + + @Override + protected void uninstallComponents() { + // uninstall hidden tabs navigation before invoking super.uninstallComponents() for + // correct uninstallation of BasicTabbedPaneUI tab scroller support + uninstallHiddenTabsNavigation(); + uninstallLeadingComponent(); + uninstallTrailingComponent(); + + super.uninstallComponents(); + + if( tabCloseButton != null ) { + tabPane.remove( tabCloseButton ); + tabCloseButton = null; + } + + tabViewport = null; + } + + protected void installHiddenTabsNavigation() { + if( !isScrollTabLayout() || tabViewport == null ) + return; + + // At this point, BasicTabbedPaneUI already has installed + // TabbedPaneScrollLayout (in super.createLayoutManager()) and + // ScrollableTabSupport, ScrollableTabViewport, ScrollableTabPanel, etc + // (in super.installComponents()). + + // install own layout manager that delegates to original layout manager + tabPane.setLayout( createScrollLayoutManager( (TabbedPaneLayout) tabPane.getLayout() ) ); + + // create and add "more tabs" button + moreTabsButton = createMoreTabsButton(); + tabPane.add( moreTabsButton ); + } + + protected void uninstallHiddenTabsNavigation() { + // restore layout manager before invoking super.uninstallComponents() for + // correct uninstallation of BasicTabbedPaneUI tab scroller support + if( tabPane.getLayout() instanceof FlatTabbedPaneScrollLayout ) + tabPane.setLayout( ((FlatTabbedPaneScrollLayout)tabPane.getLayout()).delegate ); + + if( moreTabsButton != null ) { + tabPane.remove( moreTabsButton ); + moreTabsButton = null; + } + } + + protected void installLeadingComponent() { + Object c = tabPane.getClientProperty( TABBED_PANE_LEADING_COMPONENT ); + if( c instanceof Component ) { + leadingComponent = new ContainerUIResource( (Component) c ); + tabPane.add( leadingComponent ); + } + } + + protected void uninstallLeadingComponent() { + if( leadingComponent != null ) { + tabPane.remove( leadingComponent ); + leadingComponent = null; + } + } + + protected void installTrailingComponent() { + Object c = tabPane.getClientProperty( TABBED_PANE_TRAILING_COMPONENT ); + if( c instanceof Component ) { + trailingComponent = new ContainerUIResource( (Component) c ); + tabPane.add( trailingComponent ); + } + } + + protected void uninstallTrailingComponent() { + if( trailingComponent != null ) { + tabPane.remove( trailingComponent ); + trailingComponent = null; + } + } + + @Override + protected void installListeners() { + super.installListeners(); + + getHandler().installListeners(); + + if( tabViewport != null && (wheelTabScroller = createWheelTabScroller()) != null ) { + // ideally we would add the mouse listeners to the viewport, but then the + // mouse listener of the tabbed pane would not receive events while + // the mouse pointer is over the viewport + tabPane.addMouseWheelListener( wheelTabScroller ); + tabPane.addMouseMotionListener( wheelTabScroller ); + tabPane.addMouseListener( wheelTabScroller ); + } + } + + @Override + protected void uninstallListeners() { + super.uninstallListeners(); + + if( handler != null ) { + handler.uninstallListeners(); + handler = null; + } + + if( wheelTabScroller != null ) { + wheelTabScroller.uninstall(); + + tabPane.removeMouseWheelListener( wheelTabScroller ); + tabPane.removeMouseMotionListener( wheelTabScroller ); + tabPane.removeMouseListener( wheelTabScroller ); + wheelTabScroller = null; + } + } + + private Handler getHandler() { + if( handler == null ) + handler = new Handler(); + return handler; + } + + protected FlatWheelTabScroller createWheelTabScroller() { + return new FlatWheelTabScroller(); + } + + @Override + protected MouseListener createMouseListener() { + Handler handler = getHandler(); + handler.mouseDelegate = super.createMouseListener(); + return handler; + } + + @Override + protected PropertyChangeListener createPropertyChangeListener() { + Handler handler = getHandler(); + handler.propertyChangeDelegate = super.createPropertyChangeListener(); + return handler; + } + + @Override + protected ChangeListener createChangeListener() { + Handler handler = getHandler(); + handler.changeDelegate = super.createChangeListener(); + return handler; + } + + @Override + protected LayoutManager createLayoutManager() { + if( tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT ) + return new FlatTabbedPaneLayout(); + + return super.createLayoutManager(); + } + + protected LayoutManager createScrollLayoutManager( TabbedPaneLayout delegate ) { + return new FlatTabbedPaneScrollLayout( delegate ); + } + + protected JButton createMoreTabsButton() { + return new FlatMoreTabsButton(); } @Override protected JButton createScrollButton( int direction ) { - // this method is invoked before installDefaults(), so we can not use color fields here - return new FlatArrowButton( direction, UIManager.getString( "Component.arrowType" ), - UIManager.getColor( "TabbedPane.foreground" ), - UIManager.getColor( "TabbedPane.disabledForeground" ), null, - UIManager.getColor( "TabbedPane.hoverColor" ) ); + return new FlatScrollableTabButton( direction ); + } + + protected void setRolloverTab( int x, int y ) { + setRolloverTab( tabForCoordinate( tabPane, x, y ) ); } @Override protected void setRolloverTab( int index ) { + if( blockRollover ) + return; + int oldIndex = getRolloverTab(); super.setRolloverTab( index ); @@ -228,6 +503,30 @@ public class FlatTabbedPaneUI repaintTab( index ); } + protected boolean isRolloverTabClose() { + return rolloverTabClose; + } + + protected void setRolloverTabClose( boolean rollover ) { + if( rolloverTabClose == rollover ) + return; + + rolloverTabClose = rollover; + repaintTab( getRolloverTab() ); + } + + protected boolean isPressedTabClose() { + return pressedTabClose; + } + + protected void setPressedTabClose( boolean pressed ) { + if( pressedTabClose == pressed ) + return; + + pressedTabClose = pressed; + repaintTab( getRolloverTab() ); + } + private void repaintTab( int tabIndex ) { if( tabIndex < 0 || tabIndex >= tabPane.getTabCount() ) return; @@ -237,15 +536,149 @@ public class FlatTabbedPaneUI tabPane.repaint( r ); } + private boolean inCalculateEqual; + @Override protected int calculateTabWidth( int tabPlacement, int tabIndex, FontMetrics metrics ) { - return super.calculateTabWidth( tabPlacement, tabIndex, metrics ) - 3 /* was added by superclass */; + int tabWidthMode = getTabWidthMode(); + if( tabWidthMode == WIDTH_MODE_EQUAL && isHorizontalTabPlacement() && !inCalculateEqual ) { + inCalculateEqual = true; + try { + return calculateMaxTabWidth( tabPlacement ); + } finally { + inCalculateEqual = false; + } + } + + // update textIconGap before used in super class + textIconGap = scale( textIconGapUnscaled ); + + int tabWidth; + Icon icon; + if( tabWidthMode == WIDTH_MODE_COMPACT && + tabIndex != tabPane.getSelectedIndex() && + isHorizontalTabPlacement() && + tabPane.getTabComponentAt( tabIndex ) == null && + (icon = getIconForTab( tabIndex )) != null ) + { + Insets tabInsets = getTabInsets( tabPlacement, tabIndex ); + tabWidth = icon.getIconWidth() + tabInsets.left + tabInsets.right; + } else { + int iconPlacement = clientPropertyInt( tabPane, TABBED_PANE_TAB_ICON_PLACEMENT, LEADING ); + if( (iconPlacement == TOP || iconPlacement == BOTTOM) && + tabPane.getTabComponentAt( tabIndex ) == null && + (icon = getIconForTab( tabIndex )) != null ) + { + // TOP and BOTTOM icon placement + tabWidth = icon.getIconWidth(); + + View view = getTextViewForTab( tabIndex ); + if( view != null ) + tabWidth = Math.max( tabWidth, (int) view.getPreferredSpan( View.X_AXIS ) ); + else { + String title = tabPane.getTitleAt( tabIndex ); + if( title != null ) + tabWidth = Math.max( tabWidth, metrics.stringWidth( title ) ); + } + + Insets tabInsets = getTabInsets( tabPlacement, tabIndex ); + tabWidth += tabInsets.left + tabInsets.right; + } else + tabWidth = super.calculateTabWidth( tabPlacement, tabIndex, metrics ) - 3 /* was added by superclass */; + } + + // make tab wider if closable + if( isTabClosable( tabIndex ) ) + tabWidth += closeIcon.getIconWidth(); + + // apply minimum and maximum tab width + int min = getTabClientPropertyInt( tabIndex, TABBED_PANE_MINIMUM_TAB_WIDTH, minimumTabWidth ); + int max = getTabClientPropertyInt( tabIndex, TABBED_PANE_MAXIMUM_TAB_WIDTH, maximumTabWidth ); + if( min > 0 ) + tabWidth = Math.max( tabWidth, scale( min ) ); + if( max > 0 && tabPane.getTabComponentAt( tabIndex ) == null ) + tabWidth = Math.min( tabWidth, scale( max ) ); + + return tabWidth; } @Override protected int calculateTabHeight( int tabPlacement, int tabIndex, int fontHeight ) { - int tabHeight = clientPropertyInt( tabPane, TABBED_PANE_TAB_HEIGHT, this.tabHeight ); - return Math.max( tabHeight, super.calculateTabHeight( tabPlacement, tabIndex, fontHeight ) - 2 /* was added by superclass */ ); + int tabHeight; + + Icon icon; + int iconPlacement = clientPropertyInt( tabPane, TABBED_PANE_TAB_ICON_PLACEMENT, LEADING ); + if( (iconPlacement == TOP || iconPlacement == BOTTOM) && + tabPane.getTabComponentAt( tabIndex ) == null && + (icon = getIconForTab( tabIndex )) != null ) + { + // TOP and BOTTOM icon placement + tabHeight = icon.getIconHeight(); + + View view = getTextViewForTab( tabIndex ); + if( view != null ) + tabHeight += (int) view.getPreferredSpan( View.Y_AXIS ) + scale( textIconGapUnscaled ); + else if( tabPane.getTitleAt( tabIndex ) != null ) + tabHeight += fontHeight + scale( textIconGapUnscaled ); + + Insets tabInsets = getTabInsets( tabPlacement, tabIndex ); + tabHeight += tabInsets.top + tabInsets.bottom; + } else + tabHeight = super.calculateTabHeight( tabPlacement, tabIndex, fontHeight ) - 2 /* was added by superclass */; + + return Math.max( tabHeight, scale( clientPropertyInt( tabPane, TABBED_PANE_TAB_HEIGHT, this.tabHeight ) ) ); + } + + @Override + protected Insets getTabInsets( int tabPlacement, int tabIndex ) { + Object value = getTabClientProperty( tabIndex, TABBED_PANE_TAB_INSETS ); + return scale( (value instanceof Insets) + ? (Insets) value + : super.getTabInsets( tabPlacement, tabIndex ) ); + } + + @Override + protected Insets getSelectedTabPadInsets( int tabPlacement ) { + return new Insets( 0, 0, 0, 0 ); + } + + protected Insets getRealTabAreaInsets( int tabPlacement ) { + Insets currentTabAreaInsets = super.getTabAreaInsets( tabPlacement ); + Insets insets = (Insets) currentTabAreaInsets.clone(); + + Object value = tabPane.getClientProperty( TABBED_PANE_TAB_AREA_INSETS ); + if( value instanceof Insets ) + rotateInsets( (Insets) value, insets, tabPlacement ); + + // This is a "trick" to get rid of the cropped edge: + // super.getTabAreaInsets() returns private field BasicTabbedPaneUI.currentTabAreaInsets, + // which is also used to translate the origin of the cropped edge in + // BasicTabbedPaneUI.CroppedEdge.paintComponent(). + // Giving it large values clips painting of the cropped edge and makes it invisible. + currentTabAreaInsets.top = currentTabAreaInsets.left = -10000; + + // scale insets (before adding leading/trailing component sizes) + insets = scale( insets ); + + return insets; + } + + @Override + protected Insets getTabAreaInsets( int tabPlacement ) { + Insets insets = getRealTabAreaInsets( tabPlacement ); + + // increase insets for wrap layout if using leading/trailing components + if( tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT ) { + if( isHorizontalTabPlacement() ) { + insets.left += getLeadingPreferredWidth(); + insets.right += getTrailingPreferredWidth(); + } else { + insets.top += getLeadingPreferredHeight(); + insets.bottom += getTrailingPreferredHeight(); + } + } + + return insets; } /** @@ -255,6 +688,9 @@ public class FlatTabbedPaneUI */ @Override protected Insets getContentBorderInsets( int tabPlacement ) { + if( contentSeparatorHeight == 0 || !clientPropertyBoolean( tabPane, TABBED_PANE_SHOW_CONTENT_SEPARATOR, true ) ) + return new Insets( 0, 0, 0, 0 ); + boolean hasFullBorder = clientPropertyBoolean( tabPane, TABBED_PANE_HAS_FULL_BORDER, this.hasFullBorder ); int sh = scale( contentSeparatorHeight ); Insets insets = hasFullBorder ? new Insets( sh, sh, sh, sh ) : new Insets( sh, 0, 0, 0 ); @@ -266,6 +702,10 @@ public class FlatTabbedPaneUI @Override protected int getTabLabelShiftX( int tabPlacement, int tabIndex, boolean isSelected ) { + if( isTabClosable( tabIndex ) ) { + int shift = closeIcon.getIconWidth() / 2; + return isLeftToRight() ? -shift : shift; + } return 0; } @@ -281,6 +721,75 @@ public class FlatTabbedPaneUI super.update( g, c ); } + @Override + public void paint( Graphics g, JComponent c ) { + ensureCurrentLayout(); + + int tabPlacement = tabPane.getTabPlacement(); + int selectedIndex = tabPane.getSelectedIndex(); + + paintContentBorder( g, tabPlacement, selectedIndex ); + + if( !isScrollTabLayout() ) + paintTabArea( g, tabPlacement, selectedIndex ); + } + + @Override + protected void paintTab( Graphics g, int tabPlacement, Rectangle[] rects, + int tabIndex, Rectangle iconRect, Rectangle textRect ) + { + Rectangle tabRect = rects[tabIndex]; + int x = tabRect.x; + int y = tabRect.y; + int w = tabRect.width; + int h = tabRect.height; + boolean isSelected = (tabIndex == tabPane.getSelectedIndex()); + + // paint background + if( tabsOpaque || tabPane.isOpaque() ) + paintTabBackground( g, tabPlacement, tabIndex, x, y, w, h, isSelected ); + + // paint border + paintTabBorder( g, tabPlacement, tabIndex, x, y, w, h, isSelected ); + + // paint tab close button + if( isTabClosable( tabIndex ) ) + paintTabCloseButton( g, tabIndex, x, y, w, h ); + + // paint selection indicator + if( isSelected ) + paintTabSelection( g, tabPlacement, x, y, w, h ); + + if( tabPane.getTabComponentAt( tabIndex ) != null ) + return; + + // layout title and icon + String title = tabPane.getTitleAt( tabIndex ); + Icon icon = getIconForTab( tabIndex ); + Font font = tabPane.getFont(); + FontMetrics metrics = tabPane.getFontMetrics( font ); + boolean isCompact = (icon != null && !isSelected && getTabWidthMode() == WIDTH_MODE_COMPACT && isHorizontalTabPlacement()); + if( isCompact ) + title = null; + String clippedTitle = layoutAndClipLabel( tabPlacement, metrics, tabIndex, title, icon, tabRect, iconRect, textRect, isSelected ); + + // special title clipping for scroll layout where title of last visible tab on right side may be truncated + if( tabViewport != null && (tabPlacement == TOP || tabPlacement == BOTTOM) ) { + Rectangle viewRect = tabViewport.getViewRect(); + viewRect.width -= 4; // subtract width of cropped edge + if( !viewRect.contains( textRect ) ) { + Rectangle r = viewRect.intersection( textRect ); + if( r.x > viewRect.x ) + clippedTitle = JavaCompatibility.getClippedString( null, metrics, title, r.width ); + } + } + + // paint title and icon + if( !isCompact ) + paintText( g, tabPlacement, font, metrics, tabIndex, clippedTitle, textRect, isSelected ); + paintIcon( g, tabPlacement, tabIndex, icon, iconRect, isSelected ); + } + @Override protected void paintText( Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected ) @@ -318,7 +827,7 @@ public class FlatTabbedPaneUI boolean enabled = tabPane.isEnabled(); g.setColor( enabled && tabPane.isEnabledAt( tabIndex ) && getRolloverTab() == tabIndex ? hoverColor - : (enabled && isSelected && tabPane.hasFocus() + : (enabled && isSelected && FlatUIUtils.isPermanentFocusOwner( tabPane ) ? focusColor : (selectedBackground != null && enabled && isSelected ? selectedBackground @@ -333,61 +842,44 @@ public class FlatTabbedPaneUI // paint tab separators if( clientPropertyBoolean( tabPane, TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ) && !isLastInRun( tabIndex ) ) - { - float sepWidth = UIScale.scale( 1f ); - float offset = tabSeparatorsFullHeight ? 0 : UIScale.scale( 5f ); - - g.setColor( (tabSeparatorColor != null) ? tabSeparatorColor : contentAreaColor ); - if( tabPlacement == LEFT || tabPlacement == RIGHT ) { - // paint tab separator at bottom side - ((Graphics2D)g).fill( new Rectangle2D.Float( x + offset, y + h - sepWidth, w - (offset * 2), sepWidth ) ); - } else if( tabPane.getComponentOrientation().isLeftToRight() ) { - // paint tab separator at right side - ((Graphics2D)g).fill( new Rectangle2D.Float( x + w - sepWidth, y + offset, sepWidth, h - (offset * 2) ) ); - } else { - // paint tab separator at left side - ((Graphics2D)g).fill( new Rectangle2D.Float( x, y + offset, sepWidth, h - (offset * 2) ) ); - } - } - - if( isSelected ) - paintTabSelection( g, tabPlacement, x, y, w, h ); + paintTabSeparator( g, tabPlacement, x, y, w, h ); } - protected void paintTabSelection( Graphics g, int tabPlacement, int x, int y, int w, int h ) { - // increase clip bounds in scroll-tab-layout to paint over the separator line - Rectangle clipBounds = isScrollTabLayout() ? g.getClipBounds() : null; - if( clipBounds != null ) { - Rectangle newClipBounds = new Rectangle( clipBounds ); - int contentSeparatorHeight = scale( this.contentSeparatorHeight ); - switch( tabPlacement ) { - case TOP: - default: - newClipBounds.height += contentSeparatorHeight; - break; + protected void paintTabCloseButton( Graphics g, int tabIndex, int x, int y, int w, int h ) { + // update state of tab close button + boolean rollover = (tabIndex == getRolloverTab()); + ButtonModel bm = tabCloseButton.getModel(); + bm.setRollover( rollover && isRolloverTabClose() ); + bm.setPressed( rollover && isPressedTabClose() ); - case BOTTOM: - newClipBounds.y -= contentSeparatorHeight; - newClipBounds.height += contentSeparatorHeight; - break; + // paint tab close icon + Rectangle tabCloseRect = getTabCloseBounds( tabIndex, x, y, w, h, calcRect ); + closeIcon.paintIcon( tabCloseButton, g, tabCloseRect.x, tabCloseRect.y ); + } - case LEFT: - newClipBounds.width += contentSeparatorHeight; - break; + protected void paintTabSeparator( Graphics g, int tabPlacement, int x, int y, int w, int h ) { + float sepWidth = UIScale.scale( 1f ); + float offset = tabSeparatorsFullHeight ? 0 : UIScale.scale( 5f ); - case RIGHT: - newClipBounds.x -= contentSeparatorHeight; - newClipBounds.width += contentSeparatorHeight; - break; - } - g.setClip( newClipBounds ); + g.setColor( (tabSeparatorColor != null) ? tabSeparatorColor : contentAreaColor ); + if( tabPlacement == LEFT || tabPlacement == RIGHT ) { + // paint tab separator at bottom side + ((Graphics2D)g).fill( new Rectangle2D.Float( x + offset, y + h - sepWidth, w - (offset * 2), sepWidth ) ); + } else if( isLeftToRight() ) { + // paint tab separator at right side + ((Graphics2D)g).fill( new Rectangle2D.Float( x + w - sepWidth, y + offset, sepWidth, h - (offset * 2) ) ); + } else { + // paint tab separator at left side + ((Graphics2D)g).fill( new Rectangle2D.Float( x, y + offset, sepWidth, h - (offset * 2) ) ); } + } + protected void paintTabSelection( Graphics g, int tabPlacement, int x, int y, int w, int h ) { g.setColor( tabPane.isEnabled() ? underlineColor : disabledUnderlineColor ); - Insets contentInsets = getContentBorderInsets( tabPlacement ); - // paint underline selection + Insets contentInsets = getContentBorderInsets( tabPlacement ); + int tabSelectionHeight = scale( this.tabSelectionHeight ); switch( tabPlacement ) { case TOP: default: @@ -408,21 +900,22 @@ public class FlatTabbedPaneUI g.fillRect( x - contentInsets.right, y, tabSelectionHeight, h ); break; } - - if( clipBounds != null ) - g.setClip( clipBounds ); } /** * Actually does nearly the same as super.paintContentBorder() but * - not using UIManager.getColor("TabbedPane.contentAreaColor") to be GUI builder friendly + * - tabsOverlapBorder is always true + * - paint full border (if enabled) * - not invoking paintContentBorder*Edge() methods * - repaint selection */ @Override protected void paintContentBorder( Graphics g, int tabPlacement, int selectedIndex ) { - if( tabPane.getTabCount() <= 0 ) - return; + if( tabPane.getTabCount() <= 0 || + contentSeparatorHeight == 0 || + !clientPropertyBoolean( tabPane, TABBED_PANE_SHOW_CONTENT_SEPARATOR, true ) ) + return; Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets( tabPlacement ); @@ -434,28 +927,28 @@ public class FlatTabbedPaneUI // remove tabs from bounds switch( tabPlacement ) { - case LEFT: - x += calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ); - if( tabsOverlapBorder ) - x -= tabAreaInsets.right; - w -= (x - insets.left); - break; - case RIGHT: - w -= calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ); - if( tabsOverlapBorder ) - w += tabAreaInsets.left; - break; - case BOTTOM: - h -= calculateTabAreaHeight( tabPlacement, runCount, maxTabHeight ); - if( tabsOverlapBorder ) - h += tabAreaInsets.top; - break; case TOP: default: y += calculateTabAreaHeight( tabPlacement, runCount, maxTabHeight ); - if( tabsOverlapBorder ) - y -= tabAreaInsets.bottom; + y -= tabAreaInsets.bottom; h -= (y - insets.top); + break; + + case BOTTOM: + h -= calculateTabAreaHeight( tabPlacement, runCount, maxTabHeight ); + h += tabAreaInsets.top; + break; + + case LEFT: + x += calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ); + x -= tabAreaInsets.right; + w -= (x - insets.left); + break; + + case RIGHT: + w -= calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ); + w += tabAreaInsets.left; + break; } // compute insets for separator or full border @@ -464,7 +957,7 @@ public class FlatTabbedPaneUI Insets ci = new Insets( 0, 0, 0, 0 ); rotateInsets( hasFullBorder ? new Insets( sh, sh, sh, sh ) : new Insets( sh, 0, 0, 0 ), ci, tabPlacement ); - // paint content area + // paint content separator or full border g.setColor( contentAreaColor ); Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); path.append( new Rectangle2D.Float( x, y, w, h ), false ); @@ -474,17 +967,20 @@ public class FlatTabbedPaneUI // repaint selection in scroll-tab-layout because it may be painted before // the content border was painted (from BasicTabbedPaneUI$ScrollableTabPanel) - if( isScrollTabLayout() && selectedIndex >= 0 ) { - Component scrollableTabViewport = findComponentByClassName( tabPane, - BasicTabbedPaneUI.class.getName() + "$ScrollableTabViewport" ); - if( scrollableTabViewport != null ) { - Rectangle tabRect = getTabBounds( tabPane, selectedIndex ); + if( isScrollTabLayout() && selectedIndex >= 0 && tabViewport != null ) { + Rectangle tabRect = getTabBounds( tabPane, selectedIndex ); - Shape oldClip = g.getClip(); - g.setClip( scrollableTabViewport.getBounds() ); - paintTabSelection( g, tabPlacement, tabRect.x, tabRect.y, tabRect.width, tabRect.height ); - g.setClip( oldClip ); - } + // clip to "scrolling sides" of viewport + // (left and right if horizontal, top and bottom if vertical) + Shape oldClip = g.getClip(); + Rectangle vr = tabViewport.getBounds(); + if( isHorizontalTabPlacement() ) + g.clipRect( vr.x, 0, vr.width, tabPane.getHeight() ); + else + g.clipRect( 0, vr.y, tabPane.getWidth(), vr.height ); + + paintTabSelection( g, tabPlacement, tabRect.x, tabRect.y, tabRect.width, tabRect.height ); + g.setClip( oldClip ); } } @@ -494,6 +990,144 @@ public class FlatTabbedPaneUI { } + protected String layoutAndClipLabel( int tabPlacement, FontMetrics metrics, int tabIndex, + String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected ) + { + // remove tab insets and space for close button from the tab rectangle + // to get correctly clipped title + tabRect = FlatUIUtils.subtractInsets( tabRect, getTabInsets( tabPlacement, tabIndex ) ); + if( isTabClosable( tabIndex ) ) { + tabRect.width -= closeIcon.getIconWidth(); + if( !isLeftToRight() ) + tabRect.x += closeIcon.getIconWidth(); + } + + // icon placement + int iconPlacement = clientPropertyInt( tabPane, TABBED_PANE_TAB_ICON_PLACEMENT, LEADING ); + int verticalTextPosition = CENTER; + int horizontalTextPosition = TRAILING; + switch( iconPlacement ) { + case TRAILING: horizontalTextPosition = LEADING; break; + case TOP: verticalTextPosition = BOTTOM; horizontalTextPosition = CENTER; break; + case BOTTOM: verticalTextPosition = TOP; horizontalTextPosition = CENTER; break; + } + + // reset rectangles + textRect.setBounds( 0, 0, 0, 0 ); + iconRect.setBounds( 0, 0, 0, 0 ); + + // temporary set "html" client property on tabbed pane, which is used by SwingUtilities.layoutCompoundLabel() + View view = getTextViewForTab( tabIndex ); + if( view != null ) + tabPane.putClientProperty( "html", view ); + + // layout label + String clippedTitle = SwingUtilities.layoutCompoundLabel( tabPane, metrics, title, icon, + CENTER, CENTER, verticalTextPosition, horizontalTextPosition, + tabRect, iconRect, textRect, scale( textIconGapUnscaled ) ); + + // remove temporary client property + tabPane.putClientProperty( "html", null ); + + return clippedTitle; + } + + @Override + public int tabForCoordinate( JTabbedPane pane, int x, int y ) { + if( moreTabsButton != null ) { + // convert x,y from JTabbedPane coordinate space to ScrollableTabPanel coordinate space + Point viewPosition = tabViewport.getViewPosition(); + x = x - tabViewport.getX() + viewPosition.x; + y = y - tabViewport.getY() + viewPosition.y; + + // check whether point is within viewport + if( !tabViewport.getViewRect().contains( x, y ) ) + return -1; + } + + return super.tabForCoordinate( pane, x, y ); + } + + @Override + protected Rectangle getTabBounds( int tabIndex, Rectangle dest ) { + if( moreTabsButton != null ) { + // copy tab bounds to dest + dest.setBounds( rects[tabIndex] ); + + // convert tab bounds to coordinate space of JTabbedPane + Point viewPosition = tabViewport.getViewPosition(); + dest.x = dest.x + tabViewport.getX() - viewPosition.x; + dest.y = dest.y + tabViewport.getY() - viewPosition.y; + return dest; + } else + return super.getTabBounds( tabIndex, dest ); + } + + protected Rectangle getTabCloseBounds( int tabIndex, int x, int y, int w, int h, Rectangle dest ) { + int iconWidth = closeIcon.getIconWidth(); + int iconHeight = closeIcon.getIconHeight(); + Insets tabInsets = getTabInsets( tabPane.getTabPlacement(), tabIndex ); + + // use one-third of right/left tab insets as gap between tab text and close button + dest.x = isLeftToRight() + ? (x + w - (tabInsets.right / 3 * 2) - iconWidth) + : (x + (tabInsets.left / 3 * 2)); + dest.y = y + (h - iconHeight) / 2; + dest.width = iconWidth; + dest.height = iconHeight; + return dest; + } + + protected Rectangle getTabCloseHitArea( int tabIndex ) { + Rectangle tabRect = getTabBounds( tabPane, tabIndex ); + Rectangle tabCloseRect = getTabCloseBounds( tabIndex, tabRect.x, tabRect.y, tabRect.width, tabRect.height, calcRect ); + return new Rectangle( tabCloseRect.x, tabRect.y, tabCloseRect.width, tabRect.height ); + } + + protected boolean isTabClosable( int tabIndex ) { + Object value = getTabClientProperty( tabIndex, TABBED_PANE_TAB_CLOSABLE ); + return (value instanceof Boolean) ? (boolean) value : false; + } + + @SuppressWarnings( { "unchecked" } ) + protected void closeTab( int tabIndex ) { + Object callback = getTabClientProperty( tabIndex, TABBED_PANE_TAB_CLOSE_CALLBACK ); + if( callback instanceof IntConsumer ) + ((IntConsumer)callback).accept( tabIndex ); + else if( callback instanceof BiConsumer ) + ((BiConsumer)callback).accept( tabPane, tabIndex ); + else { + throw new RuntimeException( "Missing tab close callback. " + + "Set client property 'JTabbedPane.tabCloseCallback' " + + "to a 'java.util.function.IntConsumer' " + + "or 'java.util.function.BiConsumer'" ); + } + } + + protected Object getTabClientProperty( int tabIndex, String key ) { + if( tabIndex < 0 ) + return null; + + Component c = tabPane.getComponentAt( tabIndex ); + if( c instanceof JComponent ) { + Object value = ((JComponent)c).getClientProperty( key ); + if( value != null ) + return value; + } + return tabPane.getClientProperty( key ); + } + + protected int getTabClientPropertyInt( int tabIndex, String key, int defaultValue ) { + Object value = getTabClientProperty( tabIndex, key ); + return (value instanceof Integer) ? (int) value : defaultValue; + } + + protected void ensureCurrentLayout() { + // since super.ensureCurrentLayout() is private, + // use super.getTabRunCount() as workaround + super.getTabRunCount( tabPane ); + } + private boolean isLastInRun( int tabIndex ) { int run = getRunForTab( tabPane.getTabCount(), tabIndex ); return lastTabInRun( tabPane.getTabCount(), run ) == tabIndex; @@ -503,17 +1137,1419 @@ public class FlatTabbedPaneUI return tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; } - private Component findComponentByClassName( Container c, String className ) { - for( Component child : c.getComponents() ) { - if( className.equals( child.getClass().getName() ) ) - return child; + private boolean isLeftToRight() { + return tabPane.getComponentOrientation().isLeftToRight(); + } - if( child instanceof Container ) { - Component c2 = findComponentByClassName( (Container) child, className ); - if( c2 != null ) - return c2; + protected boolean isHorizontalTabPlacement() { + int tabPlacement = tabPane.getTabPlacement(); + return tabPlacement == TOP || tabPlacement == BOTTOM; + } + + protected boolean isSmoothScrollingEnabled() { + if( !Animator.useAnimation() ) + return false; + + // Note: Getting UI value "ScrollPane.smoothScrolling" here to allow + // applications to turn smooth scrolling on or off at any time + // (e.g. in application options dialog). + return UIManager.getBoolean( "ScrollPane.smoothScrolling" ); + } + + protected int getHiddenTabsNavigation() { + String str = (String) tabPane.getClientProperty( TABBED_PANE_HIDDEN_TABS_NAVIGATION ); + if( str == null ) + str = hiddenTabsNavigationStr; + return parseHiddenTabsNavigation( str ); + } + + protected int getTabAreaAlignment() { + String str = (String) tabPane.getClientProperty( TABBED_PANE_TAB_AREA_ALIGNMENT ); + if( str == null ) + str = tabAreaAlignmentStr; + return parseTabAreaAlignment( str ); + } + + protected int getTabWidthMode() { + String str = (String) tabPane.getClientProperty( TABBED_PANE_TAB_WIDTH_MODE ); + if( str == null ) + str = tabWidthModeStr; + return parseTabWidthMode( str ); + } + + protected static int parseHiddenTabsNavigation( String str ) { + if( str == null ) + return MORE_TABS_BUTTON; + + switch( str ) { + default: + case TABBED_PANE_HIDDEN_TABS_NAVIGATION_MORE_TABS_BUTTON: return MORE_TABS_BUTTON; + case TABBED_PANE_HIDDEN_TABS_NAVIGATION_ARROW_BUTTONS: return ARROW_BUTTONS; + } + } + + protected static int parseTabAreaAlignment( String str ) { + if( str == null ) + return ALIGN_LEADING; + + switch( str ) { + default: + case TABBED_PANE_TAB_AREA_ALIGN_LEADING: return ALIGN_LEADING; + case TABBED_PANE_TAB_AREA_ALIGN_TRAILING: return ALIGN_TRAILING; + case TABBED_PANE_TAB_AREA_ALIGN_CENTER: return ALIGN_CENTER; + case TABBED_PANE_TAB_AREA_ALIGN_FILL: return ALIGN_FILL; + } + } + + protected static int parseTabWidthMode( String str ) { + if( str == null ) + return WIDTH_MODE_PREFERRED; + + switch( str ) { + default: + case TABBED_PANE_TAB_WIDTH_MODE_PREFERRED: return WIDTH_MODE_PREFERRED; + case TABBED_PANE_TAB_WIDTH_MODE_EQUAL: return WIDTH_MODE_EQUAL; + case TABBED_PANE_TAB_WIDTH_MODE_COMPACT: return WIDTH_MODE_COMPACT; + } + } + + private void runWithOriginalLayoutManager( Runnable runnable ) { + LayoutManager layout = tabPane.getLayout(); + if( layout instanceof FlatTabbedPaneScrollLayout ) { + // temporary change layout manager because the runnable may use + // BasicTabbedPaneUI.scrollableTabLayoutEnabled() + tabPane.setLayout( ((FlatTabbedPaneScrollLayout)layout).delegate ); + runnable.run(); + tabPane.setLayout( layout ); + } else + runnable.run(); + } + + protected void ensureSelectedTabIsVisibleLater() { + EventQueue.invokeLater( () -> { + ensureSelectedTabIsVisible(); + } ); + } + + protected void ensureSelectedTabIsVisible() { + if( tabPane == null || tabViewport == null ) + return; + + ensureCurrentLayout(); + + int selectedIndex = tabPane.getSelectedIndex(); + if( selectedIndex < 0 || selectedIndex >= rects.length ) + return; + + ((JComponent)tabViewport.getView()).scrollRectToVisible( (Rectangle) rects[selectedIndex].clone() ); + } + + private int getLeadingPreferredWidth() { + return (leadingComponent != null) ? leadingComponent.getPreferredSize().width : 0; + } + + private int getLeadingPreferredHeight() { + return (leadingComponent != null) ? leadingComponent.getPreferredSize().height : 0; + } + + private int getTrailingPreferredWidth() { + return (trailingComponent != null) ? trailingComponent.getPreferredSize().width : 0; + } + + private int getTrailingPreferredHeight() { + return (trailingComponent != null) ? trailingComponent.getPreferredSize().height : 0; + } + + private void shiftTabs( int sx, int sy ) { + if( sx == 0 && sy == 0 ) + return; + + for( int i = 0; i < rects.length; i++ ) { + // fix x location in rects + rects[i].x += sx; + rects[i].y += sy; + + // fix tab component location + Component c = tabPane.getTabComponentAt( i ); + if( c != null ) + c.setLocation( c.getX() + sx, c.getY() + sy ); + } + } + + private void stretchTabsWidth( int sw, boolean leftToRight ) { + int rsw = sw / rects.length; + int x = rects[0].x - (leftToRight ? 0 : rsw); + for( int i = 0; i < rects.length; i++ ) { + // fix tab component location + Component c = tabPane.getTabComponentAt( i ); + if( c != null ) + c.setLocation( x + (c.getX() - rects[i].x) + (rsw / 2), c.getY() ); + + // fix x location and width in rects + rects[i].x = x; + rects[i].width += rsw; + + if( leftToRight ) + x += rects[i].width; + else if( i + 1 < rects.length ) + x = rects[i].x - rects[i+1].width - rsw; + } + + // fix width of last tab + int diff = sw - (rsw * rects.length); + rects[rects.length-1].width += diff; + if( !leftToRight ) + rects[rects.length-1].x -= diff; + } + + private void stretchTabsHeight( int sh ) { + int rsh = sh / rects.length; + int y = rects[0].y; + for( int i = 0; i < rects.length; i++ ) { + // fix tab component location + Component c = tabPane.getTabComponentAt( i ); + if( c != null ) + c.setLocation( c.getX(), y + (c.getY() - rects[i].y) + (rsh / 2) ); + + // fix y location and height in rects + rects[i].y = y; + rects[i].height += rsh; + + y += rects[i].height; + } + + // fix height of last tab + rects[rects.length-1].height += (sh - (rsh * rects.length)); + } + + private int rectsTotalWidth( boolean leftToRight ) { + int last = rects.length - 1; + return leftToRight + ? (rects[last].x + rects[last].width) - rects[0].x + : (rects[0].x + rects[0].width) - rects[last].x; + } + + private int rectsTotalHeight() { + int last = rects.length - 1; + return (rects[last].y + rects[last].height) - rects[0].y; + } + + //---- class TabCloseButton ----------------------------------------------- + + private class TabCloseButton + extends JButton + implements UIResource + { + private TabCloseButton() { + } + } + + //---- class ContainerUIResource ------------------------------------------ + + private class ContainerUIResource + extends JPanel + implements UIResource + { + private ContainerUIResource( Component c ) { + super( new BorderLayout() ); + add( c ); + } + } + + //---- class FlatMoreTabsButton ------------------------------------------- + + protected class FlatMoreTabsButton + extends FlatArrowButton + implements ActionListener, PopupMenuListener + { + private boolean popupVisible; + + public FlatMoreTabsButton() { + // this method is invoked before installDefaults(), so we can not use color fields here + super( SOUTH, UIManager.getString( "Component.arrowType" ), + UIManager.getColor( "TabbedPane.foreground" ), + UIManager.getColor( "TabbedPane.disabledForeground" ), null, + UIManager.getColor( "TabbedPane.hoverColor" ) ); + + updateDirection(); + setToolTipText( moreTabsButtonToolTipText ); + addActionListener( this ); + } + + protected void updateDirection() { + int direction; + switch( tabPane.getTabPlacement() ) { + default: + case TOP: direction = SOUTH; break; + case BOTTOM: direction = NORTH; break; + case LEFT: direction = EAST; break; + case RIGHT: direction = WEST; break; + + } + setDirection( direction ); + } + + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + boolean horizontal = (direction == SOUTH || direction == NORTH); + int margin = scale( 8 ); + return new Dimension( + size.width + (horizontal ? margin : 0), + size.height + (horizontal ? 0 : margin) ); + } + + @Override + public void paint( Graphics g ) { + // paint arrow button near separator line + if( direction == EAST || direction == WEST ) { + int xoffset = (getWidth() / 2) - getHeight(); + setXOffset( (direction == EAST) ? xoffset : -xoffset ); + } else + setXOffset( 0 ); + + super.paint( g ); + } + + @Override + protected boolean isHover() { + return super.isHover() || popupVisible; + } + + @Override + public void actionPerformed( ActionEvent e ) { + if( tabViewport == null ) + return; + + // detect (partly) hidden tabs and build popup menu + JPopupMenu popupMenu = new JPopupMenu(); + popupMenu.addPopupMenuListener( this ); + Rectangle viewRect = tabViewport.getViewRect(); + int lastIndex = -1; + for( int i = 0; i < rects.length; i++ ) { + if( !viewRect.contains( rects[i] ) ) { + // add separator between leading and trailing tabs + if( lastIndex >= 0 && lastIndex + 1 != i ) + popupMenu.addSeparator(); + lastIndex = i; + + // create menu item for tab + popupMenu.add( createMenuItem( i ) ); + } + } + + // compute popup menu location + int buttonWidth = getWidth(); + int buttonHeight = getHeight(); + Dimension popupSize = popupMenu.getPreferredSize(); + + int x = isLeftToRight() ? buttonWidth - popupSize.width : 0; + int y = buttonHeight - popupSize.height; + switch( tabPane.getTabPlacement() ) { + default: + case TOP: y = buttonHeight; break; + case BOTTOM: y = -popupSize.height; break; + case LEFT: x = buttonWidth; break; + case RIGHT: x = -popupSize.width; break; + } + + // show popup menu + popupMenu.show( this, x, y ); + } + + protected JMenuItem createMenuItem( int index ) { + JMenuItem menuItem = new JMenuItem( tabPane.getTitleAt( index ), tabPane.getIconAt( index ) ); + menuItem.setDisabledIcon( tabPane.getDisabledIconAt( index ) ); + menuItem.setToolTipText( tabPane.getToolTipTextAt( index ) ); + + Color foregroundAt = tabPane.getForegroundAt( index ); + if( foregroundAt != tabPane.getForeground() ) + menuItem.setForeground( foregroundAt ); + + Color backgroundAt = tabPane.getBackgroundAt( index ); + if( backgroundAt != tabPane.getBackground() ) { + menuItem.setBackground( backgroundAt ); + menuItem.setOpaque( true ); + } + + if( !tabPane.isEnabledAt( index ) ) + menuItem.setEnabled( false ); + + menuItem.addActionListener( e -> selectTab( index ) ); + return menuItem; + } + + protected void selectTab( int index ) { + tabPane.setSelectedIndex( index ); + ensureSelectedTabIsVisible(); + } + + @Override + public void popupMenuWillBecomeVisible( PopupMenuEvent e ) { + popupVisible = true; + repaint(); + } + + @Override + public void popupMenuWillBecomeInvisible( PopupMenuEvent e ) { + popupVisible = false; + repaint(); + } + + @Override + public void popupMenuCanceled( PopupMenuEvent e ) { + popupVisible = false; + repaint(); + } + } + + //---- class FlatScrollableTabButton -------------------------------------- + + protected class FlatScrollableTabButton + extends FlatArrowButton + implements MouseListener + { + private Timer autoRepeatTimer; + + protected FlatScrollableTabButton( int direction ) { + // this method is invoked before installDefaults(), so we can not use color fields here + super( direction, UIManager.getString( "Component.arrowType" ), + UIManager.getColor( "TabbedPane.foreground" ), + UIManager.getColor( "TabbedPane.disabledForeground" ), null, + UIManager.getColor( "TabbedPane.hoverColor" ) ); + + addMouseListener( this ); + } + + @Override + protected void fireActionPerformed( ActionEvent event ) { + runWithOriginalLayoutManager( () -> { + super.fireActionPerformed( event ); + } ); + } + + @Override + public void mousePressed( MouseEvent e ) { + if( SwingUtilities.isLeftMouseButton( e ) && isEnabled() ) { + if( autoRepeatTimer == null ) { + // using same delays as in BasicScrollBarUI and BasicSpinnerUI + autoRepeatTimer = new Timer( 60, e2 -> { + if( isEnabled() ) + doClick(); + } ); + autoRepeatTimer.setInitialDelay( 300 ); + } + + autoRepeatTimer.start(); } } - return null; + + @Override + public void mouseReleased( MouseEvent e ) { + if( autoRepeatTimer != null ) + autoRepeatTimer.stop(); + } + + @Override + public void mouseClicked( MouseEvent e ) { + } + + @Override + public void mouseEntered( MouseEvent e ) { + if( autoRepeatTimer != null && isPressed() ) + autoRepeatTimer.start(); + } + + @Override + public void mouseExited( MouseEvent e ) { + if( autoRepeatTimer != null ) + autoRepeatTimer.stop(); + } + } + + //---- class FlatWheelTabScroller ----------------------------------------- + + protected class FlatWheelTabScroller + extends MouseAdapter + { + private int lastMouseX; + private int lastMouseY; + + private boolean inViewport; + private boolean scrolled; + private Timer rolloverTimer; + private Timer exitedTimer; + + private Animator animator; + private Point startViewPosition; + private Point targetViewPosition; + + protected void uninstall() { + if( rolloverTimer != null ) + rolloverTimer.stop(); + if( exitedTimer != null ) + exitedTimer.stop(); + if( animator != null ) + animator.cancel(); + } + + @Override + public void mouseWheelMoved( MouseWheelEvent e ) { + // disable wheel scrolling if application has added its own mouse wheel listener + if( tabPane.getMouseWheelListeners().length > 1 ) + return; + + // because this listener receives mouse events for the whole tabbed pane, + // we have to check whether the mouse is located over the viewport + if( !isInViewport( e.getX(), e.getY() ) ) + return; + + lastMouseX = e.getX(); + lastMouseY = e.getY(); + + double preciseWheelRotation = e.getPreciseWheelRotation(); + int amount = (int) (maxTabHeight * preciseWheelRotation); + + // compute new view position + Point viewPosition = (targetViewPosition != null) + ? targetViewPosition + : tabViewport.getViewPosition(); + Dimension viewSize = tabViewport.getViewSize(); + int x = viewPosition.x; + int y = viewPosition.y; + int tabPlacement = tabPane.getTabPlacement(); + if( tabPlacement == TOP || tabPlacement == BOTTOM ) { + x += isLeftToRight() ? amount : -amount; + x = Math.min( Math.max( x, 0 ), viewSize.width - tabViewport.getWidth() ); + } else { + y += amount; + y = Math.min( Math.max( y, 0 ), viewSize.height - tabViewport.getHeight() ); + } + + // check whether view position has changed + Point newViewPosition = new Point( x, y ); + if( newViewPosition.equals( viewPosition ) ) + return; + + // update view position + if( preciseWheelRotation != 0 && + preciseWheelRotation != e.getWheelRotation() ) + { + // do not use animation for precise scrolling (e.g. with trackpad) + + // stop running animation (if any) + if( animator != null ) + animator.stop(); + + tabViewport.setViewPosition( newViewPosition ); + updateRolloverDelayed(); + } else + setViewPositionAnimated( newViewPosition ); + + scrolled = true; + } + + protected void setViewPositionAnimated( Point viewPosition ) { + // check whether position is equal to current position + if( viewPosition.equals( tabViewport.getViewPosition() ) ) + return; + + // do not use animation if disabled + if( !isSmoothScrollingEnabled() ) { + tabViewport.setViewPosition( viewPosition ); + updateRolloverDelayed(); + return; + } + + // remember start and target view positions + startViewPosition = tabViewport.getViewPosition(); + targetViewPosition = viewPosition; + + // create animator + if( animator == null ) { + // using same delays as in FlatScrollBarUI + int duration = 200; + int resolution = 10; + + animator = new Animator( duration, fraction -> { + if( tabViewport == null || !tabViewport.isShowing() ) { + animator.stop(); + return; + } + + // update view position + int x = startViewPosition.x + Math.round( (targetViewPosition.x - startViewPosition.x) * fraction ); + int y = startViewPosition.y + Math.round( (targetViewPosition.y - startViewPosition.y) * fraction ); + tabViewport.setViewPosition( new Point( x, y ) ); + }, () -> { + startViewPosition = targetViewPosition = null; + + if( tabPane != null ) + setRolloverTab( lastMouseX, lastMouseY ); + } ); + + animator.setResolution( resolution ); + animator.setInterpolator( new CubicBezierEasing( 0.5f, 0.5f, 0.5f, 1 ) ); + } + + // restart animator + animator.restart(); + } + + protected void updateRolloverDelayed() { + blockRollover = true; + + // keep rollover on last tab until it would move to another tab, then clear it + int oldIndex = getRolloverTab(); + if( oldIndex >= 0 ) { + int index = tabForCoordinate( tabPane, lastMouseX, lastMouseY ); + if( index >= 0 && index != oldIndex ) { + // clear if moved to another tab + blockRollover = false; + setRolloverTab( -1 ); + blockRollover = true; + } + } + + // create timer + if( rolloverTimer == null ) { + rolloverTimer = new Timer( 150, e -> { + blockRollover = false; + + // highlight tab at mouse location + if( tabPane != null ) + setRolloverTab( lastMouseX, lastMouseY ); + } ); + rolloverTimer.setRepeats( false ); + } + + // restart timer + rolloverTimer.restart(); + } + + @Override + public void mouseMoved( MouseEvent e ) { + checkViewportExited( e.getX(), e.getY() ); + } + + @Override + public void mouseExited( MouseEvent e ) { + // this event occurs also if mouse is moved to a custom tab component + // that handles mouse events (e.g. a close button) + checkViewportExited( e.getX(), e.getY() ); + } + + @Override + public void mousePressed( MouseEvent e ) { + // for the case that the tab was only partly visible before the user clicked it + setRolloverTab( e.getX(), e.getY() ); + } + + protected boolean isInViewport( int x, int y ) { + return (tabViewport != null && tabViewport.getBounds().contains( x, y ) ); + } + + protected void checkViewportExited( int x, int y ) { + lastMouseX = x; + lastMouseY = y; + + boolean wasInViewport = inViewport; + inViewport = isInViewport( x, y ); + + if( inViewport != wasInViewport ) { + if( !inViewport ) + viewportExited(); + else if( exitedTimer != null ) + exitedTimer.stop(); + } + } + + protected void viewportExited() { + if( !scrolled ) + return; + + if( exitedTimer == null ) { + exitedTimer = new Timer( 500, e -> ensureSelectedTabVisible() ); + exitedTimer.setRepeats( false ); + } + + exitedTimer.start(); + } + + protected void ensureSelectedTabVisible() { + // check whether UI delegate was uninstalled because this method is invoked via timer + if( tabPane == null || tabViewport == null ) + return; + + if( !scrolled || tabViewport == null ) + return; + scrolled = false; + + // scroll selected tab into visible area + ensureSelectedTabIsVisible(); + } + } + + //---- class Handler ------------------------------------------------------ + + private class Handler + implements MouseListener, MouseMotionListener, PropertyChangeListener, + ChangeListener, ComponentListener, ContainerListener + { + MouseListener mouseDelegate; + PropertyChangeListener propertyChangeDelegate; + ChangeListener changeDelegate; + + private final PropertyChangeListener contentListener = this::contentPropertyChange; + + private int pressedTabIndex = -1; + private int lastTipTabIndex = -1; + private String lastTip; + + void installListeners() { + tabPane.addMouseMotionListener( this ); + tabPane.addComponentListener( this ); + tabPane.addContainerListener( this ); + + for( Component c : tabPane.getComponents() ) { + if( !(c instanceof UIResource) ) + c.addPropertyChangeListener( contentListener ); + } + } + + void uninstallListeners() { + tabPane.removeMouseMotionListener( this ); + tabPane.removeComponentListener( this ); + tabPane.removeContainerListener( this ); + + for( Component c : tabPane.getComponents() ) { + if( !(c instanceof UIResource) ) + c.removePropertyChangeListener( contentListener ); + } + } + + //---- interface MouseListener ---- + + @Override + public void mouseClicked( MouseEvent e ) { + mouseDelegate.mouseClicked( e ); + } + + @Override + public void mousePressed( MouseEvent e ) { + updateRollover( e ); + + if( !isPressedTabClose() ) + mouseDelegate.mousePressed( e ); + } + + @Override + public void mouseReleased( MouseEvent e ) { + if( isPressedTabClose() ) { + updateRollover( e ); + if( pressedTabIndex >= 0 && pressedTabIndex == getRolloverTab() ) + closeTab( pressedTabIndex ); + } else + mouseDelegate.mouseReleased( e ); + + pressedTabIndex = -1; + updateRollover( e ); + } + + @Override + public void mouseEntered( MouseEvent e ) { + // this is necessary for "more tabs" button + updateRollover( e ); + } + + @Override + public void mouseExited( MouseEvent e ) { + // this event occurs also if mouse is moved to a custom tab component + // that handles mouse events (e.g. a close button) + // --> make sure that the tab stays highlighted + updateRollover( e ); + } + + //---- interface MouseMotionListener ---- + + @Override + public void mouseDragged( MouseEvent e ) { + updateRollover( e ); + } + + @Override + public void mouseMoved( MouseEvent e ) { + updateRollover( e ); + } + + private void updateRollover( MouseEvent e ) { + int x = e.getX(); + int y = e.getY(); + + int tabIndex = tabForCoordinate( tabPane, x, y ); + + setRolloverTab( tabIndex ); + + // check whether mouse hit tab close area + boolean hitClose = isTabClosable( tabIndex ) + ? getTabCloseHitArea( tabIndex ).contains( x, y ) + : false; + if( e.getID() == MouseEvent.MOUSE_PRESSED ) + pressedTabIndex = hitClose ? tabIndex : -1; + setRolloverTabClose( hitClose ); + setPressedTabClose( hitClose && tabIndex == pressedTabIndex ); + + // update tooltip + if( tabIndex >= 0 && hitClose ) { + Object closeTip = getTabClientProperty( tabIndex, TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT ); + if( closeTip instanceof String ) + setCloseToolTip( tabIndex, (String) closeTip ); + else + restoreTabToolTip(); + } else + restoreTabToolTip(); + } + + private void setCloseToolTip( int tabIndex, String closeTip ) { + if( tabIndex == lastTipTabIndex ) + return; // closeTip already set + + if( tabIndex != lastTipTabIndex ) + restoreTabToolTip(); + + lastTipTabIndex = tabIndex; + lastTip = tabPane.getToolTipTextAt( lastTipTabIndex ); + tabPane.setToolTipTextAt( lastTipTabIndex, closeTip ); + } + + private void restoreTabToolTip() { + if( lastTipTabIndex < 0 ) + return; + + tabPane.setToolTipTextAt( lastTipTabIndex, lastTip ); + lastTip = null; + lastTipTabIndex = -1; + } + + //---- interface PropertyChangeListener ---- + + @Override + public void propertyChange( PropertyChangeEvent e ) { + // invoke delegate listener + switch( e.getPropertyName() ) { + case "tabPlacement": + case "opaque": + case "background": + case "indexForTabComponent": + runWithOriginalLayoutManager( () -> { + propertyChangeDelegate.propertyChange( e ); + } ); + break; + + default: + propertyChangeDelegate.propertyChange( e ); + break; + } + + // handle event + switch( e.getPropertyName() ) { + case "tabPlacement": + if( moreTabsButton instanceof FlatMoreTabsButton ) + ((FlatMoreTabsButton)moreTabsButton).updateDirection(); + break; + + case "componentOrientation": + ensureSelectedTabIsVisibleLater(); + break; + + case TABBED_PANE_SHOW_TAB_SEPARATORS: + case TABBED_PANE_SHOW_CONTENT_SEPARATOR: + case TABBED_PANE_HAS_FULL_BORDER: + case TABBED_PANE_MINIMUM_TAB_WIDTH: + case TABBED_PANE_MAXIMUM_TAB_WIDTH: + case TABBED_PANE_TAB_HEIGHT: + case TABBED_PANE_TAB_INSETS: + case TABBED_PANE_TAB_AREA_INSETS: + case TABBED_PANE_HIDDEN_TABS_NAVIGATION: + case TABBED_PANE_TAB_AREA_ALIGNMENT: + case TABBED_PANE_TAB_WIDTH_MODE: + case TABBED_PANE_TAB_ICON_PLACEMENT: + case TABBED_PANE_TAB_CLOSABLE: + tabPane.revalidate(); + tabPane.repaint(); + break; + + case TABBED_PANE_LEADING_COMPONENT: + uninstallLeadingComponent(); + installLeadingComponent(); + tabPane.revalidate(); + tabPane.repaint(); + ensureSelectedTabIsVisibleLater(); + break; + + case TABBED_PANE_TRAILING_COMPONENT: + uninstallTrailingComponent(); + installTrailingComponent(); + tabPane.revalidate(); + tabPane.repaint(); + ensureSelectedTabIsVisibleLater(); + break; + } + } + + //---- interface ChangeListener ---- + + @Override + public void stateChanged( ChangeEvent e ) { + changeDelegate.stateChanged( e ); + + // scroll selected tab into visible area + if( moreTabsButton != null ) + ensureSelectedTabIsVisible(); + } + + protected void contentPropertyChange( PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case TABBED_PANE_MINIMUM_TAB_WIDTH: + case TABBED_PANE_MAXIMUM_TAB_WIDTH: + case TABBED_PANE_TAB_INSETS: + case TABBED_PANE_TAB_CLOSABLE: + tabPane.revalidate(); + tabPane.repaint(); + break; + } + } + + //---- interface ComponentListener ---- + + @Override + public void componentResized( ComponentEvent e ) { + // make sure that selected tab stays visible when component size changed + ensureSelectedTabIsVisibleLater(); + } + + @Override public void componentMoved( ComponentEvent e ) {} + @Override public void componentShown( ComponentEvent e ) {} + @Override public void componentHidden( ComponentEvent e ) {} + + //---- interface ContainerListener ---- + + @Override + public void componentAdded( ContainerEvent e ) { + Component c = e.getChild(); + if( !(c instanceof UIResource) ) + c.addPropertyChangeListener( contentListener ); + } + + @Override + public void componentRemoved( ContainerEvent e ) { + Component c = e.getChild(); + if( !(c instanceof UIResource) ) + c.removePropertyChangeListener( contentListener ); + } + } + + //---- class FlatTabbedPaneLayout ----------------------------------------- + + protected class FlatTabbedPaneLayout + extends TabbedPaneLayout + { + @Override + protected Dimension calculateSize( boolean minimum ) { + if( isContentEmpty() ) + return calculateTabAreaSize(); + + return super.calculateSize( minimum ); + } + + /** + * Check whether all content components are either {@code null} or have zero preferred size. + *

+ * If {@code true}, assume that the tabbed pane is used without any content and + * use the size of the tab area (single run) as minimum/preferred size. + */ + protected boolean isContentEmpty() { + int tabCount = tabPane.getTabCount(); + if( tabCount == 0 ) + return false; + + for( int i = 0; i < tabCount; i++ ) { + Component c = tabPane.getComponentAt( i ); + if( c != null ) { + Dimension cs = c.getPreferredSize(); + if( cs.width != 0 || cs.height != 0 ) + return false; + } + } + + return true; + } + + protected Dimension calculateTabAreaSize() { + boolean horizontal = isHorizontalTabPlacement(); + int tabPlacement = tabPane.getTabPlacement(); + FontMetrics metrics = getFontMetrics(); + int fontHeight = metrics.getHeight(); + + // calculate size of tabs + int width = 0; + int height = 0; + int tabCount = tabPane.getTabCount(); + for( int i = 0; i < tabCount; i++ ) { + if( horizontal ) { + width += calculateTabWidth( tabPlacement, i, metrics ); + height = Math.max( height, calculateTabHeight( tabPlacement, i, fontHeight ) ); + } else { + width = Math.max( width, calculateTabWidth( tabPlacement, i, metrics ) ); + height += calculateTabHeight( tabPlacement, i, fontHeight ); + } + } + + // add content separator thickness + if( horizontal ) + height += scale( contentSeparatorHeight ); + else + width += scale( contentSeparatorHeight ); + + // add insets + Insets insets = tabPane.getInsets(); + Insets tabAreaInsets = getTabAreaInsets( tabPlacement ); + return new Dimension( + width + insets.left + insets.right + tabAreaInsets.left + tabAreaInsets.right, + height + insets.bottom + insets.top + tabAreaInsets.top + tabAreaInsets.bottom ); + } + + @Override + public void layoutContainer( Container parent ) { + super.layoutContainer( parent ); + + Rectangle bounds = tabPane.getBounds(); + Insets insets = tabPane.getInsets(); + int tabPlacement = tabPane.getTabPlacement(); + int tabAreaAlignment = getTabAreaAlignment(); + Insets tabAreaInsets = getRealTabAreaInsets( tabPlacement ); + boolean leftToRight = isLeftToRight(); + + // layout leading and trailing components in tab area + if( tabPlacement == TOP || tabPlacement == BOTTOM ) { + // fix x-locations of tabs in right-to-left component orientation + if( !leftToRight ) + shiftTabs( insets.left + tabAreaInsets.right + getTrailingPreferredWidth(), 0 ); + + // tab area height (maxTabHeight is zero if tab count is zero) + int tabAreaHeight = (maxTabHeight > 0) + ? maxTabHeight + : Math.max( + Math.max( getLeadingPreferredHeight(), getTrailingPreferredHeight() ), + scale( clientPropertyInt( tabPane, TABBED_PANE_TAB_HEIGHT, tabHeight ) ) ); + + // tab area bounds + int tx = insets.left; + int ty = (tabPlacement == TOP) + ? insets.top + tabAreaInsets.top + : (bounds.height - insets.bottom - tabAreaInsets.bottom - tabAreaHeight); + int tw = bounds.width - insets.left - insets.right; + int th = tabAreaHeight; + + int leadingWidth = getLeadingPreferredWidth(); + int trailingWidth = getTrailingPreferredWidth(); + + // apply tab area alignment + if( runCount == 1 && rects.length > 0 ) { + int availWidth = tw - leadingWidth - trailingWidth - tabAreaInsets.left - tabAreaInsets.right; + int totalTabWidth = rectsTotalWidth( leftToRight ); + int diff = availWidth - totalTabWidth; + + switch( tabAreaAlignment ) { + case ALIGN_LEADING: + trailingWidth += diff; + break; + + case ALIGN_TRAILING: + shiftTabs( leftToRight ? diff : -diff, 0 ); + leadingWidth += diff; + break; + + case ALIGN_CENTER: + shiftTabs( (leftToRight ? diff : -diff) / 2, 0 ); + leadingWidth += diff / 2; + trailingWidth += diff - (diff / 2); + break; + + case ALIGN_FILL: + stretchTabsWidth( diff, leftToRight ); + break; + } + } else if( rects.length == 0 ) + trailingWidth = tw - leadingWidth; + + // layout left component + Container leftComponent = leftToRight ? leadingComponent : trailingComponent; + if( leftComponent != null ) { + int leftWidth = leftToRight ? leadingWidth : trailingWidth; + leftComponent.setBounds( tx, ty, leftWidth, th ); + } + + // layout right component + Container rightComponent = leftToRight ? trailingComponent : leadingComponent; + if( rightComponent != null ) { + int rightWidth = leftToRight ? trailingWidth : leadingWidth; + rightComponent.setBounds( tx + tw - rightWidth, ty, rightWidth, th ); + } + } else { // LEFT and RIGHT tab placement + // tab area width (maxTabWidth is zero if tab count is zero) + int tabAreaWidth = (maxTabWidth > 0) + ? maxTabWidth + : Math.max( getLeadingPreferredWidth(), getTrailingPreferredWidth() ); + + // tab area bounds + int tx = (tabPlacement == LEFT) + ? insets.left + tabAreaInsets.left + : (bounds.width - insets.right - tabAreaInsets.right - tabAreaWidth); + int ty = insets.top; + int tw = tabAreaWidth; + int th = bounds.height - insets.top - insets.bottom; + + int topHeight = getLeadingPreferredHeight(); + int bottomHeight = getTrailingPreferredHeight(); + + // apply tab area alignment + if( runCount == 1 && rects.length > 0 ) { + int availHeight = th - topHeight - bottomHeight - tabAreaInsets.top - tabAreaInsets.bottom; + int totalTabHeight = rectsTotalHeight(); + int diff = availHeight - totalTabHeight; + + switch( tabAreaAlignment ) { + case ALIGN_LEADING: + bottomHeight += diff; + break; + + case ALIGN_TRAILING: + shiftTabs( 0, diff ); + topHeight += diff; + break; + + case ALIGN_CENTER: + shiftTabs( 0, (diff) / 2 ); + topHeight += diff / 2; + bottomHeight += diff - (diff / 2); + break; + + case ALIGN_FILL: + stretchTabsHeight( diff ); + break; + } + } else if( rects.length == 0 ) + bottomHeight = th - topHeight; + + // layout top component + if( leadingComponent != null ) + leadingComponent.setBounds( tx, ty, tw, topHeight ); + + // layout bottom component + if( trailingComponent != null ) + trailingComponent.setBounds( tx, ty + th - bottomHeight, tw, bottomHeight ); + } + } + } + + //---- class FlatTabbedPaneScrollLayout ----------------------------------- + + /** + * Layout manager used for scroll tab layout policy. + *

+ * Although this class delegates all methods to the original layout manager + * {@code BasicTabbedPaneUI.TabbedPaneScrollLayout}, which extends + * {@link BasicTabbedPaneUI.TabbedPaneLayout}, it is necessary that this class + * also extends {@link TabbedPaneLayout} to avoid a {@code ClassCastException} + * in {@link BasicTabbedPaneUI}.ensureCurrentLayout(). + */ + protected class FlatTabbedPaneScrollLayout + extends FlatTabbedPaneLayout + implements LayoutManager + { + private final TabbedPaneLayout delegate; + + protected FlatTabbedPaneScrollLayout( TabbedPaneLayout delegate ) { + this.delegate = delegate; + } + + @Override + public void calculateLayoutInfo() { + delegate.calculateLayoutInfo(); + } + + @Override + protected Dimension calculateTabAreaSize() { + Dimension size = super.calculateTabAreaSize(); + + // limit width/height in scroll layout + if( isHorizontalTabPlacement() ) + size.width = Math.min( size.width, scale( 100 ) ); + else + size.height = Math.min( size.height, scale( 100 ) ); + return size; + } + + //---- interface LayoutManager ---- + + @Override + public Dimension preferredLayoutSize( Container parent ) { + if( isContentEmpty() ) + return calculateTabAreaSize(); + + return delegate.preferredLayoutSize( parent ); + } + + @Override + public Dimension minimumLayoutSize( Container parent ) { + if( isContentEmpty() ) + return calculateTabAreaSize(); + + return delegate.minimumLayoutSize( parent ); + } + + @Override + public void addLayoutComponent( String name, Component comp ) { + delegate.addLayoutComponent( name, comp ); + } + + @Override + public void removeLayoutComponent( Component comp ) { + delegate.removeLayoutComponent( comp ); + } + + @Override + public void layoutContainer( Container parent ) { + // delegate to original layout manager and let it layout tabs and buttons + // + // runWithOriginalLayoutManager() is necessary for correct locations + // of tab components layed out in TabbedPaneLayout.layoutTabComponents() + runWithOriginalLayoutManager( () -> { + delegate.layoutContainer( parent ); + } ); + + boolean useMoreButton = (getHiddenTabsNavigation() == MORE_TABS_BUTTON); + + // for right-to-left always use "more tabs" button for horizontal scrolling + // because methods scrollForward() and scrollBackward() in class + // BasicTabbedPaneUI.ScrollableTabSupport do not work for right-to-left + boolean leftToRight = isLeftToRight(); + if( !leftToRight && !useMoreButton && isHorizontalTabPlacement() ) + useMoreButton = true; + + // find backward/forward scroll buttons + JButton backwardButton = null; + JButton forwardButton = null; + for( Component c : tabPane.getComponents() ) { + if( c instanceof FlatScrollableTabButton ) { + int direction = ((FlatScrollableTabButton)c).getDirection(); + if( direction == WEST || direction == NORTH ) + backwardButton = (JButton) c; + else if( direction == EAST || direction == SOUTH ) + forwardButton = (JButton) c; + } + } + + if( !useMoreButton && (backwardButton == null || forwardButton == null) ) + return; // should never occur + + Rectangle bounds = tabPane.getBounds(); + Insets insets = tabPane.getInsets(); + int tabPlacement = tabPane.getTabPlacement(); + int tabAreaAlignment = getTabAreaAlignment(); + Insets tabAreaInsets = getRealTabAreaInsets( tabPlacement ); + Dimension moreButtonSize = useMoreButton ? moreTabsButton.getPreferredSize() : null; + Dimension backwardButtonSize = useMoreButton ? null : backwardButton.getPreferredSize(); + Dimension forwardButtonSize = useMoreButton ? null : forwardButton.getPreferredSize(); + boolean buttonsVisible = false; + + // TabbedPaneScrollLayout adds tabAreaInsets to tab coordinates, + // but we use it to position the viewport + if( tabAreaInsets.left != 0 || tabAreaInsets.top != 0 ) { + // remove tabAreaInsets from tab locations + shiftTabs( -tabAreaInsets.left, -tabAreaInsets.top ); + + // reduce preferred size of view + Component view = tabViewport.getView(); + Dimension viewSize = view.getPreferredSize(); + boolean horizontal = (tabPlacement == TOP || tabPlacement == BOTTOM); + view.setPreferredSize( new Dimension( + viewSize.width - (horizontal ? tabAreaInsets.left : 0), + viewSize.height - (horizontal ? 0 : tabAreaInsets.top) ) ); + } + + // layout tab area + if( tabPlacement == TOP || tabPlacement == BOTTOM ) { + // tab area height (maxTabHeight is zero if tab count is zero) + int tabAreaHeight = (maxTabHeight > 0) + ? maxTabHeight + : Math.max( + Math.max( getLeadingPreferredHeight(), getTrailingPreferredHeight() ), + scale( clientPropertyInt( tabPane, TABBED_PANE_TAB_HEIGHT, tabHeight ) ) ); + + // tab area bounds + int tx = insets.left; + int ty = (tabPlacement == TOP) + ? insets.top + tabAreaInsets.top + : (bounds.height - insets.bottom - tabAreaInsets.bottom - tabAreaHeight); + int tw = bounds.width - insets.left - insets.right; + int th = tabAreaHeight; + + int leadingWidth = getLeadingPreferredWidth(); + int trailingWidth = getTrailingPreferredWidth(); + int availWidth = tw - leadingWidth - trailingWidth - tabAreaInsets.left - tabAreaInsets.right; + int totalTabWidth = (rects.length > 0) ? rectsTotalWidth( leftToRight ) : 0; + + // apply tab area alignment + if( totalTabWidth < availWidth && rects.length > 0 ) { + int diff = availWidth - totalTabWidth; + switch( tabAreaAlignment ) { + case ALIGN_LEADING: + trailingWidth += diff; + break; + + case ALIGN_TRAILING: + leadingWidth += diff; + break; + + case ALIGN_CENTER: + leadingWidth += diff / 2; + trailingWidth += diff - (diff / 2); + break; + + case ALIGN_FILL: + stretchTabsWidth( diff, leftToRight ); + totalTabWidth = rectsTotalWidth( leftToRight ); + break; + } + } else if( rects.length == 0 ) + trailingWidth = tw - leadingWidth; + + // layout left component + Container leftComponent = leftToRight ? leadingComponent : trailingComponent; + int leftWidth = leftToRight ? leadingWidth : trailingWidth; + if( leftComponent != null ) + leftComponent.setBounds( tx, ty, leftWidth, th ); + + // layout right component + Container rightComponent = leftToRight ? trailingComponent : leadingComponent; + int rightWidth = leftToRight ? trailingWidth : leadingWidth; + if( rightComponent != null ) + rightComponent.setBounds( tx + tw - rightWidth, ty, rightWidth, th ); + + // layout tab viewport and buttons + if( rects.length > 0 ) { + int txi = tx + leftWidth + (leftToRight ? tabAreaInsets.left : tabAreaInsets.right); + int twi = tw - leftWidth - rightWidth - tabAreaInsets.left - tabAreaInsets.right; + + // layout viewport and buttons + int viewportWidth = twi; + if( viewportWidth < totalTabWidth ) { + // need buttons + buttonsVisible = true; + int buttonsWidth = useMoreButton ? moreButtonSize.width : (backwardButtonSize.width + forwardButtonSize.width); + viewportWidth = Math.max( viewportWidth - buttonsWidth, 0 ); + + if( useMoreButton ) + moreTabsButton.setBounds( leftToRight ? (txi + twi - buttonsWidth) : txi, ty, moreButtonSize.width, th ); + else { + backwardButton.setBounds( leftToRight ? (txi + twi - buttonsWidth) : txi, ty, backwardButtonSize.width, th ); + forwardButton.setBounds( leftToRight ? (txi + twi - forwardButtonSize.width) : (txi + backwardButtonSize.width), ty, forwardButtonSize.width, th ); + } + tabViewport.setBounds( leftToRight ? txi : (txi + buttonsWidth), ty, viewportWidth, th ); + } else + tabViewport.setBounds( txi, ty, viewportWidth, th ); + + if( !leftToRight ) { + // layout viewport so that we can get correct view width below + tabViewport.doLayout(); + + // fix x-locations of tabs so that they are right-aligned in the view + shiftTabs( tabViewport.getView().getWidth() - (rects[0].x + rects[0].width), 0 ); + } + } + } else { // LEFT and RIGHT tab placement + // tab area width (maxTabWidth is zero if tab count is zero) + int tabAreaWidth = (maxTabWidth > 0) + ? maxTabWidth + : Math.max( getLeadingPreferredWidth(), getTrailingPreferredWidth() ); + + // tab area bounds + int tx = (tabPlacement == LEFT) + ? insets.left + tabAreaInsets.left + : (bounds.width - insets.right - tabAreaInsets.right - tabAreaWidth); + int ty = insets.top; + int tw = tabAreaWidth; + int th = bounds.height - insets.top - insets.bottom; + + int topHeight = getLeadingPreferredHeight(); + int bottomHeight = getTrailingPreferredHeight(); + int availHeight = th - topHeight - bottomHeight - tabAreaInsets.top - tabAreaInsets.bottom; + int totalTabHeight = (rects.length > 0) ? rectsTotalHeight() : 0; + + // apply tab area alignment + if( totalTabHeight < availHeight && rects.length > 0 ) { + int diff = availHeight - totalTabHeight; + switch( tabAreaAlignment ) { + case ALIGN_LEADING: + bottomHeight += diff; + break; + + case ALIGN_TRAILING: + topHeight += diff; + break; + + case ALIGN_CENTER: + topHeight += diff / 2; + bottomHeight += diff - (diff / 2); + break; + + case ALIGN_FILL: + stretchTabsHeight( diff ); + totalTabHeight = rectsTotalHeight(); + break; + } + } else if( rects.length == 0 ) + bottomHeight = th - topHeight; + + // layout top component + if( leadingComponent != null ) + leadingComponent.setBounds( tx, ty, tw, topHeight ); + + // layout bottom component + if( trailingComponent != null ) + trailingComponent.setBounds( tx, ty + th - bottomHeight, tw, bottomHeight ); + + // layout tab viewport and buttons + if( rects.length > 0 ) { + int tyi = ty + topHeight + tabAreaInsets.top; + int thi = th - topHeight - bottomHeight - tabAreaInsets.top - tabAreaInsets.bottom; + + // layout viewport and buttons + int viewportHeight = thi; + if( viewportHeight < totalTabHeight ) { + // need buttons + buttonsVisible = true; + int buttonsHeight = useMoreButton ? moreButtonSize.height : (backwardButtonSize.height + forwardButtonSize.height); + viewportHeight = Math.max( viewportHeight - buttonsHeight, 0 ); + + if( useMoreButton ) + moreTabsButton.setBounds( tx, tyi + thi - buttonsHeight, tw, moreButtonSize.height ); + else { + backwardButton.setBounds( tx, tyi + thi - buttonsHeight, tw, backwardButtonSize.height ); + forwardButton.setBounds( tx, tyi + thi - forwardButtonSize.height, tw, forwardButtonSize.height ); + } + } + tabViewport.setBounds( tx, tyi, tw, viewportHeight ); + } + } + + // show/hide viewport and buttons + tabViewport.setVisible( rects.length > 0 ); + moreTabsButton.setVisible( useMoreButton && buttonsVisible ); + backwardButton.setVisible( !useMoreButton && buttonsVisible ); + forwardButton.setVisible( !useMoreButton && buttonsVisible ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableCellBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableCellBorder.java index 05669edf..cd25abae 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableCellBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableCellBorder.java @@ -86,7 +86,7 @@ public class FlatTableCellBorder /** * Checks whether at least one selected cell is editable. */ - private boolean isSelectionEditable( JTable table ) { + protected boolean isSelectionEditable( JTable table ) { if( table.getRowSelectionAllowed() ) { int columnCount = table.getColumnCount(); int[] selectedRows = table.getSelectedRows(); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java index e5c7754e..c311da68 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java @@ -86,26 +86,12 @@ public class FlatTableHeaderUI case "top": sortIconPosition = SwingConstants.TOP; break; case "bottom": sortIconPosition = SwingConstants.BOTTOM; break; } - - // use own renderer if necessary - if( sortIconPosition != SwingConstants.RIGHT ) { - TableCellRenderer defaultRenderer = header.getDefaultRenderer(); - if( defaultRenderer instanceof UIResource ) - header.setDefaultRenderer( new FlatTableCellHeaderRenderer( defaultRenderer ) ); - } } @Override protected void uninstallDefaults() { super.uninstallDefaults(); - // restore default renderer - TableCellRenderer defaultRenderer = header.getDefaultRenderer(); - if( defaultRenderer instanceof FlatTableCellHeaderRenderer ) { - ((FlatTableCellHeaderRenderer)defaultRenderer).reset(); - header.setDefaultRenderer( ((FlatTableCellHeaderRenderer)defaultRenderer).delegate ); - } - separatorColor = null; bottomSeparatorColor = null; } @@ -125,8 +111,22 @@ public class FlatTableHeaderUI if( paintBorders ) paintColumnBorders( g, c ); + // temporary use own default renderer if necessary + FlatTableCellHeaderRenderer sortIconRenderer = null; + if( sortIconPosition != SwingConstants.RIGHT ) { + sortIconRenderer = new FlatTableCellHeaderRenderer( header.getDefaultRenderer() ); + header.setDefaultRenderer( sortIconRenderer ); + } + + // paint header super.paint( g, c ); + // restore default renderer + if( sortIconRenderer != null ) { + sortIconRenderer.reset(); + header.setDefaultRenderer( sortIconRenderer.delegate ); + } + if( paintBorders ) paintDraggedColumnBorders( g, c ); } @@ -158,7 +158,7 @@ public class FlatTableHeaderUI g2.setColor( separatorColor ); int sepCount = columnCount; - if( header.getTable().getAutoResizeMode() != JTable.AUTO_RESIZE_OFF && !isVerticalScrollBarVisible() ) + if( header.getTable() != null && header.getTable().getAutoResizeMode() != JTable.AUTO_RESIZE_OFF && !isVerticalScrollBarVisible() ) sepCount--; if( header.getComponentOrientation().isLeftToRight() ) { @@ -257,6 +257,7 @@ public class FlatTableHeaderUI { private final TableCellRenderer delegate; + private JLabel l; private int oldHorizontalTextPosition = -1; private Border origBorder; private Icon sortIcon; @@ -273,7 +274,7 @@ public class FlatTableHeaderUI if( !(c instanceof JLabel) ) return c; - JLabel l = (JLabel) c; + l = (JLabel) c; if( sortIconPosition == SwingConstants.LEFT ) { if( oldHorizontalTextPosition < 0 ) @@ -291,11 +292,8 @@ public class FlatTableHeaderUI } void reset() { - if( sortIconPosition == SwingConstants.LEFT && oldHorizontalTextPosition >= 0 ) { - Component c = getTableCellRendererComponent( header.getTable(), "", false, false, -1, 0 ); - if( c instanceof JLabel && ((JLabel)c).getHorizontalTextPosition() == SwingConstants.RIGHT ) - ((JLabel)c).setHorizontalTextPosition( oldHorizontalTextPosition ); - } + if( l != null && sortIconPosition == SwingConstants.LEFT && oldHorizontalTextPosition >= 0 ) + l.setHorizontalTextPosition( oldHorizontalTextPosition ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java index bee64c09..51aff9ca 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableUI.java @@ -18,13 +18,16 @@ package com.formdev.flatlaf.ui; import java.awt.Color; import java.awt.Dimension; +import java.awt.EventQueue; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; +import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.LookAndFeel; import javax.swing.UIManager; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicTableUI; +import javax.swing.table.TableCellRenderer; import com.formdev.flatlaf.util.UIScale; /** @@ -68,6 +71,10 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Table.cellFocusColor Color * @uiDefault Table.showCellFocusIndicator boolean * + * + * + * @uiDefault Table.consistentHomeEndKeyBehavior boolean + * * @author Karl Tauber */ public class FlatTableUI @@ -90,16 +97,6 @@ public class FlatTableUI return new FlatTableUI(); } - @Override - public void installUI( JComponent c ) { - super.installUI( c ); - } - - @Override - public void uninstallUI( JComponent c ) { - super.uninstallUI( c ); - } - @Override protected void installDefaults() { super.installDefaults(); @@ -113,7 +110,7 @@ public class FlatTableUI selectionInactiveBackground = UIManager.getColor( "Table.selectionInactiveBackground" ); selectionInactiveForeground = UIManager.getColor( "Table.selectionInactiveForeground" ); - toggleSelectionColors( table.hasFocus() ); + toggleSelectionColors(); int rowHeight = FlatUIUtils.getUIInt( "Table.rowHeight", 16 ); if( rowHeight > 0 ) @@ -132,6 +129,12 @@ public class FlatTableUI oldIntercellSpacing = table.getIntercellSpacing(); table.setIntercellSpacing( intercellSpacing ); } + + // checkbox is non-opaque in FlatLaf and therefore would not paint selection + // --> make checkbox renderer opaque (but opaque in Metal or Windows LaF) + TableCellRenderer booleanRenderer = table.getDefaultRenderer( Boolean.class ); + if( booleanRenderer instanceof JCheckBox ) + ((JCheckBox)booleanRenderer).setOpaque( true ); } @Override @@ -160,13 +163,17 @@ public class FlatTableUI @Override public void focusGained( FocusEvent e ) { super.focusGained( e ); - toggleSelectionColors( true ); + toggleSelectionColors(); } @Override public void focusLost( FocusEvent e ) { super.focusLost( e ); - toggleSelectionColors( false ); + + // use invokeLater for the case that the window is deactivated + EventQueue.invokeLater( () -> { + toggleSelectionColors(); + } ); } }; } @@ -180,8 +187,11 @@ public class FlatTableUI * already used in applications. Then either the inactive colors are not used, * or the application has to be changed to extend a FlatLaf renderer. */ - private void toggleSelectionColors( boolean focused ) { - if( focused ) { + private void toggleSelectionColors() { + if( table == null ) + return; + + if( FlatUIUtils.isPermanentFocusOwner( table ) ) { if( table.getSelectionBackground() == selectionInactiveBackground ) table.setSelectionBackground( selectionBackground ); if( table.getSelectionForeground() == selectionInactiveForeground ) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextAreaUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextAreaUI.java index 4cc5c109..9254749f 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextAreaUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextAreaUI.java @@ -16,10 +16,11 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Graphics2D; +import java.beans.PropertyChangeEvent; import javax.swing.JComponent; import javax.swing.JTextArea; import javax.swing.UIManager; @@ -27,6 +28,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicTextAreaUI; import javax.swing.text.JTextComponent; +import com.formdev.flatlaf.util.HiDPIUtils; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JTextArea}. @@ -58,6 +60,7 @@ public class FlatTextAreaUI { protected int minimumWidth; protected boolean isIntelliJTheme; + protected Color background; protected Color disabledBackground; protected Color inactiveBackground; @@ -65,12 +68,20 @@ public class FlatTextAreaUI return new FlatTextAreaUI(); } + @Override + public void installUI( JComponent c ) { + super.installUI( c ); + + updateBackground(); + } + @Override protected void installDefaults() { super.installDefaults(); minimumWidth = UIManager.getInt( "Component.minimumWidth" ); isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" ); + background = UIManager.getColor( "TextArea.background" ); disabledBackground = UIManager.getColor( "TextArea.disabledBackground" ); inactiveBackground = UIManager.getColor( "TextArea.inactiveBackground" ); } @@ -79,46 +90,80 @@ public class FlatTextAreaUI protected void uninstallDefaults() { super.uninstallDefaults(); + background = null; disabledBackground = null; inactiveBackground = null; } + @Override + protected void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + FlatEditorPaneUI.propertyChange( getComponent(), e ); + + switch( e.getPropertyName() ) { + case "editable": + case "enabled": + updateBackground(); + break; + } + } + + private void updateBackground() { + JTextComponent c = getComponent(); + + Color background = c.getBackground(); + if( !(background instanceof UIResource) ) + return; + + // do not update background if it currently has a unknown color (assigned from outside) + if( background != this.background && + background != disabledBackground && + background != inactiveBackground ) + return; + + Color newBackground = !c.isEnabled() + ? disabledBackground + : (!c.isEditable() + ? inactiveBackground + : this.background); + + if( newBackground != background ) + c.setBackground( newBackground ); + } + + @Override + public Dimension getPreferredSize( JComponent c ) { + return applyMinimumWidth( c, super.getPreferredSize( c ) ); + } + + @Override + public Dimension getMinimumSize( JComponent c ) { + return applyMinimumWidth( c, super.getMinimumSize( c ) ); + } + + private Dimension applyMinimumWidth( JComponent c, Dimension size ) { + // do not apply minimum width if JTextArea.columns is set + if( c instanceof JTextArea && ((JTextArea)c).getColumns() > 0 ) + return size; + + return FlatEditorPaneUI.applyMinimumWidth( c, size, minimumWidth ); + } + + @Override + protected void paintSafely( Graphics g ) { + super.paintSafely( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) ); + } + @Override protected void paintBackground( Graphics g ) { JTextComponent c = getComponent(); - Color background = c.getBackground(); - g.setColor( !(background instanceof UIResource) - ? background - : (isIntelliJTheme && (!c.isEnabled() || !c.isEditable()) - ? FlatUIUtils.getParentBackground( c ) - : (!c.isEnabled() - ? disabledBackground - : (!c.isEditable() ? inactiveBackground : background))) ); - g.fillRect( 0, 0, c.getWidth(), c.getHeight() ); - } + // for compatibility with IntelliJ themes + if( isIntelliJTheme && (!c.isEnabled() || !c.isEditable()) && (c.getBackground() instanceof UIResource) ) { + FlatUIUtils.paintParentBackground( g, c ); + return; + } - @Override - public Dimension getPreferredSize( JComponent c ) { - return applyMinimumWidth( super.getPreferredSize( c ), c ); - } - - @Override - public Dimension getMinimumSize( JComponent c ) { - return applyMinimumWidth( super.getMinimumSize( c ), c ); - } - - private Dimension applyMinimumWidth( Dimension size, JComponent c ) { - // do not apply minimum width if JTextArea.columns is set - if( c instanceof JTextArea && ((JTextArea)c).getColumns() > 0 ) - return size; - - // Assume that text area is in a scroll pane (that displays the border) - // and subtract 1px border line width. - // Using "(scale( 1 ) * 2)" instead of "scale( 2 )" to deal with rounding - // issues. E.g. at scale factor 1.5 the first returns 4, but the second 3. - int minimumWidth = FlatUIUtils.minimumWidth( getComponent(), this.minimumWidth ); - size.width = Math.max( size.width, scale( minimumWidth ) - (scale( 1 ) * 2) ); - return size; + super.paintBackground( g ); } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextBorder.java index 2e24358c..b57a1088 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextBorder.java @@ -16,14 +16,13 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Component; import javax.swing.UIManager; /** * Border for various text components (e.g. {@link javax.swing.JTextField}). * - * @uiDefault Component.arc int + * @uiDefault TextComponent.arc int * * @author Karl Tauber */ @@ -33,7 +32,11 @@ public class FlatTextBorder protected final int arc = UIManager.getInt( "TextComponent.arc" ); @Override - protected float getArc( Component c ) { - return scale( (float) arc ); + protected int getArc( Component c ) { + if( isCellEditor( c ) ) + return 0; + + Boolean roundRect = FlatUIUtils.isRoundRect( c ); + return roundRect != null ? (roundRect ? Short.MAX_VALUE : 0) : arc; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextFieldUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextFieldUI.java index e566b07b..edcc3c0b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextFieldUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextFieldUI.java @@ -32,13 +32,13 @@ import javax.swing.JSpinner; import javax.swing.JTextField; import javax.swing.LookAndFeel; import javax.swing.UIManager; -import javax.swing.border.Border; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicTextFieldUI; import javax.swing.text.Caret; import javax.swing.text.JTextComponent; import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.util.HiDPIUtils; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JTextField}. @@ -60,8 +60,6 @@ import com.formdev.flatlaf.FlatClientProperties; * * * - * @uiDefault TextComponent.arc int - * @uiDefault Component.focusWidth int * @uiDefault Component.minimumWidth int * @uiDefault Component.isIntelliJTheme boolean * @uiDefault TextField.placeholderForeground Color @@ -72,8 +70,6 @@ import com.formdev.flatlaf.FlatClientProperties; public class FlatTextFieldUI extends BasicTextFieldUI { - protected int arc; - protected int focusWidth; protected int minimumWidth; protected boolean isIntelliJTheme; protected Color placeholderForeground; @@ -89,15 +85,13 @@ public class FlatTextFieldUI super.installDefaults(); String prefix = getPropertyPrefix(); - arc = UIManager.getInt( "TextComponent.arc" ); - focusWidth = UIManager.getInt( "Component.focusWidth" ); minimumWidth = UIManager.getInt( "Component.minimumWidth" ); isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" ); placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" ); - LookAndFeel.installProperty( getComponent(), "opaque", focusWidth == 0 ); + LookAndFeel.installProperty( getComponent(), "opaque", false ); - MigLayoutVisualPadding.install( getComponent(), focusWidth ); + MigLayoutVisualPadding.install( getComponent() ); } @Override @@ -133,16 +127,28 @@ public class FlatTextFieldUI @Override protected void propertyChange( PropertyChangeEvent e ) { super.propertyChange( e ); + propertyChange( getComponent(), e ); + } - if( FlatClientProperties.PLACEHOLDER_TEXT.equals( e.getPropertyName() ) ) - getComponent().repaint(); + static void propertyChange( JTextComponent c, PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case FlatClientProperties.PLACEHOLDER_TEXT: + case FlatClientProperties.COMPONENT_ROUND_RECT: + c.repaint(); + break; + + case FlatClientProperties.MINIMUM_WIDTH: + c.revalidate(); + break; + } } @Override protected void paintSafely( Graphics g ) { - paintBackground( g, getComponent(), focusWidth, arc, isIntelliJTheme ); + paintBackground( g, getComponent(), isIntelliJTheme ); paintPlaceholder( g, getComponent(), placeholderForeground ); - super.paintSafely( g ); + + super.paintSafely( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) ); } @Override @@ -150,19 +156,20 @@ public class FlatTextFieldUI // background is painted elsewhere } - static void paintBackground( Graphics g, JTextComponent c, int focusWidth, int arc, boolean isIntelliJTheme ) { - Border border = c.getBorder(); - + static void paintBackground( Graphics g, JTextComponent c, boolean isIntelliJTheme ) { // do not paint background if: // - not opaque and // - border is not a flat border and // - opaque was explicitly set (to false) // (same behaviour as in AquaTextFieldUI) - if( !c.isOpaque() && !(border instanceof FlatBorder) && FlatUIUtils.hasOpaqueBeenExplicitlySet( c ) ) + if( !c.isOpaque() && FlatUIUtils.getOutsideFlatBorder( c ) == null && FlatUIUtils.hasOpaqueBeenExplicitlySet( c ) ) return; + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + float arc = FlatUIUtils.getBorderArc( c ); + // fill background if opaque to avoid garbage if user sets opaque to true - if( c.isOpaque() && focusWidth > 0 ) + if( c.isOpaque() && (focusWidth > 0 || arc > 0) ) FlatUIUtils.paintParentBackground( g, c ); // paint background @@ -170,16 +177,13 @@ public class FlatTextFieldUI try { FlatUIUtils.setRenderingHints( g2 ); - float fFocusWidth = (border instanceof FlatBorder) ? scale( (float) focusWidth ) : 0; - float fArc = (border instanceof FlatTextBorder) ? scale( (float) arc ) : 0; - Color background = c.getBackground(); g2.setColor( !(background instanceof UIResource) ? background : (isIntelliJTheme && (!c.isEnabled() || !c.isEditable()) ? FlatUIUtils.getParentBackground( c ) : background) ); - FlatUIUtils.paintComponentBackground( g2, 0, 0, c.getWidth(), c.getHeight(), fFocusWidth, fArc ); + FlatUIUtils.paintComponentBackground( g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, arc ); } finally { g2.dispose(); } @@ -212,28 +216,29 @@ public class FlatTextFieldUI @Override public Dimension getPreferredSize( JComponent c ) { - return applyMinimumWidth( super.getPreferredSize( c ), c ); + return applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth ); } @Override public Dimension getMinimumSize( JComponent c ) { - return applyMinimumWidth( super.getMinimumSize( c ), c ); + return applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth ); } - private Dimension applyMinimumWidth( Dimension size, JComponent c ) { + static Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth ) { // do not apply minimum width if JTextField.columns is set if( c instanceof JTextField && ((JTextField)c).getColumns() > 0 ) return size; + // do not apply minimum width if used in combobox or spinner Container parent = c.getParent(); if( parent instanceof JComboBox || parent instanceof JSpinner || (parent != null && parent.getParent() instanceof JSpinner) ) return size; - int minimumWidth = FlatUIUtils.minimumWidth( getComponent(), this.minimumWidth ); - int focusWidth = (c.getBorder() instanceof FlatBorder) ? this.focusWidth : 0; - size.width = Math.max( size.width, scale( minimumWidth + (focusWidth * 2) ) ); + minimumWidth = FlatUIUtils.minimumWidth( c, minimumWidth ); + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + size.width = Math.max( size.width, scale( minimumWidth ) + Math.round( focusWidth * 2 ) ); return size; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextPaneUI.java index b6c70926..0def747f 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextPaneUI.java @@ -16,9 +16,10 @@ package com.formdev.flatlaf.ui; -import static com.formdev.flatlaf.util.UIScale.scale; import java.awt.Dimension; import java.awt.Graphics; +import java.awt.Graphics2D; +import java.beans.PropertyChangeEvent; import javax.swing.JComponent; import javax.swing.JEditorPane; import javax.swing.UIManager; @@ -26,6 +27,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicTextPaneUI; import javax.swing.text.JTextComponent; +import com.formdev.flatlaf.util.HiDPIUtils; /** * Provides the Flat LaF UI delegate for {@link javax.swing.JTextPane}. @@ -83,24 +85,25 @@ public class FlatTextPaneUI getComponent().putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, oldHonorDisplayProperties ); } + @Override + protected void propertyChange( PropertyChangeEvent e ) { + super.propertyChange( e ); + FlatEditorPaneUI.propertyChange( getComponent(), e ); + } + @Override public Dimension getPreferredSize( JComponent c ) { - return applyMinimumWidth( super.getPreferredSize( c ) ); + return FlatEditorPaneUI.applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth ); } @Override public Dimension getMinimumSize( JComponent c ) { - return applyMinimumWidth( super.getMinimumSize( c ) ); + return FlatEditorPaneUI.applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth ); } - private Dimension applyMinimumWidth( Dimension size ) { - // Assume that text area is in a scroll pane (that displays the border) - // and subtract 1px border line width. - // Using "(scale( 1 ) * 2)" instead of "scale( 2 )" to deal with rounding - // issues. E.g. at scale factor 1.5 the first returns 4, but the second 3. - int minimumWidth = FlatUIUtils.minimumWidth( getComponent(), this.minimumWidth ); - size.width = Math.max( size.width, scale( minimumWidth ) - (scale( 1 ) * 2) ); - return size; + @Override + protected void paintSafely( Graphics g ) { + super.paintSafely( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ) ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java new file mode 100644 index 00000000..ac13a231 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java @@ -0,0 +1,867 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.ActionListener; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.geom.AffineTransform; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import javax.accessibility.AccessibleContext; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JMenuBar; +import javax.swing.JPanel; +import javax.swing.JRootPane; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.AbstractBorder; +import javax.swing.border.Border; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.FlatSystemProperties; +import com.formdev.flatlaf.ui.JBRCustomDecorations.JBRWindowTopBorder; +import com.formdev.flatlaf.util.ScaledImageIcon; +import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; + +/** + * Provides the Flat LaF title bar. + * + * @uiDefault TitlePane.background Color + * @uiDefault TitlePane.inactiveBackground Color + * @uiDefault TitlePane.foreground Color + * @uiDefault TitlePane.inactiveForeground Color + * @uiDefault TitlePane.embeddedForeground Color + * @uiDefault TitlePane.borderColor Color optional + * @uiDefault TitlePane.iconSize Dimension + * @uiDefault TitlePane.iconMargins Insets + * @uiDefault TitlePane.titleMargins Insets + * @uiDefault TitlePane.menuBarMargins Insets + * @uiDefault TitlePane.menuBarEmbedded boolean + * @uiDefault TitlePane.buttonMaximizedHeight int + * @uiDefault TitlePane.closeIcon Icon + * @uiDefault TitlePane.iconifyIcon Icon + * @uiDefault TitlePane.maximizeIcon Icon + * @uiDefault TitlePane.restoreIcon Icon + * + * @author Karl Tauber + */ +public class FlatTitlePane + extends JComponent +{ + protected final Color activeBackground = UIManager.getColor( "TitlePane.background" ); + protected final Color inactiveBackground = UIManager.getColor( "TitlePane.inactiveBackground" ); + protected final Color activeForeground = UIManager.getColor( "TitlePane.foreground" ); + protected final Color inactiveForeground = UIManager.getColor( "TitlePane.inactiveForeground" ); + protected final Color embeddedForeground = UIManager.getColor( "TitlePane.embeddedForeground" ); + protected final Color borderColor = UIManager.getColor( "TitlePane.borderColor" ); + + protected final Insets menuBarMargins = UIManager.getInsets( "TitlePane.menuBarMargins" ); + protected final Dimension iconSize = UIManager.getDimension( "TitlePane.iconSize" ); + protected final int buttonMaximizedHeight = UIManager.getInt( "TitlePane.buttonMaximizedHeight" ); + + protected final JRootPane rootPane; + + protected JPanel leftPanel; + protected JLabel iconLabel; + protected JComponent menuBarPlaceholder; + protected JLabel titleLabel; + protected JPanel buttonPanel; + protected JButton iconifyButton; + protected JButton maximizeButton; + protected JButton restoreButton; + protected JButton closeButton; + + protected Window window; + + private final Handler handler; + + public FlatTitlePane( JRootPane rootPane ) { + this.rootPane = rootPane; + + handler = createHandler(); + setBorder( createTitlePaneBorder() ); + + addSubComponents(); + activeChanged( true ); + + addMouseListener( handler ); + addMouseMotionListener( handler ); + + // necessary for closing window with double-click on icon + iconLabel.addMouseListener( handler ); + } + + protected FlatTitlePaneBorder createTitlePaneBorder() { + return new FlatTitlePaneBorder(); + } + + protected Handler createHandler() { + return new Handler(); + } + + protected void addSubComponents() { + leftPanel = new JPanel(); + iconLabel = new JLabel(); + titleLabel = new JLabel(); + iconLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.iconMargins" ) ) ); + titleLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.titleMargins" ) ) ); + + leftPanel.setLayout( new BoxLayout( leftPanel, BoxLayout.LINE_AXIS ) ); + leftPanel.setOpaque( false ); + leftPanel.add( iconLabel ); + + menuBarPlaceholder = new JComponent() { + @Override + public Dimension getPreferredSize() { + JMenuBar menuBar = rootPane.getJMenuBar(); + return (menuBar != null && menuBar.isVisible() && isMenuBarEmbedded()) + ? FlatUIUtils.addInsets( menuBar.getPreferredSize(), UIScale.scale( menuBarMargins ) ) + : new Dimension(); + } + }; + leftPanel.add( menuBarPlaceholder ); + + createButtons(); + + setLayout( new BorderLayout() { + @Override + public void layoutContainer( Container target ) { + super.layoutContainer( target ); + + // make left panel (with embedded menu bar) smaller if horizontal space is rare + // to avoid that embedded menu bar overlaps button bar + Insets insets = target.getInsets(); + int width = target.getWidth() - insets.left - insets.right; + if( leftPanel.getWidth() + buttonPanel.getWidth() > width ) { + int oldWidth = leftPanel.getWidth(); + int newWidth = Math.max( width - buttonPanel.getWidth(), 0 ); + leftPanel.setSize( newWidth, leftPanel.getHeight() ); + if( !getComponentOrientation().isLeftToRight() ) + leftPanel.setLocation( leftPanel.getX() + (oldWidth - newWidth), leftPanel.getY() ); + } + } + } ); + + add( leftPanel, BorderLayout.LINE_START ); + add( titleLabel, BorderLayout.CENTER ); + add( buttonPanel, BorderLayout.LINE_END ); + } + + protected void createButtons() { + iconifyButton = createButton( "TitlePane.iconifyIcon", "Iconify", e -> iconify() ); + maximizeButton = createButton( "TitlePane.maximizeIcon", "Maximize", e -> maximize() ); + restoreButton = createButton( "TitlePane.restoreIcon", "Restore", e -> restore() ); + closeButton = createButton( "TitlePane.closeIcon", "Close", e -> close() ); + + buttonPanel = new JPanel() { + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + if( buttonMaximizedHeight > 0 && + window instanceof Frame && + (((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0 ) + { + // make title pane height smaller when frame is maximized + size = new Dimension( size.width, Math.min( size.height, UIScale.scale( buttonMaximizedHeight ) ) ); + } + return size; + } + }; + buttonPanel.setOpaque( false ); + buttonPanel.setLayout( new BoxLayout( buttonPanel, BoxLayout.LINE_AXIS ) ); + if( rootPane.getWindowDecorationStyle() == JRootPane.FRAME ) { + // JRootPane.FRAME works only for frames (and not for dialogs) + // but at this time the owner window type is unknown (not yet added) + // so we add the iconify/maximize/restore buttons and they are hidden + // later in frameStateChanged(), which is invoked from addNotify() + + restoreButton.setVisible( false ); + + buttonPanel.add( iconifyButton ); + buttonPanel.add( maximizeButton ); + buttonPanel.add( restoreButton ); + } + buttonPanel.add( closeButton ); + } + + protected JButton createButton( String iconKey, String accessibleName, ActionListener action ) { + JButton button = new JButton( UIManager.getIcon( iconKey ) ); + button.setFocusable( false ); + button.setContentAreaFilled( false ); + button.setBorder( BorderFactory.createEmptyBorder() ); + button.putClientProperty( AccessibleContext.ACCESSIBLE_NAME_PROPERTY, accessibleName ); + button.addActionListener( action ); + return button; + } + + protected void activeChanged( boolean active ) { + boolean hasEmbeddedMenuBar = rootPane.getJMenuBar() != null && rootPane.getJMenuBar().isVisible() && isMenuBarEmbedded(); + Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground ); + Color foreground = FlatUIUtils.nonUIResource( active ? activeForeground : inactiveForeground ); + Color titleForeground = (hasEmbeddedMenuBar && active) ? FlatUIUtils.nonUIResource( embeddedForeground ) : foreground; + + setBackground( background ); + titleLabel.setForeground( titleForeground ); + iconifyButton.setForeground( foreground ); + maximizeButton.setForeground( foreground ); + restoreButton.setForeground( foreground ); + closeButton.setForeground( foreground ); + + titleLabel.setHorizontalAlignment( hasEmbeddedMenuBar ? SwingConstants.CENTER : SwingConstants.LEADING ); + + // this is necessary because hover/pressed colors are derived from background color + iconifyButton.setBackground( background ); + maximizeButton.setBackground( background ); + restoreButton.setBackground( background ); + closeButton.setBackground( background ); + } + + protected void frameStateChanged() { + if( window == null || rootPane.getWindowDecorationStyle() != JRootPane.FRAME ) + return; + + if( window instanceof Frame ) { + Frame frame = (Frame) window; + boolean resizable = frame.isResizable(); + boolean maximized = ((frame.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0); + + iconifyButton.setVisible( true ); + maximizeButton.setVisible( resizable && !maximized ); + restoreButton.setVisible( resizable && maximized ); + + if( maximized && + rootPane.getClientProperty( "_flatlaf.maximizedBoundsUpToDate" ) == null ) + { + rootPane.putClientProperty( "_flatlaf.maximizedBoundsUpToDate", null ); + + // In case that frame was maximized from custom code (e.g. when restoring + // window state on application startup), then maximized bounds is not set + // and the window would overlap Windows task bar. + // To avoid this, update maximized bounds here and if it has changed + // re-maximize windows so that maximized bounds are used. + Rectangle oldMaximizedBounds = frame.getMaximizedBounds(); + updateMaximizedBounds(); + Rectangle newMaximizedBounds = frame.getMaximizedBounds(); + if( newMaximizedBounds != null && !newMaximizedBounds.equals( oldMaximizedBounds ) ) { + int oldExtendedState = frame.getExtendedState(); + frame.setExtendedState( oldExtendedState & ~Frame.MAXIMIZED_BOTH ); + frame.setExtendedState( oldExtendedState ); + } + } + } else { + // hide buttons because they are only supported in frames + iconifyButton.setVisible( false ); + maximizeButton.setVisible( false ); + restoreButton.setVisible( false ); + + revalidate(); + repaint(); + } + } + + protected void updateIcon() { + // get window images + List images = window.getIconImages(); + if( images.isEmpty() ) { + // search in owners + for( Window owner = window.getOwner(); owner != null; owner = owner.getOwner() ) { + images = owner.getIconImages(); + if( !images.isEmpty() ) + break; + } + } + + boolean hasIcon = true; + + // set icon + if( !images.isEmpty() ) + iconLabel.setIcon( FlatTitlePaneIcon.create( images, iconSize ) ); + else { + // no icon set on window --> use default icon + Icon defaultIcon = UIManager.getIcon( "InternalFrame.icon" ); + if( defaultIcon != null && (defaultIcon.getIconWidth() == 0 || defaultIcon.getIconHeight() == 0) ) + defaultIcon = null; + if( defaultIcon != null ) { + if( defaultIcon instanceof ImageIcon ) + defaultIcon = new ScaledImageIcon( (ImageIcon) defaultIcon, iconSize.width, iconSize.height ); + iconLabel.setIcon( defaultIcon ); + } else + hasIcon = false; + } + + // show/hide icon + iconLabel.setVisible( hasIcon ); + + updateJBRHitTestSpotsAndTitleBarHeightLater(); + } + + @Override + public void addNotify() { + super.addNotify(); + + uninstallWindowListeners(); + + window = SwingUtilities.getWindowAncestor( this ); + if( window != null ) { + frameStateChanged(); + activeChanged( window.isActive() ); + updateIcon(); + titleLabel.setText( getWindowTitle() ); + installWindowListeners(); + } + + updateJBRHitTestSpotsAndTitleBarHeightLater(); + } + + @Override + public void removeNotify() { + super.removeNotify(); + + uninstallWindowListeners(); + window = null; + } + + protected String getWindowTitle() { + if( window instanceof Frame ) + return ((Frame)window).getTitle(); + if( window instanceof Dialog ) + return ((Dialog)window).getTitle(); + return null; + } + + protected void installWindowListeners() { + if( window == null ) + return; + + window.addPropertyChangeListener( handler ); + window.addWindowListener( handler ); + window.addWindowStateListener( handler ); + window.addComponentListener( handler ); + } + + protected void uninstallWindowListeners() { + if( window == null ) + return; + + window.removePropertyChangeListener( handler ); + window.removeWindowListener( handler ); + window.removeWindowStateListener( handler ); + window.removeComponentListener( handler ); + } + + protected boolean isMenuBarEmbedded() { + // not storing value of "TitlePane.menuBarEmbedded" in class to allow changing at runtime + return UIManager.getBoolean( "TitlePane.menuBarEmbedded" ) && + FlatClientProperties.clientPropertyBoolean( rootPane, FlatClientProperties.MENU_BAR_EMBEDDED, true ) && + FlatSystemProperties.getBoolean( FlatSystemProperties.MENUBAR_EMBEDDED, true ); + } + + protected Rectangle getMenuBarBounds() { + Insets insets = rootPane.getInsets(); + Rectangle bounds = new Rectangle( + SwingUtilities.convertPoint( menuBarPlaceholder, -insets.left, -insets.top, rootPane ), + menuBarPlaceholder.getSize() ); + + // add menu bar bottom border insets to bounds so that menu bar overlaps + // title pane border (menu bar border is painted over title pane border) + Insets borderInsets = getBorder().getBorderInsets( this ); + bounds.height += borderInsets.bottom; + + return FlatUIUtils.subtractInsets( bounds, UIScale.scale( getMenuBarMargins() ) ); + } + + protected Insets getMenuBarMargins() { + return getComponentOrientation().isLeftToRight() + ? menuBarMargins + : new Insets( menuBarMargins.top, menuBarMargins.right, menuBarMargins.bottom, menuBarMargins.left ); + } + + protected void menuBarChanged() { + menuBarPlaceholder.invalidate(); + + // necessary for the case that an embedded menu bar is made invisible + // and a border color is specified + repaint(); + + // update title foreground color + EventQueue.invokeLater( () -> { + activeChanged( window == null || window.isActive() ); + } ); + } + + protected void menuBarLayouted() { + updateJBRHitTestSpotsAndTitleBarHeightLater(); + } + +/*debug + @Override + public void paint( Graphics g ) { + super.paint( g ); + + if( debugTitleBarHeight > 0 ) { + g.setColor( Color.green ); + g.drawLine( 0, debugTitleBarHeight, getWidth(), debugTitleBarHeight ); + } + if( debugHitTestSpots != null ) { + g.setColor( Color.blue ); + for( Rectangle r : debugHitTestSpots ) + g.drawRect( r.x, r.y, r.width, r.height ); + } + } +debug*/ + + @Override + protected void paintComponent( Graphics g ) { + g.setColor( getBackground() ); + g.fillRect( 0, 0, getWidth(), getHeight() ); + } + + protected void repaintWindowBorder() { + int width = rootPane.getWidth(); + int height = rootPane.getHeight(); + Insets insets = rootPane.getInsets(); + rootPane.repaint( 0, 0, width, insets.top ); // top + rootPane.repaint( 0, 0, insets.left, height ); // left + rootPane.repaint( 0, height - insets.bottom, width, insets.bottom ); // bottom + rootPane.repaint( width - insets.right, 0, insets.right, height ); // right + } + + /** + * Iconifies the window. + */ + protected void iconify() { + if( window instanceof Frame ) { + Frame frame = (Frame) window; + frame.setExtendedState( frame.getExtendedState() | Frame.ICONIFIED ); + } + } + + /** + * Maximizes the window. + */ + protected void maximize() { + if( !(window instanceof Frame) ) + return; + + Frame frame = (Frame) window; + + updateMaximizedBounds(); + + // let our WindowStateListener know that the maximized bounds are up-to-date + rootPane.putClientProperty( "_flatlaf.maximizedBoundsUpToDate", true ); + + // maximize window + frame.setExtendedState( frame.getExtendedState() | Frame.MAXIMIZED_BOTH ); + } + + protected void updateMaximizedBounds() { + Frame frame = (Frame) window; + + // set maximized bounds to avoid that maximized window overlaps Windows task bar + // (if not running in JBR and if not modified from the application) + Rectangle oldMaximizedBounds = frame.getMaximizedBounds(); + if( !hasJBRCustomDecoration() && + (oldMaximizedBounds == null || + Objects.equals( oldMaximizedBounds, rootPane.getClientProperty( "_flatlaf.maximizedBounds" ) )) ) + { + GraphicsConfiguration gc = window.getGraphicsConfiguration(); + + // Screen bounds, which may be smaller than physical size on Java 9+. + // E.g. if running a 3840x2160 screen at 200%, screenBounds.size is 1920x1080. + // In Java 9+, each screen can have its own scale factor. + // + // On Java 8, which does not scale, screenBounds.size of the primary screen + // is identical to its physical size. But when the primary screen is scaled, + // then screenBounds.size of secondary screens is scaled with the scale factor + // of the primary screen. + // E.g. primary 3840x2160 screen at 150%, secondary 1920x1080 screen at 100%, + // then screenBounds.size is 3840x2160 on primary and 2880x1560 on secondary. + Rectangle screenBounds = gc.getBounds(); + + int maximizedX = screenBounds.x; + int maximizedY = screenBounds.y; + int maximizedWidth = screenBounds.width; + int maximizedHeight = screenBounds.height; + + if( !isMaximizedBoundsFixed() ) { + // on Java 8 to 14, maximized x,y are 0,0 based on all screens in a multi-screen environment + maximizedX = 0; + maximizedY = 0; + + // scale maximized screen size to get physical screen size for Java 9 to 14 + AffineTransform defaultTransform = gc.getDefaultTransform(); + maximizedWidth = (int) (maximizedWidth * defaultTransform.getScaleX()); + maximizedHeight = (int) (maximizedHeight * defaultTransform.getScaleY()); + } + + // screen insets are in physical size, except for Java 15+ + // (see https://bugs.openjdk.java.net/browse/JDK-8243925) + // and except for Java 8 on secondary screens where primary screen is scaled + Insets screenInsets = window.getToolkit().getScreenInsets( gc ); + + // maximized bounds are required in physical size, except for Java 15+ + // (see https://bugs.openjdk.java.net/browse/JDK-8231564 and + // https://bugs.openjdk.java.net/browse/JDK-8176359) + // and except for Java 8 on secondary screens where primary screen is scaled + Rectangle newMaximizedBounds = new Rectangle( + maximizedX + screenInsets.left, + maximizedY + screenInsets.top, + maximizedWidth - screenInsets.left - screenInsets.right, + maximizedHeight - screenInsets.top - screenInsets.bottom ); + + if( !Objects.equals( oldMaximizedBounds, newMaximizedBounds ) ) { + // change maximized bounds + frame.setMaximizedBounds( newMaximizedBounds ); + + // remember maximized bounds in client property to be able to detect + // whether maximized bounds are modified from the application + rootPane.putClientProperty( "_flatlaf.maximizedBounds", newMaximizedBounds ); + } + } + } + + /** + * Frame.setMaximizedBounds() behaves different on some Java versions after issues + * https://bugs.openjdk.java.net/browse/JDK-8231564 and + * https://bugs.openjdk.java.net/browse/JDK-8176359 + * (see also https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8176359) + * were fixed in Java 15 and backported to 11.0.8 and 13.0.4. + */ + private boolean isMaximizedBoundsFixed() { + return SystemInfo.isJava_15_orLater || + (SystemInfo.javaVersion >= SystemInfo.toVersion( 11, 0, 8, 0 ) && + SystemInfo.javaVersion < SystemInfo.toVersion( 12, 0, 0, 0 )) || + (SystemInfo.javaVersion >= SystemInfo.toVersion( 13, 0, 4, 0 ) && + SystemInfo.javaVersion < SystemInfo.toVersion( 14, 0, 0, 0 )); + } + + /** + * Restores the window size. + */ + protected void restore() { + if( window instanceof Frame ) { + Frame frame = (Frame) window; + int state = frame.getExtendedState(); + frame.setExtendedState( ((state & Frame.ICONIFIED) != 0) + ? (state & ~Frame.ICONIFIED) + : (state & ~Frame.MAXIMIZED_BOTH) ); + } + } + + /** + * Closes the window. + */ + protected void close() { + if( window != null ) + window.dispatchEvent( new WindowEvent( window, WindowEvent.WINDOW_CLOSING ) ); + } + + protected boolean hasJBRCustomDecoration() { + return FlatRootPaneUI.canUseJBRCustomDecorations && + window != null && + JBRCustomDecorations.hasCustomDecoration( window ); + } + + protected void updateJBRHitTestSpotsAndTitleBarHeightLater() { + EventQueue.invokeLater( () -> { + updateJBRHitTestSpotsAndTitleBarHeight(); + } ); + } + + protected void updateJBRHitTestSpotsAndTitleBarHeight() { + if( !isDisplayable() ) + return; + + if( !hasJBRCustomDecoration() ) + return; + + List hitTestSpots = new ArrayList<>(); + if( iconLabel.isVisible() ) + addJBRHitTestSpot( iconLabel, false, hitTestSpots ); + addJBRHitTestSpot( buttonPanel, false, hitTestSpots ); + addJBRHitTestSpot( menuBarPlaceholder, true, hitTestSpots ); + + int titleBarHeight = getHeight(); + // slightly reduce height so that component receives mouseExit events + if( titleBarHeight > 0 ) + titleBarHeight--; + + JBRCustomDecorations.setHitTestSpotsAndTitleBarHeight( window, hitTestSpots, titleBarHeight ); + +/*debug + debugHitTestSpots = hitTestSpots; + debugTitleBarHeight = titleBarHeight; + repaint(); +debug*/ + } + + protected void addJBRHitTestSpot( JComponent c, boolean subtractMenuBarMargins, List hitTestSpots ) { + Dimension size = c.getSize(); + if( size.width <= 0 || size.height <= 0 ) + return; + + Point location = SwingUtilities.convertPoint( c, 0, 0, window ); + Rectangle r = new Rectangle( location, size ); + if( subtractMenuBarMargins ) + r = FlatUIUtils.subtractInsets( r, UIScale.scale( getMenuBarMargins() ) ); + // slightly increase rectangle so that component receives mouseExit events + r.grow( 2, 2 ); + hitTestSpots.add( r ); + } + +/*debug + private List debugHitTestSpots; + private int debugTitleBarHeight; +debug*/ + + //---- class TitlePaneBorder ---------------------------------------------- + + protected class FlatTitlePaneBorder + extends AbstractBorder + { + @Override + public Insets getBorderInsets( Component c, Insets insets ) { + super.getBorderInsets( c, insets ); + + Border menuBarBorder = getMenuBarBorder(); + if( menuBarBorder != null ) { + // if menu bar is embedded, add bottom insets of menu bar border + Insets menuBarInsets = menuBarBorder.getBorderInsets( c ); + insets.bottom += menuBarInsets.bottom; + } else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) ) + insets.bottom += UIScale.scale( 1 ); + + if( hasJBRCustomDecoration() ) + insets = FlatUIUtils.addInsets( insets, JBRWindowTopBorder.getInstance().getBorderInsets() ); + + return insets; + } + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + // paint bottom border + Border menuBarBorder = getMenuBarBorder(); + if( menuBarBorder != null ) { + // if menu bar is embedded, paint menu bar border + menuBarBorder.paintBorder( c, g, x, y, width, height ); + } else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) ) { + // paint border between title pane and content if border color is specified + float lineHeight = UIScale.scale( (float) 1 ); + FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight ); + } + + if( hasJBRCustomDecoration() ) + JBRWindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height ); + } + + protected Border getMenuBarBorder() { + JMenuBar menuBar = rootPane.getJMenuBar(); + return (menuBar != null && menuBar.isVisible() && isMenuBarEmbedded()) ? menuBar.getBorder() : null; + } + } + + //---- class Handler ------------------------------------------------------ + + protected class Handler + extends WindowAdapter + implements PropertyChangeListener, MouseListener, MouseMotionListener, ComponentListener + { + //---- interface PropertyChangeListener ---- + + @Override + public void propertyChange( PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case "title": + titleLabel.setText( getWindowTitle() ); + break; + + case "resizable": + if( window instanceof Frame ) + frameStateChanged(); + break; + + case "iconImage": + updateIcon(); + break; + + case "componentOrientation": + updateJBRHitTestSpotsAndTitleBarHeightLater(); + break; + } + } + + //---- interface WindowListener ---- + + @Override + public void windowActivated( WindowEvent e ) { + activeChanged( true ); + updateJBRHitTestSpotsAndTitleBarHeight(); + + if( hasJBRCustomDecoration() ) + JBRWindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this ); + + repaintWindowBorder(); + } + + @Override + public void windowDeactivated( WindowEvent e ) { + activeChanged( false ); + updateJBRHitTestSpotsAndTitleBarHeight(); + + if( hasJBRCustomDecoration() ) + JBRWindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this ); + + repaintWindowBorder(); + } + + @Override + public void windowStateChanged( WindowEvent e ) { + frameStateChanged(); + updateJBRHitTestSpotsAndTitleBarHeight(); + } + + //---- interface MouseListener ---- + + private Point dragOffset; + + @Override + public void mouseClicked( MouseEvent e ) { + if( e.getClickCount() == 2 && SwingUtilities.isLeftMouseButton( e ) ) { + if( e.getSource() == iconLabel ) { + // double-click on icon closes window + close(); + } else if( !hasJBRCustomDecoration() && + window instanceof Frame && + ((Frame)window).isResizable() ) + { + // maximize/restore on double-click + Frame frame = (Frame) window; + if( (frame.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0 ) + restore(); + else + maximize(); + } + } + } + + @Override + public void mousePressed( MouseEvent e ) { + if( window == null ) + return; // should newer occur + + dragOffset = SwingUtilities.convertPoint( FlatTitlePane.this, e.getPoint(), window ); + } + + @Override public void mouseReleased( MouseEvent e ) {} + @Override public void mouseEntered( MouseEvent e ) {} + @Override public void mouseExited( MouseEvent e ) {} + + //---- interface MouseMotionListener ---- + + @Override + public void mouseDragged( MouseEvent e ) { + if( window == null ) + return; // should newer occur + + if( hasJBRCustomDecoration() ) + return; // do nothing if running in JBR + + // restore window if it is maximized + if( window instanceof Frame ) { + Frame frame = (Frame) window; + int state = frame.getExtendedState(); + if( (state & Frame.MAXIMIZED_BOTH) != 0 ) { + int maximizedWidth = window.getWidth(); + + // restore window size, which also moves window to pre-maximized location + frame.setExtendedState( state & ~Frame.MAXIMIZED_BOTH ); + + // fix drag offset to ensure that window remains under mouse position + // for the case that dragging starts in the right area of the maximized window + int restoredWidth = window.getWidth(); + int center = restoredWidth / 2; + if( dragOffset.x > center ) { + // this is same/similar to what Windows 10 does + if( dragOffset.x > maximizedWidth - center ) + dragOffset.x = restoredWidth - (maximizedWidth - dragOffset.x); + else + dragOffset.x = center; + } + } + } + + // compute new window location + int newX = e.getXOnScreen() - dragOffset.x; + int newY = e.getYOnScreen() - dragOffset.y; + + if( newX == window.getX() && newY == window.getY() ) + return; + + // move window + window.setLocation( newX, newY ); + } + + @Override public void mouseMoved( MouseEvent e ) {} + + //---- interface ComponentListener ---- + + @Override + public void componentResized( ComponentEvent e ) { + updateJBRHitTestSpotsAndTitleBarHeightLater(); + } + + @Override + public void componentShown( ComponentEvent e ) { + // necessary for the case that the frame is maximized before it is shown + frameStateChanged(); + } + + @Override public void componentMoved( ComponentEvent e ) {} + @Override public void componentHidden( ComponentEvent e ) {} + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePaneIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePaneIcon.java new file mode 100644 index 00000000..fbe166a0 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePaneIcon.java @@ -0,0 +1,70 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.awt.Dimension; +import java.awt.Image; +import java.util.ArrayList; +import java.util.List; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import com.formdev.flatlaf.util.MultiResolutionImageSupport; +import com.formdev.flatlaf.util.ScaledImageIcon; + +/** + * @author Karl Tauber + */ +public class FlatTitlePaneIcon + extends ScaledImageIcon +{ + public static Icon create( List images, Dimension size ) { + // collect all images including multi-resolution variants + List allImages = new ArrayList<>(); + for( Image image : images ) { + if( MultiResolutionImageSupport.isMultiResolutionImage( image ) ) + allImages.addAll( MultiResolutionImageSupport.getResolutionVariants( image ) ); + else + allImages.add( image ); + } + + // sort images by size + allImages.sort( (image1, image2) -> { + return image1.getWidth( null ) - image2.getWidth( null ); + } ); + + // create icon + return new FlatTitlePaneIcon( allImages, size ); + } + + private final List images; + + private FlatTitlePaneIcon( List images, Dimension size ) { + super( new ImageIcon( images.get( 0 ) ), size.width, size.height ); + this.images = images; + } + + @Override + protected Image getResolutionVariant( int destImageWidth, int destImageHeight ) { + for( Image image : images ) { + if( destImageWidth <= image.getWidth( null ) && + destImageHeight <= image.getHeight( null ) ) + return image; + } + + return images.get( images.size() - 1 ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToggleButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToggleButtonUI.java index c664a7dd..22dedbdc 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToggleButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToggleButtonUI.java @@ -22,7 +22,6 @@ import java.awt.Component; import java.awt.Graphics; import java.beans.PropertyChangeEvent; import javax.swing.AbstractButton; -import javax.swing.ButtonModel; import javax.swing.JComponent; import javax.swing.JToggleButton; import javax.swing.UIManager; @@ -50,17 +49,17 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault ToggleButton.startBackground Color optional; if set, a gradient paint is used and ToggleButton.background is ignored * @uiDefault ToggleButton.endBackground Color optional; if set, a gradient paint is used * @uiDefault ToggleButton.pressedBackground Color - * @uiDefault ToggleButton.disabledText Color - * @uiDefault ToggleButton.toolbar.hoverBackground Color - * @uiDefault ToggleButton.toolbar.pressedBackground Color - * - * - * * @uiDefault ToggleButton.selectedBackground Color * @uiDefault ToggleButton.selectedForeground Color + * @uiDefault ToggleButton.disabledBackground Color optional + * @uiDefault ToggleButton.disabledText Color * @uiDefault ToggleButton.disabledSelectedBackground Color + * @uiDefault ToggleButton.toolbar.hoverBackground Color + * @uiDefault ToggleButton.toolbar.pressedBackground Color * @uiDefault ToggleButton.toolbar.selectedBackground Color * + * + * * @uiDefault ToggleButton.tab.underlineHeight int * @uiDefault ToggleButton.tab.underlineColor Color * @uiDefault ToggleButton.tab.disabledUnderlineColor Color @@ -74,12 +73,6 @@ import com.formdev.flatlaf.util.UIScale; public class FlatToggleButtonUI extends FlatButtonUI { - protected Color selectedBackground; - protected Color selectedForeground; - protected Color disabledSelectedBackground; - - protected Color toolbarSelectedBackground; - protected int tabUnderlineHeight; protected Color tabUnderlineColor; protected Color tabDisabledUnderlineColor; @@ -89,12 +82,8 @@ public class FlatToggleButtonUI private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatToggleButtonUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatToggleButtonUI.class, FlatToggleButtonUI::new ); } @Override @@ -107,12 +96,6 @@ public class FlatToggleButtonUI super.installDefaults( b ); if( !defaults_initialized ) { - selectedBackground = UIManager.getColor( "ToggleButton.selectedBackground" ); - selectedForeground = UIManager.getColor( "ToggleButton.selectedForeground" ); - disabledSelectedBackground = UIManager.getColor( "ToggleButton.disabledSelectedBackground" ); - - toolbarSelectedBackground = UIManager.getColor( "ToggleButton.toolbar.selectedBackground" ); - tabUnderlineHeight = UIManager.getInt( "ToggleButton.tab.underlineHeight" ); tabUnderlineColor = UIManager.getColor( "ToggleButton.tab.underlineColor" ); tabDisabledUnderlineColor = UIManager.getColor( "ToggleButton.tab.disabledUnderlineColor" ); @@ -138,7 +121,7 @@ public class FlatToggleButtonUI case BUTTON_TYPE: if( BUTTON_TYPE_TAB.equals( e.getOldValue() ) || BUTTON_TYPE_TAB.equals( e.getNewValue() ) ) { MigLayoutVisualPadding.uninstall( b ); - MigLayoutVisualPadding.install( b, getFocusWidth( b ) ); + MigLayoutVisualPadding.install( b ); b.revalidate(); } @@ -184,37 +167,4 @@ public class FlatToggleButtonUI } else super.paintBackground( g, c ); } - - @Override - protected Color getBackground( JComponent c ) { - ButtonModel model = ((AbstractButton)c).getModel(); - - if( model.isSelected() ) { - // in toolbar use same colors for disabled and enabled because - // we assume that toolbar icon is shown disabled - boolean toolBarButton = isToolBarButton( c ); - return buttonStateColor( c, - toolBarButton ? toolbarSelectedBackground : selectedBackground, - toolBarButton ? toolbarSelectedBackground : disabledSelectedBackground, - null, null, - toolBarButton ? toolbarPressedBackground : pressedBackground ); - } - - return super.getBackground( c ); - } - - @Override - protected Color getForeground( JComponent c ) { - ButtonModel model = ((AbstractButton)c).getModel(); - - if( model.isSelected() && !isToolBarButton( c ) ) - return selectedForeground; - - return super.getForeground( c ); - } - - @Override - protected int getFocusWidth( JComponent c ) { - return isTabButton( c ) ? 0 : super.getFocusWidth( c ); - } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolBarSeparatorUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolBarSeparatorUI.java index 8a1877fc..8d0fa657 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolBarSeparatorUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolBarSeparatorUI.java @@ -50,12 +50,8 @@ public class FlatToolBarSeparatorUI private boolean defaults_initialized = false; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatToolBarSeparatorUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatToolBarSeparatorUI.class, FlatToolBarSeparatorUI::new ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolTipUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolTipUI.java index ee42b6e8..e900b966 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolTipUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatToolTipUI.java @@ -27,7 +27,9 @@ import javax.swing.JComponent; import javax.swing.JToolTip; import javax.swing.SwingUtilities; import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.basic.BasicToolTipUI; +import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.StringUtils; /** @@ -50,12 +52,8 @@ public class FlatToolTipUI { private static PropertyChangeListener sharedPropertyChangedListener; - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatToolTipUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatToolTipUI.class, FlatToolTipUI::new ); } @Override @@ -92,6 +90,11 @@ public class FlatToolTipUI @Override public Dimension getPreferredSize( JComponent c ) { + // do not show tool tip if text is empty + String text = ((JToolTip)c).getTipText(); + if( text == null || text.isEmpty() ) + return new Dimension(); + if( isMultiLine( c ) ) { FontMetrics fm = c.getFontMetrics( c.getFont() ); Insets insets = c.getInsets(); @@ -102,7 +105,7 @@ public class FlatToolTipUI for( String line : lines ) width = Math.max( width, SwingUtilities.computeStringWidth( fm, line ) ); - return new Dimension( insets.left + width + insets.right, insets.top + height + insets.bottom ); + return new Dimension( insets.left + width + insets.right + 6, insets.top + height + insets.bottom ); } else return super.getPreferredSize( c ); } @@ -118,8 +121,8 @@ public class FlatToolTipUI List lines = StringUtils.split( ((JToolTip)c).getTipText(), '\n' ); - int x = insets.left; - int x2 = c.getWidth() - insets.right; + int x = insets.left + 3; + int x2 = c.getWidth() - insets.right - 3; int y = insets.top - fm.getDescent(); int lineHeight = fm.getHeight(); JComponent comp = ((JToolTip)c).getComponent(); @@ -129,11 +132,11 @@ public class FlatToolTipUI FlatUIUtils.drawString( c, g, line, leftToRight ? x : x2 - SwingUtilities.computeStringWidth( fm, line ), y ); } } else - super.paint( g, c ); + super.paint( HiDPIUtils.createGraphicsTextYCorrection( (Graphics2D) g ), c ); } private boolean isMultiLine( JComponent c ) { String text = ((JToolTip)c).getTipText(); - return c.getClientProperty( "html" ) == null && text != null && text.indexOf( '\n' ) >= 0; + return c.getClientProperty( BasicHTML.propertyKey ) == null && text != null && text.indexOf( '\n' ) >= 0; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java index 141dd2a7..4527270a 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTreeUI.java @@ -25,6 +25,7 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import javax.swing.CellRendererPane; import javax.swing.JComponent; import javax.swing.JTree; import javax.swing.LookAndFeel; @@ -75,6 +76,11 @@ import com.formdev.flatlaf.util.UIScale; * @uiDefault Tree.dropCellBackground Color * @uiDefault Tree.dropCellForeground Color * + * + * + * @uiDefault Tree.editorBorder Border + * @uiDefault Tree.editorBorderSelectionColor Color + * * * * @uiDefault Tree.border Border @@ -221,11 +227,16 @@ public class FlatTreeUI TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf ) { boolean isEditing = (editingComponent != null && editingRow == row); - boolean hasFocus = tree.hasFocus(); + boolean hasFocus = FlatUIUtils.isPermanentFocusOwner( tree ); boolean cellHasFocus = hasFocus && (row == getLeadSelectionRow()); boolean isSelected = tree.isRowSelected( row ); boolean isDropRow = isDropRow( row ); + // if tree is used as cell renderer in another component (e.g. in Rhino JavaScript debugger), + // check whether that component is focused to get correct selection colors + if( !hasFocus && isSelected && tree.getParent() instanceof CellRendererPane ) + hasFocus = FlatUIUtils.isPermanentFocusOwner( tree.getParent().getParent() ); + // wide selection background if( wideSelection && (isSelected || isDropRow) ) { // fill background diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java index 8a15c8d1..b48e153b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java @@ -24,6 +24,7 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; +import java.awt.KeyboardFocusManager; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; @@ -34,15 +35,23 @@ import java.awt.event.MouseEvent; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; +import java.util.IdentityHashMap; +import java.util.WeakHashMap; import java.util.function.Consumer; +import java.util.function.Supplier; import javax.swing.JComponent; +import javax.swing.JTable; import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; import javax.swing.UIManager; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.util.DerivedColor; +import com.formdev.flatlaf.util.Graphics2DProxy; import com.formdev.flatlaf.util.HiDPIUtils; -import com.formdev.flatlaf.util.JavaCompatibility; import com.formdev.flatlaf.util.UIScale; /** @@ -54,6 +63,8 @@ public class FlatUIUtils { public static final boolean MAC_USE_QUARTZ = Boolean.getBoolean( "apple.awt.graphics.UseQuartz" ); + private static WeakHashMap> sharedUIinstances = new WeakHashMap<>(); + public static Rectangle addInsets( Rectangle r, Insets insets ) { return new Rectangle( r.x - insets.left, @@ -121,7 +132,7 @@ public class FlatUIUtils } public static Font nonUIResource( Font font ) { - return (font instanceof UIResource) ? new Font( font.getName(), font.getStyle(), font.getSize() ) : font; + return (font instanceof UIResource) ? font.deriveFont( font.getStyle() ) : font; } public static int minimumWidth( JComponent c, int minimumWidth ) { @@ -132,10 +143,82 @@ public class FlatUIUtils return FlatClientProperties.clientPropertyInt( c, FlatClientProperties.MINIMUM_HEIGHT, minimumHeight ); } - public static boolean isTableCellEditor( Component c ) { + public static boolean isCellEditor( Component c ) { + // check whether used in cell editor (check 3 levels up) + Component c2 = c; + for( int i = 0; i <= 2 && c2 != null; i++ ) { + Container parent = c2.getParent(); + if( parent instanceof JTable && ((JTable)parent).getEditorComponent() == c2 ) + return true; + + c2 = parent; + } + + // check whether used as cell editor + // Table.editor is set in JTable.GenericEditor constructor + // Tree.cellEditor is set in sun.swing.FilePane.editFileName() + String name = c.getName(); + if( "Table.editor".equals( name ) || "Tree.cellEditor".equals( name ) ) + return true; + + // for using combo box as cell editor in table + // JComboBox.isTableCellEditor is set in javax.swing.DefaultCellEditor(JComboBox) constructor return c instanceof JComponent && Boolean.TRUE.equals( ((JComponent)c).getClientProperty( "JComboBox.isTableCellEditor" ) ); } + /** + * Returns whether the given component is the permanent focus owner and + * is in the active window. Used to paint focus indicators. + */ + public static boolean isPermanentFocusOwner( Component c ) { + KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); + return keyboardFocusManager.getPermanentFocusOwner() == c && + keyboardFocusManager.getActiveWindow() == SwingUtilities.windowForComponent( c ); + } + + public static Boolean isRoundRect( Component c ) { + return (c instanceof JComponent) + ? FlatClientProperties.clientPropertyBooleanStrict( + (JComponent) c, FlatClientProperties.COMPONENT_ROUND_RECT, null ) + : null; + } + + /** + * Returns the scaled thickness of the outer focus border for the given component. + */ + public static float getBorderFocusWidth( JComponent c ) { + FlatBorder border = getOutsideFlatBorder( c ); + return (border != null) + ? UIScale.scale( (float) border.getFocusWidth( c ) ) + : 0; + } + + /** + * Returns the scaled arc diameter of the border for the given component. + */ + public static float getBorderArc( JComponent c ) { + FlatBorder border = getOutsideFlatBorder( c ); + return (border != null) + ? UIScale.scale( (float) border.getArc( c ) ) + : 0; + } + + public static boolean hasRoundBorder( JComponent c ) { + return getBorderArc( c ) >= c.getHeight(); + } + + public static FlatBorder getOutsideFlatBorder( JComponent c ) { + Border border = c.getBorder(); + for(;;) { + if( border instanceof FlatBorder ) + return (FlatBorder) border; + else if( border instanceof CompoundBorder ) + border = ((CompoundBorder)border).getOutsideBorder(); + else + return null; + } + } + /** * Sets rendering hints used for painting. */ @@ -145,17 +228,17 @@ public class FlatUIUtils MAC_USE_QUARTZ ? RenderingHints.VALUE_STROKE_PURE : RenderingHints.VALUE_STROKE_NORMALIZE ); } - public static void setColor( Graphics g, Color color, Color baseColor ) { - if( color instanceof DerivedColor ) - color = ((DerivedColor)color).derive( baseColor ); - g.setColor( color ); + public static Color deriveColor( Color color, Color baseColor ) { + return (color instanceof DerivedColor) + ? ((DerivedColor)color).derive( baseColor ) + : color; } /** * Paints an outer border, which is usually a focus border. *

* The outside bounds of the painted border are {@code x,y,width,height}. - * The line width of the painted border is {@code focusWidth + lineWidth}. + * The line thickness of the painted border is {@code focusWidth + lineWidth}. * The given arc diameter refers to the inner rectangle ({@code x,y,width,height} minus {@code focusWidth}). * * @see #paintComponentBorder @@ -164,6 +247,9 @@ public class FlatUIUtils public static void paintComponentOuterBorder( Graphics2D g, int x, int y, int width, int height, float focusWidth, float lineWidth, float arc ) { + if( focusWidth + lineWidth == 0 ) + return; // nothing to paint + double systemScaleFactor = UIScale.getSystemScaleFactor( g ); if( systemScaleFactor != 1 && systemScaleFactor != 2 ) { // paint at scale 1x to avoid clipping on right and bottom edges at 125%, 150% or 175% @@ -189,14 +275,9 @@ public class FlatUIUtils if( arc > 0 && arc < UIScale.scale( 10 ) ) outerArc -= UIScale.scale( 2f ); - if( outerArc < 0 ) - outerArc = 0; - if( innerArc < 0 ) - innerArc = 0; - Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD ); - path.append( new RoundRectangle2D.Float( x, y, width, height, outerArc, outerArc ), false ); - path.append( new RoundRectangle2D.Float( x + ow, y + ow, width - (ow * 2), height - (ow * 2), innerArc, innerArc ), false ); + path.append( createComponentRectangle( x, y, width, height, outerArc ), false ); + path.append( createComponentRectangle( x + ow, y + ow, width - (ow * 2), height - (ow * 2), innerArc ), false ); g.fill( path ); } @@ -205,6 +286,7 @@ public class FlatUIUtils *

* The outside bounds of the painted border are * {@code x + focusWidth, y + focusWidth, width - (focusWidth * 2), height - (focusWidth * 2)}. + * The line thickness of the painted border is {@code lineWidth}. * The given arc diameter refers to the painted rectangle (and not to {@code x,y,width,height}). * * @see #paintComponentOuterBorder @@ -213,6 +295,9 @@ public class FlatUIUtils public static void paintComponentBorder( Graphics2D g, int x, int y, int width, int height, float focusWidth, float lineWidth, float arc ) { + if( lineWidth == 0 ) + return; // nothing to paint + double systemScaleFactor = UIScale.getSystemScaleFactor( g ); if( systemScaleFactor != 1 && systemScaleFactor != 2 ) { // paint at scale 1x to avoid clipping on right and bottom edges at 125%, 150% or 175% @@ -230,19 +315,16 @@ public class FlatUIUtils private static void paintComponentBorderImpl( Graphics2D g, int x, int y, int width, int height, float focusWidth, float lineWidth, float arc ) { + float x1 = x + focusWidth; + float y1 = y + focusWidth; + float width1 = width - focusWidth * 2; + float height1 = height - focusWidth * 2; float arc2 = arc - (lineWidth * 2); - if( arc < 0 ) - arc = 0; - if( arc2 < 0 ) - arc2 = 0; - - RoundRectangle2D.Float r1 = new RoundRectangle2D.Float( - x + focusWidth, y + focusWidth, - width - focusWidth * 2, height - focusWidth * 2, arc, arc ); - RoundRectangle2D.Float r2 = new RoundRectangle2D.Float( - r1.x + lineWidth, r1.y + lineWidth, - r1.width - lineWidth * 2, r1.height - lineWidth * 2, arc2, arc2 ); + Shape r1 = createComponentRectangle( x1, y1, width1, height1, arc ); + Shape r2 = createComponentRectangle( + x1 + lineWidth, y1 + lineWidth, + width1 - lineWidth * 2, height1 - lineWidth * 2, arc2 ); Path2D border = new Path2D.Float( Path2D.WIND_EVEN_ODD ); border.append( r1, false ); @@ -280,12 +362,32 @@ public class FlatUIUtils private static void paintComponentBackgroundImpl( Graphics2D g, int x, int y, int width, int height, float focusWidth, float arc ) { - if( arc < 0 ) - arc = 0; - - g.fill( new RoundRectangle2D.Float( + g.fill( createComponentRectangle( x + focusWidth, y + focusWidth, - width - focusWidth * 2, height - focusWidth * 2, arc, arc ) ); + width - focusWidth * 2, height - focusWidth * 2, arc ) ); + } + + /** + * Creates a (rounded) rectangle used to paint components (border, background, etc). + * The given arc diameter is limited to min(width,height). + */ + public static Shape createComponentRectangle( float x, float y, float w, float h, float arc ) { + if( arc <= 0 ) + return new Rectangle2D.Float( x, y, w, h ); + + arc = Math.min( arc, Math.min( w, h ) ); + return new RoundRectangle2D.Float( x, y, w, h, arc, arc ); + } + + static void paintFilledRectangle( Graphics g, Color color, float x, float y, float w, float h ) { + Graphics2D g2 = (Graphics2D) g.create(); + try { + FlatUIUtils.setRenderingHints( g2 ); + g2.setColor( color ); + g2.fill( new Rectangle2D.Float( x, y, w, h ) ); + } finally { + g2.dispose(); + } } /** @@ -354,14 +456,12 @@ public class FlatUIUtils if( arcTopLeft <= 0 && arcTopRight <= 0 && arcBottomLeft <= 0 && arcBottomRight <= 0 ) return new Rectangle2D.Float( x, y, width, height ); - if( arcTopLeft < 0 ) - arcTopLeft = 0; - if( arcTopRight < 0 ) - arcTopRight = 0; - if( arcBottomLeft < 0 ) - arcBottomLeft = 0; - if( arcBottomRight < 0 ) - arcBottomRight = 0; + // limit arcs to min(width,height) + float maxArc = Math.min( width, height ) / 2; + arcTopLeft = (arcTopLeft > 0) ? Math.min( arcTopLeft, maxArc ) : 0; + arcTopRight = (arcTopRight > 0) ? Math.min( arcTopRight, maxArc ) : 0; + arcBottomLeft = (arcBottomLeft > 0) ? Math.min( arcBottomLeft, maxArc ) : 0; + arcBottomRight = (arcBottomRight > 0) ? Math.min( arcBottomRight, maxArc ) : 0; float x2 = x + width; float y2 = y + height; @@ -401,28 +501,46 @@ public class FlatUIUtils } /** - * Draws the given string at the specified location using text properties - * and anti-aliasing hints from the provided component. - * - * Use this method instead of Graphics.drawString() for correct anti-aliasing. - * - * Replacement for SwingUtilities2.drawString() + * Draws the given string at the specified location. + * The provided component is used to query text properties and anti-aliasing hints. + *

+ * Use this method instead of {@link Graphics#drawString(String, int, int)} for correct anti-aliasing. + *

+ * Replacement for {@code SwingUtilities2.drawString()}. + * Uses {@link HiDPIUtils#drawStringWithYCorrection(JComponent, Graphics2D, String, int, int)}. */ public static void drawString( JComponent c, Graphics g, String text, int x, int y ) { - JavaCompatibility.drawStringUnderlineCharAt( c, g, text, -1, x, y ); + HiDPIUtils.drawStringWithYCorrection( c, (Graphics2D) g, text, x, y ); } /** - * Draws the given string at the specified location underlining the specified - * character. The provided component is used to query text properties and - * anti-aliasing hints. - * - * Replacement for SwingUtilities2.drawStringUnderlineCharAt() + * Draws the given string at the specified location underlining the specified character. + * The provided component is used to query text properties and anti-aliasing hints. + *

+ * Replacement for {@code SwingUtilities2.drawStringUnderlineCharAt()}. + * Uses {@link HiDPIUtils#drawStringUnderlineCharAtWithYCorrection(JComponent, Graphics2D, String, int, int, int)}. */ public static void drawStringUnderlineCharAt( JComponent c, Graphics g, String text, int underlinedIndex, int x, int y ) { - JavaCompatibility.drawStringUnderlineCharAt( c, g, text, underlinedIndex, x, y ); + // scale underline height if necessary + if( underlinedIndex >= 0 && UIScale.getUserScaleFactor() > 1 ) { + g = new Graphics2DProxy( (Graphics2D) g ) { + @Override + public void fillRect( int x, int y, int width, int height ) { + if( height == 1 ) { + // scale height and correct y position + // (using 0.9f so that underline height is 1 at scale factor 1.5x) + height = Math.round( UIScale.scale( 0.9f ) ); + y += height - 1; + } + + super.fillRect( x, y, width, height ); + } + }; + } + + HiDPIUtils.drawStringUnderlineCharAtWithYCorrection( c, (Graphics2D) g, text, underlinedIndex, x, y ); } public static boolean hasOpaqueBeenExplicitlySet( JComponent c ) { @@ -433,6 +551,19 @@ public class FlatUIUtils return explicitlySet; } + /** + * Creates a shared component UI for the given key and the current Laf. + * Each Laf instance has its own shared component UI instance. + *

+ * This is for GUI builders that support Laf switching and + * may use multiple Laf instances at the same time. + */ + public static ComponentUI createSharedUI( Object key, Supplier newInstanceSupplier ) { + return sharedUIinstances + .computeIfAbsent( UIManager.getLookAndFeel(), k -> new IdentityHashMap<>() ) + .computeIfAbsent( key, k -> newInstanceSupplier.get() ); + } + //---- class HoverListener ------------------------------------------------ public static class HoverListener diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java index c8953cfb..89167367 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatViewportUI.java @@ -38,12 +38,8 @@ import javax.swing.plaf.basic.BasicViewportUI; public class FlatViewportUI extends BasicViewportUI { - private static ComponentUI instance; - public static ComponentUI createUI( JComponent c ) { - if( instance == null ) - instance = new FlatViewportUI(); - return instance; + return FlatUIUtils.createSharedUI( FlatViewportUI.class, FlatViewportUI::new ); } @Override diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatWindowResizer.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatWindowResizer.java new file mode 100644 index 00000000..cd1c3784 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatWindowResizer.java @@ -0,0 +1,573 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import static java.awt.Cursor.*; +import static javax.swing.SwingConstants.*; +import java.awt.Container; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.WindowEvent; +import java.awt.event.WindowStateListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.function.Supplier; +import javax.swing.DesktopManager; +import javax.swing.JComponent; +import javax.swing.JInternalFrame; +import javax.swing.JLayeredPane; +import javax.swing.JRootPane; +import javax.swing.UIManager; +import com.formdev.flatlaf.util.UIScale; + +/** + * Resizes frames, dialogs or internal frames. + *

+ * Could also be used to implement resize support for any Swing component + * by creating a new subclass. + * + * @author Karl Tauber + */ +public abstract class FlatWindowResizer + implements PropertyChangeListener, ComponentListener +{ + protected final static Integer WINDOW_RESIZER_LAYER = JLayeredPane.DRAG_LAYER + 1; + + protected final JComponent resizeComp; + + protected final int borderDragThickness = FlatUIUtils.getUIInt( "RootPane.borderDragThickness", 5 ); + protected final int cornerDragWidth = FlatUIUtils.getUIInt( "RootPane.cornerDragWidth", 16 ); + protected final boolean honorFrameMinimumSizeOnResize = UIManager.getBoolean( "RootPane.honorFrameMinimumSizeOnResize" ); + protected final boolean honorDialogMinimumSizeOnResize = UIManager.getBoolean( "RootPane.honorDialogMinimumSizeOnResize" ); + + protected final DragBorderComponent topDragComp; + protected final DragBorderComponent bottomDragComp; + protected final DragBorderComponent leftDragComp; + protected final DragBorderComponent rightDragComp; + + protected FlatWindowResizer( JComponent resizeComp ) { + this.resizeComp = resizeComp; + + topDragComp = createDragBorderComponent( NW_RESIZE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR ); + bottomDragComp = createDragBorderComponent( SW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR ); + leftDragComp = createDragBorderComponent( NW_RESIZE_CURSOR, W_RESIZE_CURSOR, SW_RESIZE_CURSOR ); + rightDragComp = createDragBorderComponent( NE_RESIZE_CURSOR, E_RESIZE_CURSOR, SE_RESIZE_CURSOR ); + + Container cont = (resizeComp instanceof JRootPane) ? ((JRootPane)resizeComp).getLayeredPane() : resizeComp; + Object cons = (cont instanceof JLayeredPane) ? WINDOW_RESIZER_LAYER : null; + cont.add( topDragComp, cons, 0 ); + cont.add( bottomDragComp, cons, 1 ); + cont.add( leftDragComp, cons, 2 ); + cont.add( rightDragComp, cons, 3 ); + + resizeComp.addComponentListener( this ); + resizeComp.addPropertyChangeListener( "ancestor", this ); + + if( resizeComp.isDisplayable() ) + addNotify(); + } + + protected DragBorderComponent createDragBorderComponent( int leadingResizeDir, int centerResizeDir, int trailingResizeDir ) { + return new DragBorderComponent( leadingResizeDir, centerResizeDir, trailingResizeDir ); + } + + public void uninstall() { + removeNotify(); + + resizeComp.removeComponentListener( this ); + resizeComp.removePropertyChangeListener( "ancestor", this ); + + Container cont = topDragComp.getParent(); + cont.remove( topDragComp ); + cont.remove( bottomDragComp ); + cont.remove( leftDragComp ); + cont.remove( rightDragComp ); + } + + public void doLayout() { + if( !topDragComp.isVisible() ) + return; + + int x = 0; + int y = 0; + int width = resizeComp.getWidth(); + int height = resizeComp.getHeight(); + if( width == 0 || height == 0 ) + return; + + Insets resizeInsets = getResizeInsets(); + int thickness = UIScale.scale( borderDragThickness ); + int topThickness = Math.max( resizeInsets.top, thickness ); + int bottomThickness = Math.max( resizeInsets.bottom, thickness ); + int leftThickness = Math.max( resizeInsets.left, thickness ); + int rightThickness = Math.max( resizeInsets.right, thickness ); + int y2 = y + topThickness; + int height2 = height - topThickness - bottomThickness; + + // set bounds of drag components + topDragComp.setBounds( x, y, width, topThickness ); + bottomDragComp.setBounds( x, y + height - bottomThickness, width, bottomThickness ); + leftDragComp.setBounds( x, y2, leftThickness, height2 ); + rightDragComp.setBounds( x + width - rightThickness, y2, rightThickness, height2 ); + + // set corner drag widths + int cornerDelta = UIScale.scale( cornerDragWidth - borderDragThickness ); + topDragComp.setCornerDragWidths( leftThickness + cornerDelta, rightThickness + cornerDelta ); + bottomDragComp.setCornerDragWidths( leftThickness + cornerDelta, rightThickness + cornerDelta ); + leftDragComp.setCornerDragWidths( cornerDelta, cornerDelta ); + rightDragComp.setCornerDragWidths( cornerDelta, cornerDelta ); + } + + protected Insets getResizeInsets() { + return new Insets( 0, 0, 0, 0 ); + } + + protected void addNotify() { + updateVisibility(); + } + + protected void removeNotify() { + updateVisibility(); + } + + protected void updateVisibility() { + boolean visible = isWindowResizable(); + if( visible == topDragComp.isVisible() ) + return; + + topDragComp.setVisible( visible ); + bottomDragComp.setVisible( visible ); + leftDragComp.setVisible( visible ); + + // The east component is not hidden, instead its bounds are set to 0,0,1,1 and + // it is disabled. This is necessary so that DragBorderComponent.paintComponent() is invoked. + rightDragComp.setEnabled( visible ); + if( visible ) { + rightDragComp.setVisible( true ); // necessary because it is initially invisible + doLayout(); + } else + rightDragComp.setBounds( 0, 0, 1, 1 ); + } + + boolean isDialog() { + return false; + } + + protected abstract boolean isWindowResizable(); + protected abstract Rectangle getWindowBounds(); + protected abstract void setWindowBounds( Rectangle r ); + protected abstract boolean honorMinimumSizeOnResize(); + protected abstract Dimension getWindowMinimumSize(); + + protected void beginResizing( int direction ) {} + protected void endResizing() {} + + //---- interface PropertyChangeListener ---- + + @Override + public void propertyChange( PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case "ancestor": + if( e.getNewValue() != null ) + addNotify(); + else + removeNotify(); + break; + + case "resizable": + updateVisibility(); + break; + } + } + + //---- interface ComponentListener ---- + + @Override + public void componentResized( ComponentEvent e ) { + doLayout(); + } + + @Override public void componentMoved( ComponentEvent e ) {} + @Override public void componentShown( ComponentEvent e ) {} + @Override public void componentHidden( ComponentEvent e ) {} + + //---- class WindowResizer ------------------------------------------------ + + /** + * Resizes frames and dialogs. + */ + public static class WindowResizer + extends FlatWindowResizer + implements WindowStateListener + { + protected Window window; + + public WindowResizer( JRootPane rootPane ) { + super( rootPane ); + } + + @Override + protected void addNotify() { + Container parent = resizeComp.getParent(); + window = (parent instanceof Window) ? (Window) parent : null; + if( window instanceof Frame ) { + window.addPropertyChangeListener( "resizable", this ); + window.addWindowStateListener( this ); + } + + super.addNotify(); + } + + @Override + protected void removeNotify() { + if( window instanceof Frame ) { + window.removePropertyChangeListener( "resizable", this ); + window.removeWindowStateListener( this ); + } + window = null; + + super.removeNotify(); + } + + @Override + protected boolean isWindowResizable() { + if( window instanceof Frame ) + return ((Frame)window).isResizable() && (((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) == 0; + if( window instanceof Dialog ) + return ((Dialog)window).isResizable(); + return false; + } + + @Override + protected Rectangle getWindowBounds() { + return window.getBounds(); + } + + @Override + protected void setWindowBounds( Rectangle r ) { + window.setBounds( r ); + + // immediately layout drag border components + doLayout(); + + if( Toolkit.getDefaultToolkit().isDynamicLayoutActive() ) { + window.validate(); + resizeComp.repaint(); + } + } + + @Override + protected boolean honorMinimumSizeOnResize() { + return + (honorFrameMinimumSizeOnResize && window instanceof Frame) || + (honorDialogMinimumSizeOnResize && window instanceof Dialog); + } + + @Override + protected Dimension getWindowMinimumSize() { + return window.getMinimumSize(); + } + + @Override + boolean isDialog() { + return window instanceof Dialog; + } + + @Override + public void windowStateChanged( WindowEvent e ) { + updateVisibility(); + } + } + + //---- class InternalFrameResizer ----------------------------------------- + + /** + * Resizes internal frames. + */ + public static class InternalFrameResizer + extends FlatWindowResizer + { + protected final Supplier desktopManager; + + public InternalFrameResizer( JInternalFrame frame, Supplier desktopManager ) { + super( frame ); + this.desktopManager = desktopManager; + + frame.addPropertyChangeListener( "resizable", this ); + } + + @Override + public void uninstall() { + getFrame().removePropertyChangeListener( "resizable", this ); + + super.uninstall(); + } + + private JInternalFrame getFrame() { + return (JInternalFrame) resizeComp; + } + + @Override + protected Insets getResizeInsets() { + return getFrame().getInsets(); + } + + @Override + protected boolean isWindowResizable() { + return getFrame().isResizable(); + } + + @Override + protected Rectangle getWindowBounds() { + return getFrame().getBounds(); + } + + @Override + protected void setWindowBounds( Rectangle r ) { + desktopManager.get().resizeFrame( getFrame(), r.x, r.y, r.width, r.height ); + } + + @Override + protected boolean honorMinimumSizeOnResize() { + return true; + } + + @Override + protected Dimension getWindowMinimumSize() { + return getFrame().getMinimumSize(); + } + + @Override + protected void beginResizing( int direction ) { + desktopManager.get().beginResizingFrame( getFrame(), direction ); + } + + @Override + protected void endResizing() { + desktopManager.get().endResizingFrame( getFrame() ); + } + } + + //---- class DragBorderComponent ------------------------------------------ + + protected class DragBorderComponent + extends JComponent + implements MouseListener, MouseMotionListener + { + private final int leadingResizeDir; + private final int centerResizeDir; + private final int trailingResizeDir; + + private int resizeDir = -1; + + private int leadingCornerDragWidth; + private int trailingCornerDragWidth; + + // offsets of mouse position to window edges + private int dragLeftOffset; + private int dragRightOffset; + private int dragTopOffset; + private int dragBottomOffset; + + protected DragBorderComponent( int leadingResizeDir, int centerResizeDir, int trailingResizeDir ) { + this.leadingResizeDir = leadingResizeDir; + this.centerResizeDir = centerResizeDir; + this.trailingResizeDir = trailingResizeDir; + + setResizeDir( centerResizeDir ); + setVisible( false ); + + addMouseListener( this ); + addMouseMotionListener( this ); + } + + void setCornerDragWidths( int leading, int trailing ) { + leadingCornerDragWidth = leading; + trailingCornerDragWidth = trailing; + } + + protected void setResizeDir( int resizeDir ) { + if( this.resizeDir == resizeDir ) + return; + this.resizeDir = resizeDir; + + setCursor( getPredefinedCursor( resizeDir ) ); + } + + @Override + public Dimension getPreferredSize() { + int thickness = UIScale.scale( borderDragThickness ); + return new Dimension( thickness, thickness ); + } + + @Override + protected void paintComponent( Graphics g ) { + super.paintChildren( g ); + + // this is necessary because Dialog.setResizable() does not fire events + if( isDialog() ) + updateVisibility(); + +/*debug + int width = getWidth(); + int height = getHeight(); + + g.setColor( java.awt.Color.blue ); + boolean topOrBottom = (centerResizeDir == N_RESIZE_CURSOR || centerResizeDir == S_RESIZE_CURSOR); + if( topOrBottom ) { + g.drawLine( leadingCornerDragWidth, 0, leadingCornerDragWidth, height ); + g.drawLine( width - trailingCornerDragWidth, 0, width - trailingCornerDragWidth, height ); + } else { + g.drawLine( 0, leadingCornerDragWidth, width, leadingCornerDragWidth ); + g.drawLine( 0, height - trailingCornerDragWidth, width, height - trailingCornerDragWidth ); + } + + g.setColor( java.awt.Color.red ); + g.drawRect( 0, 0, width - 1, height - 1 ); +debug*/ + } + + @Override + public void mouseClicked( MouseEvent e ) { + } + + @Override + public void mousePressed( MouseEvent e ) { + if( !isWindowResizable() ) + return; + + int xOnScreen = e.getXOnScreen(); + int yOnScreen = e.getYOnScreen(); + Rectangle windowBounds = getWindowBounds(); + + // compute offsets of mouse position to window edges + dragLeftOffset = xOnScreen - windowBounds.x; + dragTopOffset = yOnScreen - windowBounds.y; + dragRightOffset = windowBounds.x + windowBounds.width - xOnScreen; + dragBottomOffset = windowBounds.y + windowBounds.height - yOnScreen; + + int direction = 0; + switch( resizeDir ) { + case N_RESIZE_CURSOR: direction = NORTH; break; + case S_RESIZE_CURSOR: direction = SOUTH; break; + case W_RESIZE_CURSOR: direction = WEST; break; + case E_RESIZE_CURSOR: direction = EAST; break; + case NW_RESIZE_CURSOR: direction = NORTH_WEST; break; + case NE_RESIZE_CURSOR: direction = NORTH_EAST; break; + case SW_RESIZE_CURSOR: direction = SOUTH_WEST; break; + case SE_RESIZE_CURSOR: direction = SOUTH_EAST; break; + } + beginResizing( direction ); + } + + @Override + public void mouseReleased( MouseEvent e ) { + if( !isWindowResizable() ) + return; + + dragLeftOffset = dragRightOffset = dragTopOffset = dragBottomOffset = 0; + + endResizing(); + } + + @Override public void mouseEntered( MouseEvent e ) {} + @Override public void mouseExited( MouseEvent e ) {} + + @Override + public void mouseMoved( MouseEvent e ) { + boolean topOrBottom = (centerResizeDir == N_RESIZE_CURSOR || centerResizeDir == S_RESIZE_CURSOR); + int xy = topOrBottom ? e.getX() : e.getY(); + int wh = topOrBottom ? getWidth() : getHeight(); + + setResizeDir( xy <= leadingCornerDragWidth + ? leadingResizeDir + : (xy >= wh - trailingCornerDragWidth + ? trailingResizeDir + : centerResizeDir) ); + } + + @Override + public void mouseDragged( MouseEvent e ) { + if( !isWindowResizable() ) + return; + + int xOnScreen = e.getXOnScreen(); + int yOnScreen = e.getYOnScreen(); + + // Get current window bounds and compute new bounds based them. + // This is necessary because window manager may alter window bounds while resizing. + // E.g. when having two monitors with different scale factors and resizing + // a window on first screen to the second screen, then the window manager may + // decide at some point that the window should be only on second screen + // and adjusts its bounds. + Rectangle oldBounds = getWindowBounds(); + Rectangle newBounds = new Rectangle( oldBounds ); + + // compute new window bounds + + // top + if( resizeDir == N_RESIZE_CURSOR || resizeDir == NW_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR ) { + newBounds.y = yOnScreen - dragTopOffset; + newBounds.height += (oldBounds.y - newBounds.y); + } + + // bottom + if( resizeDir == S_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) + newBounds.height = (yOnScreen + dragBottomOffset) - newBounds.y; + + // left + if( resizeDir == W_RESIZE_CURSOR || resizeDir == NW_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR ) { + newBounds.x = xOnScreen - dragLeftOffset; + newBounds.width += (oldBounds.x - newBounds.x); + } + + // right + if( resizeDir == E_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) + newBounds.width = (xOnScreen + dragRightOffset) - newBounds.x; + + // apply minimum window size + Dimension minimumSize = honorMinimumSizeOnResize() ? getWindowMinimumSize() : null; + if( minimumSize == null ) + minimumSize = UIScale.scale( new Dimension( 150, 50 ) ); + if( newBounds.width < minimumSize.width ) { + if( newBounds.x != oldBounds.x ) + newBounds.x -= (minimumSize.width - newBounds.width); + newBounds.width = minimumSize.width; + } + if( newBounds.height < minimumSize.height ) { + if( newBounds.y != oldBounds.y ) + newBounds.y -= (minimumSize.height - newBounds.height); + newBounds.height = minimumSize.height; + } + + // set window bounds + if( !newBounds.equals( oldBounds ) ) + setWindowBounds( newBounds ); + } + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java new file mode 100644 index 00000000..c8abc5a6 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/JBRCustomDecorations.java @@ -0,0 +1,315 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.EventQueue; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.HierarchyEvent; +import java.awt.event.HierarchyListener; +import java.beans.PropertyChangeListener; +import java.lang.reflect.Method; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JRootPane; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.plaf.BorderUIResource; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.FlatSystemProperties; +import com.formdev.flatlaf.util.HiDPIUtils; +import com.formdev.flatlaf.util.SystemInfo; + +/** + * Support for custom window decorations provided by JetBrains Runtime (based on OpenJDK). + * Requires that the application runs on Windows 10 in a JetBrains Runtime 11 or later. + *

+ * + * @author Karl Tauber + */ +public class JBRCustomDecorations +{ + private static boolean initialized; + private static Method Window_hasCustomDecoration; + private static Method Window_setHasCustomDecoration; + private static Method WWindowPeer_setCustomDecorationHitTestSpots; + private static Method WWindowPeer_setCustomDecorationTitleBarHeight; + private static Method AWTAccessor_getComponentAccessor; + private static Method AWTAccessor_ComponentAccessor_getPeer; + + public static boolean isSupported() { + initialize(); + return Window_setHasCustomDecoration != null; + } + + static void install( JRootPane rootPane ) { + if( !isSupported() ) + return; + + // check whether root pane already has a parent, which is the case when switching LaF + if( rootPane.getParent() != null ) + return; + + // Use hierarchy listener to wait until the root pane is added to a window. + // Enabling JBR decorations must be done very early, probably before + // window becomes displayable (window.isDisplayable()). Tried also using + // "ancestor" property change event on root pane, but this is invoked too late. + HierarchyListener addListener = new HierarchyListener() { + @Override + public void hierarchyChanged( HierarchyEvent e ) { + if( e.getChanged() != rootPane || (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) == 0 ) + return; + + Container parent = e.getChangedParent(); + if( parent instanceof Window ) + install( (Window) parent ); + + // use invokeLater to remove listener to avoid that listener + // is removed while listener queue is processed + EventQueue.invokeLater( () -> { + rootPane.removeHierarchyListener( this ); + } ); + } + }; + rootPane.addHierarchyListener( addListener ); + } + + static void install( Window window ) { + if( !isSupported() ) + return; + + // do not enable JBR decorations if LaF provides decorations + if( UIManager.getLookAndFeel().getSupportsWindowDecorations() ) + return; + + if( window instanceof JFrame ) { + JFrame frame = (JFrame) window; + + // do not enable JBR decorations if JFrame should use system window decorations + // and if not forced to use JBR decorations + if( !JFrame.isDefaultLookAndFeelDecorated() && + !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, false )) + return; + + // do not enable JBR decorations if frame is undecorated + if( frame.isUndecorated() ) + return; + + // enable JBR custom window decoration for window + setHasCustomDecoration( frame ); + + // enable Swing window decoration + frame.getRootPane().setWindowDecorationStyle( JRootPane.FRAME ); + + } else if( window instanceof JDialog ) { + JDialog dialog = (JDialog) window; + + // do not enable JBR decorations if JDialog should use system window decorations + // and if not forced to use JBR decorations + if( !JDialog.isDefaultLookAndFeelDecorated() && + !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, false )) + return; + + // do not enable JBR decorations if dialog is undecorated + if( dialog.isUndecorated() ) + return; + + // enable JBR custom window decoration for window + setHasCustomDecoration( dialog ); + + // enable Swing window decoration + dialog.getRootPane().setWindowDecorationStyle( JRootPane.PLAIN_DIALOG ); + } + } + + static boolean hasCustomDecoration( Window window ) { + if( !isSupported() ) + return false; + + try { + return (Boolean) Window_hasCustomDecoration.invoke( window ); + } catch( Exception ex ) { + Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex ); + return false; + } + } + + static void setHasCustomDecoration( Window window ) { + if( !isSupported() ) + return; + + try { + Window_setHasCustomDecoration.invoke( window ); + } catch( Exception ex ) { + Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex ); + } + } + + static void setHitTestSpotsAndTitleBarHeight( Window window, List hitTestSpots, int titleBarHeight ) { + if( !isSupported() ) + return; + + try { + Object compAccessor = AWTAccessor_getComponentAccessor.invoke( null ); + Object peer = AWTAccessor_ComponentAccessor_getPeer.invoke( compAccessor, window ); + WWindowPeer_setCustomDecorationHitTestSpots.invoke( peer, hitTestSpots ); + WWindowPeer_setCustomDecorationTitleBarHeight.invoke( peer, titleBarHeight ); + } catch( Exception ex ) { + Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex ); + } + } + + private static void initialize() { + if( initialized ) + return; + initialized = true; + + // requires JetBrains Runtime 11 and Windows 10 + if( !SystemInfo.isJetBrainsJVM_11_orLater || !SystemInfo.isWindows_10_orLater ) + return; + + if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ) ) + return; + + try { + Class awtAcessorClass = Class.forName( "sun.awt.AWTAccessor" ); + Class compAccessorClass = Class.forName( "sun.awt.AWTAccessor$ComponentAccessor" ); + AWTAccessor_getComponentAccessor = awtAcessorClass.getDeclaredMethod( "getComponentAccessor" ); + AWTAccessor_ComponentAccessor_getPeer = compAccessorClass.getDeclaredMethod( "getPeer", Component.class ); + + Class peerClass = Class.forName( "sun.awt.windows.WWindowPeer" ); + WWindowPeer_setCustomDecorationHitTestSpots = peerClass.getDeclaredMethod( "setCustomDecorationHitTestSpots", List.class ); + WWindowPeer_setCustomDecorationTitleBarHeight = peerClass.getDeclaredMethod( "setCustomDecorationTitleBarHeight", int.class ); + WWindowPeer_setCustomDecorationHitTestSpots.setAccessible( true ); + WWindowPeer_setCustomDecorationTitleBarHeight.setAccessible( true ); + + Window_hasCustomDecoration = Window.class.getDeclaredMethod( "hasCustomDecoration" ); + Window_setHasCustomDecoration = Window.class.getDeclaredMethod( "setHasCustomDecoration" ); + Window_hasCustomDecoration.setAccessible( true ); + Window_setHasCustomDecoration.setAccessible( true ); + } catch( Exception ex ) { + // ignore + } + } + + //---- class JBRWindowTopBorder ------------------------------------------- + + static class JBRWindowTopBorder + extends BorderUIResource.EmptyBorderUIResource + { + private static JBRWindowTopBorder instance; + + private final Color defaultActiveBorder = new Color( 0x707070 ); + private final Color inactiveLightColor = new Color( 0xaaaaaa ); + private final Color inactiveDarkColor = new Color( 0x3f3f3f ); + + private boolean colorizationAffectsBorders; + private Color activeColor = defaultActiveBorder; + + static JBRWindowTopBorder getInstance() { + if( instance == null ) + instance = new JBRWindowTopBorder(); + return instance; + } + + private JBRWindowTopBorder() { + super( 1, 0, 0, 0 ); + + colorizationAffectsBorders = calculateAffectsBorders(); + activeColor = calculateActiveBorderColor(); + + Toolkit toolkit = Toolkit.getDefaultToolkit(); + toolkit.addPropertyChangeListener( "win.dwm.colorizationColor.affects.borders", e -> { + colorizationAffectsBorders = calculateAffectsBorders(); + activeColor = calculateActiveBorderColor(); + } ); + + PropertyChangeListener l = e -> { + activeColor = calculateActiveBorderColor(); + }; + toolkit.addPropertyChangeListener( "win.dwm.colorizationColor", l ); + toolkit.addPropertyChangeListener( "win.dwm.colorizationColorBalance", l ); + toolkit.addPropertyChangeListener( "win.frame.activeBorderColor", l ); + } + + private boolean calculateAffectsBorders() { + Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "win.dwm.colorizationColor.affects.borders" ); + return (value instanceof Boolean) ? (Boolean) value : true; + } + + private Color calculateActiveBorderColor() { + if( !colorizationAffectsBorders ) + return defaultActiveBorder; + + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Color colorizationColor = (Color) toolkit.getDesktopProperty( "win.dwm.colorizationColor" ); + if( colorizationColor != null ) { + Object colorizationColorBalanceObj = toolkit.getDesktopProperty( "win.dwm.colorizationColorBalance" ); + if( colorizationColorBalanceObj instanceof Integer ) { + int colorizationColorBalance = (Integer) colorizationColorBalanceObj; + if( colorizationColorBalance < 0 ) + colorizationColorBalance = 100; + + if( colorizationColorBalance == 0 ) + return new Color( 0xD9D9D9 ); + if( colorizationColorBalance == 100 ) + return colorizationColor; + + float alpha = colorizationColorBalance / 100.0f; + float remainder = 1 - alpha; + int r = Math.round( (colorizationColor.getRed() * alpha + 0xD9 * remainder) ); + int g = Math.round( (colorizationColor.getGreen() * alpha + 0xD9 * remainder) ); + int b = Math.round( (colorizationColor.getBlue() * alpha + 0xD9 * remainder) ); + return new Color( r, g, b ); + } + return colorizationColor; + } + + Color activeBorderColor = (Color) toolkit.getDesktopProperty( "win.frame.activeBorderColor" ); + return (activeBorderColor != null) ? activeBorderColor : UIManager.getColor( "MenuBar.borderColor" ); + } + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + Window window = SwingUtilities.windowForComponent( c ); + boolean active = (window != null) ? window.isActive() : false; + + g.setColor( active ? activeColor : (FlatLaf.isLafDark() ? inactiveDarkColor : inactiveLightColor) ); + HiDPIUtils.paintAtScale1x( (Graphics2D) g, x, y, width, height, this::paintImpl ); + } + + private void paintImpl( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { + g.drawRect( x, y, width - 1, 0 ); + } + + void repaintBorder( Component c ) { + c.repaint( 0, 0, c.getWidth(), 1 ); + } + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/MigLayoutVisualPadding.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/MigLayoutVisualPadding.java index 3d6c1d47..6148f718 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/MigLayoutVisualPadding.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/MigLayoutVisualPadding.java @@ -69,14 +69,17 @@ public class MigLayoutVisualPadding /** * Convenience method that checks whether component border is a FlatBorder. */ - public static void install( JComponent c, int focusWidth ) { + public static void install( JComponent c ) { if( !migLayoutAvailable ) return; install( c, c2 -> { - return (c2.getBorder() instanceof FlatBorder) - ? new Insets( focusWidth, focusWidth, focusWidth, focusWidth ) - : null; + FlatBorder border = FlatUIUtils.getOutsideFlatBorder( c2 ); + if( border != null ) { + int focusWidth = border.getFocusWidth( c2 ); + return new Insets( focusWidth, focusWidth, focusWidth, focusWidth ); + } else + return null; }, "border" ); } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Animator.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Animator.java new file mode 100644 index 00000000..d011f054 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Animator.java @@ -0,0 +1,340 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import java.util.ArrayList; +import javax.swing.Timer; +import com.formdev.flatlaf.FlatSystemProperties; + +/** + * Simple animator based on ideas and concepts from "Filthy Rich Clients" book + * and "Timing Framework" library. + * + * @author Karl Tauber + */ +public class Animator +{ + private int duration; + private int resolution = 10; + private Interpolator interpolator; + private final ArrayList targets = new ArrayList<>(); + private final Runnable endRunnable; + + private boolean running; + private boolean hasBegun; + private boolean timeToStop; + private long startTime; + private Timer timer; + + /** + * Checks whether animations are enabled (the default) or disabled via + * system property {@code flatlaf.animation} set to {@code false}. + * This allows disabling all animations at command line with {@code -Dflatlaf.animation=false}. + */ + public static boolean useAnimation() { + return FlatSystemProperties.getBoolean( FlatSystemProperties.ANIMATION, true ); + } + + /** + * Creates an animation that runs duration milliseconds. + * Use {@link #addTarget(TimingTarget)} to receive timing events + * and {@link #start()} to start the animation. + * + * @param duration the duration of the animation in milliseconds + */ + public Animator( int duration ) { + this( duration, null, null ); + } + + /** + * Creates an animation that runs duration milliseconds. + * Use {@link #start()} to start the animation. + * + * @param duration the duration of the animation in milliseconds + * @param target the target that receives timing events + */ + public Animator( int duration, TimingTarget target ) { + this( duration, target, null ); + } + + /** + * Creates an animation that runs duration milliseconds. + * Use {@link #start()} to start the animation. + * + * @param duration the duration of the animation in milliseconds + * @param target the target that receives timing events + * @param endRunnable a runnable invoked when the animation ends; or {@code null} + */ + public Animator( int duration, TimingTarget target, Runnable endRunnable ) { + setDuration( duration ); + addTarget( target ); + this.endRunnable = endRunnable; + } + + /** + * Returns the duration of the animation in milliseconds. + */ + public int getDuration() { + return duration; + } + + /** + * Sets the duration of the animation in milliseconds. + * + * @throws IllegalStateException if animation is running + * @throws IllegalArgumentException if duration is <= zero + */ + public void setDuration( int duration ) { + throwExceptionIfRunning(); + if( duration <= 0 ) + throw new IllegalArgumentException(); + this.duration = duration; + } + + /** + * Returns the resolution of the animation in milliseconds (default is 10). + * Resolution is the amount of time between timing events. + */ + public int getResolution() { + return resolution; + } + + /** + * Sets the resolution of the animation in milliseconds. + * + * @param resolution the resolution of the animation in milliseconds + * @throws IllegalStateException if animation is running + * @throws IllegalArgumentException if resolution is <= zero + */ + public void setResolution( int resolution ) { + throwExceptionIfRunning(); + if( resolution <= 0 ) + throw new IllegalArgumentException(); + this.resolution = resolution; + } + + /** + * Returns the interpolator for the animation. + * Default is {@code null}, which means linear. + */ + public Interpolator getInterpolator() { + return interpolator; + } + + /** + * Sets the interpolator for the animation. + * + * @throws IllegalStateException if animation is running + */ + public void setInterpolator( Interpolator interpolator ) { + throwExceptionIfRunning(); + this.interpolator = interpolator; + } + + /** + * Adds a target to the animation that receives timing events. + * + * @param target the target that receives timing events + */ + public void addTarget( TimingTarget target ) { + if( target == null ) + return; + + synchronized( targets ) { + if( !targets.contains( target ) ) + targets.add( target ); + } + } + + /** + * Removes a target from the animation. + * + * @param target the target that should be removed + */ + public void removeTarget( TimingTarget target ) { + synchronized( targets ) { + targets.remove( target ); + } + } + + /** + * Starts the animation. + * + * @throws IllegalStateException if animation is running + */ + public void start() { + throwExceptionIfRunning(); + + running = true; + hasBegun = false; + timeToStop = false; + startTime = System.nanoTime() / 1000000; + + if( timer == null ) { + timer = new Timer( resolution, e -> { + if( !hasBegun ) { + begin(); + hasBegun = true; + } + + timingEvent( getTimingFraction() ); + } ); + } else + timer.setDelay( resolution ); + timer.setInitialDelay( 0 ); + timer.start(); + } + + /** + * Stops the animation before it normally ends. + * Invokes {@link TimingTarget#end()} on timing targets. + */ + public void stop() { + stop( false ); + } + + /** + * Cancels the animation before it normally ends. + * Does not invoke {@link TimingTarget#end()} on timing targets. + */ + public void cancel() { + stop( true ); + } + + private void stop( boolean cancel ) { + if( !running ) + return; + + if( timer != null ) + timer.stop(); + + if( !cancel ) + end(); + + running = false; + timeToStop = false; + } + + /** + * Restarts the animation. + * Invokes {@link #cancel()} and {@link #start()}. + */ + public void restart() { + cancel(); + start(); + } + + /** + * Returns whether this animation is running. + */ + public boolean isRunning() { + return running; + } + + private float getTimingFraction() { + long currentTime = System.nanoTime() / 1000000; + long elapsedTime = currentTime - startTime; + timeToStop = (elapsedTime >= duration); + + float fraction = clampFraction( (float) elapsedTime / duration ); + if( interpolator != null ) + fraction = clampFraction( interpolator.interpolate( fraction ) ); + return fraction; + } + + private float clampFraction( float fraction ) { + if( fraction < 0 ) + return 0; + if( fraction > 1 ) + return 1; + return fraction; + } + + private void timingEvent( float fraction ) { + synchronized( targets ) { + for( TimingTarget target : targets ) + target.timingEvent( fraction ); + } + + if( timeToStop ) + stop(); + } + + private void begin() { + synchronized( targets ) { + for( TimingTarget target : targets ) + target.begin(); + } + } + + private void end() { + synchronized( targets ) { + for( TimingTarget target : targets ) + target.end(); + } + + if( endRunnable != null ) + endRunnable.run(); + } + + private void throwExceptionIfRunning() { + if( isRunning() ) + throw new IllegalStateException(); + } + + //---- interface TimingTarget --------------------------------------------- + + /** + * Animation callbacks. + */ + @FunctionalInterface + public interface TimingTarget { + /** + * Invoked multiple times while animation is running. + * + * @param fraction the percent (0 to 1) elapsed of the current animation cycle + */ + void timingEvent( float fraction ); + + /** + * Invoked when the animation begins. + */ + default void begin() {} + + /** + * Invoked when the animation ends. + */ + default void end() {} + } + + //---- interface Interpolator --------------------------------------------- + + /** + * Interpolator used by animation to change timing fraction. E.g. for easing. + */ + @FunctionalInterface + public interface Interpolator { + /** + * Interpolate the given fraction and returns a new fraction. + * Both fractions are in range [0, 1]. + * + * @param fraction the percent (0 to 1) elapsed of the current animation cycle + * @return new fraction in range [0, 1] + */ + float interpolate( float fraction ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ColorFunctions.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ColorFunctions.java index 00f60561..471dd7c0 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ColorFunctions.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ColorFunctions.java @@ -35,7 +35,7 @@ public class ColorFunctions return HSLColor.toRGB( hsl, alpha ); } - private static float clamp( float value ) { + public static float clamp( float value ) { return (value < 0) ? 0 : ((value > 100) @@ -49,20 +49,26 @@ public class ColorFunctions void apply( float[] hsl ); } - //---- class Lighten ------------------------------------------------------ + //---- class HSLIncreaseDecrease ------------------------------------------ /** - * Increase the lightness of a color in the HSL color space by an absolute - * or relative amount. + * Increase or decrease hue, saturation or luminance of a color in the HSL color space + * by an absolute or relative amount. */ - public static class Lighten + public static class HSLIncreaseDecrease implements ColorFunction { - private final float amount; - private final boolean relative; - private final boolean autoInverse; + public final int hslIndex; + public final boolean increase; + public final float amount; + public final boolean relative; + public final boolean autoInverse; - public Lighten( float amount, boolean relative, boolean autoInverse ) { + public HSLIncreaseDecrease( int hslIndex, boolean increase, + float amount, boolean relative, boolean autoInverse ) + { + this.hslIndex = hslIndex; + this.increase = increase; this.amount = amount; this.relative = relative; this.autoInverse = autoInverse; @@ -70,33 +76,17 @@ public class ColorFunctions @Override public void apply( float[] hsl ) { - float amount2 = autoInverse && shouldInverse( hsl ) ? -amount : amount; - hsl[2] = clamp( relative - ? (hsl[2] * ((100 + amount2) / 100)) - : (hsl[2] + amount2) ); + float amount2 = increase ? amount : -amount; + amount2 = autoInverse && shouldInverse( hsl ) ? -amount2 : amount2; + hsl[hslIndex] = clamp( relative + ? (hsl[hslIndex] * ((100 + amount2) / 100)) + : (hsl[hslIndex] + amount2) ); } protected boolean shouldInverse( float[] hsl ) { - return hsl[2] >= 50; - } - } - - //---- class Darken ------------------------------------------------------- - - /** - * Decrease the lightness of a color in the HSL color space by an absolute - * or relative amount. - */ - public static class Darken - extends Lighten - { - public Darken( float amount, boolean relative, boolean autoInverse ) { - super( -amount, relative, autoInverse ); - } - - @Override - protected boolean shouldInverse( float[] hsl ) { - return hsl[2] < 50; + return increase + ? hsl[hslIndex] >= 50 + : hsl[hslIndex] < 50; } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/CubicBezierEasing.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/CubicBezierEasing.java new file mode 100644 index 00000000..e714a209 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/CubicBezierEasing.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +/** + * An interpolator for {@link Animator} that uses a cubic bezier curve. + * + * @author Karl Tauber + */ +public class CubicBezierEasing + implements Animator.Interpolator +{ + // common cubic-bezier easing functions (same as in CSS) + // https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function + public static final CubicBezierEasing EASE = new CubicBezierEasing( 0.25f, 0.1f, 0.25f, 1f ); + public static final CubicBezierEasing EASE_IN = new CubicBezierEasing( 0.42f, 0f, 1f, 1f ); + public static final CubicBezierEasing EASE_IN_OUT = new CubicBezierEasing( 0.42f, 0f, 0.58f, 1f ); + public static final CubicBezierEasing EASE_OUT = new CubicBezierEasing( 0f, 0f, 0.58f, 1f ); + + private final float x1; + private final float y1; + private final float x2; + private final float y2; + + /** + * Creates a cubic bezier easing interpolator with the given control points. + * The start point of the cubic bezier curve is always 0,0 and the end point 1,1. + * + * @param x1 the x coordinate of the first control point in range [0, 1] + * @param y1 the y coordinate of the first control point in range [0, 1] + * @param x2 the x coordinate of the second control point in range [0, 1] + * @param y2 the y coordinate of the second control point in range [0, 1] + */ + public CubicBezierEasing( float x1, float y1, float x2, float y2 ) { + if( x1 < 0 || x1 > 1 || y1 < 0 || y1 > 1 || + x2 < 0 || x2 > 1 || y2 < 0 || y2 > 1 ) + throw new IllegalArgumentException( "control points must be in range [0, 1]"); + + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + + @Override + public float interpolate( float fraction ) { + if( fraction <= 0 || fraction >= 1 ) + return fraction; + + // use binary search + float low = 0; + float high = 1; + while( true ) { + float mid = (low + high) / 2; + float estimate = cubicBezier( mid, x1, x2 ); + if( Math.abs( fraction - estimate ) < 0.0005f ) + return cubicBezier( mid, y1, y2 ); + if( estimate < fraction ) + low = mid; + else + high = mid; + } + } + + /** + * Computes the x or y point on a cubic bezier curve for a given t value. + * + * https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves + * + * The general cubic bezier formula is: + * x = b0*x0 + b1*x1 + b2*x2 + b3*x3 + * y = b0*y0 + b1*y1 + b2*y2 + b3*y3 + * + * where: + * b0 = (1-t)^3 + * b1 = 3 * t * (1-t)^2 + * b2 = 3 * t^2 * (1-t) + * b3 = t^3 + * + * x0,y0 is always 0,0 and x3,y3 is 1,1, so we can simplify to: + * x = b1*x1 + b2*x2 + b3 + * y = b1*x1 + b2*x2 + b3 + */ + private static float cubicBezier( float t, float xy1, float xy2 ) { + float invT = (1 - t); + float b1 = 3 * t * (invT * invT); + float b2 = 3 * (t * t) * invT; + float b3 = t * t * t; + return (b1 * xy1) + (b2 * xy2) + b3; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/DerivedColor.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/DerivedColor.java index e845b9c2..de366890 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/DerivedColor.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/DerivedColor.java @@ -32,12 +32,31 @@ public class DerivedColor { private final ColorFunction[] functions; - public DerivedColor( ColorFunction... functions ) { - super( Color.red ); + private boolean hasBaseOfDefaultColor; + private int baseOfDefaultColorRGB; + + public DerivedColor( Color defaultColor, ColorFunction... functions ) { + super( (defaultColor != null) ? defaultColor : Color.red ); this.functions = functions; } public Color derive( Color baseColor ) { - return ColorFunctions.applyFunctions( baseColor, functions ); + if( (hasBaseOfDefaultColor && baseOfDefaultColorRGB == baseColor.getRGB()) || baseColor == this ) + return this; // return default color + + Color result = ColorFunctions.applyFunctions( baseColor, functions ); + + // if the result is equal to the default color, then the original base color + // was passed and we can cache this to avoid color calculations + if( !hasBaseOfDefaultColor && result.getRGB() == this.getRGB() ) { + hasBaseOfDefaultColor = true; + baseOfDefaultColorRGB = baseColor.getRGB(); + } + + return result; + } + + public ColorFunction[] getFunctions() { + return functions; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Graphics2DProxy.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Graphics2DProxy.java new file mode 100644 index 00000000..b68d2c69 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/Graphics2DProxy.java @@ -0,0 +1,479 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Paint; +import java.awt.Polygon; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.RenderingHints.Key; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.text.AttributedCharacterIterator; +import java.util.Map; + +/** + * A proxy for {@link Graphics2D}. + * + * @author Karl Tauber + */ +public class Graphics2DProxy + extends Graphics2D +{ + private final Graphics2D delegate; + + public Graphics2DProxy( Graphics2D delegate ) { + this.delegate = delegate; + } + + @Override + public Graphics create() { + return delegate.create(); + } + + @Override + public Graphics create( int x, int y, int width, int height ) { + return delegate.create( x, y, width, height ); + } + + @Override + public Color getColor() { + return delegate.getColor(); + } + + @Override + public void setColor( Color c ) { + delegate.setColor( c ); + } + + @Override + public void setPaintMode() { + delegate.setPaintMode(); + } + + @Override + public void setXORMode( Color c1 ) { + delegate.setXORMode( c1 ); + } + + @Override + public Font getFont() { + return delegate.getFont(); + } + + @Override + public void setFont( Font font ) { + delegate.setFont( font ); + } + + @Override + public FontMetrics getFontMetrics() { + return delegate.getFontMetrics(); + } + + @Override + public FontMetrics getFontMetrics( Font f ) { + return delegate.getFontMetrics( f ); + } + + @Override + public Rectangle getClipBounds() { + return delegate.getClipBounds(); + } + + @Override + public void clipRect( int x, int y, int width, int height ) { + delegate.clipRect( x, y, width, height ); + } + + @Override + public void setClip( int x, int y, int width, int height ) { + delegate.setClip( x, y, width, height ); + } + + @Override + public Shape getClip() { + return delegate.getClip(); + } + + @Override + public void setClip( Shape clip ) { + delegate.setClip( clip ); + } + + @Override + public void copyArea( int x, int y, int width, int height, int dx, int dy ) { + delegate.copyArea( x, y, width, height, dx, dy ); + } + + @Override + public void drawLine( int x1, int y1, int x2, int y2 ) { + delegate.drawLine( x1, y1, x2, y2 ); + } + + @Override + public void fillRect( int x, int y, int width, int height ) { + delegate.fillRect( x, y, width, height ); + } + + @Override + public void drawRect( int x, int y, int width, int height ) { + delegate.drawRect( x, y, width, height ); + } + + @Override + public void clearRect( int x, int y, int width, int height ) { + delegate.clearRect( x, y, width, height ); + } + + @Override + public void drawRoundRect( int x, int y, int width, int height, int arcWidth, int arcHeight ) { + delegate.drawRoundRect( x, y, width, height, arcWidth, arcHeight ); + } + + @Override + public void fillRoundRect( int x, int y, int width, int height, int arcWidth, int arcHeight ) { + delegate.fillRoundRect( x, y, width, height, arcWidth, arcHeight ); + } + + @Override + public void drawOval( int x, int y, int width, int height ) { + delegate.drawOval( x, y, width, height ); + } + + @Override + public void fillOval( int x, int y, int width, int height ) { + delegate.fillOval( x, y, width, height ); + } + + @Override + public void drawArc( int x, int y, int width, int height, int startAngle, int arcAngle ) { + delegate.drawArc( x, y, width, height, startAngle, arcAngle ); + } + + @Override + public void fillArc( int x, int y, int width, int height, int startAngle, int arcAngle ) { + delegate.fillArc( x, y, width, height, startAngle, arcAngle ); + } + + @Override + public void drawPolyline( int[] xPoints, int[] yPoints, int nPoints ) { + delegate.drawPolyline( xPoints, yPoints, nPoints ); + } + + @Override + public void drawPolygon( int[] xPoints, int[] yPoints, int nPoints ) { + delegate.drawPolygon( xPoints, yPoints, nPoints ); + } + + @Override + public void drawPolygon( Polygon p ) { + delegate.drawPolygon( p ); + } + + @Override + public void fillPolygon( int[] xPoints, int[] yPoints, int nPoints ) { + delegate.fillPolygon( xPoints, yPoints, nPoints ); + } + + @Override + public void fillPolygon( Polygon p ) { + delegate.fillPolygon( p ); + } + + @Override + public void drawChars( char[] data, int offset, int length, int x, int y ) { + delegate.drawChars( data, offset, length, x, y ); + } + + @Override + public void drawBytes( byte[] data, int offset, int length, int x, int y ) { + delegate.drawBytes( data, offset, length, x, y ); + } + + @Override + public boolean drawImage( Image img, int x, int y, ImageObserver observer ) { + return delegate.drawImage( img, x, y, observer ); + } + + @Override + public boolean drawImage( Image img, int x, int y, int width, int height, ImageObserver observer ) { + return delegate.drawImage( img, x, y, width, height, observer ); + } + + @Override + public boolean drawImage( Image img, int x, int y, Color bgcolor, ImageObserver observer ) { + return delegate.drawImage( img, x, y, bgcolor, observer ); + } + + @Override + public boolean drawImage( Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer ) { + return delegate.drawImage( img, x, y, width, height, bgcolor, observer ); + } + + @Override + public boolean drawImage( Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer ) { + return delegate.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer ); + } + + @Override + public boolean drawImage( Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer ) { + return delegate.drawImage( img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer ); + } + + @Override + public void dispose() { + delegate.dispose(); + } + + @Override + public void finalize() { + delegate.finalize(); + } + + @Override + public String toString() { + return delegate.toString(); + } + + @SuppressWarnings( "deprecation" ) + @Override + public Rectangle getClipRect() { + return delegate.getClipRect(); + } + + @Override + public boolean hitClip( int x, int y, int width, int height ) { + return delegate.hitClip( x, y, width, height ); + } + + @Override + public Rectangle getClipBounds( Rectangle r ) { + return delegate.getClipBounds( r ); + } + + @Override + public void draw3DRect( int x, int y, int width, int height, boolean raised ) { + delegate.draw3DRect( x, y, width, height, raised ); + } + + @Override + public void fill3DRect( int x, int y, int width, int height, boolean raised ) { + delegate.fill3DRect( x, y, width, height, raised ); + } + + @Override + public void draw( Shape s ) { + delegate.draw( s ); + } + + @Override + public boolean drawImage( Image img, AffineTransform xform, ImageObserver obs ) { + return delegate.drawImage( img, xform, obs ); + } + + @Override + public void drawImage( BufferedImage img, BufferedImageOp op, int x, int y ) { + delegate.drawImage( img, op, x, y ); + } + + @Override + public void drawRenderedImage( RenderedImage img, AffineTransform xform ) { + delegate.drawRenderedImage( img, xform ); + } + + @Override + public void drawRenderableImage( RenderableImage img, AffineTransform xform ) { + delegate.drawRenderableImage( img, xform ); + } + + @Override + public void drawString( String str, int x, int y ) { + delegate.drawString( str, x, y ); + } + + @Override + public void drawString( String str, float x, float y ) { + delegate.drawString( str, x, y ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, int x, int y ) { + delegate.drawString( iterator, x, y ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, float x, float y ) { + delegate.drawString( iterator, x, y ); + } + + @Override + public void drawGlyphVector( GlyphVector g, float x, float y ) { + delegate.drawGlyphVector( g, x, y ); + } + + @Override + public void fill( Shape s ) { + delegate.fill( s ); + } + + @Override + public boolean hit( Rectangle rect, Shape s, boolean onStroke ) { + return delegate.hit( rect, s, onStroke ); + } + + @Override + public GraphicsConfiguration getDeviceConfiguration() { + return delegate.getDeviceConfiguration(); + } + + @Override + public void setComposite( Composite comp ) { + delegate.setComposite( comp ); + } + + @Override + public void setPaint( Paint paint ) { + delegate.setPaint( paint ); + } + + @Override + public void setStroke( Stroke s ) { + delegate.setStroke( s ); + } + + @Override + public void setRenderingHint( Key hintKey, Object hintValue ) { + delegate.setRenderingHint( hintKey, hintValue ); + } + + @Override + public Object getRenderingHint( Key hintKey ) { + return delegate.getRenderingHint( hintKey ); + } + + @Override + public void setRenderingHints( Map hints ) { + delegate.setRenderingHints( hints ); + } + + @Override + public void addRenderingHints( Map hints ) { + delegate.addRenderingHints( hints ); + } + + @Override + public RenderingHints getRenderingHints() { + return delegate.getRenderingHints(); + } + + @Override + public void translate( int x, int y ) { + delegate.translate( x, y ); + } + + @Override + public void translate( double tx, double ty ) { + delegate.translate( tx, ty ); + } + + @Override + public void rotate( double theta ) { + delegate.rotate( theta ); + } + + @Override + public void rotate( double theta, double x, double y ) { + delegate.rotate( theta, x, y ); + } + + @Override + public void scale( double sx, double sy ) { + delegate.scale( sx, sy ); + } + + @Override + public void shear( double shx, double shy ) { + delegate.shear( shx, shy ); + } + + @Override + public void transform( AffineTransform Tx ) { + delegate.transform( Tx ); + } + + @Override + public void setTransform( AffineTransform Tx ) { + delegate.setTransform( Tx ); + } + + @Override + public AffineTransform getTransform() { + return delegate.getTransform(); + } + + @Override + public Paint getPaint() { + return delegate.getPaint(); + } + + @Override + public Composite getComposite() { + return delegate.getComposite(); + } + + @Override + public void setBackground( Color color ) { + delegate.setBackground( color ); + } + + @Override + public Color getBackground() { + return delegate.getBackground(); + } + + @Override + public Stroke getStroke() { + return delegate.getStroke(); + } + + @Override + public void clip( Shape s ) { + delegate.clip( s ); + } + + @Override + public FontRenderContext getFontRenderContext() { + return delegate.getFontRenderContext(); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/GrayFilter.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/GrayFilter.java new file mode 100644 index 00000000..9903f779 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/GrayFilter.java @@ -0,0 +1,87 @@ +// Copyright 2000-2020 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. +package com.formdev.flatlaf.util; + +import java.awt.image.RGBImageFilter; + +// based on https://github.com/JetBrains/intellij-community/blob/3840eab54746f5c4f301bb3ac78f00a980b5fd6e/platform/util/ui/src/com/intellij/util/ui/UIUtil.java#L253-L347 + +/** + * An image filter that turns an image into a grayscale image. + * Used for icons in disabled buttons and labels. + */ +public class GrayFilter + extends RGBImageFilter +{ + private final float brightness; + private final float contrast; + private final int alpha; + + private final int origContrast; + private final int origBrightness; + + public static GrayFilter createDisabledIconFilter( boolean dark ) { + return dark + ? new GrayFilter( -20, -70, 100 ) + : new GrayFilter( 25, -25, 100 ); + } + + /** + * @param brightness in range [-100..100] where 0 has no effect + * @param contrast in range [-100..100] where 0 has no effect + * @param alpha in range [0..100] where 0 is transparent, 100 has no effect + */ + public GrayFilter( int brightness, int contrast, int alpha ) { + this.origBrightness = Math.max( -100, Math.min( 100, brightness ) ); + this.origContrast = Math.max( -100, Math.min( 100, contrast ) ); + this.alpha = Math.max( 0, Math.min( 100, alpha ) ); + + this.brightness = (float) (Math.pow( origBrightness, 3 ) / (100f * 100f)); // cubic in [0..100] + this.contrast = origContrast / 100f; + + canFilterIndexColorModel = true; + } + + public GrayFilter() { + this( 0, 0, 100 ); + } + + public int getBrightness() { + return origBrightness; + } + + public int getContrast() { + return origContrast; + } + + public int getAlpha() { + return alpha; + } + + @Override + public int filterRGB( int x, int y, int rgb ) { + // use NTSC conversion formula + int gray = (int)( + 0.30 * (rgb >> 16 & 0xff) + + 0.59 * (rgb >> 8 & 0xff) + + 0.11 * (rgb & 0xff)); + + if( brightness >= 0 ) + gray = (int) ((gray + brightness * 255) / (1 + brightness)); + else + gray = (int) (gray / (1 - brightness)); + + if( contrast >= 0 ) { + if( gray >= 127 ) + gray = (int) (gray + (255 - gray) * contrast); + else + gray = (int) (gray - gray * contrast); + } else + gray = (int) (127 + (gray - 127) * (contrast + 1)); + + int a = (alpha != 100) + ? (((rgb >> 24) & 0xff) * alpha / 100) << 24 + : (rgb & 0xff000000); + + return a | (gray << 16) | (gray << 8) | gray; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java index c49048b2..9fb064b8 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java @@ -16,10 +16,14 @@ package com.formdev.flatlaf.util; +import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; +import java.text.AttributedCharacterIterator; import javax.swing.JComponent; +import com.formdev.flatlaf.FlatSystemProperties; /** * @author Karl Tauber @@ -95,4 +99,134 @@ public class HiDPIUtils private static double normalize( double value ) { return Math.floor( value + 0.25 ) + 0.25; } + + + private static Boolean useTextYCorrection; + + private static boolean useTextYCorrection() { + if( useTextYCorrection == null ) + useTextYCorrection = FlatSystemProperties.getBoolean( FlatSystemProperties.USE_TEXT_Y_CORRECTION, true ); + return useTextYCorrection; + } + + /** + * When painting text on HiDPI screens and the JRE scales, then the text is + * painted too far down on some operating systems. + * The higher the system scale factor is, the more. + *

+ * This methods computes a correction value for the Y position. + */ + public static float computeTextYCorrection( Graphics2D g ) { + if( !useTextYCorrection() || !SystemInfo.isWindows ) + return 0; + + if( !SystemInfo.isJava_9_orLater ) + return UIScale.getUserScaleFactor() > 1 ? -UIScale.scale( 0.625f ) : 0; + + AffineTransform t = g.getTransform(); + double scaleY = t.getScaleY(); + if( scaleY < 1.25 ) + return 0; + + // Text is painted at slightly different Y positions depending on scale factor + // and Y position of component. + // The exact reason is not yet known (to me), but there are several factors: + // - fractional scale factors result in fractional component Y device coordinates + // - fractional text Y device coordinates are rounded for horizontal lines of characters + // - maybe different rounding methods for drawing primitives (e.g. rectangle) and text + // - Java adds 0.5 to X/Y positions in before drawing string in BufferedTextPipe.enqueueGlyphList() + + // this is not the optimal solution, but works very good in most cases + // (tested with class FlatPaintingStringTest on Windows 10 with font "Segoe UI") + if( scaleY <= 1.25 ) + return -0.875f; + if( scaleY <= 1.5 ) + return -0.625f; + if( scaleY <= 1.75 ) + return -0.875f; + if( scaleY <= 2.0 ) + return -0.75f; + if( scaleY <= 2.25 ) + return -0.875f; + if( scaleY <= 3.5 ) + return -0.75f; + return -0.875f; + } + + /** + * Applies Y correction and draws the given string at the specified location. + * The provided component is used to query text properties and anti-aliasing hints. + *

+ * Use this method instead of {@link Graphics#drawString(String, int, int)} for correct anti-aliasing. + *

+ * Replacement for {@code SwingUtilities2.drawString()}. + */ + public static void drawStringWithYCorrection( JComponent c, Graphics2D g, String text, int x, int y ) { + drawStringUnderlineCharAtWithYCorrection( c, g, text, -1, x, y ); + } + + /** + * Applies Y correction and draws the given string at the specified location underlining the specified character. + * The provided component is used to query text properties and anti-aliasing hints. + *

+ * Replacement for {@code SwingUtilities2.drawStringUnderlineCharAt()}. + */ + public static void drawStringUnderlineCharAtWithYCorrection( JComponent c, + Graphics2D g, String text, int underlinedIndex, int x, int y ) + { + float yCorrection = computeTextYCorrection( g ); + if( yCorrection != 0 ) { + g.translate( 0, yCorrection ); + JavaCompatibility.drawStringUnderlineCharAt( c, g, text, underlinedIndex, x, y ); + g.translate( 0, -yCorrection ); + } else + JavaCompatibility.drawStringUnderlineCharAt( c, g, text, underlinedIndex, x, y ); + } + + /** + * Creates a graphics object and applies Y correction to string drawing methods. + * If no Y correction is necessary, the passed in graphics object is returned. + */ + public static Graphics2D createGraphicsTextYCorrection( Graphics2D g ) { + float yCorrection = computeTextYCorrection( g ); + if( yCorrection == 0 ) + return g; + + return new Graphics2DProxy( g ) { + @Override + public void drawString( String str, int x, int y ) { + super.drawString( str, x, y + yCorrection ); + } + + @Override + public void drawString( String str, float x, float y ) { + super.drawString( str, x, y + yCorrection ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, int x, int y ) { + super.drawString( iterator, x, y + yCorrection ); + } + + @Override + public void drawString( AttributedCharacterIterator iterator, float x, float y ) { + super.drawString( iterator, x, y + yCorrection ); + } + + @Override + public void drawChars( char[] data, int offset, int length, int x, int y ) { + super.drawChars( data, offset, length, x, Math.round( y + yCorrection ) ); + } + + @Override + public void drawBytes( byte[] data, int offset, int length, int x, int y ) { + super.drawBytes( data, offset, length, x, Math.round( y + yCorrection ) ); + } + + @Override + public void drawGlyphVector( GlyphVector g, float x, float y ) { + super.drawGlyphVector( g, x, y + yCorrection ); + } + }; + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/JavaCompatibility.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/JavaCompatibility.java index 7e784af7..f4e740fc 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/JavaCompatibility.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/JavaCompatibility.java @@ -16,6 +16,7 @@ package com.formdev.flatlaf.util; +import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.lang.reflect.InvocationTargetException; @@ -27,7 +28,7 @@ import com.formdev.flatlaf.FlatLaf; /** * Provides Java version compatibility methods. - * + *

* WARNING: This is private API and may change. * * @author Karl Tauber @@ -35,10 +36,12 @@ import com.formdev.flatlaf.FlatLaf; public class JavaCompatibility { private static Method drawStringUnderlineCharAtMethod; + private static Method getClippedStringMethod; /** * Java 8: sun.swing.SwingUtilities2.drawStringUnderlineCharAt( JComponent c, * Graphics g, String text, int underlinedIndex, int x, int y ) + *
* Java 9: javax.swing.plaf.basic.BasicGraphicsUtils.drawStringUnderlineCharAt( JComponent c, * Graphics2D g, String string, int underlinedIndex, float x, float y ) */ @@ -48,10 +51,10 @@ public class JavaCompatibility synchronized( JavaCompatibility.class ) { if( drawStringUnderlineCharAtMethod == null ) { try { - Class cls = Class.forName( SystemInfo.IS_JAVA_9_OR_LATER + Class cls = Class.forName( SystemInfo.isJava_9_orLater ? "javax.swing.plaf.basic.BasicGraphicsUtils" : "sun.swing.SwingUtilities2" ); - drawStringUnderlineCharAtMethod = cls.getMethod( "drawStringUnderlineCharAt", SystemInfo.IS_JAVA_9_OR_LATER + drawStringUnderlineCharAtMethod = cls.getMethod( "drawStringUnderlineCharAt", SystemInfo.isJava_9_orLater ? new Class[] { JComponent.class, Graphics2D.class, String.class, int.class, float.class, float.class } : new Class[] { JComponent.class, Graphics.class, String.class, int.class, int.class, int.class } ); } catch( Exception ex ) { @@ -62,7 +65,7 @@ public class JavaCompatibility } try { - if( SystemInfo.IS_JAVA_9_OR_LATER ) + if( SystemInfo.isJava_9_orLater ) drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, (float) x, (float) y ); else drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, x, y ); @@ -71,4 +74,37 @@ public class JavaCompatibility throw new RuntimeException( ex ); } } + + /** + * Java 8: sun.swing.SwingUtilities2.clipStringIfNecessary( JComponent c, + * FontMetrics fm, String string, int availTextWidth ) + *
+ * Java 9: javax.swing.plaf.basic.BasicGraphicsUtils.getClippedString( JComponent c, + * FontMetrics fm, String string, int availTextWidth ) + */ + public static String getClippedString( JComponent c, FontMetrics fm, String string, int availTextWidth ) { + synchronized( JavaCompatibility.class ) { + if( getClippedStringMethod == null ) { + try { + Class cls = Class.forName( SystemInfo.isJava_9_orLater + ? "javax.swing.plaf.basic.BasicGraphicsUtils" + : "sun.swing.SwingUtilities2" ); + getClippedStringMethod = cls.getMethod( SystemInfo.isJava_9_orLater + ? "getClippedString" + : "clipStringIfNecessary", + new Class[] { JComponent.class, FontMetrics.class, String.class, int.class } ); + } catch( Exception ex ) { + Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex ); + throw new RuntimeException( ex ); + } + } + } + + try { + return (String) getClippedStringMethod.invoke( null, c, fm, string, availTextWidth ); + } catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) { + Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex ); + throw new RuntimeException( ex ); + } + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/MultiResolutionImageSupport.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/MultiResolutionImageSupport.java new file mode 100644 index 00000000..259db6ff --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/MultiResolutionImageSupport.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import java.awt.Image; +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +/** + * Support for multi-resolution images available since Java 9. + * + * @author Karl Tauber + */ +public class MultiResolutionImageSupport +{ + public static boolean isAvailable() { + return false; + } + + public static boolean isMultiResolutionImage( Image image ) { + return false; + } + + public static Image create( int baseImageIndex, Image... resolutionVariants ) { + return resolutionVariants[baseImageIndex]; + } + + public static Image map( Image image, Function mapper ) { + return mapper.apply( image ); + } + + public static Image getResolutionVariant( Image image, int destImageWidth, int destImageHeight ) { + return image; + } + + public static List getResolutionVariants( Image image ) { + return Collections.singletonList( image ); + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledEmptyBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledEmptyBorder.java new file mode 100644 index 00000000..4d40e61e --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledEmptyBorder.java @@ -0,0 +1,53 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import static com.formdev.flatlaf.util.UIScale.scale; +import java.awt.Component; +import java.awt.Insets; +import javax.swing.border.EmptyBorder; + +/** + * Empty border that scales insets. + * + * @author Karl Tauber + */ +public class ScaledEmptyBorder + extends EmptyBorder +{ + public ScaledEmptyBorder( int top, int left, int bottom, int right ) { + super( top, left, bottom, right ); + } + + public ScaledEmptyBorder( Insets insets ) { + super( insets ); + } + + @Override + public Insets getBorderInsets() { + return new Insets( scale( top ), scale( left ), scale( bottom ), scale( right ) ); + } + + @Override + public Insets getBorderInsets( Component c, Insets insets ) { + insets.left = scale( left ); + insets.top = scale( top ); + insets.right = scale( right ); + insets.bottom = scale( bottom ); + return insets; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledImageIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledImageIcon.java new file mode 100644 index 00000000..cb503c31 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/ScaledImageIcon.java @@ -0,0 +1,184 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import javax.swing.Icon; +import javax.swing.ImageIcon; + +/** + * Scales the given image icon using the system and user scale factors and + * paints the icon at system scale factor 1x. This gives best scaling quality. + * If the given image icon supports multiple resolutions, the best resolution + * variant is used. The last scaled image is cached for faster repainting. + * + * @author Karl Tauber + */ +public class ScaledImageIcon + implements Icon +{ + private final ImageIcon imageIcon; + private final int iconWidth; + private final int iconHeight; + + private double lastSystemScaleFactor; + private float lastUserScaleFactor; + private Image lastImage; + + public ScaledImageIcon( ImageIcon imageIcon ) { + this( imageIcon, imageIcon.getIconWidth(), imageIcon.getIconHeight() ); + } + + public ScaledImageIcon( ImageIcon imageIcon, int iconWidth, int iconHeight ) { + this.imageIcon = imageIcon; + this.iconWidth = iconWidth; + this.iconHeight = iconHeight; + } + + @Override + public int getIconWidth() { + return UIScale.scale( iconWidth ); + } + + @Override + public int getIconHeight() { + return UIScale.scale( iconHeight ); + } + + @Override + public void paintIcon( Component c, Graphics g, int x, int y ) { +/*debug + g.setColor( Color.red ); + g.drawRect( x, y, getIconWidth() - 1, getIconHeight() - 1 ); +debug*/ + + // scale factor + double systemScaleFactor = UIScale.getSystemScaleFactor( (Graphics2D) g ); + float userScaleFactor = UIScale.getUserScaleFactor(); + double scaleFactor = systemScaleFactor * userScaleFactor; + + // paint input image icon if not necessary to scale + if( scaleFactor == 1 && iconWidth == imageIcon.getIconWidth() && iconHeight == imageIcon.getIconHeight() ) { + imageIcon.paintIcon( c, g, x, y ); + return; + } + + // paint cached scaled icon + if( systemScaleFactor == lastSystemScaleFactor && + userScaleFactor == lastUserScaleFactor && + lastImage != null ) + { + paintLastImage( g, x, y ); + return; + } + + // destination image size + int destImageWidth = (int) Math.round( iconWidth * scaleFactor ); + int destImageHeight = (int) Math.round( iconHeight * scaleFactor ); + + // get resolution variant of image if it is a multi-resolution image + Image image = getResolutionVariant( destImageWidth, destImageHeight ); + + // size of image + int imageWidth = image.getWidth( null ); + int imageHeight = image.getHeight( null ); + + // scale image if necessary to destination size + if( imageWidth != destImageWidth || imageHeight != destImageHeight ) { + // determine scaling method; default is "quality" + Object scalingInterpolation = RenderingHints.VALUE_INTERPOLATION_BICUBIC; + float imageScaleFactor = (float) destImageWidth / (float) imageWidth; + if( ((int) imageScaleFactor) == imageScaleFactor && + imageScaleFactor > 1f && + imageWidth <= 16 && + imageHeight <= 16 ) + { + // use "speed" scaling for small icons if the scale factor is an integer + // to avoid blurred icons + scalingInterpolation = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR; + } + + // scale image + BufferedImage bufferedImage = image2bufferedImage( image ); + image = scaleImage( bufferedImage, destImageWidth, destImageHeight, scalingInterpolation ); + } + + // cache image + lastSystemScaleFactor = systemScaleFactor; + lastUserScaleFactor = userScaleFactor; + lastImage = image; + + // paint image + paintLastImage( g, x, y ); + } + + protected Image getResolutionVariant( int destImageWidth, int destImageHeight ) { + return MultiResolutionImageSupport.getResolutionVariant( + imageIcon.getImage(), destImageWidth, destImageHeight ); + } + + private void paintLastImage( Graphics g, int x, int y ) { + if( lastSystemScaleFactor > 1 ) { + HiDPIUtils.paintAtScale1x( (Graphics2D) g, x, y, 100, 100, // width and height are not used + (g2, x2, y2, width2, height2, scaleFactor2) -> { + g2.drawImage( lastImage, x2, y2, null ); + } ); + } else + g.drawImage( lastImage, x, y, null ); + } + + /** + * Scales the given image to the target dimensions. + * + * This is the same what imgscalr library (https://github.com/rkalla/imgscalr) + * would do when invoking Scalr.resize(). + */ + private BufferedImage scaleImage( BufferedImage image, int targetWidth, int targetHeight, + Object scalingInterpolation ) + { + BufferedImage bufferedImage = new BufferedImage( targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB ); + Graphics2D g = bufferedImage.createGraphics(); + try { + g.setRenderingHint( RenderingHints.KEY_INTERPOLATION, scalingInterpolation ); + g.drawImage( image, 0, 0, targetWidth, targetHeight, null ); + } finally { + g.dispose(); + } + return bufferedImage; + + } + + private BufferedImage image2bufferedImage( Image image ) { + if( image instanceof BufferedImage ) + return (BufferedImage) image; + + BufferedImage bufferedImage = new BufferedImage( image.getWidth( null ), + image.getHeight( null ), BufferedImage.TYPE_INT_ARGB ); + Graphics2D g = bufferedImage.createGraphics(); + try { + g.drawImage( image, 0, 0, null ); + } finally { + g.dispose(); + } + return bufferedImage; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java index 0909fdb1..f5296436 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java @@ -27,46 +27,60 @@ import java.util.StringTokenizer; public class SystemInfo { // platforms - public static final boolean IS_WINDOWS; - public static final boolean IS_MAC; - public static final boolean IS_LINUX; + public static final boolean isWindows; + public static final boolean isMacOS; + public static final boolean isLinux; // OS versions - public static final boolean IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER; + public static final long osVersion; + public static final boolean isWindows_10_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_15_Catalina_orLater; // Java versions - public static final boolean IS_JAVA_9_OR_LATER; + public static final long javaVersion; + public static final boolean isJava_9_orLater; + public static final boolean isJava_11_orLater; + public static final boolean isJava_15_orLater; // Java VMs - public static final boolean IS_JETBRAINS_JVM; + public static final boolean isJetBrainsJVM; + public static final boolean isJetBrainsJVM_11_orLater; // UI toolkits - public static final boolean IS_KDE; + public static final boolean isKDE; static { // platforms String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH ); - IS_WINDOWS = osName.startsWith( "windows" ); - IS_MAC = osName.startsWith( "mac" ); - IS_LINUX = osName.startsWith( "linux" ); + isWindows = osName.startsWith( "windows" ); + isMacOS = osName.startsWith( "mac" ); + isLinux = osName.startsWith( "linux" ); // OS versions - long osVersion = scanVersion( System.getProperty( "os.version" ) ); - IS_MAC_OS_10_11_EL_CAPITAN_OR_LATER = (IS_MAC && osVersion >= toVersion( 10, 11, 0, 0 )); + osVersion = scanVersion( System.getProperty( "os.version" ) ); + isWindows_10_orLater = (isWindows && osVersion >= toVersion( 10, 0, 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_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 )); // Java versions - long javaVersion = scanVersion( System.getProperty( "java.version" ) ); - IS_JAVA_9_OR_LATER = (javaVersion >= toVersion( 9, 0, 0, 0 )); + javaVersion = scanVersion( System.getProperty( "java.version" ) ); + isJava_9_orLater = (javaVersion >= toVersion( 9, 0, 0, 0 )); + isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 )); + isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 )); // Java VMs - IS_JETBRAINS_JVM = System.getProperty( "java.vm.vendor", "Unknown" ) + isJetBrainsJVM = System.getProperty( "java.vm.vendor", "Unknown" ) .toLowerCase( Locale.ENGLISH ).contains( "jetbrains" ); + isJetBrainsJVM_11_orLater = isJetBrainsJVM && isJava_11_orLater; // UI toolkits - IS_KDE = (IS_LINUX && System.getenv( "KDE_FULL_SESSION" ) != null); + isKDE = (isLinux && System.getenv( "KDE_FULL_SESSION" ) != null); } - private static long scanVersion( String version ) { + public static long scanVersion( String version ) { int major = 1; int minor = 0; int micro = 0; @@ -84,7 +98,7 @@ public class SystemInfo return toVersion( major, minor, micro, patch ); } - private static long toVersion( int major, int minor, int micro, int patch ) { + public static long toVersion( int major, int minor, int micro, int patch ) { return ((long) major << 48) + ((long) minor << 32) + ((long) micro << 16) + patch; } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index d0bb15b8..686e400c 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -22,8 +22,10 @@ import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.Insets; +import java.awt.Toolkit; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.lang.reflect.Method; import javax.swing.LookAndFeel; import javax.swing.UIManager; @@ -31,6 +33,7 @@ import javax.swing.plaf.DimensionUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.InsetsUIResource; import javax.swing.plaf.UIResource; +import com.formdev.flatlaf.FlatSystemProperties; /** * Two scaling modes are supported for HiDPI displays: @@ -48,12 +51,15 @@ import javax.swing.plaf.UIResource; * * 2) user scaling mode * - * This mode is mainly for Java 8 compatibility, but is also used on Linux. + * This mode is mainly for Java 8 compatibility, but is also used on Linux + * or if the default font is changed. * The user scale factor is computed based on the used font. * The JRE does not scale anything. * So we have to invoke {@link #scale(float)} where necessary. * There is only one user scale factor for all displays. - * The user scale factor may change if the active LaF or "Label.font" has changed. + * The user scale factor may change if the active LaF, "defaultFont" or "Label.font" has changed. + * If system scaling mode is available the user scale factor is usually 1, + * but may be larger on Linux or if the default font is changed. * * @author Karl Tauber */ @@ -61,6 +67,20 @@ public class UIScale { private static final boolean DEBUG = false; + private static PropertyChangeSupport changeSupport; + + public static void addPropertyChangeListener( PropertyChangeListener listener ) { + if( changeSupport == null ) + changeSupport = new PropertyChangeSupport( UIScale.class ); + changeSupport.addPropertyChangeListener( listener ); + } + + public static void removePropertyChangeListener( PropertyChangeListener listener ) { + if( changeSupport == null ) + return; + changeSupport.removePropertyChangeListener( listener ); + } + //---- system scaling (Java 9) -------------------------------------------- private static Boolean jreHiDPI; @@ -71,10 +91,10 @@ public class UIScale jreHiDPI = false; - if( SystemInfo.IS_JAVA_9_OR_LATER ) { + if( SystemInfo.isJava_9_orLater ) { // Java 9 and later supports per-monitor scaling jreHiDPI = true; - } else if( SystemInfo.IS_JETBRAINS_JVM ) { + } else if( SystemInfo.isJetBrainsJVM ) { // IntelliJ IDEA ships its own JetBrains Java 8 JRE that may supports per-monitor scaling // see com.intellij.ui.JreHiDpiUtil.isJreHiDPIEnabled() try { @@ -97,7 +117,7 @@ public class UIScale } public static double getSystemScaleFactor( GraphicsConfiguration gc ) { - return isSystemScalingEnabled() ? gc.getDefaultTransform().getScaleX() : 1; + return (isSystemScalingEnabled() && gc != null) ? gc.getDefaultTransform().getScaleX() : 1; } //---- user scaling (Java 8) ---------------------------------------------- @@ -110,85 +130,129 @@ public class UIScale return; initialized = true; - if( isUserScalingEnabled() ) { - // listener to update scale factor if LaF changed or if Label.font changed - // (e.g. option "Override default fonts" in IntelliJ IDEA) - PropertyChangeListener listener = new PropertyChangeListener() { - @Override - public void propertyChange( PropertyChangeEvent e ) { - String propName = e.getPropertyName(); - if( "lookAndFeel".equals( propName ) ) { + if( !isUserScalingEnabled() ) + return; + + // listener to update scale factor if LaF changed, "defaultFont" or "Label.font" changed + PropertyChangeListener listener = new PropertyChangeListener() { + @Override + public void propertyChange( PropertyChangeEvent e ) { + switch( e.getPropertyName() ) { + case "lookAndFeel": // it is not necessary (and possible) to remove listener of old LaF defaults if( e.getNewValue() instanceof LookAndFeel ) UIManager.getLookAndFeelDefaults().addPropertyChangeListener( this ); updateScaleFactor(); - } else if( "Label.font".equals( propName ) ) - updateScaleFactor(); - } - }; - UIManager.addPropertyChangeListener( listener ); - UIManager.getLookAndFeelDefaults().addPropertyChangeListener( listener ); + break; - updateScaleFactor(); - } + case "defaultFont": + case "Label.font": + updateScaleFactor(); + break; + } + } + }; + UIManager.addPropertyChangeListener( listener ); + UIManager.getDefaults().addPropertyChangeListener( listener ); + UIManager.getLookAndFeelDefaults().addPropertyChangeListener( listener ); + + updateScaleFactor(); } private static void updateScaleFactor() { if( !isUserScalingEnabled() ) return; + // apply custom scale factor specified in system property "flatlaf.uiScale" + float customScaleFactor = getCustomScaleFactor(); + if( customScaleFactor > 0 ) { + setUserScaleFactor( customScaleFactor ); + return; + } + // use font size to calculate scale factor (instead of DPI) // because even if we are on a HiDPI display it is not sure // that a larger font size is set by the current LaF // (e.g. can avoid large icons with small text) - Font font = UIManager.getFont( "Label.font" ); + Font font = UIManager.getFont( "defaultFont" ); + if( font == null ) + font = UIManager.getFont( "Label.font" ); - setUserScaleFactor( computeScaleFactor( font ) ); + float newScaleFactor; + if( SystemInfo.isWindows ) { + // Special handling for Windows to be compatible with OS scaling, + // which distinguish between "screen scaling" and "text scaling". + // - Windows "screen scaling" scales everything (text, icon, gaps, etc) + // and may have different scaling factors for each screen. + // - Windows "text scaling" increases only the font size, but on all screens. + // + // Both can be changed by the user in the Windows 10 Settings: + // - Settings > Display > Scale and layout + // - Settings > Ease of Access > Display > Make text bigger (100% - 225%) + if( font instanceof UIResource ) { + if( isSystemScalingEnabled() ) { + // Do not apply own scaling if the JRE scales using Windows screen scale factor. + // If user increases font size in Windows 10 settings, desktop property + // "win.messagebox.font" is changed and FlatLaf uses the larger font. + newScaleFactor = 1; + } else { + // If the JRE does not scale (Java 8), the size of the UI font + // (usually from desktop property "win.messagebox.font") + // combines the Windows screen and text scale factors. + // But the font in desktop property "win.defaultGUI.font" is only + // scaled with the Windows screen scale factor. So use it to compute + // our scale factor that is equal to Windows screen scale factor. + Font winFont = (Font) Toolkit.getDefaultToolkit().getDesktopProperty( "win.defaultGUI.font" ); + newScaleFactor = computeScaleFactor( (winFont != null) ? winFont : font ); + } + } else { + // If font was explicitly set from outside (is not a UIResource) + // use it to compute scale factor. This allows applications to + // use custom fonts (e.g. that the user can change in UI) and + // get scaling if a larger font size is used. + // E.g. FlatLaf Demo supports increasing font size in "Font" menu and UI scales. + newScaleFactor = computeScaleFactor( font ); + } + } else + newScaleFactor = computeScaleFactor( font ); + + setUserScaleFactor( newScaleFactor ); } private static float computeScaleFactor( Font font ) { // default font size float fontSizeDivider = 12f; - if( SystemInfo.IS_WINDOWS ) { + if( SystemInfo.isWindows ) { // Windows LaF uses Tahoma font rather than the actual Windows system font (Segoe UI), // and its size is always ca. 10% smaller than the actual system font size. // Tahoma 11 is used at 100% if( "Tahoma".equals( font.getFamily() ) ) fontSizeDivider = 11f; - } else if( SystemInfo.IS_MAC ) { + } else if( SystemInfo.isMacOS ) { // default font size on macOS is 13 fontSizeDivider = 13f; - } else if( SystemInfo.IS_LINUX ) { + } else if( SystemInfo.isLinux ) { // default font size for Unity and Gnome is 15 and for KDE it is 13 - fontSizeDivider = SystemInfo.IS_KDE ? 13f : 15f; + fontSizeDivider = SystemInfo.isKDE ? 13f : 15f; } return font.getSize() / fontSizeDivider; } private static boolean isUserScalingEnabled() { - if( isSystemScalingEnabled() && !SystemInfo.IS_LINUX ) - return false; // disable user scaling if JRE scales - - // same as in IntelliJ IDEA - String hidpi = System.getProperty( "hidpi" ); - return (hidpi != null) ? Boolean.parseBoolean( hidpi ) : true; + return FlatSystemProperties.getBoolean( FlatSystemProperties.UI_SCALE_ENABLED, true ); } /** - * Applies a custom scale factor given in system properties "flatlaf.uiScale" - * or "sun.java2d.uiScale" to the given font. + * Applies a custom scale factor given in system property "flatlaf.uiScale" + * to the given font. */ public static FontUIResource applyCustomScaleFactor( FontUIResource font ) { - if( UIScale.isSystemScalingEnabled() ) + if( !isUserScalingEnabled() ) return font; - String uiScale = System.getProperty( "flatlaf.uiScale" ); - if( uiScale == null ) - uiScale = System.getProperty( "sun.java2d.uiScale" ); - - float scaleFactor = parseScaleFactor( uiScale ); + float scaleFactor = getCustomScaleFactor(); if( scaleFactor <= 0 ) return font; @@ -197,15 +261,14 @@ public class UIScale return font; int newFontSize = Math.round( (font.getSize() / fontScaleFactor) * scaleFactor ); - return new FontUIResource( font.getFamily(), font.getStyle(), newFontSize ); + return new FontUIResource( font.deriveFont( (float) newFontSize ) ); } /** - * Scales the given font. + * Get custom scale factor specified in system property "flatlaf.uiScale". */ - public static FontUIResource scaleFont( FontUIResource font, float scaleFactor ) { - int newFontSize = Math.round( font.getSize() * scaleFactor ); - return new FontUIResource( font.getFamily(), font.getStyle(), newFontSize ); + private static float getCustomScaleFactor() { + return parseScaleFactor( System.getProperty( FlatSystemProperties.UI_SCALE ) ); } /** @@ -245,10 +308,14 @@ public class UIScale else // round scale factor to 1/4 scaleFactor = Math.round( scaleFactor * 4f ) / 4f; + float oldScaleFactor = UIScale.scaleFactor; UIScale.scaleFactor = scaleFactor; if( DEBUG ) System.out.println( "HiDPI scale factor " + scaleFactor ); + + if( changeSupport != null ) + changeSupport.firePropertyChange( "userScaleFactor", oldScaleFactor, scaleFactor ); } public static float scale( float value ) { diff --git a/flatlaf-core/src/main/java9/com/formdev/flatlaf/util/MultiResolutionImageSupport.java b/flatlaf-core/src/main/java9/com/formdev/flatlaf/util/MultiResolutionImageSupport.java new file mode 100644 index 00000000..b23178d9 --- /dev/null +++ b/flatlaf-core/src/main/java9/com/formdev/flatlaf/util/MultiResolutionImageSupport.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.util; + +import java.awt.Image; +import java.awt.image.AbstractMultiResolutionImage; +import java.awt.image.BaseMultiResolutionImage; +import java.awt.image.MultiResolutionImage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.function.Function; +import javax.swing.ImageIcon; + +/** + * Support for multi-resolution images available since Java 9. + * + * @author Karl Tauber + */ +public class MultiResolutionImageSupport +{ + public static boolean isAvailable() { + return true; + } + + public static boolean isMultiResolutionImage( Image image ) { + return image instanceof MultiResolutionImage; + } + + public static Image create( int baseImageIndex, Image... resolutionVariants ) { + return new BaseMultiResolutionImage( baseImageIndex, resolutionVariants ); + } + + public static Image map( Image image, Function mapper ) { + return image instanceof MultiResolutionImage + ? new MappedMultiResolutionImage( image, mapper ) + : mapper.apply( image ); + } + + public static Image getResolutionVariant( Image image, int destImageWidth, int destImageHeight ) { + return (image instanceof MultiResolutionImage) + ? ((MultiResolutionImage)image).getResolutionVariant( destImageWidth, destImageHeight ) + : image; + } + + public static List getResolutionVariants( Image image ) { + return (image instanceof MultiResolutionImage) + ? ((MultiResolutionImage)image).getResolutionVariants() + : Collections.singletonList( image ); + } + + //---- class MappedMultiResolutionImage ----------------------------------- + + private static class MappedMultiResolutionImage + extends AbstractMultiResolutionImage + { + private final Image mrImage; + private final Function mapper; + private final IdentityHashMap cache = new IdentityHashMap<>(); + + MappedMultiResolutionImage( Image mrImage, Function mapper ) { + assert mrImage instanceof MultiResolutionImage; + + this.mrImage = mrImage; + this.mapper = mapper; + } + + @Override + public Image getResolutionVariant( double destImageWidth, double destImageHeight ) { + Image variant = ((MultiResolutionImage)mrImage).getResolutionVariant( destImageWidth, destImageHeight ); + return mapAndCacheImage( variant ); + } + + @Override + public List getResolutionVariants() { + List variants = ((MultiResolutionImage)mrImage).getResolutionVariants(); + List mappedVariants = new ArrayList<>(); + for( Image image : variants ) + mappedVariants.add( mapAndCacheImage( image ) ); + return mappedVariants; + } + + @Override + protected Image getBaseImage() { + return mapAndCacheImage( mrImage ); + } + + private Image mapAndCacheImage( Image image ) { + return cache.computeIfAbsent( image, img -> { + return new ImageIcon( mapper.apply( img ) ).getImage(); + } ); + } + } +} diff --git a/flatlaf-core/src/main/module-info/module-info.java b/flatlaf-core/src/main/module-info/module-info.java index 860d4423..e8e9dc4c 100644 --- a/flatlaf-core/src/main/module-info/module-info.java +++ b/flatlaf-core/src/main/module-info/module-info.java @@ -26,5 +26,7 @@ module com.formdev.flatlaf { exports com.formdev.flatlaf.ui; exports com.formdev.flatlaf.util; + opens com.formdev.flatlaf.resources; + uses com.formdev.flatlaf.FlatDefaultsAddon; } diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties index b7dcf057..210bb6c3 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties @@ -27,6 +27,7 @@ Button.default.boldText=true Component.focusWidth=2 Component.innerFocusWidth=0 +Component.innerOutlineWidth=0 Component.arrowType=triangle diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 014cf7a4..85e6d7c2 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -21,21 +21,21 @@ #---- variables ---- @background=#3c3f41 -@foreground=#bbbbbb +@foreground=#bbb @selectionBackground=#4B6EAF @selectionForeground=@foreground @selectionInactiveBackground=#0D293E @selectionInactiveForeground=@foreground -@disabledText=#777777 +@disabledText=#888 @textComponentBackground=#45494A @menuBackground=darken(@background,5%) -@cellFocusColor=#000000 +@menuHoverBackground=lighten(@menuBackground,10%,derived) +@menuCheckBackground=darken(@selectionBackground,10%) +@menuAcceleratorForeground=darken(@foreground,15%) +@menuAcceleratorSelectionForeground=@selectionForeground +@cellFocusColor=#000 @icon=#adadad -# Button -@buttonHoverBackground=lighten(3%,autoInverse) -@buttonPressedBackground=lighten(6%,autoInverse) - # Drop (use lazy colors for IntelliJ platform themes, which usually do not specify these colors) @dropCellBackground=darken(List.selectionBackground,10%,lazy) @dropCellForeground=lazy(List.selectionForeground) @@ -43,24 +43,6 @@ @dropLineShortColor=lighten(List.selectionBackground,30%,lazy) -#---- globals ---- - -*.background=@background -*.foreground=@foreground -*.textBackground=@background -*.textForeground=@foreground -*.caretForeground=@foreground -*.inactiveBackground=@background -*.inactiveForeground=@foreground -*.selectionBackground=@selectionBackground -*.selectionForeground=@selectionForeground -*.disabledBackground=@background -*.disabledForeground=@disabledText -*.disabledText=@disabledText -*.acceleratorForeground=#bbbbbb -*.acceleratorSelectionForeground=@selectionForeground - - #---- system colors ---- activeCaption=#434E60 @@ -73,8 +55,11 @@ controlDkShadow=lighten($controlShadow,10%) #---- Button ---- Button.background=#4c5052 -Button.hoverBackground=@buttonHoverBackground -Button.pressedBackground=@buttonPressedBackground +Button.hoverBackground=lighten($Button.background,3%,derived) +Button.pressedBackground=lighten($Button.background,6%,derived) +Button.selectedBackground=lighten($Button.background,10%,derived) +Button.selectedForeground=@foreground +Button.disabledSelectedBackground=lighten($Button.background,3%,derived) Button.borderColor=#5e6060 Button.disabledBorderColor=#5e6060 @@ -82,44 +67,62 @@ Button.focusedBorderColor=#466d94 Button.hoverBorderColor=$Button.focusedBorderColor Button.default.background=#365880 -Button.default.foreground=#bbbbbb -Button.default.hoverBackground=@buttonHoverBackground -Button.default.pressedBackground=@buttonPressedBackground +Button.default.foreground=#bbb +Button.default.hoverBackground=lighten($Button.default.background,3%,derived) +Button.default.pressedBackground=lighten($Button.default.background,6%,derived) Button.default.borderColor=#4c708c Button.default.hoverBorderColor=#537699 Button.default.focusedBorderColor=#537699 Button.default.focusColor=#43688c Button.default.boldText=true -Button.toolbar.hoverBackground=#4c5052 -Button.toolbar.pressedBackground=#555a5d +Button.toolbar.hoverBackground=lighten($Button.background,1%,derived) +Button.toolbar.pressedBackground=lighten($Button.background,4%,derived) +Button.toolbar.selectedBackground=lighten($Button.background,7%,derived) #---- CheckBox ---- +# enabled CheckBox.icon.borderColor=#6B6B6B -CheckBox.icon.disabledBorderColor=#545556 -CheckBox.icon.selectedBorderColor=#6B6B6B -CheckBox.icon.focusedBorderColor=#466D94 -CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor -CheckBox.icon.selectedFocusedBorderColor=#466D94 CheckBox.icon.background=#43494A -CheckBox.icon.disabledBackground=@background -CheckBox.icon.hoverBackground=@buttonHoverBackground -CheckBox.icon.pressedBackground=@buttonPressedBackground -CheckBox.icon.selectedBackground=#43494A +CheckBox.icon.selectedBorderColor=$CheckBox.icon.borderColor +CheckBox.icon.selectedBackground=$CheckBox.icon.background CheckBox.icon.checkmarkColor=#A7A7A7 + +# disabled +CheckBox.icon.disabledBorderColor=#545556 +CheckBox.icon.disabledBackground=@background CheckBox.icon.disabledCheckmarkColor=#606060 +# focused +CheckBox.icon.focusedBorderColor=#466D94 +CheckBox.icon.selectedFocusedBorderColor=#466D94 + +# hover +CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor +CheckBox.icon.hoverBackground=lighten($CheckBox.icon.background,3%,derived) + +# pressed +CheckBox.icon.pressedBackground=lighten($CheckBox.icon.background,6%,derived) + +# used if CheckBox.icon.style=filled +# enabled +CheckBox.icon[filled].selectedBorderColor=$CheckBox.icon.checkmarkColor +CheckBox.icon[filled].selectedBackground=$CheckBox.icon.checkmarkColor +CheckBox.icon[filled].checkmarkColor=$CheckBox.icon.background +# hover +CheckBox.icon[filled].selectedHoverBackground=darken($CheckBox.icon[filled].selectedBackground,3%) +# pressed +CheckBox.icon[filled].selectedPressedBackground=darken($CheckBox.icon[filled].selectedBackground,6%) + #---- ComboBox ---- -ComboBox.background=@textComponentBackground -ComboBox.buttonBackground=@textComponentBackground ComboBox.buttonEditableBackground=#404445 ComboBox.buttonArrowColor=#9A9DA1 ComboBox.buttonDisabledArrowColor=#585858 -ComboBox.buttonHoverArrowColor=#bbbbbb +ComboBox.buttonHoverArrowColor=#bbb #---- Component ---- @@ -129,6 +132,13 @@ Component.disabledBorderColor=#646464 Component.focusedBorderColor=#466d94 Component.focusColor=#3d6185 Component.linkColor=#589df6 +Component.grayFilter=-20,-70,100 + +Component.error.borderColor=desaturate($Component.error.focusedBorderColor,25%) +Component.error.focusedBorderColor=#8b3c3c +Component.warning.borderColor=darken(desaturate($Component.warning.focusedBorderColor,20%),10%) +Component.warning.focusedBorderColor=#ac7920 +Component.custom.borderColor=desaturate(#f00,50%,relative derived noAutoInverse) #---- Desktop ---- @@ -148,20 +158,18 @@ InternalFrame.activeTitleForeground=@foreground InternalFrame.inactiveTitleBackground=darken(@background,5%) InternalFrame.inactiveTitleForeground=@disabledText -InternalFrame.activeBorderColor=lighten($Component.borderColor,10%) -InternalFrame.inactiveBorderColor=$Component.borderColor +InternalFrame.activeBorderColor=darken(@background,7%) +InternalFrame.inactiveBorderColor=darken(@background,3%) -InternalFrame.buttonHoverBackground=lighten(10%,autoInverse) -InternalFrame.buttonPressedBackground=lighten(20%,autoInverse) +InternalFrame.buttonHoverBackground=lighten($InternalFrame.activeTitleBackground,10%,derived) +InternalFrame.buttonPressedBackground=lighten($InternalFrame.activeTitleBackground,20%,derived) InternalFrame.closeHoverBackground=lazy(Actions.Red) InternalFrame.closePressedBackground=darken(Actions.Red,10%,lazy) InternalFrame.closeHoverForeground=#fff InternalFrame.closePressedForeground=#fff - -#---- List ---- - -List.background=@textComponentBackground +InternalFrame.activeDropShadowOpacity=0.5 +InternalFrame.inactiveDropShadowOpacity=0.75 #---- Menu ---- @@ -173,7 +181,6 @@ Menu.icon.disabledArrowColor=#606060 #---- MenuBar ---- MenuBar.borderColor=#515151 -MenuBar.hoverBackground=lighten($MenuBar.background,10%) #---- MenuItemCheckBox ---- @@ -187,6 +194,12 @@ MenuItemCheckBox.icon.disabledCheckmarkColor=#606060 PasswordField.capsLockIconColor=#ffffff64 +#---- Popup ---- + +Popup.dropShadowColor=#000 +Popup.dropShadowOpacity=0.25 + + #---- PopupMenu ---- PopupMenu.borderColor=#5e5e5e @@ -194,18 +207,27 @@ PopupMenu.borderColor=#5e5e5e #---- ProgressBar ---- -ProgressBar.background=#555555 +ProgressBar.background=#555 ProgressBar.foreground=#4A88C7 ProgressBar.selectionForeground=@foreground ProgressBar.selectionBackground=@foreground +#---- RootPane ---- + +RootPane.activeBorderColor=darken(@background,7%,derived) +RootPane.inactiveBorderColor=darken(@background,5%,derived) + + #---- ScrollBar ---- -ScrollBar.track=#3F4244 -ScrollBar.thumb=lighten($ScrollBar.track,10%) -ScrollBar.hoverTrackColor=lighten($ScrollBar.track,4%) -ScrollBar.hoverThumbColor=lighten($ScrollBar.thumb,10%) +ScrollBar.track=lighten(@background,1%,derived noAutoInverse) +ScrollBar.thumb=lighten($ScrollBar.track,10%,derived noAutoInverse) +ScrollBar.hoverTrackColor=lighten($ScrollBar.track,4%,derived noAutoInverse) +ScrollBar.hoverThumbColor=lighten($ScrollBar.thumb,10%,derived noAutoInverse) +ScrollBar.pressedThumbColor=lighten($ScrollBar.thumb,15%,derived noAutoInverse) +ScrollBar.hoverButtonBackground=lighten(@background,5%,derived noAutoInverse) +ScrollBar.pressedButtonBackground=lighten(@background,10%,derived noAutoInverse) #---- Separator ---- @@ -217,8 +239,8 @@ Separator.foreground=#515151 Slider.trackColor=#646464 Slider.thumbColor=#A6A6A6 -Slider.tickColor=#888888 -Slider.hoverColor=darken(15%,autoInverse) +Slider.tickColor=#888 +Slider.hoverColor=darken($Slider.thumbColor,15%,derived) Slider.disabledForeground=#4c5052 @@ -230,34 +252,44 @@ SplitPaneDivider.oneTouchHoverArrowColor=#7A7D81 #---- TabbedPane ---- -TabbedPane.disabledForeground=@disabledText TabbedPane.underlineColor=#4A88C7 TabbedPane.disabledUnderlineColor=#7a7a7a TabbedPane.hoverColor=#2e3133 TabbedPane.focusColor=#3d4b5c -TabbedPane.contentAreaColor=#323232 +TabbedPane.contentAreaColor=#646464 + +TabbedPane.closeBackground=null +TabbedPane.closeForeground=@disabledText +TabbedPane.closeHoverBackground=lighten($TabbedPane.hoverColor,10%) +TabbedPane.closeHoverForeground=@foreground +TabbedPane.closePressedBackground=lighten($TabbedPane.hoverColor,15%) +TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground #---- Table ---- -Table.background=@textComponentBackground Table.gridColor=lighten($Table.background,3%) #---- TableHeader ---- -TableHeader.background=@textComponentBackground TableHeader.separatorColor=lighten($TableHeader.background,10%) TableHeader.bottomSeparatorColor=$TableHeader.separatorColor +#---- TitlePane ---- + +TitlePane.embeddedForeground=darken($TitlePane.foreground,15%) +TitlePane.buttonHoverBackground=lighten($TitlePane.background,10%,derived) +TitlePane.buttonPressedBackground=lighten($TitlePane.background,20%,derived) + + #---- ToggleButton ---- -ToggleButton.selectedBackground=#64696C -ToggleButton.selectedForeground=@foreground -ToggleButton.disabledSelectedBackground=#525658 +ToggleButton.selectedBackground=lighten($ToggleButton.background,10%,derived) +ToggleButton.disabledSelectedBackground=lighten($ToggleButton.background,3%,derived) -ToggleButton.toolbar.selectedBackground=#5c6164 +ToggleButton.toolbar.selectedBackground=lighten($ToggleButton.background,7%,derived) #---- ToolTip ---- @@ -268,5 +300,4 @@ ToolTip.background=#1e2123 #---- Tree ---- -Tree.background=@textComponentBackground Tree.hash=#505355 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties index 9268326b..ccbb305b 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties @@ -23,7 +23,7 @@ Button.focusedBackground=null Button.default.background=#4D8AC9 -Button.default.foreground=#FFFFFF +Button.default.foreground=#fff Button.default.focusedBackground=null Button.default.borderColor=#3D75B2 Button.default.hoverBorderColor=#A9C9F5 @@ -35,22 +35,12 @@ Button.default.borderWidth=1 #---- CheckBox ---- -CheckBox.icon.selectedBorderColor=#4B97D9 -CheckBox.icon.selectedFocusedBorderColor=#ACCFF7 -CheckBox.icon.selectedBackground=#4F9EE3 -CheckBox.icon.checkmarkColor=#FFFFFF - -CheckBox.icon.selectedHoverBackground=#5E94CE -CheckBox.icon.selectedPressedBackground=#72A1D4 +CheckBox.icon.style=filled #---- Component ---- Component.focusWidth=2 Component.innerFocusWidth=0 +Component.innerOutlineWidth=0 Component.arrowType=triangle - - -#---- RadioButton ---- - -RadioButton.icon.centerDiameter=5 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 09e01416..8a184861 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -64,7 +64,23 @@ ViewportUI=com.formdev.flatlaf.ui.FlatViewportUI #---- variables ---- @textComponentMargin=2,6,2,6 -@menuItemMargin=2,8,2,8 +@menuItemMargin=3,6,3,6 + + +#---- globals ---- + +*.background=@background +*.foreground=@foreground +*.caretForeground=@foreground +*.inactiveBackground=@background +*.inactiveForeground=@disabledText +*.selectionBackground=@selectionBackground +*.selectionForeground=@selectionForeground +*.disabledBackground=@background +*.disabledForeground=@disabledText +*.disabledText=@disabledText +*.acceleratorForeground=@menuAcceleratorForeground +*.acceleratorSelectionForeground=@menuAcceleratorSelectionForeground #---- system colors ---- @@ -135,6 +151,7 @@ Button.rollover=true Button.defaultButtonFollowsFocus=false [win]Button.defaultButtonFollowsFocus=true +Button.borderWidth=1 Button.default.borderWidth=1 Button.toolbar.margin=3,3,3,3 @@ -178,12 +195,20 @@ ColorChooser.swatchesDefaultRecentColor=$control ComboBox.border=com.formdev.flatlaf.ui.FlatRoundBorder ComboBox.padding=2,6,2,6 +ComboBox.minimumWidth=72 +ComboBox.editorColumns=0 +ComboBox.maximumRowCount=15 +[mac]ComboBox.showPopupOnNavigation=true +ComboBox.buttonStyle=auto +ComboBox.background=@textComponentBackground +ComboBox.buttonBackground=@textComponentBackground #---- Component ---- Component.focusWidth=0 Component.innerFocusWidth={float}0.5 +Component.innerOutlineWidth={float}1 Component.arc=5 Component.minimumWidth=64 Component.arrowType=chevron @@ -213,6 +238,7 @@ FileChooser.homeFolderIcon=com.formdev.flatlaf.icons.FlatFileChooserHomeFolderIc FileChooser.detailsViewIcon=com.formdev.flatlaf.icons.FlatFileChooserDetailsViewIcon FileChooser.listViewIcon=com.formdev.flatlaf.icons.FlatFileChooserListViewIcon FileChooser.usesSingleFilePane=true +[win]FileChooser.useSystemExtensionHiding=true #---- FileView ---- @@ -257,9 +283,16 @@ InternalFrame.buttonSize=24,24 InternalFrame.closeIcon=com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon InternalFrame.iconifyIcon=com.formdev.flatlaf.icons.FlatInternalFrameIconifyIcon InternalFrame.maximizeIcon=com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon -InternalFrame.minimizeIcon=com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon +InternalFrame.minimizeIcon=com.formdev.flatlaf.icons.FlatInternalFrameRestoreIcon InternalFrame.windowBindings=null +# drop shadow +InternalFrame.dropShadowPainted=true +InternalFrame.activeDropShadowColor=null +InternalFrame.activeDropShadowInsets=5,5,6,6 +InternalFrame.inactiveDropShadowColor=null +InternalFrame.inactiveDropShadowInsets=3,3,4,4 + #---- InternalFrameTitlePane ---- @@ -268,18 +301,19 @@ InternalFrameTitlePane.border=0,8,0,0 #---- List ---- -List.border=1,0,1,0 List.border=0,0,0,0 List.cellMargins=1,6,1,6 List.cellFocusColor=@cellFocusColor List.cellNoFocusBorder=com.formdev.flatlaf.ui.FlatListCellBorder$Default List.focusCellHighlightBorder=com.formdev.flatlaf.ui.FlatListCellBorder$Focused List.focusSelectedCellHighlightBorder=com.formdev.flatlaf.ui.FlatListCellBorder$Selected +List.background=@textComponentBackground List.selectionInactiveBackground=@selectionInactiveBackground List.selectionInactiveForeground=@selectionInactiveForeground List.dropCellBackground=@dropCellBackground List.dropCellForeground=@dropCellForeground List.dropLineColor=@dropLineColor +List.showCellFocusIndicator=false #---- Menu ---- @@ -299,7 +333,8 @@ Menu.background=@menuBackground MenuBar.border=com.formdev.flatlaf.ui.FlatMenuBarBorder MenuBar.background=@menuBackground -MenuBar.itemMargins=3,3,3,3 +MenuBar.hoverBackground=@menuHoverBackground +MenuBar.itemMargins=3,8,3,8 #---- MenuItem ---- @@ -311,9 +346,23 @@ MenuItem.margin=@menuItemMargin MenuItem.opaque=false MenuItem.borderPainted=true MenuItem.background=@menuBackground +MenuItem.checkBackground=@menuCheckBackground +MenuItem.checkMargins=2,2,2,2 +MenuItem.minimumWidth=72 +MenuItem.minimumIconSize=16,16 +MenuItem.iconTextGap=6 +MenuItem.textAcceleratorGap=24 +MenuItem.textNoAcceleratorGap=6 +MenuItem.acceleratorArrowGap=2 MenuItem.acceleratorDelimiter=- [mac]MenuItem.acceleratorDelimiter= +# for MenuItem.selectionType=underline +MenuItem.underlineSelectionBackground=@menuHoverBackground +MenuItem.underlineSelectionCheckBackground=@menuCheckBackground +MenuItem.underlineSelectionColor=$TabbedPane.underlineColor +MenuItem.underlineSelectionHeight=3 + #---- OptionPane ---- @@ -345,9 +394,16 @@ PasswordField.margin=@textComponentMargin PasswordField.background=@textComponentBackground PasswordField.placeholderForeground=@disabledText PasswordField.echoChar=\u2022 +PasswordField.showCapsLock=true PasswordField.capsLockIcon=com.formdev.flatlaf.icons.FlatCapsLockIcon +#---- Popup ---- + +Popup.dropShadowPainted=true +Popup.dropShadowInsets=-4,-4,4,4 + + #---- PopupMenu ---- PopupMenu.border=com.formdev.flatlaf.ui.FlatPopupMenuBorder @@ -377,6 +433,7 @@ ProgressBar.repaintInterval=15 RadioButton.border=com.formdev.flatlaf.ui.FlatMarginBorder RadioButton.icon=com.formdev.flatlaf.icons.FlatRadioButtonIcon RadioButton.icon.centerDiameter=8 +RadioButton.icon[filled].centerDiameter=5 RadioButton.margin=2,2,2,2 RadioButton.iconTextGap=4 RadioButton.rollover=true @@ -393,15 +450,41 @@ RadioButtonMenuItem.borderPainted=true RadioButtonMenuItem.background=@menuBackground +#---- RootPane ---- + +RootPane.border=com.formdev.flatlaf.ui.FlatRootPaneUI$FlatWindowBorder +RootPane.borderDragThickness=5 +RootPane.cornerDragWidth=16 +RootPane.honorFrameMinimumSizeOnResize=false +RootPane.honorDialogMinimumSizeOnResize=true + + #---- ScrollBar ---- ScrollBar.width=10 +ScrollBar.minimumThumbSize=10,10 +ScrollBar.maximumThumbSize=100000,100000 +ScrollBar.trackInsets=0,0,0,0 +ScrollBar.thumbInsets=0,0,0,0 +ScrollBar.trackArc=0 +ScrollBar.thumbArc=0 +ScrollBar.hoverThumbWithTrack=false +ScrollBar.pressedThumbWithTrack=false ScrollBar.showButtons=false ScrollBar.squareButtons=false ScrollBar.buttonArrowColor=$ComboBox.buttonArrowColor ScrollBar.buttonDisabledArrowColor=$ComboBox.buttonDisabledArrowColor ScrollBar.allowsAbsolutePositioning=true +[mac]ScrollBar.minimumThumbSize=18,18 +[mac]ScrollBar.thumbInsets=2,2,2,2 +[mac]ScrollBar.thumbArc=999 +[mac]ScrollBar.hoverThumbWithTrack=true + +[linux]ScrollBar.minimumThumbSize=18,18 +[linux]ScrollBar.thumbInsets=2,2,2,2 +[linux]ScrollBar.thumbArc=999 + #---- ScrollPane ---- @@ -435,6 +518,7 @@ Spinner.buttonDisabledArrowColor=$ComboBox.buttonDisabledArrowColor Spinner.buttonHoverArrowColor=$ComboBox.buttonHoverArrowColor Spinner.padding=@textComponentMargin Spinner.editorBorderPainted=false +Spinner.buttonStyle=button #---- SplitPane ---- @@ -455,14 +539,26 @@ SplitPaneDivider.oneTouchArrowColor=$ComboBox.buttonArrowColor TabbedPane.tabHeight=32 TabbedPane.tabSelectionHeight=3 TabbedPane.contentSeparatorHeight=1 +TabbedPane.showTabSeparators=false +TabbedPane.tabSeparatorsFullHeight=false TabbedPane.hasFullBorder=false -TabbedPane.tabInsets=0,12,0,12 +TabbedPane.tabInsets=4,12,4,12 TabbedPane.tabAreaInsets=0,0,0,0 TabbedPane.selectedTabPadInsets=0,0,0,0 TabbedPane.tabRunOverlay=0 -TabbedPane.tabsOverlapBorder=true +TabbedPane.tabsOverlapBorder=false +TabbedPane.disabledForeground=@disabledText TabbedPane.shadow=@background TabbedPane.contentBorderInsets=null +TabbedPane.hiddenTabsNavigation=moreTabsButton +TabbedPane.tabAreaAlignment=leading + +TabbedPane.closeIcon=com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon +TabbedPane.closeSize=16,16 +TabbedPane.closeArc=4 +TabbedPane.closeCrossPlainSize={float}7.5 +TabbedPane.closeCrossFilledSize=$TabbedPane.closeCrossPlainSize +TabbedPane.closeCrossLineWidth={float}1 #---- Table ---- @@ -470,6 +566,7 @@ TabbedPane.contentBorderInsets=null Table.rowHeight=20 Table.showHorizontalLines=false Table.showVerticalLines=false +Table.consistentHomeEndKeyBehavior=true Table.intercellSpacing={dimension}0,0 Table.scrollPaneBorder=com.formdev.flatlaf.ui.FlatBorder Table.ascendingSortIcon=com.formdev.flatlaf.icons.FlatAscendingSortIcon @@ -482,6 +579,7 @@ Table.focusCellHighlightBorder=com.formdev.flatlaf.ui.FlatTableCellBorder$Focuse Table.focusSelectedCellHighlightBorder=com.formdev.flatlaf.ui.FlatTableCellBorder$Selected Table.focusCellBackground=@textComponentBackground Table.focusCellForeground=@foreground +Table.background=@textComponentBackground Table.selectionInactiveBackground=@selectionInactiveBackground Table.selectionInactiveForeground=@selectionInactiveForeground Table.dropCellBackground=@dropCellBackground @@ -495,6 +593,7 @@ Table.dropLineShortColor=@dropLineShortColor TableHeader.height=25 TableHeader.cellBorder=2,3,2,3 TableHeader.focusCellBackground=$TableHeader.background +TableHeader.background=@textComponentBackground #---- TextArea ---- @@ -532,6 +631,31 @@ TitledBorder.titleColor=@foreground TitledBorder.border=1,1,1,1,$Separator.foreground +#---- TitlePane ---- + +TitlePane.menuBarEmbedded=true +TitlePane.iconSize=16,16 +TitlePane.iconMargins=3,8,3,0 +TitlePane.menuBarMargins=0,8,0,22 +TitlePane.titleMargins=3,8,3,8 +TitlePane.buttonSize=44,30 +TitlePane.buttonMaximizedHeight=22 +TitlePane.closeIcon=com.formdev.flatlaf.icons.FlatWindowCloseIcon +TitlePane.iconifyIcon=com.formdev.flatlaf.icons.FlatWindowIconifyIcon +TitlePane.maximizeIcon=com.formdev.flatlaf.icons.FlatWindowMaximizeIcon +TitlePane.restoreIcon=com.formdev.flatlaf.icons.FlatWindowRestoreIcon + +TitlePane.background=$MenuBar.background +TitlePane.inactiveBackground=$TitlePane.background +TitlePane.foreground=@foreground +TitlePane.inactiveForeground=@disabledText + +TitlePane.closeHoverBackground=#e81123 +TitlePane.closePressedBackground=rgba($TitlePane.closeHoverBackground,60%) +TitlePane.closeHoverForeground=#fff +TitlePane.closePressedForeground=#fff + + #---- ToggleButton ---- ToggleButton.border=com.formdev.flatlaf.ui.FlatButtonBorder @@ -541,6 +665,7 @@ ToggleButton.rollover=true ToggleButton.background=$Button.background ToggleButton.pressedBackground=$Button.pressedBackground +ToggleButton.selectedForeground=@foreground ToggleButton.toolbar.hoverBackground=$Button.toolbar.hoverBackground ToggleButton.toolbar.pressedBackground=$Button.toolbar.pressedBackground @@ -577,20 +702,15 @@ ToolBar.spacingBorder=$Button.toolbar.spacingInsets ToolTipManager.enableToolTipMode=activeApplication -#---- ToolTip ---- - -ToolTip.border=4,6,4,6,$Component.borderColor -ToolTip.borderInactive=null -ToolTip.backgroundInactive=$ToolTip.background -ToolTip.foregroundInactive=@disabledText - - #---- Tree ---- Tree.border=1,1,1,1 +Tree.editorBorder=1,1,1,1,@cellFocusColor +Tree.background=@textComponentBackground Tree.selectionInactiveBackground=@selectionInactiveBackground Tree.selectionInactiveForeground=@selectionInactiveForeground Tree.textBackground=$Tree.background +Tree.textForeground=$Tree.foreground Tree.selectionBorderColor=@cellFocusColor Tree.dropCellBackground=@dropCellBackground Tree.dropCellForeground=@dropCellForeground @@ -598,7 +718,9 @@ Tree.dropLineColor=@dropLineColor Tree.rendererFillBackground=false Tree.rendererMargins=1,2,1,2 Tree.wideSelection=true +Tree.repaintWholeRow=true Tree.paintLines=false +Tree.showCellFocusIndicator=false Tree.leftChildIndent=7 Tree.rightChildIndent=11 Tree.rowHeight=0 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index c643863f..9bc0e28c 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -21,21 +21,21 @@ #---- variables ---- @background=#f2f2f2 -@foreground=#000000 +@foreground=#000 @selectionBackground=#2675BF -@selectionForeground=#ffffff +@selectionForeground=#fff @selectionInactiveBackground=#d4d4d4 @selectionInactiveForeground=@foreground @disabledText=#8C8C8C -@textComponentBackground=#ffffff +@textComponentBackground=#fff @menuBackground=#fff -@cellFocusColor=#000000 +@menuHoverBackground=darken(@menuBackground,10%,derived) +@menuCheckBackground=lighten(@selectionBackground,40%) +@menuAcceleratorForeground=lighten(@foreground,30%) +@menuAcceleratorSelectionForeground=@selectionForeground +@cellFocusColor=#000 @icon=#afafaf -# Button -@buttonHoverBackground=darken(3%,autoInverse) -@buttonPressedBackground=darken(10%,autoInverse) - # Drop (use lazy colors for IntelliJ platform themes, which usually do not specify these colors) @dropCellBackground=lighten(List.selectionBackground,10%,lazy) @dropCellForeground=lazy(List.selectionForeground) @@ -43,24 +43,6 @@ @dropLineShortColor=darken(List.selectionBackground,20%,lazy) -#---- globals ---- - -*.background=@background -*.foreground=@foreground -*.textBackground=#cccccc -*.textForeground=@foreground -*.caretForeground=@foreground -*.inactiveBackground=@background -*.inactiveForeground=@disabledText -*.selectionBackground=@selectionBackground -*.selectionForeground=@selectionForeground -*.disabledBackground=@background -*.disabledForeground=@disabledText -*.disabledText=@disabledText -*.acceleratorForeground=#505050 -*.acceleratorSelectionForeground=@selectionForeground - - #---- system colors ---- activeCaption=#99b4d1 @@ -72,10 +54,13 @@ controlDkShadow=darken($controlShadow,15%) #---- Button ---- -Button.background=#ffffff +Button.background=#fff Button.focusedBackground=#e3f1fa -Button.hoverBackground=@buttonHoverBackground -Button.pressedBackground=@buttonPressedBackground +Button.hoverBackground=darken($Button.background,3%,derived) +Button.pressedBackground=darken($Button.background,10%,derived) +Button.selectedBackground=darken($Button.background,20%,derived) +Button.selectedForeground=@foreground +Button.disabledSelectedBackground=darken($Button.background,13%,derived) Button.borderColor=$Component.borderColor Button.disabledBorderColor=$Component.disabledBorderColor @@ -85,43 +70,66 @@ Button.hoverBorderColor=$Button.focusedBorderColor Button.default.background=$Button.background Button.default.foreground=@foreground Button.default.focusedBackground=$Button.focusedBackground -Button.default.hoverBackground=@buttonHoverBackground -Button.default.pressedBackground=@buttonPressedBackground +Button.default.hoverBackground=$Button.hoverBackground +Button.default.pressedBackground=$Button.pressedBackground Button.default.borderColor=#4F9EE3 Button.default.hoverBorderColor=$Button.hoverBorderColor Button.default.focusedBorderColor=$Button.focusedBorderColor Button.default.focusColor=$Component.focusColor Button.default.borderWidth=2 -Button.toolbar.hoverBackground=#dfdfdf -Button.toolbar.pressedBackground=#d8d8d8 +Button.toolbar.hoverBackground=darken($Button.background,12%,derived) +Button.toolbar.pressedBackground=darken($Button.background,15%,derived) +Button.toolbar.selectedBackground=$Button.selectedBackground #---- CheckBox ---- +# enabled CheckBox.icon.borderColor=#b0b0b0 -CheckBox.icon.disabledBorderColor=#BDBDBD +CheckBox.icon.background=#fff CheckBox.icon.selectedBorderColor=$CheckBox.icon.borderColor -CheckBox.icon.focusedBorderColor=#7B9FC7 -CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor -CheckBox.icon.background=#FFFFFF -CheckBox.icon.disabledBackground=@background -CheckBox.icon.focusedBackground=$Button.focusedBackground -CheckBox.icon.hoverBackground=@buttonHoverBackground -CheckBox.icon.pressedBackground=@buttonPressedBackground -CheckBox.icon.selectedBackground=#FFFFFF +CheckBox.icon.selectedBackground=$CheckBox.icon.background CheckBox.icon.checkmarkColor=#4F9EE3 + +# disabled +CheckBox.icon.disabledBorderColor=#BDBDBD +CheckBox.icon.disabledBackground=@background CheckBox.icon.disabledCheckmarkColor=#ABABAB +# focused +CheckBox.icon.focusedBorderColor=#7B9FC7 +CheckBox.icon.focusedBackground=$Button.focusedBackground + +# hover +CheckBox.icon.hoverBorderColor=$CheckBox.icon.focusedBorderColor +CheckBox.icon.hoverBackground=$Button.hoverBackground + +# pressed +CheckBox.icon.pressedBackground=$Button.pressedBackground + + +# used if CheckBox.icon.style=filled +# enabled +CheckBox.icon[filled].selectedBorderColor=#4B97D9 +CheckBox.icon[filled].selectedBackground=#4F9EE3 +CheckBox.icon[filled].checkmarkColor=#fff +# focused +CheckBox.icon[filled].selectedFocusedBorderColor=#ACCFF7 +CheckBox.icon[filled].selectedFocusedBackground=$CheckBox.icon[filled].selectedBackground +CheckBox.icon[filled].selectedFocusedCheckmarkColor=$CheckBox.icon.focusedBackground +# hover +CheckBox.icon[filled].selectedHoverBackground=darken($CheckBox.icon[filled].selectedBackground,5%) +# pressed +CheckBox.icon[filled].selectedPressedBackground=darken($CheckBox.icon[filled].selectedBackground,10%) + #---- ComboBox ---- -ComboBox.background=@textComponentBackground -ComboBox.buttonBackground=@textComponentBackground ComboBox.buttonEditableBackground=#fafafa -ComboBox.buttonArrowColor=#666666 +ComboBox.buttonArrowColor=#666 ComboBox.buttonDisabledArrowColor=#ABABAB -ComboBox.buttonHoverArrowColor=#999999 +ComboBox.buttonHoverArrowColor=#999 #---- Component ---- @@ -131,6 +139,13 @@ Component.disabledBorderColor=#cfcfcf Component.focusedBorderColor=#87afda Component.focusColor=#97c3f3 Component.linkColor=#2470B3 +Component.grayFilter=25,-25,100 + +Component.error.borderColor=lighten(desaturate($Component.error.focusedBorderColor,20%),25%) +Component.error.focusedBorderColor=#e53e4d +Component.warning.borderColor=lighten(saturate($Component.warning.focusedBorderColor,25%),20%) +Component.warning.focusedBorderColor=#e2a53a +Component.custom.borderColor=lighten(desaturate(#f00,20%,derived noAutoInverse),25%,derived noAutoInverse) #---- Desktop ---- @@ -158,29 +173,26 @@ InternalFrame.inactiveTitleForeground=@disabledText InternalFrame.activeBorderColor=darken($Component.borderColor,20%) InternalFrame.inactiveBorderColor=$Component.borderColor -InternalFrame.buttonHoverBackground=darken(10%,autoInverse) -InternalFrame.buttonPressedBackground=darken(20%,autoInverse) +InternalFrame.buttonHoverBackground=darken($InternalFrame.activeTitleBackground,10%,derived) +InternalFrame.buttonPressedBackground=darken($InternalFrame.activeTitleBackground,20%,derived) InternalFrame.closeHoverBackground=lazy(Actions.Red) InternalFrame.closePressedBackground=darken(Actions.Red,10%,lazy) InternalFrame.closeHoverForeground=#fff InternalFrame.closePressedForeground=#fff - -#---- List ---- - -List.background=@textComponentBackground +InternalFrame.activeDropShadowOpacity=0.25 +InternalFrame.inactiveDropShadowOpacity=0.5 #---- Menu ---- -Menu.icon.arrowColor=#666666 +Menu.icon.arrowColor=#666 Menu.icon.disabledArrowColor=#ABABAB #---- MenuBar ---- MenuBar.borderColor=#cdcdcd -MenuBar.hoverBackground=darken($MenuBar.background,10%) #---- MenuItemCheckBox ---- @@ -194,6 +206,12 @@ MenuItemCheckBox.icon.disabledCheckmarkColor=#ABABAB PasswordField.capsLockIconColor=#00000064 +#---- Popup ---- + +Popup.dropShadowColor=#000 +Popup.dropShadowOpacity=0.15 + + #---- PopupMenu ---- PopupMenu.borderColor=#adadad @@ -207,12 +225,21 @@ ProgressBar.selectionForeground=@textComponentBackground ProgressBar.selectionBackground=@foreground +#---- RootPane ---- + +RootPane.activeBorderColor=#707070 +RootPane.inactiveBorderColor=lighten($RootPane.activeBorderColor,20%,derived) + + #---- ScrollBar ---- -ScrollBar.track=#F5F5F5 -ScrollBar.thumb=darken($ScrollBar.track,10%) -ScrollBar.hoverTrackColor=darken($ScrollBar.track,3%) -ScrollBar.hoverThumbColor=darken($ScrollBar.thumb,10%) +ScrollBar.track=lighten(@background,1%,derived noAutoInverse) +ScrollBar.thumb=darken($ScrollBar.track,10%,derived noAutoInverse) +ScrollBar.hoverTrackColor=darken($ScrollBar.track,3%,derived noAutoInverse) +ScrollBar.hoverThumbColor=darken($ScrollBar.thumb,10%,derived noAutoInverse) +ScrollBar.pressedThumbColor=darken($ScrollBar.thumb,20%,derived noAutoInverse) +ScrollBar.hoverButtonBackground=darken(@background,5%,derived noAutoInverse) +ScrollBar.pressedButtonBackground=darken(@background,10%,derived noAutoInverse) #---- Separator ---- @@ -224,55 +251,65 @@ Separator.foreground=#d1d1d1 Slider.trackColor=#c4c4c4 Slider.thumbColor=#6e6e6e -Slider.tickColor=#888888 -Slider.hoverColor=lighten(15%,autoInverse) +Slider.tickColor=#888 +Slider.hoverColor=lighten($Slider.thumbColor,15%,derived) Slider.disabledForeground=#c0c0c0 #---- SplitPane ---- SplitPaneDivider.draggingColor=#c4c4c4 -SplitPaneDivider.oneTouchHoverArrowColor=#333333 +SplitPaneDivider.oneTouchHoverArrowColor=#333 #---- TabbedPane ---- -TabbedPane.disabledForeground=@disabledText TabbedPane.underlineColor=#4083C9 TabbedPane.disabledUnderlineColor=#ababab TabbedPane.hoverColor=#d9d9d9 TabbedPane.focusColor=#dae4ed TabbedPane.contentAreaColor=#bfbfbf +TabbedPane.closeBackground=null +TabbedPane.closeForeground=@disabledText +TabbedPane.closeHoverBackground=darken($TabbedPane.hoverColor,10%) +TabbedPane.closeHoverForeground=@foreground +TabbedPane.closePressedBackground=darken($TabbedPane.hoverColor,15%) +TabbedPane.closePressedForeground=$TabbedPane.closeHoverForeground + #---- Table ---- -Table.background=@textComponentBackground Table.gridColor=darken($Table.background,3%) #---- TableHeader ---- -TableHeader.background=@textComponentBackground TableHeader.separatorColor=darken($TableHeader.background,10%) TableHeader.bottomSeparatorColor=$TableHeader.separatorColor +#---- TitlePane ---- + +TitlePane.embeddedForeground=lighten($TitlePane.foreground,35%) +TitlePane.buttonHoverBackground=darken($TitlePane.background,10%,derived) +TitlePane.buttonPressedBackground=darken($TitlePane.background,20%,derived) + + #---- ToggleButton ---- -ToggleButton.selectedBackground=#cfcfcf -ToggleButton.selectedForeground=@foreground -ToggleButton.disabledSelectedBackground=#dfdfdf +ToggleButton.selectedBackground=darken($ToggleButton.background,20%,derived) +ToggleButton.disabledSelectedBackground=darken($ToggleButton.background,13%,derived) -ToggleButton.toolbar.selectedBackground=#cfcfcf +ToggleButton.toolbar.selectedBackground=$ToggleButton.selectedBackground #---- ToolTip ---- +ToolTip.border=4,6,4,6,$InternalFrame.activeBorderColor ToolTip.background=#fafafa #---- Tree ---- -Tree.background=@textComponentBackground Tree.hash=#E6E6E6 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties index ff8d4728..a2abdc11 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties @@ -16,6 +16,16 @@ #---- Button ---- +Button.startBackground=$Button.background +Button.endBackground=$Button.background +Button.startBorderColor=$Button.borderColor +Button.endBorderColor=$Button.borderColor + +Button.default.startBackground=$Button.default.background +Button.default.endBackground=$Button.default.background +Button.default.startBorderColor=$Button.default.borderColor +Button.default.endBorderColor=$Button.default.borderColor + Button.hoverBorderColor=null Button.default.hoverBorderColor=null @@ -23,3 +33,104 @@ Button.default.hoverBorderColor=null #---- HelpButton ---- HelpButton.hoverBorderColor=null + + +#---- ToggleButton ---- + +ToggleButton.startBackground=$ToggleButton.background +ToggleButton.endBackground=$ToggleButton.background +[dark]ToggleButton.selectedBackground=lighten($ToggleButton.background,15%,derived) +[dark]ToggleButton.disabledSelectedBackground=lighten($ToggleButton.background,5%,derived) + + +#---- theme specific ---- + +[Arc_Theme]ProgressBar.selectionBackground=#000 +[Arc_Theme]ProgressBar.selectionForeground=#fff + +[Arc_Theme_-_Orange]ProgressBar.selectionBackground=#000 +[Arc_Theme_-_Orange]ProgressBar.selectionForeground=#fff + +[Arc_Theme_Dark]ProgressBar.selectionBackground=#ddd +[Arc_Theme_Dark]ProgressBar.selectionForeground=#ddd + +[Arc_Theme_Dark_-_Orange]ProgressBar.selectionBackground=#ddd +[Arc_Theme_Dark_-_Orange]ProgressBar.selectionForeground=#fff + +[Cobalt_2]CheckBox.icon.background=#002946 +[Cobalt_2]CheckBox.icon.checkmarkColor=#002946 + +[Dracula]ProgressBar.selectionBackground=#fff +[Dracula]ProgressBar.selectionForeground=#fff + +[Gruvbox_Dark_Hard]ToggleButton.selectedBackground=$ToggleButton.selectedBackground +[Gruvbox_Dark_Hard]ToggleButton.toolbar.selectedBackground=$ToggleButton.toolbar.selectedBackground + +[Gruvbox_Dark_Medium]ToggleButton.selectedBackground=$ToggleButton.selectedBackground +[Gruvbox_Dark_Medium]ToggleButton.toolbar.selectedBackground=$ToggleButton.toolbar.selectedBackground + +[Gruvbox_Dark_Soft]ToggleButton.selectedBackground=$ToggleButton.selectedBackground +[Gruvbox_Dark_Soft]ToggleButton.toolbar.selectedBackground=$ToggleButton.toolbar.selectedBackground + +[Hiberbee_Dark]ToggleButton.selectedBackground=$ToggleButton.selectedBackground +[Hiberbee_Dark]ToggleButton.selectedBackground=$ToggleButton.selectedBackground +[Hiberbee_Dark]ToggleButton.toolbar.selectedBackground=$ToggleButton.toolbar.selectedBackground + +[High_contrast]ToggleButton.selectedBackground=#fff +[High_contrast]ToggleButton.selectedForeground=#000 +[High_contrast]ToggleButton.disabledSelectedBackground=#444 +[High_contrast]ToggleButton.toolbar.selectedBackground=#fff + + +# Material Theme UI Lite + +[Dracula_Contrast]ProgressBar.selectionBackground=#fff +[Dracula_Contrast]ProgressBar.selectionForeground=#fff + +[GitHub]ProgressBar.selectionBackground=#222 +[GitHub]ProgressBar.selectionForeground=#222 + +[GitHub_Contrast]ProgressBar.selectionBackground=#222 +[GitHub_Contrast]ProgressBar.selectionForeground=#222 + +[Light_Owl]ProgressBar.selectionBackground=#111 +[Light_Owl]ProgressBar.selectionForeground=#fff + +[Light_Owl_Contrast]ProgressBar.selectionBackground=#111 +[Light_Owl_Contrast]ProgressBar.selectionForeground=#fff + +[Material_Lighter]ProgressBar.selectionBackground=#222 +[Material_Lighter]ProgressBar.selectionForeground=#fff + +[Material_Lighter_Contrast]ProgressBar.selectionBackground=#222 +[Material_Lighter_Contrast]ProgressBar.selectionForeground=#fff + +[Material_Oceanic]ProgressBar.selectionBackground=#ddd +[Material_Oceanic]ProgressBar.selectionForeground=#ddd + +[Material_Oceanic_Contrast]ProgressBar.selectionBackground=#ddd +[Material_Oceanic_Contrast]ProgressBar.selectionForeground=#ddd + +[Material_Palenight]ProgressBar.selectionBackground=#ddd +[Material_Palenight]ProgressBar.selectionForeground=#ddd + +[Material_Palenight_Contrast]ProgressBar.selectionBackground=#ddd +[Material_Palenight_Contrast]ProgressBar.selectionForeground=#ddd + +[Night_Owl]ProgressBar.selectionBackground=#ddd +[Night_Owl]ProgressBar.selectionForeground=#ddd + +[Night_Owl_Contrast]ProgressBar.selectionBackground=#ddd +[Night_Owl_Contrast]ProgressBar.selectionForeground=#ddd + +[Solarized_Dark]ProgressBar.selectionBackground=#ccc +[Solarized_Dark]ProgressBar.selectionForeground=#ccc + +[Material_Solarized_Dark_Contrast]ProgressBar.selectionBackground=#ccc +[Material_Solarized_Dark_Contrast]ProgressBar.selectionForeground=#ccc + +[Solarized_Light]ProgressBar.selectionBackground=#222 +[Solarized_Light]ProgressBar.selectionForeground=#fff + +[Material_Solarized_Light_Contrast]ProgressBar.selectionBackground=#222 +[Material_Solarized_Light_Contrast]ProgressBar.selectionForeground=#fff diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle.properties new file mode 100644 index 00000000..06caf173 --- /dev/null +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle.properties @@ -0,0 +1,65 @@ +# +# 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. +# + +#---- FileChooser ---- + +#fields +FileChooser.lookInLabel.textAndMnemonic=Look &In: +FileChooser.saveInLabelText=Save In: +FileChooser.fileNameLabel.textAndMnemonic=File &Name: +FileChooser.folderNameLabel.textAndMnemonic=Folder &name: +FileChooser.filesOfTypeLabel.textAndMnemonic=Files of &Type: + +# toolbar +FileChooser.upFolderToolTipText=Up One Level +FileChooser.upFolderAccessibleName=Up +FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderAccessibleName=Home +FileChooser.newFolderToolTipText=Create New Folder +FileChooser.newFolderAccessibleName=New Folder +FileChooser.listViewButtonToolTipText=List +FileChooser.listViewButtonAccessibleName=List +FileChooser.detailsViewButtonToolTipText=Details +FileChooser.detailsViewButtonAccessibleName=Details + +# details table header +FileChooser.fileNameHeaderText=Name +FileChooser.fileSizeHeaderText=Size +FileChooser.fileTypeHeaderText=Type +FileChooser.fileDateHeaderText=Modified +FileChooser.fileAttrHeaderText=Attributes + +# popup menu +FileChooser.viewMenuLabelText=View +FileChooser.refreshActionLabelText=Refresh +FileChooser.newFolderActionLabelText=New Folder +FileChooser.listViewActionLabelText=List +FileChooser.detailsViewActionLabelText=Details + + +#---- SplitPaneDivider ---- + +SplitPaneDivider.collapseLeftToolTipText=Collapse Left Pane +SplitPaneDivider.collapseRightToolTipText=Collapse Right Pane +SplitPaneDivider.collapseTopToolTipText=Collapse Top Pane +SplitPaneDivider.collapseBottomToolTipText=Collapse Bottom Pane +SplitPaneDivider.expandLeftToolTipText=Expand Left Pane +SplitPaneDivider.expandRightToolTipText=Expand Right Pane +SplitPaneDivider.expandTopToolTipText=Expand Top Pane +SplitPaneDivider.expandBottomToolTipText=Expand Bottom Pane + + +#---- TabbedPane ---- + +TabbedPane.moreTabsButtonToolTipText=Show Hidden Tabs diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_de.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_de.properties new file mode 100644 index 00000000..5f30c8dd --- /dev/null +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_de.properties @@ -0,0 +1,53 @@ +# +# 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. +# + +#---- FileChooser ---- + +#fields +FileChooser.lookInLabel.textAndMnemonic=Suchen &in: +FileChooser.saveInLabelText=Speichern in: +FileChooser.fileNameLabel.textAndMnemonic=&Dateiname: +FileChooser.folderNameLabel.textAndMnemonic=Ordner&name: +FileChooser.filesOfTypeLabel.textAndMnemonic=Datei&typ: + +# toolbar +FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her +FileChooser.upFolderAccessibleName=Nach oben +FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderAccessibleName=Home +FileChooser.newFolderToolTipText=Neuen Ordner erstellen +FileChooser.newFolderAccessibleName=Neuer Ordner +FileChooser.listViewButtonToolTipText=Liste +FileChooser.listViewButtonAccessibleName=Liste +FileChooser.detailsViewButtonToolTipText=Details +FileChooser.detailsViewButtonAccessibleName=Details + +# details table header +FileChooser.fileNameHeaderText=Name +FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe +FileChooser.fileTypeHeaderText=Typ +FileChooser.fileDateHeaderText=\u00C4nderungsdatum +FileChooser.fileAttrHeaderText=Attribute + +# popup menu +FileChooser.viewMenuLabelText=Ansicht +FileChooser.refreshActionLabelText=Aktualisieren +FileChooser.newFolderActionLabelText=Neuer Ordner +FileChooser.listViewActionLabelText=Liste +FileChooser.detailsViewActionLabelText=Details + + +#---- TabbedPane ---- + +TabbedPane.moreTabsButtonToolTipText=Verdeckte Tabs anzeigen diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_fr.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_fr.properties new file mode 100644 index 00000000..4e6477ba --- /dev/null +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/resources/Bundle_fr.properties @@ -0,0 +1,48 @@ +# +# 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. +# + +#---- FileChooser ---- + +#fields +FileChooser.lookInLabel.textAndMnemonic=Rechercher &dans: +FileChooser.saveInLabelText=Enregistrer dans: +FileChooser.fileNameLabel.textAndMnemonic=&Nom du fichier: +FileChooser.folderNameLabel.textAndMnemonic=&Nom du dossier: +FileChooser.filesOfTypeLabel.textAndMnemonic=&Type de fichier: + +# toolbar +FileChooser.upFolderToolTipText=Remonte d'un niveau +FileChooser.upFolderAccessibleName=Monter +FileChooser.homeFolderToolTipText=R\u00E9pertoire de base +FileChooser.homeFolderAccessibleName=R\u00E9pertoire de base +FileChooser.newFolderToolTipText=Cr\u00E9e un dossier +FileChooser.newFolderAccessibleName=Nouveau dossier +FileChooser.listViewButtonToolTipText=Liste +FileChooser.listViewButtonAccessibleName=Liste +FileChooser.detailsViewButtonToolTipText=D\u00E9tails +FileChooser.detailsViewButtonAccessibleName=D\u00E9tails + +# details table header +FileChooser.fileNameHeaderText=Nom +FileChooser.fileSizeHeaderText=Taille +FileChooser.fileTypeHeaderText=Type +FileChooser.fileDateHeaderText=Modifi\u00E9 +FileChooser.fileAttrHeaderText=Attributs + +# popup menu +FileChooser.viewMenuLabelText=Affichage +FileChooser.refreshActionLabelText=Actualiser +FileChooser.newFolderActionLabelText=Nouveau dossier +FileChooser.listViewActionLabelText=Liste +FileChooser.detailsViewActionLabelText=D\u00E9tails diff --git a/flatlaf-core/svg/FlatLaf Icons.sketch b/flatlaf-core/svg/FlatLaf Icons.sketch index c0fb85e5..708e7fd1 100644 Binary files a/flatlaf-core/svg/FlatLaf Icons.sketch and b/flatlaf-core/svg/FlatLaf Icons.sketch differ diff --git a/flatlaf-core/svg/FlatLaf.svg b/flatlaf-core/svg/FlatLaf.svg new file mode 100644 index 00000000..41c42936 --- /dev/null +++ b/flatlaf-core/svg/FlatLaf.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/flatlaf-demo/.settings/org.eclipse.jdt.core.prefs b/flatlaf-demo/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-demo/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-demo/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-demo/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-demo/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-demo/DemoLaf.properties b/flatlaf-demo/DemoLaf.properties new file mode 100644 index 00000000..6a76fcd6 --- /dev/null +++ b/flatlaf-demo/DemoLaf.properties @@ -0,0 +1,13 @@ +# This file demonstrates using a FlatLaf theme file in the FlatLaf Demo application. +# Must be in the working directory of the Demo application. +# Shown in the "Themes" list under category "Current Directory". +# +# Modifications to this file are automatically loaded by the FlatLaf Demo application +# when the Demo window is activated. + + +# base theme (light, dark, intellij or darcula) +@baseTheme=light + +# add you theme defaults here +@background=#ccc diff --git a/flatlaf-demo/build.gradle.kts b/flatlaf-demo/build.gradle.kts index fb1dd191..589ef5dc 100644 --- a/flatlaf-demo/build.gradle.kts +++ b/flatlaf-demo/build.gradle.kts @@ -27,10 +27,18 @@ plugins { id( "com.jfrog.artifactory" ) } +repositories { + maven { + // for using MigLayout snapshot + url = uri( "https://oss.sonatype.org/content/repositories/snapshots/" ) + } +} + dependencies { implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-extras" ) ) - implementation( "com.miglayout:miglayout-swing:5.2" ) + implementation( project( ":flatlaf-intellij-themes" ) ) + implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" ) implementation( "com.jgoodies:jgoodies-forms:1.9.0" ) } @@ -38,12 +46,17 @@ tasks { jar { dependsOn( ":flatlaf-core:jar" ) dependsOn( ":flatlaf-extras:jar" ) + dependsOn( ":flatlaf-intellij-themes:jar" ) manifest { attributes( "Main-Class" to "com.formdev.flatlaf.demo.FlatLafDemo" ) + + if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) + attributes( "Multi-Release" to "true" ) } - exclude( "META-INF/versions/**" ) + exclude( "module-info.class" ) + exclude( "META-INF/versions/*/module-info.class" ) // include all dependencies in jar from( { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java index 2e73567c..b545ba2e 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java @@ -16,6 +16,7 @@ package com.formdev.flatlaf.demo; +import java.awt.Component; import javax.swing.*; import javax.swing.text.DefaultEditorKit; import net.miginfocom.swing.*; @@ -114,6 +115,14 @@ class BasicComponentsPanel JScrollPane scrollPane12 = new JScrollPane(); JTextPane textPane4 = new JTextPane(); JTextPane textPane5 = new JTextPane(); + JLabel errorHintsLabel = new JLabel(); + JTextField errorHintsTextField = new JTextField(); + JComboBox errorHintsComboBox = new JComboBox<>(); + JSpinner errorHintsSpinner = new JSpinner(); + JLabel warningHintsLabel = new JLabel(); + JTextField warningHintsTextField = new JTextField(); + JComboBox warningHintsComboBox = new JComboBox<>(); + JSpinner warningHintsSpinner = new JSpinner(); JPopupMenu popupMenu1 = new JPopupMenu(); JMenuItem cutMenuItem = new JMenuItem(); JMenuItem copyMenuItem = new JMenuItem(); @@ -121,12 +130,12 @@ class BasicComponentsPanel //======== this ======== setLayout(new MigLayout( - "hidemode 3", + "insets dialog,hidemode 3", // columns - "[]" + - "[]" + - "[]" + - "[]" + + "[sizegroup 1]" + + "[sizegroup 1]" + + "[sizegroup 1]" + + "[sizegroup 1]" + "[]" + "[]", // rows @@ -141,6 +150,8 @@ class BasicComponentsPanel "[]" + "[]" + "[]" + + "[]para" + + "[]" + "[]")); //---- labelLabel ---- @@ -148,12 +159,12 @@ class BasicComponentsPanel add(labelLabel, "cell 0 0"); //---- label1 ---- - label1.setText("enabled"); + label1.setText("Enabled"); label1.setDisplayedMnemonic('E'); add(label1, "cell 1 0"); //---- label2 ---- - label2.setText("disabled"); + label2.setText("Disabled"); label2.setDisplayedMnemonic('D'); label2.setEnabled(false); add(label2, "cell 2 0"); @@ -163,25 +174,24 @@ class BasicComponentsPanel add(buttonLabel, "cell 0 1"); //---- button1 ---- - button1.setText("enabled"); + button1.setText("Enabled"); button1.setDisplayedMnemonicIndex(0); add(button1, "cell 1 1"); //---- button2 ---- - button2.setText("disabled"); + button2.setText("Disabled"); button2.setDisplayedMnemonicIndex(0); button2.setEnabled(false); add(button2, "cell 2 1"); //---- button5 ---- - button5.setText("square"); + button5.setText("Square"); button5.putClientProperty("JButton.buttonType", "square"); add(button5, "cell 3 1"); //---- button6 ---- - button6.setText("square"); - button6.setEnabled(false); - button6.putClientProperty("JButton.buttonType", "square"); + button6.setText("Round"); + button6.putClientProperty("JButton.buttonType", "roundRect"); add(button6, "cell 4 1"); //---- button3 ---- @@ -216,23 +226,23 @@ class BasicComponentsPanel add(checkBoxLabel, "cell 0 2"); //---- checkBox1 ---- - checkBox1.setText("enabled"); + checkBox1.setText("Enabled"); checkBox1.setMnemonic('A'); add(checkBox1, "cell 1 2"); //---- checkBox2 ---- - checkBox2.setText("disabled"); + checkBox2.setText("Disabled"); checkBox2.setEnabled(false); checkBox2.setMnemonic('D'); add(checkBox2, "cell 2 2"); //---- checkBox3 ---- - checkBox3.setText("selected"); + checkBox3.setText("Selected"); checkBox3.setSelected(true); add(checkBox3, "cell 3 2"); //---- checkBox4 ---- - checkBox4.setText("selected disabled"); + checkBox4.setText("Selected disabled"); checkBox4.setSelected(true); checkBox4.setEnabled(false); add(checkBox4, "cell 4 2"); @@ -242,23 +252,23 @@ class BasicComponentsPanel add(radioButtonLabel, "cell 0 3"); //---- radioButton1 ---- - radioButton1.setText("enabled"); + radioButton1.setText("Enabled"); radioButton1.setMnemonic('N'); add(radioButton1, "cell 1 3"); //---- radioButton2 ---- - radioButton2.setText("disabled"); + radioButton2.setText("Disabled"); radioButton2.setEnabled(false); radioButton2.setMnemonic('S'); add(radioButton2, "cell 2 3"); //---- radioButton3 ---- - radioButton3.setText("selected"); + radioButton3.setText("Selected"); radioButton3.setSelected(true); add(radioButton3, "cell 3 3"); //---- radioButton4 ---- - radioButton4.setText("selected disabled"); + radioButton4.setText("Selected disabled"); radioButton4.setSelected(true); radioButton4.setEnabled(false); add(radioButton4, "cell 4 3"); @@ -272,7 +282,7 @@ class BasicComponentsPanel //---- comboBox1 ---- comboBox1.setEditable(true); comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { - "editable", + "Editable", "a", "bb", "ccc" @@ -283,7 +293,7 @@ class BasicComponentsPanel comboBox2.setEditable(true); comboBox2.setEnabled(false); comboBox2.setModel(new DefaultComboBoxModel<>(new String[] { - "disabled", + "Disabled", "a", "bb", "ccc" @@ -292,7 +302,7 @@ class BasicComponentsPanel //---- comboBox3 ---- comboBox3.setModel(new DefaultComboBoxModel<>(new String[] { - "not editable", + "Not editable", "a", "bb", "ccc" @@ -301,7 +311,7 @@ class BasicComponentsPanel //---- comboBox4 ---- comboBox4.setModel(new DefaultComboBoxModel<>(new String[] { - "not editable disabled", + "Not editable disabled", "a", "bb", "ccc" @@ -310,14 +320,13 @@ class BasicComponentsPanel add(comboBox4, "cell 4 4,growx"); //---- comboBox5 ---- - comboBox5.setPrototypeDisplayValue("12345"); comboBox5.setModel(new DefaultComboBoxModel<>(new String[] { - "wide popup if text is longer", + "Wide popup if text is longer", "aa", "bbb", "cccc" })); - add(comboBox5, "cell 5 4,growx"); + add(comboBox5, "cell 5 4,growx,wmax 100"); //---- spinnerLabel ---- spinnerLabel.setText("JSpinner:"); @@ -332,7 +341,7 @@ class BasicComponentsPanel //---- comboBox6 ---- comboBox6.setEditable(true); - comboBox6.putClientProperty("JTextField.placeholderText", "placeholder"); + comboBox6.putClientProperty("JTextField.placeholderText", "Placeholder"); add(comboBox6, "cell 5 5,growx"); //---- textFieldLabel ---- @@ -342,28 +351,28 @@ class BasicComponentsPanel add(textFieldLabel, "cell 0 6"); //---- textField1 ---- - textField1.setText("editable"); + textField1.setText("Editable"); textField1.setComponentPopupMenu(popupMenu1); add(textField1, "cell 1 6,growx"); //---- textField2 ---- - textField2.setText("disabled"); + textField2.setText("Disabled"); textField2.setEnabled(false); add(textField2, "cell 2 6,growx"); //---- textField3 ---- - textField3.setText("not editable"); + textField3.setText("Not editable"); textField3.setEditable(false); add(textField3, "cell 3 6,growx"); //---- textField4 ---- - textField4.setText("not editable disabled"); + textField4.setText("Not editable disabled"); textField4.setEnabled(false); textField4.setEditable(false); add(textField4, "cell 4 6,growx"); //---- textField6 ---- - textField6.putClientProperty("JTextField.placeholderText", "placeholder"); + textField6.putClientProperty("JTextField.placeholderText", "Placeholder"); add(textField6, "cell 5 6,growx"); //---- formattedTextFieldLabel ---- @@ -373,28 +382,28 @@ class BasicComponentsPanel add(formattedTextFieldLabel, "cell 0 7"); //---- formattedTextField1 ---- - formattedTextField1.setText("editable"); + formattedTextField1.setText("Editable"); formattedTextField1.setComponentPopupMenu(popupMenu1); add(formattedTextField1, "cell 1 7,growx"); //---- formattedTextField2 ---- - formattedTextField2.setText("disabled"); + formattedTextField2.setText("Disabled"); formattedTextField2.setEnabled(false); add(formattedTextField2, "cell 2 7,growx"); //---- formattedTextField3 ---- - formattedTextField3.setText("not editable"); + formattedTextField3.setText("Not editable"); formattedTextField3.setEditable(false); add(formattedTextField3, "cell 3 7,growx"); //---- formattedTextField4 ---- - formattedTextField4.setText("not editable disabled"); + formattedTextField4.setText("Not editable disabled"); formattedTextField4.setEnabled(false); formattedTextField4.setEditable(false); add(formattedTextField4, "cell 4 7,growx"); //---- formattedTextField5 ---- - formattedTextField5.putClientProperty("JTextField.placeholderText", "placeholder"); + formattedTextField5.putClientProperty("JTextField.placeholderText", "Placeholder"); add(formattedTextField5, "cell 5 7,growx"); //---- passwordFieldLabel ---- @@ -402,27 +411,27 @@ class BasicComponentsPanel add(passwordFieldLabel, "cell 0 8"); //---- passwordField1 ---- - passwordField1.setText("editable"); + passwordField1.setText("Editable"); add(passwordField1, "cell 1 8,growx"); //---- passwordField2 ---- - passwordField2.setText("disabled"); + passwordField2.setText("Disabled"); passwordField2.setEnabled(false); add(passwordField2, "cell 2 8,growx"); //---- passwordField3 ---- - passwordField3.setText("not editable"); + passwordField3.setText("Not editable"); passwordField3.setEditable(false); add(passwordField3, "cell 3 8,growx"); //---- passwordField4 ---- - passwordField4.setText("not editable disabled"); + passwordField4.setText("Not editable disabled"); passwordField4.setEnabled(false); passwordField4.setEditable(false); add(passwordField4, "cell 4 8,growx"); //---- passwordField5 ---- - passwordField5.putClientProperty("JTextField.placeholderText", "placeholder"); + passwordField5.putClientProperty("JTextField.placeholderText", "Placeholder"); add(passwordField5, "cell 5 8,growx"); //---- textAreaLabel ---- @@ -435,7 +444,7 @@ class BasicComponentsPanel scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea1 ---- - textArea1.setText("editable"); + textArea1.setText("Editable"); textArea1.setRows(2); scrollPane1.setViewportView(textArea1); } @@ -447,7 +456,7 @@ class BasicComponentsPanel scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea2 ---- - textArea2.setText("disabled"); + textArea2.setText("Disabled"); textArea2.setRows(2); textArea2.setEnabled(false); scrollPane2.setViewportView(textArea2); @@ -460,7 +469,7 @@ class BasicComponentsPanel scrollPane3.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea3 ---- - textArea3.setText("not editable"); + textArea3.setText("Not editable"); textArea3.setRows(2); textArea3.setEditable(false); scrollPane3.setViewportView(textArea3); @@ -473,7 +482,7 @@ class BasicComponentsPanel scrollPane4.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea4 ---- - textArea4.setText("not editable disabled"); + textArea4.setText("Not editable disabled"); textArea4.setRows(2); textArea4.setEditable(false); textArea4.setEnabled(false); @@ -483,7 +492,7 @@ class BasicComponentsPanel //---- textArea5 ---- textArea5.setRows(2); - textArea5.setText("no scroll pane"); + textArea5.setText("No scroll pane"); add(textArea5, "cell 5 9,growx"); //---- editorPaneLabel ---- @@ -496,7 +505,7 @@ class BasicComponentsPanel scrollPane5.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane1 ---- - editorPane1.setText("editable"); + editorPane1.setText("Editable"); scrollPane5.setViewportView(editorPane1); } add(scrollPane5, "cell 1 10,growx"); @@ -507,7 +516,7 @@ class BasicComponentsPanel scrollPane6.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane2 ---- - editorPane2.setText("disabled"); + editorPane2.setText("Disabled"); editorPane2.setEnabled(false); scrollPane6.setViewportView(editorPane2); } @@ -519,7 +528,7 @@ class BasicComponentsPanel scrollPane7.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane3 ---- - editorPane3.setText("not editable"); + editorPane3.setText("Not editable"); editorPane3.setEditable(false); scrollPane7.setViewportView(editorPane3); } @@ -531,7 +540,7 @@ class BasicComponentsPanel scrollPane8.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane4 ---- - editorPane4.setText("not editable disabled"); + editorPane4.setText("Not editable disabled"); editorPane4.setEditable(false); editorPane4.setEnabled(false); scrollPane8.setViewportView(editorPane4); @@ -539,7 +548,7 @@ class BasicComponentsPanel add(scrollPane8, "cell 4 10,growx"); //---- editorPane5 ---- - editorPane5.setText("no scroll pane"); + editorPane5.setText("No scroll pane"); add(editorPane5, "cell 5 10,growx"); //---- textPaneLabel ---- @@ -552,7 +561,7 @@ class BasicComponentsPanel scrollPane9.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane1 ---- - textPane1.setText("editable"); + textPane1.setText("Editable"); scrollPane9.setViewportView(textPane1); } add(scrollPane9, "cell 1 11,growx"); @@ -563,7 +572,7 @@ class BasicComponentsPanel scrollPane10.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane2 ---- - textPane2.setText("disabled"); + textPane2.setText("Disabled"); textPane2.setEnabled(false); scrollPane10.setViewportView(textPane2); } @@ -575,7 +584,7 @@ class BasicComponentsPanel scrollPane11.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane3 ---- - textPane3.setText("not editable"); + textPane3.setText("Not editable"); textPane3.setEditable(false); scrollPane11.setViewportView(textPane3); } @@ -587,7 +596,7 @@ class BasicComponentsPanel scrollPane12.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane4 ---- - textPane4.setText("not editable disabled"); + textPane4.setText("Not editable disabled"); textPane4.setEditable(false); textPane4.setEnabled(false); scrollPane12.setViewportView(textPane4); @@ -595,22 +604,64 @@ class BasicComponentsPanel add(scrollPane12, "cell 4 11,growx"); //---- textPane5 ---- - textPane5.setText("no scroll pane"); + textPane5.setText("No scroll pane"); add(textPane5, "cell 5 11,growx"); + //---- errorHintsLabel ---- + errorHintsLabel.setText("Error hints:"); + add(errorHintsLabel, "cell 0 12"); + + //---- errorHintsTextField ---- + errorHintsTextField.putClientProperty("JComponent.outline", "error"); + add(errorHintsTextField, "cell 1 12,growx"); + + //---- errorHintsComboBox ---- + errorHintsComboBox.putClientProperty("JComponent.outline", "error"); + errorHintsComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "Editable" + })); + errorHintsComboBox.setEditable(true); + add(errorHintsComboBox, "cell 2 12,growx"); + + //---- errorHintsSpinner ---- + errorHintsSpinner.putClientProperty("JComponent.outline", "error"); + add(errorHintsSpinner, "cell 3 12,growx"); + + //---- warningHintsLabel ---- + warningHintsLabel.setText("Warning hints:"); + add(warningHintsLabel, "cell 0 13"); + + //---- warningHintsTextField ---- + warningHintsTextField.putClientProperty("JComponent.outline", "warning"); + add(warningHintsTextField, "cell 1 13,growx"); + + //---- warningHintsComboBox ---- + warningHintsComboBox.putClientProperty("JComponent.outline", "warning"); + warningHintsComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "Not editable" + })); + add(warningHintsComboBox, "cell 2 13,growx"); + + //---- warningHintsSpinner ---- + warningHintsSpinner.putClientProperty("JComponent.outline", "warning"); + add(warningHintsSpinner, "cell 3 13,growx"); + //======== popupMenu1 ======== { //---- cutMenuItem ---- cutMenuItem.setText("Cut"); + cutMenuItem.setMnemonic('C'); popupMenu1.add(cutMenuItem); //---- copyMenuItem ---- copyMenuItem.setText("Copy"); + copyMenuItem.setMnemonic('O'); popupMenu1.add(copyMenuItem); //---- pasteMenuItem ---- pasteMenuItem.setText("Paste"); + pasteMenuItem.setMnemonic('P'); popupMenu1.add(pasteMenuItem); } // JFormDesigner - End of component initialization //GEN-END:initComponents @@ -618,6 +669,33 @@ class BasicComponentsPanel cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() ); copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() ); pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() ); + + if( FlatLafDemo.screenshotsMode ) { + Component[] components = { + button13, button14, button15, button16, comboBox5, comboBox6, + textField6, passwordField5, + + formattedTextFieldLabel, formattedTextField1, formattedTextField2, formattedTextField3, formattedTextField4, formattedTextField5, + textAreaLabel, scrollPane1, scrollPane2, scrollPane3, scrollPane4, textArea5, + editorPaneLabel, scrollPane5, scrollPane6, scrollPane7, scrollPane8, editorPane5, + textPaneLabel, scrollPane9, scrollPane10, scrollPane11, scrollPane12, textPane5, + + errorHintsLabel, errorHintsTextField, errorHintsComboBox, errorHintsSpinner, + warningHintsLabel, warningHintsTextField, warningHintsComboBox, warningHintsSpinner, + }; + + for( Component c : components ) + c.setVisible( false ); + + // move password fields one row up + Component[] formattedTextFields = { formattedTextFieldLabel, formattedTextField1, formattedTextField2, formattedTextField3, formattedTextField4 }; + Component[] passwordFields = { passwordFieldLabel, passwordField1, passwordField2, passwordField3, passwordField4 }; + MigLayout layout = (MigLayout) getLayout(); + for( int i = 0; i < passwordFields.length; i++ ) { + Object cons = layout.getComponentConstraints( formattedTextFields[i] ); + layout.setComponentConstraints( passwordFields[i], cons ); + } + } } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd index 81c6bb83..75ed432e 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -7,9 +7,9 @@ new FormModel { "JavaCodeGenerator.defaultVariableLocal": true } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "hidemode 3" - "$columnConstraints": "[][][][][][]" - "$rowConstraints": "[][][][][][][][][][][][]" + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[sizegroup 1][sizegroup 1][sizegroup 1][sizegroup 1][][]" + "$rowConstraints": "[][][][][][][][][][][][]para[][]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -20,14 +20,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label1" - "text": "enabled" + "text": "Enabled" "displayedMnemonic": 69 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label2" - "text": "disabled" + "text": "Disabled" "displayedMnemonic": 68 "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -41,14 +41,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button1" - "text": "enabled" + "text": "Enabled" "displayedMnemonicIndex": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1" } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button2" - "text": "disabled" + "text": "Disabled" "displayedMnemonicIndex": 0 "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -56,16 +56,15 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button5" - "text": "square" + "text": "Square" "$client.JButton.buttonType": "square" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 1" } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button6" - "text": "square" - "enabled": false - "$client.JButton.buttonType": "square" + "text": "Round" + "$client.JButton.buttonType": "roundRect" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 4 1" } ) @@ -116,14 +115,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox1" - "text": "enabled" + "text": "Enabled" "mnemonic": 65 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox2" - "text": "disabled" + "text": "Disabled" "enabled": false "mnemonic": 68 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -131,14 +130,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox3" - "text": "selected" + "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 2" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox4" - "text": "selected disabled" + "text": "Selected disabled" "selected": true "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -152,14 +151,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton1" - "text": "enabled" + "text": "Enabled" "mnemonic": 78 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 3" } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton2" - "text": "disabled" + "text": "Disabled" "enabled": false "mnemonic": 83 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -167,14 +166,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton3" - "text": "selected" + "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 3" } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton4" - "text": "selected disabled" + "text": "Selected disabled" "selected": true "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -192,8 +191,8 @@ new FormModel { name: "comboBox1" "editable": true "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "editable" - addElement( "editable" ) + selectedItem: "Editable" + addElement( "Editable" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -206,8 +205,8 @@ new FormModel { "editable": true "enabled": false "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "disabled" - addElement( "disabled" ) + selectedItem: "Disabled" + addElement( "Disabled" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -218,8 +217,8 @@ new FormModel { add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox3" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "not editable" - addElement( "not editable" ) + selectedItem: "Not editable" + addElement( "Not editable" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -230,8 +229,8 @@ new FormModel { add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox4" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "not editable disabled" - addElement( "not editable disabled" ) + selectedItem: "Not editable disabled" + addElement( "Not editable disabled" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -242,16 +241,15 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox5" - "prototypeDisplayValue": "12345" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "wide popup if text is longer" - addElement( "wide popup if text is longer" ) + selectedItem: "Wide popup if text is longer" + addElement( "Wide popup if text is longer" ) addElement( "aa" ) addElement( "bbb" ) addElement( "cccc" ) } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 4,growx" + "value": "cell 5 4,growx,wmax 100" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "spinnerLabel" @@ -275,7 +273,7 @@ new FormModel { add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox6" "editable": true - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" auxiliary() { "JavaCodeGenerator.typeParameters": "String" } @@ -292,28 +290,28 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField1" - "text": "editable" + "text": "Editable" "componentPopupMenu": &FormReference0 new FormReference( "popupMenu1" ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 6,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 6,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 6,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -321,7 +319,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField6" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 6,growx" } ) @@ -335,28 +333,28 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField1" - "text": "editable" + "text": "Editable" "componentPopupMenu": #FormReference0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 7,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 7,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 7,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -364,7 +362,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField5" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 7,growx" } ) @@ -376,27 +374,27 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField1" - "text": "editable" + "text": "Editable" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 8,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 8,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 8,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -404,7 +402,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField5" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 8,growx" } ) @@ -420,7 +418,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea1" - "text": "editable" + "text": "Editable" "rows": 2 } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -432,7 +430,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea2" - "text": "disabled" + "text": "Disabled" "rows": 2 "enabled": false } ) @@ -445,7 +443,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea3" - "text": "not editable" + "text": "Not editable" "rows": 2 "editable": false } ) @@ -458,7 +456,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea4" - "text": "not editable disabled" + "text": "Not editable disabled" "rows": 2 "editable": false "enabled": false @@ -469,7 +467,7 @@ new FormModel { add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea5" "rows": 2 - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 9,growx" } ) @@ -485,7 +483,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane1" - "text": "editable" + "text": "Editable" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 10,growx" @@ -496,7 +494,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane2" - "text": "disabled" + "text": "Disabled" "enabled": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -508,7 +506,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane3" - "text": "not editable" + "text": "Not editable" "editable": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -520,7 +518,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane4" - "text": "not editable disabled" + "text": "Not editable disabled" "editable": false "enabled": false } ) @@ -529,7 +527,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane5" - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 10,growx" } ) @@ -545,7 +543,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane1" - "text": "editable" + "text": "Editable" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 11,growx" @@ -556,7 +554,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane2" - "text": "disabled" + "text": "Disabled" "enabled": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -568,7 +566,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane3" - "text": "not editable" + "text": "Not editable" "editable": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -580,7 +578,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane4" - "text": "not editable disabled" + "text": "Not editable disabled" "editable": false "enabled": false } ) @@ -589,27 +587,87 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane5" - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 11,growx" } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "errorHintsLabel" + "text": "Error hints:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 12" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "errorHintsTextField" + "$client.JComponent.outline": "error" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 12,growx" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "errorHintsComboBox" + "$client.JComponent.outline": "error" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "Editable" + addElement( "Editable" ) + } + "editable": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 12,growx" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "errorHintsSpinner" + "$client.JComponent.outline": "error" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 12,growx" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "warningHintsLabel" + "text": "Warning hints:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 13" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "warningHintsTextField" + "$client.JComponent.outline": "warning" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 13,growx" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "warningHintsComboBox" + "$client.JComponent.outline": "warning" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "Not editable" + addElement( "Not editable" ) + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 13,growx" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "warningHintsSpinner" + "$client.JComponent.outline": "warning" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 13,growx" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 440 ) + "size": new java.awt.Dimension( 920, 440 ) } ) add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) { name: "popupMenu1" add( new FormComponent( "javax.swing.JMenuItem" ) { name: "cutMenuItem" "text": "Cut" + "mnemonic": 67 } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "copyMenuItem" "text": "Copy" + "mnemonic": 79 } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "pasteMenuItem" "text": "Paste" + "mnemonic": 80 } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 500 ) diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java index f899266e..c527959b 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java @@ -27,8 +27,12 @@ import javax.swing.UIManager.LookAndFeelInfo; import javax.swing.plaf.metal.MetalLookAndFeel; import javax.swing.plaf.nimbus.NimbusLookAndFeel; import com.formdev.flatlaf.*; +import com.formdev.flatlaf.extras.FlatAnimatedLafChange; import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.UIScale; +import net.miginfocom.layout.ConstraintParser; +import net.miginfocom.layout.LC; +import net.miginfocom.layout.UnitValue; import net.miginfocom.swing.*; /** @@ -37,12 +41,24 @@ import net.miginfocom.swing.*; class ControlBar extends JPanel { - private JFrame frame; + private DemoFrame frame; private JTabbedPane tabbedPane; ControlBar() { initComponents(); + // remove top insets + MigLayout layout = (MigLayout) getLayout(); + LC lc = ConstraintParser.parseLayoutConstraint( (String) layout.getLayoutConstraints() ); + UnitValue[] insets = lc.getInsets(); + lc.setInsets( new UnitValue[] { + new UnitValue( 0, UnitValue.PIXEL, null ), + insets[1], + insets[2], + insets[3] + } ); + layout.setLayoutConstraints( lc ); + // initialize look and feels combo box DefaultComboBoxModel lafModel = new DefaultComboBoxModel<>(); lafModel.addElement( new LookAndFeelInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) ); @@ -58,12 +74,12 @@ class ControlBar className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) ) continue; - if( (SystemInfo.IS_WINDOWS && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) || - (SystemInfo.IS_MAC && className.equals( "com.apple.laf.AquaLookAndFeel") ) || - (SystemInfo.IS_LINUX && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel") ) ) + if( (SystemInfo.isWindows && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) || + (SystemInfo.isMacOS && className.equals( "com.apple.laf.AquaLookAndFeel") ) || + (SystemInfo.isLinux && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel") ) ) name += " (F9)"; else if( className.equals( MetalLookAndFeel.class.getName() ) ) - name += " (F10)"; + name += " (F12)"; else if( className.equals( NimbusLookAndFeel.class.getName() ) ) name += " (F11)"; @@ -78,14 +94,30 @@ class ControlBar // update info label because user scale factor may change updateInfoLabel(); + // update "Font" menu + frame.updateFontMenuItems(); + // this is necessary because embedded JOptionPane's "steal" the default button frame.getRootPane().setDefaultButton( closeButton ); } ); } } ); + + UIScale.addPropertyChangeListener( e -> { + // update info label because user scale factor may change + updateInfoLabel(); + } ); } - void initialize( JFrame frame, JTabbedPane tabbedPane ) { + @Override + public void updateUI() { + super.updateUI(); + + if( infoLabel != null ) + updateInfoLabel(); + } + + void initialize( DemoFrame frame, JTabbedPane tabbedPane ) { this.frame = frame; this.tabbedPane = tabbedPane; @@ -95,13 +127,13 @@ class ControlBar registerSwitchToLookAndFeel( KeyEvent.VK_F3, FlatIntelliJLaf.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F4, FlatDarculaLaf.class.getName() ); - if( SystemInfo.IS_WINDOWS ) + if( SystemInfo.isWindows ) registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); - else if( SystemInfo.IS_MAC ) + else if( SystemInfo.isMacOS ) registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.apple.laf.AquaLookAndFeel" ); - else if( SystemInfo.IS_LINUX ) + else if( SystemInfo.isLinux ) registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" ); - registerSwitchToLookAndFeel( KeyEvent.VK_F10, MetalLookAndFeel.class.getName() ); + registerSwitchToLookAndFeel( KeyEvent.VK_F12, MetalLookAndFeel.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F11, NimbusLookAndFeel.class.getName() ); // register ESC key to close frame @@ -134,12 +166,20 @@ class ControlBar } private void updateInfoLabel() { + String javaVendor = System.getProperty( "java.vendor" ); + if( "Oracle Corporation".equals( javaVendor ) ) + javaVendor = null; double systemScaleFactor = UIScale.getSystemScaleFactor( getGraphicsConfiguration() ); float userScaleFactor = UIScale.getUserScaleFactor(); + Font font = UIManager.getFont( "Label.font" ); String newInfo = "(Java " + System.getProperty( "java.version" ) + + (javaVendor != null ? ("; " + javaVendor) : "") + (systemScaleFactor != 1 ? ("; system scale factor " + systemScaleFactor) : "") + (userScaleFactor != 1 ? ("; user scale factor " + userScaleFactor) : "") + (systemScaleFactor == 1 && userScaleFactor == 1 ? "; no scaling" : "") + + "; " + font.getFamily() + " " + font.getSize() + + (font.isBold() ? " BOLD" : "") + + (font.isItalic() ? " ITALIC" : "") + ")"; if( !newInfo.equals( infoLabel.getText() ) ) @@ -169,11 +209,18 @@ class ControlBar EventQueue.invokeLater( () -> { try { + FlatAnimatedLafChange.showSnapshot(); + // change look and feel UIManager.setLookAndFeel( lafClassName ); + // clear custom default font when switching to non-FlatLaf LaF + if( !(UIManager.getLookAndFeel() instanceof FlatLaf) ) + UIManager.put( "defaultFont", null ); + // update all components FlatLaf.updateUI(); + FlatAnimatedLafChange.hideSnapshotWithAnimation(); // increase size of frame if necessary int width = frame.getWidth(); @@ -203,6 +250,9 @@ class ControlBar private void enabledChanged() { enabledDisable( tabbedPane, enabledCheckBox.isSelected() ); + + // repainting whole tabbed pane is faster than repainting many individual components + tabbedPane.repaint(); } private void enabledDisable( Container container, boolean enabled ) { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.java index 48344b26..41860d45 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.java @@ -16,6 +16,9 @@ package com.formdev.flatlaf.demo; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; @@ -64,6 +67,41 @@ class DataComponentsPanel } } + private void rowSelectionChanged() { + table1.setRowSelectionAllowed( rowSelectionCheckBox.isSelected() ); + } + + private void columnSelectionChanged() { + table1.setColumnSelectionAllowed( columnSelectionCheckBox.isSelected() ); + } + + private void showHorizontalLinesChanged() { + table1.setShowHorizontalLines( showHorizontalLinesCheckBox.isSelected() ); + } + + private void showVerticalLinesChanged() { + table1.setShowVerticalLines( showVerticalLinesCheckBox.isSelected() ); + } + + private void intercellSpacingChanged() { + table1.setIntercellSpacing( intercellSpacingCheckBox.isSelected() ? new Dimension( 1, 1 ) : new Dimension() ); + } + + private void redGridColorChanged() { + table1.setGridColor( redGridColorCheckBox.isSelected() ? Color.red : UIManager.getColor( "Table.gridColor" ) ); + } + + @Override + public void updateUI() { + super.updateUI(); + + EventQueue.invokeLater( () -> { + showHorizontalLinesChanged(); + showVerticalLinesChanged(); + intercellSpacingChanged(); + } ); + } + @SuppressWarnings( { "unchecked", "rawtypes" } ) private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @@ -80,24 +118,36 @@ class DataComponentsPanel JLabel tableLabel = new JLabel(); JScrollPane scrollPane5 = new JScrollPane(); table1 = new JTable(); + JPanel tableOptionsPanel = new JPanel(); + showHorizontalLinesCheckBox = new JCheckBox(); + showVerticalLinesCheckBox = new JCheckBox(); + intercellSpacingCheckBox = new JCheckBox(); + redGridColorCheckBox = new JCheckBox(); + rowSelectionCheckBox = new JCheckBox(); + columnSelectionCheckBox = new JCheckBox(); dndCheckBox = new JCheckBox(); + JPopupMenu popupMenu2 = new JPopupMenu(); + JMenuItem menuItem3 = new JMenuItem(); + JMenuItem menuItem4 = new JMenuItem(); + JMenuItem menuItem5 = new JMenuItem(); + JMenuItem menuItem6 = new JMenuItem(); //======== this ======== setLayout(new MigLayout( - "hidemode 3", + "insets dialog,hidemode 3", // columns "[]" + - "[200]" + - "[200]", + "[200,fill]" + + "[200,fill]" + + "[fill]", // rows - "[]" + - "[::200]" + - "[::150]" + - "[]")); + "[150,grow,sizegroup 1,fill]" + + "[150,grow,sizegroup 1,fill]" + + "[150,grow,sizegroup 1,fill]")); //---- listLabel ---- listLabel.setText("JList:"); - add(listLabel, "cell 0 0"); + add(listLabel, "cell 0 0,aligny top,growy 0"); //======== scrollPane1 ======== { @@ -126,9 +176,10 @@ class DataComponentsPanel @Override public String getElementAt(int i) { return values[i]; } }); + list1.setComponentPopupMenu(popupMenu2); scrollPane1.setViewportView(list1); } - add(scrollPane1, "cell 1 0,growx"); + add(scrollPane1, "cell 1 0"); //======== scrollPane2 ======== { @@ -160,11 +211,11 @@ class DataComponentsPanel list2.setEnabled(false); scrollPane2.setViewportView(list2); } - add(scrollPane2, "cell 2 0,growx"); + add(scrollPane2, "cell 2 0"); //---- treeLabel ---- treeLabel.setText("JTree:"); - add(treeLabel, "cell 0 1"); + add(treeLabel, "cell 0 1,aligny top,growy 0"); //======== scrollPane3 ======== { @@ -198,9 +249,10 @@ class DataComponentsPanel add(node1); } })); + tree1.setComponentPopupMenu(popupMenu2); scrollPane3.setViewportView(tree1); } - add(scrollPane3, "cell 1 1,growx"); + add(scrollPane3, "cell 1 1"); //======== scrollPane4 ======== { @@ -209,11 +261,11 @@ class DataComponentsPanel tree2.setEnabled(false); scrollPane4.setViewportView(tree2); } - add(scrollPane4, "cell 2 1,growx"); + add(scrollPane4, "cell 2 1"); //---- tableLabel ---- tableLabel.setText("JTable:"); - add(tableLabel, "cell 0 2"); + add(tableLabel, "cell 0 2,aligny top,growy 0"); //======== scrollPane5 ======== { @@ -287,15 +339,85 @@ class DataComponentsPanel })))); } table1.setAutoCreateRowSorter(true); + table1.setComponentPopupMenu(popupMenu2); scrollPane5.setViewportView(table1); } - add(scrollPane5, "cell 1 2 2 1,growx,width 300"); + add(scrollPane5, "cell 1 2 2 1,width 300"); - //---- dndCheckBox ---- - dndCheckBox.setText("enable drag and drop"); - dndCheckBox.setMnemonic('D'); - dndCheckBox.addActionListener(e -> dndChanged()); - add(dndCheckBox, "cell 0 3 3 1"); + //======== tableOptionsPanel ======== + { + tableOptionsPanel.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[]", + // rows + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0")); + + //---- showHorizontalLinesCheckBox ---- + showHorizontalLinesCheckBox.setText("show horizontal lines"); + showHorizontalLinesCheckBox.addActionListener(e -> showHorizontalLinesChanged()); + tableOptionsPanel.add(showHorizontalLinesCheckBox, "cell 0 0"); + + //---- showVerticalLinesCheckBox ---- + showVerticalLinesCheckBox.setText("show vertical lines"); + showVerticalLinesCheckBox.addActionListener(e -> showVerticalLinesChanged()); + tableOptionsPanel.add(showVerticalLinesCheckBox, "cell 0 1"); + + //---- intercellSpacingCheckBox ---- + intercellSpacingCheckBox.setText("intercell spacing"); + intercellSpacingCheckBox.addActionListener(e -> intercellSpacingChanged()); + tableOptionsPanel.add(intercellSpacingCheckBox, "cell 0 2"); + + //---- redGridColorCheckBox ---- + redGridColorCheckBox.setText("red grid color"); + redGridColorCheckBox.addActionListener(e -> redGridColorChanged()); + tableOptionsPanel.add(redGridColorCheckBox, "cell 0 3"); + + //---- rowSelectionCheckBox ---- + rowSelectionCheckBox.setText("row selection"); + rowSelectionCheckBox.setSelected(true); + rowSelectionCheckBox.addActionListener(e -> rowSelectionChanged()); + tableOptionsPanel.add(rowSelectionCheckBox, "cell 0 4"); + + //---- columnSelectionCheckBox ---- + columnSelectionCheckBox.setText("column selection"); + columnSelectionCheckBox.addActionListener(e -> columnSelectionChanged()); + tableOptionsPanel.add(columnSelectionCheckBox, "cell 0 5"); + + //---- dndCheckBox ---- + dndCheckBox.setText("enable drag and drop"); + dndCheckBox.setMnemonic('D'); + dndCheckBox.addActionListener(e -> dndChanged()); + tableOptionsPanel.add(dndCheckBox, "cell 0 6"); + } + add(tableOptionsPanel, "cell 3 2"); + + //======== popupMenu2 ======== + { + + //---- menuItem3 ---- + menuItem3.setText("Some Action"); + popupMenu2.add(menuItem3); + + //---- menuItem4 ---- + menuItem4.setText("More Action"); + popupMenu2.add(menuItem4); + popupMenu2.addSeparator(); + + //---- menuItem5 ---- + menuItem5.setText("No Action"); + popupMenu2.add(menuItem5); + + //---- menuItem6 ---- + menuItem6.setText("Noop Action"); + popupMenu2.add(menuItem6); + } // JFormDesigner - End of component initialization //GEN-END:initComponents ((JComboBox)((DefaultCellEditor)table1.getColumnModel().getColumn( 3 ).getCellEditor()).getComponent()).setEditable( true ); @@ -307,6 +429,12 @@ class DataComponentsPanel private JTree tree1; private JTree tree2; private JTable table1; + private JCheckBox showHorizontalLinesCheckBox; + private JCheckBox showVerticalLinesCheckBox; + private JCheckBox intercellSpacingCheckBox; + private JCheckBox redGridColorCheckBox; + private JCheckBox rowSelectionCheckBox; + private JCheckBox columnSelectionCheckBox; private JCheckBox dndCheckBox; // JFormDesigner - End of variables declaration //GEN-END:variables diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.jfd index 1c263544..5da120b1 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DataComponentsPanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -7,16 +7,16 @@ new FormModel { "JavaCodeGenerator.defaultVariableLocal": true } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "hidemode 3" - "$columnConstraints": "[][200][200]" - "$rowConstraints": "[][::200][::150][]" + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[][200,fill][200,fill][fill]" + "$rowConstraints": "[150,grow,sizegroup 1,fill][150,grow,sizegroup 1,fill][150,grow,sizegroup 1,fill]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { name: "listLabel" "text": "JList:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" + "value": "cell 0 0,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane1" @@ -39,13 +39,14 @@ new FormModel { addElement( "item 14" ) addElement( "item 15" ) } + "componentPopupMenu": new FormReference( "popupMenu2" ) auxiliary() { "JavaCodeGenerator.typeParameters": "String" "JavaCodeGenerator.variableLocal": false } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0,growx" + "value": "cell 1 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane2" @@ -75,13 +76,13 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0,growx" + "value": "cell 2 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "treeLabel" "text": "JTree:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" + "value": "cell 0 1,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane3" @@ -143,12 +144,13 @@ new FormModel { } ) } ) } ) + "componentPopupMenu": new FormReference( "popupMenu2" ) auxiliary() { "JavaCodeGenerator.variableLocal": false } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1,growx" + "value": "cell 1 1" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane4" @@ -160,13 +162,13 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1,growx" + "value": "cell 2 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "tableLabel" "text": "JTable:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" + "value": "cell 0 2,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane5" @@ -299,27 +301,122 @@ new FormModel { add( null ) } ) "autoCreateRowSorter": true + "componentPopupMenu": new FormReference( "popupMenu2" ) auxiliary() { "JavaCodeGenerator.variableLocal": false } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2 2 1,growx,width 300" + "value": "cell 1 2 2 1,width 300" } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "dndCheckBox" - "text": "enable drag and drop" - "mnemonic": 68 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "dndChanged", false ) ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[]" + "$rowConstraints": "[]0[]0[]0[]0[]0[]0[]0" + } ) { + name: "tableOptionsPanel" + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showHorizontalLinesCheckBox" + "text": "show horizontal lines" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showHorizontalLinesChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showVerticalLinesCheckBox" + "text": "show vertical lines" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showVerticalLinesChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "intercellSpacingCheckBox" + "text": "intercell spacing" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "intercellSpacingChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "redGridColorCheckBox" + "text": "red grid color" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "redGridColorChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "rowSelectionCheckBox" + "text": "row selection" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rowSelectionChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "columnSelectionCheckBox" + "text": "column selection" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "columnSelectionChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "dndCheckBox" + "text": "enable drag and drop" + "mnemonic": 68 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "dndChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 3 3 1" + "value": "cell 3 2" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 715 ) + "size": new java.awt.Dimension( 790, 745 ) + } ) + add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) { + name: "popupMenu2" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem3" + "text": "Some Action" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem4" + "text": "More Action" + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator1" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem5" + "text": "No Action" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem6" + "text": "Noop Action" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 800 ) } ) } } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java index 3b365b21..7f702505 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java @@ -18,10 +18,25 @@ package com.formdev.flatlaf.demo; import java.awt.*; import java.awt.event.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.prefs.Preferences; import javax.swing.*; import javax.swing.text.DefaultEditorKit; +import javax.swing.text.StyleContext; +import com.formdev.flatlaf.FlatClientProperties; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.demo.HintManager.Hint; +import com.formdev.flatlaf.demo.extras.*; import com.formdev.flatlaf.demo.intellijthemes.*; +import com.formdev.flatlaf.extras.FlatAnimatedLafChange; import com.formdev.flatlaf.extras.FlatSVGIcon; +import com.formdev.flatlaf.extras.FlatUIDefaultsInspector; +import com.formdev.flatlaf.extras.SVGUtils; +import com.formdev.flatlaf.ui.JBRCustomDecorations; +import net.miginfocom.layout.ConstraintParser; +import net.miginfocom.layout.LC; +import net.miginfocom.layout.UnitValue; import net.miginfocom.swing.*; /** @@ -30,14 +45,79 @@ import net.miginfocom.swing.*; class DemoFrame extends JFrame { + private final String[] availableFontFamilyNames; + private int initialFontMenuItemCount = -1; + DemoFrame() { int tabIndex = DemoPrefs.getState().getInt( FlatLafDemo.KEY_TAB, 0 ); + availableFontFamilyNames = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getAvailableFontFamilyNames().clone(); + Arrays.sort( availableFontFamilyNames ); + initComponents(); + updateFontMenuItems(); controlBar.initialize( this, tabbedPane ); + setIconImages( SVGUtils.createWindowIconImages( "/com/formdev/flatlaf/demo/FlatLaf.svg" ) ); + if( tabIndex >= 0 && tabIndex < tabbedPane.getTabCount() && tabIndex != tabbedPane.getSelectedIndex() ) tabbedPane.setSelectedIndex( tabIndex ); + + SwingUtilities.invokeLater( () -> { + showHints(); + } ); + } + + @Override + public void dispose() { + super.dispose(); + + FlatUIDefaultsInspector.hide(); + } + + private void showHints() { + Hint fontMenuHint = new Hint( + "Use 'Font' menu to increase/decrease font size or try different fonts.", + fontMenu, SwingConstants.BOTTOM, "hint.fontMenu", null ); + + Hint optionsMenuHint = new Hint( + "Use 'Options' menu to try out various FlatLaf options.", + optionsMenu, SwingConstants.BOTTOM, "hint.optionsMenu", fontMenuHint ); + + Hint themesHint = new Hint( + "Use 'Themes' list to try out various themes.", + themesPanel, SwingConstants.LEFT, "hint.themesPanel", optionsMenuHint ); + + HintManager.showHint( themesHint ); + } + + private void clearHints() { + HintManager.hideAllHints(); + + Preferences state = DemoPrefs.getState(); + state.remove( "hint.fontMenu" ); + state.remove( "hint.optionsMenu" ); + state.remove( "hint.themesPanel" ); + } + + private void showUIDefaultsInspector() { + FlatUIDefaultsInspector.show(); + } + + private void newActionPerformed() { + NewDialog newDialog = new NewDialog( this ); + newDialog.setVisible( true ); + } + + private void openActionPerformed() { + JFileChooser chooser = new JFileChooser(); + chooser.showOpenDialog( this ); + } + + private void saveAsActionPerformed() { + JFileChooser chooser = new JFileChooser(); + chooser.showSaveDialog( this ); } private void exitActionPerformed() { @@ -52,18 +132,170 @@ class DemoFrame DemoPrefs.getState().putInt( FlatLafDemo.KEY_TAB, tabbedPane.getSelectedIndex() ); } - private void menuItemActionPerformed(ActionEvent e) { + private void menuItemActionPerformed( ActionEvent e ) { SwingUtilities.invokeLater( () -> { JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE ); } ); } + private void windowDecorationsChanged() { + boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected(); + + // change window decoration of demo main frame + dispose(); + setUndecorated( windowDecorations ); + getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE ); + menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations ); + setVisible( true ); + + // enable/disable window decoration for later created frames/dialogs + JFrame.setDefaultLookAndFeelDecorated( windowDecorations ); + JDialog.setDefaultLookAndFeelDecorated( windowDecorations ); + } + + private void menuBarEmbeddedChanged() { + getRootPane().putClientProperty( FlatClientProperties.MENU_BAR_EMBEDDED, + menuBarEmbeddedCheckBoxMenuItem.isSelected() ? null : false ); + +// alternative method for all frames and menu bars in an application +// UIManager.put( "TitlePane.menuBarEmbedded", menuBarEmbeddedCheckBoxMenuItem.isSelected() ); +// revalidate(); +// repaint(); + } + + private void underlineMenuSelection() { + UIManager.put( "MenuItem.selectionType", underlineMenuSelectionMenuItem.isSelected() ? "underline" : null ); + } + + private void alwaysShowMnemonics() { + UIManager.put( "Component.hideMnemonics", !alwaysShowMnemonicsMenuItem.isSelected() ); + repaint(); + } + + private void animatedLafChangeChanged() { + System.setProperty( "flatlaf.animatedLafChange", String.valueOf( animatedLafChangeMenuItem.isSelected() ) ); + } + + private void showHintsChanged() { + clearHints(); + showHints(); + } + + private void fontFamilyChanged( ActionEvent e ) { + String fontFamily = e.getActionCommand(); + + FlatAnimatedLafChange.showSnapshot(); + + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = StyleContext.getDefaultStyleContext().getFont( fontFamily, font.getStyle(), font.getSize() ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + FlatAnimatedLafChange.hideSnapshotWithAnimation(); + } + + private void fontSizeChanged( ActionEvent e ) { + String fontSizeStr = e.getActionCommand(); + + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) Integer.parseInt( fontSizeStr ) ); + UIManager.put( "defaultFont", newFont ); + + FlatLaf.updateUI(); + } + + private void restoreFont() { + UIManager.put( "defaultFont", null ); + updateFontMenuItems(); + FlatLaf.updateUI(); + } + + private void incrFont() { + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) (font.getSize() + 1) ); + UIManager.put( "defaultFont", newFont ); + + updateFontMenuItems(); + FlatLaf.updateUI(); + } + + private void decrFont() { + Font font = UIManager.getFont( "defaultFont" ); + Font newFont = font.deriveFont( (float) Math.max( font.getSize() - 1, 10 ) ); + UIManager.put( "defaultFont", newFont ); + + updateFontMenuItems(); + FlatLaf.updateUI(); + } + + void updateFontMenuItems() { + if( initialFontMenuItemCount < 0 ) + initialFontMenuItemCount = fontMenu.getItemCount(); + else { + // remove old font items + for( int i = fontMenu.getItemCount() - 1; i >= initialFontMenuItemCount; i-- ) + fontMenu.remove( i ); + } + + // get current font + Font currentFont = UIManager.getFont( "Label.font" ); + String currentFamily = currentFont.getFamily(); + String currentSize = Integer.toString( currentFont.getSize() ); + + // add font families + fontMenu.addSeparator(); + ArrayList families = new ArrayList<>( Arrays.asList( + "Arial", "Cantarell", "Comic Sans MS", "Courier New", "DejaVu Sans", + "Dialog", "Liberation Sans", "Monospaced", "Noto Sans", "Roboto", + "SansSerif", "Segoe UI", "Serif", "Tahoma", "Ubuntu", "Verdana" ) ); + if( !families.contains( currentFamily ) ) + families.add( currentFamily ); + families.sort( String.CASE_INSENSITIVE_ORDER ); + + ButtonGroup familiesGroup = new ButtonGroup(); + for( String family : families ) { + if( Arrays.binarySearch( availableFontFamilyNames, family ) < 0 ) + continue; // not available + + JCheckBoxMenuItem item = new JCheckBoxMenuItem( family ); + item.setSelected( family.equals( currentFamily ) ); + item.addActionListener( this::fontFamilyChanged ); + fontMenu.add( item ); + + familiesGroup.add( item ); + } + + // add font sizes + fontMenu.addSeparator(); + ArrayList sizes = new ArrayList<>( Arrays.asList( + "10", "12", "14", "16", "18", "20", "24", "28" ) ); + if( !sizes.contains( currentSize ) ) + sizes.add( currentSize ); + sizes.sort( String.CASE_INSENSITIVE_ORDER ); + + ButtonGroup sizesGroup = new ButtonGroup(); + for( String size : sizes ) { + JCheckBoxMenuItem item = new JCheckBoxMenuItem( size ); + item.setSelected( size.equals( currentSize ) ); + item.addActionListener( this::fontSizeChanged ); + fontMenu.add( item ); + + sizesGroup.add( item ); + } + + // enabled/disable items + boolean enabled = UIManager.getLookAndFeel() instanceof FlatLaf; + for( Component item : fontMenu.getMenuComponents() ) + item.setEnabled( enabled ); + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JMenuBar menuBar1 = new JMenuBar(); JMenu fileMenu = new JMenu(); JMenuItem newMenuItem = new JMenuItem(); JMenuItem openMenuItem = new JMenuItem(); + JMenuItem saveAsMenuItem = new JMenuItem(); JMenuItem closeMenuItem = new JMenuItem(); JMenuItem exitMenuItem = new JMenuItem(); JMenu editMenu = new JMenu(); @@ -83,9 +315,23 @@ class DemoFrame JMenuItem projectViewMenuItem = new JMenuItem(); JMenuItem structureViewMenuItem = new JMenuItem(); JMenuItem propertiesViewMenuItem = new JMenuItem(); + JMenuItem menuItem2 = new JMenuItem(); + JMenuItem menuItem1 = new JMenuItem(); JRadioButtonMenuItem radioButtonMenuItem1 = new JRadioButtonMenuItem(); JRadioButtonMenuItem radioButtonMenuItem2 = new JRadioButtonMenuItem(); JRadioButtonMenuItem radioButtonMenuItem3 = new JRadioButtonMenuItem(); + fontMenu = new JMenu(); + JMenuItem restoreFontMenuItem = new JMenuItem(); + JMenuItem incrFontMenuItem = new JMenuItem(); + JMenuItem decrFontMenuItem = new JMenuItem(); + optionsMenu = new JMenu(); + windowDecorationsCheckBoxMenuItem = new JCheckBoxMenuItem(); + menuBarEmbeddedCheckBoxMenuItem = new JCheckBoxMenuItem(); + underlineMenuSelectionMenuItem = new JCheckBoxMenuItem(); + alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem(); + animatedLafChangeMenuItem = new JCheckBoxMenuItem(); + JMenuItem showHintsMenuItem = new JMenuItem(); + JMenuItem showUIDefaultsInspectorMenuItem = new JMenuItem(); JMenu helpMenu = new JMenu(); JMenuItem aboutMenuItem = new JMenuItem(); JToolBar toolBar1 = new JToolBar(); @@ -103,8 +349,9 @@ class DemoFrame DataComponentsPanel dataComponentsPanel = new DataComponentsPanel(); TabsPanel tabsPanel = new TabsPanel(); OptionPanePanel optionPanePanel = new OptionPanePanel(); + ExtrasPanel extrasPanel1 = new ExtrasPanel(); controlBar = new ControlBar(); - IJThemesPanel themesPanel = new IJThemesPanel(); + themesPanel = new IJThemesPanel(); //======== this ======== setTitle("FlatLaf Demo"); @@ -124,15 +371,22 @@ class DemoFrame newMenuItem.setText("New"); newMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); newMenuItem.setMnemonic('N'); - newMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + newMenuItem.addActionListener(e -> newActionPerformed()); fileMenu.add(newMenuItem); //---- openMenuItem ---- - openMenuItem.setText("Open"); + openMenuItem.setText("Open..."); openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); openMenuItem.setMnemonic('O'); - openMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + openMenuItem.addActionListener(e -> openActionPerformed()); fileMenu.add(openMenuItem); + + //---- saveAsMenuItem ---- + saveAsMenuItem.setText("Save As..."); + saveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + saveAsMenuItem.setMnemonic('S'); + saveAsMenuItem.addActionListener(e -> saveAsActionPerformed()); + fileMenu.add(saveAsMenuItem); fileMenu.addSeparator(); //---- closeMenuItem ---- @@ -262,6 +516,15 @@ class DemoFrame menu1.add(propertiesViewMenuItem); } viewMenu.add(menu1); + + //---- menuItem2 ---- + menuItem2.setText("Disabled Item"); + menuItem2.setEnabled(false); + viewMenu.add(menuItem2); + + //---- menuItem1 ---- + menuItem1.setText("some HTML text"); + viewMenu.add(menuItem1); viewMenu.addSeparator(); //---- radioButtonMenuItem1 ---- @@ -285,6 +548,74 @@ class DemoFrame } menuBar1.add(viewMenu); + //======== fontMenu ======== + { + fontMenu.setText("Font"); + + //---- restoreFontMenuItem ---- + restoreFontMenuItem.setText("Restore Font"); + restoreFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + restoreFontMenuItem.addActionListener(e -> restoreFont()); + fontMenu.add(restoreFontMenuItem); + + //---- incrFontMenuItem ---- + incrFontMenuItem.setText("Increase Font Size"); + incrFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + incrFontMenuItem.addActionListener(e -> incrFont()); + fontMenu.add(incrFontMenuItem); + + //---- decrFontMenuItem ---- + decrFontMenuItem.setText("Decrease Font Size"); + decrFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + decrFontMenuItem.addActionListener(e -> decrFont()); + fontMenu.add(decrFontMenuItem); + } + menuBar1.add(fontMenu); + + //======== optionsMenu ======== + { + optionsMenu.setText("Options"); + + //---- windowDecorationsCheckBoxMenuItem ---- + windowDecorationsCheckBoxMenuItem.setText("Window decorations"); + windowDecorationsCheckBoxMenuItem.setSelected(true); + windowDecorationsCheckBoxMenuItem.addActionListener(e -> windowDecorationsChanged()); + optionsMenu.add(windowDecorationsCheckBoxMenuItem); + + //---- menuBarEmbeddedCheckBoxMenuItem ---- + menuBarEmbeddedCheckBoxMenuItem.setText("Embedded menu bar"); + menuBarEmbeddedCheckBoxMenuItem.setSelected(true); + menuBarEmbeddedCheckBoxMenuItem.addActionListener(e -> menuBarEmbeddedChanged()); + optionsMenu.add(menuBarEmbeddedCheckBoxMenuItem); + + //---- underlineMenuSelectionMenuItem ---- + underlineMenuSelectionMenuItem.setText("Use underline menu selection"); + underlineMenuSelectionMenuItem.addActionListener(e -> underlineMenuSelection()); + optionsMenu.add(underlineMenuSelectionMenuItem); + + //---- alwaysShowMnemonicsMenuItem ---- + alwaysShowMnemonicsMenuItem.setText("Always show mnemonics"); + alwaysShowMnemonicsMenuItem.addActionListener(e -> alwaysShowMnemonics()); + optionsMenu.add(alwaysShowMnemonicsMenuItem); + + //---- animatedLafChangeMenuItem ---- + animatedLafChangeMenuItem.setText("Animated Laf Change"); + animatedLafChangeMenuItem.setSelected(true); + animatedLafChangeMenuItem.addActionListener(e -> animatedLafChangeChanged()); + optionsMenu.add(animatedLafChangeMenuItem); + + //---- showHintsMenuItem ---- + showHintsMenuItem.setText("Show hints"); + showHintsMenuItem.addActionListener(e -> showHintsChanged()); + optionsMenu.add(showHintsMenuItem); + + //---- showUIDefaultsInspectorMenuItem ---- + showUIDefaultsInspectorMenuItem.setText("Show UI Defaults Inspector"); + showUIDefaultsInspectorMenuItem.addActionListener(e -> showUIDefaultsInspector()); + optionsMenu.add(showUIDefaultsInspectorMenuItem); + } + menuBar1.add(optionsMenu); + //======== helpMenu ======== { helpMenu.setText("Help"); @@ -349,12 +680,14 @@ class DemoFrame //======== tabbedPane ======== { + tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); tabbedPane.addChangeListener(e -> selectedTabChanged()); tabbedPane.addTab("Basic Components", basicComponentsPanel); tabbedPane.addTab("More Components", moreComponentsPanel); tabbedPane.addTab("Data Components", dataComponentsPanel); - tabbedPane.addTab("SplitPane & Tabs", tabsPanel); + tabbedPane.addTab("Tabs", tabsPanel); tabbedPane.addTab("Option Pane", optionPanePanel); + tabbedPane.addTab("Extras", extrasPanel1); } contentPanel.add(tabbedPane, "cell 0 0"); } @@ -387,10 +720,35 @@ class DemoFrame cutMenuItem.addActionListener( new DefaultEditorKit.CutAction() ); copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() ); pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() ); + + boolean supportsWindowDecorations = UIManager.getLookAndFeel() + .getSupportsWindowDecorations() || JBRCustomDecorations.isSupported(); + windowDecorationsCheckBoxMenuItem.setEnabled( supportsWindowDecorations && !JBRCustomDecorations.isSupported() ); + menuBarEmbeddedCheckBoxMenuItem.setEnabled( supportsWindowDecorations ); + + // remove contentPanel bottom insets + MigLayout layout = (MigLayout) contentPanel.getLayout(); + LC lc = ConstraintParser.parseLayoutConstraint( (String) layout.getLayoutConstraints() ); + UnitValue[] insets = lc.getInsets(); + lc.setInsets( new UnitValue[] { + insets[0], + insets[1], + new UnitValue( 0, UnitValue.PIXEL, null ), + insets[3] + } ); + layout.setLayoutConstraints( lc ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JMenu fontMenu; + private JMenu optionsMenu; + private JCheckBoxMenuItem windowDecorationsCheckBoxMenuItem; + private JCheckBoxMenuItem menuBarEmbeddedCheckBoxMenuItem; + private JCheckBoxMenuItem underlineMenuSelectionMenuItem; + private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem; + private JCheckBoxMenuItem animatedLafChangeMenuItem; private JTabbedPane tabbedPane; private ControlBar controlBar; + private IJThemesPanel themesPanel; // JFormDesigner - End of variables declaration //GEN-END:variables } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd index 179c618a..ef2ac5cb 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -64,6 +64,7 @@ new FormModel { name: "contentPanel" add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { name: "tabbedPane" + "tabLayoutPolicy": 1 auxiliary() { "JavaCodeGenerator.variableLocal": false } @@ -86,13 +87,18 @@ new FormModel { add( new FormComponent( "com.formdev.flatlaf.demo.TabsPanel" ) { name: "tabsPanel" }, new FormLayoutConstraints( null ) { - "title": "SplitPane & Tabs" + "title": "Tabs" } ) add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel" ) { name: "optionPanePanel" }, new FormLayoutConstraints( null ) { "title": "Option Pane" } ) + add( new FormComponent( "com.formdev.flatlaf.demo.extras.ExtrasPanel" ) { + name: "extrasPanel1" + }, new FormLayoutConstraints( null ) { + "title": "Extras" + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 0" } ) @@ -109,6 +115,9 @@ new FormModel { } ) add( new FormComponent( "com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel" ) { name: "themesPanel" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } }, new FormLayoutConstraints( class java.lang.String ) { "value": "East" } ) @@ -123,14 +132,21 @@ new FormModel { "text": "New" "accelerator": static javax.swing.KeyStroke getKeyStroke( 78, 4226, false ) "mnemonic": 78 - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "newActionPerformed", false ) ) } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "openMenuItem" - "text": "Open" + "text": "Open..." "accelerator": static javax.swing.KeyStroke getKeyStroke( 79, 4226, false ) "mnemonic": 79 - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openActionPerformed", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "saveAsMenuItem" + "text": "Save As..." + "accelerator": static javax.swing.KeyStroke getKeyStroke( 83, 4226, false ) + "mnemonic": 83 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "saveAsActionPerformed", false ) ) } ) add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { name: "separator2" @@ -259,6 +275,15 @@ new FormModel { addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) } ) } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem2" + "text": "Disabled Item" + "enabled": false + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem1" + "text": "some HTML text" + } ) add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { name: "separator8" } ) @@ -285,6 +310,91 @@ new FormModel { addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) } ) } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "fontMenu" + "text": "Font" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "restoreFontMenuItem" + "text": "Restore Font" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 48, 4226, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "restoreFont", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "incrFontMenuItem" + "text": "Increase Font Size" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 521, 4226, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "incrFont", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "decrFontMenuItem" + "text": "Decrease Font Size" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 45, 4226, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decrFont", false ) ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "optionsMenu" + "text": "Options" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "windowDecorationsCheckBoxMenuItem" + "text": "Window decorations" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "windowDecorationsChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "menuBarEmbeddedCheckBoxMenuItem" + "text": "Embedded menu bar" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "underlineMenuSelectionMenuItem" + "text": "Use underline menu selection" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "underlineMenuSelection", false ) ) + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "alwaysShowMnemonicsMenuItem" + "text": "Always show mnemonics" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alwaysShowMnemonics", false ) ) + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "animatedLafChangeMenuItem" + "text": "Animated Laf Change" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "animatedLafChangeChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "showHintsMenuItem" + "text": "Show hints" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showHintsChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "showUIDefaultsInspectorMenuItem" + "text": "Show UI Defaults Inspector" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showUIDefaultsInspector", false ) ) + } ) + } ) add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { name: "helpMenu" "text": "Help" diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java index 5a0317fb..69a84183 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoPrefs.java @@ -16,13 +16,16 @@ package com.formdev.flatlaf.demo; +import java.io.File; import java.io.FileInputStream; import java.util.prefs.Preferences; import javax.swing.UIManager; import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.FlatPropertiesLaf; import com.formdev.flatlaf.IntelliJTheme; import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel; +import com.formdev.flatlaf.util.StringUtils; /** * @author Karl Tauber @@ -30,12 +33,12 @@ import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel; public class DemoPrefs { public static final String KEY_LAF = "laf"; - public static final String KEY_LAF_INTELLIJ_THEME = "lafIntelliJTheme"; + public static final String KEY_LAF_THEME = "lafTheme"; public static final String RESOURCE_PREFIX = "res:"; public static final String FILE_PREFIX = "file:"; - public static final String INTELLIJ_THEME_UI_KEY = "__FlatLaf.demo.intelliJTheme"; + public static final String THEME_UI_KEY = "__FlatLaf.demo.theme"; private static Preferences state; @@ -55,20 +58,31 @@ public class DemoPrefs else { String lafClassName = state.get( KEY_LAF, FlatLightLaf.class.getName() ); if( IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) ) { - String intelliJTheme = state.get( KEY_LAF_INTELLIJ_THEME, "" ); - if( intelliJTheme.startsWith( RESOURCE_PREFIX ) ) - IntelliJTheme.install( IJThemesPanel.class.getResourceAsStream( intelliJTheme.substring( RESOURCE_PREFIX.length() ) ) ); - else if( intelliJTheme.startsWith( FILE_PREFIX ) ) - FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( intelliJTheme.substring( FILE_PREFIX.length() ) ) ) ); + String theme = state.get( KEY_LAF_THEME, "" ); + if( theme.startsWith( RESOURCE_PREFIX ) ) + IntelliJTheme.install( IJThemesPanel.class.getResourceAsStream( IJThemesPanel.THEMES_PACKAGE + theme.substring( RESOURCE_PREFIX.length() ) ) ); + else if( theme.startsWith( FILE_PREFIX ) ) + FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( theme.substring( FILE_PREFIX.length() ) ) ) ); else FlatLightLaf.install(); - if( !intelliJTheme.isEmpty() ) - UIManager.getLookAndFeelDefaults().put( INTELLIJ_THEME_UI_KEY, intelliJTheme ); + if( !theme.isEmpty() ) + UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme ); + } else if( FlatPropertiesLaf.class.getName().equals( lafClassName ) ) { + String theme = state.get( KEY_LAF_THEME, "" ); + if( theme.startsWith( FILE_PREFIX ) ) { + File themeFile = new File( theme.substring( FILE_PREFIX.length() ) ); + String themeName = StringUtils.removeTrailing( themeFile.getName(), ".properties" ); + FlatLaf.install( new FlatPropertiesLaf( themeName, themeFile ) ); + } else + FlatLightLaf.install(); + + if( !theme.isEmpty() ) + UIManager.getLookAndFeelDefaults().put( THEME_UI_KEY, theme ); } else UIManager.setLookAndFeel( lafClassName ); } - } catch( Exception ex ) { + } catch( Throwable ex ) { ex.printStackTrace(); // fallback diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java index 7042335d..3e24a316 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java @@ -16,7 +16,14 @@ package com.formdev.flatlaf.demo; +import java.awt.Dimension; +import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.SwingUtilities; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.extras.FlatInspector; +import com.formdev.flatlaf.extras.FlatUIDefaultsInspector; +import com.formdev.flatlaf.util.SystemInfo; /** * @author Karl Tauber @@ -26,16 +33,36 @@ public class FlatLafDemo static final String PREFS_ROOT_PATH = "/flatlaf-demo"; static final String KEY_TAB = "tab"; + static boolean screenshotsMode = Boolean.parseBoolean( System.getProperty( "flatlaf.demo.screenshotsMode" ) ); + public static void main( String[] args ) { + // on macOS enable screen menu bar + if( SystemInfo.isMacOS && System.getProperty( "apple.laf.useScreenMenuBar" ) == null ) + System.setProperty( "apple.laf.useScreenMenuBar", "true" ); + SwingUtilities.invokeLater( () -> { DemoPrefs.init( PREFS_ROOT_PATH ); + // enable window decorations + JFrame.setDefaultLookAndFeelDecorated( true ); + JDialog.setDefaultLookAndFeelDecorated( true ); + + // application specific UI defaults + FlatLaf.registerCustomDefaultsSource( "com.formdev.flatlaf.demo" ); + // set look and feel DemoPrefs.initLaf( args ); + // install inspectors + FlatInspector.install( "ctrl shift alt X" ); + FlatUIDefaultsInspector.install( "ctrl shift alt Y" ); + // create frame DemoFrame frame = new DemoFrame(); + if( FlatLafDemo.screenshotsMode ) + frame.setPreferredSize( new Dimension( 1280, 620 ) ); + // show frame frame.pack(); frame.setLocationRelativeTo( null ); diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.java new file mode 100644 index 00000000..9a336f37 --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.java @@ -0,0 +1,219 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.demo; + +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import com.formdev.flatlaf.ui.FlatDropShadowBorder; +import com.formdev.flatlaf.ui.FlatPopupMenuBorder; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.UIScale; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +class HintManager +{ + private static final List hintPanels = new ArrayList<>(); + + static void showHint( Hint hint ) { + // check whether user already closed the hint + if( DemoPrefs.getState().getBoolean( hint.prefsKey, false ) ) { + if( hint.nextHint != null ) + showHint( hint.nextHint ); + return; + } + + HintPanel hintPanel = new HintPanel( hint ); + hintPanel.showHint(); + + hintPanels.add( hintPanel ); + } + + static void hideAllHints() { + HintPanel[] hintPanels2 = hintPanels.toArray( new HintPanel[hintPanels.size()] ); + for( HintPanel hintPanel : hintPanels2 ) + hintPanel.hideHint(); + } + + //---- class HintPanel ---------------------------------------------------- + + static class Hint + { + private final String message; + private final Component owner; + private final int position; + private final String prefsKey; + private final Hint nextHint; + + Hint( String message, Component owner, int position, String prefsKey, Hint nextHint ) { + this.message = message; + this.owner = owner; + this.position = position; + this.prefsKey = prefsKey; + this.nextHint = nextHint; + } + } + + //---- class HintPanel ---------------------------------------------------- + + private static class HintPanel + extends JPanel + { + private final Hint hint; + + private JPanel popup; + + private HintPanel( Hint hint ) { + this.hint = hint; + + initComponents(); + + hintLabel.setText( "" + hint.message + "" ); + + // grab all mouse events to avoid that components overlapped + // by the hint panel receive them + addMouseListener( new MouseAdapter() {} ); + } + + @Override + public void updateUI() { + super.updateUI(); + + setBackground( UIManager.getColor( "HintPanel.backgroundColor" ) ); + setBorder( new FlatPopupMenuBorder() ); + } + + void showHint() { + JRootPane rootPane = SwingUtilities.getRootPane( hint.owner ); + if( rootPane == null ) + return; + + JLayeredPane layeredPane = rootPane.getLayeredPane(); + + // create a popup panel that has a drop shadow + popup = new JPanel( new BorderLayout() ) { + @Override + public void updateUI() { + super.updateUI(); + + setBorder( new FlatDropShadowBorder( + UIManager.getColor( "Popup.dropShadowColor" ), + UIManager.getInsets( "Popup.dropShadowInsets" ), + FlatUIUtils.getUIFloat( "Popup.dropShadowOpacity", 0.5f ) ) ); + + // use invokeLater because at this time the UI delegates + // of child components are not yet updated + EventQueue.invokeLater( () -> { + validate(); + setSize( getPreferredSize() ); + } ); + } + }; + popup.setOpaque( false ); + popup.add( this ); + + // calculate x/y location for hint popup + Point pt = SwingUtilities.convertPoint( hint.owner, 0, 0, layeredPane ); + int x = pt.x; + int y = pt.y; + Dimension size = popup.getPreferredSize(); + int gap = UIScale.scale( 6 ); + + switch( hint.position ) { + case SwingConstants.LEFT: + x -= size.width + gap; + break; + + case SwingConstants.TOP: + y -= size.height + gap; + break; + + case SwingConstants.RIGHT: + x += hint.owner.getWidth() + gap; + break; + + case SwingConstants.BOTTOM: + y += hint.owner.getHeight() + gap; + break; + } + + // set hint popup size and show it + popup.setBounds( x, y, size.width, size.height ); + layeredPane.add( popup, JLayeredPane.POPUP_LAYER ); + } + + void hideHint() { + if( popup != null ) { + Container parent = popup.getParent(); + if( parent != null ) { + parent.remove( popup ); + parent.repaint( popup.getX(), popup.getY(), popup.getWidth(), popup.getHeight() ); + } + } + + hintPanels.remove( this ); + } + + private void gotIt() { + // hide hint + hideHint(); + + // remember that user closed the hint + DemoPrefs.getState().putBoolean( hint.prefsKey, true ); + + // show next hint (if any) + if( hint.nextHint != null ) + HintManager.showHint( hint.nextHint ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + hintLabel = new JLabel(); + gotItButton = new JButton(); + + //======== this ======== + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[::200,fill]", + // rows + "[]para" + + "[]")); + + //---- hintLabel ---- + hintLabel.setText("hint"); + add(hintLabel, "cell 0 0"); + + //---- gotItButton ---- + gotItButton.setText("Got it!"); + gotItButton.setFocusable(false); + gotItButton.addActionListener(e -> gotIt()); + add(gotItButton, "cell 0 1,alignx right,growx 0"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JLabel hintLabel; + private JButton gotItButton; + // JFormDesigner - End of variables declaration //GEN-END:variables + } +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.jfd new file mode 100644 index 00000000..a7fc21ac --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/HintManager.jfd @@ -0,0 +1,34 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[::200,fill]" + "$rowConstraints": "[]para[]" + } ) { + name: "panel" + auxiliary() { + "JavaCodeGenerator.className": "HintPanel" + } + add( new FormComponent( "javax.swing.JLabel" ) { + name: "hintLabel" + "text": "hint" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "gotItButton" + "text": "Got it!" + "focusable": false + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "gotIt", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1,alignx right,growx 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 400, 300 ) + } ) + } +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.java index d0a1b198..95b1c72a 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.java @@ -59,7 +59,6 @@ class MoreComponentsPanel JSeparator separator2 = new JSeparator(); JSlider slider2 = new JSlider(); JSlider slider4 = new JSlider(); - JScrollPane scrollPane14 = new JScrollPane(); progressBar3 = new JProgressBar(); progressBar4 = new JProgressBar(); JToolBar toolBar2 = new JToolBar(); @@ -67,11 +66,12 @@ class MoreComponentsPanel JButton button10 = new JButton(); JButton button11 = new JButton(); JToggleButton toggleButton7 = new JToggleButton(); + JPanel panel2 = new JPanel(); JLabel scrollBarLabel = new JLabel(); JScrollBar scrollBar1 = new JScrollBar(); - JLabel label4 = new JLabel(); JScrollBar scrollBar4 = new JScrollBar(); JPanel panel3 = new JPanel(); + JLabel label4 = new JLabel(); JLabel label3 = new JLabel(); JScrollPane scrollPane15 = new JScrollPane(); JEditorPane editorPane6 = new JEditorPane(); @@ -81,7 +81,6 @@ class MoreComponentsPanel JScrollBar scrollBar6 = new JScrollBar(); JLabel separatorLabel = new JLabel(); JSeparator separator1 = new JSeparator(); - JPanel panel2 = new JPanel(); JLabel sliderLabel = new JLabel(); JSlider slider1 = new JSlider(); JSlider slider6 = new JSlider(); @@ -101,16 +100,28 @@ class MoreComponentsPanel JButton button7 = new JButton(); JButton button8 = new JButton(); JToggleButton toggleButton6 = new JToggleButton(); + JButton button1 = new JButton(); + JLabel splitPaneLabel = new JLabel(); + JSplitPane splitPane3 = new JSplitPane(); + JSplitPane splitPane1 = new JSplitPane(); + JPanel panel10 = new JPanel(); + JLabel label1 = new JLabel(); + JPanel panel11 = new JPanel(); + JLabel label2 = new JLabel(); + JSplitPane splitPane2 = new JSplitPane(); + JPanel panel12 = new JPanel(); + JLabel label5 = new JLabel(); + JPanel panel13 = new JPanel(); + JLabel label6 = new JLabel(); //======== this ======== setLayout(new MigLayout( - "hidemode 3", + "insets dialog,hidemode 3", // columns "[]" + "[]" + "[]" + "[]" + - "[]" + "[]", // rows "[]" + @@ -123,7 +134,8 @@ class MoreComponentsPanel "[]" + "[]" + "[]" + - "[]")); + "[]" + + "[100,top]")); //---- scrollPaneLabel ---- scrollPaneLabel.setText("JScrollPane:"); @@ -141,7 +153,7 @@ class MoreComponentsPanel } scrollPane13.setViewportView(panel1); } - add(scrollPane13, "cell 1 0,grow,width 70,height 70"); + add(scrollPane13, "cell 1 0,grow,width 70,height 40"); add(scrollBar2, "cell 2 0 1 6,growy"); //---- scrollBar3 ---- @@ -164,7 +176,7 @@ class MoreComponentsPanel //---- slider2 ---- slider2.setOrientation(SwingConstants.VERTICAL); slider2.setValue(30); - add(slider2, "cell 2 0 1 6,growy"); + add(slider2, "cell 2 0 1 6,growy,height 100"); //---- slider4 ---- slider4.setMinorTickSpacing(10); @@ -173,19 +185,18 @@ class MoreComponentsPanel slider4.setPaintLabels(true); slider4.setOrientation(SwingConstants.VERTICAL); slider4.setValue(30); - add(slider4, "cell 2 0 1 6,growy"); - add(scrollPane14, "cell 3 0,grow"); + add(slider4, "cell 2 0 1 6,growy,height 100"); //---- progressBar3 ---- progressBar3.setOrientation(SwingConstants.VERTICAL); progressBar3.setValue(60); - add(progressBar3, "cell 4 0 1 6,growy"); + add(progressBar3, "cell 2 0 1 6,growy"); //---- progressBar4 ---- progressBar4.setOrientation(SwingConstants.VERTICAL); progressBar4.setValue(60); progressBar4.setStringPainted(true); - add(progressBar4, "cell 4 0 1 6,growy"); + add(progressBar4, "cell 2 0 1 6,growy"); //======== toolBar2 ======== { @@ -208,7 +219,14 @@ class MoreComponentsPanel toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon")); toolBar2.add(toggleButton7); } - add(toolBar2, "cell 4 0 1 6,growy"); + add(toolBar2, "cell 2 0 1 6,growy"); + + //======== panel2 ======== + { + panel2.setBorder(new TitledBorder("TitledBorder")); + panel2.setLayout(new FlowLayout()); + } + add(panel2, "cell 3 0 1 6,grow"); //---- scrollBarLabel ---- scrollBarLabel.setText("JScrollBar:"); @@ -218,10 +236,6 @@ class MoreComponentsPanel scrollBar1.setOrientation(Adjustable.HORIZONTAL); add(scrollBar1, "cell 1 1,growx"); - //---- label4 ---- - label4.setText("HTML:"); - add(label4, "cell 5 1"); - //---- scrollBar4 ---- scrollBar4.setOrientation(Adjustable.HORIZONTAL); scrollBar4.setEnabled(false); @@ -237,11 +251,16 @@ class MoreComponentsPanel // rows "[]" + "[]" + + "[]" + "[]")); + //---- label4 ---- + label4.setText("HTML:"); + panel3.add(label4, "cell 0 0"); + //---- label3 ---- label3.setText("JLabel HTML
Sample content
text with link"); - panel3.add(label3, "cell 0 0"); + panel3.add(label3, "cell 0 1"); //======== scrollPane15 ======== { @@ -251,7 +270,7 @@ class MoreComponentsPanel editorPane6.setText("JEditorPane HTML
Sample content
text with link"); scrollPane15.setViewportView(editorPane6); } - panel3.add(scrollPane15, "cell 0 1,grow"); + panel3.add(scrollPane15, "cell 0 2,grow"); //======== scrollPane16 ======== { @@ -261,9 +280,9 @@ class MoreComponentsPanel textPane6.setText("JTextPane HTML
Sample content
text with link"); scrollPane16.setViewportView(textPane6); } - panel3.add(scrollPane16, "cell 0 2,grow"); + panel3.add(scrollPane16, "cell 0 3,grow"); } - add(panel3, "cell 5 2 1 9,aligny top,growy 0"); + add(panel3, "cell 4 0 1 8,aligny top,growy 0"); //---- scrollBar5 ---- scrollBar5.setOrientation(Adjustable.HORIZONTAL); @@ -281,13 +300,6 @@ class MoreComponentsPanel add(separatorLabel, "cell 0 5"); add(separator1, "cell 1 5,growx"); - //======== panel2 ======== - { - panel2.setBorder(new TitledBorder("TitledBorder")); - panel2.setLayout(new FlowLayout()); - } - add(panel2, "cell 3 5,grow"); - //---- sliderLabel ---- sliderLabel.setText("JSlider:"); add(sliderLabel, "cell 0 6"); @@ -380,9 +392,100 @@ class MoreComponentsPanel toggleButton6.setIcon(UIManager.getIcon("Tree.leafIcon")); toggleButton6.setSelected(true); toolBar1.add(toggleButton6); + + //---- button1 ---- + button1.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png"))); + button1.setEnabled(false); + toolBar1.add(button1); } add(toolBar1, "cell 1 10 3 1,growx"); + + //---- splitPaneLabel ---- + splitPaneLabel.setText("JSplitPane:"); + add(splitPaneLabel, "cell 0 11"); + + //======== splitPane3 ======== + { + splitPane3.setResizeWeight(0.5); + + //======== splitPane1 ======== + { + splitPane1.setResizeWeight(0.5); + + //======== panel10 ======== + { + panel10.setBackground(new Color(217, 163, 67)); + panel10.setLayout(new BorderLayout()); + + //---- label1 ---- + label1.setText("LEFT"); + label1.setHorizontalAlignment(SwingConstants.CENTER); + label1.setForeground(Color.white); + panel10.add(label1, BorderLayout.CENTER); + } + splitPane1.setLeftComponent(panel10); + + //======== panel11 ======== + { + panel11.setBackground(new Color(98, 181, 67)); + panel11.setLayout(new BorderLayout()); + + //---- label2 ---- + label2.setText("RIGHT"); + label2.setHorizontalAlignment(SwingConstants.CENTER); + label2.setForeground(Color.white); + panel11.add(label2, BorderLayout.CENTER); + } + splitPane1.setRightComponent(panel11); + } + splitPane3.setLeftComponent(splitPane1); + + //======== splitPane2 ======== + { + splitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); + splitPane2.setResizeWeight(0.5); + + //======== panel12 ======== + { + panel12.setBackground(new Color(242, 101, 34)); + panel12.setLayout(new BorderLayout()); + + //---- label5 ---- + label5.setText("TOP"); + label5.setHorizontalAlignment(SwingConstants.CENTER); + label5.setForeground(Color.white); + panel12.add(label5, BorderLayout.CENTER); + } + splitPane2.setTopComponent(panel12); + + //======== panel13 ======== + { + panel13.setBackground(new Color(64, 182, 224)); + panel13.setLayout(new BorderLayout()); + + //---- label6 ---- + label6.setText("BOTTOM"); + label6.setHorizontalAlignment(SwingConstants.CENTER); + label6.setForeground(Color.white); + panel13.add(label6, BorderLayout.CENTER); + } + splitPane2.setBottomComponent(panel13); + } + splitPane3.setRightComponent(splitPane2); + } + add(splitPane3, "cell 1 11 4 1,grow"); // JFormDesigner - End of component initialization //GEN-END:initComponents + + if( FlatLafDemo.screenshotsMode ) { + Component[] components = new Component[] { + indeterminateCheckBox, + toolTipLabel, toolTip1, toolTip2, + toolBarLabel, toolBar1, toolBar2, + }; + + for( Component c : components ) + c.setVisible( false ); + } } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.jfd index f533a270..c21dbefe 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/MoreComponentsPanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -7,9 +7,9 @@ new FormModel { "JavaCodeGenerator.defaultVariableLocal": true } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "hidemode 3" - "$columnConstraints": "[][][][][][]" - "$rowConstraints": "[][][][][][][][][][][]" + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[][][][][]" + "$rowConstraints": "[][][][][][][][][][][][100,top]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -27,7 +27,7 @@ new FormModel { "preferredSize": new java.awt.Dimension( 200, 200 ) } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0,grow,width 70,height 70" + "value": "cell 1 0,grow,width 70,height 40" } ) add( new FormComponent( "javax.swing.JScrollBar" ) { name: "scrollBar2" @@ -64,7 +64,7 @@ new FormModel { "orientation": 1 "value": 30 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0 1 6,growy" + "value": "cell 2 0 1 6,growy,height 100" } ) add( new FormComponent( "javax.swing.JSlider" ) { name: "slider4" @@ -75,12 +75,7 @@ new FormModel { "orientation": 1 "value": 30 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0 1 6,growy" - } ) - add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { - name: "scrollPane14" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 3 0,grow" + "value": "cell 2 0 1 6,growy,height 100" } ) add( new FormComponent( "javax.swing.JProgressBar" ) { name: "progressBar3" @@ -90,7 +85,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 0 1 6,growy" + "value": "cell 2 0 1 6,growy" } ) add( new FormComponent( "javax.swing.JProgressBar" ) { name: "progressBar4" @@ -101,7 +96,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": false } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 0 1 6,growy" + "value": "cell 2 0 1 6,growy" } ) add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { name: "toolBar2" @@ -126,7 +121,13 @@ new FormModel { "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" ) } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 0 1 6,growy" + "value": "cell 2 0 1 6,growy" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel2" + "border": new javax.swing.border.TitledBorder( "TitledBorder" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 1 6,grow" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "scrollBarLabel" @@ -140,12 +141,6 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1,growx" } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label4" - "text": "HTML:" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 1" - } ) add( new FormComponent( "javax.swing.JScrollBar" ) { name: "scrollBar4" "orientation": 0 @@ -155,16 +150,22 @@ new FormModel { } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$columnConstraints": "[]" - "$rowConstraints": "[][][]" + "$rowConstraints": "[][][][]" "$layoutConstraints": "ltr,insets 0,hidemode 3" } ) { name: "panel3" "opaque": false + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "HTML:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label3" "text": "JLabel HTML
Sample content
text with link" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" + "value": "cell 0 1" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane15" @@ -174,7 +175,7 @@ new FormModel { "text": "JEditorPane HTML
Sample content
text with link" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1,grow" + "value": "cell 0 2,grow" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane16" @@ -184,10 +185,10 @@ new FormModel { "text": "JTextPane HTML
Sample content
text with link" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2,grow" + "value": "cell 0 3,grow" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 2 1 9,aligny top,growy 0" + "value": "cell 4 0 1 8,aligny top,growy 0" } ) add( new FormComponent( "javax.swing.JScrollBar" ) { name: "scrollBar5" @@ -215,12 +216,6 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 5,growx" } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel2" - "border": new javax.swing.border.TitledBorder( "TitledBorder" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 3 5,grow" - } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "sliderLabel" "text": "JSlider:" @@ -355,12 +350,98 @@ new FormModel { "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) "selected": true } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button1" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png" ) + "enabled": false + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 10 3 1,growx" } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "splitPaneLabel" + "text": "JSplitPane:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 11" + } ) + add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { + name: "splitPane3" + "resizeWeight": 0.5 + add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { + name: "splitPane1" + "resizeWeight": 0.5 + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel10" + "background": new java.awt.Color( 217, 163, 67, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "LEFT" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "left" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel11" + "background": new java.awt.Color( 98, 181, 67, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "RIGHT" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "right" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "left" + } ) + add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { + name: "splitPane2" + "orientation": 0 + "resizeWeight": 0.5 + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel12" + "background": new java.awt.Color( 242, 101, 34, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "TOP" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "left" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel13" + "background": new java.awt.Color( 64, 182, 224, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "text": "BOTTOM" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "right" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "right" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 11 4 1,grow" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 715 ) + "size": new java.awt.Dimension( 700, 550 ) } ) } } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.java new file mode 100644 index 00000000..3ec5c270 --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.java @@ -0,0 +1,393 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.demo; + +import java.awt.*; +import java.awt.event.KeyEvent; +import javax.swing.*; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +class NewDialog + extends JDialog +{ + NewDialog( Window owner ) { + super( owner ); + initComponents(); + + // hide menubar, which is here for testing + menuBar1.setVisible( false ); + + getRootPane().setDefaultButton( okButton ); + + // register ESC key to close frame + ((JComponent)getContentPane()).registerKeyboardAction( + e -> dispose(), + KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + } + + private void okActionPerformed() { + dispose(); + } + + private void cancelActionPerformed() { + dispose(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + dialogPane = new JPanel(); + contentPanel = new JPanel(); + label1 = new JLabel(); + textField1 = new JTextField(); + label3 = new JLabel(); + comboBox2 = new JComboBox<>(); + label2 = new JLabel(); + comboBox1 = new JComboBox<>(); + buttonBar = new JPanel(); + okButton = new JButton(); + cancelButton = new JButton(); + menuBar1 = new JMenuBar(); + menu1 = new JMenu(); + menuItem8 = new JMenuItem(); + menuItem7 = new JMenuItem(); + menuItem6 = new JMenuItem(); + menuItem5 = new JMenuItem(); + menuItem4 = new JMenuItem(); + menuItem3 = new JMenuItem(); + menuItem2 = new JMenuItem(); + menuItem1 = new JMenuItem(); + menu2 = new JMenu(); + menuItem18 = new JMenuItem(); + menuItem17 = new JMenuItem(); + menuItem16 = new JMenuItem(); + menuItem15 = new JMenuItem(); + menuItem14 = new JMenuItem(); + menuItem13 = new JMenuItem(); + menuItem12 = new JMenuItem(); + menuItem11 = new JMenuItem(); + menuItem10 = new JMenuItem(); + menuItem9 = new JMenuItem(); + menu3 = new JMenu(); + menuItem25 = new JMenuItem(); + menuItem26 = new JMenuItem(); + menuItem24 = new JMenuItem(); + menuItem23 = new JMenuItem(); + menuItem22 = new JMenuItem(); + menuItem21 = new JMenuItem(); + menuItem20 = new JMenuItem(); + menuItem19 = new JMenuItem(); + popupMenu1 = new JPopupMenu(); + cutMenuItem = new JMenuItem(); + copyMenuItem = new JMenuItem(); + pasteMenuItem = new JMenuItem(); + + //======== this ======== + setTitle("New"); + setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + setModal(true); + Container contentPane = getContentPane(); + contentPane.setLayout(new BorderLayout()); + + //======== dialogPane ======== + { + dialogPane.setLayout(new BorderLayout()); + + //======== contentPanel ======== + { + contentPanel.setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[fill]" + + "[grow,fill]", + // rows + "[]" + + "[]" + + "[]")); + + //---- label1 ---- + label1.setText("Name:"); + contentPanel.add(label1, "cell 0 0"); + + //---- textField1 ---- + textField1.setComponentPopupMenu(popupMenu1); + contentPanel.add(textField1, "cell 1 0"); + + //---- label3 ---- + label3.setText("Package:"); + contentPanel.add(label3, "cell 0 1"); + + //---- comboBox2 ---- + comboBox2.setEditable(true); + comboBox2.setModel(new DefaultComboBoxModel<>(new String[] { + "com.myapp", + "com.myapp.core", + "com.myapp.ui", + "com.myapp.util", + "com.myapp.extras", + "com.myapp.components", + "com.myapp.dialogs", + "com.myapp.windows" + })); + contentPanel.add(comboBox2, "cell 1 1"); + + //---- label2 ---- + label2.setText("Type:"); + contentPanel.add(label2, "cell 0 2"); + + //---- comboBox1 ---- + comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { + "Class", + "Interface", + "Package", + "Annotation", + "Enum", + "Record", + "Java Project", + "Project", + "Folder", + "File" + })); + contentPanel.add(comboBox1, "cell 1 2"); + } + dialogPane.add(contentPanel, BorderLayout.CENTER); + + //======== buttonBar ======== + { + buttonBar.setLayout(new MigLayout( + "insets dialog,alignx right", + // columns + "[button,fill]" + + "[button,fill]", + // rows + null)); + + //---- okButton ---- + okButton.setText("OK"); + okButton.addActionListener(e -> okActionPerformed()); + buttonBar.add(okButton, "cell 0 0"); + + //---- cancelButton ---- + cancelButton.setText("Cancel"); + cancelButton.addActionListener(e -> cancelActionPerformed()); + buttonBar.add(cancelButton, "cell 1 0"); + } + dialogPane.add(buttonBar, BorderLayout.SOUTH); + + //======== menuBar1 ======== + { + + //======== menu1 ======== + { + menu1.setText("text"); + + //---- menuItem8 ---- + menuItem8.setText("text"); + menu1.add(menuItem8); + + //---- menuItem7 ---- + menuItem7.setText("text"); + menu1.add(menuItem7); + + //---- menuItem6 ---- + menuItem6.setText("text"); + menu1.add(menuItem6); + + //---- menuItem5 ---- + menuItem5.setText("text"); + menu1.add(menuItem5); + + //---- menuItem4 ---- + menuItem4.setText("text"); + menu1.add(menuItem4); + + //---- menuItem3 ---- + menuItem3.setText("text"); + menu1.add(menuItem3); + + //---- menuItem2 ---- + menuItem2.setText("text"); + menu1.add(menuItem2); + + //---- menuItem1 ---- + menuItem1.setText("text"); + menu1.add(menuItem1); + } + menuBar1.add(menu1); + + //======== menu2 ======== + { + menu2.setText("text"); + + //---- menuItem18 ---- + menuItem18.setText("text"); + menu2.add(menuItem18); + + //---- menuItem17 ---- + menuItem17.setText("text"); + menu2.add(menuItem17); + + //---- menuItem16 ---- + menuItem16.setText("text"); + menu2.add(menuItem16); + + //---- menuItem15 ---- + menuItem15.setText("text"); + menu2.add(menuItem15); + + //---- menuItem14 ---- + menuItem14.setText("text"); + menu2.add(menuItem14); + + //---- menuItem13 ---- + menuItem13.setText("text"); + menu2.add(menuItem13); + + //---- menuItem12 ---- + menuItem12.setText("text"); + menu2.add(menuItem12); + + //---- menuItem11 ---- + menuItem11.setText("text"); + menu2.add(menuItem11); + + //---- menuItem10 ---- + menuItem10.setText("text"); + menu2.add(menuItem10); + + //---- menuItem9 ---- + menuItem9.setText("text"); + menu2.add(menuItem9); + } + menuBar1.add(menu2); + + //======== menu3 ======== + { + menu3.setText("text"); + + //---- menuItem25 ---- + menuItem25.setText("text"); + menu3.add(menuItem25); + + //---- menuItem26 ---- + menuItem26.setText("text"); + menu3.add(menuItem26); + + //---- menuItem24 ---- + menuItem24.setText("text"); + menu3.add(menuItem24); + + //---- menuItem23 ---- + menuItem23.setText("text"); + menu3.add(menuItem23); + + //---- menuItem22 ---- + menuItem22.setText("text"); + menu3.add(menuItem22); + + //---- menuItem21 ---- + menuItem21.setText("text"); + menu3.add(menuItem21); + + //---- menuItem20 ---- + menuItem20.setText("text"); + menu3.add(menuItem20); + + //---- menuItem19 ---- + menuItem19.setText("text"); + menu3.add(menuItem19); + } + menuBar1.add(menu3); + } + dialogPane.add(menuBar1, BorderLayout.NORTH); + } + contentPane.add(dialogPane, BorderLayout.CENTER); + pack(); + setLocationRelativeTo(getOwner()); + + //======== popupMenu1 ======== + { + + //---- cutMenuItem ---- + cutMenuItem.setText("Cut"); + cutMenuItem.setMnemonic('C'); + popupMenu1.add(cutMenuItem); + + //---- copyMenuItem ---- + copyMenuItem.setText("Copy"); + copyMenuItem.setMnemonic('O'); + popupMenu1.add(copyMenuItem); + + //---- pasteMenuItem ---- + pasteMenuItem.setText("Paste"); + pasteMenuItem.setMnemonic('P'); + popupMenu1.add(pasteMenuItem); + } + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JPanel dialogPane; + private JPanel contentPanel; + private JLabel label1; + private JTextField textField1; + private JLabel label3; + private JComboBox comboBox2; + private JLabel label2; + private JComboBox comboBox1; + private JPanel buttonBar; + private JButton okButton; + private JButton cancelButton; + private JMenuBar menuBar1; + private JMenu menu1; + private JMenuItem menuItem8; + private JMenuItem menuItem7; + private JMenuItem menuItem6; + private JMenuItem menuItem5; + private JMenuItem menuItem4; + private JMenuItem menuItem3; + private JMenuItem menuItem2; + private JMenuItem menuItem1; + private JMenu menu2; + private JMenuItem menuItem18; + private JMenuItem menuItem17; + private JMenuItem menuItem16; + private JMenuItem menuItem15; + private JMenuItem menuItem14; + private JMenuItem menuItem13; + private JMenuItem menuItem12; + private JMenuItem menuItem11; + private JMenuItem menuItem10; + private JMenuItem menuItem9; + private JMenu menu3; + private JMenuItem menuItem25; + private JMenuItem menuItem26; + private JMenuItem menuItem24; + private JMenuItem menuItem23; + private JMenuItem menuItem22; + private JMenuItem menuItem21; + private JMenuItem menuItem20; + private JMenuItem menuItem19; + private JPopupMenu popupMenu1; + private JMenuItem cutMenuItem; + private JMenuItem copyMenuItem; + private JMenuItem pasteMenuItem; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.jfd new file mode 100644 index 00000000..45f9f74e --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/NewDialog.jfd @@ -0,0 +1,254 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormWindow( "javax.swing.JDialog", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "this" + "title": "New" + "defaultCloseOperation": 2 + "modal": true + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "dialogPane" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[fill][grow,fill]" + "$rowConstraints": "[][][]" + } ) { + name: "contentPanel" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "Name:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField1" + "componentPopupMenu": new FormReference( "popupMenu1" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "Package:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox2" + "editable": true + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "com.myapp" + addElement( "com.myapp" ) + addElement( "com.myapp.core" ) + addElement( "com.myapp.ui" ) + addElement( "com.myapp.util" ) + addElement( "com.myapp.extras" ) + addElement( "com.myapp.components" ) + addElement( "com.myapp.dialogs" ) + addElement( "com.myapp.windows" ) + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "Type:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox1" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "Class" + addElement( "Class" ) + addElement( "Interface" ) + addElement( "Package" ) + addElement( "Annotation" ) + addElement( "Enum" ) + addElement( "Record" ) + addElement( "Java Project" ) + addElement( "Project" ) + addElement( "Folder" ) + addElement( "File" ) + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,alignx right" + "$columnConstraints": "[button,fill][button,fill]" + "$rowSpecs": "[fill]" + } ) { + name: "buttonBar" + add( new FormComponent( "javax.swing.JButton" ) { + name: "okButton" + "text": "OK" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "okActionPerformed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "cancelButton" + "text": "Cancel" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "cancelActionPerformed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "South" + } ) + add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { + name: "menuBar1" + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu1" + "text": "text" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem8" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem7" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem6" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem5" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem4" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem3" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem2" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem1" + "text": "text" + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu2" + "text": "text" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem18" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem17" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem16" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem15" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem14" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem13" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem12" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem11" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem10" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem9" + "text": "text" + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu3" + "text": "text" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem25" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem26" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem24" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem23" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem22" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem21" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem20" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem19" + "text": "text" + } ) + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "North" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 330, 210 ) + } ) + add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) { + name: "popupMenu1" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "cutMenuItem" + "text": "Cut" + "mnemonic": 67 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "copyMenuItem" + "text": "Copy" + "mnemonic": 79 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "pasteMenuItem" + "text": "Paste" + "mnemonic": 80 + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 220 ) + "size": new java.awt.Dimension( 91, 87 ) + } ) + } +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.java index 71443174..98de9d00 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.java @@ -27,7 +27,7 @@ import net.miginfocom.swing.*; * @author Karl Tauber */ class OptionPanePanel - extends JScrollPane + extends JPanel { OptionPanePanel() { initComponents(); @@ -48,6 +48,7 @@ class OptionPanePanel private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JScrollPane scrollPane1 = new JScrollPane(); ScrollablePanel panel9 = new ScrollablePanel(); JLabel plainLabel = new JLabel(); JPanel panel1 = new JPanel(); @@ -83,200 +84,206 @@ class OptionPanePanel OptionPanePanel.ShowDialogLinkLabel customShowDialogLabel = new OptionPanePanel.ShowDialogLinkLabel(); //======== this ======== - setBorder(BorderFactory.createEmptyBorder()); + setLayout(new BorderLayout()); - //======== panel9 ======== + //======== scrollPane1 ======== { - panel9.setLayout(new MigLayout( - "flowy,hidemode 3", - // columns - "[]" + - "[]" + - "[fill]", - // rows - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]")); + scrollPane1.setBorder(BorderFactory.createEmptyBorder()); - //---- plainLabel ---- - plainLabel.setText("Plain"); - panel9.add(plainLabel, "cell 0 0"); - - //======== panel1 ======== + //======== panel9 ======== { - panel1.setBorder(LineBorder.createGrayLineBorder()); - panel1.setLayout(new BorderLayout()); + panel9.setLayout(new MigLayout( + "flowy,insets dialog,hidemode 3", + // columns + "[]" + + "[]" + + "[fill]", + // rows + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]")); - //---- plainOptionPane ---- - plainOptionPane.setMessage("Hello world."); - panel1.add(plainOptionPane, BorderLayout.CENTER); + //---- plainLabel ---- + plainLabel.setText("Plain"); + panel9.add(plainLabel, "cell 0 0"); + + //======== panel1 ======== + { + panel1.setBorder(LineBorder.createGrayLineBorder()); + panel1.setLayout(new BorderLayout()); + + //---- plainOptionPane ---- + plainOptionPane.setMessage("Hello world."); + panel1.add(plainOptionPane, BorderLayout.CENTER); + } + panel9.add(panel1, "cell 1 0"); + + //---- plainShowDialogLabel ---- + plainShowDialogLabel.setOptionPane(plainOptionPane); + plainShowDialogLabel.setTitleLabel(plainLabel); + panel9.add(plainShowDialogLabel, "cell 2 0"); + + //---- errorLabel ---- + errorLabel.setText("Error"); + panel9.add(errorLabel, "cell 0 1"); + + //======== panel2 ======== + { + panel2.setBorder(LineBorder.createGrayLineBorder()); + panel2.setLayout(new BorderLayout()); + + //---- errorOptionPane ---- + errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); + errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); + panel2.add(errorOptionPane, BorderLayout.CENTER); + } + panel9.add(panel2, "cell 1 1"); + + //---- errorShowDialogLabel ---- + errorShowDialogLabel.setTitleLabel(errorLabel); + errorShowDialogLabel.setOptionPane(errorOptionPane); + panel9.add(errorShowDialogLabel, "cell 2 1"); + + //---- informationLabel ---- + informationLabel.setText("Information"); + panel9.add(informationLabel, "cell 0 2"); + + //======== panel3 ======== + { + panel3.setBorder(LineBorder.createGrayLineBorder()); + panel3.setLayout(new BorderLayout()); + + //---- informationOptionPane ---- + informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); + informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); + panel3.add(informationOptionPane, BorderLayout.CENTER); + } + panel9.add(panel3, "cell 1 2"); + + //---- informationShowDialogLabel ---- + informationShowDialogLabel.setOptionPane(informationOptionPane); + informationShowDialogLabel.setTitleLabel(informationLabel); + panel9.add(informationShowDialogLabel, "cell 2 2"); + + //---- questionLabel ---- + questionLabel.setText("Question"); + panel9.add(questionLabel, "cell 0 3"); + + //======== panel4 ======== + { + panel4.setBorder(LineBorder.createGrayLineBorder()); + panel4.setLayout(new BorderLayout()); + + //---- questionOptionPane ---- + questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); + questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); + questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); + panel4.add(questionOptionPane, BorderLayout.CENTER); + } + panel9.add(panel4, "cell 1 3"); + + //---- questionShowDialogLabel ---- + questionShowDialogLabel.setOptionPane(questionOptionPane); + questionShowDialogLabel.setTitleLabel(questionLabel); + panel9.add(questionShowDialogLabel, "cell 2 3"); + + //---- warningLabel ---- + warningLabel.setText("Warning"); + panel9.add(warningLabel, "cell 0 4"); + + //======== panel5 ======== + { + panel5.setBorder(LineBorder.createGrayLineBorder()); + panel5.setLayout(new BorderLayout()); + + //---- warningOptionPane ---- + warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); + warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); + panel5.add(warningOptionPane, BorderLayout.CENTER); + } + panel9.add(panel5, "cell 1 4"); + + //---- warningShowDialogLabel ---- + warningShowDialogLabel.setOptionPane(warningOptionPane); + warningShowDialogLabel.setTitleLabel(warningLabel); + panel9.add(warningShowDialogLabel, "cell 2 4"); + + //---- inputLabel ---- + inputLabel.setText("Input"); + panel9.add(inputLabel, "cell 0 5"); + + //======== panel7 ======== + { + panel7.setBorder(LineBorder.createGrayLineBorder()); + panel7.setLayout(new BorderLayout()); + + //---- inputOptionPane ---- + inputOptionPane.setWantsInput(true); + inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputOptionPane.setMessage("Enter whatever you want:"); + panel7.add(inputOptionPane, BorderLayout.CENTER); + } + panel9.add(panel7, "cell 1 5"); + + //---- inputShowDialogLabel ---- + inputShowDialogLabel.setOptionPane(inputOptionPane); + inputShowDialogLabel.setTitleLabel(inputLabel); + panel9.add(inputShowDialogLabel, "cell 2 5"); + + //---- inputIconLabel ---- + inputIconLabel.setText("Input + icon"); + panel9.add(inputIconLabel, "cell 0 6"); + + //======== panel8 ======== + { + panel8.setBorder(LineBorder.createGrayLineBorder()); + panel8.setLayout(new BorderLayout()); + + //---- inputIconOptionPane ---- + inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + inputIconOptionPane.setWantsInput(true); + inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputIconOptionPane.setMessage("Enter something:"); + panel8.add(inputIconOptionPane, BorderLayout.CENTER); + } + panel9.add(panel8, "cell 1 6"); + + //---- inputIconShowDialogLabel ---- + inputIconShowDialogLabel.setTitleLabel(inputIconLabel); + inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); + panel9.add(inputIconShowDialogLabel, "cell 2 6"); + + //---- customLabel ---- + customLabel.setText("Custom"); + panel9.add(customLabel, "cell 0 7"); + + //======== panel6 ======== + { + panel6.setBorder(LineBorder.createGrayLineBorder()); + panel6.setLayout(new BorderLayout()); + + //---- customOptionPane ---- + customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); + panel6.add(customOptionPane, BorderLayout.CENTER); + } + panel9.add(panel6, "cell 1 7"); + + //---- customShowDialogLabel ---- + customShowDialogLabel.setOptionPane(customOptionPane); + customShowDialogLabel.setTitleLabel(customLabel); + panel9.add(customShowDialogLabel, "cell 2 7"); } - panel9.add(panel1, "cell 1 0"); - - //---- plainShowDialogLabel ---- - plainShowDialogLabel.setOptionPane(plainOptionPane); - plainShowDialogLabel.setTitleLabel(plainLabel); - panel9.add(plainShowDialogLabel, "cell 2 0"); - - //---- errorLabel ---- - errorLabel.setText("Error"); - panel9.add(errorLabel, "cell 0 1"); - - //======== panel2 ======== - { - panel2.setBorder(LineBorder.createGrayLineBorder()); - panel2.setLayout(new BorderLayout()); - - //---- errorOptionPane ---- - errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); - errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); - panel2.add(errorOptionPane, BorderLayout.CENTER); - } - panel9.add(panel2, "cell 1 1"); - - //---- errorShowDialogLabel ---- - errorShowDialogLabel.setTitleLabel(errorLabel); - errorShowDialogLabel.setOptionPane(errorOptionPane); - panel9.add(errorShowDialogLabel, "cell 2 1"); - - //---- informationLabel ---- - informationLabel.setText("Information"); - panel9.add(informationLabel, "cell 0 2"); - - //======== panel3 ======== - { - panel3.setBorder(LineBorder.createGrayLineBorder()); - panel3.setLayout(new BorderLayout()); - - //---- informationOptionPane ---- - informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); - informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); - panel3.add(informationOptionPane, BorderLayout.CENTER); - } - panel9.add(panel3, "cell 1 2"); - - //---- informationShowDialogLabel ---- - informationShowDialogLabel.setOptionPane(informationOptionPane); - informationShowDialogLabel.setTitleLabel(informationLabel); - panel9.add(informationShowDialogLabel, "cell 2 2"); - - //---- questionLabel ---- - questionLabel.setText("Question"); - panel9.add(questionLabel, "cell 0 3"); - - //======== panel4 ======== - { - panel4.setBorder(LineBorder.createGrayLineBorder()); - panel4.setLayout(new BorderLayout()); - - //---- questionOptionPane ---- - questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); - questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); - questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); - panel4.add(questionOptionPane, BorderLayout.CENTER); - } - panel9.add(panel4, "cell 1 3"); - - //---- questionShowDialogLabel ---- - questionShowDialogLabel.setOptionPane(questionOptionPane); - questionShowDialogLabel.setTitleLabel(questionLabel); - panel9.add(questionShowDialogLabel, "cell 2 3"); - - //---- warningLabel ---- - warningLabel.setText("Warning"); - panel9.add(warningLabel, "cell 0 4"); - - //======== panel5 ======== - { - panel5.setBorder(LineBorder.createGrayLineBorder()); - panel5.setLayout(new BorderLayout()); - - //---- warningOptionPane ---- - warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); - warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); - panel5.add(warningOptionPane, BorderLayout.CENTER); - } - panel9.add(panel5, "cell 1 4"); - - //---- warningShowDialogLabel ---- - warningShowDialogLabel.setOptionPane(warningOptionPane); - warningShowDialogLabel.setTitleLabel(warningLabel); - panel9.add(warningShowDialogLabel, "cell 2 4"); - - //---- inputLabel ---- - inputLabel.setText("Input"); - panel9.add(inputLabel, "cell 0 5"); - - //======== panel7 ======== - { - panel7.setBorder(LineBorder.createGrayLineBorder()); - panel7.setLayout(new BorderLayout()); - - //---- inputOptionPane ---- - inputOptionPane.setWantsInput(true); - inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputOptionPane.setMessage("Enter whatever you want:"); - panel7.add(inputOptionPane, BorderLayout.CENTER); - } - panel9.add(panel7, "cell 1 5"); - - //---- inputShowDialogLabel ---- - inputShowDialogLabel.setOptionPane(inputOptionPane); - inputShowDialogLabel.setTitleLabel(inputLabel); - panel9.add(inputShowDialogLabel, "cell 2 5"); - - //---- inputIconLabel ---- - inputIconLabel.setText("Input + icon"); - panel9.add(inputIconLabel, "cell 0 6"); - - //======== panel8 ======== - { - panel8.setBorder(LineBorder.createGrayLineBorder()); - panel8.setLayout(new BorderLayout()); - - //---- inputIconOptionPane ---- - inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - inputIconOptionPane.setWantsInput(true); - inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputIconOptionPane.setMessage("Enter something:"); - panel8.add(inputIconOptionPane, BorderLayout.CENTER); - } - panel9.add(panel8, "cell 1 6"); - - //---- inputIconShowDialogLabel ---- - inputIconShowDialogLabel.setTitleLabel(inputIconLabel); - inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); - panel9.add(inputIconShowDialogLabel, "cell 2 6"); - - //---- customLabel ---- - customLabel.setText("Custom"); - panel9.add(customLabel, "cell 0 7"); - - //======== panel6 ======== - { - panel6.setBorder(LineBorder.createGrayLineBorder()); - panel6.setLayout(new BorderLayout()); - - //---- customOptionPane ---- - customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); - panel6.add(customOptionPane, BorderLayout.CENTER); - } - panel9.add(panel6, "cell 1 7"); - - //---- customShowDialogLabel ---- - customShowDialogLabel.setOptionPane(customOptionPane); - customShowDialogLabel.setTitleLabel(customLabel); - panel9.add(customShowDialogLabel, "cell 2 7"); + scrollPane1.setViewportView(panel9); } - setViewportView(panel9); + add(scrollPane1, BorderLayout.CENTER); // JFormDesigner - End of component initialization //GEN-END:initComponents } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd index b0408f95..23905510 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/OptionPanePanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -6,244 +6,249 @@ new FormModel { auxiliary() { "JavaCodeGenerator.defaultVariableLocal": true } - add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { name: "this" - "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) - add( new FormContainer( "com.formdev.flatlaf.demo.ScrollablePanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "flowy,hidemode 3" - "$columnConstraints": "[][][fill]" - "$rowConstraints": "[top][top][top][top][top][top][top][top]" - } ) { - name: "panel9" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "plainLabel" - "text": "Plain" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel1" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "plainOptionPane" - "message": "Hello world." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + name: "scrollPane1" + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormContainer( "com.formdev.flatlaf.demo.ScrollablePanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "flowy,insets dialog,hidemode 3" + "$columnConstraints": "[][][fill]" + "$rowConstraints": "[top][top][top][top][top][top][top][top]" + } ) { + name: "panel9" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "plainLabel" + "text": "Plain" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "plainShowDialogLabel" - "optionPane": new FormReference( "plainOptionPane" ) - "titleLabel": new FormReference( "plainLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "errorLabel" - "text": "Error" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel2" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "errorOptionPane" - "messageType": 0 - "optionType": 2 - "message": "Your PC ran into a problem. Buy a new one." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel1" + "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "plainOptionPane" + "message": "Hello world." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "errorShowDialogLabel" - "titleLabel": new FormReference( "errorLabel" ) - "optionPane": new FormReference( "errorOptionPane" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "informationLabel" - "text": "Information" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel3" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "informationOptionPane" - "messageType": 1 - "optionType": 0 - "message": "Text with\nmultiple lines\n(use \\n to separate lines)" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "informationShowDialogLabel" - "optionPane": new FormReference( "informationOptionPane" ) - "titleLabel": new FormReference( "informationLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "questionLabel" - "text": "Question" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 3" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel4" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "questionOptionPane" - "messageType": 3 - "optionType": 1 - "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "questionShowDialogLabel" - "optionPane": new FormReference( "questionOptionPane" ) - "titleLabel": new FormReference( "questionLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 3" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "warningLabel" - "text": "Warning" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 4" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel5" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "warningOptionPane" - "messageType": 2 - "optionType": 2 - "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 4" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "warningShowDialogLabel" - "optionPane": new FormReference( "warningOptionPane" ) - "titleLabel": new FormReference( "warningLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 4" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputLabel" - "text": "Input" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 5" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel7" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputOptionPane" - "wantsInput": true - "optionType": 2 - "message": "Enter whatever you want:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 5" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "inputShowDialogLabel" - "optionPane": new FormReference( "inputOptionPane" ) - "titleLabel": new FormReference( "inputLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 5" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputIconLabel" - "text": "Input + icon" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 6" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel8" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputIconOptionPane" - "messageType": 1 - "wantsInput": true - "optionType": 2 - "message": "Enter something:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 6" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "inputIconShowDialogLabel" - "titleLabel": new FormReference( "inputIconLabel" ) - "optionPane": new FormReference( "inputIconOptionPane" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 6" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "customLabel" - "text": "Custom" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 7" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel6" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "customOptionPane" - "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "plainShowDialogLabel" + "optionPane": new FormReference( "plainOptionPane" ) + "titleLabel": new FormReference( "plainLabel" ) auxiliary() { "JavaCodeGenerator.variableLocal": false } - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "errorLabel" + "text": "Error" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel2" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "errorOptionPane" + "messageType": 0 + "optionType": 2 + "message": "Your PC ran into a problem. Buy a new one." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "errorShowDialogLabel" + "titleLabel": new FormReference( "errorLabel" ) + "optionPane": new FormReference( "errorOptionPane" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "informationLabel" + "text": "Information" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel3" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "informationOptionPane" + "messageType": 1 + "optionType": 0 + "message": "Text with\nmultiple lines\n(use \\n to separate lines)" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "informationShowDialogLabel" + "optionPane": new FormReference( "informationOptionPane" ) + "titleLabel": new FormReference( "informationLabel" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "questionLabel" + "text": "Question" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel4" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "questionOptionPane" + "messageType": 3 + "optionType": 1 + "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "questionShowDialogLabel" + "optionPane": new FormReference( "questionOptionPane" ) + "titleLabel": new FormReference( "questionLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "warningLabel" + "text": "Warning" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel5" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "warningOptionPane" + "messageType": 2 + "optionType": 2 + "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "warningShowDialogLabel" + "optionPane": new FormReference( "warningOptionPane" ) + "titleLabel": new FormReference( "warningLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputLabel" + "text": "Input" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel7" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputOptionPane" + "wantsInput": true + "optionType": 2 + "message": "Enter whatever you want:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "inputShowDialogLabel" + "optionPane": new FormReference( "inputOptionPane" ) + "titleLabel": new FormReference( "inputLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputIconLabel" + "text": "Input + icon" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel8" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputIconOptionPane" + "messageType": 1 + "wantsInput": true + "optionType": 2 + "message": "Enter something:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "inputIconShowDialogLabel" + "titleLabel": new FormReference( "inputIconLabel" ) + "optionPane": new FormReference( "inputIconOptionPane" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "customLabel" + "text": "Custom" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel6" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "customOptionPane" + "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { + name: "customShowDialogLabel" + "optionPane": new FormReference( "customOptionPane" ) + "titleLabel": new FormReference( "customLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 7" - } ) - add( new FormComponent( "com.formdev.flatlaf.demo.OptionPanePanel$ShowDialogLinkLabel" ) { - name: "customShowDialogLabel" - "optionPane": new FormReference( "customOptionPane" ) - "titleLabel": new FormReference( "customLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 7" } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 840 ) + "size": new java.awt.Dimension( 840, 900 ) } ) } } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.java index aa78d0c3..5e4bed57 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.java @@ -1,15 +1,30 @@ /* - * Created by JFormDesigner on Tue Aug 27 21:47:02 CEST 2019 + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.formdev.flatlaf.demo; -import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER; -import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_SHOW_TAB_SEPARATORS; +import static com.formdev.flatlaf.FlatClientProperties.*; import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.function.BiConsumer; +import java.util.function.Consumer; import javax.swing.*; import javax.swing.border.*; -import com.jgoodies.forms.layout.*; +import com.formdev.flatlaf.extras.FlatSVGIcon; +import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon; import net.miginfocom.swing.*; /** @@ -20,323 +35,781 @@ class TabsPanel { TabsPanel() { initComponents(); + + initTabPlacementTabs( tabPlacementTabbedPane ); + + initScrollLayoutTabs( scrollLayoutTabbedPane ); + initWrapLayoutTabs( wrapLayoutTabbedPane ); + + initClosableTabs( closableTabsTabbedPane ); + + initCustomComponentsTabs( customComponentsTabbedPane ); + + initMinimumTabWidth( minimumTabWidthTabbedPane ); + initMaximumTabWidth( maximumTabWidthTabbedPane ); + + initTabIconPlacement( iconTopTabbedPane, SwingConstants.TOP ); + initTabIconPlacement( iconBottomTabbedPane, SwingConstants.BOTTOM ); + initTabIconPlacement( iconLeadingTabbedPane, SwingConstants.LEADING ); + initTabIconPlacement( iconTrailingTabbedPane, SwingConstants.TRAILING ); + + initTabAreaAlignment( alignLeadingTabbedPane, TABBED_PANE_TAB_AREA_ALIGN_LEADING ); + initTabAreaAlignment( alignCenterTabbedPane, TABBED_PANE_TAB_AREA_ALIGN_CENTER ); + initTabAreaAlignment( alignTrailingTabbedPane, TABBED_PANE_TAB_AREA_ALIGN_TRAILING ); + initTabAreaAlignment( alignFillTabbedPane, TABBED_PANE_TAB_AREA_ALIGN_FILL ); + + initTabWidthMode( widthPreferredTabbedPane, TABBED_PANE_TAB_WIDTH_MODE_PREFERRED ); + initTabWidthMode( widthEqualTabbedPane, TABBED_PANE_TAB_WIDTH_MODE_EQUAL ); + initTabWidthMode( widthCompactTabbedPane, TABBED_PANE_TAB_WIDTH_MODE_COMPACT ); } - private void tabScrollChanged() { - int tabLayoutPolicy = tabScrollCheckBox.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT; - tabbedPane1.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane2.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane3.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane4.setTabLayoutPolicy( tabLayoutPolicy ); + private void initTabPlacementTabs( JTabbedPane tabbedPane ) { + addTab( tabbedPane, "Tab 1", "tab content 1" ); + + JComponent tab2 = createTab( "tab content 2" ); + tab2.setBorder( new LineBorder( Color.magenta ) ); + tabbedPane.addTab( "Second Tab", tab2 ); + + addTab( tabbedPane, "Disabled", "tab content 3" ); + tabbedPane.setEnabledAt( 2, false ); + } + + private void addTab( JTabbedPane tabbedPane, String title, String text ) { + tabbedPane.addTab( title, createTab( text ) ); + } + + private JComponent createTab( String text ) { + JLabel label = new JLabel( text ); + label.setHorizontalAlignment( SwingConstants.CENTER ); + + JPanel tab = new JPanel( new BorderLayout() ); + tab.add( label, BorderLayout.CENTER ); + return tab; + } + + private void tabPlacementChanged() { + int tabPlacement = JTabbedPane.TOP; + if( bottomPlacementButton.isSelected() ) + tabPlacement = JTabbedPane.BOTTOM; + else if( leftPlacementButton.isSelected() ) + tabPlacement = JTabbedPane.LEFT; + else if( rightPlacementButton.isSelected() ) + tabPlacement = JTabbedPane.RIGHT; + + tabPlacementTabbedPane.setTabPlacement( tabPlacement ); + } + + private void scrollChanged() { + boolean scroll = scrollButton.isSelected(); + tabPlacementTabbedPane.setTabLayoutPolicy( scroll ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT ); + + int extraTabCount = 7; + if( scroll ) { + int tabCount = tabPlacementTabbedPane.getTabCount(); + for( int i = tabCount + 1; i <= tabCount + extraTabCount; i++ ) + addTab( tabPlacementTabbedPane, "Tab " + i, "tab content " + i ); + } else { + for( int i = 0; i < extraTabCount; i++ ) + tabPlacementTabbedPane.removeTabAt( tabPlacementTabbedPane.getTabCount() - 1 ); + } + } + + private void borderChanged() { + Boolean hasFullBorder = borderButton.isSelected() ? true : null; + tabPlacementTabbedPane.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + } + + private void initScrollLayoutTabs( JTabbedPane tabbedPane ) { + tabbedPane.setTabLayoutPolicy( JTabbedPane.SCROLL_TAB_LAYOUT ); + addDefaultTabsNoContent( tabbedPane, 9 ); + } + + private void initWrapLayoutTabs( JTabbedPane tabbedPane ) { + tabbedPane.setTabLayoutPolicy( JTabbedPane.WRAP_TAB_LAYOUT ); + addDefaultTabsNoContent( tabbedPane, 9 ); + + wrapLayoutTabbedPane.setVisible( false ); + wrapLayoutNoteLabel.setVisible( false ); + } + + private void tabLayoutChanged() { + boolean scroll = scrollTabLayoutButton.isSelected(); + + scrollLayoutTabbedPane.setVisible( scroll ); + scrollLayoutNoteLabel.setVisible( scroll ); + wrapLayoutTabbedPane.setVisible( !scroll ); + wrapLayoutNoteLabel.setVisible( !scroll ); + } + + private void initClosableTabs( JTabbedPane tabbedPane ) { + tabbedPane.putClientProperty( TABBED_PANE_TAB_CLOSABLE, true ); + tabbedPane.putClientProperty( TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT, "Close" ); + tabbedPane.putClientProperty( TABBED_PANE_TAB_CLOSE_CALLBACK, + (BiConsumer) (tabPane, tabIndex) -> { + AWTEvent e = EventQueue.getCurrentEvent(); + int modifiers = (e instanceof MouseEvent) ? ((MouseEvent)e).getModifiers() : 0; + JOptionPane.showMessageDialog( this, "Closed tab '" + tabPane.getTitleAt( tabIndex ) + "'." + + "\n\n(modifiers: " + MouseEvent.getMouseModifiersText( modifiers ) + ")", + "Tab Closed", JOptionPane.PLAIN_MESSAGE ); + } ); + + addDefaultTabsNoContent( tabbedPane, 3 ); + } + + private void initCustomComponentsTabs( JTabbedPane tabbedPane ) { + addDefaultTabsNoContent( tabbedPane, 3 ); + customComponentsChanged(); + } + + private void customComponentsChanged() { + JComponent leading = null; + JComponent trailing = null; + if( leadingComponentButton.isSelected() ) { + leading = new JLabel( "Leading" ); + leading.setOpaque( true ); + leading.setBackground( new Color( UIManager.getColor( "Objects.Green" ).getRGB() ) ); + leading.setForeground( Color.black ); + leading.setBorder( new EmptyBorder( 4, 4, 4, 4 ) ); + } + if( trailingComponentButton.isSelected() ) { + trailing = new JLabel( "Trailing" ); + trailing.setOpaque( true ); + trailing.setBackground( new Color( UIManager.getColor( "Objects.Purple" ).getRGB() ) ); + trailing.setForeground( Color.black ); + trailing.setBorder( new EmptyBorder( 4, 4, 4, 4 ) ); + } + customComponentsTabbedPane.putClientProperty( TABBED_PANE_LEADING_COMPONENT, leading ); + customComponentsTabbedPane.putClientProperty( TABBED_PANE_TRAILING_COMPONENT, trailing ); + } + + private void addDefaultTabsNoContent( JTabbedPane tabbedPane, int count ) { + tabbedPane.addTab( "Tab 1", null ); + tabbedPane.addTab( "Second Tab", null ); + if( count >= 3 ) + tabbedPane.addTab( "3rd Tab", null ); + + for( int i = 4; i <= count; i++ ) + tabbedPane.addTab( "Tab " + i, null ); + } + + private void closeButtonStyleChanged() { + // WARNING: + // Do not use this trick to style individual tabbed panes in own code. + // Instead use one styling for all tabbed panes in your application. + if( circleCloseButton.isSelected() ) { + UIManager.put( "TabbedPane.closeArc", 999 ); + UIManager.put( "TabbedPane.closeCrossFilledSize", 5.5f ); + UIManager.put( "TabbedPane.closeIcon", new FlatTabbedPaneCloseIcon() ); + closableTabsTabbedPane.updateUI(); + UIManager.put( "TabbedPane.closeArc", null ); + UIManager.put( "TabbedPane.closeCrossFilledSize", null ); + UIManager.put( "TabbedPane.closeIcon", null ); + } else if( redCrossCloseButton.isSelected() ) { + UIManager.put( "TabbedPane.closeHoverForeground", Color.red ); + UIManager.put( "TabbedPane.closePressedForeground", Color.red ); + UIManager.put( "TabbedPane.closeHoverBackground", new Color( 0, true ) ); + UIManager.put( "TabbedPane.closeIcon", new FlatTabbedPaneCloseIcon() ); + closableTabsTabbedPane.updateUI(); + UIManager.put( "TabbedPane.closeHoverForeground", null ); + UIManager.put( "TabbedPane.closePressedForeground", null ); + UIManager.put( "TabbedPane.closeHoverBackground", null ); + UIManager.put( "TabbedPane.closeIcon", null ); + } else + closableTabsTabbedPane.updateUI(); + } + + private void initTabIconPlacement( JTabbedPane tabbedPane, int iconPlacement ) { + boolean topOrBottom = (iconPlacement == SwingConstants.TOP || iconPlacement == SwingConstants.BOTTOM); + int iconSize = topOrBottom ? 24 : 16; + tabbedPane.putClientProperty( TABBED_PANE_TAB_ICON_PLACEMENT, iconPlacement ); + if( topOrBottom ) { + tabbedPane.putClientProperty( TABBED_PANE_TAB_AREA_ALIGNMENT, TABBED_PANE_TAB_AREA_ALIGN_FILL ); + tabbedPane.putClientProperty( TABBED_PANE_TAB_WIDTH_MODE, TABBED_PANE_TAB_WIDTH_MODE_EQUAL ); + } + tabbedPane.addTab( "Search", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/search.svg", iconSize, iconSize ), null ); + tabbedPane.addTab( "Recents", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/RecentlyUsed.svg", iconSize, iconSize ), null ); + if( topOrBottom ) + tabbedPane.addTab( "Favorites", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/favorite.svg", iconSize, iconSize ), null ); + } + + private void initTabAreaAlignment( JTabbedPane tabbedPane, String tabAreaAlignment ) { + tabbedPane.putClientProperty( TABBED_PANE_TAB_AREA_ALIGNMENT, tabAreaAlignment ); + tabbedPane.addTab( "Search", null ); + tabbedPane.addTab( "Recents", null ); + } + + private void initTabWidthMode( JTabbedPane tabbedPane, String tabWidthMode ) { + tabbedPane.putClientProperty( TABBED_PANE_TAB_WIDTH_MODE, tabWidthMode ); + if( tabWidthMode.equals( TABBED_PANE_TAB_WIDTH_MODE_COMPACT ) ) { + tabbedPane.addTab( "Search", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/search.svg", 16, 16 ), null ); + tabbedPane.addTab( "Recents", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/RecentlyUsed.svg", 16, 16 ), null ); + tabbedPane.addTab( "Favorites", new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/favorite.svg", 16, 16 ), null ); + } else { + tabbedPane.addTab( "Short", null ); + tabbedPane.addTab( "Longer Title", null ); + } + } + + private void initMinimumTabWidth( JTabbedPane tabbedPane ) { + tabbedPane.putClientProperty( TABBED_PANE_MINIMUM_TAB_WIDTH, 80 ); + tabbedPane.addTab( "A", null ); + tabbedPane.addTab( "Very long title", null ); + } + + private void initMaximumTabWidth( JTabbedPane tabbedPane ) { + tabbedPane.putClientProperty( TABBED_PANE_MAXIMUM_TAB_WIDTH, 80 ); + tabbedPane.addTab( "Very long title", null ); + tabbedPane.addTab( "B", null ); + tabbedPane.addTab( "C", null ); } private void showTabSeparatorsChanged() { Boolean showTabSeparators = showTabSeparatorsCheckBox.isSelected() ? true : null; - tabbedPane1.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane2.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane3.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane4.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); + putTabbedPanesClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); } - private void hasFullBorderChanged() { - Boolean hasFullBorder = hasFullBorderCheckBox.isSelected() ? true : null; - tabbedPane1.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane2.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane3.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane4.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + private void putTabbedPanesClientProperty( String key, Object value ) { + updateTabbedPanesRecur( this, tabbedPane -> tabbedPane.putClientProperty( key, value ) ); } - private void moreTabsChanged() { - boolean moreTabs = moreTabsCheckBox.isSelected(); - addRemoveMoreTabs( tabbedPane1, moreTabs ); - addRemoveMoreTabs( tabbedPane2, moreTabs ); - addRemoveMoreTabs( tabbedPane3, moreTabs ); - addRemoveMoreTabs( tabbedPane4, moreTabs ); - } - - private void addRemoveMoreTabs( JTabbedPane tabbedPane, boolean add ) { - if( add ) { - tabbedPane.addTab( "Tab 4", new JLabel( "tab 4" ) ); - tabbedPane.addTab( "Tab 5", new JLabel( "tab 5" ) ); - tabbedPane.addTab( "Tab 6", new JLabel( "tab 6" ) ); - tabbedPane.addTab( "Tab 7", new JLabel( "tab 7" ) ); - tabbedPane.addTab( "Tab 8", new JLabel( "tab 8" ) ); - } else { - int tabCount = tabbedPane.getTabCount(); - if( tabCount > 3 ) { - for( int i = 0; i < 5; i++ ) - tabbedPane.removeTabAt( tabbedPane.getTabCount() - 1 ); + private void updateTabbedPanesRecur( Container container, Consumer action ) { + for( Component c : container.getComponents() ) { + if( c instanceof JTabbedPane ) { + JTabbedPane tabPane = (JTabbedPane)c; + action.accept( tabPane ); } + + if( c instanceof Container ) + updateTabbedPanesRecur( (Container) c, action ); } } private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents - JPanel panel9 = new JPanel(); - JLabel splitPaneLabel = new JLabel(); - JSplitPane splitPane3 = new JSplitPane(); - JSplitPane splitPane1 = new JSplitPane(); - JPanel panel10 = new JPanel(); - JPanel panel11 = new JPanel(); - JSplitPane splitPane2 = new JSplitPane(); - JPanel panel12 = new JPanel(); - JPanel panel13 = new JPanel(); - JLabel tabbedPaneLabel = new JLabel(); - tabbedPane1 = new JTabbedPane(); JPanel panel1 = new JPanel(); - JLabel label1 = new JLabel(); + JLabel tabPlacementLabel = new JLabel(); + tabPlacementToolBar = new JToolBar(); + topPlacementButton = new JToggleButton(); + bottomPlacementButton = new JToggleButton(); + leftPlacementButton = new JToggleButton(); + rightPlacementButton = new JToggleButton(); + scrollButton = new JToggleButton(); + borderButton = new JToggleButton(); + tabPlacementTabbedPane = new JTabbedPane(); + JLabel tabLayoutLabel = new JLabel(); + tabLayoutToolBar = new JToolBar(); + scrollTabLayoutButton = new JToggleButton(); + wrapTabLayoutButton = new JToggleButton(); + scrollLayoutNoteLabel = new JLabel(); + wrapLayoutNoteLabel = new JLabel(); + scrollLayoutTabbedPane = new JTabbedPane(); + wrapLayoutTabbedPane = new JTabbedPane(); + JLabel closableTabsLabel = new JLabel(); + closableTabsToolBar = new JToolBar(); + squareCloseButton = new JToggleButton(); + circleCloseButton = new JToggleButton(); + redCrossCloseButton = new JToggleButton(); + closableTabsTabbedPane = new JTabbedPane(); + JLabel tabAreaComponentsLabel = new JLabel(); + tabAreaComponentsToolBar = new JToolBar(); + leadingComponentButton = new JToggleButton(); + trailingComponentButton = new JToggleButton(); + customComponentsTabbedPane = new JTabbedPane(); JPanel panel2 = new JPanel(); - JLabel label2 = new JLabel(); - tabbedPane3 = new JTabbedPane(); - JPanel panel5 = new JPanel(); - JLabel label5 = new JLabel(); - JPanel panel6 = new JPanel(); - JLabel label6 = new JLabel(); - tabbedPane2 = new JTabbedPane(); + JLabel tabIconPlacementLabel = new JLabel(); + JLabel tabIconPlacementNodeLabel = new JLabel(); + iconTopTabbedPane = new JTabbedPane(); + iconBottomTabbedPane = new JTabbedPane(); + iconLeadingTabbedPane = new JTabbedPane(); + iconTrailingTabbedPane = new JTabbedPane(); + JLabel tabAreaAlignmentLabel = new JLabel(); + JLabel tabAreaAlignmentNoteLabel = new JLabel(); + alignLeadingTabbedPane = new JTabbedPane(); + alignCenterTabbedPane = new JTabbedPane(); + alignTrailingTabbedPane = new JTabbedPane(); + alignFillTabbedPane = new JTabbedPane(); JPanel panel3 = new JPanel(); - JLabel label3 = new JLabel(); + JLabel tabWidthModeLabel = new JLabel(); + JLabel tabWidthModeNoteLabel = new JLabel(); + widthPreferredTabbedPane = new JTabbedPane(); + widthEqualTabbedPane = new JTabbedPane(); + widthCompactTabbedPane = new JTabbedPane(); + JLabel minMaxTabWidthLabel = new JLabel(); + minimumTabWidthTabbedPane = new JTabbedPane(); + maximumTabWidthTabbedPane = new JTabbedPane(); JPanel panel4 = new JPanel(); - JLabel label4 = new JLabel(); - tabbedPane4 = new JTabbedPane(); - JPanel panel7 = new JPanel(); - JLabel label7 = new JLabel(); - JPanel panel8 = new JPanel(); - JLabel label8 = new JLabel(); - JPanel panel14 = new JPanel(); - moreTabsCheckBox = new JCheckBox(); - tabScrollCheckBox = new JCheckBox(); showTabSeparatorsCheckBox = new JCheckBox(); - hasFullBorderCheckBox = new JCheckBox(); - CellConstraints cc = new CellConstraints(); //======== this ======== + setName("this"); setLayout(new MigLayout( - "hidemode 3", + "insets dialog,hidemode 3", // columns - "[grow,fill]", + "[grow,fill]para" + + "[fill]para" + + "[fill]", // rows - "[grow,fill]")); + "[grow,fill]" + + "[]")); - //======== panel9 ======== + //======== panel1 ======== { - panel9.setLayout(new FormLayout( - "70dlu:grow, $lcgap, 70dlu:grow", - "default, $lgap, fill:70dlu, $lgap, pref, 2*($lgap, fill:70dlu:grow), $lgap, pref")); + panel1.setName("panel1"); + panel1.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[grow,fill]", + // rows + "[]" + + "[fill]para" + + "[]0" + + "[]" + + "[]para" + + "[]" + + "[]para" + + "[]" + + "[]")); - //---- splitPaneLabel ---- - splitPaneLabel.setText("JSplitPane:"); - panel9.add(splitPaneLabel, cc.xy(1, 1)); + //---- tabPlacementLabel ---- + tabPlacementLabel.setText("Tab placement"); + tabPlacementLabel.setFont(tabPlacementLabel.getFont().deriveFont(tabPlacementLabel.getFont().getSize() + 4f)); + tabPlacementLabel.setName("tabPlacementLabel"); + panel1.add(tabPlacementLabel, "cell 0 0"); - //======== splitPane3 ======== + //======== tabPlacementToolBar ======== { - splitPane3.setResizeWeight(0.5); + tabPlacementToolBar.setFloatable(false); + tabPlacementToolBar.setBorder(BorderFactory.createEmptyBorder()); + tabPlacementToolBar.setName("tabPlacementToolBar"); - //======== splitPane1 ======== - { - splitPane1.setResizeWeight(0.5); - splitPane1.setOneTouchExpandable(true); + //---- topPlacementButton ---- + topPlacementButton.setText("top"); + topPlacementButton.setSelected(true); + topPlacementButton.setFont(topPlacementButton.getFont().deriveFont(topPlacementButton.getFont().getSize() - 2f)); + topPlacementButton.setName("topPlacementButton"); + topPlacementButton.addActionListener(e -> tabPlacementChanged()); + tabPlacementToolBar.add(topPlacementButton); - //======== panel10 ======== - { - panel10.setBackground(Color.orange); - panel10.setLayout(new FlowLayout()); - } - splitPane1.setLeftComponent(panel10); + //---- bottomPlacementButton ---- + bottomPlacementButton.setText("bottom"); + bottomPlacementButton.setFont(bottomPlacementButton.getFont().deriveFont(bottomPlacementButton.getFont().getSize() - 2f)); + bottomPlacementButton.setName("bottomPlacementButton"); + bottomPlacementButton.addActionListener(e -> tabPlacementChanged()); + tabPlacementToolBar.add(bottomPlacementButton); - //======== panel11 ======== - { - panel11.setBackground(Color.magenta); - panel11.setLayout(new FlowLayout()); - } - splitPane1.setRightComponent(panel11); - } - splitPane3.setLeftComponent(splitPane1); + //---- leftPlacementButton ---- + leftPlacementButton.setText("left"); + leftPlacementButton.setFont(leftPlacementButton.getFont().deriveFont(leftPlacementButton.getFont().getSize() - 2f)); + leftPlacementButton.setName("leftPlacementButton"); + leftPlacementButton.addActionListener(e -> tabPlacementChanged()); + tabPlacementToolBar.add(leftPlacementButton); - //======== splitPane2 ======== - { - splitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); - splitPane2.setResizeWeight(0.5); - splitPane2.setOneTouchExpandable(true); + //---- rightPlacementButton ---- + rightPlacementButton.setText("right"); + rightPlacementButton.setFont(rightPlacementButton.getFont().deriveFont(rightPlacementButton.getFont().getSize() - 2f)); + rightPlacementButton.setName("rightPlacementButton"); + rightPlacementButton.addActionListener(e -> tabPlacementChanged()); + tabPlacementToolBar.add(rightPlacementButton); + tabPlacementToolBar.addSeparator(); - //======== panel12 ======== - { - panel12.setBackground(Color.orange); - panel12.setLayout(new FlowLayout()); - } - splitPane2.setTopComponent(panel12); + //---- scrollButton ---- + scrollButton.setText("scroll"); + scrollButton.setFont(scrollButton.getFont().deriveFont(scrollButton.getFont().getSize() - 2f)); + scrollButton.setName("scrollButton"); + scrollButton.addActionListener(e -> scrollChanged()); + tabPlacementToolBar.add(scrollButton); - //======== panel13 ======== - { - panel13.setBackground(Color.magenta); - panel13.setLayout(new FlowLayout()); - } - splitPane2.setBottomComponent(panel13); - } - splitPane3.setRightComponent(splitPane2); + //---- borderButton ---- + borderButton.setText("border"); + borderButton.setFont(borderButton.getFont().deriveFont(borderButton.getFont().getSize() - 2f)); + borderButton.setName("borderButton"); + borderButton.addActionListener(e -> borderChanged()); + tabPlacementToolBar.add(borderButton); } - panel9.add(splitPane3, cc.xywh(1, 3, 3, 1)); + panel1.add(tabPlacementToolBar, "cell 0 0,alignx right,growx 0"); - //---- tabbedPaneLabel ---- - tabbedPaneLabel.setText("JTabbedPane:"); - panel9.add(tabbedPaneLabel, cc.xy(1, 5)); - - //======== tabbedPane1 ======== + //======== tabPlacementTabbedPane ======== { - - //======== panel1 ======== - { - panel1.setLayout(new FlowLayout()); - - //---- label1 ---- - label1.setText("TOP"); - panel1.add(label1); - } - tabbedPane1.addTab("Tab 1", panel1); - - //======== panel2 ======== - { - panel2.setBorder(new LineBorder(Color.magenta)); - panel2.setLayout(new FlowLayout()); - } - tabbedPane1.addTab("Tab 2", panel2); - - //---- label2 ---- - label2.setText("text"); - tabbedPane1.addTab("Tab 3", label2); + tabPlacementTabbedPane.setName("tabPlacementTabbedPane"); } - panel9.add(tabbedPane1, cc.xy(1, 7)); + panel1.add(tabPlacementTabbedPane, "cell 0 1,width 300:300,height 100:100"); - //======== tabbedPane3 ======== + //---- tabLayoutLabel ---- + tabLayoutLabel.setText("Tab layout"); + tabLayoutLabel.setFont(tabLayoutLabel.getFont().deriveFont(tabLayoutLabel.getFont().getSize() + 4f)); + tabLayoutLabel.setName("tabLayoutLabel"); + panel1.add(tabLayoutLabel, "cell 0 2"); + + //======== tabLayoutToolBar ======== { - tabbedPane3.setTabPlacement(SwingConstants.LEFT); + tabLayoutToolBar.setFloatable(false); + tabLayoutToolBar.setBorder(BorderFactory.createEmptyBorder()); + tabLayoutToolBar.setName("tabLayoutToolBar"); - //======== panel5 ======== - { - panel5.setLayout(new FlowLayout()); + //---- scrollTabLayoutButton ---- + scrollTabLayoutButton.setText("scroll"); + scrollTabLayoutButton.setFont(scrollTabLayoutButton.getFont().deriveFont(scrollTabLayoutButton.getFont().getSize() - 2f)); + scrollTabLayoutButton.setSelected(true); + scrollTabLayoutButton.setName("scrollTabLayoutButton"); + scrollTabLayoutButton.addActionListener(e -> tabLayoutChanged()); + tabLayoutToolBar.add(scrollTabLayoutButton); - //---- label5 ---- - label5.setText("LEFT"); - panel5.add(label5); - } - tabbedPane3.addTab("Tab 1", panel5); - - //======== panel6 ======== - { - panel6.setBorder(new LineBorder(Color.magenta)); - panel6.setLayout(new FlowLayout()); - } - tabbedPane3.addTab("Tab 2", panel6); - - //---- label6 ---- - label6.setText("text"); - tabbedPane3.addTab("Tab 3", label6); + //---- wrapTabLayoutButton ---- + wrapTabLayoutButton.setText("wrap"); + wrapTabLayoutButton.setFont(wrapTabLayoutButton.getFont().deriveFont(wrapTabLayoutButton.getFont().getSize() - 2f)); + wrapTabLayoutButton.setName("wrapTabLayoutButton"); + wrapTabLayoutButton.addActionListener(e -> tabLayoutChanged()); + tabLayoutToolBar.add(wrapTabLayoutButton); } - panel9.add(tabbedPane3, cc.xy(3, 7)); + panel1.add(tabLayoutToolBar, "cell 0 2,alignx right,growx 0"); - //======== tabbedPane2 ======== + //---- scrollLayoutNoteLabel ---- + scrollLayoutNoteLabel.setText("(use mouse wheel to scroll; arrow button shows hidden tabs)"); + scrollLayoutNoteLabel.setEnabled(false); + scrollLayoutNoteLabel.setFont(scrollLayoutNoteLabel.getFont().deriveFont(scrollLayoutNoteLabel.getFont().getSize() - 2f)); + scrollLayoutNoteLabel.setName("scrollLayoutNoteLabel"); + panel1.add(scrollLayoutNoteLabel, "cell 0 3"); + + //---- wrapLayoutNoteLabel ---- + wrapLayoutNoteLabel.setText("(probably better to use scroll layout?)"); + wrapLayoutNoteLabel.setEnabled(false); + wrapLayoutNoteLabel.setFont(wrapLayoutNoteLabel.getFont().deriveFont(wrapLayoutNoteLabel.getFont().getSize() - 2f)); + wrapLayoutNoteLabel.setName("wrapLayoutNoteLabel"); + panel1.add(wrapLayoutNoteLabel, "cell 0 3"); + + //======== scrollLayoutTabbedPane ======== { - tabbedPane2.setTabPlacement(SwingConstants.BOTTOM); - - //======== panel3 ======== - { - panel3.setLayout(new FlowLayout()); - - //---- label3 ---- - label3.setText("BOTTOM"); - panel3.add(label3); - } - tabbedPane2.addTab("Tab 1", panel3); - - //======== panel4 ======== - { - panel4.setBorder(new LineBorder(Color.magenta)); - panel4.setLayout(new FlowLayout()); - } - tabbedPane2.addTab("Tab 2", panel4); - tabbedPane2.setEnabledAt(1, false); - - //---- label4 ---- - label4.setText("text"); - tabbedPane2.addTab("Tab 3", label4); + scrollLayoutTabbedPane.setName("scrollLayoutTabbedPane"); } - panel9.add(tabbedPane2, cc.xy(1, 9)); + panel1.add(scrollLayoutTabbedPane, "cell 0 4"); - //======== tabbedPane4 ======== + //======== wrapLayoutTabbedPane ======== { - tabbedPane4.setTabPlacement(SwingConstants.RIGHT); - - //======== panel7 ======== - { - panel7.setLayout(new FlowLayout()); - - //---- label7 ---- - label7.setText("RIGHT"); - panel7.add(label7); - } - tabbedPane4.addTab("Tab 1", panel7); - - //======== panel8 ======== - { - panel8.setBorder(new LineBorder(Color.magenta)); - panel8.setLayout(new FlowLayout()); - } - tabbedPane4.addTab("Tab 2", panel8); - - //---- label8 ---- - label8.setText("text"); - tabbedPane4.addTab("Tab 3", label8); + wrapLayoutTabbedPane.setName("wrapLayoutTabbedPane"); } - panel9.add(tabbedPane4, cc.xy(3, 9)); + panel1.add(wrapLayoutTabbedPane, "cell 0 4,width 100:100,height pref*2px"); - //======== panel14 ======== + //---- closableTabsLabel ---- + closableTabsLabel.setText("Closable tabs"); + closableTabsLabel.setFont(closableTabsLabel.getFont().deriveFont(closableTabsLabel.getFont().getSize() + 4f)); + closableTabsLabel.setName("closableTabsLabel"); + panel1.add(closableTabsLabel, "cell 0 5"); + + //======== closableTabsToolBar ======== { - panel14.setLayout(new MigLayout( - "insets 0,hidemode 3", - // columns - "[]" + - "[]" + - "[]" + - "[]", - // rows - "[center]")); + closableTabsToolBar.setFloatable(false); + closableTabsToolBar.setBorder(BorderFactory.createEmptyBorder()); + closableTabsToolBar.setName("closableTabsToolBar"); - //---- moreTabsCheckBox ---- - moreTabsCheckBox.setText("more tabs"); - moreTabsCheckBox.setMnemonic('M'); - moreTabsCheckBox.addActionListener(e -> moreTabsChanged()); - panel14.add(moreTabsCheckBox, "cell 0 0"); + //---- squareCloseButton ---- + squareCloseButton.setText("square"); + squareCloseButton.setFont(squareCloseButton.getFont().deriveFont(squareCloseButton.getFont().getSize() - 2f)); + squareCloseButton.setSelected(true); + squareCloseButton.setName("squareCloseButton"); + squareCloseButton.addActionListener(e -> closeButtonStyleChanged()); + closableTabsToolBar.add(squareCloseButton); - //---- tabScrollCheckBox ---- - tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL"); - tabScrollCheckBox.setMnemonic('S'); - tabScrollCheckBox.addActionListener(e -> tabScrollChanged()); - panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0"); + //---- circleCloseButton ---- + circleCloseButton.setText("circle"); + circleCloseButton.setFont(circleCloseButton.getFont().deriveFont(circleCloseButton.getFont().getSize() - 2f)); + circleCloseButton.setName("circleCloseButton"); + circleCloseButton.addActionListener(e -> closeButtonStyleChanged()); + closableTabsToolBar.add(circleCloseButton); - //---- showTabSeparatorsCheckBox ---- - showTabSeparatorsCheckBox.setText("JTabbedPane.showTabSeparators"); - showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged()); - panel14.add(showTabSeparatorsCheckBox, "cell 2 0"); - - //---- hasFullBorderCheckBox ---- - hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder"); - hasFullBorderCheckBox.setMnemonic('F'); - hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged()); - panel14.add(hasFullBorderCheckBox, "cell 3 0,alignx left,growx 0"); + //---- redCrossCloseButton ---- + redCrossCloseButton.setText("red cross"); + redCrossCloseButton.setFont(redCrossCloseButton.getFont().deriveFont(redCrossCloseButton.getFont().getSize() - 2f)); + redCrossCloseButton.setName("redCrossCloseButton"); + redCrossCloseButton.addActionListener(e -> closeButtonStyleChanged()); + closableTabsToolBar.add(redCrossCloseButton); } - panel9.add(panel14, cc.xywh(1, 11, 3, 1)); + panel1.add(closableTabsToolBar, "cell 0 5,alignx right,growx 0"); + + //======== closableTabsTabbedPane ======== + { + closableTabsTabbedPane.setName("closableTabsTabbedPane"); + } + panel1.add(closableTabsTabbedPane, "cell 0 6"); + + //---- tabAreaComponentsLabel ---- + tabAreaComponentsLabel.setText("Custom tab area components"); + tabAreaComponentsLabel.setFont(tabAreaComponentsLabel.getFont().deriveFont(tabAreaComponentsLabel.getFont().getSize() + 4f)); + tabAreaComponentsLabel.setName("tabAreaComponentsLabel"); + panel1.add(tabAreaComponentsLabel, "cell 0 7"); + + //======== tabAreaComponentsToolBar ======== + { + tabAreaComponentsToolBar.setFloatable(false); + tabAreaComponentsToolBar.setBorder(BorderFactory.createEmptyBorder()); + tabAreaComponentsToolBar.setName("tabAreaComponentsToolBar"); + + //---- leadingComponentButton ---- + leadingComponentButton.setText("leading"); + leadingComponentButton.setFont(leadingComponentButton.getFont().deriveFont(leadingComponentButton.getFont().getSize() - 2f)); + leadingComponentButton.setSelected(true); + leadingComponentButton.setName("leadingComponentButton"); + leadingComponentButton.addActionListener(e -> customComponentsChanged()); + tabAreaComponentsToolBar.add(leadingComponentButton); + + //---- trailingComponentButton ---- + trailingComponentButton.setText("trailing"); + trailingComponentButton.setFont(trailingComponentButton.getFont().deriveFont(trailingComponentButton.getFont().getSize() - 2f)); + trailingComponentButton.setSelected(true); + trailingComponentButton.setName("trailingComponentButton"); + trailingComponentButton.addActionListener(e -> customComponentsChanged()); + tabAreaComponentsToolBar.add(trailingComponentButton); + } + panel1.add(tabAreaComponentsToolBar, "cell 0 7,alignx right,growx 0"); + + //======== customComponentsTabbedPane ======== + { + customComponentsTabbedPane.setName("customComponentsTabbedPane"); + } + panel1.add(customComponentsTabbedPane, "cell 0 8"); } - add(panel9, "cell 0 0"); + add(panel1, "cell 0 0"); + + //======== panel2 ======== + { + panel2.setName("panel2"); + panel2.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[grow,fill]", + // rows + "[]0" + + "[]" + + "[fill]" + + "[center]" + + "[center]" + + "[center]para" + + "[center]0" + + "[]" + + "[center]" + + "[center]" + + "[center]" + + "[]")); + + //---- tabIconPlacementLabel ---- + tabIconPlacementLabel.setText("Tab icon placement"); + tabIconPlacementLabel.setFont(tabIconPlacementLabel.getFont().deriveFont(tabIconPlacementLabel.getFont().getSize() + 4f)); + tabIconPlacementLabel.setName("tabIconPlacementLabel"); + panel2.add(tabIconPlacementLabel, "cell 0 0"); + + //---- tabIconPlacementNodeLabel ---- + tabIconPlacementNodeLabel.setText("(top/bottom/leading/trailing)"); + tabIconPlacementNodeLabel.setEnabled(false); + tabIconPlacementNodeLabel.setFont(tabIconPlacementNodeLabel.getFont().deriveFont(tabIconPlacementNodeLabel.getFont().getSize() - 2f)); + tabIconPlacementNodeLabel.setName("tabIconPlacementNodeLabel"); + panel2.add(tabIconPlacementNodeLabel, "cell 0 1"); + + //======== iconTopTabbedPane ======== + { + iconTopTabbedPane.setName("iconTopTabbedPane"); + } + panel2.add(iconTopTabbedPane, "cell 0 2"); + + //======== iconBottomTabbedPane ======== + { + iconBottomTabbedPane.setName("iconBottomTabbedPane"); + } + panel2.add(iconBottomTabbedPane, "cell 0 3"); + + //======== iconLeadingTabbedPane ======== + { + iconLeadingTabbedPane.setName("iconLeadingTabbedPane"); + } + panel2.add(iconLeadingTabbedPane, "cell 0 4"); + + //======== iconTrailingTabbedPane ======== + { + iconTrailingTabbedPane.setName("iconTrailingTabbedPane"); + } + panel2.add(iconTrailingTabbedPane, "cell 0 5"); + + //---- tabAreaAlignmentLabel ---- + tabAreaAlignmentLabel.setText("Tab area alignment"); + tabAreaAlignmentLabel.setFont(tabAreaAlignmentLabel.getFont().deriveFont(tabAreaAlignmentLabel.getFont().getSize() + 4f)); + tabAreaAlignmentLabel.setName("tabAreaAlignmentLabel"); + panel2.add(tabAreaAlignmentLabel, "cell 0 6"); + + //---- tabAreaAlignmentNoteLabel ---- + tabAreaAlignmentNoteLabel.setText("(leading/center/trailing/fill)"); + tabAreaAlignmentNoteLabel.setEnabled(false); + tabAreaAlignmentNoteLabel.setFont(tabAreaAlignmentNoteLabel.getFont().deriveFont(tabAreaAlignmentNoteLabel.getFont().getSize() - 2f)); + tabAreaAlignmentNoteLabel.setName("tabAreaAlignmentNoteLabel"); + panel2.add(tabAreaAlignmentNoteLabel, "cell 0 7"); + + //======== alignLeadingTabbedPane ======== + { + alignLeadingTabbedPane.setName("alignLeadingTabbedPane"); + } + panel2.add(alignLeadingTabbedPane, "cell 0 8"); + + //======== alignCenterTabbedPane ======== + { + alignCenterTabbedPane.setName("alignCenterTabbedPane"); + } + panel2.add(alignCenterTabbedPane, "cell 0 9"); + + //======== alignTrailingTabbedPane ======== + { + alignTrailingTabbedPane.setName("alignTrailingTabbedPane"); + } + panel2.add(alignTrailingTabbedPane, "cell 0 10"); + + //======== alignFillTabbedPane ======== + { + alignFillTabbedPane.setName("alignFillTabbedPane"); + } + panel2.add(alignFillTabbedPane, "cell 0 11"); + } + add(panel2, "cell 1 0,growy"); + + //======== panel3 ======== + { + panel3.setName("panel3"); + panel3.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[grow,fill]", + // rows + "[]0" + + "[]" + + "[]" + + "[]" + + "[]para" + + "[]" + + "[]" + + "[]")); + + //---- tabWidthModeLabel ---- + tabWidthModeLabel.setText("Tab width mode"); + tabWidthModeLabel.setFont(tabWidthModeLabel.getFont().deriveFont(tabWidthModeLabel.getFont().getSize() + 4f)); + tabWidthModeLabel.setName("tabWidthModeLabel"); + panel3.add(tabWidthModeLabel, "cell 0 0"); + + //---- tabWidthModeNoteLabel ---- + tabWidthModeNoteLabel.setText("(preferred/equal/compact)"); + tabWidthModeNoteLabel.setFont(tabWidthModeNoteLabel.getFont().deriveFont(tabWidthModeNoteLabel.getFont().getSize() - 2f)); + tabWidthModeNoteLabel.setEnabled(false); + tabWidthModeNoteLabel.setName("tabWidthModeNoteLabel"); + panel3.add(tabWidthModeNoteLabel, "cell 0 1"); + + //======== widthPreferredTabbedPane ======== + { + widthPreferredTabbedPane.setName("widthPreferredTabbedPane"); + } + panel3.add(widthPreferredTabbedPane, "cell 0 2"); + + //======== widthEqualTabbedPane ======== + { + widthEqualTabbedPane.setName("widthEqualTabbedPane"); + } + panel3.add(widthEqualTabbedPane, "cell 0 3"); + + //======== widthCompactTabbedPane ======== + { + widthCompactTabbedPane.setName("widthCompactTabbedPane"); + } + panel3.add(widthCompactTabbedPane, "cell 0 4"); + + //---- minMaxTabWidthLabel ---- + minMaxTabWidthLabel.setText("Minimum/maximum tab width"); + minMaxTabWidthLabel.setFont(minMaxTabWidthLabel.getFont().deriveFont(minMaxTabWidthLabel.getFont().getSize() + 4f)); + minMaxTabWidthLabel.setName("minMaxTabWidthLabel"); + panel3.add(minMaxTabWidthLabel, "cell 0 5"); + + //======== minimumTabWidthTabbedPane ======== + { + minimumTabWidthTabbedPane.setName("minimumTabWidthTabbedPane"); + } + panel3.add(minimumTabWidthTabbedPane, "cell 0 6"); + + //======== maximumTabWidthTabbedPane ======== + { + maximumTabWidthTabbedPane.setName("maximumTabWidthTabbedPane"); + } + panel3.add(maximumTabWidthTabbedPane, "cell 0 7"); + } + add(panel3, "cell 2 0"); + + //======== panel4 ======== + { + panel4.setName("panel4"); + panel4.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[]", + // rows + "[center]")); + + //---- showTabSeparatorsCheckBox ---- + showTabSeparatorsCheckBox.setText("Show tab separators"); + showTabSeparatorsCheckBox.setName("showTabSeparatorsCheckBox"); + showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged()); + panel4.add(showTabSeparatorsCheckBox, "cell 0 0"); + } + add(panel4, "cell 0 1 3 1"); + + //---- tabPlacementButtonGroup ---- + ButtonGroup tabPlacementButtonGroup = new ButtonGroup(); + tabPlacementButtonGroup.add(topPlacementButton); + tabPlacementButtonGroup.add(bottomPlacementButton); + tabPlacementButtonGroup.add(leftPlacementButton); + tabPlacementButtonGroup.add(rightPlacementButton); + + //---- buttonGroup2 ---- + ButtonGroup buttonGroup2 = new ButtonGroup(); + buttonGroup2.add(scrollTabLayoutButton); + buttonGroup2.add(wrapTabLayoutButton); + + //---- buttonGroup1 ---- + ButtonGroup buttonGroup1 = new ButtonGroup(); + buttonGroup1.add(squareCloseButton); + buttonGroup1.add(circleCloseButton); + buttonGroup1.add(redCrossCloseButton); // JFormDesigner - End of component initialization //GEN-END:initComponents } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables - private JTabbedPane tabbedPane1; - private JTabbedPane tabbedPane3; - private JTabbedPane tabbedPane2; - private JTabbedPane tabbedPane4; - private JCheckBox moreTabsCheckBox; - private JCheckBox tabScrollCheckBox; + private JToolBar tabPlacementToolBar; + private JToggleButton topPlacementButton; + private JToggleButton bottomPlacementButton; + private JToggleButton leftPlacementButton; + private JToggleButton rightPlacementButton; + private JToggleButton scrollButton; + private JToggleButton borderButton; + private JTabbedPane tabPlacementTabbedPane; + private JToolBar tabLayoutToolBar; + private JToggleButton scrollTabLayoutButton; + private JToggleButton wrapTabLayoutButton; + private JLabel scrollLayoutNoteLabel; + private JLabel wrapLayoutNoteLabel; + private JTabbedPane scrollLayoutTabbedPane; + private JTabbedPane wrapLayoutTabbedPane; + private JToolBar closableTabsToolBar; + private JToggleButton squareCloseButton; + private JToggleButton circleCloseButton; + private JToggleButton redCrossCloseButton; + private JTabbedPane closableTabsTabbedPane; + private JToolBar tabAreaComponentsToolBar; + private JToggleButton leadingComponentButton; + private JToggleButton trailingComponentButton; + private JTabbedPane customComponentsTabbedPane; + private JTabbedPane iconTopTabbedPane; + private JTabbedPane iconBottomTabbedPane; + private JTabbedPane iconLeadingTabbedPane; + private JTabbedPane iconTrailingTabbedPane; + private JTabbedPane alignLeadingTabbedPane; + private JTabbedPane alignCenterTabbedPane; + private JTabbedPane alignTrailingTabbedPane; + private JTabbedPane alignFillTabbedPane; + private JTabbedPane widthPreferredTabbedPane; + private JTabbedPane widthEqualTabbedPane; + private JTabbedPane widthCompactTabbedPane; + private JTabbedPane minimumTabWidthTabbedPane; + private JTabbedPane maximumTabWidthTabbedPane; private JCheckBox showTabSeparatorsCheckBox; - private JCheckBox hasFullBorderCheckBox; // JFormDesigner - End of variables declaration //GEN-END:variables } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.jfd index 39e68c1f..57394cd2 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/TabsPanel.jfd @@ -1,261 +1,433 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" root: new FormRoot { - auxiliary() { - "JavaCodeGenerator.defaultVariableLocal": true - } + "$setComponentNames": true add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "hidemode 3" - "$columnConstraints": "[grow,fill]" - "$rowConstraints": "[grow,fill]" + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[grow,fill]para[fill]para[fill]" + "$rowConstraints": "[grow,fill][]" } ) { name: "this" - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jgoodies.forms.layout.FormLayout ) { - "$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow" - "$rowSpecs": "default, linegap, fill:70dlu, linegap, pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[grow,fill]" + "$rowConstraints": "[][fill]para[]0[][]para[][]para[][]" } ) { - name: "panel9" + name: "panel1" + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } add( new FormComponent( "javax.swing.JLabel" ) { - name: "splitPaneLabel" - "text": "JSplitPane:" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) ) - add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { - name: "splitPane3" - "resizeWeight": 0.5 - add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { - name: "splitPane1" - "resizeWeight": 0.5 - "oneTouchExpandable": true - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel10" - "background": sfield java.awt.Color orange - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "left" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel11" - "background": sfield java.awt.Color magenta - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "right" - } ) - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "left" + name: "tabPlacementLabel" + "text": "Tab placement" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "tabPlacementToolBar" + "floatable": false + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "topPlacementButton" + "text": "top" + "selected": true + "$buttonGroup": new FormReference( "tabPlacementButtonGroup" ) + "font": &SwingDerivedFont0 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabPlacementChanged", false ) ) } ) - add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) { - name: "splitPane2" - "orientation": 0 - "resizeWeight": 0.5 - "oneTouchExpandable": true - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel12" - "background": sfield java.awt.Color orange - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "left" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel13" - "background": sfield java.awt.Color magenta - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "right" - } ) - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "right" + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "bottomPlacementButton" + "text": "bottom" + "$buttonGroup": new FormReference( "tabPlacementButtonGroup" ) + "font": #SwingDerivedFont0 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabPlacementChanged", false ) ) } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 3 - "gridWidth": 3 + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "leftPlacementButton" + "text": "left" + "$buttonGroup": new FormReference( "tabPlacementButtonGroup" ) + "font": #SwingDerivedFont0 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabPlacementChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "rightPlacementButton" + "text": "right" + "$buttonGroup": new FormReference( "tabPlacementButtonGroup" ) + "font": #SwingDerivedFont0 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabPlacementChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JToolBar$Separator" ) { + name: "separator1" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "scrollButton" + "text": "scroll" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "scrollChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "borderButton" + "text": "border" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "borderChanged", false ) ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0,alignx right,growx 0" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabPlacementTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1,width 300:300,height 100:100" } ) add( new FormComponent( "javax.swing.JLabel" ) { - name: "tabbedPaneLabel" - "text": "JTabbedPane:" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - "gridY": 5 + name: "tabLayoutLabel" + "text": "Tab layout" + "font": &SwingDerivedFont1 new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "tabLayoutToolBar" + "floatable": false + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "scrollTabLayoutButton" + "text": "scroll" + "$buttonGroup": new FormReference( "buttonGroup2" ) + "font": &SwingDerivedFont2 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + "selected": true + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabLayoutChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "wrapTabLayoutButton" + "text": "wrap" + "$buttonGroup": new FormReference( "buttonGroup2" ) + "font": #SwingDerivedFont2 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabLayoutChanged", false ) ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2,alignx right,growx 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "scrollLayoutNoteLabel" + "text": "(use mouse wheel to scroll; arrow button shows hidden tabs)" + "enabled": false + "font": &SwingDerivedFont3 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "wrapLayoutNoteLabel" + "text": "(probably better to use scroll layout?)" + "enabled": false + "font": #SwingDerivedFont3 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" } ) add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane1" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel1" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label1" - "text": "TOP" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel2" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color magenta, 1, false ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label2" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - "gridY": 7 + name: "scrollLayoutTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" } ) add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane3" - "tabPlacement": 2 + name: "wrapLayoutTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4,width 100:100,height pref*2px" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "closableTabsLabel" + "text": "Closable tabs" + "font": #SwingDerivedFont1 auxiliary() { - "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.variableLocal": true } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel5" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label5" - "text": "LEFT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "closableTabsToolBar" + "floatable": false + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "squareCloseButton" + "text": "square" + "font": &SwingDerivedFont4 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + "$buttonGroup": new FormReference( "buttonGroup1" ) + "selected": true + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "closeButtonStyleChanged", false ) ) } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel6" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "circleCloseButton" + "text": "circle" + "font": #SwingDerivedFont4 + "$buttonGroup": new FormReference( "buttonGroup1" ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "closeButtonStyleChanged", false ) ) } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label6" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "redCrossCloseButton" + "text": "red cross" + "font": #SwingDerivedFont4 + "$buttonGroup": new FormReference( "buttonGroup1" ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "closeButtonStyleChanged", false ) ) } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 3 - "gridY": 7 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5,alignx right,growx 0" } ) add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane2" - "tabPlacement": 3 + name: "closableTabsTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabAreaComponentsLabel" + "text": "Custom tab area components" + "font": #SwingDerivedFont1 auxiliary() { - "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.variableLocal": true } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel3" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label3" - "text": "BOTTOM" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "tabAreaComponentsToolBar" + "floatable": false + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "leadingComponentButton" + "text": "leading" + "font": &SwingDerivedFont5 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + "selected": true + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "customComponentsChanged", false ) ) } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel4" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - "enabled": false + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "trailingComponentButton" + "text": "trailing" + "font": #SwingDerivedFont5 + "selected": true + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "customComponentsChanged", false ) ) } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label4" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 9 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7,alignx right,growx 0" } ) add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane4" - "tabPlacement": 4 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel7" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label7" - "text": "RIGHT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel8" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label8" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 3 - "gridY": 9 - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "insets 0,hidemode 3" - "$columnConstraints": "[][][][]" - "$rowConstraints": "[center]" - } ) { - name: "panel14" - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "moreTabsCheckBox" - "text": "more tabs" - "mnemonic": 77 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "moreTabsChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "tabScrollCheckBox" - "text": "tabLayoutPolicy = SCROLL" - "mnemonic": 83 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabScrollChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0,alignx left,growx 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "showTabSeparatorsCheckBox" - "text": "JTabbedPane.showTabSeparators" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTabSeparatorsChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "hasFullBorderCheckBox" - "text": "JTabbedPane.hasFullBorder" - "mnemonic": 70 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hasFullBorderChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 3 0,alignx left,growx 0" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 11 - "gridWidth": 3 + name: "customComponentsTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 0" } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[grow,fill]" + "$rowConstraints": "[]0[][fill][center][center][center]para[center]0[][center][center][center][]" + } ) { + name: "panel2" + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabIconPlacementLabel" + "text": "Tab icon placement" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabIconPlacementNodeLabel" + "text": "(top/bottom/leading/trailing)" + "enabled": false + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "iconTopTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "iconBottomTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "iconLeadingTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "iconTrailingTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabAreaAlignmentLabel" + "text": "Tab area alignment" + "font": &SwingDerivedFont6 new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabAreaAlignmentNoteLabel" + "text": "(leading/center/trailing/fill)" + "enabled": false + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "alignLeadingTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "alignCenterTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 9" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "alignTrailingTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 10" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "alignFillTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 11" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0,growy" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[grow,fill]" + "$rowConstraints": "[]0[][][][]para[][][]" + } ) { + name: "panel3" + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabWidthModeLabel" + "text": "Tab width mode" + "font": #SwingDerivedFont6 + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabWidthModeNoteLabel" + "text": "(preferred/equal/compact)" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false ) + "enabled": false + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "widthPreferredTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "widthEqualTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "widthCompactTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "minMaxTabWidthLabel" + "text": "Minimum/maximum tab width" + "font": new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false ) + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "minimumTabWidthTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "maximumTabWidthTabbedPane" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[]" + "$rowConstraints": "[center]" + } ) { + name: "panel4" + auxiliary() { + "JavaCodeGenerator.variableLocal": true + } + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showTabSeparatorsCheckBox" + "text": "Show tab separators" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTabSeparatorsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1 3 1" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 610, 515 ) + "size": new java.awt.Dimension( 925, 825 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "tabPlacementButtonGroup" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 10, 1240 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "buttonGroup1" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 1292 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "buttonGroup2" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 1344 ) } ) } } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.java new file mode 100644 index 00000000..a7291324 --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.demo.extras; + +import javax.swing.*; +import com.formdev.flatlaf.extras.*; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class ExtrasPanel + extends JPanel +{ + public ExtrasPanel() { + initComponents(); + + triStateLabel1.setText( triStateCheckBox1.getState().toString() ); + + addSVGIcon( "actions/copy.svg" ); + addSVGIcon( "actions/colors.svg" ); + addSVGIcon( "actions/execute.svg" ); + addSVGIcon( "actions/suspend.svg" ); + addSVGIcon( "actions/intentionBulb.svg" ); + addSVGIcon( "actions/quickfixOffBulb.svg" ); + + addSVGIcon( "objects/abstractClass.svg" ); + addSVGIcon( "objects/abstractMethod.svg" ); + addSVGIcon( "objects/annotationtype.svg" ); + addSVGIcon( "objects/annotationtype.svg" ); + addSVGIcon( "objects/css.svg" ); + addSVGIcon( "objects/javaScript.svg" ); + addSVGIcon( "objects/xhtml.svg" ); + + addSVGIcon( "errorDialog.svg" ); + addSVGIcon( "informationDialog.svg" ); + addSVGIcon( "warningDialog.svg" ); + } + + private void addSVGIcon( String name ) { + svgIconsPanel.add( new JLabel( new FlatSVGIcon( "com/formdev/flatlaf/demo/extras/svg/" + name ) ) ); + } + + private void triStateCheckBox1Changed() { + triStateLabel1.setText( triStateCheckBox1.getState().toString() ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + label4 = new JLabel(); + label1 = new JLabel(); + triStateCheckBox1 = new TriStateCheckBox(); + triStateLabel1 = new JLabel(); + label2 = new JLabel(); + svgIconsPanel = new JPanel(); + label3 = new JLabel(); + + //======== this ======== + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[]" + + "[]" + + "[left]", + // rows + "[]para" + + "[]" + + "[]" + + "[]")); + + //---- label4 ---- + label4.setText("Note: Components on this page require the flatlaf-extras library."); + add(label4, "cell 0 0 3 1"); + + //---- label1 ---- + label1.setText("TriStateCheckBox:"); + add(label1, "cell 0 1"); + + //---- triStateCheckBox1 ---- + triStateCheckBox1.setText("Three States"); + triStateCheckBox1.addActionListener(e -> triStateCheckBox1Changed()); + add(triStateCheckBox1, "cell 1 1"); + + //---- triStateLabel1 ---- + triStateLabel1.setText("text"); + triStateLabel1.setEnabled(false); + add(triStateLabel1, "cell 2 1,gapx 30"); + + //---- label2 ---- + label2.setText("SVG Icons:"); + add(label2, "cell 0 2"); + + //======== svgIconsPanel ======== + { + svgIconsPanel.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[fill]", + // rows + "[grow,center]")); + } + add(svgIconsPanel, "cell 1 2 2 1"); + + //---- label3 ---- + label3.setText("The icons may change colors when switching to another theme."); + add(label3, "cell 1 3 2 1"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JLabel label4; + private JLabel label1; + private TriStateCheckBox triStateCheckBox1; + private JLabel triStateLabel1; + private JLabel label2; + private JPanel svgIconsPanel; + private JLabel label3; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.jfd new file mode 100644 index 00000000..80741d5c --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/extras/ExtrasPanel.jfd @@ -0,0 +1,64 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[][][left]" + "$rowConstraints": "[]para[][][]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "Note: Components on this page require the flatlaf-extras library." + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0 3 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "TriStateCheckBox:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) { + name: "triStateCheckBox1" + "text": "Three States" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "triStateCheckBox1Changed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "triStateLabel1" + "text": "text" + "enabled": false + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1,gapx 30" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "SVG Icons:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[fill]" + "$rowConstraints": "[grow,center]" + } ) { + name: "svgIconsPanel" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "The icons may change colors when switching to another theme." + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3 2 1" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 500, 300 ) + } ) + } +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemeInfo.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemeInfo.java index 6250d22b..40e0bc03 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemeInfo.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemeInfo.java @@ -25,6 +25,7 @@ class IJThemeInfo { final String name; final String resourceName; + final boolean dark; final String license; final String licenseFile; final String sourceCodeUrl; @@ -32,13 +33,14 @@ class IJThemeInfo final File themeFile; final String lafClassName; - IJThemeInfo( String name, String resourceName, + IJThemeInfo( String name, String resourceName, boolean dark, String license, String licenseFile, String sourceCodeUrl, String sourceCodePath, File themeFile, String lafClassName ) { this.name = name; this.resourceName = resourceName; + this.dark = dark; this.license = license; this.licenseFile = licenseFile; this.sourceCodeUrl = sourceCodeUrl; diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesClassGenerator.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesClassGenerator.java new file mode 100644 index 00000000..6a1e3ac6 --- /dev/null +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesClassGenerator.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.demo.intellijthemes; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; + +/** + * This tool creates look and feel classes for all themes listed in themes.json. + * + * @author Karl Tauber + */ +public class IJThemesClassGenerator +{ + public static void main( String[] args ) { + IJThemesManager themesManager = new IJThemesManager(); + themesManager.loadBundledThemes(); + + String toPath = "../flatlaf-intellij-themes/src/main/java" + IJThemesPanel.THEMES_PACKAGE + ".."; + + StringBuilder allInfos = new StringBuilder(); + StringBuilder markdownTable = new StringBuilder(); + markdownTable.append( "Name | Class\n" ); + markdownTable.append( "-----|------\n" ); + + for( IJThemeInfo ti : themesManager.bundledThemes ) { + if( ti.sourceCodeUrl == null || ti.sourceCodePath == null ) + continue; + + generateClass( ti, toPath, allInfos, markdownTable ); + } + + Path out = new File( toPath, "FlatAllIJThemes.java" ).toPath(); + String allThemes = CLASS_HEADER + ALL_THEMES_TEMPLATE.replace( "${allInfos}", allInfos ); + writeFile( out, allThemes ); + + System.out.println( markdownTable ); + } + + private static void generateClass( IJThemeInfo ti, String toPath, StringBuilder allInfos, StringBuilder markdownTable ) { + String resourceName = ti.resourceName; + String resourcePath = null; + int resSep = resourceName.indexOf( '/' ); + if( resSep >= 0 ) { + resourcePath = resourceName.substring( 0, resSep ); + resourceName = resourceName.substring( resSep + 1 ); + } + + String name = ti.name; + int nameSep = name.indexOf( '/' ); + if( nameSep >= 0 ) + name = name.substring( nameSep + 1 ).trim(); + + StringBuilder buf = new StringBuilder(); + for( String n : name.split( " " ) ) { + if( n.length() == 0 || n.equals( "-" ) ) + continue; + + if( Character.isUpperCase( n.charAt( 0 ) ) ) + buf.append( n ); + else + buf.append( Character.toUpperCase( n.charAt( 0 ) ) ).append( n.substring( 1 ) ); + } + + String subPackage = (resourcePath != null) ? '.' + resourcePath.replace( "-", "" ) : ""; + String themeClass = "Flat" + buf + "IJTheme"; + String themeFile = resourceName; + + String classBody = CLASS_HEADER + CLASS_TEMPLATE + .replace( "${subPackage}", subPackage ) + .replace( "${themeClass}", themeClass ) + .replace( "${themeFile}", themeFile ); + + File toDir = new File( toPath ); + if( resourcePath != null ) + toDir = new File( toDir, resourcePath.replace( "-", "" ) ); + + Path out = new File( toDir, themeClass + ".java" ).toPath(); + writeFile( out, classBody ); + + if( allInfos.length() > 0 ) + allInfos.append( '\n' ); + allInfos.append( THEME_TEMPLATE + .replace( "${subPackage}", subPackage ) + .replace( "${themeClass}", themeClass ) + .replace( "${themeName}", name ) ); + + markdownTable.append( String.format( "[%s](%s) | `com.formdev.flatlaf.intellijthemes%s.%s`\n", + name, ti.sourceCodeUrl, subPackage, themeClass ) ); + } + + private static void writeFile( Path out, String content ) { + try { + Files.write( out, content.getBytes( StandardCharsets.ISO_8859_1 ), + StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); + } catch( IOException ex ) { + ex.printStackTrace(); + } + } + + private static final String CLASS_HEADER = + "/*\n" + + " * Copyright 2020 FormDev Software GmbH\n" + + " *\n" + + " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" + + " * you may not use this file except in compliance with the License.\n" + + " * You may obtain a copy of the License at\n" + + " *\n" + + " * https://www.apache.org/licenses/LICENSE-2.0\n" + + " *\n" + + " * Unless required by applicable law or agreed to in writing, software\n" + + " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" + + " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + + " * See the License for the specific language governing permissions and\n" + + " * limitations under the License.\n" + + " */\n" + + "\n"; + + private static final String CLASS_TEMPLATE = + "package com.formdev.flatlaf.intellijthemes${subPackage};\n" + + "\n" + + "import com.formdev.flatlaf.IntelliJTheme;\n" + + "\n" + + "/**\n" + + " * @author Karl Tauber\n" + + " */\n" + + "public class ${themeClass}\n" + + " extends IntelliJTheme.ThemeLaf\n" + + "{\n" + + " public static boolean install( ) {\n" + + " try {\n" + + " return install( new ${themeClass}() );\n" + + " } catch( RuntimeException ex ) {\n" + + " return false;\n" + + " }\n" + + " }\n" + + "\n" + + " public ${themeClass}() {\n" + + " super( Utils.loadTheme( \"${themeFile}\" ) );\n" + + " }\n" + + "}\n"; + + private static final String ALL_THEMES_TEMPLATE = + "package com.formdev.flatlaf.intellijthemes;\n" + + "\n" + + "import javax.swing.UIManager.LookAndFeelInfo;\n" + + "\n" + + "/**\n" + + " * @author Karl Tauber\n" + + " */\n" + + "public class FlatAllIJThemes\n" + + "{\n" + + " public static final LookAndFeelInfo[] INFOS = {\n" + + "${allInfos}\n" + + " };\n" + + "}\n"; + + private static final String THEME_TEMPLATE = + " new LookAndFeelInfo( \"${themeName}\", \"com.formdev.flatlaf.intellijthemes${subPackage}.${themeClass}\" ),"; +} diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java index 6e7969a2..07142025 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesManager.java @@ -55,12 +55,13 @@ class IJThemesManager String resourceName = e.getKey(); Map value = (Map) e.getValue(); String name = value.get( "name" ); + boolean dark = Boolean.parseBoolean( value.get( "dark" ) ); String license = value.get( "license" ); String licenseFile = value.get( "licenseFile" ); String sourceCodeUrl = value.get( "sourceCodeUrl" ); String sourceCodePath = value.get( "sourceCodePath" ); - bundledThemes.add( new IJThemeInfo( name, resourceName, license, licenseFile, sourceCodeUrl, sourceCodePath, null, null ) ); + bundledThemes.add( new IJThemeInfo( name, resourceName, dark, license, licenseFile, sourceCodeUrl, sourceCodePath, null, null ) ); } } @@ -68,7 +69,9 @@ class IJThemesManager // get current working directory File directory = new File( "" ).getAbsoluteFile(); - File[] themeFiles = directory.listFiles( (dir, name) -> name.endsWith( ".theme.json" ) ); + File[] themeFiles = directory.listFiles( (dir, name) -> { + return name.endsWith( ".theme.json" ) || name.endsWith( ".properties" ); + } ); if( themeFiles == null ) return; @@ -77,8 +80,11 @@ class IJThemesManager moreThemes.clear(); for( File f : themeFiles ) { - String name = StringUtils.removeTrailing( f.getName(), ".theme.json" ); - moreThemes.add( new IJThemeInfo( name, null, null, null, null, null, f, null ) ); + String fname = f.getName(); + String name = fname.endsWith( ".properties" ) + ? StringUtils.removeTrailing( fname, ".properties" ) + : StringUtils.removeTrailing( fname, ".theme.json" ); + moreThemes.add( new IJThemeInfo( name, null, false, null, null, null, null, f, null ) ); lastModifiedMap.put( f, f.lastModified() ); } } diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java index d5b5269d..3566322a 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java @@ -19,6 +19,7 @@ package com.formdev.flatlaf.demo.intellijthemes; import java.awt.Component; import java.awt.Desktop; import java.awt.EventQueue; +import java.awt.Rectangle; import java.awt.Window; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -46,8 +47,10 @@ import com.formdev.flatlaf.FlatDarkLaf; import com.formdev.flatlaf.FlatIntelliJLaf; import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.FlatPropertiesLaf; import com.formdev.flatlaf.IntelliJTheme; import com.formdev.flatlaf.demo.DemoPrefs; +import com.formdev.flatlaf.extras.FlatAnimatedLafChange; import com.formdev.flatlaf.extras.FlatSVGIcon; import com.formdev.flatlaf.util.StringUtils; import net.miginfocom.swing.*; @@ -58,6 +61,8 @@ import net.miginfocom.swing.*; public class IJThemesPanel extends JPanel { + public static final String THEMES_PACKAGE = "/com/formdev/flatlaf/intellijthemes/themes/"; + private final IJThemesManager themesManager = new IJThemesManager(); private final List themes = new ArrayList<>(); private final HashMap categories = new HashMap<>(); @@ -71,6 +76,7 @@ public class IJThemesPanel private Window window; private File lastDirectory; + private boolean isAdjustingThemesList; public IJThemesPanel() { initComponents(); @@ -115,6 +121,10 @@ public class IJThemesPanel } private void updateThemesList() { + int filterLightDark = filterComboBox.getSelectedIndex(); + boolean showLight = (filterLightDark != 2); + boolean showDark = (filterLightDark != 1); + // load theme infos themesManager.loadBundledThemes(); themesManager.loadThemesFromDirectory(); @@ -124,28 +134,41 @@ public class IJThemesPanel themesManager.bundledThemes.sort( comparator ); themesManager.moreThemes.sort( comparator ); + // remember selection (must be invoked before clearing themes field) + IJThemeInfo oldSel = themesList.getSelectedValue(); + themes.clear(); categories.clear(); // add core themes at beginning categories.put( themes.size(), "Core Themes" ); - themes.add( new IJThemeInfo( "Flat Light", null, null, null, null, null, null, FlatLightLaf.class.getName() ) ); - themes.add( new IJThemeInfo( "Flat Dark", null, null, null, null, null, null, FlatDarkLaf.class.getName() ) ); - themes.add( new IJThemeInfo( "Flat IntelliJ", null, null, null, null, null, null, FlatIntelliJLaf.class.getName() ) ); - themes.add( new IJThemeInfo( "Flat Darcula", null, null, null, null, null, null, FlatDarculaLaf.class.getName() ) ); + if( showLight ) + themes.add( new IJThemeInfo( "Flat Light", null, false, null, null, null, null, null, FlatLightLaf.class.getName() ) ); + if( showDark ) + themes.add( new IJThemeInfo( "Flat Dark", null, true, null, null, null, null, null, FlatDarkLaf.class.getName() ) ); + if( showLight ) + themes.add( new IJThemeInfo( "Flat IntelliJ", null, false, null, null, null, null, null, FlatIntelliJLaf.class.getName() ) ); + if( showDark ) + themes.add( new IJThemeInfo( "Flat Darcula", null, true, null, null, null, null, null, FlatDarculaLaf.class.getName() ) ); + + // add themes from directory + categories.put( themes.size(), "Current Directory" ); + themes.addAll( themesManager.moreThemes ); // add uncategorized bundled themes categories.put( themes.size(), "IntelliJ Themes" ); for( IJThemeInfo ti : themesManager.bundledThemes ) { - if( !ti.name.contains( "/" ) ) + boolean show = (showLight && !ti.dark) || (showDark && ti.dark); + if( show && !ti.name.contains( "/" ) ) themes.add( ti ); } // add categorized bundled themes String lastCategory = null; for( IJThemeInfo ti : themesManager.bundledThemes ) { + boolean show = (showLight && !ti.dark) || (showDark && ti.dark); int sep = ti.name.indexOf( '/' ); - if( sep < 0 ) + if( !show || sep < 0 ) continue; String category = ti.name.substring( 0, sep ).trim(); @@ -157,13 +180,6 @@ public class IJThemesPanel themes.add( ti ); } - // add themes from directory - categories.put( themes.size(), "Current Directory" ); - themes.addAll( themesManager.moreThemes ); - - // remember selection - IJThemeInfo oldSel = themesList.getSelectedValue(); - // fill themes list themesList.setModel( new AbstractListModel() { @Override @@ -189,18 +205,30 @@ public class IJThemesPanel break; } } + + // select first theme if none selected + if( themesList.getSelectedIndex() < 0 ) + themesList.setSelectedIndex( 0 ); + } + + // scroll selection into visible area + int sel = themesList.getSelectedIndex(); + if( sel >= 0 ) { + Rectangle bounds = themesList.getCellBounds( sel, sel ); + if( bounds != null ) + themesList.scrollRectToVisible( bounds ); } } private void themesListValueChanged( ListSelectionEvent e ) { - if( e.getValueIsAdjusting() ) - return; - IJThemeInfo themeInfo = themesList.getSelectedValue(); boolean bundledTheme = (themeInfo != null && themeInfo.resourceName != null); saveButton.setEnabled( bundledTheme ); sourceCodeButton.setEnabled( bundledTheme ); + if( e.getValueIsAdjusting() || isAdjustingThemesList ) + return; + EventQueue.invokeLater( () -> { setTheme( themeInfo ); } ); @@ -215,6 +243,8 @@ public class IJThemesPanel if( themeInfo.lafClassName.equals( UIManager.getLookAndFeel().getClass().getName() ) ) return; + FlatAnimatedLafChange.showSnapshot(); + try { UIManager.setLookAndFeel( themeInfo.lafClassName ); } catch( Exception ex ) { @@ -222,20 +252,29 @@ public class IJThemesPanel showInformationDialog( "Failed to create '" + themeInfo.lafClassName + "'.", ex ); } } else if( themeInfo.themeFile != null ) { + FlatAnimatedLafChange.showSnapshot(); + try { - FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) ); - DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile ); + if( themeInfo.themeFile.getName().endsWith( ".properties" ) ) { + FlatLaf.install( new FlatPropertiesLaf( themeInfo.name, themeInfo.themeFile ) ); + } else + FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) ); + + DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile ); } catch( Exception ex ) { ex.printStackTrace(); showInformationDialog( "Failed to load '" + themeInfo.themeFile + "'.", ex ); } } else { - IntelliJTheme.install( getClass().getResourceAsStream( themeInfo.resourceName ) ); - DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName ); + FlatAnimatedLafChange.showSnapshot(); + + IntelliJTheme.install( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.resourceName ) ); + DemoPrefs.getState().put( DemoPrefs.KEY_LAF_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName ); } // update all components FlatLaf.updateUI(); + FlatAnimatedLafChange.hideSnapshotWithAnimation(); } private void saveTheme() { @@ -253,7 +292,7 @@ public class IJThemesPanel // save theme try { - Files.copy( getClass().getResourceAsStream( themeInfo.resourceName ), + Files.copy( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.resourceName ), file.toPath(), StandardCopyOption.REPLACE_EXISTING ); } catch( IOException ex ) { showInformationDialog( "Failed to save theme to '" + file + "'.", ex ); @@ -266,7 +305,7 @@ public class IJThemesPanel File licenseFile = new File( file.getParentFile(), StringUtils.removeTrailing( file.getName(), ".theme.json" ) + themeInfo.licenseFile.substring( themeInfo.licenseFile.indexOf( '.' ) ) ); - Files.copy( getClass().getResourceAsStream( themeInfo.licenseFile ), + Files.copy( getClass().getResourceAsStream( THEMES_PACKAGE + themeInfo.licenseFile ), licenseFile.toPath(), StandardCopyOption.REPLACE_EXISTING ); } catch( IOException ex ) { showInformationDialog( "Failed to save theme license to '" + file + "'.", ex ); @@ -331,17 +370,17 @@ public class IJThemesPanel private void selectedCurrentLookAndFeel() { LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); - String intelliJTheme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.INTELLIJ_THEME_UI_KEY ); + String theme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.THEME_UI_KEY ); - if( intelliJTheme == null && lookAndFeel instanceof IntelliJTheme.ThemeLaf ) + if( theme == null && (lookAndFeel instanceof IntelliJTheme.ThemeLaf || lookAndFeel instanceof FlatPropertiesLaf) ) return; Predicate test; - if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) { - String resourceName = intelliJTheme.substring( DemoPrefs.RESOURCE_PREFIX.length() ); + if( theme != null && theme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) { + String resourceName = theme.substring( DemoPrefs.RESOURCE_PREFIX.length() ); test = ti -> Objects.equals( ti.resourceName, resourceName ); - } else if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.FILE_PREFIX ) ) { - File themeFile = new File( intelliJTheme.substring( DemoPrefs.FILE_PREFIX.length() ) ); + } else if( theme != null && theme.startsWith( DemoPrefs.FILE_PREFIX ) ) { + File themeFile = new File( theme.substring( DemoPrefs.FILE_PREFIX.length() ) ); test = ti -> Objects.equals( ti.themeFile, themeFile ); } else { String lafClassName = lookAndFeel.getClass().getName(); @@ -356,11 +395,17 @@ public class IJThemesPanel } } + isAdjustingThemesList = true; if( newSel >= 0 ) { if( newSel != themesList.getSelectedIndex() ) themesList.setSelectedIndex( newSel ); } else themesList.clearSelection(); + isAdjustingThemesList = false; + } + + private void filterChanged() { + updateThemesList(); } private void initComponents() { @@ -369,6 +414,7 @@ public class IJThemesPanel toolBar = new JToolBar(); saveButton = new JButton(); sourceCodeButton = new JButton(); + filterComboBox = new JComboBox<>(); themesScrollPane = new JScrollPane(); themesList = new JList<>(); @@ -401,6 +447,17 @@ public class IJThemesPanel } add(toolBar, "cell 0 0,alignx right,growx 0"); + //---- filterComboBox ---- + filterComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "all", + "light", + "dark" + })); + filterComboBox.putClientProperty("JComponent.minimumWidth", 0); + filterComboBox.setFocusable(false); + filterComboBox.addActionListener(e -> filterChanged()); + add(filterComboBox, "cell 0 0,alignx right,growx 0"); + //======== themesScrollPane ======== { @@ -417,6 +474,7 @@ public class IJThemesPanel private JToolBar toolBar; private JButton saveButton; private JButton sourceCodeButton; + private JComboBox filterComboBox; private JScrollPane themesScrollPane; private JList themesList; // JFormDesigner - End of variables declaration //GEN-END:variables diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.jfd index 51a3fa3a..8674fb70 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -34,6 +34,20 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 0,alignx right,growx 0" } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "filterComboBox" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "all" + addElement( "all" ) + addElement( "light" ) + addElement( "dark" ) + } + "$client.JComponent.minimumWidth": 0 + "focusable": false + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "filterChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0,alignx right,growx 0" + } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "themesScrollPane" add( new FormComponent( "javax.swing.JList" ) { diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesUpdater.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesUpdater.java index 184dbc32..bad7a17a 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesUpdater.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesUpdater.java @@ -46,7 +46,7 @@ public class IJThemesUpdater else if( fromUrl.contains( "gitlab.com" ) ) fromUrl = fromUrl.replace( "/blob/", "/raw/" ); - String toPath = "src/main/resources/com/formdev/flatlaf/demo/intellijthemes/" + ti.resourceName; + String toPath = "../flatlaf-intellij-themes/src/main/resources" + IJThemesPanel.THEMES_PACKAGE + ti.resourceName; download( fromUrl, toPath ); } diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatDarkLaf.properties b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatDarkLaf.properties new file mode 100644 index 00000000..cb56e9fa --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatDarkLaf.properties @@ -0,0 +1,17 @@ +# +# Copyright 2020 FormDev Software GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +HintPanel.backgroundColor=darken(#ffffe1,80%) diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLaf.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLaf.svg new file mode 100644 index 00000000..41c42936 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLaf.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLightLaf.properties b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLightLaf.properties new file mode 100644 index 00000000..07b41420 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/FlatLightLaf.properties @@ -0,0 +1,17 @@ +# +# Copyright 2020 FormDev Software GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +HintPanel.backgroundColor=#ffffe1 diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/LICENSE.txt b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/LICENSE.txt new file mode 100644 index 00000000..186cd751 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/LICENSE.txt @@ -0,0 +1,3 @@ +The icons in this folder are from IntelliJ IDEA Community Edition, +which is licensed under the Apache 2.0 license. Copyright 2000-2019 JetBrains s.r.o. +See: https://github.com/JetBrains/intellij-community/ diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/colors.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/colors.svg new file mode 100644 index 00000000..bddfa1b6 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/colors.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/copy_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/copy.svg similarity index 64% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/copy_dark.svg rename to flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/copy.svg index 4ff18263..cfbf4d6d 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/copy_dark.svg +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/copy.svg @@ -1,6 +1,6 @@ - - + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/execute.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/execute.svg new file mode 100644 index 00000000..6b05be3b --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/execute.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/intentionBulb.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/intentionBulb.svg new file mode 100644 index 00000000..41566135 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/intentionBulb.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/quickfixOffBulb.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/quickfixOffBulb.svg new file mode 100644 index 00000000..e53c922b --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/quickfixOffBulb.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/suspend.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/suspend.svg new file mode 100644 index 00000000..718f3c31 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/actions/suspend.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/errorDialog.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/errorDialog.svg new file mode 100644 index 00000000..c941d6bc --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/errorDialog.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/informationDialog.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/informationDialog.svg new file mode 100644 index 00000000..599b9759 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/informationDialog.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractClass.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractClass.svg new file mode 100644 index 00000000..fdd31bbc --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractClass.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractMethod.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractMethod.svg new file mode 100644 index 00000000..0ac6b954 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/abstractMethod.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/annotationtype.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/annotationtype.svg new file mode 100644 index 00000000..ce03c7e5 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/annotationtype.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/css.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/css.svg new file mode 100644 index 00000000..fad092bf --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/css.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/javaScript.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/javaScript.svg new file mode 100644 index 00000000..603b1d9f --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/javaScript.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/xhtml.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/xhtml.svg new file mode 100644 index 00000000..229a9660 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/objects/xhtml.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/warningDialog.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/warningDialog.svg new file mode 100644 index 00000000..ce5eb81d --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/extras/svg/warningDialog.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/RecentlyUsed.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/RecentlyUsed.svg new file mode 100644 index 00000000..10e24cb8 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/RecentlyUsed.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/back_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/back_dark.svg deleted file mode 100644 index 88abaa73..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/back_dark.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/download_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/download_dark.svg deleted file mode 100644 index 3e58c7d6..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/download_dark.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/favorite.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/favorite.svg new file mode 100644 index 00000000..592c1dcc --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/favorite.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/forward_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/forward_dark.svg deleted file mode 100644 index d031c78f..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/forward_dark.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png new file mode 100644 index 00000000..c006c56f Binary files /dev/null and b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png differ diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess@2x.png b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess@2x.png new file mode 100644 index 00000000..b1a2398e Binary files /dev/null and b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess@2x.png differ diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-cut_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-cut_dark.svg deleted file mode 100644 index 6bae57d8..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-cut_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste.svg index 1debae89..0e88bad0 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste.svg +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste.svg @@ -1,3 +1,3 @@ - + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste_dark.svg deleted file mode 100644 index 10ca357f..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/menu-paste_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/redo_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/redo_dark.svg deleted file mode 100644 index 63b1a69d..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/redo_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/refresh_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/refresh_dark.svg deleted file mode 100644 index 0b0f5440..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/refresh_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/search.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/search.svg new file mode 100644 index 00000000..1cf5bf50 --- /dev/null +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/show_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/show_dark.svg deleted file mode 100644 index 24255733..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/show_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/undo_dark.svg b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/undo_dark.svg deleted file mode 100644 index 1ab3b7f3..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/icons/undo_dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_dark_fuchsia.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_dark_fuchsia.theme.json deleted file mode 100644 index 2881d526..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_dark_fuchsia.theme.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "name": "Gradianto Dark Fuchsia", - "dark": true, - "author": "", - "editorScheme": "/Gradianto_dark_fuchsia.xml", - "ui": { - "*": { - "background": "#20022d", - "foreground": "#9ca9af", - - "infoForeground": "#6aaf41", - - "selectionBackground": "#4d086d", - "selectionForeground": "#c9c9c9", - "selectionInactiveBackground": "#37064e", - - - "disabledForeground": "#646464", - "disabledBackground": "#250434", - "inactiveBackground": "#250434", - - "errorForeground": "#cd860b", - - "disabledText": "#646464", - "Borders.ContrastBorderColor" : "#2b033b", - "borderColor": "#38044e", - "disabledBorderColor": "#22022f", - "focusColor" : "#550979", - "focusedBorderColor": "#550979", - - "separatorColor": "#2d033f" - }, - - "ActionButton": { - "hoverBackground": "#320647", - "pressedBackground": "#42075c", - "hoverBorderColor": "#58077c", - "pressedBorderColor": "#3c0555" - }, - - "Borders": { - "color": "#38044e", - "ContrastBorderColor": "#38044e" - }, - - - "Button": { - "startBackground": "#41295a", - "endBackground": "#2F0743", - "startBorderColor": "#400080", - "endBorderColor": "#6300c5", - "shadowColor" : "#400080", - "focusedBorderColor" : "#550979", - "default.focusColor": "#550979", - "disabledBorderColor" : "#2e005d", - "default": { - "startBackground": "#41295a", - "endBackground": "#2f0743", - "startBorderColor": "#400080", - "endBorderColor": "#6300c5", - "focusedBorderColor": "#550979", - "focusColor": "#550979" - } - - }, - - "RadioButton": { - "background" : "#41295a", - "foreground": "#2f0743" - }, - - "CompletionPopup": { - "matchForeground": "#652683", - "matchSelectionForeground": "#9057f2" - }, - - "MenuBar.borderColor": "#550979", - "Menu.borderColor": "#2f0743", - - "NavBar.borderColor": "#2f0743", - - - "Notification": { - - "errorForeground": "#abb2bf", - "errorBackground": "#280e29", - "errorBorderColor": "#692746", - - "ToolWindow": { - "informativeForeground": "#abb2bf", - "informativeBackground": "#4b1d62", - "informativeBorderColor": "#3f2d55", - - "warningForeground": "#abb2bf", - "warningBackground": "#735822", - "warningBorderColor": "#5f4422", - - "errorForeground": "#abb2bf", - "errorBackground": "#802d43", - "errorBorderColor": "#552029" - } - }, - - "ComboBox": { - "background" : "#300444", - "nonEditableBackground": "#170b16", - "ArrowButton": { - "iconColor": "#aeb0b2", - "disabledIconColor": "#2a043c", - "nonEditableBackground": "#2c152a" - } - }, - - "Editor": { - "shortcutForeground": "#477924" - }, - - "EditorTabs": { - - "selectedForeground": "#c9c9c9", - "selectedBackground": "#4e086f", - "underlinedTabBackground": "58097e", - "underlineColor": "#58097e", - "inactiveMaskColor": "#280a2fff" - }, - - "Link": { - "activeForeground": "#ede891", - "hoverForeground": "#ede891", - "pressedForeground": "#ede891", - "visitedForeground": "#ede891" - }, - - "FileColor": { - "Yellow": "#d19a6614", - "Green": "#98c37915", - "Blue": "#61afef15", - "Violet": "#542a4f", - "Orange": "#d13c0015", - "Rose": "#ae002f20" - }, - - "Tree.background": "#2d0340", - - "SearchEverywhere": { - - - "Tab": { - "selectedForeground": "#c9c9c9", - "selectedBackground": "#4d086d" - } - }, - - "SearchMatch": { - "startBackground": "#d379f2", - "endBackground": "#d379f2" - }, - - "WelcomeScreen": { - "Projects.selectionInactiveBackground": "#37064e", - "separatorColor": "#2d033f" - }, - - "ValidationTooltip": { - "errorBackground": "#802d43", - "errorBorderColor": "#802d43", - "warningBackground": "#735822", - "warningBorderColor": "#5f4422" - }, - - "Table": { - "stripeColor": "#2d033f", - "selectionForeground": "#c9c9c9", - "dropLineColor": "#2d033f", - "focusCellForeground": "#abb2bf", - "gridColor": "#35064c" - }, - - "ProgressBar": { - "trackColor": "#280a2f", - "progressColor": "#e78af2", - "indeterminateStartColor": "#e78af2", - "indeterminateEndColor": "#523569", - "failedColor": "#ad3864", - "failedEndColor": "#47221d", - "passedColor": "#60649e", - "passedEndColor": "#251642" - }, - - "PopupMenu.translucentBackground": "#4d086d", - - "Popup": { - "paintBorder": true, - "Header.activeBackground": "#4e086f", - "Header.inactiveBackground": "#4d086d", - "separatorColor" : "#5e0a85", - "separatorForeground": "#5e0a85", - "Advertiser": { - "background": "#490768", - "borderColor": "#490768", - "borderInsets": "3,8,5,0" - } - }, - "ToggleButton": { - "onForeground": "#4d086d", - "onBackground": "#9ca9af", - "offForeground": "#646464", - "offBackground": "#280a2f", - "buttonColor": "#4e086f", - "borderColor": "#4e086f" - }, - "ToolTip": { - "background": "#450073", - "Actions.background": "#331432" - }, - - "ToolWindow": { - "Header": { - "background": "#3b0063", - "inactiveBackground": "#370c41" - }, - - "HeaderTab": { - "selectedBackground": "#9C23D9FF", - "selectedInactiveBackground": "#4D0080FF", - "hoverBackground": "#9C23D9FF", - "hoverInactiveBackground": "#4D0080FF" - }, - - "Button": { - "hoverBackground": "#320647", - "selectedBackground": "#42075c", - "selectedForeground": "#9ca9af" - } - }, - "DragAndDrop": { - "areaForeground": "#FFFFFF", - "areaBackground": "#42075c", - "areaBorderColor": "#4d0080" - }, - "Plugins": { - "SectionHeader.background": "#4d0080", - "tagBackground": "#42075c", - "lightSelectionBackground": "#41075b" - }, - "EditorPane.inactiveBackground": "#1a0225" - }, - "icons": { - "ColorPalette": { - "Checkbox.Background.Default.Dark": "#3c0555", - "Checkbox.Border.Default.Dark": "#460561", - "Checkbox.Foreground.Selected.Dark": "#6aae41", - - "Objects.Grey": "#9b8ebe", - "Objects.Blue": "#05b4a1", - "Objects.RedStatus": "#a8191aff", - "Objects.Red": "#aa3c3aff", - "Objects.Pink": "#d16979ff", - "Objects.Yellow": "#be9418ff", - "Objects.Green": "#009c0eff", - "Objects.Purple": "#6b48a6ff", - "Objects.BlackText": "#131313ff", - "Objects.YellowDark": "#8a6c1aff", - "Objects.GreenAndroid": "#008b14ff" - } - } -} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json deleted file mode 100644 index d2dafd0b..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.theme.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "author": "Vlad Volkov", - "colors": { - "accent": "#FFC83C", - "greyDot15": "#d8d8d8", - "greyDot25": "#bfbfbf", - "greyDot33": "#aaaaaa", - "greyDot50": "#7d7d7d", - "greyDot65": "#5a5a5a", - "greyDot70": "#4d4d4d", - "greyDot75": "#434343", - "greyDot80": "#323232", - "greyDot85": "#252525", - "greyDot90": "#191919", - "navyDot85": "#191d21", - "navyDot90": "#1f2021", - "lightBlue": "#90dae6", - "green": "#5B8021", - "red": "#800040", - "desaturatedBlue": "#1e282d", - "desaturatedOrange": "#8049117f", - "transparentGreen": "#5B80217f", - "transparentRed": "#8000407f", - "transparentYellow": "#8066357f", - "transparentViolet": "#9478F67f", - "yellow": "#806635" - }, - "dark": true, - "editorScheme": "/Hiberbee.xml", - "icons": { - "ColorPalette": { - "Actions.Grey": "#afafaf", - "Actions.Red": "#ff0072", - "Actions.Yellow": "#f7cd46", - "Actions.Green": "#A6E22E", - "Actions.Blue": "#307bf6", - "Actions.GreyInline": "#afafaf", - "Actions.GreyInline.Dark": "#7d7d7d", - "Objects.Grey": "#c8c8c8", - "Objects.RedStatus": "#EC5F5D", - "Objects.Red": "#ff0072", - "Objects.Pink": "#ffa9ca", - "Objects.Yellow": "#f7cd46", - "Objects.Green": "#78b756", - "Objects.Purple": "#9478f6", - "Objects.BlackText": "#4d4d4d", - "Objects.Blue": "#49b0f1", - "Objects.YellowDark": "#fd971f", - "Objects.GreenAndroid": "#78c856" - } - }, - "name": "Hiberbee", - "ui": { - "ActionButton.hoverBackground": "greyDot65", - "ActionButton.hoverBorderColor": "greyDot50", - "ActionButton.pressedBackground": "greyDot65", - "Borders.ContrastBorderColor": "greyDot65", - "ActionButton.pressedBorderColor": "lightBlue", - "Borders.color": "greyDot65", - "Button.arc": "5", - "Button.background": "greyDot80", - "Button.default.endBackground": "greyDot80", - "Button.default.endBorderColor": "greyDot65", - "Button.default.startBorderColor": "greyDot65", - "Button.default.focusColor": "greyDot50", - "Button.default.focusedBorderColor": "lightBlue", - "Button.default.foreground": "greyDot25", - "Button.default.shadowColor": "navyDot90", - "Button.default.startBackground": "greyDot80", - "Button.endBackground": "greyDot80", - "Button.startBorderColor": "greyDot65", - "Button.endBorderColor": "greyDot65", - "Button.focusedBorderColor": "accent", - "Button.foreground": "greyDot25", - "Button.shadowColor": "navyDot90", - "Button.shadowWidth": "0", - "Button.startBackground": "greyDot80", - "CheckBox.background": "greyDot80", - "CheckBoxMenuItem.background": "greyDot80", - "CheckBoxMenuItem.disabledBackground": "greyDot85", - "CheckBoxMenuItem.selectionForeground": "accent", - "ComboBox.ArrowButton.disabledIconColor": "greyDot50", - "ComboBox.ArrowButton.iconColor": "accent", - "ComboBox.ArrowButton.nonEditableBackground": "greyDot70", - "ComboBox.background": "greyDot80", - "ComboBox.modifiedItemForeground": "accent", - "ComboBox.nonEditableBackground": "greyDot75", - "ComboPopup.border": "1,1,1,1,5a5a5a", - "CompletionPopup.foreground": "greyDot25", - "CompletionPopup.matchForeground": "accent", - "CompletionPopup.selectionBackground": "navyDot85", - "CompletionPopup.selectionInactiveBackground": "greyDot80", - "Component.arc": "5", - "Component.borderColor": "greyDot65", - "Component.errorFocusColor": "red", - "Component.focusColor": "accent", - "Component.focusWidth": "0", - "Component.focusedBorderColor": "greyDot50", - "Component.hoverIconColor": "accent", - "Component.iconColor": "lightBlue", - "Component.inactiveErrorFocusColor": "transparentRed", - "Component.inactiveWarningFocusColor": "transparentYellow", - "Component.warningFocusColor": "yellow", - "Counter.background": "greyDot80", - "Counter.foreground": "greyDot25", - "Debugger.Variables.changedValueForeground": "accent", - "Debugger.Variables.evaluatingExpressionForeground": "lightBlue", - "DebuggerPopup.borderColor": "greyDot65", - "DefaultTabs.background": "greyDot80", - "DefaultTabs.borderColor": "greyDot65", - "DefaultTabs.hoverBackground": "navyDot85", - "DefaultTabs.underlineColor": "accent", - "DefaultTabs.underlineHeight": 1, - "DefaultTabs.underlinedTabBackground": "greyDot75", - "DefaultTabs.underlinedTabForeground": "lightBlue", - "DragAndDrop.areaBackground": "greyDot75", - "DragAndDrop.areaForeground": "greyDot25", - "Editor.background": "greyDot90", - "Editor.foreground": "greyDot25", - "EditorPane.background": "greyDot80", - "EditorPane.caretForeground": "accent", - "EditorPane.foreground": "greyDot25", - "EditorPane.inactiveBackground": "greyDot85", - "EditorPane.inactiveForeground": "greyDot50", - "EditorPane.selectionBackground": "navyDot85", - "EditorPane.selectionForeground": "accent", - "EditorTabs.underlineHeight": 1, - "FileColor.Blue": "#23282d", - "FileColor.Green": "#232d28", - "FileColor.Orange": "#2d2823", - "FileColor.Rose": "#2d2323", - "FileColor.Violet": "#2D232D", - "FileColor.Yellow": "#2d2d23", - "GutterTooltip.infoForeground": "greyDot50", - "InplaceRefactoringPopup.borderColor": "lightBlue", - "Label.background": "greyDot80", - "Link.activeForeground": "lightBlue", - "Link.hoverForeground": "accent", - "Link.pressedForeground": "lightBlue", - "Link.visitedForeground": "greyDot25", - "List.background": "greyDot80", - "List.selectionBackground": "navyDot85", - "List.selectionForeground": "accent", - "MemoryIndicator.allocatedBackground": "green", - "MemoryIndicator.usedBackground": "red", - "Menu.acceleratorForeground": "greyDot25", - "Menu.acceleratorSelectionForeground": "accent", - "Menu.background": "greyDot80", - "Menu.borderColor": "greyDot65", - "Menu.foreground": "greyDot25", - "Menu.selectionForeground": "accent", - "Menu.separatorColor": "greyDot65", - "MenuBar.borderColor": "greyDot65", - "MenuBar.selectionBackground": "navyDot85", - "MenuBar.shadow": "navyDot90", - "MenuItem.selectionForeground": "accent", - "Notification.MoreButton.background": "greyDot85", - "Notification.MoreButton.innerBorderColor": "greyDot65", - "Notification.ToolWindow.errorBackground": "red", - "Notification.ToolWindow.errorBorderColor": "greyDot50", - "Notification.ToolWindow.errorForeground": "greyDot15", - "Notification.ToolWindow.informativeBackground": "#304000", - "Notification.ToolWindow.informativeBorderColor": "greyDot65", - "Notification.ToolWindow.informativeForeground": "greyDot15", - "Notification.ToolWindow.warningBackground": "yellow", - "Notification.ToolWindow.warningBorderColor": "greyDot65", - "Notification.ToolWindow.warningForeground": "greyDot15", - "Notification.background": "greyDot85", - "Notification.errorBackground": "red", - "Notification.errorBorderColor": "greyDot65", - "Notification.errorForeground": "greyDot15", - "Notification.foreground": "greyDot25", - "OptionPane.background": "greyDot80", - "OptionPane.foreground": "greyDot25", - "Panel.background": "greyDot80", - "Panel.foreground": "greyDot25", - "ParameterInfo.background": "greyDot85", - "ParameterInfo.currentOverloadBackground": "lightBlue", - "ParameterInfo.currentParameterForeground": "accent", - "ParameterInfo.foreground": "greyDot25", - "ParameterInfo.infoForeground": "greyDot33", - "ParameterInfo.lineSeparatorColor": "greyDot70", - "Plugins.Button.installBackground": "greyDot80", - "Plugins.Button.installBorderColor": "greyDot65", - "Plugins.Button.installFillBackground": "greyDot80", - "Plugins.Button.installFillForeground": "greyDot25", - "Plugins.Button.installForeground": "accent", - "Plugins.SearchField.background": "greyDot75", - "Plugins.SectionHeader.background": "greyDot75", - "Plugins.SectionHeader.foreground": "greyDot25", - "Plugins.Tab.hoverBackground": "navyDot85", - "Plugins.Tab.selectedBackground": "greyDot85", - "Plugins.background": "greyDot80", - "Plugins.disabledForeground": "greyDot50", - "Plugins.lightSelectionBackground": "greyDot70", - "Plugins.tagBackground": "greyDot85", - "Plugins.tagForeground": "greyDot25", - "Popup.Advertiser.background": "greyDot85", - "Popup.Advertiser.foreground": "greyDot50", - "Popup.Header.activeBackground": "greyDot75", - "Popup.Header.inactiveBackground": "greyDot85", - "Popup.paintBorder": true, - "PopupMenu.background": "greyDot80", - "PopupMenu.foreground": "greyDot25", - "PopupMenu.selectionBackground": "navyDot85", - "PopupMenu.selectionForeground": "lightBlue", - "PopupMenuSeparator.stripeWidth": 1, - "ProgressBar.failedColor": "red", - "ProgressBar.failedEndColor": "greyDot65", - "ProgressBar.indeterminateEndColor": "greyDot25", - "ProgressBar.indeterminateStartColor": "accent", - "ProgressBar.passedColor": "green", - "ProgressBar.passedEndColor": "greyDot65", - "ProgressBar.progressColor": "accent", - "ProgressBar.trackColor": "greyDot75", - "RadioButton.background": "greyDot75", - "ScrollBar.Mac.hoverTrackColor": "greyDot75", - "ScrollBar.Mac.trackColor": "greyDot75", - "ScrollPane.background": "greyDot85", - "ScrollPane.foreground": "greyDot25", - "SearchEverywhere.Advertiser.background": "greyDot85", - "SearchEverywhere.Advertiser.foreground": "greyDot33", - "SearchEverywhere.Header.background": "greyDot85", - "SearchEverywhere.List.separatorColor": "greyDot70", - "SearchEverywhere.List.separatorForeground": "greyDot70", - "SearchEverywhere.SearchField.background": "greyDot75", - "SearchEverywhere.SearchField.borderColor": "greyDot70", - "SearchEverywhere.SearchField.infoForeground": "greyDot50", - "SearchEverywhere.Tab.selectedBackground": "greyDot70", - "SearchEverywhere.Tab.selectedForeground": "accent", - "SearchMatch.endBackground": "accent", - "SearchMatch.startBackground": "accent", - "Separator.separatorColor": "greyDot70", - "SidePanel.background": "greyDot85", - "Slider.background": "greyDot80", - "Slider.focus": "greyDot65", - "SpeedSearch.background": "greyDot80", - "SpeedSearch.borderColor": "greyDot70", - "SpeedSearch.errorForeground": "red", - "SpeedSearch.foreground": "accent", - "SplitPane.background": "greyDot80", - "SplitPane.darkShadow": "navyDot90", - "SplitPane.highlight": "accent", - "SplitPane.shadow": "navyDot90", - "TabbedPane.background": "greyDot80", - "TabbedPane.contentAreaColor": "greyDot80", - "TabbedPane.disabledUnderlineColor": "greyDot75", - "TabbedPane.focusColor": "greyDot65", - "TabbedPane.foreground": "greyDot25", - "TabbedPane.hoverColor": "navyDot85", - "TabbedPane.tabSelectionHeight": 1, - "TabbedPane.underlineColor": "accent", - "Table.background": "greyDot80", - "Table.dropLineColor": "greyDot75", - "Table.dropLineShortColor": "greyDot70", - "Table.focusCellForeground": "accent", - "Table.selectionBackground": "navyDot85", - "Table.selectionForeground": "accent", - "Table.sortIconColor": "accent", - "Table.stripeColor": "greyDot75", - "TableHeader.background": "greyDot85", - "TableHeader.bottomSeparatorColor": "greyDot75", - "TableHeader.separatorColor": "greyDot70", - "TextArea.background": "greyDot85", - "TextArea.caretForeground": "accent", - "TextArea.foreground": "greyDot25", - "TextArea.selectionBackground": "navyDot85", - "TextField.background": "greyDot75", - "TextField.caretForeground": "accent", - "TextField.darkShadow": "navyDot90", - "TextField.foreground": "greyDot25", - "TextField.highlight": "greyDot15", - "TextField.selectionBackground": "navyDot85", - "TextPane.background": "greyDot80", - "TitlePane.background": "greyDot85", - "ToggleButton.borderColor": "greyDot70", - "ToggleButton.buttonColor": "greyDot75", - "ToggleButton.offBackground": "greyDot75", - "ToggleButton.offForeground": "greyDot25", - "ToggleButton.onBackground": "greyDot50", - "ToggleButton.onForeground": "accent", - "ToolBar.background": "greyDot80", - "ToolBar.borderHandleColor": "greyDot70", - "ToolBar.darkShadow": "navyDot90", - "ToolBar.shadow": "navyDot90", - "ToolTip.Actions.background": "greyDot80", - "ToolTip.Actions.infoForeground": "greyDot50", - "ToolTip.background": "greyDot75", - "ToolTip.foreground": "greyDot25", - "ToolTip.infoForeground": "greyDot50", - "ToolWindow.Button.hoverBackground": "navyDot85", - "ToolWindow.Button.selectedBackground": "greyDot70", - "ToolWindow.Button.selectedForeground": "accent", - "ToolWindow.Header.background": "greyDot85", - "ToolWindow.Header.inactiveBackground": "greyDot80", - "ToolWindow.HeaderTab.hoverBackground": "navyDot85", - "ToolWindow.HeaderTab.hoverInactiveBackground": "navyDot90", - "ToolWindow.HeaderTab.inactiveUnderlineColor": "greyDot75", - "ToolWindow.HeaderTab.selectedInactiveBackground": "greyDot80", - "ToolWindow.HeaderTab.underlineColor": "accent", - "ToolWindow.HeaderTab.underlineHeight": 1, - "ToolWindow.HeaderTab.underlinedTabInactiveBackground": "greyDot75", - "Tree.background": "greyDot85", - "Tree.modifiedItemForeground": "accent", - "Tree.paintLines": 0, - "Tree.rowHeight": 20, - "Tree.selectionBackground": "navyDot85", - "Tree.selectionForeground": "accent", - "Tree.selectionInactiveBackground": "navyDot90", - "ValidationTooltip.errorBackground": "red", - "ValidationTooltip.errorBorderColor": "greyDot65", - "ValidationTooltip.warningBackground": "#805e00", - "ValidationTooltip.warningBorderColor": "greyDot65", - "VersionControl.FileHistory.Commit.selectedBranchBackground": "greyDot70", - "VersionControl.Log.Commit.currentBranchBackground": "greyDot85", - "VersionControl.Log.Commit.unmatchedForeground": "greyDot25", - "WelcomeScreen.Projects.selectionBackground": "navyDot85", - "WelcomeScreen.Projects.selectionInactiveBackground": "navyDot90", - "WelcomeScreen.separatorColor": "greyDot65", - "Window.border": "0,0,0,0,5a5a5a" - } -} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.LICENSE.txt b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.LICENSE.txt deleted file mode 100644 index 98783834..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 CloudCannon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.theme.json deleted file mode 100644 index ab2d5768..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Light.theme.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "name": "IntelliJ Light Preview", - "dark": false, - "author": "", - "editorScheme": "/Light.xml", - - "ui": { - "*": { - "selectionBackground": "#2675BF", - "selectionBackgroundInactive": "#D5D5D5", - "selectionInactiveBackground": "#D5D5D5", - - "disabledForeground": "#8C8C8C", - "disabledText": "#8C8C8C", - "inactiveForeground": "#8C8C8C", - - "infoForeground": "#808080", - "modifiedItemForeground": "#005ad9", - - "acceleratorSelectionForeground": "#FFFFFF", - - "separatorColor": "#d1d1d1", - "separatorForeground": "#999999" - }, - - "Borders": { - "color": "#D1D1D1", - "ContrastBorderColor": "#D1D1D1" - }, - - "Button": { - "shadowColor": "#A6A6A620", - "startBorderColor": "#C4C4C4", - "endBorderColor": "#C4C4C4", - "default": { - "foreground": "#FFFFFF", - "startBackground": "#528CC7", - "endBackground": "#4989CC", - "startBorderColor": "#487EB8", - "endBorderColor": "#346DAD", - "shadowColor": "#A6A6A650", - "focusedBorderColor": "#A9C9F5" - } - }, - - "ComboBox": { - "background": "#FFFFFF", - "nonEditableBackground": "#FFFFFF", - "ArrowButton.background": "#fafafa" - }, - - "ComboBoxButton.background": "#FFFFFF", - - "CompletionPopup": { - "selectionBackground": "#c5dffc", - "selectionInactiveBackground": "#e0e0e0" - }, - - "Component.borderColor": "#C4C4C4", - - "DefaultTabs.background": "#F2F2F2", - - "EditorTabs.underlinedTabBackground": "#ffffff", - - "Editor": { - "background": "#cccccc", - "foreground": "#737373", - "shortcutForeground": "#4274A6" - }, - - "Label.errorForeground": "#C7222D", - - "Link": { - "activeForeground": "#2470B3", - "hoverForeground": "#2470B3", - "pressedForeground": "#2470B3", - "visitedForeground": "#2470B3", - "secondaryForeground": "#77a8d9" - }, - - "Notification": { - "borderColor": "#D1D1D1" - }, - - "Menu.borderColor": "#d9d9d9", - - "Panel.background": "#F2F2F2", - - "PasswordField.background": "#FFFFFF", - - "Popup": { - "separatorColor": "#d9d9d9", - "Advertiser.borderColor": "#D1D1D1", - "borderColor": "#adadad" - }, - - "ProgressBar": { - "trackColor": "#D1D1D1", - "progressColor": "#1E82E6", - "indeterminateStartColor": "#91C5F2", - "indeterminateEndColor": "#1E82E6" - }, - - "StatusBar.borderColor": "#D1D1D1", - - "ToolWindow.Header.inactiveBackground": "#F2F2F2", - - "Tree.rowHeight": 20 - }, - - "icons": { - - "ColorPalette": { - "Checkbox.Border.Default": "#b0b0b0", - "Checkbox.Background.Selected": "#4F9EE3", - "Checkbox.Border.Selected": "#4B97D9" - } - } -} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/gruvbox_theme.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/gruvbox_theme.theme.json deleted file mode 100644 index 895d59fb..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/gruvbox_theme.theme.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "name": "gruvbox-theme", - "dark": true, - "author": "Vincent Parizet", - "editorScheme": "/gruvbox_theme.xml", - "ui": { - "*": { - "background": "#282828", - "foreground": "#fbf1c7", - - "infoForeground": "#ebdbb2", - - "lightSelectionBackground": "#3c3836", - "selectionBackground": "#4F4945", - "selectionForeground": "#fbf1c7", - - "selectionBackgroundInactive": "#3c3836", - - "selectedBackground": "#1d2021", - "selectedForeground": "#fbf1c7", - "selectedInactiveBackground": "#3c3836", - "selectedBackgroundInactive": "#3c3836", - - "hoverBackground": "#28282866", - - "borderColor": "#3c3836", - "disabledBorderColor": "#1d2021", - - "separatorColor": "#3c3836" - }, - "ActionButton": { - "hoverBackground": "#504945" - }, - "Button": { - "startBackground": "#282828", - "endBackground": "#282828", - "startBorderColor": "#504945", - "endBorderColor": "#504945", - - "default": { - "foreground": "#fbf1c7", - "startBackground": "#32302F", - "endBackground": "#32302F", - "startBorderColor": "#4F4945", - "endBorderColor": "#4F4945", - "focusedBorderColor": "#282828" - } - }, - "ComboBox": { - "nonEditableBackground": "#282828", - "ArrowButton": { - "iconColor": "#fbf1c7", - "disabledIconColor": "#fbf1c7", - "nonEditableBackground": "#282828" - } - }, - "EditorTabs": { - "selectedBackground": "#3c3836", - "underlineColor": "#83a598", - "inactiveMaskColor": "#28282866" - }, - "ToolWindow": { - "Header": { - "background": "#3c3836", - "inactiveBackground": "#282828" - }, - - "HeaderTab": { - "selectedInactiveBackground": "#1d2021", - "hoverInactiveBackground": "#1d2021" - } - }, - "Table": { - "stripeColor": "#3c3836", - "lightSelectionForeground": "#fbf1c7", - "lightSelectionInactiveForeground":"#a89984", - "lightSelectionBackground": "#504945", - "lightSelectionInactiveBackground":"#282828" - }, - "FileColor": { - "Yellow": "#fabd2f22", - "Green": "#b8bb2622", - "Blue": "#83a59822", - "Violet": "#d3869b22", - "Orange": "#fe801922", - "Rose": "#cc241d22" - }, - "Link": { - "activeForeground": "#83a598", - "hoverForeground": "#83a598", - "pressedForeground": "#83a598", - "visitedForeground": "#83a598" - } - }, - "icons": { - "ColorPalette": { - "Actions.Grey": "#928374", - "Actions.Red": "#fb4934", - "Actions.Yellow": "#fabd2f", - "Actions.Green": "#98971a", - "Actions.Blue": "#458588", - "Actions.GreyInline.Dark": "#fbf1c7", - - "Objects.Grey": "#928374FF", - "Objects.RedStatus": "#fb4934FF", - "Objects.Red": "#fb4934FF", - "Objects.Pink": "#d3869bFF", - "Objects.Yellow": "#fabd2fFF", - "Objects.Green": "#98971aFF", - "Objects.Blue": "#458588FF", - "Objects.Purple": "#b16286FF", - "Objects.BlackText": "#000000FF", - "Objects.YellowDark": "#d79921FF", - "Objects.GreenAndroid": "#b8bb26FF", - - "Checkbox.Background.Default.Dark": "#282828", - "Checkbox.Border.Default.Dark": "#fbf1c7", - "Checkbox.Foreground.Selected.Dark": "#fbf1c7", - "Checkbox.Focus.Wide.Dark": "#458588", - "Checkbox.Focus.Thin.Default.Dark": "#458588", - "Checkbox.Focus.Thin.Selected.Dark": "#458588", - "Checkbox.Background.Disabled.Dark": "#282828", - "Checkbox.Border.Disabled.Dark": "#a89984", - "Checkbox.Foreground.Disabled.Dark": "#a89984" - } - } -} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.theme.json deleted file mode 100644 index ee1f247b..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.theme.json +++ /dev/null @@ -1,433 +0,0 @@ -{ - "name": "Solarized Dark", - "dark": true, - "author": "Tyler Thrailkill", - "editorScheme": "/themes/solarizedDark.xml", - "colors": { - "background": "#002b36", - "backgroundEmpty": "#00212c", - "backgroundHighlights": "#073642", - "backgroundHighlightsShading": "#073642ab", - "primaryText": "#839496", - "inverseBackground": "#fdf6e3", - "inverseBackgroundHighlights": "#eee8d5", - "inversePrimaryText": "#657b83", - "inverseSecondaryText": "#93a1a1", - "inverseEmphasizedContent": "#586e75", - "secondaryText": "#586e75", - "backgroundHighlightsShade1": "#074855", - "backgroundHighlightsShade2": "#0A677A", - "backgroundHighlightsShade2Shading": "#0A677Ac3", - "emphasizedContent": "#93a1a1", - "yellow": "#074855", - "green": "#213d37", - "blue": "#2aa198", - "violet": "#6c71c4", - "orange": "#cb4b16", - "rose": "#dc322f", - "maskColor": "#0d0d0d" - }, - "ui": { - "*": { - "background": "backgroundHighlights", - "foreground": "primaryText", - - "infoForeground": "secondaryText", - - "selectionBackground": "inverseEmphasizedContent", - "selectionForeground": "inverseBackground", - "selectionInactiveBackground": "backgroundHighlightsShade1", - "selectionBackgroundInactive": "backgroundHighlightsShade1", - - "lightSelectionBackground": "backgroundHighlightsShade1", - "lightSelectionForeground": "primaryText", - "lightSelectionInactiveBackground": "backgroundHighlights", - "lightSelectionInactiveForeground":"primaryText", - - "disabledBackground": "background", - "inactiveBackground": "background", - - "disabledForeground": "secondaryText", - "disabledText": "secondaryText", - "inactiveForeground": "secondaryText", - - "acceleratorForeground": "primaryText", - "acceleratorSelectionForeground": "primaryText", - - "errorForeground": "#dd3962", - - "borderColor": "emphasizedContent", - "disabledBorderColor": "secondaryText", - - "focusColor": "#778282", - "focusedBorderColor": "emphasizedContent", - - "separatorForeground": "secondaryText", - "separatorColor": "backgroundHighlightsShade1", - "lineSeparatorColor": "#55506b", - - "modifiedItemForeground": "#b279f2" - }, - - "//": "affects buttons like the 'Play' or 'Debug' buttons", - "ActionButton": { - "hoverBackground": "backgroundHighlightsShade1", - "hoverBorderColor": "backgroundHighlightsShade1", - "pressedBackground": "backgroundHighlightsShade1", - "pressedBorderColor": "backgroundHighlightsShade1" - }, - - "Button": { - "startBackground": "backgroundHighlightsShade1", - "endBackground": "backgroundHighlightsShade1", - "startBorderColor": "backgroundHighlights", - "endBorderColor": "backgroundHighlights", - "shadowColor": "background", - - "default": { - "foreground": "inverseBackground", - "startBackground": "backgroundHighlightsShade2", - "endBackground": "backgroundHighlightsShade2", - "startBorderColor": "backgroundHighlightsShade2Shading", - "endBorderColor": "backgroundHighlightsShade2Shading", - "focusedBorderColor": "primaryText", - "focusColor": "#778282", - "shadowColor": "background" - } - }, - - "Borders": { - "color": "backgroundHighlights", - "ContrastBorderColor": "background" - }, - - "CheckBox": { - "background": "background" - }, - - "COMMENT:": "you can put comments in like this", - "ComboBox": { - "nonEditableBackground": "backgroundHighlightsShade1", - "background": "backgroundHighlightsShading", - "ArrowButton": { - "iconColor": "emphasizedContent", - "disabledIconColor": "primaryText", - "nonEditableBackground": "backgroundHighlightsShade1" - } - }, - - "ComboPopup.border": "1,1,1,1,64647A", - - "CompletionPopup": { - "matchForeground": "#ED94FF", - "matchSelectionForeground": "#ED94FF" - }, - - "Component": { - "errorFocusColor": "#993750", - "inactiveErrorFocusColor": "#522530", - "warningFocusColor": "#8c812b", - "inactiveWarningFocusColor": "#47441f", - "iconColor": "#77728fCC", - "hoverIconColor": "#8b85a6" - }, - - "Counter": { - "background": "#FFFFFF80", - "foreground": "#000000" - }, - - "DebuggerPopup.borderColor": "#524e66", - - "DefaultTabs": { - "background": "backgroundHighlightsShade1", - "borderColor": "backgroundHighlightsShade1", - "hoverBackground": "backgroundHighlightsShade2", - "inactiveUnderlineColor": "backgroundHighlightsShade2", - "underlineColor": "backgroundHighlightsShade2", - "underlinedTabBackground": "backgroundHighlights", - "underlinedTabForeground": "primaryText", - "underlineHeight": 5 - }, - - "DragAndDrop": { - "areaForeground": "primaryText", - "areaBackground": "#702F91", - "areaBorderColor": "#343142" - }, - - "Editor": { - "background": "background", - "foreground": "emphasizedContent", - "shortcutForeground": "#2aa198" - }, - - "EditorPane.inactiveBackground": "background", - - "EditorTabs": { - "borderColor": "background", - "underlineColor": "backgroundHighlights", - "inactiveUnderlineColor": "background", - "background": "backgroundHighlightsShade1", - "underlinedTabBackground": "background", - "hoverMaskColor": "backgroundHighlightsShade2", - "underlinedTabForeground": "primaryText", - "inactiveColoredFileBackground": "backgroundHighlightsShade1", - "underlineHeight": 0 - }, - - "FileColor": { - "Yellow": "yellow", - "Green": "green", - "Blue": "blue", - "Violet": "violet", - "Orange": "orange", - "Rose": "rose" - }, - - "InplaceRefactoringPopup.borderColor": "#474359", - - "Link": { - "activeForeground": "#7094ff", - "hoverForeground": "#7094FF", - "pressedForeground": "#7094FF", - "visitedForeground": "#7094FF" - }, - - "NavBar.borderColor": "#1a1721", - - "Notification": { - "background": "backgroundHighlightsShade1", - "borderColor": "backgroundHighlights", - - "errorForeground": "primaryText", - "errorBackground": "#4d232e", - "errorBorderColor": "#802e44", - - "MoreButton.innerBorderColor": "#1a1721", - - "ToolWindow": { - "informativeForeground": "primaryText", - "informativeBackground": "#2e4280", - "informativeBorderColor": "#17254d", - - "warningForeground": "primaryText", - "warningBackground": "backgroundHighlights", - "warningBorderColor": "#403013", - - "errorForeground": "primaryText", - "errorBackground": "#802d43", - "errorBorderColor": "#4d1c2b" - } - }, - - "Panel": { - "background": "background" - }, - - "ParameterInfo": { - "background": "backgroundHighlightsShade1", - "foreground": "primaryText", - "infoForeground": "ababb3", - "currentOverloadBackground": "backgroundHighlights", - "currentParameterForeground": "primaryText" - }, - - "Plugins": { - "SearchField.borderColor": "emphasizedContent", - "SearchField.background": "background", - "SectionHeader.background": "backgroundHighlights", - "tagBackground": "backgroundHighlightsShade1", - "tagForeground": "primaryText", - - "Button": { - "installForeground": "primaryText", - "installBorderColor":"backgroundHighlightsShade1", - "installFillForeground": "primaryText", - "installFillBackground": "#713a91", - "updateForeground":"primaryText", - "updateBackground": "backgroundHighlightsShade1", - "updateBorderColor": "secondaryText" - } - }, - - "Popup": { - "paintBorder": true, - "borderColor": "backgroundHighlightsShade1", - "inactiveBorderColor": "backgroundHighlights", - "Toolbar.borderColor": "#1a1721", - "Header.activeBackground": "backgroundHighlightsShade1", - "Header.inactiveBackground": "backgroundHighlightsShade1", - "Advertiser": { - "foreground": "secondaryText", - "borderColor": "backgroundHighlightsShade1", - "borderInsets": "4,8,3,0" - } - }, - - "PopupMenu": { - "borderWidth": 1, - "borderInsets": "4,1,4,1" - }, - - "ProgressBar": { - "trackColor": "#1D1D26", - "progressColor": "#268bd2", - "indeterminateStartColor": "#268bd2", - "indeterminateEndColor": "#2aa198", - "failedColor": "#bd3c5f", - "failedEndColor": "#472c33", - "passedColor": "#239E62", - "passedEndColor": "#2b4242" - }, - - "SearchEverywhere": { - "Header.background": "backgroundHighlights", - "Tab": { - "selectedForeground": "primaryText", - "selectedBackground": "backgroundHighlightsShade1" - }, - "SearchField":{ - "background": "background", - "borderColor": "#1a1721" - }, - "Advertiser.foreground": "#8785a6" - }, - - "SearchMatch": { - "startBackground": "#cca929", - "endBackground": "#cca929" - }, - - "SpeedSearch": { - "foreground": "primaryText", - "borderColor": "backgroundHighlights", - "background": "background", - "errorForeground": "#ff80a1" - }, - - "StatusBar.borderColor": "background", - - "TabbedPane": { - "underlineColor": "backgroundHighlightsShade2", - "disabledUnderlineColor": "backgroundHighlightsShade2", - "contentAreaColor": "backgroundHighlights", - "background": "backgroundHighlightsShade1", - "foreground": "primaryText", - "disabledForeground": "primaryText", - "focusColor": "backgroundHighlights", - "hoverColor": "backgroundHighlightsShade2" - }, - - "TableHeader.cellBorder": "3,0,3,0", - - "Table.stripeColor": "backgroundHighlightsShade1", - - "TextArea": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade2" - }, - - "TextField": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade2" - }, - - "ToggleButton": { - "onForeground": "primaryText", - "onBackground": "#543073", - "offForeground": "#9f9fa6", - "offBackground": "background", - "buttonColor": "#666380", - "borderColor": "#666380" - }, - - "ToolTip": { - "background": "backgroundHighlightsShade1", - "Actions.background": "#323245" - }, - - "ToolWindow": { - "Header": { - "background": "backgroundHighlightsShade1", - "inactiveBackground": "backgroundHighlights", - "borderColor": "backgroundHighlights" - }, - - "HeaderTab": { - "selectedBackground": "#0a0a0a66", - "selectedInactiveBackground": "#0a0a0a4D", - "hoverBackground": "#0a0a0a66", - "hoverInactiveBackground": "#0a0a0a66" - }, - - "Button": { - "hoverBackground": "backgroundHighlightsShade1", - "selectedBackground": "backgroundHighlightsShade1", - "selectedForeground": "primaryText" - } - }, - - "Tree": { - "rowHeight": 20, - "background": "backgroundEmpty" - }, - - "ValidationTooltip": { - "errorBackground": "#802d43", - "errorBorderColor": "#4d1c2b", - "warningBackground": "#735822", - "warningBorderColor": "#403013" - }, - - "VersionControl": { - "Log.Commit": { - "currentBranchBackground": "green", - "unmatchedForeground": "#6d6a80" - }, - "FileHistory.Commit.selectedBranchBackground": "#202340" - }, - - "WelcomeScreen": { - "comments": "#713a91", - "separatorColor": "backgroundHighlights", - "Projects": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade1", - "selectionInactiveBackground": "backgroundHighlightsShade1" - } - } - }, - "icons": { - "ColorPalette": { - "Actions.Grey": "#a4a1b3", - "Actions.Red": "#cb4b16", - "Actions.Yellow": "#b58900", - "Actions.Green": "#5c65b8", - "Actions.Blue": "#268bd2", - "Actions.GreyInline.Dark": "#9f99bfb3", - - "Objects.Grey": "#9790ad", - "Objects.RedStatus": "#dd3962", - "Objects.Red": "#c63a5d", - "Objects.Pink": "#f98b9e", - "Objects.Yellow": "#caba2d", - "Objects.Green": "#239e62", - "Objects.Blue": "#598bff", - "Objects.Purple": "#af71e0", - "Objects.BlackText": "#000000ff", - "Objects.YellowDark": "#988c26", - "Objects.GreenAndroid": "#78c257", - - "Checkbox.Background.Default.Dark": "backgroundHighlightsShade1", - "Checkbox.Border.Default.Dark": "secondaryText", - "Checkbox.Foreground.Selected.Dark": "#a4a1b3", - "Checkbox.Focus.Wide.Dark": "emphasizedContent", - "Checkbox.Focus.Thin.Default.Dark": "primaryText", - "Checkbox.Focus.Thin.Selected.Dark": "primaryText", - "Checkbox.Background.Disabled.Dark": "backgroundHighlights", - "Checkbox.Border.Disabled.Dark": "backgroundHighlightsShade1", - "Checkbox.Foreground.Disabled.Dark": "secondaryText" - } - } -} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.LICENSE.txt b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.LICENSE.txt deleted file mode 100644 index 68011d97..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2019 Tyler B. Thrailkill - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.theme.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.theme.json deleted file mode 100644 index e8960754..00000000 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_light_theme.theme.json +++ /dev/null @@ -1,433 +0,0 @@ -{ - "name": "Solarized Light", - "dark": false, - "author": "Tyler Thrailkill", - "editorScheme": "/themes/solarizedLight.xml", - "colors": { - "background": "#fdf6e3", - "backgroundEmpty": "#eee8d4", - "backgroundHighlights": "#eee8d5", - "backgroundHighlightsShading": "#073642ab", - "primaryText": "#657b83", - "inverseBackground": "#002b36", - "inverseBackgroundHighlights": "#073642", - "inversePrimaryText": "#839496", - "inverseSecondaryText": "#586e75", - "inverseEmphasizedContent": "#93a1a1", - "secondaryText": "#93a1a1", - "backgroundHighlightsShade1": "#cdc8b7", - "backgroundHighlightsShade2": "#A4A092", - "backgroundHighlightsShade2Shading": "#0A677Ac3", - "emphasizedContent": "#586e75", - "yellow": "#b5890066", - "green": "#baebda", - "blue": "#2aa198", - "violet": "#6c71c4", - "orange": "#cb4b16", - "rose": "#dc322f", - "maskColor": "#b58900" - }, - "ui": { - "*": { - "background": "backgroundHighlights", - "foreground": "primaryText", - - "infoForeground": "secondaryText", - - "selectionBackground": "inverseEmphasizedContent", - "selectionForeground": "inverseBackground", - "selectionInactiveBackground": "backgroundHighlightsShade1", - "selectionBackgroundInactive": "backgroundHighlightsShade1", - - "lightSelectionBackground": "backgroundHighlightsShade1", - "lightSelectionForeground": "primaryText", - "lightSelectionInactiveBackground": "backgroundHighlights", - "lightSelectionInactiveForeground":"primaryText", - - "disabledBackground": "background", - "inactiveBackground": "background", - - "disabledForeground": "secondaryText", - "disabledText": "secondaryText", - "inactiveForeground": "secondaryText", - - "acceleratorForeground": "primaryText", - "acceleratorSelectionForeground": "primaryText", - - "errorForeground": "#dd3962", - - "borderColor": "emphasizedContent", - "disabledBorderColor": "secondaryText", - - "focusColor": "#778282", - "focusedBorderColor": "emphasizedContent", - - "separatorForeground": "secondaryText", - "separatorColor": "backgroundHighlightsShade1", - "lineSeparatorColor": "#55506b", - - "modifiedItemForeground": "#b279f2" - }, - - "//": "affects buttons like the 'Play' or 'Debug' buttons", - "ActionButton": { - "hoverBackground": "backgroundHighlightsShade1", - "hoverBorderColor": "backgroundHighlightsShade1", - "pressedBackground": "backgroundHighlightsShade1", - "pressedBorderColor": "backgroundHighlightsShade1" - }, - - "Button": { - "startBackground": "backgroundHighlightsShade1", - "endBackground": "backgroundHighlightsShade1", - "startBorderColor": "backgroundHighlights", - "endBorderColor": "backgroundHighlights", - "shadowColor": "background", - - "default": { - "foreground": "inverseBackground", - "startBackground": "backgroundHighlightsShade2", - "endBackground": "backgroundHighlightsShade2", - "startBorderColor": "backgroundHighlightsShade2Shading", - "endBorderColor": "backgroundHighlightsShade2Shading", - "focusedBorderColor": "primaryText", - "focusColor": "#778282", - "shadowColor": "background" - } - }, - - "Borders": { - "color": "backgroundHighlights", - "ContrastBorderColor": "background" - }, - - "CheckBox": { - "background": "background" - }, - - "COMMENT:": "you can put comments in like this", - "ComboBox": { - "nonEditableBackground": "backgroundHighlightsShade1", - "background": "backgroundHighlightsShading", - "ArrowButton": { - "iconColor": "emphasizedContent", - "disabledIconColor": "primaryText", - "nonEditableBackground": "backgroundHighlightsShade1" - } - }, - - "ComboPopup.border": "1,1,1,1,64647A", - - "CompletionPopup": { - "matchForeground": "#ED94FF", - "matchSelectionForeground": "#ED94FF" - }, - - "Component": { - "errorFocusColor": "#993750", - "inactiveErrorFocusColor": "#522530", - "warningFocusColor": "#8c812b", - "inactiveWarningFocusColor": "#47441f", - "iconColor": "#77728fCC", - "hoverIconColor": "#8b85a6" - }, - - "Counter": { - "background": "#FFFFFF80", - "foreground": "#000000" - }, - - "DebuggerPopup.borderColor": "#524e66", - - "DefaultTabs": { - "background": "backgroundHighlightsShade1", - "borderColor": "backgroundHighlightsShade1", - "hoverBackground": "backgroundHighlightsShade2", - "inactiveUnderlineColor": "backgroundHighlightsShade2", - "underlineColor": "backgroundHighlightsShade2", - "underlinedTabBackground": "backgroundHighlights", - "underlinedTabForeground": "primaryText", - "underlineHeight": 5 - }, - - "DragAndDrop": { - "areaForeground": "primaryText", - "areaBackground": "#702F91", - "areaBorderColor": "#343142" - }, - - "Editor": { - "background": "background", - "foreground": "emphasizedContent", - "shortcutForeground": "#2aa198" - }, - - "EditorPane.inactiveBackground": "background", - - "EditorTabs": { - "borderColor": "background", - "underlineColor": "backgroundHighlights", - "inactiveUnderlineColor": "background", - "background": "backgroundHighlightsShade1", - "underlinedTabBackground": "background", - "hoverMaskColor": "backgroundHighlightsShade2", - "underlinedTabForeground": "primaryText", - "inactiveColoredFileBackground": "backgroundHighlightsShade1", - "underlineHeight": 0 - }, - - "FileColor": { - "Yellow": "yellow", - "Green": "green", - "Blue": "blue", - "Violet": "violet", - "Orange": "orange", - "Rose": "rose" - }, - - "InplaceRefactoringPopup.borderColor": "#474359", - - "Link": { - "activeForeground": "#7094ff", - "hoverForeground": "#7094FF", - "pressedForeground": "#7094FF", - "visitedForeground": "#7094FF" - }, - - "NavBar.borderColor": "#1a1721", - - "Notification": { - "background": "backgroundHighlightsShade1", - "borderColor": "backgroundHighlights", - - "errorForeground": "primaryText", - "errorBackground": "#4d232e", - "errorBorderColor": "#802e44", - - "MoreButton.innerBorderColor": "#1a1721", - - "ToolWindow": { - "informativeForeground": "primaryText", - "informativeBackground": "#2e4280", - "informativeBorderColor": "#17254d", - - "warningForeground": "primaryText", - "warningBackground": "backgroundHighlights", - "warningBorderColor": "#403013", - - "errorForeground": "primaryText", - "errorBackground": "#802d43", - "errorBorderColor": "#4d1c2b" - } - }, - - "Panel": { - "background": "background" - }, - - "ParameterInfo": { - "background": "backgroundHighlightsShade1", - "foreground": "primaryText", - "infoForeground": "ababb3", - "currentOverloadBackground": "backgroundHighlights", - "currentParameterForeground": "primaryText" - }, - - "Plugins": { - "SearchField.borderColor": "emphasizedContent", - "SearchField.background": "background", - "SectionHeader.background": "backgroundHighlights", - "tagBackground": "backgroundHighlightsShade1", - "tagForeground": "primaryText", - - "Button": { - "installForeground": "primaryText", - "installBorderColor":"backgroundHighlightsShade1", - "installFillForeground": "primaryText", - "installFillBackground": "#713a91", - "updateForeground":"primaryText", - "updateBackground": "backgroundHighlightsShade1", - "updateBorderColor": "secondaryText" - } - }, - - "Popup": { - "paintBorder": true, - "borderColor": "backgroundHighlightsShade1", - "inactiveBorderColor": "backgroundHighlights", - "Toolbar.borderColor": "#1a1721", - "Header.activeBackground": "backgroundHighlightsShade1", - "Header.inactiveBackground": "backgroundHighlightsShade1", - "Advertiser": { - "foreground": "secondaryText", - "borderColor": "backgroundHighlightsShade1", - "borderInsets": "4,8,3,0" - } - }, - - "PopupMenu": { - "borderWidth": 1, - "borderInsets": "4,1,4,1" - }, - - "ProgressBar": { - "trackColor": "#1D1D26", - "progressColor": "#268bd2", - "indeterminateStartColor": "#268bd2", - "indeterminateEndColor": "#2aa198", - "failedColor": "#bd3c5f", - "failedEndColor": "#472c33", - "passedColor": "#239E62", - "passedEndColor": "#2b4242" - }, - - "SearchEverywhere": { - "Header.background": "backgroundHighlights", - "Tab": { - "selectedForeground": "primaryText", - "selectedBackground": "backgroundHighlightsShade1" - }, - "SearchField":{ - "background": "background", - "borderColor": "#1a1721" - }, - "Advertiser.foreground": "#8785a6" - }, - - "SearchMatch": { - "startBackground": "#cca929", - "endBackground": "#cca929" - }, - - "SpeedSearch": { - "foreground": "primaryText", - "borderColor": "backgroundHighlights", - "background": "background", - "errorForeground": "#ff80a1" - }, - - "StatusBar.borderColor": "background", - - "TabbedPane": { - "underlineColor": "backgroundHighlightsShade2", - "disabledUnderlineColor": "backgroundHighlightsShade2", - "contentAreaColor": "backgroundHighlights", - "background": "backgroundHighlightsShade1", - "foreground": "primaryText", - "disabledForeground": "primaryText", - "focusColor": "backgroundHighlights", - "hoverColor": "backgroundHighlightsShade2" - }, - - "TableHeader.cellBorder": "3,0,3,0", - - "Table.stripeColor": "backgroundHighlightsShade1", - - "TextArea": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade2" - }, - - "TextField": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade2" - }, - - "ToggleButton": { - "onForeground": "primaryText", - "onBackground": "#543073", - "offForeground": "#9f9fa6", - "offBackground": "background", - "buttonColor": "#666380", - "borderColor": "#666380" - }, - - "ToolTip": { - "background": "backgroundHighlightsShade1", - "Actions.background": "#323245" - }, - - "ToolWindow": { - "Header": { - "background": "backgroundHighlightsShade1", - "inactiveBackground": "backgroundHighlights", - "borderColor": "backgroundHighlights" - }, - - "HeaderTab": { - "selectedBackground": "#0a0a0a66", - "selectedInactiveBackground": "#0a0a0a4D", - "hoverBackground": "#0a0a0a16", - "hoverInactiveBackground": "#0a0a0a16" - }, - - "Button": { - "hoverBackground": "backgroundHighlightsShade1", - "selectedBackground": "backgroundHighlightsShade1", - "selectedForeground": "primaryText" - } - }, - - "Tree": { - "rowHeight": 20, - "background": "backgroundEmpty" - }, - - "ValidationTooltip": { - "errorBackground": "#802d43", - "errorBorderColor": "#4d1c2b", - "warningBackground": "#735822", - "warningBorderColor": "#403013" - }, - - "VersionControl": { - "Log.Commit": { - "currentBranchBackground": "green", - "unmatchedForeground": "#6d6a80" - }, - "FileHistory.Commit.selectedBranchBackground": "#202340" - }, - - "WelcomeScreen": { - "comments": "#713a91", - "separatorColor": "backgroundHighlights", - "Projects": { - "background": "backgroundHighlights", - "selectionBackground": "backgroundHighlightsShade1", - "selectionInactiveBackground": "backgroundHighlightsShade1" - } - } - }, - "icons": { - "ColorPalette": { - "Actions.Grey": "#a4a1b3", - "Actions.Red": "#cb4b16", - "Actions.Yellow": "#b58900", - "Actions.Green": "#859900", - "Actions.Blue": "#268bd2", - "Actions.GreyInline.Dark": "#9f99bfb3", - - "Objects.Grey": "#9790ad", - "Objects.RedStatus": "#dd3962", - "Objects.Red": "#c63a5d", - "Objects.Pink": "#f98b9e", - "Objects.Yellow": "#caba2d", - "Objects.Green": "#239e62", - "Objects.Blue": "#598bff", - "Objects.Purple": "#af71e0", - "Objects.BlackText": "#000000ff", - "Objects.YellowDark": "#988c26", - "Objects.GreenAndroid": "#78c257", - - "Checkbox.Background.Default.Dark": "backgroundHighlightsShade1", - "Checkbox.Border.Default.Dark": "secondaryText", - "Checkbox.Foreground.Selected.Dark": "#a4a1b3", - "Checkbox.Focus.Wide.Dark": "emphasizedContent", - "Checkbox.Focus.Thin.Default.Dark": "primaryText", - "Checkbox.Focus.Thin.Selected.Dark": "primaryText", - "Checkbox.Background.Disabled.Dark": "backgroundHighlights", - "Checkbox.Border.Disabled.Dark": "backgroundHighlightsShade1", - "Checkbox.Foreground.Disabled.Dark": "secondaryText" - } - } -} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/themes.json b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/themes.json index c64a534e..948b6e61 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/themes.json +++ b/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/themes.json @@ -13,6 +13,38 @@ "sourceCodeUrl": "https://gitlab.com/zlamalp/arc-theme-idea", "sourceCodePath": "blob/master/resources/arc-theme-orange.theme.json" }, + "arc_theme_dark.theme.json": { + "name": "Arc Dark", + "dark": true, + "license": "MIT", + "licenseFile": "arc-themes.LICENSE.txt", + "sourceCodeUrl": "https://gitlab.com/zlamalp/arc-theme-idea", + "sourceCodePath": "blob/master/resources/arc_theme_dark.theme.json" + }, + "arc_theme_dark_orange.theme.json": { + "name": "Arc Dark - Orange", + "dark": true, + "license": "MIT", + "licenseFile": "arc-themes.LICENSE.txt", + "sourceCodeUrl": "https://gitlab.com/zlamalp/arc-theme-idea", + "sourceCodePath": "blob/master/resources/arc_theme_dark_orange.theme.json" + }, + "Carbon.theme.json": { + "name": "Carbon", + "dark": true, + "license": "Apache License 2.0", + "licenseFile": "arc-themes.LICENSE.txt", + "sourceCodeUrl": "https://github.com/luisfer0793/theme-carbon", + "sourceCodePath": "blob/master/resources/matte_carbon_basics.theme.json" + }, + "Cobalt_2.theme.json": { + "name": "Cobalt 2", + "dark": true, + "license": "MIT", + "licenseFile": "Cobalt_2.LICENSE.txt", + "sourceCodeUrl": "https://github.com/ngehlert/cobalt2", + "sourceCodePath": "blob/master/Cobalt2-UI-Theme/resources/Cobalt_2.theme.json" + }, "Cyan.theme.json": { "name": "Cyan light", "license": "MIT", @@ -22,6 +54,7 @@ }, "DarkFlatTheme.theme.json": { "name": "Dark Flat", + "dark": true, "license": "MIT", "licenseFile": "DarkFlatTheme.LICENSE.txt", "sourceCodeUrl": "https://github.com/nerzhulart/DarkFlatTheme", @@ -29,6 +62,7 @@ }, "DarkPurple.theme.json": { "name": "Dark purple", + "dark": true, "license": "MIT", "licenseFile": "DarkPurple.LICENSE.txt", "sourceCodeUrl": "https://github.com/OlyaB/DarkPurpleTheme", @@ -36,6 +70,7 @@ }, "Dracula.theme.json": { "name": "Dracula", + "dark": true, "license": "MIT", "licenseFile": "Dracula.LICENSE.txt", "sourceCodeUrl": "https://github.com/dracula/jetbrains", @@ -43,24 +78,27 @@ }, "Gradianto_dark_fuchsia.theme.json": { "name": "Gradianto Dark Fuchsia", + "dark": true, "license": "MIT", "licenseFile": "Gradianto.LICENSE.txt", "sourceCodeUrl": "https://github.com/thvardhan/Gradianto", - "sourceCodePath": "blob/master/resources/Gradianto_dark_fuchsia.theme.json" + "sourceCodePath": "blob/master/src/main/resources/Gradianto_dark_fuchsia.theme.json" }, "Gradianto_deep_ocean.theme.json": { "name": "Gradianto Deep Ocean", + "dark": true, "license": "MIT", "licenseFile": "Gradianto.LICENSE.txt", "sourceCodeUrl": "https://github.com/thvardhan/Gradianto", - "sourceCodePath": "blob/master/resources/Gradianto_deep_ocean.theme.json" + "sourceCodePath": "blob/master/src/main/resources/Gradianto_deep_ocean.theme.json" }, "Gradianto_midnight_blue.theme.json": { "name": "Gradianto Midnight Blue", + "dark": true, "license": "MIT", "licenseFile": "Gradianto.LICENSE.txt", "sourceCodeUrl": "https://github.com/thvardhan/Gradianto", - "sourceCodePath": "blob/master/resources/Gradianto_midnight_blue.theme.json" + "sourceCodePath": "blob/master/src/main/resources/Gradianto_midnight_blue.theme.json" }, "Gray.theme.json": { "name": "Gray", @@ -69,34 +107,46 @@ "sourceCodeUrl": "https://github.com/OlyaB/GreyTheme", "sourceCodePath": "blob/master/src/Gray.theme.json" }, - "gruvbox_theme.theme.json": { - "name": "Gruvbox", + "gruvbox_dark_hard.theme.json": { + "name": "Gruvbox Dark Hard", + "dark": true, "license": "MIT", "licenseFile": "gruvbox_theme.LICENSE.txt", "sourceCodeUrl": "https://github.com/Vincent-P/gruvbox-intellij-theme", - "sourceCodePath": "blob/master/src/main/resources/gruvbox_theme.theme.json" + "sourceCodePath": "blob/master/src/main/resources/gruvbox_dark_hard.theme.json" }, - "Hiberbee.theme.json": { - "name": "Hiberbee", + "gruvbox_dark_medium.theme.json": { + "name": "Gruvbox Dark Medium", + "dark": true, + "license": "MIT", + "licenseFile": "gruvbox_theme.LICENSE.txt", + "sourceCodeUrl": "https://github.com/Vincent-P/gruvbox-intellij-theme", + "sourceCodePath": "blob/master/src/main/resources/gruvbox_dark_medium.theme.json" + }, + "gruvbox_dark_soft.theme.json": { + "name": "Gruvbox Dark Soft", + "dark": true, + "license": "MIT", + "licenseFile": "gruvbox_theme.LICENSE.txt", + "sourceCodeUrl": "https://github.com/Vincent-P/gruvbox-intellij-theme", + "sourceCodePath": "blob/master/src/main/resources/gruvbox_dark_soft.theme.json" + }, + "HiberbeeDark.theme.json": { + "name": "Hiberbee Dark", + "dark": true, "license": "MIT", "licenseFile": "Hiberbee.LICENSE.txt", "sourceCodeUrl": "https://github.com/Hiberbee/code-highlight-themes", - "sourceCodePath": "blob/master/src/main/resources/Hiberbee.theme.json" + "sourceCodePath": "blob/master/src/main/resources/HiberbeeDark.theme.json" }, "HighContrast.theme.json": { "name": "High contrast", + "dark": true, "license": "MIT", "licenseFile": "HighContrast.LICENSE.txt", "sourceCodeUrl": "https://github.com/OlyaB/HighContrastTheme", "sourceCodePath": "blob/master/src/HighContrast.theme.json" }, - "Light.theme.json": { - "name": "IntelliJ Light Preview", - "license": "MIT", - "licenseFile": "Light.LICENSE.txt", - "sourceCodeUrl": "https://github.com/OlyaB/IntelliJLightTheme", - "sourceCodePath": "blob/master/src/Light.theme.json" - }, "LightFlatTheme.theme.json": { "name": "Light Flat", "license": "MIT", @@ -106,6 +156,7 @@ }, "MaterialTheme.theme.json": { "name": "Material Design Dark", + "dark": true, "license": "MIT", "licenseFile": "MaterialTheme.LICENSE.txt", "sourceCodeUrl": "https://github.com/xinkunZ/NotReallyMDTheme", @@ -113,6 +164,7 @@ }, "Monocai.theme.json": { "name": "Monocai", + "dark": true, "license": "MIT", "licenseFile": "Monocai.LICENSE.txt", "sourceCodeUrl": "https://github.com/bmikaili/intellij-monocai-theme", @@ -120,6 +172,7 @@ }, "nord.theme.json": { "name": "Nord", + "dark": true, "license": "MIT", "licenseFile": "nord.LICENSE.txt", "sourceCodeUrl": "https://github.com/arcticicestudio/nord-jetbrains", @@ -127,27 +180,30 @@ }, "one_dark.theme.json": { "name": "One Dark", + "dark": true, "license": "MIT", "licenseFile": "one_dark.LICENSE.txt", "sourceCodeUrl": "https://github.com/one-dark/jetbrains-one-dark-theme", - "sourceCodePath": "blob/master/src/main/resources/themes/one_dark.theme.json" + "sourceCodePath": "blob/master/buildSrc/templates/oneDark.template.theme.json" }, - "solarized_dark_theme.theme.json": { + "SolarizedDark.theme.json": { "name": "Solarized Dark", - "license": "MIT", - "licenseFile": "solarized_dark_theme.LICENSE.txt", - "sourceCodeUrl": "https://github.com/snowe2010/solarized-jetbrains", - "sourceCodePath": "blob/master/src/solarized_dark_theme.theme.json" + "dark": true, + "license": "The Unlicense", + "licenseFile": "Solarized.LICENSE.txt", + "sourceCodeUrl": "https://github.com/4lex4/intellij-platform-solarized", + "sourceCodePath": "blob/master/resources/SolarizedDark.theme.json" }, - "solarized_light_theme.theme.json": { + "SolarizedLight.theme.json": { "name": "Solarized Light", - "license": "MIT", - "licenseFile": "solarized_light_theme.LICENSE.txt", - "sourceCodeUrl": "https://github.com/snowe2010/solarized-jetbrains", - "sourceCodePath": "blob/master/src/solarized_light_theme.theme.json" + "license": "The Unlicense", + "licenseFile": "Solarized.LICENSE.txt", + "sourceCodeUrl": "https://github.com/4lex4/intellij-platform-solarized", + "sourceCodePath": "blob/master/resources/SolarizedLight.theme.json" }, "Spacegray.theme.json": { "name": "Spacegray", + "dark": true, "license": "MIT", "licenseFile": "Spacegray.LICENSE.txt", "sourceCodeUrl": "https://github.com/mturlo/intellij-spacegray", @@ -155,6 +211,7 @@ }, "vuesion_theme.theme.json": { "name": "Vuesion", + "dark": true, "license": "MIT", "licenseFile": "vuesion_theme.LICENSE.txt", "sourceCodeUrl": "https://github.com/vuesion/intellij-theme", @@ -163,6 +220,7 @@ "material-theme-ui-lite/Arc Dark.theme.json": { "name": "Material Theme UI Lite / Arc Dark", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -170,6 +228,7 @@ }, "material-theme-ui-lite/Arc Dark Contrast.theme.json": { "name": "Material Theme UI Lite / Arc Dark Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -177,6 +236,7 @@ }, "material-theme-ui-lite/Atom One Dark.theme.json": { "name": "Material Theme UI Lite / Atom One Dark", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -184,6 +244,7 @@ }, "material-theme-ui-lite/Atom One Dark Contrast.theme.json": { "name": "Material Theme UI Lite / Atom One Dark Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -205,6 +266,7 @@ }, "material-theme-ui-lite/Dracula.theme.json": { "name": "Material Theme UI Lite / Dracula", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -212,6 +274,7 @@ }, "material-theme-ui-lite/Dracula Contrast.theme.json": { "name": "Material Theme UI Lite / Dracula Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -247,6 +310,7 @@ }, "material-theme-ui-lite/Material Darker.theme.json": { "name": "Material Theme UI Lite / Material Darker", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -254,6 +318,7 @@ }, "material-theme-ui-lite/Material Darker Contrast.theme.json": { "name": "Material Theme UI Lite / Material Darker Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -261,6 +326,7 @@ }, "material-theme-ui-lite/Material Deep Ocean.theme.json": { "name": "Material Theme UI Lite / Material Deep Ocean", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -268,6 +334,7 @@ }, "material-theme-ui-lite/Material Deep Ocean Contrast.theme.json": { "name": "Material Theme UI Lite / Material Deep Ocean Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -289,6 +356,7 @@ }, "material-theme-ui-lite/Material Oceanic.theme.json": { "name": "Material Theme UI Lite / Material Oceanic", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -296,6 +364,7 @@ }, "material-theme-ui-lite/Material Oceanic Contrast.theme.json": { "name": "Material Theme UI Lite / Material Oceanic Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -303,6 +372,7 @@ }, "material-theme-ui-lite/Material Palenight.theme.json": { "name": "Material Theme UI Lite / Material Palenight", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -310,6 +380,7 @@ }, "material-theme-ui-lite/Material Palenight Contrast.theme.json": { "name": "Material Theme UI Lite / Material Palenight Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -317,6 +388,7 @@ }, "material-theme-ui-lite/Monokai Pro.theme.json": { "name": "Material Theme UI Lite / Monokai Pro", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -324,6 +396,7 @@ }, "material-theme-ui-lite/Monokai Pro Contrast.theme.json": { "name": "Material Theme UI Lite / Monokai Pro Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -331,6 +404,7 @@ }, "material-theme-ui-lite/Night Owl.theme.json": { "name": "Material Theme UI Lite / Night Owl", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -338,6 +412,7 @@ }, "material-theme-ui-lite/Night Owl Contrast.theme.json": { "name": "Material Theme UI Lite / Night Owl Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -345,6 +420,7 @@ }, "material-theme-ui-lite/Solarized Dark.theme.json": { "name": "Material Theme UI Lite / Solarized Dark", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", @@ -352,6 +428,7 @@ }, "material-theme-ui-lite/Solarized Dark Contrast.theme.json": { "name": "Material Theme UI Lite / Solarized Dark Contrast", + "dark": true, "license": "MIT", "licenseFile": "material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt", "sourceCodeUrl": "https://github.com/mallowigi/material-theme-ui-lite", diff --git a/flatlaf-extras/.settings/org.eclipse.jdt.core.prefs b/flatlaf-extras/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-extras/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-extras/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-extras/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-extras/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-extras/README.md b/flatlaf-extras/README.md index 2bad65af..a4c6aeab 100644 --- a/flatlaf-extras/README.md +++ b/flatlaf-extras/README.md @@ -3,11 +3,82 @@ FlatLaf Extras This sub-project provides some additional components and classes: -- [TriStateCheckBox](src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java): - A tri-state check box. +- [FlatSVGIcon](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/FlatSVGIcon.html): + An icon that displays SVG using + [svgSalamander](https://github.com/JFormDesigner/svgSalamander).\ + ![FlatSVGIcon.png](../images/extras-FlatSVGIcon.png) +- [TriStateCheckBox](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/TriStateCheckBox.html): + A tri-state check box.\ + ![TriStateCheckBox.png](../images/extras-TriStateCheckBox.png) +- [FlatAnimatedLafChange](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/FlatAnimatedLafChange.html): + Animated Laf (theme) changing. +- [FlatInspector](#ui-inspector): A simple UI inspector that shows information + about UI component at mouse location in a tooltip. +- [FlatUIDefaultsInspector](#ui-defaults-inspector): A simple UI defaults + inspector that shows a window with all UI defaults used in current theme (look + and feel). Download -------- -Not yet available. +FlatLaf Extras binaries are available on **JCenter** and **Maven Central**. + +If you use Maven or Gradle, add a dependency with following coordinates to your +build script: + + groupId: com.formdev + artifactId: flatlaf-extras + version: (see button below) + +Otherwise download `flatlaf-extras-.jar` here: + +[![Download](https://api.bintray.com/packages/jformdesigner/flatlaf/flatlaf-extras/images/download.svg)](https://bintray.com/jformdesigner/flatlaf/flatlaf-extras/_latestVersion) + +You also need `flatlaf-.jar` and `svgSalamander-.jar`, which +you can download here: + +[![Download](https://api.bintray.com/packages/jformdesigner/flatlaf/flatlaf/images/download.svg)](https://bintray.com/jformdesigner/flatlaf/flatlaf/_latestVersion) +[![Download](https://api.bintray.com/packages/jformdesigner/svgSalamander/svgSalamander/images/download.svg)](https://bintray.com/jformdesigner/svgSalamander/svgSalamander/_latestVersion) + + +Tools +----- + +### UI Inspector + +A simple UI inspector that shows information about UI component at mouse +location in a tooltip, which may be useful while developing an application. +Should not be installed in released applications. + +Once installed with following code (e.g. in method `main`), it can be activated +for the active window with the given keystroke: + +~~~java +FlatInspector.install( "ctrl shift alt X" ); +~~~ + +![UI inspector](../images/extras-FlatInspector.png) + +When the UI inspector is active some additional keys are available: + +- press Esc key to disable UI inspector +- press Ctrl key to increase inspection level, which shows + information about parent of UI component at mouse location +- press Shift key to decrease inspection level + + +### UI Defaults Inspector + +A simple UI defaults inspector that shows a window with all UI defaults used in +current theme (look and feel), which may be useful while developing an +application. Should be not installed in released applications. + +Once installed with following code (e.g. in method `main`), it can be activated +with the given keystroke: + +~~~java +FlatUIDefaultsInspector.install( "ctrl shift alt Y" ); +~~~ + +![UI Defaults Inspector](../images/extras-FlatUIDefaultsInspector.png) diff --git a/flatlaf-extras/build.gradle.kts b/flatlaf-extras/build.gradle.kts index 6fc245b6..831288e6 100644 --- a/flatlaf-extras/build.gradle.kts +++ b/flatlaf-extras/build.gradle.kts @@ -16,9 +16,37 @@ plugins { `java-library` + `flatlaf-module-info` + `flatlaf-publish` } dependencies { implementation( project( ":flatlaf-core" ) ) - implementation( "com.formdev:svgSalamander:1.1.2.1" ) + implementation( "com.formdev:svgSalamander:1.1.2.3" ) +} + +flatlafModuleInfo { + dependsOn( ":flatlaf-core:jar" ) +} + +java { + withSourcesJar() + withJavadocJar() +} + +tasks { + javadoc { + options { + this as StandardJavadocDocletOptions + use( true ) + tags = listOf( "uiDefault", "clientProperty" ) + } + isFailOnError = false + } +} + +flatlafPublish { + artifactId = "flatlaf-extras" + name = "FlatLaf Extras" + description = "Flat Look and Feel Extras" } diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatAnimatedLafChange.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatAnimatedLafChange.java new file mode 100644 index 00000000..f66cefe1 --- /dev/null +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatAnimatedLafChange.java @@ -0,0 +1,194 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.extras; + +import java.awt.AlphaComposite; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Window; +import java.awt.image.VolatileImage; +import java.util.Map; +import java.util.WeakHashMap; +import javax.swing.JComponent; +import javax.swing.JLayeredPane; +import javax.swing.RootPaneContainer; +import com.formdev.flatlaf.FlatSystemProperties; +import com.formdev.flatlaf.util.Animator; + +/** + * Animated look and feel changing. + *

+ * Invoke {@link #showSnapshot()} before setting look and feel and + * {@link #hideSnapshotWithAnimation()} after updating UI. E.g. + *

+ * FlatAnimatedLafChange.showSnapshot();
+ * UIManager.setLookAndFeel( lafClassName );
+ * FlatLaf.updateUI();
+ * FlatAnimatedLafChange.hideSnapshotWithAnimation();
+ * 
+ * + * @author Karl Tauber + */ +public class FlatAnimatedLafChange +{ + /** + * The duration of the animation in milliseconds. Default is 160 ms. + */ + public static int duration = 160; + + /** + * The resolution of the animation in milliseconds. Default is 40 ms. + */ + public static int resolution = 40; + + private static Animator animator; + private static final Map oldUIsnapshots = new WeakHashMap<>(); + private static final Map newUIsnapshots = new WeakHashMap<>(); + private static float alpha; + private static boolean inShowSnapshot; + + /** + * Create a snapshot of the old UI and shows it on top of the UI. + * Invoke before setting new look and feel. + */ + public static void showSnapshot() { + if( !FlatSystemProperties.getBoolean( "flatlaf.animatedLafChange", true ) ) + return; + + // stop already running animation + if( animator != null ) + animator.stop(); + + alpha = 1; + + // show snapshot of old UI + showSnapshot( true, oldUIsnapshots ); + } + + private static void showSnapshot( boolean useAlpha, Map map ) { + inShowSnapshot = true; + + // create snapshots for all shown windows + Window[] windows = Window.getWindows(); + for( Window window : windows ) { + if( !(window instanceof RootPaneContainer) || !window.isShowing() ) + continue; + + // create snapshot image + // (using volatile image to have correct sub-pixel text rendering on Java 9+) + VolatileImage snapshot = window.createVolatileImage( window.getWidth(), window.getHeight() ); + if( snapshot == null ) + continue; + + // paint window to snapshot image + JLayeredPane layeredPane = ((RootPaneContainer)window).getLayeredPane(); + layeredPane.paint( snapshot.getGraphics() ); + + // create snapshot layer, which is added to layered pane and paints + // snapshot with animated alpha + JComponent snapshotLayer = new JComponent() { + @Override + public void paint( Graphics g ) { + if( inShowSnapshot || snapshot.contentsLost() ) + return; + + if( useAlpha ) + ((Graphics2D)g).setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, alpha ) ); + g.drawImage( snapshot, 0, 0, null ); + } + + @Override + public void removeNotify() { + super.removeNotify(); + + // release system resources used by volatile image + snapshot.flush(); + } + }; + if( !useAlpha ) + snapshotLayer.setOpaque( true ); + snapshotLayer.setSize( layeredPane.getSize() ); + + // add image layer to layered pane + layeredPane.add( snapshotLayer, Integer.valueOf( JLayeredPane.DRAG_LAYER + (useAlpha ? 2 : 1) ) ); + map.put( layeredPane, snapshotLayer ); + } + + inShowSnapshot = false; + } + + /** + * Starts an animation that shows the snapshot (created by {@link #showSnapshot()} + * with an decreasing alpha. At the end, the snapshot is removed and the new UI is shown. + * Invoke after updating UI. + */ + public static void hideSnapshotWithAnimation() { + if( !FlatSystemProperties.getBoolean( "flatlaf.animatedLafChange", true ) ) + return; + + if( oldUIsnapshots.isEmpty() ) + return; + + // show snapshot of new UI + showSnapshot( false, newUIsnapshots ); + + // create animator + animator = new Animator( duration, fraction -> { + if( fraction < 0.1 || fraction > 0.9 ) + return; // ignore initial and last events + + alpha = 1f - fraction; + + // repaint snapshots + for( Map.Entry e : oldUIsnapshots.entrySet() ) { + if( e.getKey().isShowing() ) + e.getValue().repaint(); + } + }, () -> { + hideSnapshot(); + animator = null; + } ); + + animator.setResolution( resolution ); + animator.start(); + } + + private static void hideSnapshot() { + hideSnapshot( oldUIsnapshots ); + hideSnapshot( newUIsnapshots ); + } + + private static void hideSnapshot( Map map ) { + // remove snapshots + for( Map.Entry e : map.entrySet() ) { + e.getKey().remove( e.getValue() ); + e.getKey().repaint(); + } + + map.clear(); + } + + /** + * Stops a running animation (if any) and hides the snapshot. + */ + public static void stop() { + if( animator != null ) + animator.stop(); + else + hideSnapshot(); + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInspector.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatInspector.java similarity index 62% rename from flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInspector.java rename to flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatInspector.java index 3cef2fd4..6e9f4225 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInspector.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatInspector.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.formdev.flatlaf.testing; +package com.formdev.flatlaf.extras; import java.awt.AWTEvent; import java.awt.Color; @@ -28,15 +28,19 @@ import java.awt.Graphics2D; import java.awt.Insets; import java.awt.KeyboardFocusManager; import java.awt.LayoutManager; +import java.awt.MouseInfo; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Window; +import java.awt.event.AWTEventListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.event.MouseMotionListener; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.lang.reflect.Field; import javax.swing.AbstractButton; import javax.swing.JComponent; @@ -57,6 +61,24 @@ import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.UIScale; /** + * A simple UI inspector that shows information about UI component at mouse location + * in a tooltip. + *

+ * To use it in an application install it with: + *

+ * FlatInspector.install( "ctrl shift alt X" );
+ * 
+ * This can be done e.g. in the main() method and allows enabling (and disabling) + * the UI inspector for the active window with the given keystroke. + *

+ * When the UI inspector is active some additional keys are available: + *

    + *
  • press {@code Esc} key to disable UI inspector
  • + *
  • press {@code Ctrl} key to increase inspection level, which shows + * information about parent of UI component at mouse location
  • + *
  • press {@code Shift} key to decrease inspection level
  • + *
+ * * @author Karl Tauber */ public class FlatInspector @@ -68,11 +90,15 @@ public class FlatInspector private final JRootPane rootPane; private final MouseMotionListener mouseMotionListener; + private final AWTEventListener keyListener; + private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this ); + private boolean enabled; private Component lastComponent; private int lastX; private int lastY; private int inspectParentLevel; + private boolean wasCtrlOrShiftKeyPressed; private JComponent highlightFigure; private JToolTip tip; @@ -80,6 +106,8 @@ public class FlatInspector /** * Installs a key listener into the application that allows enabling and disabling * the UI inspector with the given keystroke (e.g. "ctrl shift alt X"). + * + * @param activationKeys a keystroke (e.g. "ctrl shift alt X") */ public static void install( String activationKeys ) { KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys ); @@ -113,14 +141,56 @@ public class FlatInspector public void mouseMoved( MouseEvent e ) { lastX = e.getX(); lastY = e.getY(); - inspectParentLevel = (e.isControlDown() ? 1 : 0) - + (e.isShiftDown() ? 2 : 0) - + (e.isAltDown() ? 4 : 0); inspect( lastX, lastY ); } }; rootPane.getGlassPane().addMouseMotionListener( mouseMotionListener ); + + keyListener = e -> { + KeyEvent keyEvent = (KeyEvent) e; + int keyCode = keyEvent.getKeyCode(); + int id = e.getID(); + + if( id == KeyEvent.KEY_PRESSED ) { + // this avoids that the inspection level is changed when UI inspector + // is enabled with keyboard shortcut (e.g. Ctrl+Shift+Alt+X) + if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_SHIFT ) + wasCtrlOrShiftKeyPressed = true; + } else if( id == KeyEvent.KEY_RELEASED && wasCtrlOrShiftKeyPressed ) { + if( keyCode == KeyEvent.VK_CONTROL ) { + inspectParentLevel++; + int parentLevel = inspect( lastX, lastY ); + + // limit level + if( inspectParentLevel > parentLevel ) + inspectParentLevel = parentLevel; + } else if( keyCode == KeyEvent.VK_SHIFT && inspectParentLevel > 0 ) { + inspectParentLevel--; + int parentLevel = inspect( lastX, lastY ); + + // decrease level + if( inspectParentLevel > parentLevel ) { + inspectParentLevel = Math.max( parentLevel - 1, 0 ); + inspect( lastX, lastY ); + } + } + } + + if( keyCode == KeyEvent.VK_ESCAPE ) { + // consume pressed and released ESC key events to e.g. avoid that dialog is closed + keyEvent.consume(); + + if( id == KeyEvent.KEY_PRESSED ) { + FlatInspector inspector = (FlatInspector) rootPane.getClientProperty( FlatInspector.class ); + if( inspector == FlatInspector.this ) { + uninstall(); + rootPane.putClientProperty( FlatInspector.class, null ); + } else + setEnabled( false ); + } + } + }; } private void uninstall() { @@ -129,11 +199,46 @@ public class FlatInspector rootPane.getGlassPane().removeMouseMotionListener( mouseMotionListener ); } + + public void addPropertyChangeListener( PropertyChangeListener l ) { + propertyChangeSupport.addPropertyChangeListener( l ); + } + + public void removePropertyChangeListener( PropertyChangeListener l ) { + propertyChangeSupport.removePropertyChangeListener( l ); + } + + public boolean isEnabled() { + return enabled; + } + public void setEnabled( boolean enabled ) { + if( this.enabled == enabled ) + return; + + this.enabled = enabled; + + // make sure that glass pane is not opaque, which is not the case in WebLaF + ((JComponent)rootPane.getGlassPane()).setOpaque( false ); + rootPane.getGlassPane().setVisible( enabled ); - if( !enabled ) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + if( enabled ) + toolkit.addAWTEventListener( keyListener, AWTEvent.KEY_EVENT_MASK ); + else + toolkit.removeAWTEventListener( keyListener ); + + if( enabled ) { + Point pt = new Point( MouseInfo.getPointerInfo().getLocation() ); + SwingUtilities.convertPointFromScreen( pt, rootPane ); + + lastX = pt.x; + lastY = pt.y; + inspect( lastX, lastY ); + } else { lastComponent = null; + inspectParentLevel = 0; if( highlightFigure != null ) highlightFigure.getParent().remove( highlightFigure ); @@ -143,6 +248,8 @@ public class FlatInspector tip.getParent().remove( tip ); tip = null; } + + propertyChangeSupport.firePropertyChange( "enabled", !enabled, enabled ); } public void update() { @@ -156,21 +263,63 @@ public class FlatInspector } ); } - private void inspect( int x, int y ) { - Container contentPane = rootPane.getContentPane(); - Point pt = SwingUtilities.convertPoint( rootPane.getGlassPane(), x, y, contentPane ); - Component c = SwingUtilities.getDeepestComponentAt( contentPane, pt.x, pt.y ); + private int inspect( int x, int y ) { + Point pt = SwingUtilities.convertPoint( rootPane.getGlassPane(), x, y, rootPane ); + Component c = getDeepestComponentAt( rootPane, pt.x, pt.y ); + int parentLevel = 0; for( int i = 0; i < inspectParentLevel && c != null; i++ ) { - c = c.getParent(); + Container parent = c.getParent(); + if( parent == null ) + break; + + c = parent; + parentLevel++; } if( c == lastComponent ) - return; + return parentLevel; lastComponent = c; highlight( c ); - showToolTip( c, x, y ); + showToolTip( c, x, y, parentLevel ); + + return parentLevel; + } + + private Component getDeepestComponentAt( Component parent, int x, int y ) { + if( !parent.contains( x, y ) ) + return null; + + if( parent instanceof Container ) { + for( Component child : ((Container)parent).getComponents() ) { + if( child == null || !child.isVisible() ) + continue; + + int cx = x - child.getX(); + int cy = y - child.getY(); + Component c = (child instanceof Container) + ? getDeepestComponentAt( child, cx, cy ) + : child.getComponentAt( cx, cy ); + if( c == null || !c.isVisible() ) + continue; + + // ignore highlight figure and tooltip + if( c == highlightFigure || c == tip ) + continue; + + // ignore glass pane + if( c.getParent() instanceof JRootPane && c == ((JRootPane)c.getParent()).getGlassPane() ) + continue; + + if( "com.formdev.flatlaf.ui.FlatWindowResizer".equals( c.getClass().getName() ) ) + continue; + + return c; + } + } + + return parent; } private void highlight( Component c ) { @@ -182,9 +331,10 @@ public class FlatInspector highlightFigure.setVisible( c != null ); if( c != null ) { - Rectangle bounds = c.getBounds(); - Rectangle highlightBounds = SwingUtilities.convertRectangle( c.getParent(), bounds, rootPane ); - highlightFigure.setBounds( highlightBounds ); + Insets insets = rootPane.getInsets(); + highlightFigure.setBounds( new Rectangle( + SwingUtilities.convertPoint( c, -insets.left, -insets.top, rootPane ), + c.getSize() ) ); } } @@ -207,7 +357,7 @@ public class FlatInspector return c; } - private void showToolTip( Component c, int x, int y ) { + private void showToolTip( Component c, int x, int y, int parentLevel ) { if( c == null ) { if( tip != null ) tip.setVisible( false ); @@ -225,7 +375,7 @@ public class FlatInspector } else tip.setVisible( true ); - tip.setTipText( buildToolTipText( c ) ); + tip.setTipText( buildToolTipText( c, parentLevel ) ); int tx = x + UIScale.scale( 8 ); int ty = y + UIScale.scale( 16 ); @@ -246,7 +396,7 @@ public class FlatInspector tip.repaint(); } - private String buildToolTipText( Component c ) { + private static String buildToolTipText( Component c, int parentLevel ) { String name = c.getClass().getName(); name = name.substring( name.lastIndexOf( '.' ) + 1 ); @@ -304,12 +454,19 @@ public class FlatInspector text += "Enabled: " + c.isEnabled() + '\n'; text += "Opaque: " + c.isOpaque() + (c instanceof JComponent && FlatUIUtils.hasOpaqueBeenExplicitlySet( (JComponent) c ) ? " EXPLICIT" : "") + '\n'; + if( c instanceof AbstractButton ) + text += "ContentAreaFilled: " + ((AbstractButton)c).isContentAreaFilled() + '\n'; text += "Focusable: " + c.isFocusable() + '\n'; text += "Left-to-right: " + c.getComponentOrientation().isLeftToRight() + '\n'; - text += "Parent: " + c.getParent().getClass().getName(); + text += "Parent: " + (c.getParent() != null ? c.getParent().getClass().getName() : "null"); - if( inspectParentLevel > 0 ) - text += "\n\nParent level: " + inspectParentLevel; + if( parentLevel > 0 ) + text += "\n\nParent level: " + parentLevel; + + if( parentLevel > 0 ) + text += "\n(press Ctrl/Shift to increase/decrease level)"; + else + text += "\n\n(press Ctrl key to inspect parent)"; return text; } diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatSVGIcon.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatSVGIcon.java index 3db69935..6876a19c 100644 --- a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatSVGIcon.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatSVGIcon.java @@ -20,37 +20,169 @@ import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; +import java.awt.Paint; import java.awt.Rectangle; import java.awt.RenderingHints; -import java.awt.image.BufferedImage; +import java.awt.image.RGBImageFilter; import java.net.URISyntaxException; import java.net.URL; -import javax.swing.ImageIcon; -import javax.swing.LookAndFeel; +import java.util.HashMap; +import java.util.Map; +import javax.swing.Icon; import javax.swing.UIManager; +import com.formdev.flatlaf.FlatIconColors; import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.Graphics2DProxy; +import com.formdev.flatlaf.util.GrayFilter; import com.formdev.flatlaf.util.UIScale; import com.kitfox.svg.SVGDiagram; import com.kitfox.svg.SVGException; import com.kitfox.svg.SVGUniverse; /** + * An icon that loads and paints SVG. + * * @author Karl Tauber */ public class FlatSVGIcon - extends ImageIcon + implements Icon { // use own SVG universe so that it can not be cleared from anywhere private static final SVGUniverse svgUniverse = new SVGUniverse(); private final String name; + private final int width; + private final int height; + private final float scale; + private final ClassLoader classLoader; + private SVGDiagram diagram; private boolean dark; + /** + * Creates an SVG icon from the given resource name. + *

+ * The SVG attributes {@code width} and {@code height} (or {@code viewBox}) + * in the tag {@code } are used as icon size. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @see ClassLoader#getResource(String) + */ public FlatSVGIcon( String name ) { + this( name, -1, -1, 1, null ); + } + + /** + * Creates an SVG icon from the given resource name. + * The SVG file is loaded from the given class loader. + *

+ * The SVG attributes {@code width} and {@code height} (or {@code viewBox}) + * in the tag {@code } are used as icon size. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @param classLoader the class loader used to load the SVG resource + * @see ClassLoader#getResource(String) + */ + public FlatSVGIcon( String name, ClassLoader classLoader ) { + this( name, -1, -1, 1, classLoader ); + } + + /** + * Creates an SVG icon from the given resource name with the given width and height. + *

+ * The icon is scaled if the given size is different to the size specified in the SVG file. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @param width the width of the icon + * @param height the height of the icon + * @see ClassLoader#getResource(String) + */ + public FlatSVGIcon( String name, int width, int height ) { + this( name, width, height, 1, null ); + } + + /** + * Creates an SVG icon from the given resource name with the given width and height. + * The SVG file is loaded from the given class loader. + *

+ * The icon is scaled if the given size is different to the size specified in the SVG file. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @param width the width of the icon + * @param height the height of the icon + * @param classLoader the class loader used to load the SVG resource + * @see ClassLoader#getResource(String) + */ + public FlatSVGIcon( String name, int width, int height, ClassLoader classLoader ) { + this( name, width, height, 1, classLoader ); + } + + /** + * Creates an SVG icon from the given resource name that is scaled by the given amount. + *

+ * The SVG attributes {@code width} and {@code height} (or {@code viewBox}) + * in the tag {@code } are used as base icon size, which is multiplied + * by the given scale factor. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @param scale the amount by which the icon size is scaled + * @see ClassLoader#getResource(String) + */ + public FlatSVGIcon( String name, float scale ) { + this( name, -1, -1, scale, null ); + } + + /** + * Creates an SVG icon from the given resource name that is scaled by the given amount. + * The SVG file is loaded from the given class loader. + *

+ * The SVG attributes {@code width} and {@code height} (or {@code viewBox}) + * in the tag {@code } are used as base icon size, which is multiplied + * by the given scale factor. + * + * @param name the name of the SVG resource (a '/'-separated path) + * @param scale the amount by which the icon size is scaled + * @param classLoader the class loader used to load the SVG resource + * @see ClassLoader#getResource(String) + */ + public FlatSVGIcon( String name, float scale, ClassLoader classLoader ) { + this( name, -1, -1, scale, classLoader ); + } + + private FlatSVGIcon( String name, int width, int height, float scale, ClassLoader classLoader ) { this.name = name; + this.classLoader = classLoader; + this.width = width; + this.height = height; + this.scale = scale; + } + + /** + * Creates a new icon with given width and height, which is derived from this icon. + * + * @param width the width of the new icon + * @param height the height of the new icon + * @return a new icon + */ + public FlatSVGIcon derive( int width, int height ) { + FlatSVGIcon icon = new FlatSVGIcon( name, width, height, scale, classLoader ); + icon.diagram = diagram; + icon.dark = dark; + return icon; + } + + /** + * Creates a new icon with given scaling, which is derived from this icon. + * + * @param scale the amount by which the icon size is scaled + * @return a new icon + */ + public FlatSVGIcon derive( float scale ) { + FlatSVGIcon icon = new FlatSVGIcon( name, width, height, scale, classLoader ); + icon.diagram = diagram; + icon.dark = dark; + return icon; } private void update() { @@ -75,30 +207,72 @@ public class FlatSVGIcon int dotIndex = name.lastIndexOf( '.' ); name = name.substring( 0, dotIndex ) + "_dark" + name.substring( dotIndex ); } - return FlatSVGIcon.class.getClassLoader().getResource( name ); + + ClassLoader cl = (classLoader != null) ? classLoader : FlatSVGIcon.class.getClassLoader(); + return cl.getResource( name ); } + /** + * Returns whether the SVG file was found. + * + * @return whether the SVG file was found + */ + public boolean hasFound() { + update(); + return diagram != null; + } + + /** + * Returns the scaled width of the icon. + */ @Override public int getIconWidth() { + if( width > 0 ) + return scaleSize( width ); + update(); - return (int) UIScale.scale( (diagram != null) ? diagram.getWidth() : 16 ); + return scaleSize( (diagram != null) ? Math.round( diagram.getWidth() ) : 16 ); } + /** + * Returns the scaled height of the icon. + */ @Override public int getIconHeight() { + if( height > 0 ) + return scaleSize( height ); + update(); - return (int) UIScale.scale( (diagram != null) ? diagram.getHeight() : 16 ); + return scaleSize( (diagram != null) ? Math.round( diagram.getHeight() ) : 16 ); + } + + private int scaleSize( int size ) { + int scaledSize = UIScale.scale( size ); + if( scale != 1 ) + scaledSize = Math.round( scaledSize * scale ); + return scaledSize; } @Override public void paintIcon( Component c, Graphics g, int x, int y ) { update(); + // check whether icon is outside of clipping area Rectangle clipBounds = g.getClipBounds(); if( clipBounds != null && !clipBounds.intersects( new Rectangle( x, y, getIconWidth(), getIconHeight() ) ) ) return; - Graphics2D g2 = (Graphics2D) g.create(); + // get gray filter + RGBImageFilter grayFilter = null; + if( c != null && !c.isEnabled() ) { + Object grayFilterObj = UIManager.get( "Component.grayFilter" ); + grayFilter = (grayFilterObj instanceof RGBImageFilter) + ? (RGBImageFilter) grayFilterObj + : GrayFilter.createDisabledIconFilter( dark ); + } + + Graphics2D g2 = new GraphicsFilter( (Graphics2D) g.create(), ColorFilter.getInstance(), grayFilter ); + try { FlatUIUtils.setRenderingHints( g2 ); g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR ); @@ -119,6 +293,14 @@ public class FlatSVGIcon g.clipRect( 0, 0, getIconWidth(), getIconHeight() ); UIScale.scaleGraphics( g ); + if( width > 0 || height > 0 ) { + double sx = (width > 0) ? width / diagram.getWidth() : 1; + double sy = (height > 0) ? height / diagram.getHeight() : 1; + if( sx != 1 || sy != 1 ) + g.scale( sx, sy ); + } + if( scale != 1 ) + g.scale( scale, scale ); diagram.setIgnoringClipHeuristic( true ); @@ -134,20 +316,6 @@ public class FlatSVGIcon g.fillRect( x, y, getIconWidth(), getIconHeight() ); } - @Override - public Image getImage() { - update(); - - BufferedImage image = new BufferedImage( getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB ); - Graphics2D g = image.createGraphics(); - try { - paintIcon( null, g, 0, 0 ); - } finally { - g.dispose(); - } - return image; - } - private static Boolean darkLaf; private static boolean isDarkLaf() { @@ -163,7 +331,95 @@ public class FlatSVGIcon } private static void lafChanged() { - LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); - darkLaf = (lookAndFeel instanceof FlatLaf && ((FlatLaf)lookAndFeel).isDark()); + darkLaf = FlatLaf.isLafDark(); + } + + //---- class ColorFilter -------------------------------------------------- + + public static class ColorFilter + { + private static ColorFilter instance; + + private final Map rgb2keyMap = new HashMap<>(); + private final Map color2colorMap = new HashMap<>(); + + public static ColorFilter getInstance() { + if( instance == null ) + instance = new ColorFilter(); + return instance; + } + + public ColorFilter() { + for( FlatIconColors c : FlatIconColors.values() ) + rgb2keyMap.put( c.rgb, c.key ); + } + + public void addAll( Map from2toMap ) { + color2colorMap.putAll( from2toMap ); + } + + public void add( Color from, Color to ) { + color2colorMap.put( from, to ); + } + + public void remove( Color from ) { + color2colorMap.remove( from ); + } + + public Color filter( Color color ) { + Color newColor = color2colorMap.get( color ); + if( newColor != null ) + return newColor; + + String colorKey = rgb2keyMap.get( color.getRGB() & 0xffffff ); + if( colorKey == null ) + return color; + + newColor = UIManager.getColor( colorKey ); + if( newColor == null ) + return color; + + return (newColor.getAlpha() != color.getAlpha()) + ? new Color( (newColor.getRGB() & 0x00ffffff) | (color.getRGB() & 0xff000000) ) + : newColor; + }; + } + + //---- class GraphicsFilter ----------------------------------------------- + + private static class GraphicsFilter + extends Graphics2DProxy + { + private final ColorFilter colorFilter; + private final RGBImageFilter grayFilter; + + public GraphicsFilter( Graphics2D delegate, ColorFilter colorFilter, RGBImageFilter grayFilter ) { + super( delegate ); + this.colorFilter = colorFilter; + this.grayFilter = grayFilter; + } + + @Override + public void setColor( Color c ) { + super.setColor( filterColor( c ) ); + } + + @Override + public void setPaint( Paint paint ) { + if( paint instanceof Color ) + paint = filterColor( (Color) paint ); + super.setPaint( paint ); + } + + private Color filterColor( Color color ) { + if( colorFilter != null ) + color = colorFilter.filter( color ); + if( grayFilter != null ) { + int oldRGB = color.getRGB(); + int newRGB = grayFilter.filterRGB( 0, 0, oldRGB ); + color = (newRGB != oldRGB) ? new Color( newRGB, true ) : color; + } + return color; + } } } diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.java new file mode 100644 index 00000000..3eee4ee6 --- /dev/null +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.java @@ -0,0 +1,914 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.extras; + +import java.awt.*; +import java.awt.event.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map.Entry; +import java.util.Set; +import java.util.function.Predicate; +import java.util.prefs.Preferences; +import javax.swing.*; +import javax.swing.border.Border; +import javax.swing.border.EmptyBorder; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableColumnModel; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.icons.FlatAbstractIcon; +import com.formdev.flatlaf.ui.FlatBorder; +import com.formdev.flatlaf.ui.FlatEmptyBorder; +import com.formdev.flatlaf.ui.FlatLineBorder; +import com.formdev.flatlaf.ui.FlatMarginBorder; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.GrayFilter; +import com.formdev.flatlaf.util.HSLColor; +import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.formdev.flatlaf.util.UIScale; + +/** + * A simple UI defaults inspector that shows a window with all UI defaults used + * in current look and feel. + *

+ * To use it in an application install it with: + *

+ * FlatUIDefaultsInspector.install( "ctrl shift alt Y" );
+ * 
+ * This can be done e.g. in the main() method and allows enabling (and disabling) + * the UI defaults inspector with the given keystroke. + * + * @author Karl Tauber + */ +public class FlatUIDefaultsInspector +{ + private static final int KEY_MODIFIERS_MASK = InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK; + + private static FlatUIDefaultsInspector inspector; + + private final String title; + private final PropertyChangeListener lafListener = this::lafChanged; + private final PropertyChangeListener lafDefaultsListener = this::lafDefaultsChanged; + private boolean refreshPending; + + /** + * Installs a key listener into the application that allows enabling and disabling + * the UI inspector with the given keystroke (e.g. "ctrl shift alt Y"). + * + * @param activationKeys a keystroke (e.g. "ctrl shift alt Y") + */ + public static void install( String activationKeys ) { + KeyStroke keyStroke = KeyStroke.getKeyStroke( activationKeys ); + Toolkit.getDefaultToolkit().addAWTEventListener( e -> { + if( e.getID() == KeyEvent.KEY_RELEASED && + ((KeyEvent)e).getKeyCode() == keyStroke.getKeyCode() && + (((KeyEvent)e).getModifiersEx() & KEY_MODIFIERS_MASK) == (keyStroke.getModifiers() & KEY_MODIFIERS_MASK) ) + { + show(); + } + }, AWTEvent.KEY_EVENT_MASK ); + } + + public static void show() { + if( inspector != null ) { + inspector.ensureOnScreen(); + inspector.frame.toFront(); + return; + } + + inspector = new FlatUIDefaultsInspector(); + inspector.frame.setVisible( true ); + } + + public static void hide() { + if( inspector != null ) + inspector.frame.dispose(); + } + + private FlatUIDefaultsInspector() { + initComponents(); + + title = frame.getTitle(); + updateWindowTitle(); + + panel.setBorder( new ScaledEmptyBorder( 10, 10, 10, 10 ) ); + filterPanel.setBorder( new ScaledEmptyBorder( 0, 0, 10, 0 ) ); + + // initialize filter + filterField.getDocument().addDocumentListener( new DocumentListener() { + @Override + public void removeUpdate( DocumentEvent e ) { + filterChanged(); + } + @Override + public void insertUpdate( DocumentEvent e ) { + filterChanged(); + } + @Override + public void changedUpdate( DocumentEvent e ) { + filterChanged(); + } + } ); + delegateKey( KeyEvent.VK_UP, "unitScrollUp" ); + delegateKey( KeyEvent.VK_DOWN, "unitScrollDown" ); + delegateKey( KeyEvent.VK_PAGE_UP, "scrollUp" ); + delegateKey( KeyEvent.VK_PAGE_DOWN, "scrollDown" ); + + // initialize table + table.setModel( new ItemsTableModel( getUIDefaultsItems() ) ); + table.setDefaultRenderer( String.class, new KeyRenderer() ); + table.setDefaultRenderer( Item.class, new ValueRenderer() ); + table.getRowSorter().setSortKeys( Collections.singletonList( + new RowSorter.SortKey( 0, SortOrder.ASCENDING ) ) ); + + // restore window bounds + Preferences prefs = getPrefs(); + int x = prefs.getInt( "x", -1 ); + int y = prefs.getInt( "y", -1 ); + int width = prefs.getInt( "width", UIScale.scale( 600 ) ); + int height = prefs.getInt( "height", UIScale.scale( 800 ) ); + frame.setSize( width, height ); + if( x != -1 && y != -1 ) { + frame.setLocation( x, y ); + ensureOnScreen(); + } else + frame.setLocationRelativeTo( null ); + + // restore column widths + TableColumnModel columnModel = table.getColumnModel(); + columnModel.getColumn( 0 ).setPreferredWidth( prefs.getInt( "column1width", 100 ) ); + columnModel.getColumn( 1 ).setPreferredWidth( prefs.getInt( "column2width", 100 ) ); + + // restore filter + String filter = prefs.get( "filter", "" ); + String valueType = prefs.get( "valueType", null ); + if( filter != null && !filter.isEmpty() ) + filterField.setText( filter ); + if( valueType != null ) + valueTypeField.setSelectedItem( valueType ); + + UIManager.addPropertyChangeListener( lafListener ); + UIManager.getDefaults().addPropertyChangeListener( lafDefaultsListener ); + + // register F5 key to refresh + ((JComponent)frame.getContentPane()).registerKeyboardAction( + e -> refresh(), + KeyStroke.getKeyStroke( KeyEvent.VK_F5, 0, false ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + + // register ESC key to close frame + ((JComponent)frame.getContentPane()).registerKeyboardAction( + e -> frame.dispose(), + KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + } + + private void delegateKey( int keyCode, String actionKey ) { + KeyStroke keyStroke = KeyStroke.getKeyStroke( keyCode, 0 ); + String actionMapKey = "delegate-" + actionKey; + + filterField.getInputMap().put( keyStroke, actionMapKey ); + filterField.getActionMap().put( actionMapKey, new AbstractAction() { + @Override + public void actionPerformed( ActionEvent e ) { + Action action = scrollPane.getActionMap().get( actionKey ); + if( action != null ) { + action.actionPerformed( new ActionEvent( scrollPane, + e.getID(), actionKey, e.getWhen(), e.getModifiers() ) ); + } + } + } ); + } + + private void ensureOnScreen() { + Rectangle frameBounds = frame.getBounds(); + boolean onScreen = false; + for( GraphicsDevice screen : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() ) { + GraphicsConfiguration gc = screen.getDefaultConfiguration(); + Rectangle screenBounds = FlatUIUtils.subtractInsets( gc.getBounds(), + Toolkit.getDefaultToolkit().getScreenInsets( gc ) ); + if( frameBounds.intersects( screenBounds ) ) { + onScreen = true; + break; + } + } + + if( !onScreen ) + frame.setLocationRelativeTo( null ); + } + + void lafChanged( PropertyChangeEvent e ) { + if( "lookAndFeel".equals( e.getPropertyName() ) ) + refresh(); + } + + void lafDefaultsChanged( PropertyChangeEvent e ) { + if( refreshPending ) + return; + + refreshPending = true; + EventQueue.invokeLater( () -> { + refresh(); + refreshPending = false; + } ); + } + + void refresh() { + ItemsTableModel model = (ItemsTableModel) table.getModel(); + model.setItems( getUIDefaultsItems() ); + + updateWindowTitle(); + } + + private Item[] getUIDefaultsItems() { + UIDefaults defaults = UIManager.getDefaults(); + UIDefaults lafDefaults = UIManager.getLookAndFeelDefaults(); + + Set> defaultsSet = defaults.entrySet(); + ArrayList items = new ArrayList<>( defaultsSet.size() ); + HashSet keys = new HashSet<>( defaultsSet.size() ); + for( Entry e : defaultsSet ) { + Object key = e.getKey(); + + // ignore non-string keys + if( !(key instanceof String) ) + continue; + + // ignore values of type Class + Object value = defaults.get( key ); + if( value instanceof Class ) + continue; + + // avoid duplicate keys if UIManager.put(key,value) was used to override a LaF value + if( !keys.add( key ) ) + continue; + + // check whether key was overridden using UIManager.put(key,value) + Object lafValue = null; + if( defaults.containsKey( key ) ) + lafValue = lafDefaults.get( key ); + + // add item + items.add( new Item( String.valueOf( key ), value, lafValue ) ); + } + + return items.toArray( new Item[items.size()] ); + } + + private void updateWindowTitle() { + frame.setTitle( title + " - " + UIManager.getLookAndFeel().getName() ); + } + + private void saveWindowBounds() { + Preferences prefs = getPrefs(); + prefs.putInt( "x", frame.getX() ); + prefs.putInt( "y", frame.getY() ); + prefs.putInt( "width", frame.getWidth() ); + prefs.putInt( "height", frame.getHeight() ); + + TableColumnModel columnModel = table.getColumnModel(); + prefs.putInt( "column1width", columnModel.getColumn( 0 ).getWidth() ); + prefs.putInt( "column2width", columnModel.getColumn( 1 ).getWidth() ); + } + + private Preferences getPrefs() { + return Preferences.userRoot().node( "flatlaf-uidefaults-inspector" ); + } + + private void windowClosed() { + UIManager.removePropertyChangeListener( lafListener ); + UIManager.getDefaults().removePropertyChangeListener( lafDefaultsListener ); + + inspector = null; + } + + private void filterChanged() { + String filter = filterField.getText().trim(); + String valueType = (String) valueTypeField.getSelectedItem(); + + // split filter string on space characters + String[] filters = filter.split( " +" ); + for( int i = 0; i < filters.length; i++ ) + filters[i] = filters[i].toLowerCase( Locale.ENGLISH ); + + ItemsTableModel model = (ItemsTableModel) table.getModel(); + model.setFilter( item -> { + if( valueType != null && + !valueType.equals( "(any)" ) && + !valueType.equals( typeOfValue( item.value ) ) ) + return false; + + String lkey = item.key.toLowerCase( Locale.ENGLISH ); + String lvalue = item.getValueAsString().toLowerCase( Locale.ENGLISH ); + for( String f : filters ) { + if( lkey.contains( f ) || lvalue.contains( f ) ) + return true; + } + return false; + } ); + + Preferences prefs = getPrefs(); + prefs.put( "filter", filter ); + prefs.put( "valueType", valueType ); + } + + private String typeOfValue( Object value ) { + if( value instanceof Boolean ) + return "Boolean"; + if( value instanceof Border ) + return "Border"; + if( value instanceof Color ) + return "Color"; + if( value instanceof Dimension ) + return "Dimension"; + if( value instanceof Float ) + return "Float"; + if( value instanceof Font ) + return "Font"; + if( value instanceof Icon ) + return "Icon"; + if( value instanceof Insets ) + return "Insets"; + if( value instanceof Integer ) + return "Integer"; + if( value instanceof String ) + return "String"; + return "(other)"; + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + frame = new JFrame(); + panel = new JPanel(); + filterPanel = new JPanel(); + flterLabel = new JLabel(); + filterField = new JTextField(); + valueTypeLabel = new JLabel(); + valueTypeField = new JComboBox<>(); + scrollPane = new JScrollPane(); + table = new JTable(); + + //======== frame ======== + { + frame.setTitle("UI Defaults Inspector"); + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.addWindowListener(new WindowAdapter() { + @Override + public void windowClosed(WindowEvent e) { + FlatUIDefaultsInspector.this.windowClosed(); + } + @Override + public void windowClosing(WindowEvent e) { + saveWindowBounds(); + } + @Override + public void windowDeactivated(WindowEvent e) { + saveWindowBounds(); + } + }); + Container frameContentPane = frame.getContentPane(); + frameContentPane.setLayout(new BorderLayout()); + + //======== panel ======== + { + panel.setLayout(new BorderLayout()); + + //======== filterPanel ======== + { + filterPanel.setLayout(new GridBagLayout()); + ((GridBagLayout)filterPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0, 0}; + ((GridBagLayout)filterPanel.getLayout()).rowHeights = new int[] {0, 0}; + ((GridBagLayout)filterPanel.getLayout()).columnWeights = new double[] {0.0, 1.0, 0.0, 0.0, 1.0E-4}; + ((GridBagLayout)filterPanel.getLayout()).rowWeights = new double[] {0.0, 1.0E-4}; + + //---- flterLabel ---- + flterLabel.setText("Filter:"); + flterLabel.setLabelFor(filterField); + flterLabel.setDisplayedMnemonic('F'); + filterPanel.add(flterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 10), 0, 0)); + + //---- filterField ---- + filterField.putClientProperty("JTextField.placeholderText", "enter one or more filter strings, separated by space characters"); + filterPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 10), 0, 0)); + + //---- valueTypeLabel ---- + valueTypeLabel.setText("Value Type:"); + valueTypeLabel.setLabelFor(valueTypeField); + valueTypeLabel.setDisplayedMnemonic('T'); + filterPanel.add(valueTypeLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 10), 0, 0)); + + //---- valueTypeField ---- + valueTypeField.setModel(new DefaultComboBoxModel<>(new String[] { + "(any)", + "Boolean", + "Border", + "Color", + "Dimension", + "Float", + "Font", + "Icon", + "Insets", + "Integer", + "String", + "(other)" + })); + valueTypeField.addActionListener(e -> filterChanged()); + filterPanel.add(valueTypeField, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, + GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 0), 0, 0)); + } + panel.add(filterPanel, BorderLayout.NORTH); + + //======== scrollPane ======== + { + + //---- table ---- + table.setAutoCreateRowSorter(true); + scrollPane.setViewportView(table); + } + panel.add(scrollPane, BorderLayout.CENTER); + } + frameContentPane.add(panel, BorderLayout.CENTER); + } + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JFrame frame; + private JPanel panel; + private JPanel filterPanel; + private JLabel flterLabel; + private JTextField filterField; + private JLabel valueTypeLabel; + private JComboBox valueTypeField; + private JScrollPane scrollPane; + private JTable table; + // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class Item --------------------------------------------------------- + + private static class Item { + final String key; + final Object value; + final Object lafValue; + + private String valueStr; + + Item( String key, Object value, Object lafValue ) { + this.key = key; + this.value = value; + this.lafValue = lafValue; + } + + String getValueAsString() { + if( valueStr == null ) + valueStr = valueAsString( value ); + return valueStr; + } + + static String valueAsString( Object value ) { + if( value instanceof Color ) { + Color color = (Color) value; + HSLColor hslColor = new HSLColor( color ); + if( color.getAlpha() == 255 ) { + return String.format( "%s rgb(%d, %d, %d) hsl(%d, %d, %d)", + color2hex( color ), + color.getRed(), color.getGreen(), color.getBlue(), + (int) hslColor.getHue(), (int) hslColor.getSaturation(), + (int) hslColor.getLuminance() ); + } else { + return String.format( "%s rgba(%d, %d, %d, %d) hsla(%d, %d, %d, %d)", + color2hex( color ), + color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha(), + (int) hslColor.getHue(), (int) hslColor.getSaturation(), + (int) hslColor.getLuminance(), (int) (hslColor.getAlpha() * 100) ); + } + } else if( value instanceof Insets ) { + Insets insets = (Insets) value; + return insets.top + "," + insets.left + "," + insets.bottom + "," + insets.right; + } else if( value instanceof Dimension ) { + Dimension dim = (Dimension) value; + return dim.width + "," + dim.height; + } else if( value instanceof Font ) { + Font font = (Font) value; + String s = font.getFamily() + " " + font.getSize(); + if( font.isBold() ) + s += " bold"; + if( font.isItalic() ) + s += " italic"; + return s; + } else if( value instanceof Icon ) { + Icon icon = (Icon) value; + return icon.getIconWidth() + "x" + icon.getIconHeight() + " " + icon.getClass().getName(); + } else if( value instanceof Border ) { + Border border = (Border) value; + if( border instanceof FlatLineBorder ) { + FlatLineBorder lineBorder = (FlatLineBorder) border; + return valueAsString( lineBorder.getUnscaledBorderInsets() ) + + " " + Item.color2hex( lineBorder.getLineColor() ) + + " " + lineBorder.getLineThickness() + + " " + border.getClass().getName(); + } else if( border instanceof EmptyBorder ) { + Insets insets = (border instanceof FlatEmptyBorder) + ? ((FlatEmptyBorder)border).getUnscaledBorderInsets() + : ((EmptyBorder)border).getBorderInsets(); + return valueAsString( insets ) + " " + border.getClass().getName(); + } else if( border instanceof FlatBorder || border instanceof FlatMarginBorder ) + return border.getClass().getName(); + else + return String.valueOf( value ); + } else if( value instanceof GrayFilter ) { + GrayFilter grayFilter = (GrayFilter) value; + return grayFilter.getBrightness() + "," + grayFilter.getContrast() + + " " + grayFilter.getAlpha() + " " + grayFilter.getClass().getName(); + } else if( value instanceof ActionMap ) { + ActionMap actionMap = (ActionMap) value; + return "ActionMap (" + actionMap.size() + ")"; + } else if( value instanceof InputMap ) { + InputMap inputMap = (InputMap) value; + return "InputMap (" + inputMap.size() + ")"; + } else if( value instanceof Object[] ) + return Arrays.toString( (Object[]) value ); + else if( value instanceof int[] ) + return Arrays.toString( (int[]) value ); + else + return String.valueOf( value ); + } + + private static String color2hex( Color color ) { + int rgb = color.getRGB(); + boolean hasAlpha = color.getAlpha() != 255; + + boolean useShortFormat = + (rgb & 0xf0000000) == (rgb & 0xf000000) << 4 && + (rgb & 0xf00000) == (rgb & 0xf0000) << 4 && + (rgb & 0xf000) == (rgb & 0xf00) << 4 && + (rgb & 0xf0) == (rgb & 0xf) << 4; + + if( useShortFormat ) { + int srgb = ((rgb & 0xf0000) >> 8) | ((rgb & 0xf00) >> 4) | (rgb & 0xf); + return String.format( hasAlpha ? "#%03X%X" : "#%03X", srgb, (rgb >> 24) & 0xf ); + } else + return String.format( hasAlpha ? "#%06X%02X" : "#%06X", rgb & 0xffffff, (rgb >> 24) & 0xff ); + } + + // used for sorting by value + @Override + public String toString() { + return getValueAsString(); + } + } + + //---- class ItemsTableModel ---------------------------------------------- + + private static class ItemsTableModel + extends AbstractTableModel + { + private Item[] allItems; + private Item[] items; + private Predicate filter; + + ItemsTableModel( Item[] items ) { + this.allItems = this.items = items; + } + + void setItems( Item[] items ) { + this.allItems = this.items = items; + setFilter( filter ); + } + + void setFilter( Predicate filter ) { + this.filter = filter; + + if( filter != null ) { + ArrayList list = new ArrayList<>( allItems.length ); + for( Item item : allItems ) { + if( filter.test( item ) ) + list.add( item ); + } + items = list.toArray( new Item[list.size()] ); + } else + items = allItems; + + fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return items.length; + } + + @Override + public int getColumnCount() { + return 2; + } + + @Override + public String getColumnName( int columnIndex ) { + switch( columnIndex ) { + case 0: return "Name"; + case 1: return "Value"; + } + return super.getColumnName( columnIndex ); + } + + @Override + public Class getColumnClass( int columnIndex ) { + switch( columnIndex ) { + case 0: return String.class; + case 1: return Item.class; + } + return super.getColumnClass( columnIndex ); + } + + @Override + public Object getValueAt( int rowIndex, int columnIndex ) { + Item item = items[rowIndex]; + switch( columnIndex ) { + case 0: return item.key; + case 1: return item; + } + return null; + } + } + + //---- class Renderer ----------------------------------------------------- + + private static class Renderer + extends DefaultTableCellRenderer + { + protected boolean selected; + protected boolean first; + + protected void init( JTable table, String key, boolean selected, int row ) { + this.selected = selected; + + first = false; + if( row > 0 ) { + String previousKey = (String) table.getValueAt( row - 1, 0 ); + int dot = key.indexOf( '.' ); + if( dot > 0 ) { + String prefix = key.substring( 0, dot + 1 ); + first = !previousKey.startsWith( prefix ); + } else + first = previousKey.indexOf( '.' ) > 0; + } + } + + protected void paintSeparator( Graphics g ) { + if( first && !selected ) { + g.setColor( FlatLaf.isLafDark() ? Color.gray : Color.lightGray ); + g.fillRect( 0, 0, getWidth() - 1, 1 ); + } + } + + protected String layoutLabel( FontMetrics fm, String text, Rectangle textR ) { + int width = getWidth(); + int height = getHeight(); + Insets insets = getInsets(); + + Rectangle viewR = new Rectangle( insets.left, insets.top, + width - (insets.left + insets.right), + height - (insets.top + insets.bottom) ); + Rectangle iconR = new Rectangle(); + + return SwingUtilities.layoutCompoundLabel( this, fm, text, null, + getVerticalAlignment(), getHorizontalAlignment(), + getVerticalTextPosition(), getHorizontalTextPosition(), + viewR, iconR, textR, getIconTextGap() ); + } + } + + //---- class KeyRenderer -------------------------------------------------- + + private static class KeyRenderer + extends Renderer + { + private String key; + private boolean isOverridden; + private Icon overriddenIcon; + + @Override + public Component getTableCellRendererComponent( JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column ) + { + key = (String) value; + init( table, key, isSelected, row ); + + Item item = (Item) table.getValueAt( row, 1 ); + isOverridden = (item.lafValue != null); + + // set tooltip + String toolTipText = key; + if( isOverridden ) + toolTipText += " \n\nLaF UI default value was overridden with UIManager.put(key,value)."; + setToolTipText( toolTipText ); + + return super.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column ); + } + + @Override + protected void paintComponent( Graphics g ) { + g.setColor( getBackground() ); + g.fillRect( 0, 0, getWidth(), getHeight() ); + + FontMetrics fm = getFontMetrics( getFont() ); + Rectangle textR = new Rectangle(); + String clippedText = layoutLabel( fm, key, textR ); + int x = textR.x; + int y = textR.y + fm.getAscent(); + + int dot = key.indexOf( '.' ); + if( dot > 0 && !selected ) { + g.setColor( FlatUIUtils.getUIColor( "Label.disabledForeground", + FlatUIUtils.getUIColor( "Label.disabledText", Color.gray ) ) ); + + if( dot >= clippedText.length() ) + FlatUIUtils.drawString( this, g, clippedText, x, y ); + else { + String prefix = clippedText.substring( 0, dot + 1 ); + String subkey = clippedText.substring( dot + 1 ); + + FlatUIUtils.drawString( this, g, prefix, x, y ); + + g.setColor( getForeground() ); + FlatUIUtils.drawString( this, g, subkey, x + fm.stringWidth( prefix ), y ); + } + } else { + g.setColor( getForeground() ); + FlatUIUtils.drawString( this, g, clippedText, x, y ); + } + + if( isOverridden ) { + if( overriddenIcon == null ) { + overriddenIcon = new FlatAbstractIcon( 16, 16, null ) { + @Override + protected void paintIcon( Component c, Graphics2D g2 ) { + g2.setColor( FlatUIUtils.getUIColor( "Actions.Red", Color.red ) ); + g2.setStroke( new BasicStroke( 2f ) ); + g2.draw( FlatUIUtils.createPath( false, 3,10, 8,5, 13,10 ) ); + } + }; + } + + overriddenIcon.paintIcon( this, g, + getWidth() - overriddenIcon.getIconWidth(), + (getHeight() - overriddenIcon.getIconHeight()) / 2 ); + } + + paintSeparator( g ); + } + } + + //---- class ValueRenderer ------------------------------------------------ + + private static class ValueRenderer + extends Renderer + { + private Item item; + + @Override + public Component getTableCellRendererComponent( JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column ) + { + item = (Item) value; + init( table, item.key, isSelected, row ); + + // reset background, foreground and icon + if( !(item.value instanceof Color) ) { + setBackground( null ); + setForeground( null ); + } + if( !(item.value instanceof Icon) ) + setIcon( null ); + + // value to string + value = item.getValueAsString(); + + super.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column ); + + if( item.value instanceof Color ) { + Color color = (Color) item.value; + boolean isDark = new HSLColor( color ).getLuminance() < 70; + setBackground( color ); + setForeground( isDark ? Color.white : Color.black ); + } else if( item.value instanceof Icon ) { + Icon icon = (Icon) item.value; + setIcon( new SafeIcon( icon ) ); + } + + // set tooltip + String toolTipText = String.valueOf( item.value ); + if( item.lafValue != null ) { + toolTipText += " \n\nLaF UI default value was overridden with UIManager.put(key,value):\n " + + Item.valueAsString( item.lafValue ) + "\n " + String.valueOf( item.lafValue ); + } + setToolTipText( toolTipText ); + + return this; + } + + @Override + protected void paintComponent( Graphics g ) { + if( item.value instanceof Color ) { + // fill background + g.setColor( getBackground() ); + g.fillRect( 0, 0, getWidth(), getHeight() ); + + // layout text + FontMetrics fm = getFontMetrics( getFont() ); + String text = getText(); + Rectangle textR = new Rectangle(); + layoutLabel( fm, text, textR ); + int x = textR.x; + int y = textR.y + fm.getAscent(); + + g.setColor( getForeground() ); + + // paint rgb() and hsl() horizontally aligned + int rgbIndex = text.indexOf( "rgb" ); + int hslIndex = text.indexOf( "hsl" ); + if( rgbIndex > 0 && hslIndex > rgbIndex ) { + String hexText = text.substring( 0, rgbIndex ); + String rgbText = text.substring( rgbIndex, hslIndex ); + String hslText = text.substring( hslIndex ); + int hexWidth = Math.max( fm.stringWidth( hexText ), fm.stringWidth( "#DDDDDD " ) ); + int rgbWidth = Math.max( fm.stringWidth( rgbText ), fm.stringWidth( "rgb(444, 444, 444) " ) ); + FlatUIUtils.drawString( this, g, hexText, x, y ); + FlatUIUtils.drawString( this, g, rgbText, x + hexWidth, y ); + FlatUIUtils.drawString( this, g, hslText, x + hexWidth + rgbWidth, y ); + } else + FlatUIUtils.drawString( this, g, text, x, y ); + } else + super.paintComponent( g ); + + paintSeparator( g ); + } + } + + //---- class SafeIcon ----------------------------------------------------- + + private static class SafeIcon + implements Icon + { + private final Icon icon; + + SafeIcon( Icon icon ) { + this.icon = icon; + } + + @Override + public void paintIcon( Component c, Graphics g, int x, int y ) { + int width = getIconWidth(); + int height = getIconHeight(); + + try { + g.setColor( UIManager.getColor( "Panel.background" ) ); + g.fillRect( x, y, width, height ); + + icon.paintIcon( c, g, x, y ); + } catch( Exception ex ) { + g.setColor( Color.red ); + g.drawRect( x, y, width - 1, height - 1 ); + } + } + + @Override + public int getIconWidth() { + return icon.getIconWidth(); + } + + @Override + public int getIconHeight() { + return icon.getIconHeight(); + } + } +} diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.jfd b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.jfd new file mode 100644 index 00000000..a563dd73 --- /dev/null +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.jfd @@ -0,0 +1,90 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "frame" + "title": "UI Defaults Inspector" + "defaultCloseOperation": 2 + "$sizePolicy": 2 + "$locationPolicy": 2 + addEvent( new FormEvent( "java.awt.event.WindowListener", "windowClosed", "windowClosed", false ) ) + addEvent( new FormEvent( "java.awt.event.WindowListener", "windowClosing", "saveWindowBounds", false ) ) + addEvent( new FormEvent( "java.awt.event.WindowListener", "windowDeactivated", "saveWindowBounds", false ) ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.GridBagLayout ) { + "$columnSpecs": "0, 0:1.0, 0, 0" + "$rowSpecs": "0" + "$hGap": 10 + "$vGap": 5 + "$alignLeft": true + "$alignTop": true + } ) { + name: "filterPanel" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "flterLabel" + "text": "Filter:" + "labelFor": new FormReference( "filterField" ) + "displayedMnemonic": 70 + }, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "filterField" + "$client.JTextField.placeholderText": "enter one or more filter strings, separated by space characters" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) { + "gridx": 1 + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "valueTypeLabel" + "text": "Value Type:" + "labelFor": new FormReference( "valueTypeField" ) + "displayedMnemonic": 84 + }, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) { + "gridx": 2 + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "valueTypeField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "(any)" + addElement( "(any)" ) + addElement( "Boolean" ) + addElement( "Border" ) + addElement( "Color" ) + addElement( "Dimension" ) + addElement( "Float" ) + addElement( "Font" ) + addElement( "Icon" ) + addElement( "Insets" ) + addElement( "Integer" ) + addElement( "String" ) + addElement( "(other)" ) + } + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "filterChanged", false ) ) + }, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) { + "gridx": 3 + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "North" + } ) + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + name: "scrollPane" + add( new FormComponent( "javax.swing.JTable" ) { + name: "table" + "autoCreateRowSorter": true + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 400, 300 ) + } ) + } +} diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/SVGUtils.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/SVGUtils.java new file mode 100644 index 00000000..9f698d48 --- /dev/null +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/SVGUtils.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.extras; + +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import javax.swing.JWindow; +import com.kitfox.svg.SVGCache; +import com.kitfox.svg.SVGDiagram; +import com.kitfox.svg.SVGException; + +/** + * Utility methods for SVG. + * + * @author Karl Tauber + */ +public class SVGUtils +{ + /** + * Creates from the given SVG a list of icon images with different sizes that + * can be used for windows headers. The SVG should have a size of 16x16, + * otherwise it is scaled. + * + * @param svgName the name of the SVG resource (a '/'-separated path) + * @return list of icon images with different sizes (16x16, 24x24, 32x32, 48x48 and 64x64) + * @throws RuntimeException if failed to load or render SVG file + * @see JWindow#setIconImages(List) + */ + public static List createWindowIconImages( String svgName ) { + SVGDiagram diagram = loadSVG( svgName ); + + return Arrays.asList( + svg2image( diagram, 16, 16 ), + svg2image( diagram, 24, 24 ), + svg2image( diagram, 32, 32 ), + svg2image( diagram, 48, 48 ), + svg2image( diagram, 64, 64 ) + ); + } + + /** + * Creates a buffered image and renders the given SVG into it. + * + * @param svgName the name of the SVG resource (a '/'-separated path) + * @param width the width of the image + * @param height the height of the image + * @return the image + * @throws RuntimeException if failed to load or render SVG file + */ + public static BufferedImage svg2image( String svgName, int width, int height ) { + return svg2image( loadSVG( svgName ), width, height ); + } + + /** + * Creates a buffered image and renders the given SVG into it. + * + * @param svgName the name of the SVG resource (a '/'-separated path) + * @param scaleFactor the amount by which the SVG size is scaled + * @return the image + * @throws RuntimeException if failed to load or render SVG file + */ + public static BufferedImage svg2image( String svgName, float scaleFactor ) { + SVGDiagram diagram = loadSVG( svgName ); + int width = (int) (diagram.getWidth() * scaleFactor); + int height = (int) (diagram.getHeight() * scaleFactor); + return svg2image( diagram, width, height ); + } + + /** + * Creates a buffered image and renders the given SVGDiagram into it. + * + * @param diagram the SVG diagram + * @param width the width of the image + * @param height the height of the image + * @return the image + * @throws RuntimeException if failed to render SVG file + */ + public static BufferedImage svg2image( SVGDiagram diagram, int width, int height ) { + try { + BufferedImage image = new BufferedImage( width, height, BufferedImage.TYPE_INT_ARGB ); + + Graphics2D g = image.createGraphics(); + try { + g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); + g.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR ); + + double sx = width / diagram.getWidth(); + double sy = height / diagram.getHeight(); + if( sx != 1 || sy != 1 ) + g.scale( sx, sy ); + + diagram.setIgnoringClipHeuristic( true ); + + diagram.render( g ); + } finally { + g.dispose(); + } + return image; + + } catch( SVGException ex ) { + throw new RuntimeException( ex ); + } + } + + /** + * Loads a SVG file. + * + * @param svgName the name of the SVG resource (a '/'-separated path) + * @return the SVG diagram + * @throws RuntimeException if failed to load SVG file + */ + private static SVGDiagram loadSVG( String svgName ) { + try { + URL url = SVGUtils.class.getResource( svgName ); + return SVGCache.getSVGUniverse().getDiagram( url.toURI() ); + } catch( URISyntaxException ex ) { + throw new RuntimeException( ex ); + } + } +} diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java index 4c13396b..a60c45ef 100644 --- a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java @@ -16,17 +16,23 @@ package com.formdev.flatlaf.extras; +import java.awt.Color; +import java.awt.Graphics; import java.awt.event.ItemEvent; import javax.swing.JCheckBox; +import javax.swing.LookAndFeel; +import javax.swing.UIManager; +import com.formdev.flatlaf.FlatLaf; /** * A tri-state check box. - * + *

* To display the third state, this component requires an LaF that supports painting * the indeterminate state if client property {@code "JButton.selectedState"} has the * value {@code "indeterminate"}. - * + *

* FlatLaf and Mac Aqua LaF support the third state. + * For other LaFs a magenta rectangle is painted around the component for the third state. * * @author Karl Tauber */ @@ -58,7 +64,7 @@ public class TriStateCheckBox @Override public void setSelected( boolean b ) { switch( state ) { - case INDETERMINATE: setState( State.SELECTED ); break; + case INDETERMINATE: setState( State.SELECTED ); break; case SELECTED: setState( State.UNSELECTED ); break; case UNSELECTED: setState( thirdStateEnabled ? State.INDETERMINATE : State.SELECTED ); break; } @@ -89,6 +95,19 @@ public class TriStateCheckBox repaint(); } + public Boolean getValue() { + switch( state ) { + default: + case INDETERMINATE: return null; + case SELECTED: return true; + case UNSELECTED: return false; + } + } + + public void setValue( Boolean value ) { + setState( value == null ? State.INDETERMINATE : (value ? State.SELECTED : State.UNSELECTED) ); + } + public boolean isThirdStateEnabled() { return thirdStateEnabled; } @@ -104,4 +123,19 @@ public class TriStateCheckBox public void setSelected( boolean b ) { setState( b ? State.SELECTED : State.UNSELECTED ); } + + @Override + protected void paintComponent( Graphics g ) { + super.paintComponent( g ); + + if( state == State.INDETERMINATE && !isThirdStateSupported() ) { + g.setColor( Color.magenta ); + g.drawRect( 0, 0, getWidth() - 1, getHeight() - 1 ); + } + } + + private boolean isThirdStateSupported() { + LookAndFeel laf = UIManager.getLookAndFeel(); + return laf instanceof FlatLaf || laf.getClass().getName().equals( "com.apple.laf.AquaLookAndFeel" ); + } } diff --git a/flatlaf-extras/src/main/module-info/module-info.java b/flatlaf-extras/src/main/module-info/module-info.java new file mode 100644 index 00000000..c351ed1a --- /dev/null +++ b/flatlaf-extras/src/main/module-info/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Karl Tauber + */ +module com.formdev.flatlaf.extras { + requires java.desktop; + requires java.prefs; + requires static com.kitfox.svg; // optional at runtime + requires com.formdev.flatlaf; + + exports com.formdev.flatlaf.extras; +} diff --git a/flatlaf-intellij-themes/.settings/org.eclipse.jdt.core.prefs b/flatlaf-intellij-themes/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-intellij-themes/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-intellij-themes/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-intellij-themes/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-intellij-themes/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-intellij-themes/README.md b/flatlaf-intellij-themes/README.md new file mode 100644 index 00000000..ff189a63 --- /dev/null +++ b/flatlaf-intellij-themes/README.md @@ -0,0 +1,112 @@ +FlatLaf IntelliJ Themes Pack +============================ + +This addon for FlatLaf bundles many popular open-source 3rd party themes from +JetBrains Plugins Repository into a JAR and provides Java classes to use them. + +Use [FlatLaf Demo](https://github.com/JFormDesigner/FlatLaf#demo) to try them +out. + + +Download +-------- + +FlatLaf IntelliJ Themes Pack binaries are available on **JCenter** and **Maven +Central**. + +If you use Maven or Gradle, add a dependency with following coordinates to your +build script: + + groupId: com.formdev + artifactId: flatlaf-intellij-themes + version: (see button below) + +Otherwise download `flatlaf-intellij-themes-.jar` here: + +[![Download](https://api.bintray.com/packages/jformdesigner/flatlaf/flatlaf-intellij-themes/images/download.svg)](https://bintray.com/jformdesigner/flatlaf/flatlaf-intellij-themes/_latestVersion) + +You also need `flatlaf-.jar`, which you can download here: + +[![Download](https://api.bintray.com/packages/jformdesigner/flatlaf/flatlaf/images/download.svg)](https://bintray.com/jformdesigner/flatlaf/flatlaf/_latestVersion) + + +How to use? +----------- + +Choose a theme (see list below) and invoke its `install` method. E.g.: + +~~~java +FlatArcOrangeIJTheme.install(); +~~~ + + +Themes +------ + +This addon contains following themes. + +Name | Class +-----|------ +[Arc](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcIJTheme` +[Arc - Orange](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcOrangeIJTheme` +[Arc Dark](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcDarkIJTheme` +[Arc Dark - Orange](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcDarkOrangeIJTheme` +[Carbon](https://github.com/luisfer0793/theme-carbon) | `com.formdev.flatlaf.intellijthemes.FlatCarbonIJTheme` +[Cobalt 2](https://github.com/ngehlert/cobalt2) | `com.formdev.flatlaf.intellijthemes.FlatCobalt2IJTheme` +[Cyan light](https://github.com/OlyaB/CyanTheme) | `com.formdev.flatlaf.intellijthemes.FlatCyanLightIJTheme` +[Dark Flat](https://github.com/nerzhulart/DarkFlatTheme) | `com.formdev.flatlaf.intellijthemes.FlatDarkFlatIJTheme` +[Dark purple](https://github.com/OlyaB/DarkPurpleTheme) | `com.formdev.flatlaf.intellijthemes.FlatDarkPurpleIJTheme` +[Dracula](https://github.com/dracula/jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatDraculaIJTheme` +[Gradianto Dark Fuchsia](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoDarkFuchsiaIJTheme` +[Gradianto Deep Ocean](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoDeepOceanIJTheme` +[Gradianto Midnight Blue](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoMidnightBlueIJTheme` +[Gray](https://github.com/OlyaB/GreyTheme) | `com.formdev.flatlaf.intellijthemes.FlatGrayIJTheme` +[Gruvbox Dark Hard](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkHardIJTheme` +[Gruvbox Dark Medium](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkMediumIJTheme` +[Gruvbox Dark Soft](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkSoftIJTheme` +[Hiberbee Dark](https://github.com/Hiberbee/code-highlight-themes) | `com.formdev.flatlaf.intellijthemes.FlatHiberbeeDarkIJTheme` +[High contrast](https://github.com/OlyaB/HighContrastTheme) | `com.formdev.flatlaf.intellijthemes.FlatHighContrastIJTheme` +[Light Flat](https://github.com/nerzhulart/LightFlatTheme) | `com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme` +[Material Design Dark](https://github.com/xinkunZ/NotReallyMDTheme) | `com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme` +[Monocai](https://github.com/bmikaili/intellij-monocai-theme) | `com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme` +[Nord](https://github.com/arcticicestudio/nord-jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatNordIJTheme` +[One Dark](https://github.com/one-dark/jetbrains-one-dark-theme) | `com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme` +[Solarized Dark](https://github.com/4lex4/intellij-platform-solarized) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme` +[Solarized Light](https://github.com/4lex4/intellij-platform-solarized) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme` +[Spacegray](https://github.com/mturlo/intellij-spacegray) | `com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme` +[Vuesion](https://github.com/vuesion/intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme` + +Material Theme UI Lite: + +Name | Class +-----|------ +[Arc Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkIJTheme` +[Arc Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkContrastIJTheme` +[Atom One Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkIJTheme` +[Atom One Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkContrastIJTheme` +[Atom One Light](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightIJTheme` +[Atom One Light Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightContrastIJTheme` +[Dracula](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme` +[Dracula Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaContrastIJTheme` +[GitHub](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubIJTheme` +[GitHub Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubContrastIJTheme` +[Light Owl](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlIJTheme` +[Light Owl Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlContrastIJTheme` +[Material Darker](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerIJTheme` +[Material Darker Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerContrastIJTheme` +[Material Deep Ocean](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanIJTheme` +[Material Deep Ocean Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanContrastIJTheme` +[Material Lighter](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterIJTheme` +[Material Lighter Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterContrastIJTheme` +[Material Oceanic](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicIJTheme` +[Material Oceanic Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicContrastIJTheme` +[Material Palenight](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightIJTheme` +[Material Palenight Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightContrastIJTheme` +[Monokai Pro](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProIJTheme` +[Monokai Pro Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProContrastIJTheme` +[Night Owl](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlIJTheme` +[Night Owl Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlContrastIJTheme` +[Solarized Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkIJTheme` +[Solarized Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkContrastIJTheme` +[Solarized Light](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightIJTheme` +[Solarized Light Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightContrastIJTheme` diff --git a/flatlaf-intellij-themes/build.gradle.kts b/flatlaf-intellij-themes/build.gradle.kts new file mode 100644 index 00000000..66b77510 --- /dev/null +++ b/flatlaf-intellij-themes/build.gradle.kts @@ -0,0 +1,51 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + `java-library` + `flatlaf-module-info` + `flatlaf-publish` +} + +dependencies { + implementation( project( ":flatlaf-core" ) ) +} + +flatlafModuleInfo { + dependsOn( ":flatlaf-core:jar" ) +} + +java { + withSourcesJar() + withJavadocJar() +} + +tasks { + javadoc { + options { + this as StandardJavadocDocletOptions + use( true ) + tags = listOf( "uiDefault", "clientProperty" ) + } + isFailOnError = false + } +} + +flatlafPublish { + artifactId = "flatlaf-intellij-themes" + name = "FlatLaf IntelliJ Themes Pack" + description = "Flat Look and Feel IntelliJ Themes Pack" +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatAllIJThemes.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatAllIJThemes.java new file mode 100644 index 00000000..b6233f10 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatAllIJThemes.java @@ -0,0 +1,86 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import javax.swing.UIManager.LookAndFeelInfo; + +/** + * @author Karl Tauber + */ +public class FlatAllIJThemes +{ + public static final LookAndFeelInfo[] INFOS = { + new LookAndFeelInfo( "Arc", "com.formdev.flatlaf.intellijthemes.FlatArcIJTheme" ), + new LookAndFeelInfo( "Arc - Orange", "com.formdev.flatlaf.intellijthemes.FlatArcOrangeIJTheme" ), + new LookAndFeelInfo( "Arc Dark", "com.formdev.flatlaf.intellijthemes.FlatArcDarkIJTheme" ), + new LookAndFeelInfo( "Arc Dark - Orange", "com.formdev.flatlaf.intellijthemes.FlatArcDarkOrangeIJTheme" ), + new LookAndFeelInfo( "Carbon", "com.formdev.flatlaf.intellijthemes.FlatCarbonIJTheme" ), + new LookAndFeelInfo( "Cobalt 2", "com.formdev.flatlaf.intellijthemes.FlatCobalt2IJTheme" ), + new LookAndFeelInfo( "Cyan light", "com.formdev.flatlaf.intellijthemes.FlatCyanLightIJTheme" ), + new LookAndFeelInfo( "Dark Flat", "com.formdev.flatlaf.intellijthemes.FlatDarkFlatIJTheme" ), + new LookAndFeelInfo( "Dark purple", "com.formdev.flatlaf.intellijthemes.FlatDarkPurpleIJTheme" ), + new LookAndFeelInfo( "Dracula", "com.formdev.flatlaf.intellijthemes.FlatDraculaIJTheme" ), + new LookAndFeelInfo( "Gradianto Dark Fuchsia", "com.formdev.flatlaf.intellijthemes.FlatGradiantoDarkFuchsiaIJTheme" ), + new LookAndFeelInfo( "Gradianto Deep Ocean", "com.formdev.flatlaf.intellijthemes.FlatGradiantoDeepOceanIJTheme" ), + new LookAndFeelInfo( "Gradianto Midnight Blue", "com.formdev.flatlaf.intellijthemes.FlatGradiantoMidnightBlueIJTheme" ), + new LookAndFeelInfo( "Gray", "com.formdev.flatlaf.intellijthemes.FlatGrayIJTheme" ), + new LookAndFeelInfo( "Gruvbox Dark Hard", "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkHardIJTheme" ), + new LookAndFeelInfo( "Gruvbox Dark Medium", "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkMediumIJTheme" ), + new LookAndFeelInfo( "Gruvbox Dark Soft", "com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkSoftIJTheme" ), + new LookAndFeelInfo( "Hiberbee Dark", "com.formdev.flatlaf.intellijthemes.FlatHiberbeeDarkIJTheme" ), + new LookAndFeelInfo( "High contrast", "com.formdev.flatlaf.intellijthemes.FlatHighContrastIJTheme" ), + new LookAndFeelInfo( "Light Flat", "com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme" ), + new LookAndFeelInfo( "Material Design Dark", "com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme" ), + new LookAndFeelInfo( "Monocai", "com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme" ), + new LookAndFeelInfo( "Nord", "com.formdev.flatlaf.intellijthemes.FlatNordIJTheme" ), + new LookAndFeelInfo( "One Dark", "com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme" ), + new LookAndFeelInfo( "Solarized Dark", "com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme" ), + new LookAndFeelInfo( "Solarized Light", "com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme" ), + new LookAndFeelInfo( "Spacegray", "com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme" ), + new LookAndFeelInfo( "Vuesion", "com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme" ), + new LookAndFeelInfo( "Arc Dark", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkIJTheme" ), + new LookAndFeelInfo( "Arc Dark Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkContrastIJTheme" ), + new LookAndFeelInfo( "Atom One Dark", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkIJTheme" ), + new LookAndFeelInfo( "Atom One Dark Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkContrastIJTheme" ), + new LookAndFeelInfo( "Atom One Light", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightIJTheme" ), + new LookAndFeelInfo( "Atom One Light Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightContrastIJTheme" ), + new LookAndFeelInfo( "Dracula", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme" ), + new LookAndFeelInfo( "Dracula Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaContrastIJTheme" ), + new LookAndFeelInfo( "GitHub", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubIJTheme" ), + new LookAndFeelInfo( "GitHub Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubContrastIJTheme" ), + new LookAndFeelInfo( "Light Owl", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlIJTheme" ), + new LookAndFeelInfo( "Light Owl Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlContrastIJTheme" ), + new LookAndFeelInfo( "Material Darker", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerIJTheme" ), + new LookAndFeelInfo( "Material Darker Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerContrastIJTheme" ), + new LookAndFeelInfo( "Material Deep Ocean", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanIJTheme" ), + new LookAndFeelInfo( "Material Deep Ocean Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanContrastIJTheme" ), + new LookAndFeelInfo( "Material Lighter", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterIJTheme" ), + new LookAndFeelInfo( "Material Lighter Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterContrastIJTheme" ), + new LookAndFeelInfo( "Material Oceanic", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicIJTheme" ), + new LookAndFeelInfo( "Material Oceanic Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicContrastIJTheme" ), + new LookAndFeelInfo( "Material Palenight", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightIJTheme" ), + new LookAndFeelInfo( "Material Palenight Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightContrastIJTheme" ), + new LookAndFeelInfo( "Monokai Pro", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProIJTheme" ), + new LookAndFeelInfo( "Monokai Pro Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProContrastIJTheme" ), + new LookAndFeelInfo( "Night Owl", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlIJTheme" ), + new LookAndFeelInfo( "Night Owl Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlContrastIJTheme" ), + new LookAndFeelInfo( "Solarized Dark", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkIJTheme" ), + new LookAndFeelInfo( "Solarized Dark Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkContrastIJTheme" ), + new LookAndFeelInfo( "Solarized Light", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightIJTheme" ), + new LookAndFeelInfo( "Solarized Light Contrast", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightContrastIJTheme" ), + }; +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkIJTheme.java new file mode 100644 index 00000000..f14b6182 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcDarkIJTheme() { + super( Utils.loadTheme( "arc_theme_dark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkOrangeIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkOrangeIJTheme.java new file mode 100644 index 00000000..a7358261 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcDarkOrangeIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcDarkOrangeIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcDarkOrangeIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcDarkOrangeIJTheme() { + super( Utils.loadTheme( "arc_theme_dark_orange.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcIJTheme.java new file mode 100644 index 00000000..ec20f734 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcIJTheme() { + super( Utils.loadTheme( "arc-theme.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcOrangeIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcOrangeIJTheme.java new file mode 100644 index 00000000..3034c2c9 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatArcOrangeIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcOrangeIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcOrangeIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcOrangeIJTheme() { + super( Utils.loadTheme( "arc-theme-orange.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCarbonIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCarbonIJTheme.java new file mode 100644 index 00000000..1da93b87 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCarbonIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatCarbonIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatCarbonIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatCarbonIJTheme() { + super( Utils.loadTheme( "Carbon.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCobalt2IJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCobalt2IJTheme.java new file mode 100644 index 00000000..1c864c1e --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCobalt2IJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatCobalt2IJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatCobalt2IJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatCobalt2IJTheme() { + super( Utils.loadTheme( "Cobalt_2.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCyanLightIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCyanLightIJTheme.java new file mode 100644 index 00000000..01ffe52c --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatCyanLightIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatCyanLightIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatCyanLightIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatCyanLightIJTheme() { + super( Utils.loadTheme( "Cyan.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkFlatIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkFlatIJTheme.java new file mode 100644 index 00000000..3ea326b8 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkFlatIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatDarkFlatIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatDarkFlatIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatDarkFlatIJTheme() { + super( Utils.loadTheme( "DarkFlatTheme.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkPurpleIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkPurpleIJTheme.java new file mode 100644 index 00000000..c90069b9 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDarkPurpleIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatDarkPurpleIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatDarkPurpleIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatDarkPurpleIJTheme() { + super( Utils.loadTheme( "DarkPurple.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDraculaIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDraculaIJTheme.java new file mode 100644 index 00000000..e926cef3 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatDraculaIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatDraculaIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatDraculaIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatDraculaIJTheme() { + super( Utils.loadTheme( "Dracula.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDarkFuchsiaIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDarkFuchsiaIJTheme.java new file mode 100644 index 00000000..3a449113 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDarkFuchsiaIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGradiantoDarkFuchsiaIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGradiantoDarkFuchsiaIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGradiantoDarkFuchsiaIJTheme() { + super( Utils.loadTheme( "Gradianto_dark_fuchsia.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDeepOceanIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDeepOceanIJTheme.java new file mode 100644 index 00000000..083e8f01 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoDeepOceanIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGradiantoDeepOceanIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGradiantoDeepOceanIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGradiantoDeepOceanIJTheme() { + super( Utils.loadTheme( "Gradianto_deep_ocean.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoMidnightBlueIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoMidnightBlueIJTheme.java new file mode 100644 index 00000000..c6593b47 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGradiantoMidnightBlueIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGradiantoMidnightBlueIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGradiantoMidnightBlueIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGradiantoMidnightBlueIJTheme() { + super( Utils.loadTheme( "Gradianto_midnight_blue.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGrayIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGrayIJTheme.java new file mode 100644 index 00000000..492c40b1 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGrayIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGrayIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGrayIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGrayIJTheme() { + super( Utils.loadTheme( "Gray.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkHardIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkHardIJTheme.java new file mode 100644 index 00000000..09e0f8ca --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkHardIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGruvboxDarkHardIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGruvboxDarkHardIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGruvboxDarkHardIJTheme() { + super( Utils.loadTheme( "gruvbox_dark_hard.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkMediumIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkMediumIJTheme.java new file mode 100644 index 00000000..33567f62 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkMediumIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGruvboxDarkMediumIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGruvboxDarkMediumIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGruvboxDarkMediumIJTheme() { + super( Utils.loadTheme( "gruvbox_dark_medium.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkSoftIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkSoftIJTheme.java new file mode 100644 index 00000000..d966f36c --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatGruvboxDarkSoftIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGruvboxDarkSoftIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGruvboxDarkSoftIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGruvboxDarkSoftIJTheme() { + super( Utils.loadTheme( "gruvbox_dark_soft.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHiberbeeDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHiberbeeDarkIJTheme.java new file mode 100644 index 00000000..1ba747d8 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHiberbeeDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatHiberbeeDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatHiberbeeDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatHiberbeeDarkIJTheme() { + super( Utils.loadTheme( "HiberbeeDark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHighContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHighContrastIJTheme.java new file mode 100644 index 00000000..680a6f72 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatHighContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatHighContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatHighContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatHighContrastIJTheme() { + super( Utils.loadTheme( "HighContrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatLightFlatIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatLightFlatIJTheme.java new file mode 100644 index 00000000..3e3c003b --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatLightFlatIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatLightFlatIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatLightFlatIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatLightFlatIJTheme() { + super( Utils.loadTheme( "LightFlatTheme.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMaterialDesignDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMaterialDesignDarkIJTheme.java new file mode 100644 index 00000000..5779d7a8 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMaterialDesignDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialDesignDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialDesignDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialDesignDarkIJTheme() { + super( Utils.loadTheme( "MaterialTheme.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMonocaiIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMonocaiIJTheme.java new file mode 100644 index 00000000..39428885 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatMonocaiIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMonocaiIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMonocaiIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMonocaiIJTheme() { + super( Utils.loadTheme( "Monocai.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatNordIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatNordIJTheme.java new file mode 100644 index 00000000..d143062c --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatNordIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatNordIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatNordIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatNordIJTheme() { + super( Utils.loadTheme( "nord.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatOneDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatOneDarkIJTheme.java new file mode 100644 index 00000000..b116f3b6 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatOneDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatOneDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatOneDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatOneDarkIJTheme() { + super( Utils.loadTheme( "one_dark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedDarkIJTheme.java new file mode 100644 index 00000000..1b143bd4 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedDarkIJTheme() { + super( Utils.loadTheme( "SolarizedDark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedLightIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedLightIJTheme.java new file mode 100644 index 00000000..e1ecf544 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSolarizedLightIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedLightIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedLightIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedLightIJTheme() { + super( Utils.loadTheme( "SolarizedLight.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSpacegrayIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSpacegrayIJTheme.java new file mode 100644 index 00000000..d5754058 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatSpacegrayIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSpacegrayIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSpacegrayIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSpacegrayIJTheme() { + super( Utils.loadTheme( "Spacegray.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatVuesionIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatVuesionIJTheme.java new file mode 100644 index 00000000..1b2902a4 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/FlatVuesionIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatVuesionIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatVuesionIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatVuesionIJTheme() { + super( Utils.loadTheme( "vuesion_theme.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/Utils.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/Utils.java new file mode 100644 index 00000000..0392cd94 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/Utils.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +class Utils +{ + static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() ); + + static IntelliJTheme loadTheme( String name ) { + try { + return new IntelliJTheme( Utils.class.getResourceAsStream( + "/com/formdev/flatlaf/intellijthemes/themes/" + name ) ); + } catch( IOException ex ) { + String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'"; + LOG.log( Level.SEVERE, msg, ex ); + throw new RuntimeException( msg, ex ); + } + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkContrastIJTheme.java new file mode 100644 index 00000000..32f0b205 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcDarkContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcDarkContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcDarkContrastIJTheme() { + super( Utils.loadTheme( "Arc Dark Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkIJTheme.java new file mode 100644 index 00000000..13621ed4 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatArcDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatArcDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatArcDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatArcDarkIJTheme() { + super( Utils.loadTheme( "Arc Dark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkContrastIJTheme.java new file mode 100644 index 00000000..2004d5a3 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatAtomOneDarkContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatAtomOneDarkContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatAtomOneDarkContrastIJTheme() { + super( Utils.loadTheme( "Atom One Dark Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkIJTheme.java new file mode 100644 index 00000000..b2940f60 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatAtomOneDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatAtomOneDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatAtomOneDarkIJTheme() { + super( Utils.loadTheme( "Atom One Dark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightContrastIJTheme.java new file mode 100644 index 00000000..ba4b7341 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatAtomOneLightContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatAtomOneLightContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatAtomOneLightContrastIJTheme() { + super( Utils.loadTheme( "Atom One Light Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightIJTheme.java new file mode 100644 index 00000000..6d316c47 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatAtomOneLightIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatAtomOneLightIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatAtomOneLightIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatAtomOneLightIJTheme() { + super( Utils.loadTheme( "Atom One Light.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaContrastIJTheme.java new file mode 100644 index 00000000..64ece9fc --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatDraculaContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatDraculaContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatDraculaContrastIJTheme() { + super( Utils.loadTheme( "Dracula Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaIJTheme.java new file mode 100644 index 00000000..c1893e47 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatDraculaIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatDraculaIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatDraculaIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatDraculaIJTheme() { + super( Utils.loadTheme( "Dracula.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubContrastIJTheme.java new file mode 100644 index 00000000..c1b8aee7 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGitHubContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGitHubContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGitHubContrastIJTheme() { + super( Utils.loadTheme( "GitHub Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubIJTheme.java new file mode 100644 index 00000000..e55642eb --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatGitHubIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatGitHubIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatGitHubIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatGitHubIJTheme() { + super( Utils.loadTheme( "GitHub.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlContrastIJTheme.java new file mode 100644 index 00000000..839cab9f --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatLightOwlContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatLightOwlContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatLightOwlContrastIJTheme() { + super( Utils.loadTheme( "Light Owl Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlIJTheme.java new file mode 100644 index 00000000..6b242c84 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatLightOwlIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatLightOwlIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatLightOwlIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatLightOwlIJTheme() { + super( Utils.loadTheme( "Light Owl.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerContrastIJTheme.java new file mode 100644 index 00000000..6e0e9cc2 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialDarkerContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialDarkerContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialDarkerContrastIJTheme() { + super( Utils.loadTheme( "Material Darker Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerIJTheme.java new file mode 100644 index 00000000..4eb35c5e --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDarkerIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialDarkerIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialDarkerIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialDarkerIJTheme() { + super( Utils.loadTheme( "Material Darker.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanContrastIJTheme.java new file mode 100644 index 00000000..e4c2fddf --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialDeepOceanContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialDeepOceanContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialDeepOceanContrastIJTheme() { + super( Utils.loadTheme( "Material Deep Ocean Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanIJTheme.java new file mode 100644 index 00000000..153687e3 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialDeepOceanIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialDeepOceanIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialDeepOceanIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialDeepOceanIJTheme() { + super( Utils.loadTheme( "Material Deep Ocean.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterContrastIJTheme.java new file mode 100644 index 00000000..f04905fb --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialLighterContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialLighterContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialLighterContrastIJTheme() { + super( Utils.loadTheme( "Material Lighter Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterIJTheme.java new file mode 100644 index 00000000..d3f97d2c --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialLighterIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialLighterIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialLighterIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialLighterIJTheme() { + super( Utils.loadTheme( "Material Lighter.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicContrastIJTheme.java new file mode 100644 index 00000000..45c6c25a --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialOceanicContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialOceanicContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialOceanicContrastIJTheme() { + super( Utils.loadTheme( "Material Oceanic Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicIJTheme.java new file mode 100644 index 00000000..795db39b --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialOceanicIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialOceanicIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialOceanicIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialOceanicIJTheme() { + super( Utils.loadTheme( "Material Oceanic.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightContrastIJTheme.java new file mode 100644 index 00000000..acc6c716 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialPalenightContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialPalenightContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialPalenightContrastIJTheme() { + super( Utils.loadTheme( "Material Palenight Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightIJTheme.java new file mode 100644 index 00000000..fe14b7cd --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMaterialPalenightIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMaterialPalenightIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMaterialPalenightIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMaterialPalenightIJTheme() { + super( Utils.loadTheme( "Material Palenight.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProContrastIJTheme.java new file mode 100644 index 00000000..2e933ff1 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMonokaiProContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMonokaiProContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMonokaiProContrastIJTheme() { + super( Utils.loadTheme( "Monokai Pro Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProIJTheme.java new file mode 100644 index 00000000..b734d7c1 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatMonokaiProIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatMonokaiProIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatMonokaiProIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatMonokaiProIJTheme() { + super( Utils.loadTheme( "Monokai Pro.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlContrastIJTheme.java new file mode 100644 index 00000000..9363dc94 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatNightOwlContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatNightOwlContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatNightOwlContrastIJTheme() { + super( Utils.loadTheme( "Night Owl Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlIJTheme.java new file mode 100644 index 00000000..52774138 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatNightOwlIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatNightOwlIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatNightOwlIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatNightOwlIJTheme() { + super( Utils.loadTheme( "Night Owl.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkContrastIJTheme.java new file mode 100644 index 00000000..ffc8105a --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedDarkContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedDarkContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedDarkContrastIJTheme() { + super( Utils.loadTheme( "Solarized Dark Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkIJTheme.java new file mode 100644 index 00000000..fc264a0f --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedDarkIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedDarkIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedDarkIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedDarkIJTheme() { + super( Utils.loadTheme( "Solarized Dark.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightContrastIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightContrastIJTheme.java new file mode 100644 index 00000000..22af87c0 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightContrastIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedLightContrastIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedLightContrastIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedLightContrastIJTheme() { + super( Utils.loadTheme( "Solarized Light Contrast.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightIJTheme.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightIJTheme.java new file mode 100644 index 00000000..551d50e9 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/FlatSolarizedLightIJTheme.java @@ -0,0 +1,38 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +public class FlatSolarizedLightIJTheme + extends IntelliJTheme.ThemeLaf +{ + public static boolean install( ) { + try { + return install( new FlatSolarizedLightIJTheme() ); + } catch( RuntimeException ex ) { + return false; + } + } + + public FlatSolarizedLightIJTheme() { + super( Utils.loadTheme( "Solarized Light.theme.json" ) ); + } +} diff --git a/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/Utils.java b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/Utils.java new file mode 100644 index 00000000..f5523cca --- /dev/null +++ b/flatlaf-intellij-themes/src/main/java/com/formdev/flatlaf/intellijthemes/materialthemeuilite/Utils.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.intellijthemes.materialthemeuilite; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.IntelliJTheme; + +/** + * @author Karl Tauber + */ +class Utils +{ + static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() ); + + static IntelliJTheme loadTheme( String name ) { + try { + return new IntelliJTheme( Utils.class.getResourceAsStream( + "/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) ); + } catch( IOException ex ) { + String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'"; + LOG.log( Level.SEVERE, msg, ex ); + throw new RuntimeException( msg, ex ); + } + } +} diff --git a/flatlaf-intellij-themes/src/main/module-info/module-info.java b/flatlaf-intellij-themes/src/main/module-info/module-info.java new file mode 100644 index 00000000..c6c87c20 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/module-info/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Karl Tauber + */ +module com.formdev.flatlaf.intellijthemes { + requires java.desktop; + requires java.logging; + requires com.formdev.flatlaf; + + exports com.formdev.flatlaf.intellijthemes; + exports com.formdev.flatlaf.intellijthemes.materialthemeuilite; +} diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.LICENSE.txt new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.theme.json new file mode 100644 index 00000000..09947b80 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Carbon.theme.json @@ -0,0 +1,353 @@ +{ + "name": "Carbon", + "dark": true, + "author": "Luis Fernando Jimenez", + "editorScheme": "/themes/Carbon.xml", + "ui": { + "*": { + "foreground": "#bac8cb", + "background": "#172030", + "borderColor": "#213047", + "disabledBorderColor": "#586e75", + "selectionBackground": "#0A677A", + "selectionForeground": "#fdf6e3", + "selectionInactiveBackground": "#1E2A3E", + "selectionBackgroundInactive": "#1E2A3E", + "lightSelectionBackground": "#074855", + "lightSelectionForeground": "#839496", + "lightSelectionInactiveBackground": "#073642", + "lightSelectionInactiveForeground": "#839496", + "separatorColor": "#213047", + "lineSeparatorColor": "#213047", + "disabledBackground": "#1E2A3E", + "inactiveBackground": "#1E2A3E", + "disabledForeground": "#657778", + "disabledText": "#657778", + "inactiveForeground": "#657778", + "acceleratorForeground": "#abb9bc", + "acceleratorSelectionForeground": "#abb9bc" + }, + + "ActionButton": { + "hoverBackground": "26354f", + "hoverBorderColor": "#074855", + "pressedBackground": "#074855", + "pressedBorderColor": "#074855" + }, + + "Borders": { + "color": "#213047", + "ContrastBorderColor": "#213047" + }, + + "Button": { + "startBackground": "#074855", + "endBackground": "#074855", + "startBorderColor": "#93a1a1", + "endBorderColor": "#93a1a1", + "default": { + "foreground": "#fdf6e3", + "startBackground": "#0A677A", + "endBackground": "#0A677A", + "startBorderColor": "#0A677Ac3", + "endBorderColor": "#0A677Ac3", + "focusedBorderColor": "#839496", + "focusColor": "#778282" + } + }, + + "ComboBox": { + "nonEditableBackground": "#1e2a3e", + "background": "#1e2a3e", + "ArrowButton": { + "iconColor": "#a3aaa9", + "disabledIconColor": "#839496", + "nonEditableBackground": "#1e2a3e" + } + }, + + "ComboPopup.border": "1,1,1,1,213047", + + "CompletionPopup": { + "matchForeground": "#02858E" + }, + + "Component": { + "errorFocusColor": "#bf616a", + "focusColor": "#0c9294", + "focusedBorderColor": "#0c9294", + "focusWidth": 2, + "inactiveErrorFocusColor": "#bf616a", + "inactiveWarningFocusColor": "#8f9544", + "infoForeground": "#bac8cb", + "warningFocusColor": "#8f9544" + }, + + "Counter": { + "background": "#0A677A", + "foreground": "#bac8cb" + }, + + "DefaultTabs": { + "underlineColor": "#2aa198", + "hoverBackground": "#1E2A3E", + "inactiveUnderlineColor": "#446a73" + }, + + "DragAndDrop": { + "areaForeground": "#bac8cb", + "areaBackground": "#1E2A3E", + "areaBorderColor": "#213047" + }, + + "Editor": { + "background": "#172030", + "foreground": "#bac8cb", + "shortcutForeground": "#2aa198" + }, + + "EditorPane.inactiveBackground": "#1E2A3E", + + "EditorTabs": { + "underlineColor": "#2aa198", + "borderColor": "#213047", + "underlinedTabBackground": "#1E2A3E", + "hoverMaskColor": "#1E2A3E" + }, + + "FileColor": { + "Yellow": "#1b2f41", + "Rose": "#bf616a", + "Green": "#112634" + }, + + "Group.disabledSeparatorColor": "#213047", + + "InplaceRefactoringPopup.borderColor": "#213047", + + "Link": { + "activeForeground": "#0a7285", + "hoverForeground": "#0a7285", + "pressedForeground": "#0a7285", + "visitedForeground": "#0a7285", + "secondaryForeground": "#75BAB5" + }, + + "Label.errorForeground": "#af304a", + + "NavBar.borderColor": "#213047", + + "Notification": { + "background": "#1E2A3E", + "borderColor": "#586E75", + "errorForeground": "#bac8cb", + "errorBackground": "#4d232e", + "errorBorderColor": "#802e44", + "MoreButton": { + "background": "#1E2A3E", + "foreground": "#bac8cb", + "innerBorderColor": "#213047" + }, + "ToolWindow": { + "informativeForeground": "#bac8cb", + "informativeBackground": "#074855", + "informativeBorderColor": "#213047", + "warningForeground": "#bac8cb", + "warningBackground": "#8d8d55", + "warningBorderColor": "#213047", + "errorForeground": "#bac8cb", + "errorBackground": "#802d43", + "errorBorderColor": "#4d1c2b" + } + }, + + "ParameterInfo": { + "background": "#1E2A3E", + "foreground": "#bac8cb", + "infoForeground": "ababb3", + "currentOverloadBackground": "#1E2A3E", + "currentParameterForeground": "#02858e" + }, + + "Plugins": { + "Tab": { + "selectedForeground": "#bac8cb", + "selectedBackground": "#074855", + "hoverBackground": "#1E2A3E" + }, + "eapTagBackground": "#02858e", + "SectionHeader.background": "#1E2A3E", + "tagBackground": "#1E2A3E", + "tagForeground": "#bac8cb", + "Button": { + "installForeground": "#bac8cb", + "installBorderColor": "#02858e", + "installFillForeground": "#bac8cb", + "installFillBackground": "#172030", + "updateForeground": "#bac8cb", + "updateBackground": "#02858e", + "updateBorderColor": "#213047" + }, + "lightSelectionBackground": "#1E2A3E" + }, + + "Popup": { + "paintBorder": true, + "borderColor": "#213047", + "inactiveBorderColor": "#213047", + "Toolbar.borderColor": "#213047", + "Header.activeBackground": "#172030", + "Header.inactiveBackground": "#172030", + "separatorForeground": "#213047", + "Advertiser": { + "foreground": "#bac8cb", + "borderColor": "#213047", + "borderInsets": "4,8,3,0" + } + }, + + "PopupMenu": { + "borderWidth": 1, + "borderInsets": "1,1,1,1" + }, + + "ProgressBar": { + "trackColor": "#1E2A3E", + "progressColor": "#029098", + "indeterminateStartColor": "#02858e", + "indeterminateEndColor": "#2cb0a7", + "failedColor": "#ff4262", + "failedEndColor": "#a12a3e", + "passedColor": "#2cb0a7", + "passedEndColor": "#026d76" + }, + + "SearchEverywhere": { + "Header.background": "#1E2A3E", + "Tab": { + "selectedForeground": "#bac8cb", + "selectedBackground": "#074855" + }, + "SearchField": { + "background": "#172030", + "borderColor": "#213047" + }, + "Advertiser.foreground": "#bac8cb" + }, + + "SearchMatch": { + "startBackground": "#e1e797", + "endBackground": "#e1e797" + }, + + "SpeedSearch": { + "foreground": "#bac8cb", + "borderColor": "#213047", + "background": "#1E2A3E", + "errorForeground": "#e0555e" + }, + + "SplitPane.background": "#172030", + + "StatusBar.borderColor": "#213047", + + "Table": { + "foreground": "#bac8cb", + "background": "#172030", + "stripeColor": "#1E2A3E", + "selectionForeground": "#fdf6e3", + "selectionBackground": "#074855", + "focusCellForeground": "#fdf6e3", + "dropLineColor": "#213047", + "gridColor": "#213047", + "lightSelectionInactiveForeground": "#bac8cb", + "lightSelectionForeground": "#bac8cb", + "selectionInactiveForeground": "#bac8cb", + "lightSelectionBackground": "#074855", + "lightSelectionInactiveBackground": "#063944" + }, + + "TabbedPane": { + "hoverColor": "#1E2A3E", + "underlineColor": "#0A677A", + "disabledUnderlineColor": "#5e5b6b", + "contentAreaColor": "#213047" + }, + + "ToggleButton": { + "onBackground": "#0A677A", + "borderColor": "#213047" + }, + + "ToolTip": { + "background": "#172030", + "Actions.background": "#1E2A3E" + }, + + "ToolWindow": { + "Header": { + "background": "#1E2A3E", + "inactiveBackground": "#1E2A3E" + }, + "HeaderTab": { + "selectedBackground": "#1E2A3E", + "hoverBackground": "#1E2A3E", + "selectedInactiveBackground": "#1E2A3E", + "hoverInactiveBackground": "#1E2A3E" + }, + "Button": { + "selectedBackground": "#1E2A3E", + "hoverBackground": "#1E2A3E" + } + }, + + "Tree.rowHeight": 22, + + "VersionControl": { + "GitLog.localBranchIconColor": "#02858e", + "GitLog.remoteBranchIconColor": "#214760", + "Log.Commit.currentBranchBackground": "#1e2a3e", + "FileHistory.Commit.selectedBranchBackground": "#3f5d6e" + }, + + "Viewport.background": "#172030", + + "WelcomeScreen.background": "#172030", + + "WelcomeScreen": { + "Projects.selectionInactiveBackground": "#172030", + "separatorColor": "#172030" + } + }, + + "icons": { + "ColorPalette": { + "Actions.Red": "#ff4262", + "Actions.Green": "#52b455", + "Actions.Grey": "#bac8cb", + "Actions.Yellow": "#e1e797", + "Actions.Blue": "#44a6d2", + "Actions.GreyInline.Dark": "#9f99bfb3", + "Objects.Grey": "#808C97", + "Objects.RedStatus": "#af304a", + "Objects.Red": "#c6455a", + "Objects.Pink": "#f98b9e", + "Objects.Yellow": "#e1e797", + "Objects.Green": "#27b26f", + "Objects.Blue": "#2F7A99", + "Objects.Purple": "#B692CE", + "Objects.BlackText": "#0b1015", + "Objects.YellowDark": "#acaf44", + "Objects.GreenAndroid": "#78c257", + "Checkbox.Background.Default.Dark": "#1E2A3E", + "Checkbox.Border.Default.Dark": "#586e75", + "Checkbox.Foreground.Selected.Dark": "#bac8cb", + "Checkbox.Focus.Wide.Dark": "#93a1a1", + "Checkbox.Focus.Thin.Default.Dark": "#839496", + "Checkbox.Focus.Thin.Selected.Dark": "#839496", + "Checkbox.Background.Disabled.Dark": "#1a2334", + "Checkbox.Border.Disabled.Dark": "#657778", + "Checkbox.Foreground.Disabled.Dark": "#657778" + } + } +} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.LICENSE.txt similarity index 96% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.LICENSE.txt index 68011d97..7dbea182 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/solarized_dark_theme.LICENSE.txt +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.LICENSE.txt @@ -1,4 +1,4 @@ -Copyright 2019 Tyler B. Thrailkill +Copyright 2020 Nicolas Gehlert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.theme.json new file mode 100644 index 00000000..9ff6b745 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cobalt_2.theme.json @@ -0,0 +1,181 @@ +{ + "name": "Cobalt 2", + "author": "Nicolas Gehlert ", + "dark": true, + "editorScheme": "/Cobalt_2.xml", + "colors": { + "basicBackground": "#002946", + "secondaryBackground": "#001b36", + "borderColor": "#545454", + "hue1": "#003854", + "hue2": "#003f5e", + "hue3": "#267DA2", + "contrast": "#ff9d00", + "contrastHue1": "#9a5000", + "textColor": "#FFF0C7" + }, + "ui": { + "*": { + "background": "basicBackground", + "foreground": "textColor", + "selectionBackground": "hue2" + }, + "ActionButton": { + "pressedBackground": "hue3", + "pressedBorderColor": "hue3", + "hoverBackground": "hue2", + "hoverBorderColor": "hue2" + }, + "CompletionPopup": { + "selectionBackground": "basicBackground" + }, + "Borders": { + "ContrastBorderColor": "borderColor", + "color": "borderColor" + }, + "Button": { + "background": "secondaryBackground", + "startBackground": "hue3", + "endBackground": "hue2", + "startBorderColor": "hue3", + "endBorderColor": "hue2", + "default": { + "startBackground": "contrast", + "endBackground": "contrastHue1", + "startBorderColor": "contrast", + "endBorderColor": "contrastHue1" + } + }, + "CheckBox": { + "background": "secondaryBackground" + }, + "CheckBoxMenuItem": { + "background": "secondaryBackground" + }, + "ColorChooser": { + "background": "secondaryBackground" + }, + "ComboBox": { + "ArrowButton": { + "background": "basicBackground", + "nonEditableBackground": "basicBackground" + }, + "background": "secondaryBackground", + "foreground": "textColor", + "nonEditableBackground": "secondaryBackground" + }, + "DefaultTabs": { + "background": "secondaryBackground", + "borderColor": "borderColor", + "hoverBackground": "hue1" + }, + "EditorTabs": { + "background": "secondaryBackground", + "borderColor": "borderColor", + "underlinedTabBackground": "hue1" + }, + "Link": { + "activeForeground": "contrast", + "hoverForeground": "contrast", + "visitedForeground": "contrast" + }, + "Label": { + "background": "secondaryBackground" + }, + "List": { + "background": "secondaryBackground" + }, + "Menu": { + "background": "secondaryBackground", + "foreground": "textColor" + }, + "MenuBar": { + "disabledBackground": "secondaryBackground" + }, + "OptionPane": { + "background": "secondaryBackground" + }, + "Panel": { + "background": "secondaryBackground", + "foreground": "textColor" + }, + "PasswordField": { + "background": "secondaryBackground", + "selectionBackground": "secondaryBackground" + }, + "Popup": { + "Toolbar.background": "basicBackground" + }, + "PopupMenu": { + "background": "secondaryBackground" + }, + "ProgressBar": { + "background": "secondaryBackground" + }, + "Plugins": { + "lightSelectionBackground": "hue2" + }, + "RadioButton": { + "background": "secondaryBackground" + }, + "RadioButtonMenuItem": { + "background": "secondaryBackground" + }, + "ScrollBar": { + "background": "hue1" + }, + "ScrollPane": { + "background": "secondaryBackground" + }, + "Slider": { + "background": "secondaryBackground" + }, + "Spinner": { + "background": "secondaryBackground" + }, + "SplitPane": { + "background": "secondaryBackground" + }, + "TabbedPane": { + "background": "secondaryBackground", + "contentAreaColor": "borderColor" + }, + "TextField": { + "background": "secondaryBackground" + }, + "TextPane": { + "background": "secondaryBackground" + }, + "ToggleButton": { + "background": "secondaryBackground" + }, + "ToolBar": { + "background": "secondaryBackground" + }, + "ToolTip": { + "background": "hue2" + }, + "ToolWindow": { + "Header.background": "basicBackground", + "Header.borderColor": "borderColor", + "Header.inactiveBackground": "secondaryBackground" + }, + "Tree": { + "background": "basicBackground", + "modifiedItemForeground": "contrast" + }, + "Viewport": { + "background": "secondaryBackground" + } + }, + "icons": { + "ColorPalette": { + "Checkbox.Background.Default.Dark": "#002946", + "Checkbox.Background.Default": "#002946", + "Checkbox.Background.Selected.Dark": "#FF9D00", + "Checkbox.Background.Selected": "#FF9D00", + "Checkbox.Foreground.Selected.Dark": "#002240", + "Checkbox.Foreground.Selected": "#002240" + } + } +} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Cyan.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cyan.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Cyan.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cyan.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Cyan.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cyan.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Cyan.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Cyan.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkFlatTheme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkFlatTheme.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkFlatTheme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkFlatTheme.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkFlatTheme.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkFlatTheme.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkFlatTheme.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkFlatTheme.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkPurple.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkPurple.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkPurple.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkPurple.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkPurple.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkPurple.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/DarkPurple.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/DarkPurple.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Dracula.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Dracula.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Dracula.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Dracula.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Dracula.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Dracula.theme.json similarity index 96% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Dracula.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Dracula.theme.json index d48f1c58..f963edfd 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Dracula.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Dracula.theme.json @@ -10,8 +10,7 @@ "selectionBackground": "#6272a4", "selectionInactiveBackground": "#4E5A82", "inactiveBackground": "#414450", - "borderColor": "#282a36", - "underlineColor": "#bd93f9" + "borderColor": "#282a36" }, "Borders": { "color": "#282a36", @@ -82,7 +81,7 @@ "background": "#44475a", "underlinedTabBackground": "#313341", "underlineColor": "#bd93f9", - "underlineHeight": 2 + "underlineHeight": 1 }, "FileColor": { "Blue": "#8be9fd", @@ -160,6 +159,13 @@ "inactiveBackground": "#44475a" } }, + "ScrollBar": { + "Mac": { + "Transparent": { + "hoverThumbColor": "#bd93f9" + } + } + }, "SearchEverywhere": { "SearchField": { "background": "#44475a" @@ -175,7 +181,7 @@ }, "Separator.separatorColor": "#282a35", "TabbedPane": { - "tabSelectionHeight": 2, + "tabSelectionHeight": 1, "focusColor": "#282a35", "hoverColor": "#282a35", "underlineColor": "#bd93f9", @@ -198,7 +204,7 @@ }, "HeaderTab": { "underlineColor": "#bd93f9", - "underlineHeight": 2, + "underlineHeight": 1, "underlinedTabBackground": "#313341", "underlinedTabInactiveBackground": "#313341" } diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto.LICENSE.txt diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_dark_fuchsia.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_dark_fuchsia.theme.json new file mode 100644 index 00000000..f1c0dd4a --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_dark_fuchsia.theme.json @@ -0,0 +1,273 @@ +{ + "name": "Gradianto Dark Fuchsia", + "dark": true, + "author": "thvardhan", + "editorScheme": "/Gradianto_dark_fuchsia.xml", + "ui": { + "*": { + "background": "#3d214e", + "foreground": "#c8ccd0", + + "infoForeground": "#6aaf41", + + "selectionBackground": "#562c6a", + "selectionForeground": "#c9c9c9", + "selectionInactiveBackground": "#3f2042", + + + "disabledForeground": "#646464", + "disabledBackground": "#35233e", + "inactiveBackground": "#2c1e31", + + "errorForeground": "#cd860b", + + "disabledText": "#646464", + "Borders.ContrastBorderColor" : "#292636", + "borderColor": "#311f39", + "disabledBorderColor": "#271d2b", + "focusColor" : "#5a2e6f", + "focusedBorderColor": "#5a356d", + + "separatorColor": "#4b2665" + }, + + "VersionControl" :{ + "Log.Commit.currentBranchBackground": "#442661", + "Log.Commit.unmatchedForeground": "#8f7fa8" + }, + "ActionButton": { + "hoverBackground": "#512663", + "pressedBackground": "#402a4b", + "hoverBorderColor": "#382447", + "pressedBorderColor": "#382140" + }, + + "Borders": { + "color": "#2f1f39", + "ContrastBorderColor": "#241728" + }, + + + "Button": { + "startBackground": "#643578", + "endBackground": "#643578", + "startBorderColor": "#2f1f39", + "endBorderColor": "#2f1f39", + "shadowColor" : "#39294c", + "focusedBorderColor" : "#352040", + "default.focusColor": "#2c1d32", + "disabledBorderColor" : "#25192f", + "default": { + "startBackground": "#643578", + "endBackground": "#643578", + "startBorderColor": "#2f1f39", + "endBorderColor": "#2f1f39", + "focusedBorderColor": "#352040", + "focusColor": "#352040" + } + + }, + + "RadioButton": { + "foreground": "#c8ccd0" + }, + + "CompletionPopup": { + "matchForeground": "#652683", + "matchSelectionForeground": "#9057f2" + }, + + "MenuBar.borderColor": "#392540", + "Menu.borderColor": "#2e2134", + + "NavBar.borderColor": "#35243d", + + + "Notification": { + + "errorForeground": "#abb2bf", + "errorBackground": "#280e29", + "errorBorderColor": "#692746", + + "ToolWindow": { + "informativeForeground": "#abb2bf", + "informativeBackground": "#4b1d62", + "informativeBorderColor": "#3f2d55", + + "warningForeground": "#abb2bf", + "warningBackground": "#735822", + "warningBorderColor": "#5f4422", + + "errorForeground": "#abb2bf", + "errorBackground": "#802d43", + "errorBorderColor": "#552029" + } + }, + + "ComboBox": { + "background" : "#52356c", + "nonEditableBackground": "#55356c", + "ArrowButton": { + "iconColor": "#e3e2f1", + "disabledIconColor": "#86828b", + "nonEditableBackground": "#674082" + } + }, + + "Editor": { + "shortcutForeground": "#477924" + }, + + "EditorTabs": { + "selectedForeground": "#eceff1", + "selectedBackground": "#8a599e", + "underlinedTabBackground": "#5c306f", + "background": "#3e1c4c", + "underlineColor": "#693d6c", + "hoverMaskColor": "#71468f", + "inactiveMaskColor": "#34244aff" + }, + + "Link": { + "activeForeground": "#b6b1bfff", + "hoverForeground": "#483f58ff", + "pressedForeground": "#483f58ff", + "visitedForeground": "#bcb2c4ff" + }, + + "FileColor": { + "Yellow": "#d19a6614", + "Green": "#98c37915", + "Blue": "#61afef15", + "Violet": "#542a4f", + "Orange": "#d13c0015", + "Rose": "#ae002f20" + }, + + "Tree.background": "#342040", + + "SearchEverywhere": { + + + "Tab": { + "selectedForeground": "#c9c9c9", + "selectedBackground": "#623474" + } + }, + + "SearchMatch": { + "startBackground": "#d379f2", + "endBackground": "#d379f2" + }, + + "WelcomeScreen": { + "Projects.selectionInactiveBackground": "#372342", + "separatorColor": "#4c3655" + }, + + "ValidationTooltip": { + "errorBackground": "#802d43", + "errorBorderColor": "#802d43", + "warningBackground": "#735822", + "warningBorderColor": "#5f4422" + }, + + "Table": { + "stripeColor": "#36243d", + "selectionForeground": "#c9c9c9", + "dropLineColor": "#51325c", + "focusCellForeground": "#abb2bf", + "gridColor": "#392642" + }, + + "ProgressBar": { + "trackColor": "#412647", + "progressColor": "#88538e", + "indeterminateStartColor": "#895290", + "indeterminateEndColor": "#533868", + "failedColor": "#ad3864", + "failedEndColor": "#47221d", + "passedColor": "#609e81", + "passedEndColor": "#406d5b" + }, + + "PopupMenu.translucentBackground": "#5d3b6c", + + "Popup": { + "paintBorder": true, + "Header.activeBackground": "#563b63", + "Header.inactiveBackground": "#6c497f", + "separatorColor" : "#472e53", + "separatorForeground": "#c2aec7", + "Advertiser": { + "background": "#755a82", + "borderColor": "#2c2132", + "borderInsets": "3,8,5,0" + } + }, + "ToggleButton": { + "onForeground": "#493353", + "onBackground": "#9ca9af", + "offForeground": "#646464", + "offBackground": "#332138", + "buttonColor": "#3b2d42", + "borderColor": "#352740" + }, + "ToolTip": { + "background": "#4d3a5c", + "Actions.background": "#5e395c" + }, + + "ToolWindow": { + "Header": { + "background": "#4b335c", + "inactiveBackground": "#452d4b" + }, + + "HeaderTab": { + "selectedBackground": "#a778bfff", + "selectedInactiveBackground": "#8e6ea3ff", + "hoverBackground": "#815d93ff", + "hoverInactiveBackground": "#7f6392ff" + }, + + "Button": { + "hoverBackground": "#7a5a89", + "selectedBackground": "#624a6d", + "selectedForeground": "#acb7bb" + } + }, + "DragAndDrop": { + "areaForeground": "#FFFFFF", + "areaBackground": "#745382", + "areaBorderColor": "#392d42" + }, + "Plugins": { + "SectionHeader.background": "#7b638b", + "tagBackground": "#7d6089", + "lightSelectionBackground": "#4e3a57", + "Tab.selectedBackground": "#a778bfff", + "Tab.hoverBackground": "#82519cff" + }, + "EditorPane.inactiveBackground": "#5d4966" + }, + "icons": { + "ColorPalette": { + "Checkbox.Background.Default.Dark": "#442557", + "Checkbox.Border.Default.Dark": "#532d68", + "Checkbox.Foreground.Selected.Dark": "#6aae41", + + "Objects.Grey": "#a098a0", + "Objects.Blue": "#55a9c2", + "Objects.RedStatus": "#a74d4dff", + "Objects.Red": "#774199ff", + "Objects.Pink": "#d16979ff", + "Objects.Yellow": "#be9418ff", + "Objects.Green": "#009c0eff", + "Objects.Purple": "#6b48a6ff", + "Objects.BlackText": "#131313ff", + "Objects.YellowDark": "#8a6c1aff", + "Objects.GreenAndroid": "#008b14ff" + } + } +} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_deep_ocean.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_deep_ocean.theme.json similarity index 95% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_deep_ocean.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_deep_ocean.theme.json index ae71adc3..6c32b6f5 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_deep_ocean.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_deep_ocean.theme.json @@ -1,7 +1,7 @@ { "name": "Gradianto Deep Ocean", "dark": true, - "author": "", + "author": "thvardhan", "editorScheme": "/Gradianto_deep_ocean.xml", "ui": { "*": { @@ -31,7 +31,10 @@ "separatorColor": "#1d304b" }, "Tree.background": "#24334a", - + "VersionControl" :{ + "Log.Commit.currentBranchBackground": "#263d61", + "Log.Commit.unmatchedForeground": "#7f8aa8" + }, "ActionButton": { "hoverBackground": "#324565", "pressedBackground": "#284267", @@ -112,12 +115,12 @@ "visitedForeground": "#ede891" }, "FileColor": { - "Yellow": "#d1b14225", - "Green": "#98c37925", + "Yellow": "#b6a76f25", + "Green": "#7c9e6425", "Blue": "#61afef25", "Violet": "#542a4f25", - "Orange": "#d13c0025", - "Rose": "#ae002f25" + "Orange": "#ad694f25", + "Rose": "#932d4825" }, "SearchEverywhere": { "Tab": { @@ -214,7 +217,7 @@ "tagBackground": "#3d445a", "lightSelectionBackground": "#3c4b7e" }, - "EditorPane.inactiveBackground": "#040c25" + "EditorPane.inactiveBackground": "#25334aff" }, "icons": { "ColorPalette": { diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_midnight_blue.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_midnight_blue.theme.json similarity index 96% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_midnight_blue.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_midnight_blue.theme.json index ec6ecb49..8b26244f 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gradianto_midnight_blue.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gradianto_midnight_blue.theme.json @@ -1,7 +1,7 @@ { "name": "Gradianto Midnight Blue", "dark": true, - "author": "", + "author": "thvardhan", "editorScheme": "/Gradianto_midnight_blue.xml", "ui": { "*": { @@ -30,7 +30,10 @@ "separatorColor": "#383850" }, - + "VersionControl" :{ + "Log.Commit.currentBranchBackground": "#3e2e61", + "Log.Commit.unmatchedForeground": "#7f80a8" + }, "Tree.background": "#2c2c3e", "ActionButton": { @@ -217,7 +220,7 @@ "tagBackground": "#40405a", "lightSelectionBackground": "#48387e" }, - "EditorPane.inactiveBackground": "#1a0225" + "EditorPane.inactiveBackground": "#414157ff" }, "icons": { "ColorPalette": { diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gray.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gray.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gray.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gray.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gray.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gray.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Gray.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Gray.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Hiberbee.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Hiberbee.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Hiberbee.LICENSE.txt diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HiberbeeDark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HiberbeeDark.theme.json new file mode 100644 index 00000000..3c501bcb --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HiberbeeDark.theme.json @@ -0,0 +1,313 @@ +{ + "name": "Hiberbee Dark", + "author": "Vlad Volkov", + "dark": true, + "editorScheme": "/colors/Dark.xml", + "colors": { + "black": "#000000", + "consoleBackground": "#191919", + "editorBackground": "#212121", + "panelBackground": "#333333", + "textColor": "#F9F6EF", + "border": "#3c3c3c", + "redMac": "#fb3b45", + "redWin": "#ef6950", + "redMonokaiPro": "#ff6188", + "blueWinPalette": "#409AE1", + "blue": "#78dce8", + "orangeMonokaiPro": "#fc9867", + "greenMonokaiPro": "#a9dc76", + "yellowWinPalette": "#ffc83d", + "yellowMac": "#faaa1f", + "purpleWinPalette": "#b4a0ff", + "purpleMonokaiPro": "#ab9df2", + "greenWinPalette": "#40c5af", + "greyWinPalette": "#b2b2b2", + "panelText": "#a6a6a6", + "desaturatedBlue": "#1e282d", + "desaturatedOrange": "#8049117f", + "green": "#5B8021", + "greyDot15": "#d8d8d8", + "greyDot20": "#cccccc", + "greyDot25": "#bfbfbf", + "greyDot33": "#aaaaaa", + "greyDot50": "#7d7d7d", + "greyDot60": "#666666", + "greyDot65": "#5a5a5a", + "greyDot70": "#4d4d4d", + "greyDot75": "#434343", + "greyDot80": "#323232", + "greyDot85": "#252525", + "greyDot90": "#1f2021", + "lightBlue": "#70D7FF", + "navyDot85": "#191d21", + "navyDot90": "#1f2021", + "red": "#800040", + "transparentGreen": "#5B80217f", + "transparentRed": "#8000407f", + "transparentViolet": "#9478F67f", + "transparentYellow": "#8066357f", + "yellow": "#806635" + }, + "icons": { + "ColorPalette": { + "Actions.Blue": "#57D1EB", + "Actions.Green": "#92D923", + "Actions.Grey": "#afafaf", + "Actions.GreyInline": "#7f7f7f", + "Actions.GreyInline.Dark": "#646464", + "Actions.Red": "#ff6188", + "Actions.Yellow": "#FFC83C", + "Objects.BlackText": "#7d7d7d", + "Objects.Blue": "#57D1EB", + "Objects.Green": "#92D923", + "Objects.GreenAndroid": "#92D923", + "Objects.Grey": "#7f7f7f", + "Objects.Pink": "#ffa9ca", + "Objects.Purple": "#9380FF", + "Objects.Red": "#ed005c", + "Objects.RedStatus": "#EC5F5D", + "Objects.Yellow": "#FFC83C", + "Objects.YellowDark": "#FD971F" + } + }, + "ui": { + "*": { + "arc": "3", + "shadow": "greyDot75", + "background": "greyDot80", + "borderColor": "greyDot70", + "caretForeground": "yellowMac", + "color": "greyDot50", + "foreground": "greyDot20", + "hoverBackground": "greyDot70", + "selectedBackground": "greyDot85", + "selectedForeground": "greyDot15", + "selectedInactiveBackground": "greyDot70", + "selectionBackground": "navyDot85", + "selectionForeground": "yellowMac", + "separatorColor": "greyDot75", + "underlineHeight": 1 + }, + "ActionButton": { + "hoverBorderColor": "greyDot50", + "pressedBackground": "greyDot65", + "pressedBorderColor": "greyDot50" + }, + "Borders": { + "ContrastBorderColor": "greyDot65", + "color": "border" + }, + "Button.default.endBackground": "greyDot80", + "Button.default.endBorderColor": "greyDot65", + "Button.default.focusColor": "greyDot80", + "Button.default.focusedBorderColor": "greyDot15", + "Button.default.foreground": "greyDot15", + "Button.default.startBackground": "greyDot80", + "Button.default.startBorderColor": "greyDot65", + "Button.endBackground": "greyDot80", + "Button.endBorderColor": "greyDot65", + "Button.focusedBorderColor": "yellowMac", + "Button.startBackground": "greyDot80", + "Button.startBorderColor": "greyDot65", + "CheckBox.disabledText": "greyDot33", + "CheckBox.select": "greyDot50", + "CheckBoxMenuItem.disabledBackground": "greyDot80", + "ComboBox.ArrowButton.disabledIconColor": "greyDot50", + "ComboBox.ArrowButton.iconColor": "yellowMac", + "ComboBox.ArrowButton.nonEditableBackground": "greyDot70", + "ComboBox.modifiedItemForeground": "yellowMac", + "ComboBox.disabledForeground": "greyDot80", + "ComboBox.nonEditableBackground": "greyDot75", + "ComboPopup.border": "1,1,1,1,4d4d4d", + "CompletionPopup": { + "nonFocusedMask": "#34343434", + "selectionBackground": "navyDot85", + "foreground": "greyDot20", + "matchForeground": "yellowMac" + }, + "Component": { + "arc": "3", + "disabledBorderColor": "greyDot70", + "infoForeground": "greyDot50", + "errorFocusColor": "#F65F87", + "focusColor": "greyDot50", + "focusWidth": "0", + "focusedBorderColor": "greyDot50", + "hoverIconColor": "yellowMac", + "inactiveErrorFocusColor": "transparentRed", + "inactiveWarningFocusColor": "transparentYellow", + "warningFocusColor": "yellow" + }, + "Debugger.Variables.changedValueForeground": "yellowMac", + "Debugger.Variables.evaluatingExpressionForeground": "lightBlue", + "DefaultTabs.underlineColor": "yellowMac", + "DefaultTabs.underlineHeight": 1, + "DefaultTabs.underlinedTabBackground": "greyDot75", + "DefaultTabs.underlinedTabForeground": "lightBlue", + "DragAndDrop.areaBackground": "greyDot75", + "DragAndDrop.areaForeground": "greyDot25", + "Editor.background": "greyDot90", + "EditorPane.inactiveBackground": "greyDot85", + "EditorPane.inactiveForeground": "greyDot50", + "EditorTabs.underlineHeight": 1, + "FileColor.Blue": "#23282d", + "FileColor.Green": "#232d28", + "FileColor.Orange": "#2d2823", + "FileColor.Rose": "#2d2323", + "FileColor.Violet": "#2D232D", + "FileColor.Yellow": "#2d2d23", + "FormattedTextField.inactiveBackground": "greyDot80", + "FormattedTextField.background": "greyDot75", + "GutterTooltip.infoForeground": "greyDot50", + "Label": { + "foreground": "greyDot25", + "infoForeground": "greyDot50" + }, + "Link.activeForeground": "lightBlue", + "Link.hoverForeground": "yellowMac", + "Link.pressedForeground": "lightBlue", + "Link.visitedForeground": "greyDot25", + "MemoryIndicator.allocatedBackground": "green", + "MemoryIndicator.usedBackground": "red", + "Menu": { + "separatorColor": "greyDot75", + "foreground": "textColor", + "borderColor": "greyDot70", + "acceleratorForeground": "greyDot25" + }, + "Notification.MoreButton.innerBorderColor": "greyDot65", + "Notification.ToolWindow.errorBackground": "greyDot85", + "Notification.ToolWindow.errorBorderColor": "#ed005c", + "Notification.ToolWindow.errorForeground": "#F65F87", + "Notification.ToolWindow.informativeBackground": "greyDot85", + "Notification.ToolWindow.informativeBorderColor": "#92D923", + "Notification.ToolWindow.informativeForeground": "#92D923", + "Notification.ToolWindow.warningBackground": "greyDot85", + "Notification.ToolWindow.warningBorderColor": "yellowMac", + "Notification.ToolWindow.warningForeground": "yellowMac", + "Notification.background": "greyDot85", + "Notification.errorBackground": "greyDot85", + "Notification.errorBorderColor": "#ed005c", + "Notification.errorForeground": "#F65F87", + "OptionPane": { + "background": "greyDot80", + "foreground": "greyDot20" + }, + "Panel": { + "background": "greyDot80", + "foreground": "greyDot20" + }, + "Panel.foreground": "greyDot20", + "ParameterInfo.background": "greyDot85", + "ParameterInfo.foreground": "greyDot25", + "ParameterInfo.currentOverloadBackground": "greyDot65", + "ParameterInfo.currentParameterForeground": "yellowMac", + "ParameterInfo.infoForeground": "greyDot33", + "ParameterInfo.lineSeparatorColor": "greyDot75", + "PasswordField.background": "greyDot75", + "Plugins.Button.installBackground": "greyDot80", + "Plugins.Button.installBorderColor": "greyDot65", + "Plugins.Button.installFillBackground": "greyDot80", + "Plugins.Button.installFillForeground": "greyDot25", + "Plugins.Button.installForeground": "yellowMac", + "Plugins.SearchField.background": "greyDot75", + "Plugins.SectionHeader.background": "greyDot75", + "Plugins.Tab.hoverBackground": "navyDot85", + "Plugins.Tab.selectedBackground": "greyDot85", + "Plugins.background": "greyDot80", + "Plugins.disabledForeground": "greyDot50", + "Plugins.lightSelectionBackground": "navyDot85", + "Plugins.tagBackground": "greyDot85", + "Popup.Advertiser.background": "greyDot85", + "Popup.Advertiser.foreground": "greyDot50", + "Popup.Header.activeBackground": "greyDot75", + "Popup.Header.inactiveBackground": "greyDot85", + "Popup.paintBorder": true, + "PopupMenu.background": "greyDot80", + "PopupMenuSeparator.stripeWidth": 1, + "ProgressBar.failedColor": "#ed005c", + "ProgressBar.failedEndColor": "greyDot75", + "ProgressBar.indeterminateStartColor": "yellowMac", + "ProgressBar.indeterminateEndColor": "#FD971F", + "ProgressBar.passedColor": "#92D923", + "ProgressBar.passedEndColor": "greyDot75", + "ProgressBar.progressColor": "yellowMac", + "ProgressBar.trackColor": "greyDot75", + "RadioButton.background": "greyDot80", + "RadioButtonMenuItem.disabledBackground": "greyDot80", + "ScrollPane.background": "greyDot80", + "SearchEverywhere.Advertiser.foreground": "greyDot50", + "SearchEverywhere.List.separatorForeground": "greyDot50", + "SearchEverywhere.SearchField.infoForeground": "greyDot33", + "SearchEverywhere.SearchField.background": "greyDot75", + "SearchEverywhere.Header.background": "greyDot80", + "SearchEverywhere.Tab.selectedBackground": "greyDot85", + "SearchEverywhere.Tab.selectedForeground": "lightBlue", + "SearchMatch.endBackground": "yellowMac", + "SearchMatch.startBackground": "yellowMac", + "SidePanel.background": "greyDot85", + "SpeedSearch.errorForeground": "#F65F87", + "SpeedSearch.foreground": "yellowMac", + "SplitPane.highlight": "yellowMac", + "PopupMenu.translucentBackground": "greyDot50", + "TabbedPane.disabledUnderlineColor": "greyDot65", + "TabbedPane.focusColor": "greyDot65", + "TabbedPane.tabSelectionHeight": 1, + "TabbedPane.underlineColor": "yellowMac", + "Table.dropLineColor": "greyDot75", + "Table.dropLineShortColor": "greyDot70", + "Table.focusCellBackground": "greyDot85", + "Table.focusCellForeground": "yellowMac", + "Table.sortIconColor": "yellowMac", + "Table.stripeColor": "greyDot75", + "TableHeader.background": "greyDot85", + "TableHeader.bottomSeparatorColor": "greyDot65", + "TextArea.background": "greyDot75", + "TextArea.caretForeground": "yellowMac", + "TextArea.inactiveBackground": "greyDot80", + "TextField.background": "greyDot75", + "TextField.foreground": "greyDot25", + "TextField.caretForeground": "yellowMac", + "TextField.highlight": "greyDot15", + "TextField.inactiveForeground": "greyDot33", + "TextPane.inactiveBackground": "greyDot80", + "TitlePane.background": "greyDot85", + "ToggleButton.buttonColor": "greyDot65", + "ToggleButton.offBackground": "greyDot75", + "ToggleButton.offForeground": "greyDot25", + "ToggleButton.onBackground": "yellowMac", + "ToggleButton.onForeground": "greyDot80", + "ToolBar.borderHandleColor": "greyDot65", + "ToolTip.Actions.background": "greyDot80", + "ToolTip.Actions.infoForeground": "greyDot50", + "ToolTip.background": "greyDot75", + "ToolTip.infoForeground": "greyDot50", + "ToolWindow.Button.hoverBackground": "greyDot65", + "ToolWindow.Button.selectedBackground": "greyDot85", + "ToolWindow.Button.selectedForeground": "lightBlue", + "ToolWindow.Header.background": "greyDot85", + "ToolWindow.Header.inactiveBackground": "greyDot80", + "ToolWindow.HeaderTab.hoverBackground": "greyDot65", + "ToolWindow.HeaderTab.hoverInactiveBackground": "greyDot85", + "ToolWindow.HeaderTab.inactiveUnderlineColor": "greyDot75", + "ToolWindow.HeaderTab.underlineColor": "yellowMac", + "ToolWindow.HeaderTab.underlineHeight": 1, + "ToolWindow.HeaderTab.underlinedTabBackground": "greyDot90", + "ToolWindow.HeaderTab.underlinedTabInactiveBackground": "greyDot75", + "Tree.background": "greyDot85", + "Tree.foreground": "greyDot15", + "Tree.modifiedItemForeground": "yellowMac", + "ValidationTooltip.errorBackground": "greyDot85", + "ValidationTooltip.errorBorderColor": "#ed005c", + "ValidationTooltip.warningBackground": "greyDot85", + "ValidationTooltip.warningBorderColor": "yellowMac", + "VersionControl.FileHistory.Commit.selectedBranchBackground": "greyDot70", + "VersionControl.Log.Commit.currentBranchBackground": "greyDot85", + "VersionControl.Log.Commit.unmatchedForeground": "greyDot25", + "WelcomeScreen.Projects.selectionBackground": "navyDot85", + "WelcomeScreen.Projects.selectionInactiveBackground": "navyDot90", + "WelcomeScreen.separatorColor": "greyDot65", + "Window.border": "1,1,1,1,4d4d4d" + } +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/HighContrast.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HighContrast.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/HighContrast.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HighContrast.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/HighContrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HighContrast.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/HighContrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/HighContrast.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/LightFlatTheme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/LightFlatTheme.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/LightFlatTheme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/LightFlatTheme.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/LightFlatTheme.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/LightFlatTheme.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/LightFlatTheme.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/LightFlatTheme.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/MaterialTheme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/MaterialTheme.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/MaterialTheme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/MaterialTheme.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/MaterialTheme.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/MaterialTheme.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/MaterialTheme.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/MaterialTheme.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Monocai.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Monocai.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Monocai.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Monocai.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Monocai.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Monocai.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Monocai.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Monocai.theme.json diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Solarized.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Solarized.LICENSE.txt new file mode 100644 index 00000000..fdddb29a --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Solarized.LICENSE.txt @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedDark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedDark.theme.json new file mode 100644 index 00000000..fb91ee63 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedDark.theme.json @@ -0,0 +1,670 @@ +{ + "name": "Solarized Dark", + "dark": true, + "author": "4lex4", + "editorScheme": "/editor/SolarizedDark.xml", + "colors": { + "colorBackground": "#0E3C4A", + "colorForeground": "#A9B3AE", + "colorInactiveForeground": "#839496", + "colorSelectionBackground": "#1C62C9", + "colorSelectionBackgroundInactive": "#00243C", + "colorSelectionForeground": "#C2C5BC", + "colorSelectionForegroundInactive": "#A9B3AE", + "colorHoverBackground": "#284E5B", + "colorBorder": "#04343F", + "colorDisabledForeground": "#657B83", + "colorAlternativeBackground": "#1B4854", + "colorSeparator": "#2E4E58", + "colorAcceleratorForeground": "#527FBF", + "colorAcceleratorSelectionForeground": "#C2C5BC", + "colorHighlight": "#FFFFEB", + "colorShadow": "#B2CEE6" + }, + "ui": { + "*": { + "acceleratorForeground": "colorAcceleratorForeground", + "acceleratorSelectionForeground": "colorAcceleratorSelectionForeground", + "background": "colorBackground", + "caretForeground": "colorForeground", + "disabledForeground": "colorDisabledForeground", + "disabledText": "colorDisabledForeground", + "foreground": "colorForeground", + "inactiveBackground": "colorBackground", + "inactiveForeground": "colorInactiveForeground", + "selectionBackground": "colorSelectionBackground", + "selectionBackgroundInactive": "colorSelectionBackgroundInactive", + "selectionForeground": "colorSelectionForeground", + "selectionForegroundInactive": "colorSelectionForegroundInactive", + "selectionInactiveBackground": "colorSelectionBackgroundInactive", + "selectionInactiveForeground": "colorSelectionForegroundInactive", + "textBackground": "colorBackground", + "textForeground": "colorForeground" + }, + "ActionButton": { + "hoverBackground": "colorHoverBackground", + "hoverBorderColor": "colorHoverBackground", + "pressedBackground": "#43616C", + "pressedBorderColor": "#43616C" + }, + "Borders": { + "color": "colorBorder", + "ContrastBorderColor": "colorBorder" + }, + "Button": { + "default": { + "endBackground": "#0F5282", + "endBorderColor": "#2D6D90", + "focusColor": "#25648F", + "focusedBorderColor": "#3B749E", + "shadowColor": "#00151F1A", + "startBackground": "#0F5282", + "startBorderColor": "#2D6D90" + }, + "disabledBorderColor": "#476069", + "endBackground": "#284E5B", + "endBorderColor": "#476069", + "focusedBorderColor": "#296996", + "shadowColor": "#00151F1A", + "startBackground": "#284E5B", + "startBorderColor": "#476069" + }, + "CheckBox": {}, + "CheckBoxMenuItem": {}, + "ColorChooser": { + "swatchesDefaultRecentColor": "colorBackground" + }, + "ComboBox": { + "ArrowButton": { + "disabledIconColor": "#49636B", + "iconColor": "#8D9FA2", + "nonEditableBackground": "colorBackground" + }, + "disabledBackground": "colorBackground", + "modifiedItemForeground": "#519AF2", + "nonEditableBackground": "colorBackground" + }, + "ComboBoxButton": {}, + "ComboPopup": { + "border": "1,1,1,1,04343F" + }, + "CompletionPopup": { + "foreground": "colorForeground", + "matchForeground": "#519AF2", + "selectionBackground": "#003359", + "selectionInactiveBackground": "#295462" + }, + "Component": { + "borderColor": "#49636B", + "disabledBorderColor": "#49636B", + "errorFocusColor": "#743D44", + "focusColor": "#26608A", + "focusedBorderColor": "#296996", + "hoverIconColor": "#8D9FA2", + "iconColor": "#8D9FA2", + "inactiveErrorFocusColor": "#53515A", + "inactiveWarningFocusColor": "#555129", + "infoForeground": "#657B83", + "warningFocusColor": "#9A7926" + }, + "Counter": { + "background": "#99A6A5B0", + "foreground": "#002B36" + }, + "Debugger": { + "Variables": { + "changedValueForeground": "#519AF2", + "collectingDataForeground": "#93A1A1", + "errorMessageForeground": "#FA6060", + "evaluatingExpressionForeground": "#93A1A1", + "exceptionForeground": "#FA6060", + "modifyingValueForeground": "#519AF2", + "valueForeground": "#FD7E7A" + } + }, + "DebuggerPopup": { + "borderColor": "colorBorder" + }, + "DebuggerTabs": {}, + "DefaultTabs": { + "borderColor": "colorBorder", + "hoverBackground": "#00131F82", + "inactiveUnderlineColor": "#577A88", + "underlineColor": "#3985C7", + "underlinedTabBackground": "colorBackground", + "underlinedTabForeground": "colorForeground" + }, + "DragAndDrop": { + "areaBackground": "#17475F", + "areaBorderColor": "#386FA8", + "areaForeground": "colorForeground" + }, + "Editor": { + "background": "#0E272F", + "foreground": "#93A1A1", + "shortcutForeground": "#519AF2" + }, + "EditorPane": { + "inactiveBackground": "colorAlternativeBackground", + "inactiveForeground": "colorForeground" + }, + "EditorTabs": { + "inactiveColoredFileBackground": "#0E3C4A99", + "underlinedTabBackground": "#225261" + }, + "FileColor": { + "Blue": "#2B5372", + "Green": "#215354", + "Orange": "#67625D", + "Rose": "#4D5264", + "Violet": "#534A57", + "Yellow": "#274A4C" + }, + "FlameGraph": { + "JavaCell": { + "background": "#B29F66", + "foreground": "#002B36", + "hoverBackground": "#8E865F", + "hoverForeground": "#002B36", + "hoverInactiveBackground": "#76704A", + "hoverInactiveForeground": "#002B36", + "inactiveBackground": "#96854E", + "inactiveForeground": "#586E75", + "searchFailBackground": "#536861", + "searchFailHoverBackground": "#3D5853", + "searchFailHoverInactiveBackground": "#29423F", + "searchFailInactiveBackground": "#3E524C", + "searchOkBackground": "#B29F66", + "searchOkHoverBackground": "#8E865F", + "searchOkHoverInactiveBackground": "#76704A", + "searchOkInactiveBackground": "#988750" + }, + "NativeCell": { + "background": "#75ABCA", + "foreground": "#002B36", + "hoverBackground": "#5B8DAC", + "hoverForeground": "#002B36", + "hoverInactiveBackground": "#437694", + "hoverInactiveForeground": "#002B36", + "inactiveBackground": "#5B90AF", + "inactiveForeground": "#586E75", + "searchFailBackground": "#376375", + "searchFailHoverBackground": "#265465", + "searchFailHoverInactiveBackground": "#0C3F4F", + "searchFailInactiveBackground": "#1E4D5E", + "searchOkBackground": "#75ABCA", + "searchOkHoverBackground": "#5B8DAC", + "searchOkHoverInactiveBackground": "#437694", + "searchOkInactiveBackground": "#5D93B1" + }, + "ParentCell": { + "background": "#95A3A4", + "foreground": "#002B36", + "hoverBackground": "#7D8F92", + "hoverForeground": "#002B36", + "hoverInactiveBackground": "#627880", + "hoverInactiveForeground": "#002B36", + "inactiveBackground": "#778A8F", + "inactiveForeground": "#586E75", + "searchFailBackground": "#476069", + "searchFailHoverBackground": "#566C73", + "searchFailHoverInactiveBackground": "#3B5760", + "searchFailInactiveBackground": "#2B4C56", + "searchOkBackground": "#95A3A4", + "searchOkHoverBackground": "#7D8F92", + "searchOkHoverInactiveBackground": "#627880", + "searchOkInactiveBackground": "#7B8C8F" + } + }, + "FormattedTextField": { + "background": "colorAlternativeBackground" + }, + "Group": { + "disabledSeparatorColor": "colorSeparator", + "separatorColor": "colorSeparator" + }, + "GutterTooltip": { + "infoForeground": "#708589", + "lineSeparatorColor": "colorBorder" + }, + "HelpTooltip": { + "borderColor": "#486671" + }, + "InformationHint": { + "borderColor": "colorBorder" + }, + "InplaceRefactoringPopup": { + "borderColor": "colorBorder" + }, + "Label": { + "errorForeground": "#FA6060", + "infoForeground": "#778A8F", + "selectedForeground": "colorForeground" + }, + "Link": { + "activeForeground": "#519AF2", + "hoverForeground": "#519AF2", + "pressedForeground": "#AA6E28", + "secondaryForeground": "#3B72A2", + "visitedForeground": "#519AF2" + }, + "List": { + "dropLineColor": "colorAcceleratorForeground" + }, + "MemoryIndicator": { + "allocatedBackground": "#3B5760", + "usedBackground": "#566C73" + }, + "Menu": { + "borderColor": "colorSeparator", + "separatorColor": "colorSeparator" + }, + "MenuBar": { + "borderColor": "colorSeparator", + "disabledBackground": "colorBackground", + "highlight": "colorHighlight", + "shadow": "colorShadow" + }, + "MenuItem": { + "acceleratorForeground": "colorForeground", + "disabledBackground": "colorBackground" + }, + "NavBar": { + "borderColor": "colorSeparator" + }, + "Notification": { + "borderColor": "#365863CD", + "errorBackground": "#353E4D", + "errorBorderColor": "#564755", + "errorForeground": "colorForeground", + "MoreButton": { + "background": "#0F3945", + "foreground": "#839496", + "innerBorderColor": "#073642" + }, + "ToolWindow": { + "errorBackground": "#524950", + "errorBorderColor": "#828A91", + "errorForeground": "colorForeground", + "informativeBackground": "#123F35", + "informativeBorderColor": "#6D977F", + "informativeForeground": "colorForeground", + "warningBackground": "#435126", + "warningBorderColor": "#93A16A", + "warningForeground": "colorForeground" + } + }, + "OptionPane": { + "messageForeground": "colorForeground" + }, + "Panel": {}, + "ParameterInfo": { + "background": "#254C57", + "borderColor": "#415E69", + "currentOverloadBackground": "#415E69", + "currentParameterForeground": "colorForeground", + "disabledForeground": "#60767D", + "infoForeground": "#708589", + "lineSeparatorColor": "#415E69" + }, + "PasswordField": { + "background": "colorAlternativeBackground" + }, + "Plugins": { + "background": "#013441", + "Button": { + "installBackground": "#013441", + "installBorderColor": "#057A56", + "installFillBackground": "#057A56", + "installFillForeground": "colorForeground", + "installFocusedBackground": "#DFF6DB", + "installForeground": "#057A56", + "updateBackground": "#004880", + "updateBorderColor": "#004880", + "updateForeground": "colorForeground" + }, + "disabledForeground": "#546971", + "eapTagBackground": "#EFD2CF", + "lightSelectionBackground": "#0B3A48", + "SearchField": { + "background": "#013441", + "borderColor": "#30505B" + }, + "SectionHeader": { + "background": "#0C3D45", + "foreground": "#88999B" + }, + "Tab": {}, + "tagBackground": "#2E4E58", + "tagForeground": "#88999B" + }, + "Popup": { + "Advertiser": { + "borderColor": "#708589" + }, + "borderColor": "#476069", + "Header": { + "activeBackground": "#204D5C", + "inactiveBackground": "#1B4555" + }, + "inactiveBorderColor": "#38555E", + "separatorColor": "colorSeparator", + "separatorForeground": "#6B8086", + "Toolbar": { + "borderColor": "#264C59" + } + }, + "PopupMenu": { + "translucentBackground": "colorBackground" + }, + "ProgressBar": { + "failedColor": "#DE4647", + "failedEndColor": "#EFA0A0", + "foreground": "#6B8086", + "indeterminateEndColor": "#6D8289", + "indeterminateStartColor": "#4E6770", + "passedColor": "#008A4B", + "passedEndColor": "#4FC392", + "progressColor": "#93A1A1", + "trackColor": "#36525B" + }, + "RadioButton": {}, + "RadioButtonMenuItem": {}, + "ScrollBar": { + "background": "#14414F", + "hoverThumbBorderColor": "#0A384459", + "hoverThumbColor": "#99A6A559", + "hoverTrackColor": "", + "Mac": { + "hoverThumbBorderColor": "#0027328C", + "hoverThumbColor": "#6B80868C", + "hoverTrackColor": "", + "thumbBorderColor": "#00273259", + "thumbColor": "#6B808659", + "trackColor": "", + "Transparent": { + "hoverThumbBorderColor": "#0027328C", + "hoverThumbColor": "#6B80868C", + "hoverTrackColor": "#6B80861A", + "thumbBorderColor": "", + "thumbColor": "", + "trackColor": "" + } + }, + "thumbBorderColor": "#0A384447", + "thumbColor": "#99A6A547", + "trackColor": "", + "Transparent": { + "hoverThumbBorderColor": "#0A384459", + "hoverThumbColor": "#99A6A559", + "hoverTrackColor": "#6B80861A", + "thumbBorderColor": "#0A384447", + "thumbColor": "#99A6A547", + "trackColor": "" + } + }, + "ScrollPane": {}, + "SearchEverywhere": { + "Advertiser": { + "background": "colorAlternativeBackground", + "foreground": "#6B8086" + }, + "Header": { + "background": "colorAlternativeBackground" + }, + "List": { + "separatorColor": "#2E4E58", + "separatorForeground": "#6B8086" + }, + "SearchField": { + "borderColor": "#49636B", + "infoForeground": "#6B8086" + }, + "Tab": { + "selectedBackground": "#365863", + "selectedForeground": "colorForeground" + } + }, + "SearchField": { + "errorBackground": "#5B3C43" + }, + "SearchMatch": { + "endBackground": "#FCCE40", + "startBackground": "#FFEAA2" + }, + "Separator": { + "separatorColor": "colorSeparator" + }, + "Settings": { + "Spotlight": { + "borderColor": "#9A670064" + } + }, + "SidePanel": { + "background": "#0E4155" + }, + "Slider": { + "buttonBorderColor": "#023B49", + "buttonColor": "#909E9E", + "tickColor": "#4C656D", + "trackColor": "#4C656D" + }, + "SpeedSearch": { + "borderColor": "#6B8086", + "errorForeground": "#FA6060" + }, + "Spinner": {}, + "SplitPane": { + "darkShadow": "#628A9F", + "highlight": "colorBackground", + "shadow": "colorShadow" + }, + "SplitPaneDivider": { + "draggingColor": "#193E49" + }, + "StatusBar": { + "borderColor": "#204550", + "hoverBackground": "colorHoverBackground" + }, + "TabbedPane": { + "contentAreaColor": "#04343F", + "disabledUnderlineColor": "#627880", + "focus": "colorAcceleratorForeground", + "focusColor": "#164864", + "hoverColor": "#003240", + "underlineColor": "#3985C7" + }, + "Table": { + "dropLineColor": "colorAcceleratorForeground", + "dropLineShortColor": "#0C3542", + "focusCellBackground": "colorAlternativeBackground", + "focusCellForeground": "colorForeground", + "gridColor": "#284E5B", + "lightSelectionBackground": "#1B4755", + "lightSelectionForeground": "colorForeground", + "lightSelectionInactiveBackground": "#1B4755", + "lightSelectionInactiveForeground": "colorForeground", + "sortIconColor": "#839496", + "stripeColor": "#174351" + }, + "TableHeader": { + "background": "#194553", + "bottomSeparatorColor": "#003442", + "focusCellBackground": "colorAlternativeBackground", + "separatorColor": "#003442" + }, + "TextArea": { + "background": "colorAlternativeBackground" + }, + "TextComponent": {}, + "TextField": { + "background": "colorAlternativeBackground", + "darkShadow": "#628A9F", + "highlight": "colorHighlight" + }, + "TextPane": {}, + "TitledBorder": { + "titleColor": "colorForeground" + }, + "TitlePane": { + "Button": { + "hoverBackground": "#FFFFEB1A" + }, + "inactiveInfoForeground": "#586E75", + "infoForeground": "#839496" + }, + "ToggleButton": { + "borderColor": "#2E4E58", + "buttonColor": "#49636B", + "offBackground": "colorAlternativeBackground", + "offForeground": "colorDisabledForeground", + "onBackground": "#2B6955", + "onForeground": "colorForeground" + }, + "ToolBar": { + "darkShadow": "#628A9F", + "floatingForeground": "#A2CAF1", + "highlight": "colorHighlight", + "light": "colorHighlight", + "shadow": "colorShadow" + }, + "Toolbar": { + "Floating": { + "background": "#174857" + } + }, + "ToolTip": { + "Actions": { + "background": "#1A4653", + "infoForeground": "#7D8F92" + }, + "background": "#254C57", + "borderColor": "#486671", + "infoForeground": "#778A8F", + "shortcutForeground": "#88999B" + }, + "Tooltip": { + "separatorColor": "#38555E" + }, + "ToolWindow": { + "Button": { + "hoverBackground": "#00151F30", + "selectedBackground": "#00151F5A", + "selectedForeground": "#CCCDC1" + }, + "Header": { + "background": "#11435A", + "borderColor": "colorBorder", + "inactiveBackground": "colorBackground" + }, + "HeaderCloseButton": { + "background": "#123E4F" + }, + "HeaderTab": { + "selectedInactiveBackground": "#0D3340" + } + }, + "Tree": { + "errorForeground": "#FA6060", + "hash": "#2B515E", + "modifiedItemForeground": "#519AF2" + }, + "UiDesigner": { + "Panel": {}, + "Preview": {} + }, + "ValidationTooltip": { + "errorBackground": "#353E4D", + "errorBorderColor": "#564755", + "warningBackground": "#384E3C", + "warningBorderColor": "#6E5209" + }, + "VersionControl": { + "FileHistory": { + "Commit": { + "selectedBranchBackground": "#224849" + } + }, + "GitLog": { + "headIconColor": "#DAC732", + "localBranchIconColor": "#2AB15E", + "otherIconColor": "#7D8F92", + "remoteBranchIconColor": "#8D78B9", + "tagIconColor": "#7D8F92" + }, + "HgLog": { + "bookmarkIconColor": "#8D78B9", + "branchIconColor": "#2AB15E", + "closedBranchIconColor": "#FD5C6C", + "headIconColor": "#B51D8F", + "localTagIconColor": "#00F1F0", + "mqTagIconColor": "#0050F8", + "tagIconColor": "#7D8F92", + "tipIconColor": "#DAC732" + }, + "Log": { + "Commit": { + "currentBranchBackground": "#044452", + "unmatchedForeground": "#657B83" + } + }, + "RefLabel": { + "backgroundBase": "#FFFFEB", + "foreground": "#7D8F92" + } + }, + "Viewport": {}, + "WelcomeScreen": { + "background": "#1D4553", + "borderColor": "#31535F", + "captionBackground": "#294953", + "captionForeground": "#C2C5BC", + "footerBackground": "#294953", + "footerForeground": "#C2C5BC", + "groupIconBorderColor": "#0A3844", + "headerBackground": "#294953", + "headerForeground": "#C2C5BC", + "Projects": { + "background": "#113842", + "selectionBackground": "#396AB0", + "selectionInactiveBackground": "#1E434E" + }, + "separatorColor": "#244A57" + }, + "Window": { + "border": "colorBorder" + } + }, + "icons": { + "ColorPalette": { + "Actions.Red": "#DC322F", + "Actions.Yellow": "#B58900", + "Actions.Green": "#859900", + "Actions.Blue": "#268BD2", + "Actions.Grey": "#93A1A1", + "Actions.GreyInline.Dark": "#93A1A1", + "Objects.Grey": "#93A1A1", + "Objects.Blue": "#268BD2", + "Objects.Green": "#859900", + "Objects.Yellow": "#B58900", + "Objects.YellowDark": "#CB4B16", + "Objects.Purple": "#6C71C4", + "Objects.Pink": "#D33682", + "Objects.Red": "#DC322F", + "Objects.RedStatus": "#DC322F", + "Objects.BlackText": "#002B36FF", + "Objects.GreenAndroid": "#859900", + "Checkbox.Background.Default.Dark": "#1B4854", + "Checkbox.Border.Default.Dark": "#476069", + "Checkbox.Background.Selected.Dark": "#1B4854", + "Checkbox.Border.Selected.Dark": "#42646D", + "Checkbox.Foreground.Selected.Dark": "#A9B3AE", + "Checkbox.Background.Disabled.Dark": "#0E3C4A", + "Checkbox.Border.Disabled.Dark": "#476069", + "Checkbox.Foreground.Disabled.Dark": "#476069", + "Checkbox.Focus.Thin.Default.Dark": "#296996", + "Checkbox.Focus.Thin.Selected.Dark": "#296996", + "Checkbox.Focus.Wide.Dark": "#296996" + } + } +} \ No newline at end of file diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedLight.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedLight.theme.json new file mode 100644 index 00000000..cbffeb4c --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/SolarizedLight.theme.json @@ -0,0 +1,675 @@ +{ + "name": "Solarized Light", + "dark": false, + "author": "4lex4", + "editorScheme": "/editor/SolarizedLight.xml", + "colors": { + "colorBackground": "#EEE8D5", + "colorForeground": "#2E4E58", + "colorInactiveForeground": "#657B83", + "colorSelectionBackground": "#3570CD", + "colorSelectionBackgroundInactive": "#D3D2C6", + "colorSelectionForeground": "#FFFFEB", + "colorSelectionForegroundInactive": "#2E4E58", + "colorHoverBackground": "#D9D7CA", + "colorBorder": "#C8CAC0", + "colorDisabledForeground": "#839496", + "colorAlternativeBackground": "#FDF6E3", + "colorSeparator": "#C8CAC0", + "colorAcceleratorForeground": "#617EB3", + "colorAcceleratorSelectionForeground": "#FFFFEB", + "colorHighlight": "#FFFFEB", + "colorShadow": "#B5C7CF" + }, + "ui": { + "*": { + "acceleratorForeground": "colorAcceleratorForeground", + "acceleratorSelectionForeground": "colorAcceleratorSelectionForeground", + "background": "colorBackground", + "caretForeground": "colorForeground", + "disabledForeground": "colorDisabledForeground", + "disabledText": "colorDisabledForeground", + "foreground": "colorForeground", + "inactiveBackground": "colorBackground", + "inactiveForeground": "colorInactiveForeground", + "selectionBackground": "colorSelectionBackground", + "selectionBackgroundInactive": "colorSelectionBackgroundInactive", + "selectionForeground": "colorSelectionForeground", + "selectionForegroundInactive": "colorSelectionForegroundInactive", + "selectionInactiveBackground": "colorSelectionBackgroundInactive", + "selectionInactiveForeground": "colorSelectionForegroundInactive", + "textBackground": "colorBackground", + "textForeground": "colorForeground" + }, + "ActionButton": { + "hoverBackground": "colorHoverBackground", + "hoverBorderColor": "colorHoverBackground", + "pressedBackground": "#C6C7BD", + "pressedBorderColor": "#C6C7BD" + }, + "Borders": { + "color": "colorBorder", + "ContrastBorderColor": "colorBorder" + }, + "Button": { + "default": { + "endBackground": "#4681BB", + "endBorderColor": "#3065A7", + "focusedBorderColor": "#A5C7E2", + "foreground": "#FDF6E3", + "shadowColor": "#000E1B0F", + "startBackground": "#4681BB", + "startBorderColor": "#4676B2" + }, + "disabledBorderColor": "#C6C7BD", + "endBackground": "colorAlternativeBackground", + "endBorderColor": "#A7B0AC", + "focusedBorderColor": "#86ABCB", + "shadowColor": "#000E1B0F", + "startBackground": "colorAlternativeBackground", + "startBorderColor": "#B4BAB5" + }, + "CheckBox": {}, + "CheckBoxMenuItem": {}, + "ColorChooser": { + "swatchesDefaultRecentColor": "#CFD0C3" + }, + "ComboBox": { + "ArrowButton": { + "background": "#F7F0DD", + "disabledIconColor": "#A1ABA8", + "iconColor": "#4E6770", + "nonEditableBackground": "colorAlternativeBackground" + }, + "background": "colorAlternativeBackground", + "disabledBackground": "colorBackground", + "modifiedItemForeground": "#3961FA", + "nonEditableBackground": "colorAlternativeBackground" + }, + "ComboBoxButton": { + "background": "colorAlternativeBackground" + }, + "ComboPopup": { + "border": "1,1,1,1,C8CAC0" + }, + "CompletionPopup": { + "foreground": "colorForeground", + "matchForeground": "#4975B9", + "selectionBackground": "#BED8F0", + "selectionInactiveBackground": "#D9D7CA" + }, + "Component": { + "borderColor": "#BAC0B8", + "disabledBorderColor": "#C6C7BD", + "errorFocusColor": "#DE3641", + "focusColor": "#95BDE1", + "focusedBorderColor": "#86ABCB", + "hoverIconColor": "#4E6770", + "iconColor": "#4E6770", + "inactiveErrorFocusColor": "#E8B4A6", + "inactiveWarningFocusColor": "#F6CA7C", + "infoForeground": "#839496", + "warningFocusColor": "#DC9E2F" + }, + "Counter": { + "background": "#99A6A5B0", + "foreground": "#002B36" + }, + "Debugger": { + "Variables": { + "changedValueForeground": "#3961FA", + "collectingDataForeground": "#586E75", + "errorMessageForeground": "#F94A26", + "evaluatingExpressionForeground": "#586E75", + "exceptionForeground": "#F94A26", + "modifyingValueForeground": "#3961FA", + "valueForeground": "#C44C30" + } + }, + "DebuggerPopup": { + "borderColor": "colorBorder" + }, + "DebuggerTabs": {}, + "DefaultTabs": { + "borderColor": "colorBorder", + "hoverBackground": "#000E1B1A", + "inactiveUnderlineColor": "#92A4A7", + "underlineColor": "#3D7EC0", + "underlinedTabBackground": "colorBackground", + "underlinedTabForeground": "colorForeground" + }, + "DragAndDrop": { + "areaBackground": "#DEE3DE", + "areaBorderColor": "#88ACCD", + "areaForeground": "#657B83" + }, + "Editor": { + "background": "#B5B0A2", + "foreground": "#36525B", + "shortcutForeground": "#516091" + }, + "EditorPane": { + "background": "colorAlternativeBackground", + "inactiveBackground": "colorAlternativeBackground" + }, + "EditorTabs": { + "inactiveColoredFileBackground": "#0B080112", + "underlinedTabBackground": "colorAlternativeBackground" + }, + "FileColor": { + "Blue": "#E8EEE5", + "Green": "#EDF2CE", + "Orange": "#F2E0C2", + "Rose": "#F0D4C2", + "Violet": "#E4D8D8", + "Yellow": "#FBF4C9" + }, + "FlameGraph": { + "JavaCell": { + "background": "#F8D583", + "foreground": "#073642", + "hoverBackground": "#E5C67B", + "hoverForeground": "#073642", + "hoverInactiveBackground": "#C9A95A", + "hoverInactiveForeground": "#073642", + "inactiveBackground": "#DBB969", + "inactiveForeground": "#657B83", + "searchFailBackground": "#C0A86D", + "searchFailHoverBackground": "#9A865B", + "searchFailHoverInactiveBackground": "#7F6D43", + "searchFailInactiveBackground": "#A48E54", + "searchOkBackground": "#F8D583", + "searchOkHoverBackground": "#E5C67B", + "searchOkHoverInactiveBackground": "#C7AA60", + "searchOkInactiveBackground": "#DBB969" + }, + "NativeCell": { + "background": "#A7D1DD", + "foreground": "#073642", + "hoverBackground": "#98BBCD", + "hoverForeground": "#073642", + "hoverInactiveBackground": "#7CA5B1", + "hoverInactiveForeground": "#073642", + "inactiveBackground": "#8CB5C1", + "inactiveForeground": "#657B83", + "searchFailBackground": "#8DADBA", + "searchFailHoverBackground": "#72858C", + "searchFailHoverInactiveBackground": "#596B72", + "searchFailInactiveBackground": "#75939F", + "searchOkBackground": "#A7D1DD", + "searchOkHoverBackground": "#98BBCD", + "searchOkHoverInactiveBackground": "#7FA1B2", + "searchOkInactiveBackground": "#8CB5C1" + }, + "ParentCell": { + "background": "#D3D2C6", + "foreground": "#073642", + "hoverBackground": "#BEC2B9", + "hoverForeground": "#073642", + "hoverInactiveBackground": "#9DA8A7", + "hoverInactiveForeground": "#073642", + "inactiveBackground": "#B1B8B2", + "inactiveForeground": "#657B83", + "searchFailBackground": "#7B8C8F", + "searchFailHoverBackground": "#9DA8A7", + "searchFailHoverInactiveBackground": "#7D8F92", + "searchFailInactiveBackground": "#5D737B", + "searchOkBackground": "#D3D2C6", + "searchOkHoverBackground": "#BEC2B9", + "searchOkHoverInactiveBackground": "#9DA8A7", + "searchOkInactiveBackground": "#B1B8B2" + } + }, + "FormattedTextField": { + "background": "colorAlternativeBackground", + "inactiveBackground": "colorAlternativeBackground" + }, + "Group": { + "disabledSeparatorColor": "colorSeparator", + "separatorColor": "colorSeparator" + }, + "GutterTooltip": { + "infoForeground": "#657B83", + "lineSeparatorColor": "colorBorder" + }, + "HelpTooltip": { + "borderColor": "#A1ABA8" + }, + "InformationHint": { + "borderColor": "colorBorder" + }, + "InplaceRefactoringPopup": { + "borderColor": "colorBorder" + }, + "Label": { + "errorForeground": "#F95551", + "infoForeground": "#657B83", + "selectedForeground": "colorForeground" + }, + "Link": { + "activeForeground": "#4975B9", + "hoverForeground": "#4975B9", + "pressedForeground": "#2857A1", + "secondaryForeground": "#7598AF", + "visitedForeground": "#516091" + }, + "List": { + "background": "colorAlternativeBackground", + "dropLineColor": "colorAcceleratorForeground" + }, + "MemoryIndicator": { + "allocatedBackground": "#CFD0C3", + "usedBackground": "#ADB5AF" + }, + "Menu": { + "borderColor": "#D3D2C6", + "disabledBackground": "colorBackground", + "separatorColor": "colorSeparator" + }, + "MenuBar": { + "borderColor": "colorSeparator", + "disabledBackground": "colorBackground", + "highlight": "colorHighlight", + "shadow": "colorShadow" + }, + "MenuItem": { + "acceleratorForeground": "#49636B", + "disabledBackground": "colorBackground" + }, + "NavBar": { + "borderColor": "colorSeparator" + }, + "Notification": { + "borderColor": "#A7B0ACCD", + "errorBackground": "#F2DED1", + "errorBorderColor": "#DDA195", + "errorForeground": "colorForeground", + "MoreButton": { + "background": "#DDDACB", + "foreground": "#586E75", + "innerBorderColor": "#D3D2C6" + }, + "ToolWindow": { + "errorBackground": "#F8C4C5", + "errorBorderColor": "#D49084", + "errorForeground": "colorForeground", + "informativeBackground": "#B4E4A2", + "informativeBorderColor": "#9DB88A", + "informativeForeground": "colorForeground", + "warningBackground": "#F7F280", + "warningBorderColor": "#B4B21A", + "warningForeground": "colorForeground" + } + }, + "OptionPane": { + "messageForeground": "colorForeground" + }, + "Panel": {}, + "ParameterInfo": { + "background": "#F5F1E5", + "borderColor": "#D9D7CA", + "currentOverloadBackground": "#D9D7CA", + "currentParameterForeground": "colorForeground", + "disabledForeground": "#A3ADAB", + "infoForeground": "#657B83", + "lineSeparatorColor": "#D9D7CA" + }, + "PasswordField": { + "background": "colorAlternativeBackground" + }, + "Plugins": { + "background": "colorAlternativeBackground", + "Button": { + "installBackground": "colorAlternativeBackground", + "installBorderColor": "#81BA5C", + "installFillBackground": "#81BA5C", + "installFillForeground": "colorAlternativeBackground", + "installFocusedBackground": "#DFEEC2", + "installForeground": "#81BA5C", + "updateBackground": "#5F9DE7", + "updateBorderColor": "#5F9DE7", + "updateForeground": "colorAlternativeBackground" + }, + "disabledForeground": "#A3ADAB", + "eapTagBackground": "#EECAB6", + "lightSelectionBackground": "#F3F1E3", + "SearchField": { + "background": "colorAlternativeBackground", + "borderColor": "#B4BAB5" + }, + "SectionHeader": { + "background": "#F4EDDA", + "foreground": "#627880" + }, + "Tab": {}, + "tagBackground": "#E8E2D2", + "tagForeground": "#627880" + }, + "Popup": { + "Advertiser": { + "borderColor": "colorBorder" + }, + "borderColor": "#A1ABA8", + "Header": { + "activeBackground": "#E2DCCA", + "inactiveBackground": "#EBE5D2" + }, + "inactiveBorderColor": "#9DA8A7", + "separatorColor": "#D3D2C6", + "separatorForeground": "#6B8086", + "Toolbar": { + "borderColor": "#F7F0DD" + } + }, + "PopupMenu": { + "translucentBackground": "colorBackground" + }, + "ProgressBar": { + "failedColor": "#D14943", + "failedEndColor": "#F6887C", + "indeterminateEndColor": "#6B8086", + "indeterminateStartColor": "#BAC0B8", + "passedColor": "#2DAA66", + "passedEndColor": "#77DF92", + "progressColor": "#6B8086", + "trackColor": "#BAC0B8" + }, + "RadioButton": {}, + "RadioButtonMenuItem": {}, + "ScrollBar": { + "background": "#F5F0E3", + "hoverThumbBorderColor": "#4B5A5F47", + "hoverThumbColor": "#5D737B47", + "hoverTrackColor": "", + "Mac": { + "hoverThumbBorderColor": "#002B3680", + "hoverThumbColor": "#002B3680", + "hoverTrackColor": "", + "thumbBorderColor": "#002B3633", + "thumbColor": "#002B3633", + "trackColor": "", + "Transparent": { + "hoverThumbBorderColor": "#002B3680", + "hoverThumbColor": "#002B3680", + "hoverTrackColor": "#6D82891A", + "thumbBorderColor": "", + "thumbColor": "", + "trackColor": "" + } + }, + "thumbBorderColor": "#4B5A5F33", + "thumbColor": "#5D737B33", + "trackColor": "", + "Transparent": { + "hoverThumbBorderColor": "#4B5A5F47", + "hoverThumbColor": "#5D737B47", + "hoverTrackColor": "#6D82891A", + "thumbBorderColor": "#4B5A5F33", + "thumbColor": "#5D737B33", + "trackColor": "" + } + }, + "ScrollPane": {}, + "SearchEverywhere": { + "Advertiser": { + "foreground": "#6B8086" + }, + "Header": {}, + "List": { + "separatorColor": "#D7D5C7", + "separatorForeground": "#657B83" + }, + "SearchField": { + "background": "colorAlternativeBackground", + "borderColor": "#B4BAB5", + "infoForeground": "#6B8086" + }, + "Tab": { + "selectedBackground": "#DAD5C3", + "selectedForeground": "colorForeground" + } + }, + "SearchField": { + "errorBackground": "#FCC4B3" + }, + "SearchMatch": { + "endBackground": "#F8C734", + "startBackground": "#FAE08D" + }, + "Separator": { + "separatorColor": "colorSeparator" + }, + "Settings": { + "Spotlight": { + "borderColor": "#F6C00064" + } + }, + "SidePanel": { + "background": "#E2E2D4" + }, + "Slider": { + "buttonBorderColor": "#95A3A4", + "buttonColor": "colorAlternativeBackground", + "tickColor": "#869798", + "trackColor": "#BEC2B9" + }, + "SpeedSearch": { + "borderColor": "#6B8086", + "errorForeground": "#F94A26" + }, + "Spinner": {}, + "SplitPane": { + "darkShadow": "#78858B", + "highlight": "colorBackground", + "shadow": "colorShadow" + }, + "SplitPaneDivider": { + "draggingColor": "#1E434E" + }, + "StatusBar": { + "borderColor": "colorBorder", + "hoverBackground": "colorHoverBackground" + }, + "TabbedPane": { + "contentAreaColor": "#B4BAB5", + "disabledUnderlineColor": "#A1ABA8", + "focus": "colorAcceleratorForeground", + "focusColor": "#D6DBD3", + "hoverColor": "#D3D2C6", + "underlineColor": "#3D7EC0" + }, + "Table": { + "background": "colorAlternativeBackground", + "dropLineColor": "colorAcceleratorForeground", + "dropLineShortColor": "#5F63A9", + "focusCellBackground": "colorAlternativeBackground", + "focusCellForeground": "colorForeground", + "gridColor": "#F4EDDA", + "lightSelectionBackground": "#E7E6DA", + "lightSelectionForeground": "colorForeground", + "lightSelectionInactiveBackground": "#F4EDDA", + "lightSelectionInactiveForeground": "colorForeground", + "sortIconColor": "colorShadow", + "stripeColor": "#F3EDDE" + }, + "TableHeader": { + "background": "colorAlternativeBackground", + "bottomSeparatorColor": "#E0DDCD", + "focusCellBackground": "colorAlternativeBackground", + "separatorColor": "#E0DDCD" + }, + "TextArea": { + "background": "colorAlternativeBackground" + }, + "TextComponent": {}, + "TextField": { + "background": "colorAlternativeBackground", + "darkShadow": "#73888C", + "highlight": "colorHighlight" + }, + "TextPane": {}, + "TitledBorder": { + "titleColor": "colorForeground" + }, + "TitlePane": { + "Button": { + "hoverBackground": "#0001181A" + }, + "inactiveInfoForeground": "#839496", + "infoForeground": "#586E75" + }, + "ToggleButton": { + "borderColor": "#B7BDB6", + "buttonColor": "#BEC2B9", + "offBackground": "colorAlternativeBackground", + "offForeground": "colorDisabledForeground", + "onBackground": "#6FB460", + "onForeground": "colorForeground" + }, + "ToolBar": { + "darkShadow": "#78858B", + "floatingForeground": "colorShadow", + "highlight": "colorHighlight", + "light": "colorHighlight", + "shadow": "colorShadow" + }, + "Toolbar": { + "Floating": { + "background": "#EBE5D2" + } + }, + "ToolTip": { + "Actions": { + "background": "#E9E2CF", + "infoForeground": "#93A1A1" + }, + "background": "#F7F0DD", + "borderColor": "#A1ABA8", + "infoForeground": "#657B83", + "shortcutForeground": "#566C73" + }, + "Tooltip": { + "separatorColor": "colorSeparator" + }, + "ToolWindow": { + "Button": { + "hoverBackground": "#3B576025", + "selectedBackground": "#3B576050", + "selectedForeground": "#002B36" + }, + "Header": { + "background": "#DEDDD1", + "borderColor": "colorBorder", + "inactiveBackground": "colorBackground" + }, + "HeaderCloseButton": { + "background": "#ADB5AF" + }, + "HeaderTab": { + "selectedInactiveBackground": "#D3D2C6" + } + }, + "Tree": { + "background": "colorAlternativeBackground", + "errorForeground": "#F94A26", + "hash": "#E0DDCD", + "modifiedItemForeground": "#3961FA" + }, + "UiDesigner": { + "Panel": {}, + "Preview": {} + }, + "ValidationTooltip": { + "errorBackground": "#F2DED1", + "errorBorderColor": "#DDA195", + "warningBackground": "#F2E8D0", + "warningBorderColor": "#DDC794" + }, + "VersionControl": { + "FileHistory": { + "Commit": { + "selectedBranchBackground": "#FBF4C7" + } + }, + "GitLog": { + "headIconColor": "#EABE00", + "localBranchIconColor": "#2DA54A", + "otherIconColor": "#627880", + "remoteBranchIconColor": "#976EA1", + "tagIconColor": "#627880" + }, + "HgLog": { + "bookmarkIconColor": "#976EA1", + "branchIconColor": "#2DA54A", + "closedBranchIconColor": "#7B2A2D", + "headIconColor": "#832460", + "localTagIconColor": "#008687", + "mqTagIconColor": "#002C8B", + "tagIconColor": "#627880", + "tipIconColor": "#EABE00" + }, + "Log": { + "Commit": { + "currentBranchBackground": "#E3F2E4", + "unmatchedForeground": "#6B8086" + } + }, + "RefLabel": { + "backgroundBase": "#000118", + "foreground": "#627880" + } + }, + "Viewport": {}, + "WelcomeScreen": { + "background": "#F7F0DD", + "borderColor": "#B4BAB5", + "captionBackground": "#CCCDC1", + "captionForeground": "colorForeground", + "footerBackground": "#CCCDC1", + "footerForeground": "colorForeground", + "groupIconBorderColor": "#B4BAB5", + "headerBackground": "#D9D7CA", + "headerForeground": "#36525B", + "Projects": { + "background": "colorAlternativeBackground", + "selectionInactiveBackground": "#D7D5C7" + }, + "separatorColor": "#ECE5D3" + }, + "Window": { + "border": "colorBorder" + } + }, + "icons": { + "ColorPalette": { + "Actions.Red": "#DC322F", + "Actions.Yellow": "#B58900", + "Actions.Green": "#859900", + "Actions.Blue": "#268BD2", + "Actions.Grey": "#586E75", + "Actions.GreyInline": "#586E75", + "Objects.Grey": "#657B83", + "Objects.Blue": "#268BD2", + "Objects.Green": "#859900", + "Objects.Yellow": "#B58900", + "Objects.YellowDark": "#CB4B16", + "Objects.Purple": "#6C71C4", + "Objects.Pink": "#D33682", + "Objects.Red": "#DC322F", + "Objects.RedStatus": "#DC322F", + "Objects.BlackText": "#002B36FF", + "Objects.GreenAndroid": "#859900", + "Checkbox.Background.Default": "#FDF6E3", + "Checkbox.Border.Default": "#B4BAB5", + "Checkbox.Background.Selected": "#4984BE", + "Checkbox.Border.Selected": "#4984BE", + "Checkbox.Foreground.Selected": "#FDF6E3", + "Checkbox.Background.Disabled": "#EEE8D5", + "Checkbox.Border.Disabled": "#C6C7BD", + "Checkbox.Foreground.Disabled": "#C6C7BD", + "Checkbox.Focus.Thin.Default": "#86ABCB", + "Checkbox.Focus.Thin.Selected": "#86ABCB", + "Checkbox.Focus.Wide": "#86ABCB" + } + } +} \ No newline at end of file diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Spacegray.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Spacegray.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Spacegray.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Spacegray.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Spacegray.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Spacegray.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/Spacegray.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/Spacegray.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme-orange.theme.json similarity index 78% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme-orange.theme.json index 46e3fa3f..950e31f8 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme-orange.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme-orange.theme.json @@ -2,6 +2,7 @@ "name": "Arc Theme - Orange", "dark": false, "author": "Pavel Zlámal", + "editorScheme": "/arc-theme-light.xml", "ui": { @@ -15,8 +16,8 @@ }, "Borders": { - "color": "#e1e3e6", - "ContrastBorderColor": "#E1E3E6" + "color": "#C4C4C4", + "ContrastBorderColor": "#C4C4C4" }, "Button": { @@ -25,6 +26,8 @@ "endBorderColor": "#C4C4C4", "focusedBorderColor" : "#f57900", "background" : "#F5F5F5", + "startBackground" : "#fcfdfd", + "endBackground" : "#fcfdfd", "default": { "foreground": "#FFFFFF", "startBackground": "#f57900", @@ -36,6 +39,15 @@ } }, + "ActionButton.hoverBackground" : "#ffffff", + "ActionButton.hoverBorderColor" : "#C4C4C4", + "ActionButton.pressedBorderColor" : "#C4C4C4", + "ActionButton.pressedBackground" : "#ffffff", + "StatusBar.hoverBackground" : "#ffffff", + "StatusBar.borderColor" : "#C4C4C4", + "ToolBar.highlight" : "#ffffff", + "ToolBar.background" : "#F5F5F5", + "Popup.Toolbar.background" : "#F5F5F5", "Panel.background": "#F5F5F5", "Panel.foreground" : "#5c616c", "Window.border" : "1,1,1,1,#5c616c", @@ -53,7 +65,6 @@ "Group.separatorColor" : "#9ba2ab", "Tree.background" : "#ffffff", - "Tree.rowHeight": "23", "ProgressBar.background" : "#f57900", "ProgressBar.foreground" : "#f57900", @@ -91,6 +102,7 @@ "TabbedPane.underlineColor" : "#f57900", "TabbedPane.tabSelectionHeight" : 2, "TabbedPane.background" : "#F5F5F5", + "TabbedPane.hoverColor" : "#ffffff", "Link.hoverForeground" : "#f57900", "Link.activeForeground" : "#f57900", @@ -110,6 +122,18 @@ "Editor.background" : "#f5f5f5", "EditorPane.background" : "#ffffff", + "Component.borderColor" : "#C4C4C4", + "HelpTooltip.borderColor" : "#C4C4C4", + "InplaceRefactoringPopup.borderColor" : "#C4C4C4", + "NavBar.borderColor" : "#C4C4C4", + "ComboPopup.border": "#C4C4C4", + "Popup.Header.activeBackground" : "#e7e8eb", + "Popup.borderColor" : "#C4C4C4", + "Popup.inactiveBorderColor" : "#C4C4C4", + "Popup.Advertiser.borderColor" : "#C4C4C4", + "Popup.Toolbar.borderColor" : "#C4C4C4", + "SpeedSearch.borderColor" : "#C4C4C4", + "CheckBox.background" : "#F5F5F5", "RadioButton.background" : "#F5F5F5", "Slider.background" : "#F5F5F5", @@ -145,17 +169,25 @@ "ToolWindow.Header.background" : "#e7e8eb", "ToolWindow.HeaderTab.selectedBackground" : "#dddee1", - "ToolWindow.HeaderTab.hoverInactiveBackground" : "#dddee1", "ToolWindow.HeaderTab.selectedInactiveBackground" : "#dddee1", "ToolWindow.Button.selectedBackground" : "#dddee1", + "ToolWindow.Button.hoverBackground" : "#ffffff", "ToolWindow.HeaderTab.underlineHeight" : 2, "ToolWindow.HeaderTab.underlineColor" : "#f57900", + "ToolWindow.HeaderTab.underlinedTabBackground" : "#F5F5F500", + "ToolWindow.HeaderTab.hoverBackground" : "#F5F5F5", + "ToolWindow.HeaderTab.hoverInactiveBackground" : "#F5F5F5", "DefaultTabs.underlineHeight" : 2, "DefaultTabs.underlineColor" : "#f57900", + "DefaultTabs.underlinedTabBackground" : "#ffffff", "DefaultTabs.background" : "#F5F5F5", + "DefaultTabs.borderColor" : "#C4C4C4", + "DefaultTabs.hoverBackground" : "#ffffff90", "EditorTabs.underlineHeight" : 2, "EditorTabs.underlineColor" : "#f57900", "EditorTabs.background" : "#F5F5F5", + "EditorTabs.borderColor": "#C4C4C4", + "EditorTabs.hoverBackground" : "#ffffff", "Notification.background" : "#F5F5F5", "Notification.MoreButton.background" : "#dddee1", diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme.theme.json similarity index 77% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme.theme.json index 81539b35..0d6746e3 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-theme.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-theme.theme.json @@ -2,6 +2,7 @@ "name": "Arc Theme", "dark": false, "author": "Pavel Zlámal", + "editorScheme": "/arc-theme-light.xml", "ui": { @@ -15,8 +16,8 @@ }, "Borders": { - "color": "#e1e3e6", - "ContrastBorderColor": "#E1E3E6" + "color": "#C4C4C4", + "ContrastBorderColor": "#C4C4C4" }, "Button": { @@ -25,6 +26,8 @@ "endBorderColor": "#C4C4C4", "focusedBorderColor" : "#2679db", "background" : "#F5F5F5", + "startBackground" : "#fcfdfd", + "endBackground" : "#fcfdfd", "default": { "foreground": "#FFFFFF", "startBackground": "#2679db", @@ -36,6 +39,15 @@ } }, + "ActionButton.hoverBackground" : "#ffffff", + "ActionButton.hoverBorderColor" : "#C4C4C4", + "ActionButton.pressedBorderColor" : "#C4C4C4", + "ActionButton.pressedBackground" : "#ffffff", + "StatusBar.hoverBackground" : "#ffffff", + "StatusBar.borderColor" : "#C4C4C4", + "ToolBar.highlight" : "#ffffff", + "ToolBar.background" : "#F5F5F5", + "Popup.Toolbar.background" : "#F5F5F5", "Panel.background": "#F5F5F5", "Panel.foreground" : "#5c616c", "Window.border" : "1,1,1,1,#5c616c", @@ -53,7 +65,6 @@ "Group.separatorColor" : "#9ba2ab", "Tree.background" : "#ffffff", - "Tree.rowHeight": "23", "ProgressBar.background" : "#2679db", "ProgressBar.foreground" : "#2679db", @@ -91,6 +102,7 @@ "TabbedPane.underlineColor" : "#2679db", "TabbedPane.tabSelectionHeight" : 2, "TabbedPane.background" : "#F5F5F5", + "TabbedPane.hoverColor" : "#ffffff", "Link.hoverForeground" : "#2679db", "Link.activeForeground" : "#2679db", @@ -110,6 +122,18 @@ "Editor.background" : "#f5f5f5", "EditorPane.background" : "#ffffff", + "Component.borderColor" : "#C4C4C4", + "HelpTooltip.borderColor" : "#C4C4C4", + "InplaceRefactoringPopup.borderColor" : "#C4C4C4", + "NavBar.borderColor" : "#C4C4C4", + "ComboPopup.border": "#C4C4C4", + "Popup.Header.activeBackground" : "#e7e8eb", + "Popup.borderColor" : "#C4C4C4", + "Popup.inactiveBorderColor" : "#C4C4C4", + "Popup.Advertiser.borderColor" : "#C4C4C4", + "Popup.Toolbar.borderColor" : "#C4C4C4", + "SpeedSearch.borderColor" : "#C4C4C4", + "CheckBox.background" : "#F5F5F5", "RadioButton.background" : "#F5F5F5", "Slider.background" : "#F5F5F5", @@ -144,18 +168,26 @@ "ToolTip.Actions.background" : "#F5F5F5", "ToolWindow.Header.background" : "#e7e8eb", - "ToolWindow.HeaderTab.selectedBackground" : "#dddee1", - "ToolWindow.HeaderTab.hoverInactiveBackground" : "#dddee1", + "ToolWindow.HeaderTab.selectedBackground" : "#fcfdfd", "ToolWindow.HeaderTab.selectedInactiveBackground" : "#dddee1", "ToolWindow.Button.selectedBackground" : "#dddee1", + "ToolWindow.Button.hoverBackground" : "#ffffff", "ToolWindow.HeaderTab.underlineHeight" : 2, "ToolWindow.HeaderTab.underlineColor" : "#2679db", + "ToolWindow.HeaderTab.underlinedTabBackground" : "#F5F5F500", + "ToolWindow.HeaderTab.hoverBackground" : "#F5F5F5", + "ToolWindow.HeaderTab.hoverInactiveBackground" : "#F5F5F5", "DefaultTabs.underlineHeight" : 2, "DefaultTabs.underlineColor" : "#2679db", + "DefaultTabs.underlinedTabBackground" : "#ffffff", "DefaultTabs.background" : "#F5F5F5", + "DefaultTabs.borderColor" : "#C4C4C4", + "DefaultTabs.hoverBackground" : "#ffffff90", "EditorTabs.underlineHeight" : 2, "EditorTabs.underlineColor" : "#2679db", "EditorTabs.background" : "#F5F5F5", + "EditorTabs.borderColor": "#C4C4C4", + "EditorTabs.hoverBackground" : "#ffffff", "Notification.background" : "#F5F5F5", "Notification.MoreButton.background" : "#dddee1", diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-themes.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-themes.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/arc-themes.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc-themes.LICENSE.txt diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark.theme.json new file mode 100644 index 00000000..23250440 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark.theme.json @@ -0,0 +1,275 @@ +{ + "name": "Arc Theme Dark", + "dark": true, + "author": "Pavel Zlámal", + "editorScheme": "/arc-theme-dark.xml", + + "ui": { + + "*": { + "selectionBackground": "#2679db", + "selectionForeground": "#ffffff", + "selectionInactiveBackground": "#1e61b0", + "selectionBackgroundInactive": "#1e61b0", + "background" : "#383c4a", + "focusColor" : "#2679db", + "windowText" : "#d3dae3", + "darcula.foreground" : "#d3dae3" + }, + + "Borders": { + "color": "#2b2e39", + "ContrastBorderColor": "#2b2e39" + }, + + "Button": { + "shadowColor": "#383c4a20", + "startBorderColor": "#2b2e39", + "endBorderColor": "#2b2e39", + "focusedBorderColor" : "#2679db", + "background" : "#383c4a", + "startBackground" : "#474c5b", + "endBackground" : "#474c5b", + "default": { + "foreground": "#d3dae3", + "startBackground": "#2679db", + "endBackground": "#2679db", + "startBorderColor": "#2679db", + "endBorderColor": "#2679db", + "shadowColor": "#383c4a50", + "focusedBorderColor": "#2679db" + }, + "disabledBorderColor" : "#2b2e39", + "disabledText" : "#9ba2ab" + }, + + "ToolBar.background" : "#474c5b", + "ToolBar.highlight" : "#4e5467", + "Popup.Toolbar.borderColor" : "#2b2e39", + "ActionButton.hoverBorderColor" : "#2b2e39", + "ActionButton.hoverBackground" : "#4e5467", + "ActionButton.pressedBackground" : "#4e5467", + "ActionButton.pressedBorderColor" : "#2b2e39", + "StatusBar.hoverBackground" : "#4e5467", + "StatusBar.borderColor" : "#2b2e39", + "Popup.Toolbar.background" : "#474c5b", + "Panel.background": "#383c4a", + "Panel.foreground" : "#d3dae3", + "Window.border" : "1,1,1,1,#2b2e39", + "WelcomeScreen.background" : "#383c4a", + "WelcomeScreen.Projects.background" : "#474c5b", + + "MenuBar.foreground" : "#d3dae3", + "MenuBar.borderColor" : "#2b2e39", + "Menu.background" : "#383c4a", + "Menu.separatorColor" : "#2b2e39", + "Menu.foreground" : "#d3dae3", + "Menu.borderColor" : "#2b2e39", + "MenuItem.foreground" : "#d3dae3", + "MenuItem.background" : "#383c4a", + "MenuItem.acceleratorForeground" : "#d3dae3", + "MenuItem.disabledForeground" : "#9ba2ab", + "PopupMenuSeparator.height" : "2", + "Separator.separatorColor" : "#9ba2ab", + "Group.separatorColor" : "#9ba2ab", + + "Tree.background" : "#474c5b", + "Tree.foreground" : "#d3dae3", + + "ProgressBar.background" : "#2679db", + "ProgressBar.foreground" : "#2679db", + "ProgressBar.progressColor" : "#2679db", + "ProgressBar.indeterminateStartColor" : "#2679db", + "ProgressBar.indeterminateEndColor" : "#2679db", + + "Component.focusedBorderColor" : "#2679db", + "Component.focusColor" : "#2679db", + "Component.focusWidth" : "1", + "Component.arc" : "4", + "Button.arc" : "4", + + "SidePanel.background" : "#383C4ACC", + + "ParameterInfo.background" : "#fffae3", + "ParameterInfo.currentOverloadBackground" : "#fffae3", + + "List.background" : "#474c5b", + "List.dropLineColor" : "#2679db", + "List.selectionBackground": "#2679db", + "List.selectionForeground": "#ffffff", + "List.selectionInactiveBackground": "#1e61b0", + + "Table.background" : "#474c5b", + "Table.selectionBackground" : "#2679db", + "Table.selectionForeground" : "#ffffff", + "Table.lightSelectionBackground" : "#2679db", + "Table.lightSelectionForeground" : "#ffffff", + "Table.focusCellBackground" : "#2679db", + "Table.focusCellForeground" : "#ffffff", + "Table.dropLineColor": "#2679db", + "Table.dropLineShortColor": "#2679db", + "Table.gridColor" : "#383c4a", + + "TabbedPane.underlineColor" : "#2679db", + "TabbedPane.tabSelectionHeight" : 2, + "TabbedPane.background" : "#383c4a", + "TabbedPane.hoverColor" : "#474c5b", + + "Link.hoverForeground" : "#2679db", + "Link.activeForeground" : "#2679db", + "Link.pressedForeground" : "#2679db", + "Link.visitedForeground" : "#2679db", + "Link.secondaryForeground" : "#2679db", + "Hyperlink.linkColor" : "#2679db", + + "ComboBox.background" : "#474c5b", + "ComboBox.nonEditableBackground" : "#474c5b", + "ComboBox.ArrowButton.background" : "#474c5b", + "ComboBox.ArrowButton.nonEditableBackground" : "#474c5b", + "ComboBoxButton.background" : "#474c5b", + + "TextField.background" : "#474c5b", + "TextArea.background" : "#474c5b", + "TextPane.background" : "#474c5b", + "PasswordField.background" : "#474c5b", + "FormattedTextField.background" : "#474c5b", + "Editor.background" : "#474c5b", + "EditorPane.background" : "#474c5b", + + "Component.borderColor" : "#2b2e39", + "HelpTooltip.borderColor" : "#2b2e39", + "InplaceRefactoringPopup.borderColor" : "#2b2e39", + "NavBar.borderColor" : "#2b2e39", + "ComboPopup.border": "#2b2e39", + "Popup.Header.activeBackground" : "#383c4a", + "Popup.Header.inactiveBackground" : "#383c4a", + "Popup.borderColor" : "#2b2e39", + "Popup.inactiveBorderColor" : "#2b2e39", + "Popup.Advertiser.borderColor" : "#2b2e39", + "SpeedSearch.borderColor" : "#2b2e39", + + "CheckBox.background" : "#383c4a", + "RadioButton.background" : "#383c4a", + "Slider.background" : "#383c4a", + "Spinner.background" : "#383c4a", + "OptionPane.background" : "#383c4a", + + "CompletionPopup": { + "selectionBackground" : "#2679db55", + "nonFocusedMask": false, + "matchForeground": "#2679db", + "selectionInactiveBackground": "#1e61b0" + }, + + "Plugins.lightSelectionBackground" : "#4e5467", + "Plugins.SearchField.background" : "#4e5467", + "Plugins.background" : "#383c4a", + "Plugins.Button.installBackground" : "#2679db", + "Plugins.Button.installForeground" : "#ffffff", + "Plugins.Button.installBorderColor" : "#2679db", + "Plugins.Button.installFillBackground" : "#2679db", + "Plugins.Button.installFillForeground" : "#ffffff", + "Plugins.Button.updateBackground" : "#2679db", + "Plugins.Button.updateForeground" : "#ffffff", + "Plugins.Button.updateBorderColor" : "#2679db", + "Plugins.SearchField.borderColor" : "#2b2e39", + "Plugins.tagBackground" : "#4e5467", + "Plugins.eapTagBackground" : "#4e5467", + "Counter.background" : "#ffffff", + "Counter.foreground" : "#5c616c", + + "SearchEverywhere.SearchField.background" : "#4e5467", + "SearchEverywhere.Header.background" : "#383c4a", + "SearchEverywhere.Tab.selectedBackground" : "#4e5467", + "SearchEverywhere.Advertiser.foreground" : "#d3dae3", + "SearchEverywhere.List.separatorColor" : "#d3dae3", + "SearchEverywhere.List.separatorForeground" : "#d3dae3", + "SearchEverywhere.SearchField.borderColor" : "#2b2e39", + + "ToolTip.background" : "#4e5467", + "ToolTip.Actions.background" : "#383c4a", + "ToolTip.borderColor" : "#2b2e39", + "ToolTip.foreground" : "#d3dae3", + "Tooltip.separatorColor" : "#2b2e39", + + "ToolWindow.Header.background" : "#383C4ACC", + "ToolWindow.Header.inactiveBackground" : "#383c4a", + "ToolWindow.HeaderTab.selectedBackground" : "#4e5467", + "ToolWindow.HeaderTab.hoverInactiveBackground" : "#4e5467", + "ToolWindow.HeaderTab.selectedInactiveBackground" : "#4e5467", + "ToolWindow.HeaderTab.underlineHeight" : 2, + "ToolWindow.HeaderTab.underlinedTabBackground" : "#383c4a", + "ToolWindow.HeaderTab.underlineColor" : "#2679db", + "ToolWindow.Button.selectedBackground" : "#474c5b", + "ToolWindow.Button.hoverBackground" : "#4e5467", + "DefaultTabs.underlineHeight" : 2, + "DefaultTabs.underlineColor" : "#2679db", + "DefaultTabs.background" : "#383c4a", + "DefaultTabs.underlinedTabForeground" : "#d3dae3", + "DefaultTabs.underlinedTabBackground" : "#474c5b", + "DefaultTabs.hoverBackground" : "#4e5467", + "EditorTabs.underlinedTabBackground" : "#474c5b99", + "EditorTabs.underlineHeight" : 2, + "EditorTabs.underlineColor" : "#2679db", + "EditorTabs.background" : "#383c4a", + "EditorTabs.underlinedTabForeground" : "#d3dae3", + "EditorTabs.hoverBackground" : "#4e5467", + + "Notification.background" : "#4e5467", + "Notification.MoreButton.background" : "#383c4a", + "Notification.borderColor" : "#2b2e39", + "ScrollBar.background" : "#4e5467", + + "Label.foreground" : "#d3dae3", + "Label.disabledForeground" : "#9ba2ab", + "Label.disabledText" : "#9ba2ab", + + "MemoryIndicator.allocatedBackground" : "#474c5b", + "MemoryIndicator.usedBackground" : "#4e5467", + + "FileColor.Blue" : "#111d53", + "FileColor.Green" : "#155221", + "FileColor.Orange" : "#522911", + "FileColor.Rose" : "#581226", + "FileColor.Violet" : "#411357", + "FileColor.Yellow" : "#5c4814", + + "Component.infoForeground" : "#9ba2ab", + "SearchEverywhere.SearchField.infoForeground" : "#9ba2ab", + + "ColorChooser.background" : "#383c4a", + "Popup.innerBorderColor" : "#383c4a", + "InformationHint.borderColor" : "#383c4a" + + }, + + "icons": { + + "ColorPalette": { + + "Checkbox.Focus.Wide.Dark": "#2679db", + "Checkbox.Focus.Thin.Selected.Dark": "#2679db", + "Checkbox.Focus.Thin.Default.Dark": "#2679db", + "Checkbox.Background.Default.Dark": "#474c5b", + "Checkbox.Background.Disabled.Dark": "#383c4a", + "Checkbox.Background.Selected.Dark": "#474c5b", + "Checkbox.Foreground.Selected.Dark": "#ffffff", + "Checkbox.Border.Default.Dark": "#2b2e39", + "Checkbox.Border.Disabled.Dark": "#2b2e39", + "Checkbox.Border.Selected.Dark": "#2b2e39", + + "#43494A": "#383c4a", + "#6B6B6B": "#8b9eb5", + "#A7A7A7": "#8b9eb5", + "#3D6185": "#42A5F5", + "#466D94": "#42A5F5", + "#3C3F41": "#4e5467", + "#545556": "#D3DAE3", + "#606060": "#D3DAE3", + "#9AA7B0": "#8b9eb5" + + } + + } + +} diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark_orange.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark_orange.theme.json new file mode 100644 index 00000000..ef69243b --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/arc_theme_dark_orange.theme.json @@ -0,0 +1,273 @@ +{ + "name": "Arc Theme Dark - Orange", + "dark": true, + "author": "Pavel Zlámal", + "editorScheme": "/arc-theme-dark.xml", + + "ui": { + + "*": { + "selectionBackground": "#f57900", + "selectionForeground": "#ffffff", + "selectionInactiveBackground": "#C36200", + "selectionBackgroundInactive": "#C36200", + "background" : "#383c4a", + "focusColor" : "#f57900", + "windowText" : "#d3dae3", + "darcula.foreground" : "#d3dae3" + }, + + "Borders": { + "color": "#2b2e39", + "ContrastBorderColor": "#2b2e39" + }, + + "Button": { + "shadowColor": "#383c4a20", + "startBorderColor": "#2b2e39", + "endBorderColor": "#2b2e39", + "focusedBorderColor" : "#f57900", + "background" : "#383c4a", + "startBackground" : "#474c5b", + "endBackground" : "#474c5b", + "default": { + "foreground": "#d3dae3", + "startBackground": "#f57900", + "endBackground": "#f57900", + "startBorderColor": "#f57900", + "endBorderColor": "#f57900", + "shadowColor": "#383c4a50", + "focusedBorderColor": "#f57900" + }, + "disabledBorderColor" : "#2b2e39", + "disabledText" : "#9ba2ab" + }, + + "ToolBar.background" : "#474c5b", + "ToolBar.highlight" : "#4e5467", + "Popup.Toolbar.borderColor" : "#2b2e39", + "ActionButton.hoverBorderColor" : "#2b2e39", + "ActionButton.hoverBackground" : "#4e5467", + "ActionButton.pressedBackground" : "#4e5467", + "ActionButton.pressedBorderColor" : "#2b2e39", + "StatusBar.hoverBackground" : "#4e5467", + "StatusBar.borderColor" : "#2b2e39", + "Popup.Toolbar.background" : "#474c5b", + "Panel.background": "#383c4a", + "Panel.foreground" : "#d3dae3", + "Window.border" : "1,1,1,1,#2b2e39", + "WelcomeScreen.background" : "#383c4a", + "WelcomeScreen.Projects.background" : "#474c5b", + + "MenuBar.foreground" : "#d3dae3", + "MenuBar.borderColor" : "#2b2e39", + "Menu.background" : "#383c4a", + "Menu.separatorColor" : "#2b2e39", + "Menu.foreground" : "#d3dae3", + "Menu.borderColor" : "#2b2e39", + "MenuItem.foreground" : "#d3dae3", + "MenuItem.background" : "#383c4a", + "MenuItem.acceleratorForeground" : "#d3dae3", + "MenuItem.disabledForeground" : "#9ba2ab", + "PopupMenuSeparator.height" : "2", + "Separator.separatorColor" : "#9ba2ab", + "Group.separatorColor" : "#9ba2ab", + + "Tree.background" : "#474c5b", + "Tree.foreground" : "#d3dae3", + + "ProgressBar.background" : "#f57900", + "ProgressBar.foreground" : "#f57900", + "ProgressBar.progressColor" : "#f57900", + "ProgressBar.indeterminateStartColor" : "#f57900", + "ProgressBar.indeterminateEndColor" : "#f57900", + + "Component.focusedBorderColor" : "#f57900", + "Component.focusColor" : "#f57900", + "Component.focusWidth" : "1", + "Component.arc" : "4", + "Button.arc" : "4", + + "SidePanel.background" : "#383C4ACC", + + "ParameterInfo.background" : "#fffae3", + "ParameterInfo.currentOverloadBackground" : "#fffae3", + + "List.background" : "#474c5b", + "List.dropLineColor" : "#f57900", + "List.selectionBackground": "#f57900", + "List.selectionForeground": "#ffffff", + "List.selectionInactiveBackground": "#C36200", + + "Table.background" : "#474c5b", + "Table.selectionBackground" : "#f57900", + "Table.selectionForeground" : "#ffffff", + "Table.lightSelectionBackground" : "#f57900", + "Table.lightSelectionForeground" : "#ffffff", + "Table.focusCellBackground" : "#f57900", + "Table.focusCellForeground" : "#ffffff", + "Table.dropLineColor": "#f57900", + "Table.dropLineShortColor": "#f57900", + + "TabbedPane.underlineColor" : "#f57900", + "TabbedPane.tabSelectionHeight" : 2, + "TabbedPane.background" : "#383c4a", + "TabbedPane.hoverColor" : "#474c5b", + + "Link.hoverForeground" : "#f57900", + "Link.activeForeground" : "#f57900", + "Link.pressedForeground" : "#f57900", + "Link.visitedForeground" : "#f57900", + "Link.secondaryForeground" : "#f57900", + "Hyperlink.linkColor" : "#f57900", + + "ComboBox.background" : "#474c5b", + "ComboBox.nonEditableBackground" : "#474c5b", + "ComboBox.ArrowButton.background" : "#474c5b", + "ComboBox.ArrowButton.nonEditableBackground" : "#474c5b", + "ComboBoxButton.background" : "#474c5b", + + "TextField.background" : "#474c5b", + "TextArea.background" : "#474c5b", + "TextPane.background" : "#474c5b", + "PasswordField.background" : "#474c5b", + "FormattedTextField.background" : "#474c5b", + "Editor.background" : "#474c5b", + "EditorPane.background" : "#474c5b", + + "Component.borderColor" : "#2b2e39", + "HelpTooltip.borderColor" : "#2b2e39", + "InplaceRefactoringPopup.borderColor" : "#2b2e39", + "NavBar.borderColor" : "#2b2e39", + "ComboPopup.border": "#2b2e39", + "Popup.Header.activeBackground" : "#383c4a", + "Popup.Header.inactiveBackground" : "#383c4a", + "Popup.borderColor" : "#2b2e39", + "Popup.inactiveBorderColor" : "#383c4a", + "Popup.Advertiser.borderColor" : "#383c4a", + "SpeedSearch.borderColor" : "#2b2e39", + + "CheckBox.background" : "#383c4a", + "RadioButton.background" : "#383c4a", + "Slider.background" : "#383c4a", + "Spinner.background" : "#383c4a", + "OptionPane.background" : "#383c4a", + + "CompletionPopup": { + "selectionBackground" : "#f5790055", + "nonFocusedMask": false, + "matchForeground": "#f57900", + "selectionInactiveBackground": "#C36200" + }, + + "Plugins.lightSelectionBackground" : "#4e5467", + "Plugins.SearchField.background" : "#4e5467", + "Plugins.background" : "#383c4a", + "Plugins.Button.installBackground" : "#f57900", + "Plugins.Button.installForeground" : "#ffffff", + "Plugins.Button.installBorderColor" : "#f57900", + "Plugins.Button.installFillBackground" : "#f57900", + "Plugins.Button.installFillForeground" : "#ffffff", + "Plugins.Button.updateBackground" : "#f57900", + "Plugins.Button.updateForeground" : "#ffffff", + "Plugins.Button.updateBorderColor" : "#f57900", + "Plugins.SearchField.borderColor" : "#2b2e39", + "Plugins.tagBackground" : "#4e5467", + "Plugins.eapTagBackground" : "#4e5467", + "Counter.background" : "#ffffff", + "Counter.foreground" : "#5c616c", + + "SearchEverywhere.SearchField.background" : "#4e5467", + "SearchEverywhere.Header.background" : "#383c4a", + "SearchEverywhere.Tab.selectedBackground" : "#4e5467", + "SearchEverywhere.Advertiser.foreground" : "#d3dae3", + "SearchEverywhere.List.separatorColor" : "#d3dae3", + "SearchEverywhere.List.separatorForeground" : "#d3dae3", + "SearchEverywhere.SearchField.borderColor" : "#2b2e39", + + "ToolTip.background" : "#4e5467", + "ToolTip.Actions.background" : "#383c4a", + "ToolTip.borderColor" : "#2b2e39", + "ToolTip.foreground" : "#d3dae3", + "Tooltip.separatorColor" : "#2b2e39", + + "ToolWindow.Header.background" : "#383C4ACC", + "ToolWindow.Header.inactiveBackground" : "#383c4a", + "ToolWindow.HeaderTab.selectedBackground" : "#4e5467", + "ToolWindow.HeaderTab.hoverInactiveBackground" : "#4e5467", + "ToolWindow.HeaderTab.selectedInactiveBackground" : "#4e5467", + "ToolWindow.HeaderTab.underlineHeight" : 2, + "ToolWindow.HeaderTab.underlinedTabBackground" : "#383c4a", + "ToolWindow.HeaderTab.underlineColor" : "#f57900", + "ToolWindow.Button.selectedBackground" : "#474c5b", + "ToolWindow.Button.hoverBackground" : "#4e5467", + "DefaultTabs.underlineHeight" : 2, + "DefaultTabs.underlineColor" : "#f57900", + "DefaultTabs.background" : "#383c4a", + "DefaultTabs.underlinedTabForeground" : "#d3dae3", + "DefaultTabs.underlinedTabBackground" : "#474c5b", + "DefaultTabs.hoverBackground" : "#4e5467", + "EditorTabs.underlinedTabBackground" : "#474c5b99", + "EditorTabs.underlineHeight" : 2, + "EditorTabs.underlineColor" : "#f57900", + "EditorTabs.background" : "#383c4a", + "EditorTabs.underlinedTabForeground" : "#d3dae3", + "EditorTabs.hoverBackground" : "#4e5467", + + "Notification.background" : "#4e5467", + "Notification.MoreButton.background" : "#383c4a", + "Notification.borderColor" : "#2b2e39", + "ScrollBar.background" : "#4e5467", + + "Label.foreground" : "#d3dae3", + "Label.disabledForeground" : "#9ba2ab", + "Label.disabledText" : "#9ba2ab", + + "MemoryIndicator.allocatedBackground" : "#474c5b", + "MemoryIndicator.usedBackground" : "#4e5467", + + "FileColor.Blue" : "#111d53", + "FileColor.Green" : "#155221", + "FileColor.Orange" : "#522911", + "FileColor.Rose" : "#581226", + "FileColor.Violet" : "#411357", + "FileColor.Yellow" : "#5c4814", + + "Component.infoForeground" : "#9ba2ab", + "SearchEverywhere.SearchField.infoForeground" : "#9ba2ab", + + "ColorChooser.background" : "#383c4a", + "Popup.innerBorderColor" : "#383c4a", + "InformationHint.borderColor" : "#383c4a" + + }, + + "icons": { + + "ColorPalette": { + + "Checkbox.Focus.Wide.Dark": "#f57900", + "Checkbox.Focus.Thin.Selected.Dark": "#f57900", + "Checkbox.Focus.Thin.Default.Dark": "#f57900", + "Checkbox.Background.Default.Dark": "#474c5b", + "Checkbox.Background.Disabled.Dark": "#383c4a", + "Checkbox.Background.Selected.Dark": "#474c5b", + "Checkbox.Foreground.Selected.Dark": "#ffffff", + "Checkbox.Border.Default.Dark": "#2b2e39", + "Checkbox.Border.Disabled.Dark": "#2b2e39", + "Checkbox.Border.Selected.Dark": "#2b2e39", + + "#43494A": "#383c4a", + "#6B6B6B": "#8b9eb5", + "#A7A7A7": "#8b9eb5", + "#3D6185": "#f57900", + "#466D94": "#f57900", + "#3C3F41": "#4e5467", + "#545556": "#D3DAE3", + "#606060": "#D3DAE3", + "#9AA7B0": "#8b9eb5" + + } + } + +} diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_hard.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_hard.theme.json new file mode 100644 index 00000000..008d26e4 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_hard.theme.json @@ -0,0 +1,164 @@ +{ + "name": "Gruvbox Dark Hard", + "dark": true, + "author": "Vincent Parizet", + "editorScheme": "/gruvbox_dark_hard.xml", + "colors": { + "bg0": "#282828", + "bg0_hh": "#101415", + "bg0_h": "#1d2021", + "bg0_s": "#32302f", + "bg1": "#3c3836", + "bg2": "#504945", + "bg3": "#665c54", + "bg4": "#7c6f64", + "bg": "#1d2021", + + "fg0": "#fbf1c7", + "fg1": "#ebdbb2", + "fg2": "#d5c4a1", + "fg3": "#bdae93", + "fg4": "#a89984", + "fg": "#ebdbb2", + + "red0": "#cc241d", + "red1": "#fb4934", + "green0": "#98971a", + "green1": "#b8bb26", + "yellow0": "#d79921", + "yellow1": "#fabd2f", + "blue0": "#458588", + "blue1": "#83a598", + "purple0": "#b16286", + "purple1": "#d3869b", + "aqua0": "#689d6a", + "aqua1": "#8ec07c", + "gray0": "#a89984", + "gray1": "#928374", + "orange0": "#d65d0e", + "orange1": "#fe8019" + }, + "ui": { + "*": { + "background": "bg", + "foreground": "fg", + + "infoForeground": "fg", + + "lightSelectionBackground": "bg1", + "selectionBackground": "#4F4945", + "selectionForeground": "fg0", + + "selectionBackgroundInactive": "bg0_s", + "selectionInactiveBackground": "bg0_s", + + "selectedBackground": "bg0_hh", + "selectedForeground": "fg0", + "selectedInactiveBackground": "bg0_s", + "selectedBackgroundInactive": "bg0_s", + + "hoverBackground": "#28282866", + + "borderColor": "bg2", + "disabledBorderColor": "bg0_hh", + + "separatorColor": "bg2" + }, + "ActionButton": { + "hoverBackground": "bg2" + }, + "Button": { + "startBackground": "bg", + "endBackground": "bg", + "startBorderColor": "bg2", + "endBorderColor": "bg2", + + "default": { + "foreground": "fg0", + "startBackground": "#32302F", + "endBackground": "#32302F", + "startBorderColor": "#4F4945", + "endBorderColor": "#4F4945", + "focusedBorderColor": "bg" + } + }, + "ComboBox": { + "nonEditableBackground": "bg", + "ArrowButton": { + "iconColor": "fg0", + "disabledIconColor": "fg0", + "nonEditableBackground": "bg" + } + }, + "EditorTabs": { + "selectedBackground": "bg0_s", + "underlinedTabBackground": "bg2", + "underlineColor": "blue1", + "inactiveMaskColor": "#28282866" + }, + "ToolWindow": { + "Header": { + "background": "bg0_s", + "inactiveBackground": "bg" + }, + + "HeaderTab": { + "selectedInactiveBackground": "bg0_hh", + "hoverInactiveBackground": "bg0_hh" + } + }, + "Table": { + "stripeColor": "bg0_s", + "lightSelectionForeground": "fg0", + "lightSelectionInactiveForeground":"fg4", + "lightSelectionBackground": "bg2", + "lightSelectionInactiveBackground":"bg" + }, + "FileColor": { + "Yellow": "#fabd2f22", + "Green": "#b8bb2622", + "Blue": "#83a59822", + "Violet": "#d3869b22", + "Orange": "#fe801922", + "Rose": "#cc241d22" + }, + "Link": { + "activeForeground": "blue1", + "hoverForeground": "blue1", + "pressedForeground": "blue1", + "visitedForeground": "blue1" + } + }, + "icons": { + "ColorPalette": { + "Actions.Grey": "#928374", + "Actions.Red": "#fb4934", + "Actions.Yellow": "#fabd2f", + "Actions.Green": "#98971a", + "Actions.Blue": "#458588", + "Actions.GreyInline.Dark": "#fbf1c7", + + "Objects.Grey": "#928374FF", + "Objects.RedStatus": "#fb4934FF", + "Objects.Red": "#fb4934FF", + "Objects.Pink": "#d3869bFF", + "Objects.Yellow": "#fabd2fFF", + "Objects.Green": "#98971aFF", + "Objects.Blue": "#458588FF", + "Objects.Purple": "#b16286FF", + "Objects.BlackText": "#000000FF", + "Objects.YellowDark": "#d79921FF", + "Objects.GreenAndroid": "#b8bb26FF", + + "Checkbox.Background.Default.Dark": "#282828", + "Checkbox.Border.Default.Dark": "#fbf1c7", + "Checkbox.Foreground.Selected.Dark": "#fbf1c7", + "Checkbox.Focus.Wide.Dark": "#458588", + "Checkbox.Focus.Thin.Default.Dark": "#458588", + "Checkbox.Focus.Thin.Selected.Dark": "#458588", + "Checkbox.Background.Disabled.Dark": "#282828", + "Checkbox.Border.Disabled.Dark": "#a89984", + "Checkbox.Foreground.Disabled.Dark": "#a89984" + } + } +} diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_medium.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_medium.theme.json new file mode 100644 index 00000000..6dcfcaa6 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_medium.theme.json @@ -0,0 +1,163 @@ +{ + "name": "Gruvbox Dark Medium", + "dark": true, + "author": "Vincent Parizet", + "editorScheme": "/gruvbox_dark_medium.xml", + "colors": { + "bg0": "#282828", + "bg0_h": "#1d2021", + "bg0_s": "#32302f", + "bg1": "#3c3836", + "bg2": "#504945", + "bg3": "#665c54", + "bg4": "#7c6f64", + "bg": "#282828", + + "fg0": "#fbf1c7", + "fg1": "#ebdbb2", + "fg2": "#d5c4a1", + "fg3": "#bdae93", + "fg4": "#a89984", + "fg": "#ebdbb2", + + "red0": "#cc241d", + "red1": "#fb4934", + "green0": "#98971a", + "green1": "#b8bb26", + "yellow0": "#d79921", + "yellow1": "#fabd2f", + "blue0": "#458588", + "blue1": "#83a598", + "purple0": "#b16286", + "purple1": "#d3869b", + "aqua0": "#689d6a", + "aqua1": "#8ec07c", + "gray0": "#a89984", + "gray1": "#928374", + "orange0": "#d65d0e", + "orange1": "#fe8019" + }, + "ui": { + "*": { + "background": "bg", + "foreground": "fg", + + "infoForeground": "fg", + + "lightSelectionBackground": "bg1", + "selectionBackground": "#4F4945", + "selectionForeground": "fg0", + + "selectionBackgroundInactive": "bg0_s", + "selectionInactiveBackground": "bg0_s", + + "selectedBackground": "bg0_h", + "selectedForeground": "fg0", + "selectedInactiveBackground": "bg0_s", + "selectedBackgroundInactive": "bg0_s", + + "hoverBackground": "#28282866", + + "borderColor": "bg2", + "disabledBorderColor": "bg0_h", + + "separatorColor": "bg2" + }, + "ActionButton": { + "hoverBackground": "bg2" + }, + "Button": { + "startBackground": "bg", + "endBackground": "bg", + "startBorderColor": "bg2", + "endBorderColor": "bg2", + + "default": { + "foreground": "fg0", + "startBackground": "#32302F", + "endBackground": "#32302F", + "startBorderColor": "#4F4945", + "endBorderColor": "#4F4945", + "focusedBorderColor": "bg" + } + }, + "ComboBox": { + "nonEditableBackground": "bg", + "ArrowButton": { + "iconColor": "fg0", + "disabledIconColor": "fg0", + "nonEditableBackground": "bg" + } + }, + "EditorTabs": { + "selectedBackground": "bg0_s", + "underlinedTabBackground": "bg2", + "underlineColor": "blue1", + "inactiveMaskColor": "#28282866" + }, + "ToolWindow": { + "Header": { + "background": "bg0_s", + "inactiveBackground": "bg" + }, + + "HeaderTab": { + "selectedInactiveBackground": "bg0_h", + "hoverInactiveBackground": "bg0_h" + } + }, + "Table": { + "stripeColor": "bg0_s", + "lightSelectionForeground": "fg0", + "lightSelectionInactiveForeground":"fg4", + "lightSelectionBackground": "bg2", + "lightSelectionInactiveBackground":"bg" + }, + "FileColor": { + "Yellow": "#fabd2f22", + "Green": "#b8bb2622", + "Blue": "#83a59822", + "Violet": "#d3869b22", + "Orange": "#fe801922", + "Rose": "#cc241d22" + }, + "Link": { + "activeForeground": "blue1", + "hoverForeground": "blue1", + "pressedForeground": "blue1", + "visitedForeground": "blue1" + } + }, + "icons": { + "ColorPalette": { + "Actions.Grey": "#928374", + "Actions.Red": "#fb4934", + "Actions.Yellow": "#fabd2f", + "Actions.Green": "#98971a", + "Actions.Blue": "#458588", + "Actions.GreyInline.Dark": "#fbf1c7", + + "Objects.Grey": "#928374FF", + "Objects.RedStatus": "#fb4934FF", + "Objects.Red": "#fb4934FF", + "Objects.Pink": "#d3869bFF", + "Objects.Yellow": "#fabd2fFF", + "Objects.Green": "#98971aFF", + "Objects.Blue": "#458588FF", + "Objects.Purple": "#b16286FF", + "Objects.BlackText": "#000000FF", + "Objects.YellowDark": "#d79921FF", + "Objects.GreenAndroid": "#b8bb26FF", + + "Checkbox.Background.Default.Dark": "#282828", + "Checkbox.Border.Default.Dark": "#fbf1c7", + "Checkbox.Foreground.Selected.Dark": "#fbf1c7", + "Checkbox.Focus.Wide.Dark": "#458588", + "Checkbox.Focus.Thin.Default.Dark": "#458588", + "Checkbox.Focus.Thin.Selected.Dark": "#458588", + "Checkbox.Background.Disabled.Dark": "#282828", + "Checkbox.Border.Disabled.Dark": "#a89984", + "Checkbox.Foreground.Disabled.Dark": "#a89984" + } + } +} diff --git a/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_soft.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_soft.theme.json new file mode 100644 index 00000000..079a2e86 --- /dev/null +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_dark_soft.theme.json @@ -0,0 +1,163 @@ +{ + "name": "Gruvbox Dark Soft", + "dark": true, + "author": "Vincent Parizet", + "editorScheme": "/gruvbox_dark_soft.xml", + "colors": { + "bg0": "#282828", + "bg0_h": "#1d2021", + "bg0_s": "#32302f", + "bg1": "#3c3836", + "bg2": "#504945", + "bg3": "#665c54", + "bg4": "#7c6f64", + "bg": "#32302f", + + "fg0": "#fbf1c7", + "fg1": "#ebdbb2", + "fg2": "#d5c4a1", + "fg3": "#bdae93", + "fg4": "#a89984", + "fg": "#ebdbb2", + + "red0": "#cc241d", + "red1": "#fb4934", + "green0": "#98971a", + "green1": "#b8bb26", + "yellow0": "#d79921", + "yellow1": "#fabd2f", + "blue0": "#458588", + "blue1": "#83a598", + "purple0": "#b16286", + "purple1": "#d3869b", + "aqua0": "#689d6a", + "aqua1": "#8ec07c", + "gray0": "#a89984", + "gray1": "#928374", + "orange0": "#d65d0e", + "orange1": "#fe8019" + }, + "ui": { + "*": { + "background": "bg", + "foreground": "fg", + + "infoForeground": "fg", + + "lightSelectionBackground": "bg1", + "selectionBackground": "#4F4945", + "selectionForeground": "fg0", + + "selectionBackgroundInactive": "bg0_s", + "selectionInactiveBackground": "bg0_s", + + "selectedBackground": "bg0_h", + "selectedForeground": "fg0", + "selectedInactiveBackground": "bg0_s", + "selectedBackgroundInactive": "bg0_s", + + "hoverBackground": "#28282866", + + "borderColor": "bg2", + "disabledBorderColor": "bg0_h", + + "separatorColor": "bg2" + }, + "ActionButton": { + "hoverBackground": "bg2" + }, + "Button": { + "startBackground": "bg", + "endBackground": "bg", + "startBorderColor": "bg2", + "endBorderColor": "bg2", + + "default": { + "foreground": "fg0", + "startBackground": "#32302F", + "endBackground": "#32302F", + "startBorderColor": "#4F4945", + "endBorderColor": "#4F4945", + "focusedBorderColor": "bg" + } + }, + "ComboBox": { + "nonEditableBackground": "bg", + "ArrowButton": { + "iconColor": "fg0", + "disabledIconColor": "fg0", + "nonEditableBackground": "bg" + } + }, + "EditorTabs": { + "selectedBackground": "bg0_s", + "underlinedTabBackground": "bg2", + "underlineColor": "blue1", + "inactiveMaskColor": "#28282866" + }, + "ToolWindow": { + "Header": { + "background": "bg0_s", + "inactiveBackground": "bg" + }, + + "HeaderTab": { + "selectedInactiveBackground": "bg0_h", + "hoverInactiveBackground": "bg0_h" + } + }, + "Table": { + "stripeColor": "bg0_s", + "lightSelectionForeground": "fg0", + "lightSelectionInactiveForeground":"fg4", + "lightSelectionBackground": "bg2", + "lightSelectionInactiveBackground":"bg" + }, + "FileColor": { + "Yellow": "#fabd2f22", + "Green": "#b8bb2622", + "Blue": "#83a59822", + "Violet": "#d3869b22", + "Orange": "#fe801922", + "Rose": "#cc241d22" + }, + "Link": { + "activeForeground": "blue1", + "hoverForeground": "blue1", + "pressedForeground": "blue1", + "visitedForeground": "blue1" + } + }, + "icons": { + "ColorPalette": { + "Actions.Grey": "#928374", + "Actions.Red": "#fb4934", + "Actions.Yellow": "#fabd2f", + "Actions.Green": "#98971a", + "Actions.Blue": "#458588", + "Actions.GreyInline.Dark": "#fbf1c7", + + "Objects.Grey": "#928374FF", + "Objects.RedStatus": "#fb4934FF", + "Objects.Red": "#fb4934FF", + "Objects.Pink": "#d3869bFF", + "Objects.Yellow": "#fabd2fFF", + "Objects.Green": "#98971aFF", + "Objects.Blue": "#458588FF", + "Objects.Purple": "#b16286FF", + "Objects.BlackText": "#000000FF", + "Objects.YellowDark": "#d79921FF", + "Objects.GreenAndroid": "#b8bb26FF", + + "Checkbox.Background.Default.Dark": "#282828", + "Checkbox.Border.Default.Dark": "#fbf1c7", + "Checkbox.Foreground.Selected.Dark": "#fbf1c7", + "Checkbox.Focus.Wide.Dark": "#458588", + "Checkbox.Focus.Thin.Default.Dark": "#458588", + "Checkbox.Focus.Thin.Selected.Dark": "#458588", + "Checkbox.Background.Disabled.Dark": "#282828", + "Checkbox.Border.Disabled.Dark": "#a89984", + "Checkbox.Foreground.Disabled.Dark": "#a89984" + } + } +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/gruvbox_theme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_theme.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/gruvbox_theme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/gruvbox_theme.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark Contrast.theme.json index 32924dbe..4516c784 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#42A5F550", "hoverBorderColor": "#42A5F550", + "hoverSeparatorColor": "#383C4A", + "focusedBorderColor": "#42A5F550", "pressedBackground": "#42A5F550", "pressedBorderColor": "#42A5F550" }, @@ -66,6 +68,11 @@ "shadowColor": "#383C4A", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#404552", + "Tooltip.background": "#262a33" + }, + "Content.background": "#262b33", "CheckBox": { "background": "#2f343f", "disabledText": "#D3DAE3", @@ -161,6 +168,7 @@ "hoverBackground": "#41416A", "hoverColor": "#262b33", "hoverMaskColor": "#08507C", + "inactiveColoredFileBackground": "#383C4A", "inactiveUnderlineColor": "#D3DAE3", "inactiveMaskColor": "#262b33", "underlineColor": "#42A5F5", @@ -193,6 +201,7 @@ "hoverColor": "#08507C", "hoverMaskColor": "#08507C", "inactiveMaskColor": "#2f343f", + "inactiveColoredFileBackground": "#2f343f2", "inactiveUnderlineColor": "#D3DAE3", "selectedForeground": "#D3DAE3", "selectedBackground": "#41416A", @@ -288,13 +297,14 @@ "secondaryForeground": "#8b9eb5", "visitedForeground": "#42A5F5" }, + "link.foreground": "#42A5F5", "List": { "background": "#393f4c", "foreground": "#D3DAE3", "selectionBackground": "#8888FF50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#09477125" + "selectionInactiveBackground": "#09477170" }, "material": { "background": "#2f343f", @@ -360,6 +370,7 @@ "background": "#262b33" } }, + "NewPSD.warning": "#42A5F5", "Notification": { "background": "#262a33", "borderColor": "#262a33", @@ -387,7 +398,9 @@ "messageForeground": "#D3DAE3" }, "Outline": { - "color": "#383C4A" + "color": "#383C4A", + "focusedColor": "#42A5F5", + "disabledColor": "#D3DAE3" }, "Panel": { "background": "#2f343f", @@ -417,15 +430,17 @@ "disabledForeground": "#D3DAE3", "eapTagBackground": "#08507C", "lightSelectionBackground": "#8888FF", + "paidTagBackground": "#08507C", "selectionBackground": "#8888FF", "tagForeground": "#42A5F5", "tagBackground": "#08507C", + "trialTagBackground": "#08507C", "Button": { "installBackground": "#383C4A", "installBorderColor": "#383C4A", "installForeground": "#D3DAE3", "installFocusedBackground": "#08507C", - "installFillForeground": "#8b9eb5", + "installFillForeground": "#D3DAE3", "installFillBackground": "#383C4A", "updateBackground": "#383C4A", "updateBorderColor": "#383C4A", @@ -462,6 +477,7 @@ "separatorForeground": "#D3DAE3", "separatorColor": "#393f4c", "Toolbar": { + "Floating.background": "#262b33", "background": "#262b33", "borderColor": "#262b33" } @@ -483,6 +499,9 @@ "selectionBackground": "#08507C", "trackColor": "#08507C" }, + "PsiViewer": { + "referenceHighlightColor": "#42A5F5" + }, "RadioButton": { "background": "#2f343f", "disabledText": "#D3DAE3", @@ -559,6 +578,7 @@ "endBackground": "#42A5F5", "startBackground": "#42A5F5" }, + "SearchField.errorBackground": "#262a33", "Separator": { "background": "#393f4c", "foreground": "#393f4c", @@ -648,6 +668,7 @@ "borderColor": "#2f343f", "bottomSeparatorColor": "#393f4c", "cellBorder": "4,0,4,0", + "disabledForeground": "#D3DAE3", "foreground": "#D3DAE3", "focusCellBackground": "#41416A", "focusCellForeground": "#FFFFFF", @@ -749,14 +770,33 @@ "selectionBackground": "#09477170", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#09477125", + "selectionInactiveBackground": "#09477170", "textBackground": "#262b33" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#404552", + "ColorPicker.background": "#2f343f", + "ColorPicker.foreground": "#D3DAE3", + "Component.borderColor": "#404552", + "Component.background": "#2f343f", + "Component.foreground": "#D3DAE3", + "Connector.borderColor": "#404552", + "Connector.hoverBorderColor": "#08507C", + "Canvas.background": "#262b33", + "highStroke.foreground": "#D3DAE3", + "Label.foreground": "#8b9eb5", + "List.selectionBackground": "#09477170", + "Panel.borderColor": "#404552", "Panel.background": "#2f343f", - "Preview.background": "#2f343f" + "percent.foreground": "#D3DAE3", + "Placeholder.background": "#2f343f", + "Placeholder.borderColor": "#404552", + "Placeholder.foreground": "#D3DAE3", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#2f343f", + "stroke.acceleratorForeground": "#8b9eb5" }, "ValidationTooltip": { "errorBackground": "#262a33", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#2f343f" }, + "GitCommits": { + "graphColor": "#08507C" + }, "GitLog": { "localBranchIconColor": "#42A5F5", "otherIconColor": "#8b9eb5", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#8F9D6A" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark.theme.json index 0a55ff34..ad9510f4 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Arc Dark.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Arc Dark.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#42A5F550", "hoverBorderColor": "#42A5F550", + "hoverSeparatorColor": "#383C4A", + "focusedBorderColor": "#42A5F550", "pressedBackground": "#42A5F550", "pressedBorderColor": "#42A5F550" }, @@ -66,6 +68,11 @@ "shadowColor": "#383C4A", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#404552", + "Tooltip.background": "#262a33" + }, + "Content.background": "#262b33", "CheckBox": { "background": "#2f343f", "disabledText": "#D3DAE3", @@ -161,6 +168,7 @@ "hoverBackground": "#41416A", "hoverColor": "#2f343f", "hoverMaskColor": "#08507C", + "inactiveColoredFileBackground": "#383C4A", "inactiveUnderlineColor": "#D3DAE3", "inactiveMaskColor": "#2f343f", "underlineColor": "#42A5F5", @@ -193,6 +201,7 @@ "hoverColor": "#08507C", "hoverMaskColor": "#08507C", "inactiveMaskColor": "#2f343f", + "inactiveColoredFileBackground": "#2f343f2", "inactiveUnderlineColor": "#D3DAE3", "selectedForeground": "#D3DAE3", "selectedBackground": "#41416A", @@ -288,13 +297,14 @@ "secondaryForeground": "#8b9eb5", "visitedForeground": "#42A5F5" }, + "link.foreground": "#42A5F5", "List": { "background": "#393f4c", "foreground": "#D3DAE3", "selectionBackground": "#8888FF50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#09477125" + "selectionInactiveBackground": "#09477170" }, "material": { "background": "#2f343f", @@ -360,6 +370,7 @@ "background": "#2f343f" } }, + "NewPSD.warning": "#42A5F5", "Notification": { "background": "#262a33", "borderColor": "#262a33", @@ -387,7 +398,9 @@ "messageForeground": "#D3DAE3" }, "Outline": { - "color": "#383C4A" + "color": "#383C4A", + "focusedColor": "#42A5F5", + "disabledColor": "#D3DAE3" }, "Panel": { "background": "#2f343f", @@ -417,15 +430,17 @@ "disabledForeground": "#D3DAE3", "eapTagBackground": "#08507C", "lightSelectionBackground": "#8888FF", + "paidTagBackground": "#08507C", "selectionBackground": "#8888FF", "tagForeground": "#42A5F5", "tagBackground": "#08507C", + "trialTagBackground": "#08507C", "Button": { "installBackground": "#383C4A", "installBorderColor": "#383C4A", "installForeground": "#D3DAE3", "installFocusedBackground": "#08507C", - "installFillForeground": "#8b9eb5", + "installFillForeground": "#D3DAE3", "installFillBackground": "#383C4A", "updateBackground": "#383C4A", "updateBorderColor": "#383C4A", @@ -462,6 +477,7 @@ "separatorForeground": "#D3DAE3", "separatorColor": "#393f4c", "Toolbar": { + "Floating.background": "#262b33", "background": "#262b33", "borderColor": "#262b33" } @@ -483,6 +499,9 @@ "selectionBackground": "#08507C", "trackColor": "#08507C" }, + "PsiViewer": { + "referenceHighlightColor": "#42A5F5" + }, "RadioButton": { "background": "#2f343f", "disabledText": "#D3DAE3", @@ -559,6 +578,7 @@ "endBackground": "#42A5F5", "startBackground": "#42A5F5" }, + "SearchField.errorBackground": "#262a33", "Separator": { "background": "#393f4c", "foreground": "#393f4c", @@ -648,6 +668,7 @@ "borderColor": "#2f343f", "bottomSeparatorColor": "#393f4c", "cellBorder": "4,0,4,0", + "disabledForeground": "#D3DAE3", "foreground": "#D3DAE3", "focusCellBackground": "#41416A", "focusCellForeground": "#FFFFFF", @@ -749,14 +770,33 @@ "selectionBackground": "#09477170", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#09477125", + "selectionInactiveBackground": "#09477170", "textBackground": "#2f343f" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#404552", + "ColorPicker.background": "#2f343f", + "ColorPicker.foreground": "#D3DAE3", + "Component.borderColor": "#404552", + "Component.background": "#2f343f", + "Component.foreground": "#D3DAE3", + "Connector.borderColor": "#404552", + "Connector.hoverBorderColor": "#08507C", + "Canvas.background": "#262b33", + "highStroke.foreground": "#D3DAE3", + "Label.foreground": "#8b9eb5", + "List.selectionBackground": "#09477170", + "Panel.borderColor": "#404552", "Panel.background": "#2f343f", - "Preview.background": "#2f343f" + "percent.foreground": "#D3DAE3", + "Placeholder.background": "#2f343f", + "Placeholder.borderColor": "#404552", + "Placeholder.foreground": "#D3DAE3", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#2f343f", + "stroke.acceleratorForeground": "#8b9eb5" }, "ValidationTooltip": { "errorBackground": "#262a33", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#2f343f" }, + "GitCommits": { + "graphColor": "#08507C" + }, "GitLog": { "localBranchIconColor": "#42A5F5", "otherIconColor": "#8b9eb5", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#8F9D6A" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark Contrast.theme.json index 72f1631a..97f50d4d 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2979ff50", "hoverBorderColor": "#2979ff50", + "hoverSeparatorColor": "#3A3F4B", + "focusedBorderColor": "#2979ff50", "pressedBackground": "#2979ff50", "pressedBorderColor": "#2979ff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#3A3F4B", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#282C34", + "Tooltip.background": "#282C34" + }, + "Content.background": "#21252B", "CheckBox": { "background": "#282C34", "disabledText": "#6B727D", @@ -161,6 +168,7 @@ "hoverBackground": "#383E49", "hoverColor": "#21252B", "hoverMaskColor": "#383D48", + "inactiveColoredFileBackground": "#3A3F4B", "inactiveUnderlineColor": "#6B727D", "inactiveMaskColor": "#21252B", "underlineColor": "#2979ff", @@ -193,6 +201,7 @@ "hoverColor": "#383D48", "hoverMaskColor": "#383D48", "inactiveMaskColor": "#282C34", + "inactiveColoredFileBackground": "#282C342", "inactiveUnderlineColor": "#6B727D", "selectedForeground": "#979FAD", "selectedBackground": "#383E49", @@ -288,13 +297,14 @@ "secondaryForeground": "#979FAD", "visitedForeground": "#2979ff" }, + "link.foreground": "#2979ff", "List": { "background": "#2F333D", "foreground": "#979FAD", "selectionBackground": "#4D515D50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A3F4B25" + "selectionInactiveBackground": "#3A3F4B80" }, "material": { "background": "#282C34", @@ -360,6 +370,7 @@ "background": "#21252B" } }, + "NewPSD.warning": "#2979ff", "Notification": { "background": "#282C34", "borderColor": "#282C34", @@ -387,7 +398,9 @@ "messageForeground": "#979FAD" }, "Outline": { - "color": "#3A3F4B" + "color": "#3A3F4B", + "focusedColor": "#2979ff", + "disabledColor": "#6B727D" }, "Panel": { "background": "#282C34", @@ -417,15 +430,17 @@ "disabledForeground": "#6B727D", "eapTagBackground": "#383D48", "lightSelectionBackground": "#4D515D", + "paidTagBackground": "#383D48", "selectionBackground": "#4D515D", "tagForeground": "#2979ff", "tagBackground": "#383D48", + "trialTagBackground": "#383D48", "Button": { "installBackground": "#3A3F4B", "installBorderColor": "#3A3F4B", "installForeground": "#979FAD", "installFocusedBackground": "#383D48", - "installFillForeground": "#979FAD", + "installFillForeground": "#6B727D", "installFillBackground": "#3A3F4B", "updateBackground": "#3A3F4B", "updateBorderColor": "#3A3F4B", @@ -462,6 +477,7 @@ "separatorForeground": "#979FAD", "separatorColor": "#2F333D", "Toolbar": { + "Floating.background": "#21252B", "background": "#21252B", "borderColor": "#21252B" } @@ -483,6 +499,9 @@ "selectionBackground": "#383D48", "trackColor": "#383D48" }, + "PsiViewer": { + "referenceHighlightColor": "#2979ff" + }, "RadioButton": { "background": "#282C34", "disabledText": "#6B727D", @@ -559,6 +578,7 @@ "endBackground": "#2979ff", "startBackground": "#2979ff" }, + "SearchField.errorBackground": "#282C34", "Separator": { "background": "#2F333D", "foreground": "#2F333D", @@ -648,6 +668,7 @@ "borderColor": "#282C34", "bottomSeparatorColor": "#2F333D", "cellBorder": "4,0,4,0", + "disabledForeground": "#6B727D", "foreground": "#979FAD", "focusCellBackground": "#383E49", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#282C34", "modifiedItemForeground": "#2979ff", "rowHeight": 28, - "selectionBackground": "#3A3F4B70", + "selectionBackground": "#3A3F4B80", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A3F4B25", + "selectionInactiveBackground": "#3A3F4B80", "textBackground": "#21252B" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#282C34", + "ColorPicker.background": "#282C34", + "ColorPicker.foreground": "#979FAD", + "Component.borderColor": "#282C34", + "Component.background": "#282C34", + "Component.foreground": "#979FAD", + "Connector.borderColor": "#282C34", + "Connector.hoverBorderColor": "#383D48", + "Canvas.background": "#21252B", + "highStroke.foreground": "#979FAD", + "Label.foreground": "#979FAD", + "List.selectionBackground": "#3A3F4B80", + "Panel.borderColor": "#282C34", "Panel.background": "#282C34", - "Preview.background": "#282C34" + "percent.foreground": "#979FAD", + "Placeholder.background": "#282C34", + "Placeholder.borderColor": "#282C34", + "Placeholder.foreground": "#979FAD", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#282C34", + "stroke.acceleratorForeground": "#979FAD" }, "ValidationTooltip": { "errorBackground": "#282C34", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#282C34" }, + "GitCommits": { + "graphColor": "#383D48" + }, "GitLog": { "localBranchIconColor": "#2979ff", "otherIconColor": "#979FAD", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#98C379" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark.theme.json index 74ec3f0a..e1407de6 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Dark.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Dark.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2979ff50", "hoverBorderColor": "#2979ff50", + "hoverSeparatorColor": "#3A3F4B", + "focusedBorderColor": "#2979ff50", "pressedBackground": "#2979ff50", "pressedBorderColor": "#2979ff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#3A3F4B", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#282C34", + "Tooltip.background": "#282C34" + }, + "Content.background": "#21252B", "CheckBox": { "background": "#282C34", "disabledText": "#6B727D", @@ -161,6 +168,7 @@ "hoverBackground": "#383E49", "hoverColor": "#282C34", "hoverMaskColor": "#383D48", + "inactiveColoredFileBackground": "#3A3F4B", "inactiveUnderlineColor": "#6B727D", "inactiveMaskColor": "#282C34", "underlineColor": "#2979ff", @@ -193,6 +201,7 @@ "hoverColor": "#383D48", "hoverMaskColor": "#383D48", "inactiveMaskColor": "#282C34", + "inactiveColoredFileBackground": "#282C342", "inactiveUnderlineColor": "#6B727D", "selectedForeground": "#979FAD", "selectedBackground": "#383E49", @@ -288,13 +297,14 @@ "secondaryForeground": "#979FAD", "visitedForeground": "#2979ff" }, + "link.foreground": "#2979ff", "List": { "background": "#2F333D", "foreground": "#979FAD", "selectionBackground": "#4D515D50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A3F4B25" + "selectionInactiveBackground": "#3A3F4B80" }, "material": { "background": "#282C34", @@ -360,6 +370,7 @@ "background": "#282C34" } }, + "NewPSD.warning": "#2979ff", "Notification": { "background": "#282C34", "borderColor": "#282C34", @@ -387,7 +398,9 @@ "messageForeground": "#979FAD" }, "Outline": { - "color": "#3A3F4B" + "color": "#3A3F4B", + "focusedColor": "#2979ff", + "disabledColor": "#6B727D" }, "Panel": { "background": "#282C34", @@ -417,15 +430,17 @@ "disabledForeground": "#6B727D", "eapTagBackground": "#383D48", "lightSelectionBackground": "#4D515D", + "paidTagBackground": "#383D48", "selectionBackground": "#4D515D", "tagForeground": "#2979ff", "tagBackground": "#383D48", + "trialTagBackground": "#383D48", "Button": { "installBackground": "#3A3F4B", "installBorderColor": "#3A3F4B", "installForeground": "#979FAD", "installFocusedBackground": "#383D48", - "installFillForeground": "#979FAD", + "installFillForeground": "#6B727D", "installFillBackground": "#3A3F4B", "updateBackground": "#3A3F4B", "updateBorderColor": "#3A3F4B", @@ -462,6 +477,7 @@ "separatorForeground": "#979FAD", "separatorColor": "#2F333D", "Toolbar": { + "Floating.background": "#21252B", "background": "#21252B", "borderColor": "#21252B" } @@ -483,6 +499,9 @@ "selectionBackground": "#383D48", "trackColor": "#383D48" }, + "PsiViewer": { + "referenceHighlightColor": "#2979ff" + }, "RadioButton": { "background": "#282C34", "disabledText": "#6B727D", @@ -559,6 +578,7 @@ "endBackground": "#2979ff", "startBackground": "#2979ff" }, + "SearchField.errorBackground": "#282C34", "Separator": { "background": "#2F333D", "foreground": "#2F333D", @@ -648,6 +668,7 @@ "borderColor": "#282C34", "bottomSeparatorColor": "#2F333D", "cellBorder": "4,0,4,0", + "disabledForeground": "#6B727D", "foreground": "#979FAD", "focusCellBackground": "#383E49", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#282C34", "modifiedItemForeground": "#2979ff", "rowHeight": 28, - "selectionBackground": "#3A3F4B70", + "selectionBackground": "#3A3F4B80", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A3F4B25", + "selectionInactiveBackground": "#3A3F4B80", "textBackground": "#282C34" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#282C34", + "ColorPicker.background": "#282C34", + "ColorPicker.foreground": "#979FAD", + "Component.borderColor": "#282C34", + "Component.background": "#282C34", + "Component.foreground": "#979FAD", + "Connector.borderColor": "#282C34", + "Connector.hoverBorderColor": "#383D48", + "Canvas.background": "#21252B", + "highStroke.foreground": "#979FAD", + "Label.foreground": "#979FAD", + "List.selectionBackground": "#3A3F4B80", + "Panel.borderColor": "#282C34", "Panel.background": "#282C34", - "Preview.background": "#282C34" + "percent.foreground": "#979FAD", + "Placeholder.background": "#282C34", + "Placeholder.borderColor": "#282C34", + "Placeholder.foreground": "#979FAD", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#282C34", + "stroke.acceleratorForeground": "#979FAD" }, "ValidationTooltip": { "errorBackground": "#282C34", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#282C34" }, + "GitCommits": { + "graphColor": "#383D48" + }, "GitLog": { "localBranchIconColor": "#2979ff", "otherIconColor": "#979FAD", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#98C379" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light Contrast.theme.json index 86eca7ce..fac18fc2 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light Contrast.theme.json @@ -1,5 +1,5 @@ { - "name": "Atom One Light", + "name": "Atom One Light Contrast", "dark": false, "author": "Mallowigi", "editorScheme": "/colors/Atom One Light.xml", @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2979ff50", "hoverBorderColor": "#2979ff50", + "hoverSeparatorColor": "#DBDBDC", + "focusedBorderColor": "#2979ff50", "pressedBackground": "#2979ff50", "pressedBorderColor": "#2979ff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#DBDBDC", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#DBDBDC", + "Tooltip.background": "#F2F2F2" + }, + "Content.background": "#eaeaeb", "CheckBox": { "background": "#F4F4F4", "disabledText": "#b8b8b9", @@ -161,6 +168,7 @@ "hoverBackground": "#DBDBDC", "hoverColor": "#eaeaeb", "hoverMaskColor": "#FFFFFF", + "inactiveColoredFileBackground": "#DBDBDC", "inactiveUnderlineColor": "#b8b8b9", "inactiveMaskColor": "#eaeaeb", "underlineColor": "#2979ff", @@ -193,6 +201,7 @@ "hoverColor": "#FFFFFF", "hoverMaskColor": "#FFFFFF", "inactiveMaskColor": "#F4F4F4", + "inactiveColoredFileBackground": "#F4F4F42", "inactiveUnderlineColor": "#b8b8b9", "selectedForeground": "#232324", "selectedBackground": "#DBDBDC", @@ -288,13 +297,14 @@ "secondaryForeground": "#7f7f7f", "visitedForeground": "#2979ff" }, + "link.foreground": "#2979ff", "List": { "background": "#EAEAEB", "foreground": "#232324", "selectionBackground": "#FFFFFF50", "selectionForeground": "#232324", "selectionInactiveForeground": "#232324", - "selectionInactiveBackground": "#DBDBDC25" + "selectionInactiveBackground": "#DBDBDC80" }, "material": { "background": "#F4F4F4", @@ -360,6 +370,7 @@ "background": "#eaeaeb" } }, + "NewPSD.warning": "#2979ff", "Notification": { "background": "#F2F2F2", "borderColor": "#F2F2F2", @@ -387,7 +398,9 @@ "messageForeground": "#232324" }, "Outline": { - "color": "#DBDBDC" + "color": "#DBDBDC", + "focusedColor": "#2979ff", + "disabledColor": "#b8b8b9" }, "Panel": { "background": "#F4F4F4", @@ -417,15 +430,17 @@ "disabledForeground": "#b8b8b9", "eapTagBackground": "#FFFFFF", "lightSelectionBackground": "#FFFFFF", + "paidTagBackground": "#FFFFFF", "selectionBackground": "#FFFFFF", "tagForeground": "#2979ff", "tagBackground": "#FFFFFF", + "trialTagBackground": "#FFFFFF", "Button": { "installBackground": "#DBDBDC", "installBorderColor": "#DBDBDC", "installForeground": "#232324", "installFocusedBackground": "#FFFFFF", - "installFillForeground": "#7f7f7f", + "installFillForeground": "#b8b8b9", "installFillBackground": "#DBDBDC", "updateBackground": "#DBDBDC", "updateBorderColor": "#DBDBDC", @@ -462,6 +477,7 @@ "separatorForeground": "#232324", "separatorColor": "#EAEAEB", "Toolbar": { + "Floating.background": "#eaeaeb", "background": "#eaeaeb", "borderColor": "#eaeaeb" } @@ -483,6 +499,9 @@ "selectionBackground": "#FFFFFF", "trackColor": "#FFFFFF" }, + "PsiViewer": { + "referenceHighlightColor": "#2979ff" + }, "RadioButton": { "background": "#F4F4F4", "disabledText": "#b8b8b9", @@ -559,6 +578,7 @@ "endBackground": "#2979ff", "startBackground": "#2979ff" }, + "SearchField.errorBackground": "#F2F2F2", "Separator": { "background": "#EAEAEB", "foreground": "#EAEAEB", @@ -648,6 +668,7 @@ "borderColor": "#F4F4F4", "bottomSeparatorColor": "#EAEAEB", "cellBorder": "4,0,4,0", + "disabledForeground": "#b8b8b9", "foreground": "#232324", "focusCellBackground": "#DBDBDC", "focusCellForeground": "#232324", @@ -746,17 +767,36 @@ "hash": "#DBDBDC", "modifiedItemForeground": "#2979ff", "rowHeight": 28, - "selectionBackground": "#DBDBDC70", + "selectionBackground": "#DBDBDC80", "selectionForeground": "#232324", "selectionInactiveForeground": "#232324", - "selectionInactiveBackground": "#DBDBDC25", + "selectionInactiveBackground": "#DBDBDC80", "textBackground": "#eaeaeb" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#DBDBDC", + "ColorPicker.background": "#F4F4F4", + "ColorPicker.foreground": "#232324", + "Component.borderColor": "#DBDBDC", + "Component.background": "#F4F4F4", + "Component.foreground": "#232324", + "Connector.borderColor": "#DBDBDC", + "Connector.hoverBorderColor": "#FFFFFF", + "Canvas.background": "#eaeaeb", + "highStroke.foreground": "#232324", + "Label.foreground": "#7f7f7f", + "List.selectionBackground": "#DBDBDC80", + "Panel.borderColor": "#DBDBDC", "Panel.background": "#F4F4F4", - "Preview.background": "#F4F4F4" + "percent.foreground": "#232324", + "Placeholder.background": "#F4F4F4", + "Placeholder.borderColor": "#DBDBDC", + "Placeholder.foreground": "#232324", + "Placeholder.selectedForeground": "#232324", + "Preview.background": "#F4F4F4", + "stroke.acceleratorForeground": "#7f7f7f" }, "ValidationTooltip": { "errorBackground": "#F2F2F2", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F4F4F4" }, + "GitCommits": { + "graphColor": "#FFFFFF" + }, "GitLog": { "localBranchIconColor": "#2979ff", "otherIconColor": "#7f7f7f", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#50A14E" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light.theme.json index 8b0b41a3..e916dc36 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Atom One Light.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Atom One Light.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2979ff50", "hoverBorderColor": "#2979ff50", + "hoverSeparatorColor": "#DBDBDC", + "focusedBorderColor": "#2979ff50", "pressedBackground": "#2979ff50", "pressedBorderColor": "#2979ff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#DBDBDC", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#DBDBDC", + "Tooltip.background": "#F2F2F2" + }, + "Content.background": "#eaeaeb", "CheckBox": { "background": "#F4F4F4", "disabledText": "#b8b8b9", @@ -161,6 +168,7 @@ "hoverBackground": "#DBDBDC", "hoverColor": "#F4F4F4", "hoverMaskColor": "#FFFFFF", + "inactiveColoredFileBackground": "#DBDBDC", "inactiveUnderlineColor": "#b8b8b9", "inactiveMaskColor": "#F4F4F4", "underlineColor": "#2979ff", @@ -193,6 +201,7 @@ "hoverColor": "#FFFFFF", "hoverMaskColor": "#FFFFFF", "inactiveMaskColor": "#F4F4F4", + "inactiveColoredFileBackground": "#F4F4F42", "inactiveUnderlineColor": "#b8b8b9", "selectedForeground": "#232324", "selectedBackground": "#DBDBDC", @@ -288,13 +297,14 @@ "secondaryForeground": "#7f7f7f", "visitedForeground": "#2979ff" }, + "link.foreground": "#2979ff", "List": { "background": "#EAEAEB", "foreground": "#232324", "selectionBackground": "#FFFFFF50", "selectionForeground": "#232324", "selectionInactiveForeground": "#232324", - "selectionInactiveBackground": "#DBDBDC25" + "selectionInactiveBackground": "#DBDBDC80" }, "material": { "background": "#F4F4F4", @@ -360,6 +370,7 @@ "background": "#F4F4F4" } }, + "NewPSD.warning": "#2979ff", "Notification": { "background": "#F2F2F2", "borderColor": "#F2F2F2", @@ -387,7 +398,9 @@ "messageForeground": "#232324" }, "Outline": { - "color": "#DBDBDC" + "color": "#DBDBDC", + "focusedColor": "#2979ff", + "disabledColor": "#b8b8b9" }, "Panel": { "background": "#F4F4F4", @@ -417,15 +430,17 @@ "disabledForeground": "#b8b8b9", "eapTagBackground": "#FFFFFF", "lightSelectionBackground": "#FFFFFF", + "paidTagBackground": "#FFFFFF", "selectionBackground": "#FFFFFF", "tagForeground": "#2979ff", "tagBackground": "#FFFFFF", + "trialTagBackground": "#FFFFFF", "Button": { "installBackground": "#DBDBDC", "installBorderColor": "#DBDBDC", "installForeground": "#232324", "installFocusedBackground": "#FFFFFF", - "installFillForeground": "#7f7f7f", + "installFillForeground": "#b8b8b9", "installFillBackground": "#DBDBDC", "updateBackground": "#DBDBDC", "updateBorderColor": "#DBDBDC", @@ -462,6 +477,7 @@ "separatorForeground": "#232324", "separatorColor": "#EAEAEB", "Toolbar": { + "Floating.background": "#eaeaeb", "background": "#eaeaeb", "borderColor": "#eaeaeb" } @@ -483,6 +499,9 @@ "selectionBackground": "#FFFFFF", "trackColor": "#FFFFFF" }, + "PsiViewer": { + "referenceHighlightColor": "#2979ff" + }, "RadioButton": { "background": "#F4F4F4", "disabledText": "#b8b8b9", @@ -559,6 +578,7 @@ "endBackground": "#2979ff", "startBackground": "#2979ff" }, + "SearchField.errorBackground": "#F2F2F2", "Separator": { "background": "#EAEAEB", "foreground": "#EAEAEB", @@ -648,6 +668,7 @@ "borderColor": "#F4F4F4", "bottomSeparatorColor": "#EAEAEB", "cellBorder": "4,0,4,0", + "disabledForeground": "#b8b8b9", "foreground": "#232324", "focusCellBackground": "#DBDBDC", "focusCellForeground": "#232324", @@ -746,17 +767,36 @@ "hash": "#DBDBDC", "modifiedItemForeground": "#2979ff", "rowHeight": 28, - "selectionBackground": "#DBDBDC70", + "selectionBackground": "#DBDBDC80", "selectionForeground": "#232324", "selectionInactiveForeground": "#232324", - "selectionInactiveBackground": "#DBDBDC25", + "selectionInactiveBackground": "#DBDBDC80", "textBackground": "#F4F4F4" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#DBDBDC", + "ColorPicker.background": "#F4F4F4", + "ColorPicker.foreground": "#232324", + "Component.borderColor": "#DBDBDC", + "Component.background": "#F4F4F4", + "Component.foreground": "#232324", + "Connector.borderColor": "#DBDBDC", + "Connector.hoverBorderColor": "#FFFFFF", + "Canvas.background": "#eaeaeb", + "highStroke.foreground": "#232324", + "Label.foreground": "#7f7f7f", + "List.selectionBackground": "#DBDBDC80", + "Panel.borderColor": "#DBDBDC", "Panel.background": "#F4F4F4", - "Preview.background": "#F4F4F4" + "percent.foreground": "#232324", + "Placeholder.background": "#F4F4F4", + "Placeholder.borderColor": "#DBDBDC", + "Placeholder.foreground": "#232324", + "Placeholder.selectedForeground": "#232324", + "Preview.background": "#F4F4F4", + "stroke.acceleratorForeground": "#7f7f7f" }, "ValidationTooltip": { "errorBackground": "#F2F2F2", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F4F4F4" }, + "GitCommits": { + "graphColor": "#FFFFFF" + }, "GitLog": { "localBranchIconColor": "#2979ff", "otherIconColor": "#7f7f7f", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#50A14E" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula Contrast.theme.json index 44eed77e..43655460 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#FF79C550", "hoverBorderColor": "#FF79C550", + "hoverSeparatorColor": "#393C4B", + "focusedBorderColor": "#FF79C550", "pressedBackground": "#FF79C550", "pressedBorderColor": "#FF79C550" }, @@ -66,6 +68,11 @@ "shadowColor": "#393C4B", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#21222C", + "Tooltip.background": "#1D2228" + }, + "Content.background": "#191A21", "CheckBox": { "background": "#282A36", "disabledText": "#6272A4", @@ -161,6 +168,7 @@ "hoverBackground": "#44475A", "hoverColor": "#191A21", "hoverMaskColor": "#6272A4", + "inactiveColoredFileBackground": "#393C4B", "inactiveUnderlineColor": "#6272A4", "inactiveMaskColor": "#191A21", "underlineColor": "#FF79C5", @@ -193,6 +201,7 @@ "hoverColor": "#6272A4", "hoverMaskColor": "#6272A4", "inactiveMaskColor": "#282A36", + "inactiveColoredFileBackground": "#282A362", "inactiveUnderlineColor": "#6272A4", "selectedForeground": "#F8F8F2", "selectedBackground": "#44475A", @@ -288,13 +297,14 @@ "secondaryForeground": "#6272A4", "visitedForeground": "#FF79C5" }, + "link.foreground": "#FF79C5", "List": { "background": "#282A36", "foreground": "#F8F8F2", "selectionBackground": "#44475A50", "selectionForeground": "#8BE9FD", "selectionInactiveForeground": "#8BE9FD", - "selectionInactiveBackground": "#44475A25" + "selectionInactiveBackground": "#44475A50" }, "material": { "background": "#282A36", @@ -360,6 +370,7 @@ "background": "#191A21" } }, + "NewPSD.warning": "#FF79C5", "Notification": { "background": "#1D2228", "borderColor": "#1D2228", @@ -387,7 +398,9 @@ "messageForeground": "#F8F8F2" }, "Outline": { - "color": "#393C4B" + "color": "#393C4B", + "focusedColor": "#FF79C5", + "disabledColor": "#6272A4" }, "Panel": { "background": "#282A36", @@ -417,9 +430,11 @@ "disabledForeground": "#6272A4", "eapTagBackground": "#6272A4", "lightSelectionBackground": "#44475A", + "paidTagBackground": "#6272A4", "selectionBackground": "#44475A", "tagForeground": "#FF79C5", "tagBackground": "#6272A4", + "trialTagBackground": "#6272A4", "Button": { "installBackground": "#393C4B", "installBorderColor": "#393C4B", @@ -462,6 +477,7 @@ "separatorForeground": "#F8F8F2", "separatorColor": "#282A36", "Toolbar": { + "Floating.background": "#191A21", "background": "#191A21", "borderColor": "#191A21" } @@ -483,6 +499,9 @@ "selectionBackground": "#6272A4", "trackColor": "#6272A4" }, + "PsiViewer": { + "referenceHighlightColor": "#FF79C5" + }, "RadioButton": { "background": "#282A36", "disabledText": "#6272A4", @@ -559,6 +578,7 @@ "endBackground": "#FF79C5", "startBackground": "#FF79C5" }, + "SearchField.errorBackground": "#1D2228", "Separator": { "background": "#282A36", "foreground": "#282A36", @@ -648,6 +668,7 @@ "borderColor": "#282A36", "bottomSeparatorColor": "#282A36", "cellBorder": "4,0,4,0", + "disabledForeground": "#6272A4", "foreground": "#F8F8F2", "focusCellBackground": "#44475A", "focusCellForeground": "#8BE9FD", @@ -746,17 +767,36 @@ "hash": "#21222C", "modifiedItemForeground": "#FF79C5", "rowHeight": 28, - "selectionBackground": "#44475A70", + "selectionBackground": "#44475A50", "selectionForeground": "#8BE9FD", "selectionInactiveForeground": "#8BE9FD", - "selectionInactiveBackground": "#44475A25", + "selectionInactiveBackground": "#44475A50", "textBackground": "#191A21" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#21222C", + "ColorPicker.background": "#282A36", + "ColorPicker.foreground": "#F8F8F2", + "Component.borderColor": "#21222C", + "Component.background": "#282A36", + "Component.foreground": "#F8F8F2", + "Connector.borderColor": "#21222C", + "Connector.hoverBorderColor": "#6272A4", + "Canvas.background": "#191A21", + "highStroke.foreground": "#F8F8F2", + "Label.foreground": "#6272A4", + "List.selectionBackground": "#44475A50", + "Panel.borderColor": "#21222C", "Panel.background": "#282A36", - "Preview.background": "#282A36" + "percent.foreground": "#F8F8F2", + "Placeholder.background": "#282A36", + "Placeholder.borderColor": "#21222C", + "Placeholder.foreground": "#F8F8F2", + "Placeholder.selectedForeground": "#8BE9FD", + "Preview.background": "#282A36", + "stroke.acceleratorForeground": "#6272A4" }, "ValidationTooltip": { "errorBackground": "#1D2228", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#282A36" }, + "GitCommits": { + "graphColor": "#6272A4" + }, "GitLog": { "localBranchIconColor": "#FF79C5", "otherIconColor": "#6272A4", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#F1FA8C" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula.theme.json index 93c7bef2..f98bc16b 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Dracula.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Dracula.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#FF79C550", "hoverBorderColor": "#FF79C550", + "hoverSeparatorColor": "#393C4B", + "focusedBorderColor": "#FF79C550", "pressedBackground": "#FF79C550", "pressedBorderColor": "#FF79C550" }, @@ -66,6 +68,11 @@ "shadowColor": "#393C4B", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#21222C", + "Tooltip.background": "#1D2228" + }, + "Content.background": "#191A21", "CheckBox": { "background": "#282A36", "disabledText": "#6272A4", @@ -161,6 +168,7 @@ "hoverBackground": "#44475A", "hoverColor": "#282A36", "hoverMaskColor": "#6272A4", + "inactiveColoredFileBackground": "#393C4B", "inactiveUnderlineColor": "#6272A4", "inactiveMaskColor": "#282A36", "underlineColor": "#FF79C5", @@ -193,6 +201,7 @@ "hoverColor": "#6272A4", "hoverMaskColor": "#6272A4", "inactiveMaskColor": "#282A36", + "inactiveColoredFileBackground": "#282A362", "inactiveUnderlineColor": "#6272A4", "selectedForeground": "#F8F8F2", "selectedBackground": "#44475A", @@ -288,13 +297,14 @@ "secondaryForeground": "#6272A4", "visitedForeground": "#FF79C5" }, + "link.foreground": "#FF79C5", "List": { "background": "#282A36", "foreground": "#F8F8F2", "selectionBackground": "#44475A50", "selectionForeground": "#8BE9FD", "selectionInactiveForeground": "#8BE9FD", - "selectionInactiveBackground": "#44475A25" + "selectionInactiveBackground": "#44475A50" }, "material": { "background": "#282A36", @@ -360,6 +370,7 @@ "background": "#282A36" } }, + "NewPSD.warning": "#FF79C5", "Notification": { "background": "#1D2228", "borderColor": "#1D2228", @@ -387,7 +398,9 @@ "messageForeground": "#F8F8F2" }, "Outline": { - "color": "#393C4B" + "color": "#393C4B", + "focusedColor": "#FF79C5", + "disabledColor": "#6272A4" }, "Panel": { "background": "#282A36", @@ -417,9 +430,11 @@ "disabledForeground": "#6272A4", "eapTagBackground": "#6272A4", "lightSelectionBackground": "#44475A", + "paidTagBackground": "#6272A4", "selectionBackground": "#44475A", "tagForeground": "#FF79C5", "tagBackground": "#6272A4", + "trialTagBackground": "#6272A4", "Button": { "installBackground": "#393C4B", "installBorderColor": "#393C4B", @@ -462,6 +477,7 @@ "separatorForeground": "#F8F8F2", "separatorColor": "#282A36", "Toolbar": { + "Floating.background": "#191A21", "background": "#191A21", "borderColor": "#191A21" } @@ -483,6 +499,9 @@ "selectionBackground": "#6272A4", "trackColor": "#6272A4" }, + "PsiViewer": { + "referenceHighlightColor": "#FF79C5" + }, "RadioButton": { "background": "#282A36", "disabledText": "#6272A4", @@ -559,6 +578,7 @@ "endBackground": "#FF79C5", "startBackground": "#FF79C5" }, + "SearchField.errorBackground": "#1D2228", "Separator": { "background": "#282A36", "foreground": "#282A36", @@ -648,6 +668,7 @@ "borderColor": "#282A36", "bottomSeparatorColor": "#282A36", "cellBorder": "4,0,4,0", + "disabledForeground": "#6272A4", "foreground": "#F8F8F2", "focusCellBackground": "#44475A", "focusCellForeground": "#8BE9FD", @@ -746,17 +767,36 @@ "hash": "#21222C", "modifiedItemForeground": "#FF79C5", "rowHeight": 28, - "selectionBackground": "#44475A70", + "selectionBackground": "#44475A50", "selectionForeground": "#8BE9FD", "selectionInactiveForeground": "#8BE9FD", - "selectionInactiveBackground": "#44475A25", + "selectionInactiveBackground": "#44475A50", "textBackground": "#282A36" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#21222C", + "ColorPicker.background": "#282A36", + "ColorPicker.foreground": "#F8F8F2", + "Component.borderColor": "#21222C", + "Component.background": "#282A36", + "Component.foreground": "#F8F8F2", + "Connector.borderColor": "#21222C", + "Connector.hoverBorderColor": "#6272A4", + "Canvas.background": "#191A21", + "highStroke.foreground": "#F8F8F2", + "Label.foreground": "#6272A4", + "List.selectionBackground": "#44475A50", + "Panel.borderColor": "#21222C", "Panel.background": "#282A36", - "Preview.background": "#282A36" + "percent.foreground": "#F8F8F2", + "Placeholder.background": "#282A36", + "Placeholder.borderColor": "#21222C", + "Placeholder.foreground": "#F8F8F2", + "Placeholder.selectedForeground": "#8BE9FD", + "Preview.background": "#282A36", + "stroke.acceleratorForeground": "#6272A4" }, "ValidationTooltip": { "errorBackground": "#1D2228", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#282A36" }, + "GitCommits": { + "graphColor": "#6272A4" + }, "GitLog": { "localBranchIconColor": "#FF79C5", "otherIconColor": "#6272A4", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#F1FA8C" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub Contrast.theme.json index 156d5d14..8cba9e36 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#79CB6050", "hoverBorderColor": "#79CB6050", + "hoverSeparatorColor": "#edf1f5", + "focusedBorderColor": "#79CB6050", "pressedBackground": "#79CB6050", "pressedBorderColor": "#79CB6050" }, @@ -66,6 +68,11 @@ "shadowColor": "#edf1f5", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#DFE1E4", + "Tooltip.background": "#DFECFE" + }, + "Content.background": "#fafbfc", "CheckBox": { "background": "#F7F8FA", "disabledText": "#9ba0a3", @@ -161,6 +168,7 @@ "hoverBackground": "#cce5ff", "hoverColor": "#fafbfc", "hoverMaskColor": "#CCE5FF", + "inactiveColoredFileBackground": "#edf1f5", "inactiveUnderlineColor": "#9ba0a3", "inactiveMaskColor": "#fafbfc", "underlineColor": "#79CB60", @@ -193,6 +201,7 @@ "hoverColor": "#CCE5FF", "hoverMaskColor": "#CCE5FF", "inactiveMaskColor": "#F7F8FA", + "inactiveColoredFileBackground": "#F7F8FA2", "inactiveUnderlineColor": "#9ba0a3", "selectedForeground": "#5B6168", "selectedBackground": "#cce5ff", @@ -288,13 +297,14 @@ "secondaryForeground": "#292D31", "visitedForeground": "#79CB60" }, + "link.foreground": "#79CB60", "List": { "background": "#f3f3f3", "foreground": "#5B6168", "selectionBackground": "#3A66D150", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#111111", - "selectionInactiveBackground": "#3A66D125" + "selectionInactiveBackground": "#3A66D1" }, "material": { "background": "#F7F8FA", @@ -360,6 +370,7 @@ "background": "#fafbfc" } }, + "NewPSD.warning": "#79CB60", "Notification": { "background": "#DFECFE", "borderColor": "#DFECFE", @@ -387,7 +398,9 @@ "messageForeground": "#5B6168" }, "Outline": { - "color": "#edf1f5" + "color": "#edf1f5", + "focusedColor": "#79CB60", + "disabledColor": "#9ba0a3" }, "Panel": { "background": "#F7F8FA", @@ -417,15 +430,17 @@ "disabledForeground": "#9ba0a3", "eapTagBackground": "#CCE5FF", "lightSelectionBackground": "#3A66D1", + "paidTagBackground": "#CCE5FF", "selectionBackground": "#3A66D1", "tagForeground": "#79CB60", "tagBackground": "#CCE5FF", + "trialTagBackground": "#CCE5FF", "Button": { "installBackground": "#edf1f5", "installBorderColor": "#edf1f5", "installForeground": "#5B6168", "installFocusedBackground": "#CCE5FF", - "installFillForeground": "#292D31", + "installFillForeground": "#9ba0a3", "installFillBackground": "#edf1f5", "updateBackground": "#edf1f5", "updateBorderColor": "#edf1f5", @@ -462,6 +477,7 @@ "separatorForeground": "#5B6168", "separatorColor": "#f3f3f3", "Toolbar": { + "Floating.background": "#fafbfc", "background": "#fafbfc", "borderColor": "#fafbfc" } @@ -483,6 +499,9 @@ "selectionBackground": "#CCE5FF", "trackColor": "#CCE5FF" }, + "PsiViewer": { + "referenceHighlightColor": "#79CB60" + }, "RadioButton": { "background": "#F7F8FA", "disabledText": "#9ba0a3", @@ -559,6 +578,7 @@ "endBackground": "#79CB60", "startBackground": "#79CB60" }, + "SearchField.errorBackground": "#DFECFE", "Separator": { "background": "#f3f3f3", "foreground": "#f3f3f3", @@ -648,6 +668,7 @@ "borderColor": "#F7F8FA", "bottomSeparatorColor": "#f3f3f3", "cellBorder": "4,0,4,0", + "disabledForeground": "#9ba0a3", "foreground": "#5B6168", "focusCellBackground": "#cce5ff", "focusCellForeground": "#111111", @@ -746,17 +767,36 @@ "hash": "#DFE1E4", "modifiedItemForeground": "#79CB60", "rowHeight": 28, - "selectionBackground": "#3A66D170", + "selectionBackground": "#3A66D1", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A66D125", + "selectionInactiveBackground": "#3A66D1", "textBackground": "#fafbfc" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#DFE1E4", + "ColorPicker.background": "#F7F8FA", + "ColorPicker.foreground": "#5B6168", + "Component.borderColor": "#DFE1E4", + "Component.background": "#F7F8FA", + "Component.foreground": "#5B6168", + "Connector.borderColor": "#DFE1E4", + "Connector.hoverBorderColor": "#CCE5FF", + "Canvas.background": "#fafbfc", + "highStroke.foreground": "#5B6168", + "Label.foreground": "#292D31", + "List.selectionBackground": "#3A66D1", + "Panel.borderColor": "#DFE1E4", "Panel.background": "#F7F8FA", - "Preview.background": "#F7F8FA" + "percent.foreground": "#5B6168", + "Placeholder.background": "#F7F8FA", + "Placeholder.borderColor": "#DFE1E4", + "Placeholder.foreground": "#5B6168", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#F7F8FA", + "stroke.acceleratorForeground": "#292D31" }, "ValidationTooltip": { "errorBackground": "#DFECFE", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F7F8FA" }, + "GitCommits": { + "graphColor": "#CCE5FF" + }, "GitLog": { "localBranchIconColor": "#79CB60", "otherIconColor": "#292D31", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#032F62" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub.theme.json index ccaeb0f0..6002f77d 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/GitHub.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/GitHub.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#79CB6050", "hoverBorderColor": "#79CB6050", + "hoverSeparatorColor": "#edf1f5", + "focusedBorderColor": "#79CB6050", "pressedBackground": "#79CB6050", "pressedBorderColor": "#79CB6050" }, @@ -66,6 +68,11 @@ "shadowColor": "#edf1f5", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#DFE1E4", + "Tooltip.background": "#DFECFE" + }, + "Content.background": "#fafbfc", "CheckBox": { "background": "#F7F8FA", "disabledText": "#9ba0a3", @@ -161,6 +168,7 @@ "hoverBackground": "#cce5ff", "hoverColor": "#F7F8FA", "hoverMaskColor": "#CCE5FF", + "inactiveColoredFileBackground": "#edf1f5", "inactiveUnderlineColor": "#9ba0a3", "inactiveMaskColor": "#F7F8FA", "underlineColor": "#79CB60", @@ -193,6 +201,7 @@ "hoverColor": "#CCE5FF", "hoverMaskColor": "#CCE5FF", "inactiveMaskColor": "#F7F8FA", + "inactiveColoredFileBackground": "#F7F8FA2", "inactiveUnderlineColor": "#9ba0a3", "selectedForeground": "#5B6168", "selectedBackground": "#cce5ff", @@ -288,13 +297,14 @@ "secondaryForeground": "#292D31", "visitedForeground": "#79CB60" }, + "link.foreground": "#79CB60", "List": { "background": "#f3f3f3", "foreground": "#5B6168", "selectionBackground": "#3A66D150", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#111111", - "selectionInactiveBackground": "#3A66D125" + "selectionInactiveBackground": "#3A66D1" }, "material": { "background": "#F7F8FA", @@ -360,6 +370,7 @@ "background": "#F7F8FA" } }, + "NewPSD.warning": "#79CB60", "Notification": { "background": "#DFECFE", "borderColor": "#DFECFE", @@ -387,7 +398,9 @@ "messageForeground": "#5B6168" }, "Outline": { - "color": "#edf1f5" + "color": "#edf1f5", + "focusedColor": "#79CB60", + "disabledColor": "#9ba0a3" }, "Panel": { "background": "#F7F8FA", @@ -417,15 +430,17 @@ "disabledForeground": "#9ba0a3", "eapTagBackground": "#CCE5FF", "lightSelectionBackground": "#3A66D1", + "paidTagBackground": "#CCE5FF", "selectionBackground": "#3A66D1", "tagForeground": "#79CB60", "tagBackground": "#CCE5FF", + "trialTagBackground": "#CCE5FF", "Button": { "installBackground": "#edf1f5", "installBorderColor": "#edf1f5", "installForeground": "#5B6168", "installFocusedBackground": "#CCE5FF", - "installFillForeground": "#292D31", + "installFillForeground": "#9ba0a3", "installFillBackground": "#edf1f5", "updateBackground": "#edf1f5", "updateBorderColor": "#edf1f5", @@ -462,6 +477,7 @@ "separatorForeground": "#5B6168", "separatorColor": "#f3f3f3", "Toolbar": { + "Floating.background": "#fafbfc", "background": "#fafbfc", "borderColor": "#fafbfc" } @@ -483,6 +499,9 @@ "selectionBackground": "#CCE5FF", "trackColor": "#CCE5FF" }, + "PsiViewer": { + "referenceHighlightColor": "#79CB60" + }, "RadioButton": { "background": "#F7F8FA", "disabledText": "#9ba0a3", @@ -559,6 +578,7 @@ "endBackground": "#79CB60", "startBackground": "#79CB60" }, + "SearchField.errorBackground": "#DFECFE", "Separator": { "background": "#f3f3f3", "foreground": "#f3f3f3", @@ -648,6 +668,7 @@ "borderColor": "#F7F8FA", "bottomSeparatorColor": "#f3f3f3", "cellBorder": "4,0,4,0", + "disabledForeground": "#9ba0a3", "foreground": "#5B6168", "focusCellBackground": "#cce5ff", "focusCellForeground": "#111111", @@ -746,17 +767,36 @@ "hash": "#DFE1E4", "modifiedItemForeground": "#79CB60", "rowHeight": 28, - "selectionBackground": "#3A66D170", + "selectionBackground": "#3A66D1", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#3A66D125", + "selectionInactiveBackground": "#3A66D1", "textBackground": "#F7F8FA" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#DFE1E4", + "ColorPicker.background": "#F7F8FA", + "ColorPicker.foreground": "#5B6168", + "Component.borderColor": "#DFE1E4", + "Component.background": "#F7F8FA", + "Component.foreground": "#5B6168", + "Connector.borderColor": "#DFE1E4", + "Connector.hoverBorderColor": "#CCE5FF", + "Canvas.background": "#fafbfc", + "highStroke.foreground": "#5B6168", + "Label.foreground": "#292D31", + "List.selectionBackground": "#3A66D1", + "Panel.borderColor": "#DFE1E4", "Panel.background": "#F7F8FA", - "Preview.background": "#F7F8FA" + "percent.foreground": "#5B6168", + "Placeholder.background": "#F7F8FA", + "Placeholder.borderColor": "#DFE1E4", + "Placeholder.foreground": "#5B6168", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#F7F8FA", + "stroke.acceleratorForeground": "#292D31" }, "ValidationTooltip": { "errorBackground": "#DFECFE", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F7F8FA" }, + "GitCommits": { + "graphColor": "#CCE5FF" + }, "GitLog": { "localBranchIconColor": "#79CB60", "otherIconColor": "#292D31", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#032F62" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl Contrast.theme.json index 12f49866..ef88efdd 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2AA29850", "hoverBorderColor": "#2AA29850", + "hoverSeparatorColor": "#d9d9d9", + "focusedBorderColor": "#2AA29850", "pressedBackground": "#2AA29850", "pressedBorderColor": "#2AA29850" }, @@ -66,6 +68,11 @@ "shadowColor": "#d9d9d9", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#d9d9d9", + "Tooltip.background": "#F0F0F0" + }, + "Content.background": "#f0f0f0", "CheckBox": { "background": "#F0F0F0", "disabledText": "#93A1A1", @@ -161,6 +168,7 @@ "hoverBackground": "#d3e8f8", "hoverColor": "#f0f0f0", "hoverMaskColor": "#CCCCCC", + "inactiveColoredFileBackground": "#d9d9d9", "inactiveUnderlineColor": "#93A1A1", "inactiveMaskColor": "#f0f0f0", "underlineColor": "#2AA298", @@ -193,6 +201,7 @@ "hoverColor": "#CCCCCC", "hoverMaskColor": "#CCCCCC", "inactiveMaskColor": "#F0F0F0", + "inactiveColoredFileBackground": "#F0F0F02", "inactiveUnderlineColor": "#93A1A1", "selectedForeground": "#403f53", "selectedBackground": "#d3e8f8", @@ -288,13 +297,14 @@ "secondaryForeground": "#90A7B2", "visitedForeground": "#2AA298" }, + "link.foreground": "#2AA298", "List": { "background": "#FBFBFB", "foreground": "#403f53", "selectionBackground": "#d3e8f850", "selectionForeground": "#403f53", "selectionInactiveForeground": "#333333", - "selectionInactiveBackground": "#d3e8f825" + "selectionInactiveBackground": "#d3e8f87c" }, "material": { "background": "#F0F0F0", @@ -360,6 +370,7 @@ "background": "#f0f0f0" } }, + "NewPSD.warning": "#2AA298", "Notification": { "background": "#F0F0F0", "borderColor": "#F0F0F0", @@ -387,7 +398,9 @@ "messageForeground": "#403f53" }, "Outline": { - "color": "#d9d9d9" + "color": "#d9d9d9", + "focusedColor": "#2AA298", + "disabledColor": "#93A1A1" }, "Panel": { "background": "#F0F0F0", @@ -417,15 +430,17 @@ "disabledForeground": "#93A1A1", "eapTagBackground": "#CCCCCC", "lightSelectionBackground": "#d3e8f8", + "paidTagBackground": "#CCCCCC", "selectionBackground": "#d3e8f8", "tagForeground": "#2AA298", "tagBackground": "#CCCCCC", + "trialTagBackground": "#CCCCCC", "Button": { "installBackground": "#d9d9d9", "installBorderColor": "#d9d9d9", "installForeground": "#403f53", "installFocusedBackground": "#CCCCCC", - "installFillForeground": "#90A7B2", + "installFillForeground": "#93A1A1", "installFillBackground": "#d9d9d9", "updateBackground": "#d9d9d9", "updateBorderColor": "#d9d9d9", @@ -462,6 +477,7 @@ "separatorForeground": "#403f53", "separatorColor": "#FBFBFB", "Toolbar": { + "Floating.background": "#f0f0f0", "background": "#f0f0f0", "borderColor": "#f0f0f0" } @@ -483,6 +499,9 @@ "selectionBackground": "#CCCCCC", "trackColor": "#CCCCCC" }, + "PsiViewer": { + "referenceHighlightColor": "#2AA298" + }, "RadioButton": { "background": "#F0F0F0", "disabledText": "#93A1A1", @@ -559,6 +578,7 @@ "endBackground": "#2AA298", "startBackground": "#2AA298" }, + "SearchField.errorBackground": "#F0F0F0", "Separator": { "background": "#FBFBFB", "foreground": "#FBFBFB", @@ -648,6 +668,7 @@ "borderColor": "#F0F0F0", "bottomSeparatorColor": "#FBFBFB", "cellBorder": "4,0,4,0", + "disabledForeground": "#93A1A1", "foreground": "#403f53", "focusCellBackground": "#d3e8f8", "focusCellForeground": "#333333", @@ -746,17 +767,36 @@ "hash": "#d9d9d9", "modifiedItemForeground": "#2AA298", "rowHeight": 28, - "selectionBackground": "#d3e8f870", + "selectionBackground": "#d3e8f87c", "selectionForeground": "#403f53", "selectionInactiveForeground": "#403f53", - "selectionInactiveBackground": "#d3e8f825", + "selectionInactiveBackground": "#d3e8f87c", "textBackground": "#f0f0f0" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#d9d9d9", + "ColorPicker.background": "#F0F0F0", + "ColorPicker.foreground": "#403f53", + "Component.borderColor": "#d9d9d9", + "Component.background": "#F0F0F0", + "Component.foreground": "#403f53", + "Connector.borderColor": "#d9d9d9", + "Connector.hoverBorderColor": "#CCCCCC", + "Canvas.background": "#f0f0f0", + "highStroke.foreground": "#403f53", + "Label.foreground": "#90A7B2", + "List.selectionBackground": "#d3e8f87c", + "Panel.borderColor": "#d9d9d9", "Panel.background": "#F0F0F0", - "Preview.background": "#F0F0F0" + "percent.foreground": "#403f53", + "Placeholder.background": "#F0F0F0", + "Placeholder.borderColor": "#d9d9d9", + "Placeholder.foreground": "#403f53", + "Placeholder.selectedForeground": "#403f53", + "Preview.background": "#F0F0F0", + "stroke.acceleratorForeground": "#90A7B2" }, "ValidationTooltip": { "errorBackground": "#F0F0F0", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F0F0F0" }, + "GitCommits": { + "graphColor": "#CCCCCC" + }, "GitLog": { "localBranchIconColor": "#2AA298", "otherIconColor": "#90A7B2", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c96765" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl.theme.json index 7644edce..bfa197d2 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Light Owl.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Light Owl.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#2AA29850", "hoverBorderColor": "#2AA29850", + "hoverSeparatorColor": "#d9d9d9", + "focusedBorderColor": "#2AA29850", "pressedBackground": "#2AA29850", "pressedBorderColor": "#2AA29850" }, @@ -66,6 +68,11 @@ "shadowColor": "#d9d9d9", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#d9d9d9", + "Tooltip.background": "#F0F0F0" + }, + "Content.background": "#f0f0f0", "CheckBox": { "background": "#F0F0F0", "disabledText": "#93A1A1", @@ -161,6 +168,7 @@ "hoverBackground": "#d3e8f8", "hoverColor": "#F0F0F0", "hoverMaskColor": "#CCCCCC", + "inactiveColoredFileBackground": "#d9d9d9", "inactiveUnderlineColor": "#93A1A1", "inactiveMaskColor": "#F0F0F0", "underlineColor": "#2AA298", @@ -193,6 +201,7 @@ "hoverColor": "#CCCCCC", "hoverMaskColor": "#CCCCCC", "inactiveMaskColor": "#F0F0F0", + "inactiveColoredFileBackground": "#F0F0F02", "inactiveUnderlineColor": "#93A1A1", "selectedForeground": "#403f53", "selectedBackground": "#d3e8f8", @@ -288,13 +297,14 @@ "secondaryForeground": "#90A7B2", "visitedForeground": "#2AA298" }, + "link.foreground": "#2AA298", "List": { "background": "#FBFBFB", "foreground": "#403f53", "selectionBackground": "#d3e8f850", "selectionForeground": "#403f53", "selectionInactiveForeground": "#333333", - "selectionInactiveBackground": "#d3e8f825" + "selectionInactiveBackground": "#d3e8f87c" }, "material": { "background": "#F0F0F0", @@ -360,6 +370,7 @@ "background": "#F0F0F0" } }, + "NewPSD.warning": "#2AA298", "Notification": { "background": "#F0F0F0", "borderColor": "#F0F0F0", @@ -387,7 +398,9 @@ "messageForeground": "#403f53" }, "Outline": { - "color": "#d9d9d9" + "color": "#d9d9d9", + "focusedColor": "#2AA298", + "disabledColor": "#93A1A1" }, "Panel": { "background": "#F0F0F0", @@ -417,15 +430,17 @@ "disabledForeground": "#93A1A1", "eapTagBackground": "#CCCCCC", "lightSelectionBackground": "#d3e8f8", + "paidTagBackground": "#CCCCCC", "selectionBackground": "#d3e8f8", "tagForeground": "#2AA298", "tagBackground": "#CCCCCC", + "trialTagBackground": "#CCCCCC", "Button": { "installBackground": "#d9d9d9", "installBorderColor": "#d9d9d9", "installForeground": "#403f53", "installFocusedBackground": "#CCCCCC", - "installFillForeground": "#90A7B2", + "installFillForeground": "#93A1A1", "installFillBackground": "#d9d9d9", "updateBackground": "#d9d9d9", "updateBorderColor": "#d9d9d9", @@ -462,6 +477,7 @@ "separatorForeground": "#403f53", "separatorColor": "#FBFBFB", "Toolbar": { + "Floating.background": "#f0f0f0", "background": "#f0f0f0", "borderColor": "#f0f0f0" } @@ -483,6 +499,9 @@ "selectionBackground": "#CCCCCC", "trackColor": "#CCCCCC" }, + "PsiViewer": { + "referenceHighlightColor": "#2AA298" + }, "RadioButton": { "background": "#F0F0F0", "disabledText": "#93A1A1", @@ -559,6 +578,7 @@ "endBackground": "#2AA298", "startBackground": "#2AA298" }, + "SearchField.errorBackground": "#F0F0F0", "Separator": { "background": "#FBFBFB", "foreground": "#FBFBFB", @@ -648,6 +668,7 @@ "borderColor": "#F0F0F0", "bottomSeparatorColor": "#FBFBFB", "cellBorder": "4,0,4,0", + "disabledForeground": "#93A1A1", "foreground": "#403f53", "focusCellBackground": "#d3e8f8", "focusCellForeground": "#333333", @@ -746,17 +767,36 @@ "hash": "#d9d9d9", "modifiedItemForeground": "#2AA298", "rowHeight": 28, - "selectionBackground": "#d3e8f870", + "selectionBackground": "#d3e8f87c", "selectionForeground": "#403f53", "selectionInactiveForeground": "#403f53", - "selectionInactiveBackground": "#d3e8f825", + "selectionInactiveBackground": "#d3e8f87c", "textBackground": "#F0F0F0" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#d9d9d9", + "ColorPicker.background": "#F0F0F0", + "ColorPicker.foreground": "#403f53", + "Component.borderColor": "#d9d9d9", + "Component.background": "#F0F0F0", + "Component.foreground": "#403f53", + "Connector.borderColor": "#d9d9d9", + "Connector.hoverBorderColor": "#CCCCCC", + "Canvas.background": "#f0f0f0", + "highStroke.foreground": "#403f53", + "Label.foreground": "#90A7B2", + "List.selectionBackground": "#d3e8f87c", + "Panel.borderColor": "#d9d9d9", "Panel.background": "#F0F0F0", - "Preview.background": "#F0F0F0" + "percent.foreground": "#403f53", + "Placeholder.background": "#F0F0F0", + "Placeholder.borderColor": "#d9d9d9", + "Placeholder.foreground": "#403f53", + "Placeholder.selectedForeground": "#403f53", + "Preview.background": "#F0F0F0", + "stroke.acceleratorForeground": "#90A7B2" }, "ValidationTooltip": { "errorBackground": "#F0F0F0", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#F0F0F0" }, + "GitCommits": { + "graphColor": "#CCCCCC" + }, "GitLog": { "localBranchIconColor": "#2AA298", "otherIconColor": "#90A7B2", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c96765" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker Contrast.theme.json index b461afb3..adbb78e5 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#FF980050", "hoverBorderColor": "#FF980050", + "hoverSeparatorColor": "#2A2A2A", + "focusedBorderColor": "#FF980050", "pressedBackground": "#FF980050", "pressedBorderColor": "#FF980050" }, @@ -66,6 +68,11 @@ "shadowColor": "#2A2A2A", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#292929", + "Tooltip.background": "#1A1A1A" + }, + "Content.background": "#1A1A1A", "CheckBox": { "background": "#212121", "disabledText": "#474747", @@ -161,6 +168,7 @@ "hoverBackground": "#323232", "hoverColor": "#1A1A1A", "hoverMaskColor": "#3F3F3F", + "inactiveColoredFileBackground": "#2A2A2A", "inactiveUnderlineColor": "#474747", "inactiveMaskColor": "#1A1A1A", "underlineColor": "#FF9800", @@ -193,6 +201,7 @@ "hoverColor": "#3F3F3F", "hoverMaskColor": "#3F3F3F", "inactiveMaskColor": "#212121", + "inactiveColoredFileBackground": "#2121212", "inactiveUnderlineColor": "#474747", "selectedForeground": "#B0BEC5", "selectedBackground": "#323232", @@ -288,13 +297,14 @@ "secondaryForeground": "#727272", "visitedForeground": "#FF9800" }, + "link.foreground": "#FF9800", "List": { "background": "#292929", "foreground": "#B0BEC5", "selectionBackground": "#40404050", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#32323225" + "selectionInactiveBackground": "#323232c0" }, "material": { "background": "#212121", @@ -360,6 +370,7 @@ "background": "#1A1A1A" } }, + "NewPSD.warning": "#FF9800", "Notification": { "background": "#1A1A1A", "borderColor": "#1A1A1A", @@ -387,7 +398,9 @@ "messageForeground": "#B0BEC5" }, "Outline": { - "color": "#2A2A2A" + "color": "#2A2A2A", + "focusedColor": "#FF9800", + "disabledColor": "#474747" }, "Panel": { "background": "#212121", @@ -417,15 +430,17 @@ "disabledForeground": "#474747", "eapTagBackground": "#3F3F3F", "lightSelectionBackground": "#404040", + "paidTagBackground": "#3F3F3F", "selectionBackground": "#404040", "tagForeground": "#FF9800", "tagBackground": "#3F3F3F", + "trialTagBackground": "#3F3F3F", "Button": { "installBackground": "#2A2A2A", "installBorderColor": "#2A2A2A", "installForeground": "#B0BEC5", "installFocusedBackground": "#3F3F3F", - "installFillForeground": "#727272", + "installFillForeground": "#474747", "installFillBackground": "#2A2A2A", "updateBackground": "#2A2A2A", "updateBorderColor": "#2A2A2A", @@ -462,6 +477,7 @@ "separatorForeground": "#B0BEC5", "separatorColor": "#292929", "Toolbar": { + "Floating.background": "#1A1A1A", "background": "#1A1A1A", "borderColor": "#1A1A1A" } @@ -483,6 +499,9 @@ "selectionBackground": "#3F3F3F", "trackColor": "#3F3F3F" }, + "PsiViewer": { + "referenceHighlightColor": "#FF9800" + }, "RadioButton": { "background": "#212121", "disabledText": "#474747", @@ -559,6 +578,7 @@ "endBackground": "#FF9800", "startBackground": "#FF9800" }, + "SearchField.errorBackground": "#1A1A1A", "Separator": { "background": "#292929", "foreground": "#292929", @@ -648,6 +668,7 @@ "borderColor": "#212121", "bottomSeparatorColor": "#292929", "cellBorder": "4,0,4,0", + "disabledForeground": "#474747", "foreground": "#B0BEC5", "focusCellBackground": "#323232", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#292929", "modifiedItemForeground": "#FF9800", "rowHeight": 28, - "selectionBackground": "#32323270", + "selectionBackground": "#323232c0", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#32323225", + "selectionInactiveBackground": "#323232c0", "textBackground": "#1A1A1A" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#292929", + "ColorPicker.background": "#212121", + "ColorPicker.foreground": "#B0BEC5", + "Component.borderColor": "#292929", + "Component.background": "#212121", + "Component.foreground": "#B0BEC5", + "Connector.borderColor": "#292929", + "Connector.hoverBorderColor": "#3F3F3F", + "Canvas.background": "#1A1A1A", + "highStroke.foreground": "#B0BEC5", + "Label.foreground": "#727272", + "List.selectionBackground": "#323232c0", + "Panel.borderColor": "#292929", "Panel.background": "#212121", - "Preview.background": "#212121" + "percent.foreground": "#B0BEC5", + "Placeholder.background": "#212121", + "Placeholder.borderColor": "#292929", + "Placeholder.foreground": "#B0BEC5", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#212121", + "stroke.acceleratorForeground": "#727272" }, "ValidationTooltip": { "errorBackground": "#1A1A1A", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#212121" }, + "GitCommits": { + "graphColor": "#3F3F3F" + }, "GitLog": { "localBranchIconColor": "#FF9800", "otherIconColor": "#727272", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker.theme.json index 8f12cfd8..4cb6f3a1 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Darker.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Darker.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#FF980050", "hoverBorderColor": "#FF980050", + "hoverSeparatorColor": "#2A2A2A", + "focusedBorderColor": "#FF980050", "pressedBackground": "#FF980050", "pressedBorderColor": "#FF980050" }, @@ -66,6 +68,11 @@ "shadowColor": "#2A2A2A", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#292929", + "Tooltip.background": "#1A1A1A" + }, + "Content.background": "#1A1A1A", "CheckBox": { "background": "#212121", "disabledText": "#474747", @@ -161,6 +168,7 @@ "hoverBackground": "#323232", "hoverColor": "#212121", "hoverMaskColor": "#3F3F3F", + "inactiveColoredFileBackground": "#2A2A2A", "inactiveUnderlineColor": "#474747", "inactiveMaskColor": "#212121", "underlineColor": "#FF9800", @@ -193,6 +201,7 @@ "hoverColor": "#3F3F3F", "hoverMaskColor": "#3F3F3F", "inactiveMaskColor": "#212121", + "inactiveColoredFileBackground": "#2121212", "inactiveUnderlineColor": "#474747", "selectedForeground": "#B0BEC5", "selectedBackground": "#323232", @@ -288,13 +297,14 @@ "secondaryForeground": "#727272", "visitedForeground": "#FF9800" }, + "link.foreground": "#FF9800", "List": { "background": "#292929", "foreground": "#B0BEC5", "selectionBackground": "#40404050", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#32323225" + "selectionInactiveBackground": "#323232c0" }, "material": { "background": "#212121", @@ -360,6 +370,7 @@ "background": "#212121" } }, + "NewPSD.warning": "#FF9800", "Notification": { "background": "#1A1A1A", "borderColor": "#1A1A1A", @@ -387,7 +398,9 @@ "messageForeground": "#B0BEC5" }, "Outline": { - "color": "#2A2A2A" + "color": "#2A2A2A", + "focusedColor": "#FF9800", + "disabledColor": "#474747" }, "Panel": { "background": "#212121", @@ -417,15 +430,17 @@ "disabledForeground": "#474747", "eapTagBackground": "#3F3F3F", "lightSelectionBackground": "#404040", + "paidTagBackground": "#3F3F3F", "selectionBackground": "#404040", "tagForeground": "#FF9800", "tagBackground": "#3F3F3F", + "trialTagBackground": "#3F3F3F", "Button": { "installBackground": "#2A2A2A", "installBorderColor": "#2A2A2A", "installForeground": "#B0BEC5", "installFocusedBackground": "#3F3F3F", - "installFillForeground": "#727272", + "installFillForeground": "#474747", "installFillBackground": "#2A2A2A", "updateBackground": "#2A2A2A", "updateBorderColor": "#2A2A2A", @@ -462,6 +477,7 @@ "separatorForeground": "#B0BEC5", "separatorColor": "#292929", "Toolbar": { + "Floating.background": "#1A1A1A", "background": "#1A1A1A", "borderColor": "#1A1A1A" } @@ -483,6 +499,9 @@ "selectionBackground": "#3F3F3F", "trackColor": "#3F3F3F" }, + "PsiViewer": { + "referenceHighlightColor": "#FF9800" + }, "RadioButton": { "background": "#212121", "disabledText": "#474747", @@ -559,6 +578,7 @@ "endBackground": "#FF9800", "startBackground": "#FF9800" }, + "SearchField.errorBackground": "#1A1A1A", "Separator": { "background": "#292929", "foreground": "#292929", @@ -648,6 +668,7 @@ "borderColor": "#212121", "bottomSeparatorColor": "#292929", "cellBorder": "4,0,4,0", + "disabledForeground": "#474747", "foreground": "#B0BEC5", "focusCellBackground": "#323232", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#292929", "modifiedItemForeground": "#FF9800", "rowHeight": 28, - "selectionBackground": "#32323270", + "selectionBackground": "#323232c0", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#32323225", + "selectionInactiveBackground": "#323232c0", "textBackground": "#212121" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#292929", + "ColorPicker.background": "#212121", + "ColorPicker.foreground": "#B0BEC5", + "Component.borderColor": "#292929", + "Component.background": "#212121", + "Component.foreground": "#B0BEC5", + "Connector.borderColor": "#292929", + "Connector.hoverBorderColor": "#3F3F3F", + "Canvas.background": "#1A1A1A", + "highStroke.foreground": "#B0BEC5", + "Label.foreground": "#727272", + "List.selectionBackground": "#323232c0", + "Panel.borderColor": "#292929", "Panel.background": "#212121", - "Preview.background": "#212121" + "percent.foreground": "#B0BEC5", + "Placeholder.background": "#212121", + "Placeholder.borderColor": "#292929", + "Placeholder.foreground": "#B0BEC5", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#212121", + "stroke.acceleratorForeground": "#727272" }, "ValidationTooltip": { "errorBackground": "#1A1A1A", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#212121" }, + "GitCommits": { + "graphColor": "#3F3F3F" + }, "GitLog": { "localBranchIconColor": "#FF9800", "otherIconColor": "#727272", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json index 4a47a650..c4df47a4 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#84ffff50", "hoverBorderColor": "#84ffff50", + "hoverSeparatorColor": "#191A21", + "focusedBorderColor": "#84ffff50", "pressedBackground": "#84ffff50", "pressedBorderColor": "#84ffff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#191A21", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#0F111A", + "Tooltip.background": "#090B10" + }, + "Content.background": "#090B10", "CheckBox": { "background": "#0F111A", "disabledText": "#464B5D", @@ -161,6 +168,7 @@ "hoverBackground": "#1A1C25", "hoverColor": "#090B10", "hoverMaskColor": "#1F2233", + "inactiveColoredFileBackground": "#191A21", "inactiveUnderlineColor": "#464B5D", "inactiveMaskColor": "#090B10", "underlineColor": "#84ffff", @@ -193,6 +201,7 @@ "hoverColor": "#1F2233", "hoverMaskColor": "#1F2233", "inactiveMaskColor": "#0F111A", + "inactiveColoredFileBackground": "#0F111A2", "inactiveUnderlineColor": "#464B5D", "selectedForeground": "#8F93A2", "selectedBackground": "#1A1C25", @@ -288,13 +297,14 @@ "secondaryForeground": "#4B526D", "visitedForeground": "#84ffff" }, + "link.foreground": "#84ffff", "List": { "background": "#181A1F", "foreground": "#8F93A2", "selectionBackground": "#23263250", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#717CB425" + "selectionInactiveBackground": "#717CB430" }, "material": { "background": "#0F111A", @@ -360,6 +370,7 @@ "background": "#090B10" } }, + "NewPSD.warning": "#84ffff", "Notification": { "background": "#090B10", "borderColor": "#090B10", @@ -387,7 +398,9 @@ "messageForeground": "#8F93A2" }, "Outline": { - "color": "#191A21" + "color": "#191A21", + "focusedColor": "#84ffff", + "disabledColor": "#464B5D" }, "Panel": { "background": "#0F111A", @@ -417,15 +430,17 @@ "disabledForeground": "#464B5D", "eapTagBackground": "#1F2233", "lightSelectionBackground": "#232632", + "paidTagBackground": "#1F2233", "selectionBackground": "#232632", "tagForeground": "#84ffff", "tagBackground": "#1F2233", + "trialTagBackground": "#1F2233", "Button": { "installBackground": "#191A21", "installBorderColor": "#191A21", "installForeground": "#8F93A2", "installFocusedBackground": "#1F2233", - "installFillForeground": "#4B526D", + "installFillForeground": "#464B5D", "installFillBackground": "#191A21", "updateBackground": "#191A21", "updateBorderColor": "#191A21", @@ -462,6 +477,7 @@ "separatorForeground": "#8F93A2", "separatorColor": "#181A1F", "Toolbar": { + "Floating.background": "#090B10", "background": "#090B10", "borderColor": "#090B10" } @@ -483,6 +499,9 @@ "selectionBackground": "#1F2233", "trackColor": "#1F2233" }, + "PsiViewer": { + "referenceHighlightColor": "#84ffff" + }, "RadioButton": { "background": "#0F111A", "disabledText": "#464B5D", @@ -559,6 +578,7 @@ "endBackground": "#84ffff", "startBackground": "#84ffff" }, + "SearchField.errorBackground": "#090B10", "Separator": { "background": "#181A1F", "foreground": "#181A1F", @@ -648,6 +668,7 @@ "borderColor": "#0F111A", "bottomSeparatorColor": "#181A1F", "cellBorder": "4,0,4,0", + "disabledForeground": "#464B5D", "foreground": "#8F93A2", "focusCellBackground": "#1A1C25", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#0F111A", "modifiedItemForeground": "#84ffff", "rowHeight": 28, - "selectionBackground": "#717CB470", + "selectionBackground": "#717CB430", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#717CB425", + "selectionInactiveBackground": "#717CB430", "textBackground": "#090B10" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#0F111A", + "ColorPicker.background": "#0F111A", + "ColorPicker.foreground": "#8F93A2", + "Component.borderColor": "#0F111A", + "Component.background": "#0F111A", + "Component.foreground": "#8F93A2", + "Connector.borderColor": "#0F111A", + "Connector.hoverBorderColor": "#1F2233", + "Canvas.background": "#090B10", + "highStroke.foreground": "#8F93A2", + "Label.foreground": "#4B526D", + "List.selectionBackground": "#717CB430", + "Panel.borderColor": "#0F111A", "Panel.background": "#0F111A", - "Preview.background": "#0F111A" + "percent.foreground": "#8F93A2", + "Placeholder.background": "#0F111A", + "Placeholder.borderColor": "#0F111A", + "Placeholder.foreground": "#8F93A2", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#0F111A", + "stroke.acceleratorForeground": "#4B526D" }, "ValidationTooltip": { "errorBackground": "#090B10", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#0F111A" }, + "GitCommits": { + "graphColor": "#1F2233" + }, "GitLog": { "localBranchIconColor": "#84ffff", "otherIconColor": "#4B526D", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean.theme.json index 53044940..4d5b6173 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Deep Ocean.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Deep Ocean.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#84ffff50", "hoverBorderColor": "#84ffff50", + "hoverSeparatorColor": "#191A21", + "focusedBorderColor": "#84ffff50", "pressedBackground": "#84ffff50", "pressedBorderColor": "#84ffff50" }, @@ -66,6 +68,11 @@ "shadowColor": "#191A21", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#0F111A", + "Tooltip.background": "#090B10" + }, + "Content.background": "#090B10", "CheckBox": { "background": "#0F111A", "disabledText": "#464B5D", @@ -161,6 +168,7 @@ "hoverBackground": "#1A1C25", "hoverColor": "#0F111A", "hoverMaskColor": "#1F2233", + "inactiveColoredFileBackground": "#191A21", "inactiveUnderlineColor": "#464B5D", "inactiveMaskColor": "#0F111A", "underlineColor": "#84ffff", @@ -193,6 +201,7 @@ "hoverColor": "#1F2233", "hoverMaskColor": "#1F2233", "inactiveMaskColor": "#0F111A", + "inactiveColoredFileBackground": "#0F111A2", "inactiveUnderlineColor": "#464B5D", "selectedForeground": "#8F93A2", "selectedBackground": "#1A1C25", @@ -288,13 +297,14 @@ "secondaryForeground": "#4B526D", "visitedForeground": "#84ffff" }, + "link.foreground": "#84ffff", "List": { "background": "#181A1F", "foreground": "#8F93A2", "selectionBackground": "#23263250", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#717CB425" + "selectionInactiveBackground": "#717CB430" }, "material": { "background": "#0F111A", @@ -360,6 +370,7 @@ "background": "#0F111A" } }, + "NewPSD.warning": "#84ffff", "Notification": { "background": "#090B10", "borderColor": "#090B10", @@ -387,7 +398,9 @@ "messageForeground": "#8F93A2" }, "Outline": { - "color": "#191A21" + "color": "#191A21", + "focusedColor": "#84ffff", + "disabledColor": "#464B5D" }, "Panel": { "background": "#0F111A", @@ -417,15 +430,17 @@ "disabledForeground": "#464B5D", "eapTagBackground": "#1F2233", "lightSelectionBackground": "#232632", + "paidTagBackground": "#1F2233", "selectionBackground": "#232632", "tagForeground": "#84ffff", "tagBackground": "#1F2233", + "trialTagBackground": "#1F2233", "Button": { "installBackground": "#191A21", "installBorderColor": "#191A21", "installForeground": "#8F93A2", "installFocusedBackground": "#1F2233", - "installFillForeground": "#4B526D", + "installFillForeground": "#464B5D", "installFillBackground": "#191A21", "updateBackground": "#191A21", "updateBorderColor": "#191A21", @@ -462,6 +477,7 @@ "separatorForeground": "#8F93A2", "separatorColor": "#181A1F", "Toolbar": { + "Floating.background": "#090B10", "background": "#090B10", "borderColor": "#090B10" } @@ -483,6 +499,9 @@ "selectionBackground": "#1F2233", "trackColor": "#1F2233" }, + "PsiViewer": { + "referenceHighlightColor": "#84ffff" + }, "RadioButton": { "background": "#0F111A", "disabledText": "#464B5D", @@ -559,6 +578,7 @@ "endBackground": "#84ffff", "startBackground": "#84ffff" }, + "SearchField.errorBackground": "#090B10", "Separator": { "background": "#181A1F", "foreground": "#181A1F", @@ -648,6 +668,7 @@ "borderColor": "#0F111A", "bottomSeparatorColor": "#181A1F", "cellBorder": "4,0,4,0", + "disabledForeground": "#464B5D", "foreground": "#8F93A2", "focusCellBackground": "#1A1C25", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#0F111A", "modifiedItemForeground": "#84ffff", "rowHeight": 28, - "selectionBackground": "#717CB470", + "selectionBackground": "#717CB430", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#717CB425", + "selectionInactiveBackground": "#717CB430", "textBackground": "#0F111A" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#0F111A", + "ColorPicker.background": "#0F111A", + "ColorPicker.foreground": "#8F93A2", + "Component.borderColor": "#0F111A", + "Component.background": "#0F111A", + "Component.foreground": "#8F93A2", + "Connector.borderColor": "#0F111A", + "Connector.hoverBorderColor": "#1F2233", + "Canvas.background": "#090B10", + "highStroke.foreground": "#8F93A2", + "Label.foreground": "#4B526D", + "List.selectionBackground": "#717CB430", + "Panel.borderColor": "#0F111A", "Panel.background": "#0F111A", - "Preview.background": "#0F111A" + "percent.foreground": "#8F93A2", + "Placeholder.background": "#0F111A", + "Placeholder.borderColor": "#0F111A", + "Placeholder.foreground": "#8F93A2", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#0F111A", + "stroke.acceleratorForeground": "#4B526D" }, "ValidationTooltip": { "errorBackground": "#090B10", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#0F111A" }, + "GitCommits": { + "graphColor": "#1F2233" + }, "GitLog": { "localBranchIconColor": "#84ffff", "otherIconColor": "#4B526D", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter Contrast.theme.json index 51b7f57e..edde7257 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#00BCD450", "hoverBorderColor": "#00BCD450", + "hoverSeparatorColor": "#F3F4F5", + "focusedBorderColor": "#00BCD450", "pressedBackground": "#00BCD450", "pressedBorderColor": "#00BCD450" }, @@ -66,6 +68,11 @@ "shadowColor": "#F3F4F5", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#d3e1e8", + "Tooltip.background": "#eae8e8" + }, + "Content.background": "#EEEEEE", "CheckBox": { "background": "#FAFAFA", "disabledText": "#D2D4D5", @@ -161,6 +168,7 @@ "hoverBackground": "#E7E7E8", "hoverColor": "#EEEEEE", "hoverMaskColor": "#E7E7E8", + "inactiveColoredFileBackground": "#F3F4F5", "inactiveUnderlineColor": "#D2D4D5", "inactiveMaskColor": "#EEEEEE", "underlineColor": "#00BCD4", @@ -193,6 +201,7 @@ "hoverColor": "#E7E7E8", "hoverMaskColor": "#E7E7E8", "inactiveMaskColor": "#FAFAFA", + "inactiveColoredFileBackground": "#FAFAFA2", "inactiveUnderlineColor": "#D2D4D5", "selectedForeground": "#546E7A", "selectedBackground": "#E7E7E8", @@ -288,13 +297,14 @@ "secondaryForeground": "#94A7B0", "visitedForeground": "#00BCD4" }, + "link.foreground": "#00BCD4", "List": { "background": "#FFFFFF", "foreground": "#546E7A", "selectionBackground": "#80CBC450", "selectionForeground": "#546e7a", "selectionInactiveForeground": "#546e7a", - "selectionInactiveBackground": "#80CBC425" + "selectionInactiveBackground": "#80CBC440" }, "material": { "background": "#FAFAFA", @@ -360,6 +370,7 @@ "background": "#EEEEEE" } }, + "NewPSD.warning": "#00BCD4", "Notification": { "background": "#eae8e8", "borderColor": "#eae8e8", @@ -387,7 +398,9 @@ "messageForeground": "#546E7A" }, "Outline": { - "color": "#F3F4F5" + "color": "#F3F4F5", + "focusedColor": "#00BCD4", + "disabledColor": "#D2D4D5" }, "Panel": { "background": "#FAFAFA", @@ -417,15 +430,17 @@ "disabledForeground": "#D2D4D5", "eapTagBackground": "#E7E7E8", "lightSelectionBackground": "#80CBC4", + "paidTagBackground": "#E7E7E8", "selectionBackground": "#80CBC4", "tagForeground": "#00BCD4", "tagBackground": "#E7E7E8", + "trialTagBackground": "#E7E7E8", "Button": { "installBackground": "#F3F4F5", "installBorderColor": "#F3F4F5", "installForeground": "#546E7A", "installFocusedBackground": "#E7E7E8", - "installFillForeground": "#94A7B0", + "installFillForeground": "#D2D4D5", "installFillBackground": "#F3F4F5", "updateBackground": "#F3F4F5", "updateBorderColor": "#F3F4F5", @@ -462,6 +477,7 @@ "separatorForeground": "#546E7A", "separatorColor": "#FFFFFF", "Toolbar": { + "Floating.background": "#EEEEEE", "background": "#EEEEEE", "borderColor": "#EEEEEE" } @@ -483,6 +499,9 @@ "selectionBackground": "#E7E7E8", "trackColor": "#E7E7E8" }, + "PsiViewer": { + "referenceHighlightColor": "#00BCD4" + }, "RadioButton": { "background": "#FAFAFA", "disabledText": "#D2D4D5", @@ -559,6 +578,7 @@ "endBackground": "#00BCD4", "startBackground": "#00BCD4" }, + "SearchField.errorBackground": "#eae8e8", "Separator": { "background": "#FFFFFF", "foreground": "#FFFFFF", @@ -648,6 +668,7 @@ "borderColor": "#FAFAFA", "bottomSeparatorColor": "#FFFFFF", "cellBorder": "4,0,4,0", + "disabledForeground": "#D2D4D5", "foreground": "#546E7A", "focusCellBackground": "#E7E7E8", "focusCellForeground": "#546e7a", @@ -746,17 +767,36 @@ "hash": "#d3e1e8", "modifiedItemForeground": "#00BCD4", "rowHeight": 28, - "selectionBackground": "#80CBC470", + "selectionBackground": "#80CBC440", "selectionForeground": "#546e7a", "selectionInactiveForeground": "#546e7a", - "selectionInactiveBackground": "#80CBC425", + "selectionInactiveBackground": "#80CBC440", "textBackground": "#EEEEEE" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#d3e1e8", + "ColorPicker.background": "#FAFAFA", + "ColorPicker.foreground": "#546E7A", + "Component.borderColor": "#d3e1e8", + "Component.background": "#FAFAFA", + "Component.foreground": "#546E7A", + "Connector.borderColor": "#d3e1e8", + "Connector.hoverBorderColor": "#E7E7E8", + "Canvas.background": "#EEEEEE", + "highStroke.foreground": "#546E7A", + "Label.foreground": "#94A7B0", + "List.selectionBackground": "#80CBC440", + "Panel.borderColor": "#d3e1e8", "Panel.background": "#FAFAFA", - "Preview.background": "#FAFAFA" + "percent.foreground": "#546E7A", + "Placeholder.background": "#FAFAFA", + "Placeholder.borderColor": "#d3e1e8", + "Placeholder.foreground": "#546E7A", + "Placeholder.selectedForeground": "#546e7a", + "Preview.background": "#FAFAFA", + "stroke.acceleratorForeground": "#94A7B0" }, "ValidationTooltip": { "errorBackground": "#eae8e8", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#FAFAFA" }, + "GitCommits": { + "graphColor": "#E7E7E8" + }, "GitLog": { "localBranchIconColor": "#00BCD4", "otherIconColor": "#94A7B0", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#91B859" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter.theme.json index b1a26e3d..26ce91a8 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Lighter.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Lighter.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#00BCD450", "hoverBorderColor": "#00BCD450", + "hoverSeparatorColor": "#F3F4F5", + "focusedBorderColor": "#00BCD450", "pressedBackground": "#00BCD450", "pressedBorderColor": "#00BCD450" }, @@ -66,6 +68,11 @@ "shadowColor": "#F3F4F5", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#d3e1e8", + "Tooltip.background": "#eae8e8" + }, + "Content.background": "#EEEEEE", "CheckBox": { "background": "#FAFAFA", "disabledText": "#D2D4D5", @@ -161,6 +168,7 @@ "hoverBackground": "#E7E7E8", "hoverColor": "#FAFAFA", "hoverMaskColor": "#E7E7E8", + "inactiveColoredFileBackground": "#F3F4F5", "inactiveUnderlineColor": "#D2D4D5", "inactiveMaskColor": "#FAFAFA", "underlineColor": "#00BCD4", @@ -193,6 +201,7 @@ "hoverColor": "#E7E7E8", "hoverMaskColor": "#E7E7E8", "inactiveMaskColor": "#FAFAFA", + "inactiveColoredFileBackground": "#FAFAFA2", "inactiveUnderlineColor": "#D2D4D5", "selectedForeground": "#546E7A", "selectedBackground": "#E7E7E8", @@ -288,13 +297,14 @@ "secondaryForeground": "#94A7B0", "visitedForeground": "#00BCD4" }, + "link.foreground": "#00BCD4", "List": { "background": "#FFFFFF", "foreground": "#546E7A", "selectionBackground": "#80CBC450", "selectionForeground": "#546e7a", "selectionInactiveForeground": "#546e7a", - "selectionInactiveBackground": "#80CBC425" + "selectionInactiveBackground": "#80CBC440" }, "material": { "background": "#FAFAFA", @@ -360,6 +370,7 @@ "background": "#FAFAFA" } }, + "NewPSD.warning": "#00BCD4", "Notification": { "background": "#eae8e8", "borderColor": "#eae8e8", @@ -387,7 +398,9 @@ "messageForeground": "#546E7A" }, "Outline": { - "color": "#F3F4F5" + "color": "#F3F4F5", + "focusedColor": "#00BCD4", + "disabledColor": "#D2D4D5" }, "Panel": { "background": "#FAFAFA", @@ -417,15 +430,17 @@ "disabledForeground": "#D2D4D5", "eapTagBackground": "#E7E7E8", "lightSelectionBackground": "#80CBC4", + "paidTagBackground": "#E7E7E8", "selectionBackground": "#80CBC4", "tagForeground": "#00BCD4", "tagBackground": "#E7E7E8", + "trialTagBackground": "#E7E7E8", "Button": { "installBackground": "#F3F4F5", "installBorderColor": "#F3F4F5", "installForeground": "#546E7A", "installFocusedBackground": "#E7E7E8", - "installFillForeground": "#94A7B0", + "installFillForeground": "#D2D4D5", "installFillBackground": "#F3F4F5", "updateBackground": "#F3F4F5", "updateBorderColor": "#F3F4F5", @@ -462,6 +477,7 @@ "separatorForeground": "#546E7A", "separatorColor": "#FFFFFF", "Toolbar": { + "Floating.background": "#EEEEEE", "background": "#EEEEEE", "borderColor": "#EEEEEE" } @@ -483,6 +499,9 @@ "selectionBackground": "#E7E7E8", "trackColor": "#E7E7E8" }, + "PsiViewer": { + "referenceHighlightColor": "#00BCD4" + }, "RadioButton": { "background": "#FAFAFA", "disabledText": "#D2D4D5", @@ -559,6 +578,7 @@ "endBackground": "#00BCD4", "startBackground": "#00BCD4" }, + "SearchField.errorBackground": "#eae8e8", "Separator": { "background": "#FFFFFF", "foreground": "#FFFFFF", @@ -648,6 +668,7 @@ "borderColor": "#FAFAFA", "bottomSeparatorColor": "#FFFFFF", "cellBorder": "4,0,4,0", + "disabledForeground": "#D2D4D5", "foreground": "#546E7A", "focusCellBackground": "#E7E7E8", "focusCellForeground": "#546e7a", @@ -746,17 +767,36 @@ "hash": "#d3e1e8", "modifiedItemForeground": "#00BCD4", "rowHeight": 28, - "selectionBackground": "#80CBC470", + "selectionBackground": "#80CBC440", "selectionForeground": "#546e7a", "selectionInactiveForeground": "#546e7a", - "selectionInactiveBackground": "#80CBC425", + "selectionInactiveBackground": "#80CBC440", "textBackground": "#FAFAFA" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#d3e1e8", + "ColorPicker.background": "#FAFAFA", + "ColorPicker.foreground": "#546E7A", + "Component.borderColor": "#d3e1e8", + "Component.background": "#FAFAFA", + "Component.foreground": "#546E7A", + "Connector.borderColor": "#d3e1e8", + "Connector.hoverBorderColor": "#E7E7E8", + "Canvas.background": "#EEEEEE", + "highStroke.foreground": "#546E7A", + "Label.foreground": "#94A7B0", + "List.selectionBackground": "#80CBC440", + "Panel.borderColor": "#d3e1e8", "Panel.background": "#FAFAFA", - "Preview.background": "#FAFAFA" + "percent.foreground": "#546E7A", + "Placeholder.background": "#FAFAFA", + "Placeholder.borderColor": "#d3e1e8", + "Placeholder.foreground": "#546E7A", + "Placeholder.selectedForeground": "#546e7a", + "Preview.background": "#FAFAFA", + "stroke.acceleratorForeground": "#94A7B0" }, "ValidationTooltip": { "errorBackground": "#eae8e8", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#FAFAFA" }, + "GitCommits": { + "graphColor": "#E7E7E8" + }, "GitLog": { "localBranchIconColor": "#00BCD4", "otherIconColor": "#94A7B0", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#91B859" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic Contrast.theme.json index cc83b1f1..9e8d0483 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#00968850", "hoverBorderColor": "#00968850", + "hoverSeparatorColor": "#2E3C43", + "focusedBorderColor": "#00968850", "pressedBackground": "#00968850", "pressedBorderColor": "#00968850" }, @@ -66,6 +68,11 @@ "shadowColor": "#2E3C43", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2A373E", + "Tooltip.background": "#1E272C" + }, + "Content.background": "#1E272C", "CheckBox": { "background": "#263238", "disabledText": "#415967", @@ -161,6 +168,7 @@ "hoverBackground": "#314549", "hoverColor": "#1E272C", "hoverMaskColor": "#425B67", + "inactiveColoredFileBackground": "#2E3C43", "inactiveUnderlineColor": "#415967", "inactiveMaskColor": "#1E272C", "underlineColor": "#009688", @@ -193,6 +201,7 @@ "hoverColor": "#425B67", "hoverMaskColor": "#425B67", "inactiveMaskColor": "#263238", + "inactiveColoredFileBackground": "#2632382", "inactiveUnderlineColor": "#415967", "selectedForeground": "#B0BEC5", "selectedBackground": "#314549", @@ -288,13 +297,14 @@ "secondaryForeground": "#607D8B", "visitedForeground": "#009688" }, + "link.foreground": "#009688", "List": { "background": "#32424A", "foreground": "#B0BEC5", "selectionBackground": "#546E7A50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#546E7A25" + "selectionInactiveBackground": "#546E7A50" }, "material": { "background": "#263238", @@ -360,6 +370,7 @@ "background": "#1E272C" } }, + "NewPSD.warning": "#009688", "Notification": { "background": "#1E272C", "borderColor": "#1E272C", @@ -387,7 +398,9 @@ "messageForeground": "#B0BEC5" }, "Outline": { - "color": "#2E3C43" + "color": "#2E3C43", + "focusedColor": "#009688", + "disabledColor": "#415967" }, "Panel": { "background": "#263238", @@ -417,15 +430,17 @@ "disabledForeground": "#415967", "eapTagBackground": "#425B67", "lightSelectionBackground": "#546E7A", + "paidTagBackground": "#425B67", "selectionBackground": "#546E7A", "tagForeground": "#009688", "tagBackground": "#425B67", + "trialTagBackground": "#425B67", "Button": { "installBackground": "#2E3C43", "installBorderColor": "#2E3C43", "installForeground": "#B0BEC5", "installFocusedBackground": "#425B67", - "installFillForeground": "#607D8B", + "installFillForeground": "#415967", "installFillBackground": "#2E3C43", "updateBackground": "#2E3C43", "updateBorderColor": "#2E3C43", @@ -462,6 +477,7 @@ "separatorForeground": "#B0BEC5", "separatorColor": "#32424A", "Toolbar": { + "Floating.background": "#1E272C", "background": "#1E272C", "borderColor": "#1E272C" } @@ -483,6 +499,9 @@ "selectionBackground": "#425B67", "trackColor": "#425B67" }, + "PsiViewer": { + "referenceHighlightColor": "#009688" + }, "RadioButton": { "background": "#263238", "disabledText": "#415967", @@ -559,6 +578,7 @@ "endBackground": "#009688", "startBackground": "#009688" }, + "SearchField.errorBackground": "#1E272C", "Separator": { "background": "#32424A", "foreground": "#32424A", @@ -648,6 +668,7 @@ "borderColor": "#263238", "bottomSeparatorColor": "#32424A", "cellBorder": "4,0,4,0", + "disabledForeground": "#415967", "foreground": "#B0BEC5", "focusCellBackground": "#314549", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#2A373E", "modifiedItemForeground": "#009688", "rowHeight": 28, - "selectionBackground": "#546E7A70", + "selectionBackground": "#546E7A50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#546E7A25", + "selectionInactiveBackground": "#546E7A50", "textBackground": "#1E272C" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2A373E", + "ColorPicker.background": "#263238", + "ColorPicker.foreground": "#B0BEC5", + "Component.borderColor": "#2A373E", + "Component.background": "#263238", + "Component.foreground": "#B0BEC5", + "Connector.borderColor": "#2A373E", + "Connector.hoverBorderColor": "#425B67", + "Canvas.background": "#1E272C", + "highStroke.foreground": "#B0BEC5", + "Label.foreground": "#607D8B", + "List.selectionBackground": "#546E7A50", + "Panel.borderColor": "#2A373E", "Panel.background": "#263238", - "Preview.background": "#263238" + "percent.foreground": "#B0BEC5", + "Placeholder.background": "#263238", + "Placeholder.borderColor": "#2A373E", + "Placeholder.foreground": "#B0BEC5", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#263238", + "stroke.acceleratorForeground": "#607D8B" }, "ValidationTooltip": { "errorBackground": "#1E272C", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#263238" }, + "GitCommits": { + "graphColor": "#425B67" + }, "GitLog": { "localBranchIconColor": "#009688", "otherIconColor": "#607D8B", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic.theme.json index ba77a74e..40f47454 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Oceanic.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Oceanic.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#00968850", "hoverBorderColor": "#00968850", + "hoverSeparatorColor": "#2E3C43", + "focusedBorderColor": "#00968850", "pressedBackground": "#00968850", "pressedBorderColor": "#00968850" }, @@ -66,6 +68,11 @@ "shadowColor": "#2E3C43", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2A373E", + "Tooltip.background": "#1E272C" + }, + "Content.background": "#1E272C", "CheckBox": { "background": "#263238", "disabledText": "#415967", @@ -161,6 +168,7 @@ "hoverBackground": "#314549", "hoverColor": "#263238", "hoverMaskColor": "#425B67", + "inactiveColoredFileBackground": "#2E3C43", "inactiveUnderlineColor": "#415967", "inactiveMaskColor": "#263238", "underlineColor": "#009688", @@ -193,6 +201,7 @@ "hoverColor": "#425B67", "hoverMaskColor": "#425B67", "inactiveMaskColor": "#263238", + "inactiveColoredFileBackground": "#2632382", "inactiveUnderlineColor": "#415967", "selectedForeground": "#B0BEC5", "selectedBackground": "#314549", @@ -288,13 +297,14 @@ "secondaryForeground": "#607D8B", "visitedForeground": "#009688" }, + "link.foreground": "#009688", "List": { "background": "#32424A", "foreground": "#B0BEC5", "selectionBackground": "#546E7A50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#546E7A25" + "selectionInactiveBackground": "#546E7A50" }, "material": { "background": "#263238", @@ -360,6 +370,7 @@ "background": "#263238" } }, + "NewPSD.warning": "#009688", "Notification": { "background": "#1E272C", "borderColor": "#1E272C", @@ -387,7 +398,9 @@ "messageForeground": "#B0BEC5" }, "Outline": { - "color": "#2E3C43" + "color": "#2E3C43", + "focusedColor": "#009688", + "disabledColor": "#415967" }, "Panel": { "background": "#263238", @@ -417,15 +430,17 @@ "disabledForeground": "#415967", "eapTagBackground": "#425B67", "lightSelectionBackground": "#546E7A", + "paidTagBackground": "#425B67", "selectionBackground": "#546E7A", "tagForeground": "#009688", "tagBackground": "#425B67", + "trialTagBackground": "#425B67", "Button": { "installBackground": "#2E3C43", "installBorderColor": "#2E3C43", "installForeground": "#B0BEC5", "installFocusedBackground": "#425B67", - "installFillForeground": "#607D8B", + "installFillForeground": "#415967", "installFillBackground": "#2E3C43", "updateBackground": "#2E3C43", "updateBorderColor": "#2E3C43", @@ -462,6 +477,7 @@ "separatorForeground": "#B0BEC5", "separatorColor": "#32424A", "Toolbar": { + "Floating.background": "#1E272C", "background": "#1E272C", "borderColor": "#1E272C" } @@ -483,6 +499,9 @@ "selectionBackground": "#425B67", "trackColor": "#425B67" }, + "PsiViewer": { + "referenceHighlightColor": "#009688" + }, "RadioButton": { "background": "#263238", "disabledText": "#415967", @@ -559,6 +578,7 @@ "endBackground": "#009688", "startBackground": "#009688" }, + "SearchField.errorBackground": "#1E272C", "Separator": { "background": "#32424A", "foreground": "#32424A", @@ -648,6 +668,7 @@ "borderColor": "#263238", "bottomSeparatorColor": "#32424A", "cellBorder": "4,0,4,0", + "disabledForeground": "#415967", "foreground": "#B0BEC5", "focusCellBackground": "#314549", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#2A373E", "modifiedItemForeground": "#009688", "rowHeight": 28, - "selectionBackground": "#546E7A70", + "selectionBackground": "#546E7A50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#546E7A25", + "selectionInactiveBackground": "#546E7A50", "textBackground": "#263238" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2A373E", + "ColorPicker.background": "#263238", + "ColorPicker.foreground": "#B0BEC5", + "Component.borderColor": "#2A373E", + "Component.background": "#263238", + "Component.foreground": "#B0BEC5", + "Connector.borderColor": "#2A373E", + "Connector.hoverBorderColor": "#425B67", + "Canvas.background": "#1E272C", + "highStroke.foreground": "#B0BEC5", + "Label.foreground": "#607D8B", + "List.selectionBackground": "#546E7A50", + "Panel.borderColor": "#2A373E", "Panel.background": "#263238", - "Preview.background": "#263238" + "percent.foreground": "#B0BEC5", + "Placeholder.background": "#263238", + "Placeholder.borderColor": "#2A373E", + "Placeholder.foreground": "#B0BEC5", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#263238", + "stroke.acceleratorForeground": "#607D8B" }, "ValidationTooltip": { "errorBackground": "#1E272C", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#263238" }, + "GitCommits": { + "graphColor": "#425B67" + }, "GitLog": { "localBranchIconColor": "#009688", "otherIconColor": "#607D8B", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight Contrast.theme.json index e97f403e..d08262df 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#ab47bc50", "hoverBorderColor": "#ab47bc50", + "hoverSeparatorColor": "#303348", + "focusedBorderColor": "#ab47bc50", "pressedBackground": "#ab47bc50", "pressedBorderColor": "#ab47bc50" }, @@ -66,6 +68,11 @@ "shadowColor": "#303348", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2b2a3e", + "Tooltip.background": "#202331" + }, + "Content.background": "#202331", "CheckBox": { "background": "#292D3E", "disabledText": "#515772", @@ -161,6 +168,7 @@ "hoverBackground": "#414863", "hoverColor": "#202331", "hoverMaskColor": "#444267", + "inactiveColoredFileBackground": "#303348", "inactiveUnderlineColor": "#515772", "inactiveMaskColor": "#202331", "underlineColor": "#ab47bc", @@ -193,6 +201,7 @@ "hoverColor": "#444267", "hoverMaskColor": "#444267", "inactiveMaskColor": "#292D3E", + "inactiveColoredFileBackground": "#292D3E2", "inactiveUnderlineColor": "#515772", "selectedForeground": "#A6ACCD", "selectedBackground": "#414863", @@ -288,13 +297,14 @@ "secondaryForeground": "#676E95", "visitedForeground": "#ab47bc" }, + "link.foreground": "#ab47bc", "List": { "background": "#34324a", "foreground": "#A6ACCD", "selectionBackground": "#3C435E50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#676E9525" + "selectionInactiveBackground": "#676E9550" }, "material": { "background": "#292D3E", @@ -360,6 +370,7 @@ "background": "#202331" } }, + "NewPSD.warning": "#ab47bc", "Notification": { "background": "#202331", "borderColor": "#202331", @@ -387,7 +398,9 @@ "messageForeground": "#A6ACCD" }, "Outline": { - "color": "#303348" + "color": "#303348", + "focusedColor": "#ab47bc", + "disabledColor": "#515772" }, "Panel": { "background": "#292D3E", @@ -417,15 +430,17 @@ "disabledForeground": "#515772", "eapTagBackground": "#444267", "lightSelectionBackground": "#3C435E", + "paidTagBackground": "#444267", "selectionBackground": "#3C435E", "tagForeground": "#ab47bc", "tagBackground": "#444267", + "trialTagBackground": "#444267", "Button": { "installBackground": "#303348", "installBorderColor": "#303348", "installForeground": "#A6ACCD", "installFocusedBackground": "#444267", - "installFillForeground": "#676E95", + "installFillForeground": "#515772", "installFillBackground": "#303348", "updateBackground": "#303348", "updateBorderColor": "#303348", @@ -462,6 +477,7 @@ "separatorForeground": "#A6ACCD", "separatorColor": "#34324a", "Toolbar": { + "Floating.background": "#202331", "background": "#202331", "borderColor": "#202331" } @@ -483,6 +499,9 @@ "selectionBackground": "#444267", "trackColor": "#444267" }, + "PsiViewer": { + "referenceHighlightColor": "#ab47bc" + }, "RadioButton": { "background": "#292D3E", "disabledText": "#515772", @@ -559,6 +578,7 @@ "endBackground": "#ab47bc", "startBackground": "#ab47bc" }, + "SearchField.errorBackground": "#202331", "Separator": { "background": "#34324a", "foreground": "#34324a", @@ -648,6 +668,7 @@ "borderColor": "#292D3E", "bottomSeparatorColor": "#34324a", "cellBorder": "4,0,4,0", + "disabledForeground": "#515772", "foreground": "#A6ACCD", "focusCellBackground": "#414863", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#2b2a3e", "modifiedItemForeground": "#ab47bc", "rowHeight": 28, - "selectionBackground": "#676E9570", + "selectionBackground": "#676E9550", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#676E9525", + "selectionInactiveBackground": "#676E9550", "textBackground": "#202331" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2b2a3e", + "ColorPicker.background": "#292D3E", + "ColorPicker.foreground": "#A6ACCD", + "Component.borderColor": "#2b2a3e", + "Component.background": "#292D3E", + "Component.foreground": "#A6ACCD", + "Connector.borderColor": "#2b2a3e", + "Connector.hoverBorderColor": "#444267", + "Canvas.background": "#202331", + "highStroke.foreground": "#A6ACCD", + "Label.foreground": "#676E95", + "List.selectionBackground": "#676E9550", + "Panel.borderColor": "#2b2a3e", "Panel.background": "#292D3E", - "Preview.background": "#292D3E" + "percent.foreground": "#A6ACCD", + "Placeholder.background": "#292D3E", + "Placeholder.borderColor": "#2b2a3e", + "Placeholder.foreground": "#A6ACCD", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#292D3E", + "stroke.acceleratorForeground": "#676E95" }, "ValidationTooltip": { "errorBackground": "#202331", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#292D3E" }, + "GitCommits": { + "graphColor": "#444267" + }, "GitLog": { "localBranchIconColor": "#ab47bc", "otherIconColor": "#676E95", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight.theme.json index 21a1fdb2..bf0aec6f 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Palenight.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Palenight.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#ab47bc50", "hoverBorderColor": "#ab47bc50", + "hoverSeparatorColor": "#303348", + "focusedBorderColor": "#ab47bc50", "pressedBackground": "#ab47bc50", "pressedBorderColor": "#ab47bc50" }, @@ -66,6 +68,11 @@ "shadowColor": "#303348", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2b2a3e", + "Tooltip.background": "#202331" + }, + "Content.background": "#202331", "CheckBox": { "background": "#292D3E", "disabledText": "#515772", @@ -161,6 +168,7 @@ "hoverBackground": "#414863", "hoverColor": "#292D3E", "hoverMaskColor": "#444267", + "inactiveColoredFileBackground": "#303348", "inactiveUnderlineColor": "#515772", "inactiveMaskColor": "#292D3E", "underlineColor": "#ab47bc", @@ -193,6 +201,7 @@ "hoverColor": "#444267", "hoverMaskColor": "#444267", "inactiveMaskColor": "#292D3E", + "inactiveColoredFileBackground": "#292D3E2", "inactiveUnderlineColor": "#515772", "selectedForeground": "#A6ACCD", "selectedBackground": "#414863", @@ -288,13 +297,14 @@ "secondaryForeground": "#676E95", "visitedForeground": "#ab47bc" }, + "link.foreground": "#ab47bc", "List": { "background": "#34324a", "foreground": "#A6ACCD", "selectionBackground": "#3C435E50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#676E9525" + "selectionInactiveBackground": "#676E9550" }, "material": { "background": "#292D3E", @@ -360,6 +370,7 @@ "background": "#292D3E" } }, + "NewPSD.warning": "#ab47bc", "Notification": { "background": "#202331", "borderColor": "#202331", @@ -387,7 +398,9 @@ "messageForeground": "#A6ACCD" }, "Outline": { - "color": "#303348" + "color": "#303348", + "focusedColor": "#ab47bc", + "disabledColor": "#515772" }, "Panel": { "background": "#292D3E", @@ -417,15 +430,17 @@ "disabledForeground": "#515772", "eapTagBackground": "#444267", "lightSelectionBackground": "#3C435E", + "paidTagBackground": "#444267", "selectionBackground": "#3C435E", "tagForeground": "#ab47bc", "tagBackground": "#444267", + "trialTagBackground": "#444267", "Button": { "installBackground": "#303348", "installBorderColor": "#303348", "installForeground": "#A6ACCD", "installFocusedBackground": "#444267", - "installFillForeground": "#676E95", + "installFillForeground": "#515772", "installFillBackground": "#303348", "updateBackground": "#303348", "updateBorderColor": "#303348", @@ -462,6 +477,7 @@ "separatorForeground": "#A6ACCD", "separatorColor": "#34324a", "Toolbar": { + "Floating.background": "#202331", "background": "#202331", "borderColor": "#202331" } @@ -483,6 +499,9 @@ "selectionBackground": "#444267", "trackColor": "#444267" }, + "PsiViewer": { + "referenceHighlightColor": "#ab47bc" + }, "RadioButton": { "background": "#292D3E", "disabledText": "#515772", @@ -559,6 +578,7 @@ "endBackground": "#ab47bc", "startBackground": "#ab47bc" }, + "SearchField.errorBackground": "#202331", "Separator": { "background": "#34324a", "foreground": "#34324a", @@ -648,6 +668,7 @@ "borderColor": "#292D3E", "bottomSeparatorColor": "#34324a", "cellBorder": "4,0,4,0", + "disabledForeground": "#515772", "foreground": "#A6ACCD", "focusCellBackground": "#414863", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#2b2a3e", "modifiedItemForeground": "#ab47bc", "rowHeight": 28, - "selectionBackground": "#676E9570", + "selectionBackground": "#676E9550", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#676E9525", + "selectionInactiveBackground": "#676E9550", "textBackground": "#292D3E" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2b2a3e", + "ColorPicker.background": "#292D3E", + "ColorPicker.foreground": "#A6ACCD", + "Component.borderColor": "#2b2a3e", + "Component.background": "#292D3E", + "Component.foreground": "#A6ACCD", + "Connector.borderColor": "#2b2a3e", + "Connector.hoverBorderColor": "#444267", + "Canvas.background": "#202331", + "highStroke.foreground": "#A6ACCD", + "Label.foreground": "#676E95", + "List.selectionBackground": "#676E9550", + "Panel.borderColor": "#2b2a3e", "Panel.background": "#292D3E", - "Preview.background": "#292D3E" + "percent.foreground": "#A6ACCD", + "Placeholder.background": "#292D3E", + "Placeholder.borderColor": "#2b2a3e", + "Placeholder.foreground": "#A6ACCD", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#292D3E", + "stroke.acceleratorForeground": "#676E95" }, "ValidationTooltip": { "errorBackground": "#202331", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#292D3E" }, + "GitCommits": { + "graphColor": "#444267" + }, "GitLog": { "localBranchIconColor": "#ab47bc", "otherIconColor": "#676E95", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#c3e88d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Material Theme UI Lite.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro Contrast.theme.json index 16de21cd..b16896d9 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#ffd86650", "hoverBorderColor": "#ffd86650", + "hoverSeparatorColor": "#403E41", + "focusedBorderColor": "#ffd86650", "pressedBackground": "#ffd86650", "pressedBorderColor": "#ffd86650" }, @@ -66,6 +68,11 @@ "shadowColor": "#403E41", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2d2a2e", + "Tooltip.background": "#363437" + }, + "Content.background": "#3a3a3c", "CheckBox": { "background": "#2D2A2E", "disabledText": "#5b595c", @@ -161,6 +168,7 @@ "hoverBackground": "#4A474B", "hoverColor": "#3a3a3c", "hoverMaskColor": "#5b595c", + "inactiveColoredFileBackground": "#403E41", "inactiveUnderlineColor": "#5b595c", "inactiveMaskColor": "#3a3a3c", "underlineColor": "#ffd866", @@ -193,6 +201,7 @@ "hoverColor": "#5b595c", "hoverMaskColor": "#5b595c", "inactiveMaskColor": "#2D2A2E", + "inactiveColoredFileBackground": "#2D2A2E2", "inactiveUnderlineColor": "#5b595c", "selectedForeground": "#fcfcfa", "selectedBackground": "#4A474B", @@ -288,13 +297,14 @@ "secondaryForeground": "#939293", "visitedForeground": "#ffd866" }, + "link.foreground": "#ffd866", "List": { "background": "#403E41", "foreground": "#fcfcfa", "selectionBackground": "#6E6C6F50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#ffd866", - "selectionInactiveBackground": "#403E4125" + "selectionInactiveBackground": "#403E41" }, "material": { "background": "#2D2A2E", @@ -360,6 +370,7 @@ "background": "#3a3a3c" } }, + "NewPSD.warning": "#ffd866", "Notification": { "background": "#363437", "borderColor": "#363437", @@ -387,7 +398,9 @@ "messageForeground": "#fcfcfa" }, "Outline": { - "color": "#403E41" + "color": "#403E41", + "focusedColor": "#ffd866", + "disabledColor": "#5b595c" }, "Panel": { "background": "#2D2A2E", @@ -417,15 +430,17 @@ "disabledForeground": "#5b595c", "eapTagBackground": "#5b595c", "lightSelectionBackground": "#6E6C6F", + "paidTagBackground": "#5b595c", "selectionBackground": "#6E6C6F", "tagForeground": "#ffd866", "tagBackground": "#5b595c", + "trialTagBackground": "#5b595c", "Button": { "installBackground": "#403E41", "installBorderColor": "#403E41", "installForeground": "#fcfcfa", "installFocusedBackground": "#5b595c", - "installFillForeground": "#939293", + "installFillForeground": "#5b595c", "installFillBackground": "#403E41", "updateBackground": "#403E41", "updateBorderColor": "#403E41", @@ -462,6 +477,7 @@ "separatorForeground": "#fcfcfa", "separatorColor": "#403E41", "Toolbar": { + "Floating.background": "#3a3a3c", "background": "#3a3a3c", "borderColor": "#3a3a3c" } @@ -483,6 +499,9 @@ "selectionBackground": "#5b595c", "trackColor": "#5b595c" }, + "PsiViewer": { + "referenceHighlightColor": "#ffd866" + }, "RadioButton": { "background": "#2D2A2E", "disabledText": "#5b595c", @@ -559,6 +578,7 @@ "endBackground": "#ffd866", "startBackground": "#ffd866" }, + "SearchField.errorBackground": "#363437", "Separator": { "background": "#403E41", "foreground": "#403E41", @@ -648,6 +668,7 @@ "borderColor": "#2D2A2E", "bottomSeparatorColor": "#403E41", "cellBorder": "4,0,4,0", + "disabledForeground": "#5b595c", "foreground": "#fcfcfa", "focusCellBackground": "#4A474B", "focusCellForeground": "#ffd866", @@ -746,17 +767,36 @@ "hash": "#2d2a2e", "modifiedItemForeground": "#ffd866", "rowHeight": 28, - "selectionBackground": "#403E4170", + "selectionBackground": "#403E41", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#403E4125", + "selectionInactiveBackground": "#403E41", "textBackground": "#3a3a3c" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2d2a2e", + "ColorPicker.background": "#2D2A2E", + "ColorPicker.foreground": "#fcfcfa", + "Component.borderColor": "#2d2a2e", + "Component.background": "#2D2A2E", + "Component.foreground": "#fcfcfa", + "Connector.borderColor": "#2d2a2e", + "Connector.hoverBorderColor": "#5b595c", + "Canvas.background": "#3a3a3c", + "highStroke.foreground": "#fcfcfa", + "Label.foreground": "#939293", + "List.selectionBackground": "#403E41", + "Panel.borderColor": "#2d2a2e", "Panel.background": "#2D2A2E", - "Preview.background": "#2D2A2E" + "percent.foreground": "#fcfcfa", + "Placeholder.background": "#2D2A2E", + "Placeholder.borderColor": "#2d2a2e", + "Placeholder.foreground": "#fcfcfa", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#2D2A2E", + "stroke.acceleratorForeground": "#939293" }, "ValidationTooltip": { "errorBackground": "#363437", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#2D2A2E" }, + "GitCommits": { + "graphColor": "#5b595c" + }, "GitLog": { "localBranchIconColor": "#ffd866", "otherIconColor": "#939293", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#FFD866" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro.theme.json index a80d2be7..9a71d591 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Monokai Pro.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Monokai Pro.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#ffd86650", "hoverBorderColor": "#ffd86650", + "hoverSeparatorColor": "#403E41", + "focusedBorderColor": "#ffd86650", "pressedBackground": "#ffd86650", "pressedBorderColor": "#ffd86650" }, @@ -66,6 +68,11 @@ "shadowColor": "#403E41", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#2d2a2e", + "Tooltip.background": "#363437" + }, + "Content.background": "#3a3a3c", "CheckBox": { "background": "#2D2A2E", "disabledText": "#5b595c", @@ -161,6 +168,7 @@ "hoverBackground": "#4A474B", "hoverColor": "#2D2A2E", "hoverMaskColor": "#5b595c", + "inactiveColoredFileBackground": "#403E41", "inactiveUnderlineColor": "#5b595c", "inactiveMaskColor": "#2D2A2E", "underlineColor": "#ffd866", @@ -193,6 +201,7 @@ "hoverColor": "#5b595c", "hoverMaskColor": "#5b595c", "inactiveMaskColor": "#2D2A2E", + "inactiveColoredFileBackground": "#2D2A2E2", "inactiveUnderlineColor": "#5b595c", "selectedForeground": "#fcfcfa", "selectedBackground": "#4A474B", @@ -288,13 +297,14 @@ "secondaryForeground": "#939293", "visitedForeground": "#ffd866" }, + "link.foreground": "#ffd866", "List": { "background": "#403E41", "foreground": "#fcfcfa", "selectionBackground": "#6E6C6F50", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#ffd866", - "selectionInactiveBackground": "#403E4125" + "selectionInactiveBackground": "#403E41" }, "material": { "background": "#2D2A2E", @@ -360,6 +370,7 @@ "background": "#2D2A2E" } }, + "NewPSD.warning": "#ffd866", "Notification": { "background": "#363437", "borderColor": "#363437", @@ -387,7 +398,9 @@ "messageForeground": "#fcfcfa" }, "Outline": { - "color": "#403E41" + "color": "#403E41", + "focusedColor": "#ffd866", + "disabledColor": "#5b595c" }, "Panel": { "background": "#2D2A2E", @@ -417,15 +430,17 @@ "disabledForeground": "#5b595c", "eapTagBackground": "#5b595c", "lightSelectionBackground": "#6E6C6F", + "paidTagBackground": "#5b595c", "selectionBackground": "#6E6C6F", "tagForeground": "#ffd866", "tagBackground": "#5b595c", + "trialTagBackground": "#5b595c", "Button": { "installBackground": "#403E41", "installBorderColor": "#403E41", "installForeground": "#fcfcfa", "installFocusedBackground": "#5b595c", - "installFillForeground": "#939293", + "installFillForeground": "#5b595c", "installFillBackground": "#403E41", "updateBackground": "#403E41", "updateBorderColor": "#403E41", @@ -462,6 +477,7 @@ "separatorForeground": "#fcfcfa", "separatorColor": "#403E41", "Toolbar": { + "Floating.background": "#3a3a3c", "background": "#3a3a3c", "borderColor": "#3a3a3c" } @@ -483,6 +499,9 @@ "selectionBackground": "#5b595c", "trackColor": "#5b595c" }, + "PsiViewer": { + "referenceHighlightColor": "#ffd866" + }, "RadioButton": { "background": "#2D2A2E", "disabledText": "#5b595c", @@ -559,6 +578,7 @@ "endBackground": "#ffd866", "startBackground": "#ffd866" }, + "SearchField.errorBackground": "#363437", "Separator": { "background": "#403E41", "foreground": "#403E41", @@ -648,6 +668,7 @@ "borderColor": "#2D2A2E", "bottomSeparatorColor": "#403E41", "cellBorder": "4,0,4,0", + "disabledForeground": "#5b595c", "foreground": "#fcfcfa", "focusCellBackground": "#4A474B", "focusCellForeground": "#ffd866", @@ -746,17 +767,36 @@ "hash": "#2d2a2e", "modifiedItemForeground": "#ffd866", "rowHeight": 28, - "selectionBackground": "#403E4170", + "selectionBackground": "#403E41", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#403E4125", + "selectionInactiveBackground": "#403E41", "textBackground": "#2D2A2E" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#2d2a2e", + "ColorPicker.background": "#2D2A2E", + "ColorPicker.foreground": "#fcfcfa", + "Component.borderColor": "#2d2a2e", + "Component.background": "#2D2A2E", + "Component.foreground": "#fcfcfa", + "Connector.borderColor": "#2d2a2e", + "Connector.hoverBorderColor": "#5b595c", + "Canvas.background": "#3a3a3c", + "highStroke.foreground": "#fcfcfa", + "Label.foreground": "#939293", + "List.selectionBackground": "#403E41", + "Panel.borderColor": "#2d2a2e", "Panel.background": "#2D2A2E", - "Preview.background": "#2D2A2E" + "percent.foreground": "#fcfcfa", + "Placeholder.background": "#2D2A2E", + "Placeholder.borderColor": "#2d2a2e", + "Placeholder.foreground": "#fcfcfa", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#2D2A2E", + "stroke.acceleratorForeground": "#939293" }, "ValidationTooltip": { "errorBackground": "#363437", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#2D2A2E" }, + "GitCommits": { + "graphColor": "#5b595c" + }, "GitLog": { "localBranchIconColor": "#ffd866", "otherIconColor": "#939293", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#FFD866" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl Contrast.theme.json index d3953e6b..2e6a6b24 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#7e57c250", "hoverBorderColor": "#7e57c250", + "hoverSeparatorColor": "#0b253a", + "focusedBorderColor": "#7e57c250", "pressedBackground": "#7e57c250", "pressedBorderColor": "#7e57c250" }, @@ -66,6 +68,11 @@ "shadowColor": "#0b253a", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#122d42", + "Tooltip.background": "#01111d" + }, + "Content.background": "#010e1a", "CheckBox": { "background": "#011627", "disabledText": "#697098", @@ -161,6 +168,7 @@ "hoverBackground": "#13344f", "hoverColor": "#010e1a", "hoverMaskColor": "#084d81", + "inactiveColoredFileBackground": "#0b253a", "inactiveUnderlineColor": "#697098", "inactiveMaskColor": "#010e1a", "underlineColor": "#7e57c2", @@ -193,6 +201,7 @@ "hoverColor": "#084d81", "hoverMaskColor": "#084d81", "inactiveMaskColor": "#011627", + "inactiveColoredFileBackground": "#0116272", "inactiveUnderlineColor": "#697098", "selectedForeground": "#d6deeb", "selectedBackground": "#13344f", @@ -288,13 +297,14 @@ "secondaryForeground": "#5f7e97", "visitedForeground": "#7e57c2" }, + "link.foreground": "#7e57c2", "List": { "background": "#0b2942", "foreground": "#d6deeb", "selectionBackground": "#5f7e9750", "selectionForeground": "#ffffff", "selectionInactiveForeground": "#ffffff", - "selectionInactiveBackground": "#13344f25" + "selectionInactiveBackground": "#13344f50" }, "material": { "background": "#011627", @@ -360,6 +370,7 @@ "background": "#010e1a" } }, + "NewPSD.warning": "#7e57c2", "Notification": { "background": "#01111d", "borderColor": "#01111d", @@ -387,7 +398,9 @@ "messageForeground": "#d6deeb" }, "Outline": { - "color": "#0b253a" + "color": "#0b253a", + "focusedColor": "#7e57c2", + "disabledColor": "#697098" }, "Panel": { "background": "#011627", @@ -417,15 +430,17 @@ "disabledForeground": "#697098", "eapTagBackground": "#084d81", "lightSelectionBackground": "#5f7e97", + "paidTagBackground": "#084d81", "selectionBackground": "#5f7e97", "tagForeground": "#7e57c2", "tagBackground": "#084d81", + "trialTagBackground": "#084d81", "Button": { "installBackground": "#0b253a", "installBorderColor": "#0b253a", "installForeground": "#d6deeb", "installFocusedBackground": "#084d81", - "installFillForeground": "#5f7e97", + "installFillForeground": "#697098", "installFillBackground": "#0b253a", "updateBackground": "#0b253a", "updateBorderColor": "#0b253a", @@ -462,6 +477,7 @@ "separatorForeground": "#d6deeb", "separatorColor": "#0b2942", "Toolbar": { + "Floating.background": "#010e1a", "background": "#010e1a", "borderColor": "#010e1a" } @@ -483,6 +499,9 @@ "selectionBackground": "#084d81", "trackColor": "#084d81" }, + "PsiViewer": { + "referenceHighlightColor": "#7e57c2" + }, "RadioButton": { "background": "#011627", "disabledText": "#697098", @@ -559,6 +578,7 @@ "endBackground": "#7e57c2", "startBackground": "#7e57c2" }, + "SearchField.errorBackground": "#01111d", "Separator": { "background": "#0b2942", "foreground": "#0b2942", @@ -648,6 +668,7 @@ "borderColor": "#011627", "bottomSeparatorColor": "#0b2942", "cellBorder": "4,0,4,0", + "disabledForeground": "#697098", "foreground": "#d6deeb", "focusCellBackground": "#13344f", "focusCellForeground": "#ffffff", @@ -746,17 +767,36 @@ "hash": "#122d42", "modifiedItemForeground": "#7e57c2", "rowHeight": 28, - "selectionBackground": "#13344f70", + "selectionBackground": "#13344f50", "selectionForeground": "#ffffff", "selectionInactiveForeground": "#ffffff", - "selectionInactiveBackground": "#13344f25", + "selectionInactiveBackground": "#13344f50", "textBackground": "#010e1a" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#122d42", + "ColorPicker.background": "#011627", + "ColorPicker.foreground": "#d6deeb", + "Component.borderColor": "#122d42", + "Component.background": "#011627", + "Component.foreground": "#d6deeb", + "Connector.borderColor": "#122d42", + "Connector.hoverBorderColor": "#084d81", + "Canvas.background": "#010e1a", + "highStroke.foreground": "#d6deeb", + "Label.foreground": "#5f7e97", + "List.selectionBackground": "#13344f50", + "Panel.borderColor": "#122d42", "Panel.background": "#011627", - "Preview.background": "#011627" + "percent.foreground": "#d6deeb", + "Placeholder.background": "#011627", + "Placeholder.borderColor": "#122d42", + "Placeholder.foreground": "#d6deeb", + "Placeholder.selectedForeground": "#ffffff", + "Preview.background": "#011627", + "stroke.acceleratorForeground": "#5f7e97" }, "ValidationTooltip": { "errorBackground": "#01111d", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#011627" }, + "GitCommits": { + "graphColor": "#084d81" + }, "GitLog": { "localBranchIconColor": "#7e57c2", "otherIconColor": "#5f7e97", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#ecc48d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl.theme.json index df4362e0..1412b1ce 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Night Owl.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Night Owl.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#7e57c250", "hoverBorderColor": "#7e57c250", + "hoverSeparatorColor": "#0b253a", + "focusedBorderColor": "#7e57c250", "pressedBackground": "#7e57c250", "pressedBorderColor": "#7e57c250" }, @@ -66,6 +68,11 @@ "shadowColor": "#0b253a", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#122d42", + "Tooltip.background": "#01111d" + }, + "Content.background": "#010e1a", "CheckBox": { "background": "#011627", "disabledText": "#697098", @@ -161,6 +168,7 @@ "hoverBackground": "#13344f", "hoverColor": "#011627", "hoverMaskColor": "#084d81", + "inactiveColoredFileBackground": "#0b253a", "inactiveUnderlineColor": "#697098", "inactiveMaskColor": "#011627", "underlineColor": "#7e57c2", @@ -193,6 +201,7 @@ "hoverColor": "#084d81", "hoverMaskColor": "#084d81", "inactiveMaskColor": "#011627", + "inactiveColoredFileBackground": "#0116272", "inactiveUnderlineColor": "#697098", "selectedForeground": "#d6deeb", "selectedBackground": "#13344f", @@ -288,13 +297,14 @@ "secondaryForeground": "#5f7e97", "visitedForeground": "#7e57c2" }, + "link.foreground": "#7e57c2", "List": { "background": "#0b2942", "foreground": "#d6deeb", "selectionBackground": "#5f7e9750", "selectionForeground": "#ffffff", "selectionInactiveForeground": "#ffffff", - "selectionInactiveBackground": "#13344f25" + "selectionInactiveBackground": "#13344f50" }, "material": { "background": "#011627", @@ -360,6 +370,7 @@ "background": "#011627" } }, + "NewPSD.warning": "#7e57c2", "Notification": { "background": "#01111d", "borderColor": "#01111d", @@ -387,7 +398,9 @@ "messageForeground": "#d6deeb" }, "Outline": { - "color": "#0b253a" + "color": "#0b253a", + "focusedColor": "#7e57c2", + "disabledColor": "#697098" }, "Panel": { "background": "#011627", @@ -417,15 +430,17 @@ "disabledForeground": "#697098", "eapTagBackground": "#084d81", "lightSelectionBackground": "#5f7e97", + "paidTagBackground": "#084d81", "selectionBackground": "#5f7e97", "tagForeground": "#7e57c2", "tagBackground": "#084d81", + "trialTagBackground": "#084d81", "Button": { "installBackground": "#0b253a", "installBorderColor": "#0b253a", "installForeground": "#d6deeb", "installFocusedBackground": "#084d81", - "installFillForeground": "#5f7e97", + "installFillForeground": "#697098", "installFillBackground": "#0b253a", "updateBackground": "#0b253a", "updateBorderColor": "#0b253a", @@ -462,6 +477,7 @@ "separatorForeground": "#d6deeb", "separatorColor": "#0b2942", "Toolbar": { + "Floating.background": "#010e1a", "background": "#010e1a", "borderColor": "#010e1a" } @@ -483,6 +499,9 @@ "selectionBackground": "#084d81", "trackColor": "#084d81" }, + "PsiViewer": { + "referenceHighlightColor": "#7e57c2" + }, "RadioButton": { "background": "#011627", "disabledText": "#697098", @@ -559,6 +578,7 @@ "endBackground": "#7e57c2", "startBackground": "#7e57c2" }, + "SearchField.errorBackground": "#01111d", "Separator": { "background": "#0b2942", "foreground": "#0b2942", @@ -648,6 +668,7 @@ "borderColor": "#011627", "bottomSeparatorColor": "#0b2942", "cellBorder": "4,0,4,0", + "disabledForeground": "#697098", "foreground": "#d6deeb", "focusCellBackground": "#13344f", "focusCellForeground": "#ffffff", @@ -746,17 +767,36 @@ "hash": "#122d42", "modifiedItemForeground": "#7e57c2", "rowHeight": 28, - "selectionBackground": "#13344f70", + "selectionBackground": "#13344f50", "selectionForeground": "#ffffff", "selectionInactiveForeground": "#ffffff", - "selectionInactiveBackground": "#13344f25", + "selectionInactiveBackground": "#13344f50", "textBackground": "#011627" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#122d42", + "ColorPicker.background": "#011627", + "ColorPicker.foreground": "#d6deeb", + "Component.borderColor": "#122d42", + "Component.background": "#011627", + "Component.foreground": "#d6deeb", + "Connector.borderColor": "#122d42", + "Connector.hoverBorderColor": "#084d81", + "Canvas.background": "#010e1a", + "highStroke.foreground": "#d6deeb", + "Label.foreground": "#5f7e97", + "List.selectionBackground": "#13344f50", + "Panel.borderColor": "#122d42", "Panel.background": "#011627", - "Preview.background": "#011627" + "percent.foreground": "#d6deeb", + "Placeholder.background": "#011627", + "Placeholder.borderColor": "#122d42", + "Placeholder.foreground": "#d6deeb", + "Placeholder.selectedForeground": "#ffffff", + "Preview.background": "#011627", + "stroke.acceleratorForeground": "#5f7e97" }, "ValidationTooltip": { "errorBackground": "#01111d", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#011627" }, + "GitCommits": { + "graphColor": "#084d81" + }, "GitLog": { "localBranchIconColor": "#7e57c2", "otherIconColor": "#5f7e97", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#ecc48d" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark Contrast.theme.json index e7ef5824..218f50e6 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#d3368250", "hoverBorderColor": "#d3368250", + "hoverSeparatorColor": "#073642", + "focusedBorderColor": "#d3368250", "pressedBackground": "#d3368250", "pressedBorderColor": "#d3368250" }, @@ -66,6 +68,11 @@ "shadowColor": "#073642", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#0D3640", + "Tooltip.background": "#2E4C52" + }, + "Content.background": "#00252E", "CheckBox": { "background": "#002B36", "disabledText": "#2E5861", @@ -161,6 +168,7 @@ "hoverBackground": "#003946", "hoverColor": "#00252E", "hoverMaskColor": "#005a6f", + "inactiveColoredFileBackground": "#073642", "inactiveUnderlineColor": "#2E5861", "inactiveMaskColor": "#00252E", "underlineColor": "#d33682", @@ -193,6 +201,7 @@ "hoverColor": "#005a6f", "hoverMaskColor": "#005a6f", "inactiveMaskColor": "#002B36", + "inactiveColoredFileBackground": "#002B362", "inactiveUnderlineColor": "#2E5861", "selectedForeground": "#839496", "selectedBackground": "#003946", @@ -288,13 +297,14 @@ "secondaryForeground": "#586e75", "visitedForeground": "#d33682" }, + "link.foreground": "#d33682", "List": { "background": "#003745", "foreground": "#839496", "selectionBackground": "#2E4C5250", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#2E4C5225" + "selectionInactiveBackground": "#2E4C5280" }, "material": { "background": "#002B36", @@ -360,6 +370,7 @@ "background": "#00252E" } }, + "NewPSD.warning": "#d33682", "Notification": { "background": "#2E4C52", "borderColor": "#2E4C52", @@ -387,7 +398,9 @@ "messageForeground": "#839496" }, "Outline": { - "color": "#073642" + "color": "#073642", + "focusedColor": "#d33682", + "disabledColor": "#2E5861" }, "Panel": { "background": "#002B36", @@ -417,15 +430,17 @@ "disabledForeground": "#2E5861", "eapTagBackground": "#005a6f", "lightSelectionBackground": "#2E4C52", + "paidTagBackground": "#005a6f", "selectionBackground": "#2E4C52", "tagForeground": "#d33682", "tagBackground": "#005a6f", + "trialTagBackground": "#005a6f", "Button": { "installBackground": "#073642", "installBorderColor": "#073642", "installForeground": "#839496", "installFocusedBackground": "#005a6f", - "installFillForeground": "#586e75", + "installFillForeground": "#2E5861", "installFillBackground": "#073642", "updateBackground": "#073642", "updateBorderColor": "#073642", @@ -462,6 +477,7 @@ "separatorForeground": "#839496", "separatorColor": "#003745", "Toolbar": { + "Floating.background": "#00252E", "background": "#00252E", "borderColor": "#00252E" } @@ -483,6 +499,9 @@ "selectionBackground": "#005a6f", "trackColor": "#005a6f" }, + "PsiViewer": { + "referenceHighlightColor": "#d33682" + }, "RadioButton": { "background": "#002B36", "disabledText": "#2E5861", @@ -559,6 +578,7 @@ "endBackground": "#d33682", "startBackground": "#d33682" }, + "SearchField.errorBackground": "#2E4C52", "Separator": { "background": "#003745", "foreground": "#003745", @@ -648,6 +668,7 @@ "borderColor": "#002B36", "bottomSeparatorColor": "#003745", "cellBorder": "4,0,4,0", + "disabledForeground": "#2E5861", "foreground": "#839496", "focusCellBackground": "#003946", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#0D3640", "modifiedItemForeground": "#d33682", "rowHeight": 28, - "selectionBackground": "#2E4C5270", + "selectionBackground": "#2E4C5280", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#2E4C5225", + "selectionInactiveBackground": "#2E4C5280", "textBackground": "#00252E" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#0D3640", + "ColorPicker.background": "#002B36", + "ColorPicker.foreground": "#839496", + "Component.borderColor": "#0D3640", + "Component.background": "#002B36", + "Component.foreground": "#839496", + "Connector.borderColor": "#0D3640", + "Connector.hoverBorderColor": "#005a6f", + "Canvas.background": "#00252E", + "highStroke.foreground": "#839496", + "Label.foreground": "#586e75", + "List.selectionBackground": "#2E4C5280", + "Panel.borderColor": "#0D3640", "Panel.background": "#002B36", - "Preview.background": "#002B36" + "percent.foreground": "#839496", + "Placeholder.background": "#002B36", + "Placeholder.borderColor": "#0D3640", + "Placeholder.foreground": "#839496", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#002B36", + "stroke.acceleratorForeground": "#586e75" }, "ValidationTooltip": { "errorBackground": "#2E4C52", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#002B36" }, + "GitCommits": { + "graphColor": "#005a6f" + }, "GitLog": { "localBranchIconColor": "#d33682", "otherIconColor": "#586e75", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#2AA198" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark.theme.json index eada1284..77c18cf1 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Dark.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Dark.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#d3368250", "hoverBorderColor": "#d3368250", + "hoverSeparatorColor": "#073642", + "focusedBorderColor": "#d3368250", "pressedBackground": "#d3368250", "pressedBorderColor": "#d3368250" }, @@ -66,6 +68,11 @@ "shadowColor": "#073642", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#0D3640", + "Tooltip.background": "#2E4C52" + }, + "Content.background": "#00252E", "CheckBox": { "background": "#002B36", "disabledText": "#2E5861", @@ -161,6 +168,7 @@ "hoverBackground": "#003946", "hoverColor": "#002B36", "hoverMaskColor": "#005a6f", + "inactiveColoredFileBackground": "#073642", "inactiveUnderlineColor": "#2E5861", "inactiveMaskColor": "#002B36", "underlineColor": "#d33682", @@ -193,6 +201,7 @@ "hoverColor": "#005a6f", "hoverMaskColor": "#005a6f", "inactiveMaskColor": "#002B36", + "inactiveColoredFileBackground": "#002B362", "inactiveUnderlineColor": "#2E5861", "selectedForeground": "#839496", "selectedBackground": "#003946", @@ -288,13 +297,14 @@ "secondaryForeground": "#586e75", "visitedForeground": "#d33682" }, + "link.foreground": "#d33682", "List": { "background": "#003745", "foreground": "#839496", "selectionBackground": "#2E4C5250", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#2E4C5225" + "selectionInactiveBackground": "#2E4C5280" }, "material": { "background": "#002B36", @@ -360,6 +370,7 @@ "background": "#002B36" } }, + "NewPSD.warning": "#d33682", "Notification": { "background": "#2E4C52", "borderColor": "#2E4C52", @@ -387,7 +398,9 @@ "messageForeground": "#839496" }, "Outline": { - "color": "#073642" + "color": "#073642", + "focusedColor": "#d33682", + "disabledColor": "#2E5861" }, "Panel": { "background": "#002B36", @@ -417,15 +430,17 @@ "disabledForeground": "#2E5861", "eapTagBackground": "#005a6f", "lightSelectionBackground": "#2E4C52", + "paidTagBackground": "#005a6f", "selectionBackground": "#2E4C52", "tagForeground": "#d33682", "tagBackground": "#005a6f", + "trialTagBackground": "#005a6f", "Button": { "installBackground": "#073642", "installBorderColor": "#073642", "installForeground": "#839496", "installFocusedBackground": "#005a6f", - "installFillForeground": "#586e75", + "installFillForeground": "#2E5861", "installFillBackground": "#073642", "updateBackground": "#073642", "updateBorderColor": "#073642", @@ -462,6 +477,7 @@ "separatorForeground": "#839496", "separatorColor": "#003745", "Toolbar": { + "Floating.background": "#00252E", "background": "#00252E", "borderColor": "#00252E" } @@ -483,6 +499,9 @@ "selectionBackground": "#005a6f", "trackColor": "#005a6f" }, + "PsiViewer": { + "referenceHighlightColor": "#d33682" + }, "RadioButton": { "background": "#002B36", "disabledText": "#2E5861", @@ -559,6 +578,7 @@ "endBackground": "#d33682", "startBackground": "#d33682" }, + "SearchField.errorBackground": "#2E4C52", "Separator": { "background": "#003745", "foreground": "#003745", @@ -648,6 +668,7 @@ "borderColor": "#002B36", "bottomSeparatorColor": "#003745", "cellBorder": "4,0,4,0", + "disabledForeground": "#2E5861", "foreground": "#839496", "focusCellBackground": "#003946", "focusCellForeground": "#FFFFFF", @@ -746,17 +767,36 @@ "hash": "#0D3640", "modifiedItemForeground": "#d33682", "rowHeight": 28, - "selectionBackground": "#2E4C5270", + "selectionBackground": "#2E4C5280", "selectionForeground": "#FFFFFF", "selectionInactiveForeground": "#FFFFFF", - "selectionInactiveBackground": "#2E4C5225", + "selectionInactiveBackground": "#2E4C5280", "textBackground": "#002B36" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#0D3640", + "ColorPicker.background": "#002B36", + "ColorPicker.foreground": "#839496", + "Component.borderColor": "#0D3640", + "Component.background": "#002B36", + "Component.foreground": "#839496", + "Connector.borderColor": "#0D3640", + "Connector.hoverBorderColor": "#005a6f", + "Canvas.background": "#00252E", + "highStroke.foreground": "#839496", + "Label.foreground": "#586e75", + "List.selectionBackground": "#2E4C5280", + "Panel.borderColor": "#0D3640", "Panel.background": "#002B36", - "Preview.background": "#002B36" + "percent.foreground": "#839496", + "Placeholder.background": "#002B36", + "Placeholder.borderColor": "#0D3640", + "Placeholder.foreground": "#839496", + "Placeholder.selectedForeground": "#FFFFFF", + "Preview.background": "#002B36", + "stroke.acceleratorForeground": "#586e75" }, "ValidationTooltip": { "errorBackground": "#2E4C52", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#002B36" }, + "GitCommits": { + "graphColor": "#005a6f" + }, "GitLog": { "localBranchIconColor": "#d33682", "otherIconColor": "#586e75", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#2AA198" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light Contrast.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light Contrast.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light Contrast.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light Contrast.theme.json index 90692773..19d5aae6 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light Contrast.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light Contrast.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#d3368250", "hoverBorderColor": "#d3368250", + "hoverSeparatorColor": "#d8d4c4", + "focusedBorderColor": "#d3368250", "pressedBackground": "#d3368250", "pressedBorderColor": "#d3368250" }, @@ -66,6 +68,11 @@ "shadowColor": "#d8d4c4", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#edead9", + "Tooltip.background": "#EDE8D4" + }, + "Content.background": "#eee8d5", "CheckBox": { "background": "#fdf6e3", "disabledText": "#C9CCC3", @@ -161,6 +168,7 @@ "hoverBackground": "#d1cbb8", "hoverColor": "#eee8d5", "hoverMaskColor": "#d1cbb8", + "inactiveColoredFileBackground": "#d8d4c4", "inactiveUnderlineColor": "#C9CCC3", "inactiveMaskColor": "#eee8d5", "underlineColor": "#d33682", @@ -193,6 +201,7 @@ "hoverColor": "#d1cbb8", "hoverMaskColor": "#d1cbb8", "inactiveMaskColor": "#fdf6e3", + "inactiveColoredFileBackground": "#fdf6e32", "inactiveUnderlineColor": "#C9CCC3", "selectedForeground": "#586e75", "selectedBackground": "#d1cbb8", @@ -288,13 +297,14 @@ "secondaryForeground": "#93a1a1", "visitedForeground": "#d33682" }, + "link.foreground": "#d33682", "List": { "background": "#F6F0DE", "foreground": "#586e75", "selectionBackground": "#e8dcb650", "selectionForeground": "#002b36", "selectionInactiveForeground": "#002b36", - "selectionInactiveBackground": "#e8dcb625" + "selectionInactiveBackground": "#e8dcb6b0" }, "material": { "background": "#fdf6e3", @@ -360,6 +370,7 @@ "background": "#eee8d5" } }, + "NewPSD.warning": "#d33682", "Notification": { "background": "#EDE8D4", "borderColor": "#EDE8D4", @@ -387,7 +398,9 @@ "messageForeground": "#586e75" }, "Outline": { - "color": "#d8d4c4" + "color": "#d8d4c4", + "focusedColor": "#d33682", + "disabledColor": "#C9CCC3" }, "Panel": { "background": "#fdf6e3", @@ -417,15 +430,17 @@ "disabledForeground": "#C9CCC3", "eapTagBackground": "#d1cbb8", "lightSelectionBackground": "#e8dcb6", + "paidTagBackground": "#d1cbb8", "selectionBackground": "#e8dcb6", "tagForeground": "#d33682", "tagBackground": "#d1cbb8", + "trialTagBackground": "#d1cbb8", "Button": { "installBackground": "#d8d4c4", "installBorderColor": "#d8d4c4", "installForeground": "#586e75", "installFocusedBackground": "#d1cbb8", - "installFillForeground": "#93a1a1", + "installFillForeground": "#C9CCC3", "installFillBackground": "#d8d4c4", "updateBackground": "#d8d4c4", "updateBorderColor": "#d8d4c4", @@ -462,6 +477,7 @@ "separatorForeground": "#586e75", "separatorColor": "#F6F0DE", "Toolbar": { + "Floating.background": "#eee8d5", "background": "#eee8d5", "borderColor": "#eee8d5" } @@ -483,6 +499,9 @@ "selectionBackground": "#d1cbb8", "trackColor": "#d1cbb8" }, + "PsiViewer": { + "referenceHighlightColor": "#d33682" + }, "RadioButton": { "background": "#fdf6e3", "disabledText": "#C9CCC3", @@ -559,6 +578,7 @@ "endBackground": "#d33682", "startBackground": "#d33682" }, + "SearchField.errorBackground": "#EDE8D4", "Separator": { "background": "#F6F0DE", "foreground": "#F6F0DE", @@ -648,6 +668,7 @@ "borderColor": "#fdf6e3", "bottomSeparatorColor": "#F6F0DE", "cellBorder": "4,0,4,0", + "disabledForeground": "#C9CCC3", "foreground": "#586e75", "focusCellBackground": "#d1cbb8", "focusCellForeground": "#002b36", @@ -746,17 +767,36 @@ "hash": "#edead9", "modifiedItemForeground": "#d33682", "rowHeight": 28, - "selectionBackground": "#e8dcb670", + "selectionBackground": "#e8dcb6b0", "selectionForeground": "#002b36", "selectionInactiveForeground": "#002b36", - "selectionInactiveBackground": "#e8dcb625", + "selectionInactiveBackground": "#e8dcb6b0", "textBackground": "#eee8d5" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#edead9", + "ColorPicker.background": "#fdf6e3", + "ColorPicker.foreground": "#586e75", + "Component.borderColor": "#edead9", + "Component.background": "#fdf6e3", + "Component.foreground": "#586e75", + "Connector.borderColor": "#edead9", + "Connector.hoverBorderColor": "#d1cbb8", + "Canvas.background": "#eee8d5", + "highStroke.foreground": "#586e75", + "Label.foreground": "#93a1a1", + "List.selectionBackground": "#e8dcb6b0", + "Panel.borderColor": "#edead9", "Panel.background": "#fdf6e3", - "Preview.background": "#fdf6e3" + "percent.foreground": "#586e75", + "Placeholder.background": "#fdf6e3", + "Placeholder.borderColor": "#edead9", + "Placeholder.foreground": "#586e75", + "Placeholder.selectedForeground": "#002b36", + "Preview.background": "#fdf6e3", + "stroke.acceleratorForeground": "#93a1a1" }, "ValidationTooltip": { "errorBackground": "#EDE8D4", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#fdf6e3" }, + "GitCommits": { + "graphColor": "#d1cbb8" + }, "GitLog": { "localBranchIconColor": "#d33682", "otherIconColor": "#93a1a1", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#2AA198" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light.theme.json similarity index 93% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light.theme.json index 5a7de378..af9f9ec6 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/material-theme-ui-lite/Solarized Light.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/Solarized Light.theme.json @@ -27,6 +27,8 @@ "ActionButton": { "hoverBackground": "#d3368250", "hoverBorderColor": "#d3368250", + "hoverSeparatorColor": "#d8d4c4", + "focusedBorderColor": "#d3368250", "pressedBackground": "#d3368250", "pressedBorderColor": "#d3368250" }, @@ -66,6 +68,11 @@ "shadowColor": "#d8d4c4", "shadowWidth": 0 }, + "Canvas": { + "Tooltip.borderColor": "#edead9", + "Tooltip.background": "#EDE8D4" + }, + "Content.background": "#eee8d5", "CheckBox": { "background": "#fdf6e3", "disabledText": "#C9CCC3", @@ -161,6 +168,7 @@ "hoverBackground": "#d1cbb8", "hoverColor": "#fdf6e3", "hoverMaskColor": "#d1cbb8", + "inactiveColoredFileBackground": "#d8d4c4", "inactiveUnderlineColor": "#C9CCC3", "inactiveMaskColor": "#fdf6e3", "underlineColor": "#d33682", @@ -193,6 +201,7 @@ "hoverColor": "#d1cbb8", "hoverMaskColor": "#d1cbb8", "inactiveMaskColor": "#fdf6e3", + "inactiveColoredFileBackground": "#fdf6e32", "inactiveUnderlineColor": "#C9CCC3", "selectedForeground": "#586e75", "selectedBackground": "#d1cbb8", @@ -288,13 +297,14 @@ "secondaryForeground": "#93a1a1", "visitedForeground": "#d33682" }, + "link.foreground": "#d33682", "List": { "background": "#F6F0DE", "foreground": "#586e75", "selectionBackground": "#e8dcb650", "selectionForeground": "#002b36", "selectionInactiveForeground": "#002b36", - "selectionInactiveBackground": "#e8dcb625" + "selectionInactiveBackground": "#e8dcb6b0" }, "material": { "background": "#fdf6e3", @@ -360,6 +370,7 @@ "background": "#fdf6e3" } }, + "NewPSD.warning": "#d33682", "Notification": { "background": "#EDE8D4", "borderColor": "#EDE8D4", @@ -387,7 +398,9 @@ "messageForeground": "#586e75" }, "Outline": { - "color": "#d8d4c4" + "color": "#d8d4c4", + "focusedColor": "#d33682", + "disabledColor": "#C9CCC3" }, "Panel": { "background": "#fdf6e3", @@ -417,15 +430,17 @@ "disabledForeground": "#C9CCC3", "eapTagBackground": "#d1cbb8", "lightSelectionBackground": "#e8dcb6", + "paidTagBackground": "#d1cbb8", "selectionBackground": "#e8dcb6", "tagForeground": "#d33682", "tagBackground": "#d1cbb8", + "trialTagBackground": "#d1cbb8", "Button": { "installBackground": "#d8d4c4", "installBorderColor": "#d8d4c4", "installForeground": "#586e75", "installFocusedBackground": "#d1cbb8", - "installFillForeground": "#93a1a1", + "installFillForeground": "#C9CCC3", "installFillBackground": "#d8d4c4", "updateBackground": "#d8d4c4", "updateBorderColor": "#d8d4c4", @@ -462,6 +477,7 @@ "separatorForeground": "#586e75", "separatorColor": "#F6F0DE", "Toolbar": { + "Floating.background": "#eee8d5", "background": "#eee8d5", "borderColor": "#eee8d5" } @@ -483,6 +499,9 @@ "selectionBackground": "#d1cbb8", "trackColor": "#d1cbb8" }, + "PsiViewer": { + "referenceHighlightColor": "#d33682" + }, "RadioButton": { "background": "#fdf6e3", "disabledText": "#C9CCC3", @@ -559,6 +578,7 @@ "endBackground": "#d33682", "startBackground": "#d33682" }, + "SearchField.errorBackground": "#EDE8D4", "Separator": { "background": "#F6F0DE", "foreground": "#F6F0DE", @@ -648,6 +668,7 @@ "borderColor": "#fdf6e3", "bottomSeparatorColor": "#F6F0DE", "cellBorder": "4,0,4,0", + "disabledForeground": "#C9CCC3", "foreground": "#586e75", "focusCellBackground": "#d1cbb8", "focusCellForeground": "#002b36", @@ -746,17 +767,36 @@ "hash": "#edead9", "modifiedItemForeground": "#d33682", "rowHeight": 28, - "selectionBackground": "#e8dcb670", + "selectionBackground": "#e8dcb6b0", "selectionForeground": "#002b36", "selectionInactiveForeground": "#002b36", - "selectionInactiveBackground": "#e8dcb625", + "selectionInactiveBackground": "#e8dcb6b0", "textBackground": "#fdf6e3" }, "Tree.leftChildIndent": 10, "Tree.rightChildIndent": 5, "UiDesigner": { + "Activity.borderColor": "#edead9", + "ColorPicker.background": "#fdf6e3", + "ColorPicker.foreground": "#586e75", + "Component.borderColor": "#edead9", + "Component.background": "#fdf6e3", + "Component.foreground": "#586e75", + "Connector.borderColor": "#edead9", + "Connector.hoverBorderColor": "#d1cbb8", + "Canvas.background": "#eee8d5", + "highStroke.foreground": "#586e75", + "Label.foreground": "#93a1a1", + "List.selectionBackground": "#e8dcb6b0", + "Panel.borderColor": "#edead9", "Panel.background": "#fdf6e3", - "Preview.background": "#fdf6e3" + "percent.foreground": "#586e75", + "Placeholder.background": "#fdf6e3", + "Placeholder.borderColor": "#edead9", + "Placeholder.foreground": "#586e75", + "Placeholder.selectedForeground": "#002b36", + "Preview.background": "#fdf6e3", + "stroke.acceleratorForeground": "#93a1a1" }, "ValidationTooltip": { "errorBackground": "#EDE8D4", @@ -768,6 +808,9 @@ "FileHistory.Commit": { "selectedBranchBackground": "#fdf6e3" }, + "GitCommits": { + "graphColor": "#d1cbb8" + }, "GitLog": { "localBranchIconColor": "#d33682", "otherIconColor": "#93a1a1", @@ -871,4 +914,4 @@ "Objects.GreenAndroid": "#2AA198" } } -} \ No newline at end of file +} diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/nord.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/nord.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/nord.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/nord.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/nord.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/nord.theme.json similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/nord.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/nord.theme.json diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/one_dark.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/one_dark.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/one_dark.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/one_dark.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/one_dark.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/one_dark.theme.json similarity index 86% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/one_dark.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/one_dark.theme.json index 2d511479..5e32a8e1 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/one_dark.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/one_dark.theme.json @@ -1,9 +1,11 @@ - { "name": "One Dark", "dark": true, "author": "Mark Skelton", "editorScheme": "/themes/one_dark.xml", + "colors": { + "accentColor": "#568AF2" + }, "ui": { "*": { "background": "#21252b", @@ -24,10 +26,10 @@ "errorForeground": "#cd3359", - "borderColor": "#46494f", + "borderColor": "#333841", "disabledBorderColor": "#2d3137", "focusColor": "#21252b", - "focusedBorderColor": "#568AF2", + "focusedBorderColor": "accentColor", "separatorColor": "#32363c" }, @@ -50,10 +52,10 @@ "default": { "foreground": "#ffffff", - "startBackground": "#568AF2", - "endBackground": "#568AF2", - "startBorderColor": "#568AF2", - "endBorderColor": "#568AF2", + "startBackground": "accentColor", + "endBackground": "accentColor", + "startBorderColor": "accentColor", + "endBorderColor": "accentColor", "focusedBorderColor": "#4269b9", "focusColor": "#4269b9" } @@ -78,7 +80,7 @@ "ComboPopup.border": "1,1,1,1,2d3137", "CompletionPopup": { - "matchForeground": "#568AF2" + "matchForeground": "accentColor" }, "Component": { @@ -93,10 +95,8 @@ "foreground": "#abb2bf" }, - "DebuggerPopup.borderColor": "#46494f", - "DefaultTabs": { - "underlineColor": "#568AF2", + "underlineColor": "accentColor", "inactiveUnderlineColor": "#4269b9", "hoverBackground": "#323844" }, @@ -104,13 +104,13 @@ "DragAndDrop": { "areaForeground": "#abb2bf", "areaBackground": "#323844", - "areaBorderColor": "#46494f" + "areaBorderColor": "#333841" }, "Editor": { "background": "#282c34", "foreground": "#abb2bf", - "shortcutForeground": "#568AF2" + "shortcutForeground": "accentColor" }, "EditorPane.inactiveBackground": "#282c34", @@ -139,11 +139,6 @@ "visitedForeground": "#6494ed" }, - "MenuBar.borderColor": "#46494f", - "Menu.borderColor": "#2d3137", - - "NavBar.borderColor": "#46494f", - "Notification": { "background": "#3d424b", "borderColor": "#53565f", @@ -186,13 +181,13 @@ "tagForeground": "#abb2bf", "Button": { - "installForeground": "#568AF2", - "installBorderColor":"#568AF2", + "installForeground": "accentColor", + "installBorderColor":"accentColor", "installFillForeground": "#ffffff", - "installFillBackground": "#568AF2", + "installFillBackground": "accentColor", "updateForeground":"#ffffff", - "updateBackground": "#568AF2", - "updateBorderColor": "#568AF2" + "updateBackground": "accentColor", + "updateBorderColor": "accentColor" }, "SearchField": { @@ -222,8 +217,8 @@ "ProgressBar": { "trackColor": "#1D1D26", - "progressColor": "#568AF2", - "indeterminateStartColor": "#568AF2", + "progressColor": "accentColor", + "indeterminateStartColor": "accentColor", "indeterminateEndColor": "#313469", "failedColor": "#bd3c5f", "failedEndColor": "#472c33", @@ -247,8 +242,8 @@ }, "SearchMatch": { - "startBackground": "#568AF2", - "endBackground": "#568AF2" + "startBackground": "accentColor", + "endBackground": "accentColor" }, "SpeedSearch": { @@ -258,8 +253,10 @@ "errorForeground": "#e06c75" }, + "Settings.Spotlight.borderColor": "accentColor", + "TabbedPane": { - "underlineColor": "#568AF2", + "underlineColor": "accentColor", "contentAreaColor": "#323844", "hoverColor": "#323844" }, @@ -292,7 +289,7 @@ "ToggleButton": { "onForeground": "#ffffff", - "onBackground": "#568AF2", + "onBackground": "accentColor", "offForeground": "#9f9fa6", "offBackground": "#3d424b", "borderColor": "#3d424b", @@ -312,8 +309,7 @@ "Header": { "background": "#414855", - "inactiveBackground": "#323844", - "borderColor": "#21252b" + "inactiveBackground": "#323844" }, "HeaderTab": { @@ -326,7 +322,7 @@ "Tree": { "selectionBackground": "#4d78cc", - "modifiedItemForeground": "#568AF2", + "modifiedItemForeground": "accentColor", "rowHeight": 20 }, @@ -361,9 +357,9 @@ "Checkbox.Background.Default.Dark": "#282c34", "Checkbox.Border.Default.Dark": "#414855", "Checkbox.Foreground.Selected.Dark": "#abb2bf", - "Checkbox.Focus.Wide.Dark": "#568AF2", - "Checkbox.Focus.Thin.Default.Dark": "#568AF2", - "Checkbox.Focus.Thin.Selected.Dark": "#568AF2", + "Checkbox.Focus.Wide.Dark": "accentColor", + "Checkbox.Focus.Thin.Default.Dark": "accentColor", + "Checkbox.Focus.Thin.Selected.Dark": "accentColor", "Checkbox.Background.Disabled.Dark": "#21252b", "Checkbox.Border.Disabled.Dark": "#2c313a", "Checkbox.Foreground.Disabled.Dark": "#5c6370" diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/vuesion_theme.LICENSE.txt b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/vuesion_theme.LICENSE.txt similarity index 100% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/vuesion_theme.LICENSE.txt rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/vuesion_theme.LICENSE.txt diff --git a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/vuesion_theme.theme.json b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/vuesion_theme.theme.json similarity index 95% rename from flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/vuesion_theme.theme.json rename to flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/vuesion_theme.theme.json index 79a7b36e..8ac31e9a 100644 --- a/flatlaf-demo/src/main/resources/com/formdev/flatlaf/demo/intellijthemes/vuesion_theme.theme.json +++ b/flatlaf-intellij-themes/src/main/resources/com/formdev/flatlaf/intellijthemes/themes/vuesion_theme.theme.json @@ -82,9 +82,10 @@ "ComboPopup.border": "1,1,1,1,303a45", "CompletionPopup": { - "matchForeground": "#f43b6c", - "selectionBackground": "#202831", - "selectionInactiveBackground": "#202831" + "foreground": "#c9cbcf", + "matchForeground": "#0d9660", + "selectionBackground": "#0c1014", + "selectionInactiveBackground": "#0c1014" }, "Component": { @@ -103,7 +104,6 @@ "DebuggerPopup.borderColor": "#202831", - "DebuggerTabs.selectedBackground": "#303a45", "DebuggerTabs.underlineHeight": 1, "DefaultTabs": { @@ -254,14 +254,14 @@ "Transparent": { "thumbColor": "#303a45", "thumbBorderColor": "#303a45", - "hoverThumbColor": "#434e5b", - "hoverThumbBorderColor": "#434e5b", + "hoverThumbColor": "#9ca2aa", + "hoverThumbBorderColor": "#9ca2aa", "hoverTrackColor": "#434e5b" }, "thumbColor": "#303a45", "thumbBorderColor": "#303a45", - "hoverThumbColor": "#434e5b", - "hoverThumbBorderColor": "#434e5b", + "hoverThumbColor": "#9ca2aa", + "hoverThumbBorderColor": "#9ca2aa", "trackColor": "#434e5b", "hoverTrackColor": "#434e5b", @@ -269,14 +269,14 @@ "Transparent": { "thumbColor": "#303a45", "thumbBorderColor": "#303a45", - "hoverThumbColor": "#434e5b", - "hoverThumbBorderColor": "#434e5b", + "hoverThumbColor": "#9ca2aa", + "hoverThumbBorderColor": "#9ca2aa", "hoverTrackColor": "#434e5b" }, "thumbColor": "#303a45", "thumbBorderColor": "#303a45", - "hoverThumbColor": "#434e5b", - "hoverThumbBorderColor": "#434e5b", + "hoverThumbColor": "#9ca2aa", + "hoverThumbBorderColor": "#9ca2aa", "trackColor": "#434e5b", "hoverTrackColor": "#434e5b" } @@ -349,7 +349,6 @@ }, "HeaderTab": { - "selectedBackground": "#303a45", "selectedInactiveBackground": "#303a45", "hoverBackground": "#303a45", "hoverInactiveBackground": "#303a45", diff --git a/flatlaf-jide-oss/.settings/org.eclipse.jdt.core.prefs b/flatlaf-jide-oss/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-jide-oss/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-jide-oss/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-jide-oss/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-jide-oss/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-jide-oss/build.gradle.kts b/flatlaf-jide-oss/build.gradle.kts index 158129e8..faf975e4 100644 --- a/flatlaf-jide-oss/build.gradle.kts +++ b/flatlaf-jide-oss/build.gradle.kts @@ -16,9 +16,7 @@ plugins { `java-library` - `maven-publish` - id( "com.jfrog.bintray" ) - id( "com.jfrog.artifactory" ) + `flatlaf-publish` } dependencies { @@ -26,113 +24,24 @@ dependencies { implementation( "com.jidesoft:jide-oss:3.6.18" ) } -tasks { - assemble { - dependsOn( - "sourcesJar", - "javadocJar" - ) - } +java { + withSourcesJar() + withJavadocJar() +} +tasks { javadoc { options { this as StandardJavadocDocletOptions + use( true ) tags = listOf( "uiDefault", "clientProperty" ) } isFailOnError = false } - - register( "sourcesJar", Jar::class ) { - archiveClassifier.set( "sources" ) - - from( sourceSets.main.get().allJava ) - } - - register( "javadocJar", Jar::class ) { - archiveClassifier.set( "javadoc" ) - - from( javadoc ) - } } -publishing { - publications { - create( "maven" ) { - artifactId = "flatlaf-jide-oss" - groupId = "com.formdev" - - from( components["java"] ) - - artifact( tasks["sourcesJar"] ) - artifact( tasks["javadocJar"] ) - - pom { - name.set( "FlatLaf addon for JIDE Common Layer" ) - description.set( "Flat Look and Feel addon for JIDE Common Layer" ) - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - - licenses { - license { - name.set( "The Apache License, Version 2.0" ) - url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" ) - } - } - - developers { - developer { - name.set( "Karl Tauber" ) - organization.set( "FormDev Software GmbH" ) - organizationUrl.set( "https://www.formdev.com/" ) - } - } - - scm { - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - } - } - } - } -} - -bintray { - user = rootProject.extra["bintray.user"] as String? - key = rootProject.extra["bintray.key"] as String? - - setPublications( "maven" ) - - with( pkg ) { - repo = "flatlaf" - name = "flatlaf-jide-oss" - setLicenses( "Apache-2.0" ) - vcsUrl = "https://github.com/JFormDesigner/FlatLaf" - - with( version ) { - name = project.version.toString() - } - - publish = rootProject.extra["bintray.publish"] as Boolean - dryRun = rootProject.extra["bintray.dryRun"] as Boolean - } -} - -artifactory { - setContextUrl( "https://oss.jfrog.org" ) - - publish( closureOf { - repository( delegateClosureOf { - setProperty( "repoKey", "oss-snapshot-local" ) - setProperty( "username", rootProject.extra["bintray.user"] as String? ) - setProperty( "password", rootProject.extra["bintray.key"] as String? ) - } ) - - defaults( delegateClosureOf { - invokeMethod( "publications", "maven" ) - setProperty( "publishArtifacts", true ) - setProperty( "publishPom", true ) - } ) - } ) - - resolve( delegateClosureOf { - setProperty( "repoKey", "jcenter" ) - } ) +flatlafPublish { + artifactId = "flatlaf-jide-oss" + name = "FlatLaf addon for JIDE Common Layer" + description = "Flat Look and Feel addon for JIDE Common Layer" } diff --git a/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/ui/FlatJideTabbedPaneUI.java b/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/ui/FlatJideTabbedPaneUI.java index da6f5f2f..7d1baea2 100644 --- a/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/ui/FlatJideTabbedPaneUI.java +++ b/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/ui/FlatJideTabbedPaneUI.java @@ -216,7 +216,7 @@ public class FlatJideTabbedPaneUI g.setColor( enabled && _tabPane.isEnabledAt( tabIndex ) && (_indexMouseOver == tabIndex || (_closeButtons != null && ((JideTabbedPane.NoFocusButton)_closeButtons[tabIndex]).isMouseOver())) ? hoverColor - : (enabled && isSelected && _tabPane.hasFocus() + : (enabled && isSelected && FlatUIUtils.isPermanentFocusOwner( _tabPane ) ? focusColor : _tabPane.getBackgroundAt( tabIndex )) ); g.fillRect( x, y, w, h ); diff --git a/flatlaf-swingx/.settings/org.eclipse.jdt.core.prefs b/flatlaf-swingx/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-swingx/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-swingx/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-swingx/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-swingx/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-swingx/build.gradle.kts b/flatlaf-swingx/build.gradle.kts index 22b2e542..90bd33b9 100644 --- a/flatlaf-swingx/build.gradle.kts +++ b/flatlaf-swingx/build.gradle.kts @@ -16,9 +16,8 @@ plugins { `java-library` - `maven-publish` - id( "com.jfrog.bintray" ) - id( "com.jfrog.artifactory" ) + `flatlaf-module-info` + `flatlaf-publish` } dependencies { @@ -26,113 +25,28 @@ dependencies { implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" ) } -tasks { - assemble { - dependsOn( - "sourcesJar", - "javadocJar" - ) - } +flatlafModuleInfo { + dependsOn( ":flatlaf-core:jar" ) +} +java { + withSourcesJar() + withJavadocJar() +} + +tasks { javadoc { options { this as StandardJavadocDocletOptions + use( true ) tags = listOf( "uiDefault", "clientProperty" ) } isFailOnError = false } - - register( "sourcesJar", Jar::class ) { - archiveClassifier.set( "sources" ) - - from( sourceSets.main.get().allJava ) - } - - register( "javadocJar", Jar::class ) { - archiveClassifier.set( "javadoc" ) - - from( javadoc ) - } } -publishing { - publications { - create( "maven" ) { - artifactId = "flatlaf-swingx" - groupId = "com.formdev" - - from( components["java"] ) - - artifact( tasks["sourcesJar"] ) - artifact( tasks["javadocJar"] ) - - pom { - name.set( "FlatLaf addon for SwingX" ) - description.set( "Flat Look and Feel addon for SwingX" ) - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - - licenses { - license { - name.set( "The Apache License, Version 2.0" ) - url.set( "https://www.apache.org/licenses/LICENSE-2.0.txt" ) - } - } - - developers { - developer { - name.set( "Karl Tauber" ) - organization.set( "FormDev Software GmbH" ) - organizationUrl.set( "https://www.formdev.com/" ) - } - } - - scm { - url.set( "https://github.com/JFormDesigner/FlatLaf" ) - } - } - } - } -} - -bintray { - user = rootProject.extra["bintray.user"] as String? - key = rootProject.extra["bintray.key"] as String? - - setPublications( "maven" ) - - with( pkg ) { - repo = "flatlaf" - name = "flatlaf-swingx" - setLicenses( "Apache-2.0" ) - vcsUrl = "https://github.com/JFormDesigner/FlatLaf" - - with( version ) { - name = project.version.toString() - } - - publish = rootProject.extra["bintray.publish"] as Boolean - dryRun = rootProject.extra["bintray.dryRun"] as Boolean - } -} - -artifactory { - setContextUrl( "https://oss.jfrog.org" ) - - publish( closureOf { - repository( delegateClosureOf { - setProperty( "repoKey", "oss-snapshot-local" ) - setProperty( "username", rootProject.extra["bintray.user"] as String? ) - setProperty( "password", rootProject.extra["bintray.key"] as String? ) - } ) - - defaults( delegateClosureOf { - invokeMethod( "publications", "maven" ) - setProperty( "publishArtifacts", true ) - setProperty( "publishPom", true ) - } ) - } ) - - resolve( delegateClosureOf { - setProperty( "repoKey", "jcenter" ) - } ) +flatlafPublish { + artifactId = "flatlaf-swingx" + name = "FlatLaf addon for SwingX" + description = "Flat Look and Feel addon for SwingX" } diff --git a/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerBorder.java b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerBorder.java index f9968ca0..a53b8378 100644 --- a/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerBorder.java +++ b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerBorder.java @@ -20,6 +20,7 @@ import java.awt.Component; import javax.swing.JTable; import org.jdesktop.swingx.JXDatePicker; import com.formdev.flatlaf.ui.FlatRoundBorder; +import com.formdev.flatlaf.ui.FlatUIUtils; /** * Border for {@link org.jdesktop.swingx.JXDatePicker}. @@ -32,13 +33,13 @@ public class FlatDatePickerBorder @Override protected boolean isFocused( Component c ) { if( c instanceof JXDatePicker ) - return ((JXDatePicker)c).getEditor().hasFocus(); + return FlatUIUtils.isPermanentFocusOwner( ((JXDatePicker)c).getEditor() ); return super.isFocused( c ); } @Override - protected boolean isTableCellEditor( Component c ) { + protected boolean isCellEditor( Component c ) { return c.getParent() instanceof JTable; } } diff --git a/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerUI.java b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerUI.java index 5bff5639..27ada24a 100644 --- a/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerUI.java +++ b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/ui/FlatDatePickerUI.java @@ -46,8 +46,6 @@ import org.jdesktop.swingx.JXPanel; import org.jdesktop.swingx.calendar.DatePickerFormatter.DatePickerFormatterUIResource; import org.jdesktop.swingx.plaf.basic.BasicDatePickerUI; import com.formdev.flatlaf.ui.FlatArrowButton; -import com.formdev.flatlaf.ui.FlatBorder; -import com.formdev.flatlaf.ui.FlatRoundBorder; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.MigLayoutVisualPadding; import com.formdev.flatlaf.util.UIScale; @@ -62,8 +60,6 @@ public class FlatDatePickerUI { protected Insets padding; - protected int focusWidth; - protected int arc; protected String arrowType; protected Color borderColor; protected Color disabledBorderColor; @@ -88,8 +84,6 @@ public class FlatDatePickerUI padding = UIManager.getInsets( "ComboBox.padding" ); - focusWidth = UIManager.getInt( "Component.focusWidth" ); - arc = UIManager.getInt( "Component.arc" ); arrowType = UIManager.getString( "Component.arrowType" ); borderColor = UIManager.getColor( "Component.borderColor" ); disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" ); @@ -130,7 +124,7 @@ public class FlatDatePickerUI LookAndFeel.installBorder( datePicker, "JXDatePicker.border" ); LookAndFeel.installProperty( datePicker, "opaque", Boolean.TRUE ); - MigLayoutVisualPadding.install( datePicker, focusWidth ); + MigLayoutVisualPadding.install( datePicker ); } @Override @@ -228,8 +222,8 @@ public class FlatDatePickerUI int width = c.getWidth(); int height = c.getHeight(); - float focusWidth = (c.getBorder() instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0; - float arc = (c.getBorder() instanceof FlatRoundBorder) ? scale( (float) this.arc ) : 0; + float focusWidth = FlatUIUtils.getBorderFocusWidth( c ); + float arc = FlatUIUtils.getBorderArc( c ); int arrowX = popupButton.getX(); int arrowWidth = popupButton.getWidth(); boolean enabled = c.isEnabled(); diff --git a/flatlaf-swingx/src/main/module-info/module-info.java b/flatlaf-swingx/src/main/module-info/module-info.java new file mode 100644 index 00000000..36afe50d --- /dev/null +++ b/flatlaf-swingx/src/main/module-info/module-info.java @@ -0,0 +1,36 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Karl Tauber + */ +module com.formdev.flatlaf.swingx { + requires java.desktop; + requires swingx.all; + requires com.formdev.flatlaf; + + exports com.formdev.flatlaf.swingx; + exports com.formdev.flatlaf.swingx.ui; + + // this allows com.formdev.flatlaf.FlatDefaultsAddon to read .properties files + opens com.formdev.flatlaf.swingx + to com.formdev.flatlaf; + + provides com.formdev.flatlaf.FlatDefaultsAddon + with com.formdev.flatlaf.swingx.FlatSwingXDefaultsAddon; + provides org.jdesktop.swingx.plaf.LookAndFeelAddons + with com.formdev.flatlaf.swingx.FlatLookAndFeelAddons; +} diff --git a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties index 4565a9b7..98e3238d 100644 --- a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties +++ b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatDarkLaf.properties @@ -16,7 +16,7 @@ #---- BusyLabel ---- -JXBusyLabel.baseColor=#777777 +JXBusyLabel.baseColor=#777 JXBusyLabel.highlightColor=#e0e0e0 @@ -38,8 +38,8 @@ Hyperlink.disabledText=@disabledText JXMonthView.background=@textComponentBackground JXMonthView.monthStringBackground=#4c5052 JXMonthView.monthStringForeground=@foreground -JXMonthView.daysOfTheWeekForeground=#aaaaaa -JXMonthView.weekOfTheYearForeground=#888888 +JXMonthView.daysOfTheWeekForeground=#aaa +JXMonthView.weekOfTheYearForeground=#888 JXMonthView.unselectableDayForeground=#E05555 JXMonthView.selectedBackground=@selectionBackground JXMonthView.flaggedDayForeground=#E05555 @@ -63,7 +63,7 @@ TaskPane.contentInsets=10,10,10,10 TaskPane.titleBackgroundGradientStart=#4c5052 TaskPane.titleForeground=@foreground -TaskPane.titleOver=#888888 +TaskPane.titleOver=#888 TaskPane.specialTitleBackground=#afafaf -TaskPane.specialTitleForeground=#222222 -TaskPane.specialTitleOver=#666666 +TaskPane.specialTitleForeground=#222 +TaskPane.specialTitleOver=#666 diff --git a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties index b0b4a002..84e09193 100644 --- a/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties +++ b/flatlaf-swingx/src/main/resources/com/formdev/flatlaf/swingx/FlatLightLaf.properties @@ -23,7 +23,7 @@ JXBusyLabel.highlightColor=#808080 #---- Header ---- JXHeader.background=@background -JXHeader.startBackground=#ffffff +JXHeader.startBackground=#fff #---- Hyperlink ---- @@ -38,8 +38,8 @@ Hyperlink.disabledText=@disabledText JXMonthView.background=@textComponentBackground JXMonthView.monthStringBackground=#dfdfdf JXMonthView.monthStringForeground=@foreground -JXMonthView.daysOfTheWeekForeground=#444444 -JXMonthView.weekOfTheYearForeground=#666666 +JXMonthView.daysOfTheWeekForeground=#444 +JXMonthView.weekOfTheYearForeground=#666 JXMonthView.unselectableDayForeground=#E02222 JXMonthView.selectedBackground=#B9CEF8 JXMonthView.flaggedDayForeground=#E02222 @@ -62,8 +62,8 @@ TaskPane.borderColor=$Button.borderColor TaskPane.contentInsets=10,10,10,10 TaskPane.titleBackgroundGradientStart=#dfdfdf -TaskPane.titleForeground=#222222 -TaskPane.titleOver=#666666 +TaskPane.titleForeground=#222 +TaskPane.titleOver=#666 TaskPane.specialTitleBackground=#afafaf -TaskPane.specialTitleForeground=#222222 -TaskPane.specialTitleOver=#666666 +TaskPane.specialTitleForeground=#222 +TaskPane.specialTitleOver=#666 diff --git a/flatlaf-testing/.settings/org.eclipse.jdt.core.prefs b/flatlaf-testing/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-testing/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-testing/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-testing/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-testing/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-testing/Window Icon Test Images.sketch b/flatlaf-testing/Window Icon Test Images.sketch new file mode 100644 index 00000000..3fa6d1df Binary files /dev/null and b/flatlaf-testing/Window Icon Test Images.sketch differ diff --git a/flatlaf-testing/Windows 10 decorations.png b/flatlaf-testing/Windows 10 decorations.png new file mode 100644 index 00000000..04af6c4c Binary files /dev/null and b/flatlaf-testing/Windows 10 decorations.png differ diff --git a/flatlaf-testing/build.gradle.kts b/flatlaf-testing/build.gradle.kts index 1bfca1c5..41489b4a 100644 --- a/flatlaf-testing/build.gradle.kts +++ b/flatlaf-testing/build.gradle.kts @@ -18,21 +18,30 @@ plugins { `java-library` } +repositories { + maven { + // for using MigLayout snapshot + url = uri( "https://oss.sonatype.org/content/repositories/snapshots/" ) + } +} + dependencies { implementation( project( ":flatlaf-core" ) ) implementation( project( ":flatlaf-extras" ) ) implementation( project( ":flatlaf-swingx" ) ) implementation( project( ":flatlaf-jide-oss" ) ) + implementation( project( ":flatlaf-intellij-themes" ) ) implementation( project( ":flatlaf-demo" ) ) - implementation( "com.miglayout:miglayout-swing:5.2" ) + implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" ) implementation( "com.jgoodies:jgoodies-forms:1.9.0" ) implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" ) implementation( "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1" ) implementation( "com.jidesoft:jide-oss:3.6.18" ) + implementation( "com.glazedlists:glazedlists:1.11.0" ) implementation( "org.netbeans.api:org-openide-awt:RELEASE112" ) -// implementation( "org.pushing-pixels:radiance-substance:2.5.1" ) -// implementation( "com.weblookandfeel:weblaf-ui:1.2.12" ) +// implementation( "org.pushing-pixels:radiance-substance:3.5.1" ) +// implementation( "com.weblookandfeel:weblaf-ui:1.2.13" ) // implementation( "com.jgoodies:jgoodies-looks:2.7.0" ) } diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.0t.txt new file mode 100644 index 00000000..9ea66ee5 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.0 + +Java scale: 1.0 +Font scale: 1.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.captionFont.height 12 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 5 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.smallCaptionFont.height 12 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.icon.font.height 12 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.menu.font.height 12 +win.menu.height 19 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.messagebox.font.height 12 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.status.font.height 12 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.tooltip.font.height 12 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.25t.txt new file mode 100644 index 00000000..9af636b7 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 5 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.5t.txt new file mode 100644 index 00000000..a87830ee --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 44 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 5 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.25t.txt new file mode 100644 index 00000000..6f797342 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.25 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=13] +win.defaultGUI.font.height 13 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 28 +win.frame.captionButtonWidth 46 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.frame.captionFont.height 19 +win.frame.captionGradientsOn true +win.frame.captionHeight 28 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 6 +win.frame.smallCaptionButtonHeight 28 +win.frame.smallCaptionButtonWidth 28 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.frame.smallCaptionFont.height 19 +win.frame.smallCaptionHeight 28 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.icon.font.height 19 +win.icon.hspacing 143 +win.icon.titleWrappingOn true +win.icon.vspacing 94 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 24 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.menu.font.height 19 +win.menu.height 28 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 21 +win.scrollbar.width 21 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.status.font.height 19 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=19] +win.tooltip.font.height 19 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.5t.txt new file mode 100644 index 00000000..2b5e028d --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.25s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.25 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 2.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=13] +win.defaultGUI.font.height 13 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 34 +win.frame.captionButtonWidth 56 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.frame.captionFont.height 23 +win.frame.captionGradientsOn true +win.frame.captionHeight 34 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 6 +win.frame.smallCaptionButtonHeight 34 +win.frame.smallCaptionButtonWidth 28 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.frame.smallCaptionFont.height 23 +win.frame.smallCaptionHeight 34 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.icon.font.height 23 +win.icon.hspacing 143 +win.icon.titleWrappingOn true +win.icon.vspacing 94 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 24 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.menu.font.height 23 +win.menu.height 34 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.messagebox.font.height 23 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 21 +win.scrollbar.width 21 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.status.font.height 23 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=23] +win.tooltip.font.height 23 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.0t.txt new file mode 100644 index 00000000..03a79c59 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.0 + +Java scale: 1.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 33 +win.frame.captionButtonWidth 54 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 33 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 8 +win.frame.smallCaptionButtonHeight 33 +win.frame.smallCaptionButtonWidth 33 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 33 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 171 +win.icon.titleWrappingOn true +win.icon.vspacing 113 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 29 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 29 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 26 +win.scrollbar.width 26 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.25t.txt new file mode 100644 index 00000000..affdecdc --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 1.75 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 33 +win.frame.captionButtonWidth 54 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.frame.captionFont.height 22 +win.frame.captionGradientsOn true +win.frame.captionHeight 33 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 8 +win.frame.smallCaptionButtonHeight 33 +win.frame.smallCaptionButtonWidth 33 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.frame.smallCaptionFont.height 22 +win.frame.smallCaptionHeight 33 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.icon.font.height 22 +win.icon.hspacing 171 +win.icon.titleWrappingOn true +win.icon.vspacing 113 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 29 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.menu.font.height 22 +win.menu.height 32 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.messagebox.font.height 22 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 26 +win.scrollbar.width 26 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.status.font.height 22 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=22] +win.tooltip.font.height 22 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.5t.txt new file mode 100644 index 00000000..985f06e0 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.5s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 2.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 39 +win.frame.captionButtonWidth 64 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.frame.captionFont.height 27 +win.frame.captionGradientsOn true +win.frame.captionHeight 39 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 8 +win.frame.smallCaptionButtonHeight 39 +win.frame.smallCaptionButtonWidth 33 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.frame.smallCaptionFont.height 27 +win.frame.smallCaptionHeight 39 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.icon.font.height 27 +win.icon.hspacing 171 +win.icon.titleWrappingOn true +win.icon.vspacing 113 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 29 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.menu.font.height 27 +win.menu.height 39 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.messagebox.font.height 27 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 26 +win.scrollbar.width 26 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.status.font.height 27 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=27] +win.tooltip.font.height 27 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.25t.txt new file mode 100644 index 00000000..4b097926 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.75 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 2.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=19] +win.defaultGUI.font.height 19 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 39 +win.frame.captionButtonWidth 64 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.frame.captionFont.height 26 +win.frame.captionGradientsOn true +win.frame.captionHeight 39 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 9 +win.frame.smallCaptionButtonHeight 39 +win.frame.smallCaptionButtonWidth 39 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.frame.smallCaptionFont.height 26 +win.frame.smallCaptionHeight 39 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.icon.font.height 26 +win.icon.hspacing 200 +win.icon.titleWrappingOn true +win.icon.vspacing 131 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 33 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.menu.font.height 26 +win.menu.height 39 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.messagebox.font.height 26 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 30 +win.scrollbar.width 30 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.status.font.height 26 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=26] +win.tooltip.font.height 26 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.5t.txt new file mode 100644 index 00000000..986114ad --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--1.75s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 1.75 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 2.75 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=19] +win.defaultGUI.font.height 19 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 47 +win.frame.captionButtonWidth 77 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.frame.captionFont.height 32 +win.frame.captionGradientsOn true +win.frame.captionHeight 47 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 9 +win.frame.smallCaptionButtonHeight 47 +win.frame.smallCaptionButtonWidth 39 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.frame.smallCaptionFont.height 32 +win.frame.smallCaptionHeight 47 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.icon.font.height 32 +win.icon.hspacing 200 +win.icon.titleWrappingOn true +win.icon.vspacing 131 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 33 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.menu.font.height 32 +win.menu.height 47 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.messagebox.font.height 32 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 30 +win.scrollbar.width 30 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.status.font.height 32 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=32] +win.tooltip.font.height 32 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.0t.txt new file mode 100644 index 00000000..5ce7d0f7 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.0 + +Java scale: 1.0 +Font scale: 2.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=21] +win.defaultGUI.font.height 21 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 44 +win.frame.captionButtonWidth 72 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.frame.captionFont.height 24 +win.frame.captionGradientsOn true +win.frame.captionHeight 44 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 10 +win.frame.smallCaptionButtonHeight 44 +win.frame.smallCaptionButtonWidth 44 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.frame.smallCaptionFont.height 24 +win.frame.smallCaptionHeight 44 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.icon.font.height 24 +win.icon.hspacing 228 +win.icon.titleWrappingOn true +win.icon.vspacing 150 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 38 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.menu.font.height 24 +win.menu.height 38 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.messagebox.font.height 24 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 34 +win.scrollbar.width 34 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.status.font.height 24 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=24] +win.tooltip.font.height 24 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.25t.txt new file mode 100644 index 00000000..263021d9 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 2.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=21] +win.defaultGUI.font.height 21 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 44 +win.frame.captionButtonWidth 72 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.frame.captionFont.height 30 +win.frame.captionGradientsOn true +win.frame.captionHeight 44 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 10 +win.frame.smallCaptionButtonHeight 44 +win.frame.smallCaptionButtonWidth 44 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.frame.smallCaptionFont.height 30 +win.frame.smallCaptionHeight 44 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.icon.font.height 30 +win.icon.hspacing 228 +win.icon.titleWrappingOn true +win.icon.vspacing 150 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 38 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.menu.font.height 30 +win.menu.height 44 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=29] +win.messagebox.font.height 29 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 34 +win.scrollbar.width 34 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.status.font.height 30 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=30] +win.tooltip.font.height 30 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.5t.txt new file mode 100644 index 00000000..01e7ef76 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 3.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=21] +win.defaultGUI.font.height 21 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 54 +win.frame.captionButtonWidth 89 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.frame.captionFont.height 36 +win.frame.captionGradientsOn true +win.frame.captionHeight 54 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 10 +win.frame.smallCaptionButtonHeight 54 +win.frame.smallCaptionButtonWidth 44 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.frame.smallCaptionFont.height 36 +win.frame.smallCaptionHeight 54 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.icon.font.height 36 +win.icon.hspacing 228 +win.icon.titleWrappingOn true +win.icon.vspacing 150 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 38 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.menu.font.height 36 +win.menu.height 54 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.messagebox.font.height 36 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 34 +win.scrollbar.width 34 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.status.font.height 36 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=36] +win.tooltip.font.height 36 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.25s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.25s-1.5t.txt new file mode 100644 index 00000000..150ac6de --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--2.25s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 2.25 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 3.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=24] +win.defaultGUI.font.height 24 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 61 +win.frame.captionButtonWidth 100 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.frame.captionFont.height 41 +win.frame.captionGradientsOn true +win.frame.captionHeight 61 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 11 +win.frame.smallCaptionButtonHeight 61 +win.frame.smallCaptionButtonWidth 50 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.frame.smallCaptionFont.height 41 +win.frame.smallCaptionHeight 61 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.icon.font.height 41 +win.icon.hspacing 257 +win.icon.titleWrappingOn true +win.icon.vspacing 169 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 43 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.menu.font.height 41 +win.menu.height 61 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.messagebox.font.height 41 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 38 +win.scrollbar.width 38 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.status.font.height 41 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=41] +win.tooltip.font.height 41 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.25t.txt new file mode 100644 index 00000000..ce1fd0e0 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 3.0 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 3.75 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=32] +win.defaultGUI.font.height 32 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 66 +win.frame.captionButtonWidth 109 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.frame.captionFont.height 45 +win.frame.captionGradientsOn true +win.frame.captionHeight 66 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 15 +win.frame.smallCaptionButtonHeight 66 +win.frame.smallCaptionButtonWidth 66 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.frame.smallCaptionFont.height 45 +win.frame.smallCaptionHeight 66 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.icon.font.height 45 +win.icon.hspacing 342 +win.icon.titleWrappingOn true +win.icon.vspacing 225 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 57 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.menu.font.height 45 +win.menu.height 66 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=44] +win.messagebox.font.height 44 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 51 +win.scrollbar.width 51 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.status.font.height 45 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=45] +win.tooltip.font.height 45 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.5t.txt new file mode 100644 index 00000000..51291b59 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-1.8.0_202--3.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 1.8.0_202 +OS: Windows 10 + +Screen scale: 3.0 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 4.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=32] +win.defaultGUI.font.height 32 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 81 +win.frame.captionButtonWidth 133 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.frame.captionFont.height 54 +win.frame.captionGradientsOn true +win.frame.captionHeight 81 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 15 +win.frame.smallCaptionButtonHeight 81 +win.frame.smallCaptionButtonWidth 66 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.frame.smallCaptionFont.height 54 +win.frame.smallCaptionHeight 81 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.icon.font.height 54 +win.icon.hspacing 342 +win.icon.titleWrappingOn true +win.icon.vspacing 225 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 57 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.menu.font.height 54 +win.menu.height 81 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.messagebox.font.height 54 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 51 +win.scrollbar.width 51 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.status.font.height 54 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=54] +win.tooltip.font.height 54 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.0t.txt new file mode 100644 index 00000000..b3187323 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.0 + +Java scale: 1.0 +Font scale: 1.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.captionFont.height 12 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.smallCaptionFont.height 12 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.icon.font.height 12 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.menu.font.height 12 +win.menu.height 19 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.messagebox.font.height 12 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.status.font.height 12 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.tooltip.font.height 12 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.25t.txt new file mode 100644 index 00000000..b413be72 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.25 + +Java scale: 1.0 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.5t.txt new file mode 100644 index 00000000..a1146c7c --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.0 +Text scale: 1.5 + +Java scale: 1.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=16] +win.defaultGUI.font.height 16 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 44 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.25t.txt new file mode 100644 index 00000000..85f306fe --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.25 +Text scale: 1.25 + +Java scale: 1.25 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=13] +win.defaultGUI.font.height 13 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 37 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=14] +win.messagebox.font.height 14 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.5t.txt new file mode 100644 index 00000000..f4d07c71 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.25s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.25 +Text scale: 1.5 + +Java scale: 1.25 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=13] +win.defaultGUI.font.height 13 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 45 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.0t.txt new file mode 100644 index 00000000..d6232668 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.0 + +Java scale: 1.5 +Font scale: 1.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.captionFont.height 12 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.smallCaptionFont.height 12 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.icon.font.height 12 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.menu.font.height 12 +win.menu.height 19 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.messagebox.font.height 12 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.status.font.height 12 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.tooltip.font.height 12 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.25t.txt new file mode 100644 index 00000000..9e55cd38 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.25 + +Java scale: 1.5 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 21 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.5t.txt new file mode 100644 index 00000000..25b28a91 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.5s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.5 +Text scale: 1.5 + +Java scale: 1.5 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=11] +win.defaultGUI.font.height 11 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 26 +win.frame.captionButtonWidth 43 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 26 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 26 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 26 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 26 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.25t.txt new file mode 100644 index 00000000..1a9fd2db --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.75 +Text scale: 1.25 + +Java scale: 1.75 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=9] +win.defaultGUI.font.height 9 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 37 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.5t.txt new file mode 100644 index 00000000..cd2dcfa0 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--1.75s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 1.75 +Text scale: 1.5 + +Java scale: 1.75 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=9] +win.defaultGUI.font.height 9 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 44 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.0t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.0t.txt new file mode 100644 index 00000000..0e7cd3ae --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.0t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.0 + +Java scale: 2.0 +Font scale: 1.0 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=8] +win.defaultGUI.font.height 8 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.captionFont.height 12 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.frame.smallCaptionFont.height 12 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.icon.font.height 12 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.menu.font.height 12 +win.menu.height 19 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.messagebox.font.height 12 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.status.font.height 12 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=12] +win.tooltip.font.height 12 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.25t.txt new file mode 100644 index 00000000..3fd0bba6 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.25 + +Java scale: 2.0 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=8] +win.defaultGUI.font.height 8 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.5t.txt new file mode 100644 index 00000000..08613b1e --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 2.0 +Text scale: 1.5 + +Java scale: 2.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=8] +win.defaultGUI.font.height 8 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 45 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.25s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.25s-1.5t.txt new file mode 100644 index 00000000..59d9fc54 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--2.25s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 2.25 +Text scale: 1.5 + +Java scale: 2.25 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=7] +win.defaultGUI.font.height 7 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 44 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.25t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.25t.txt new file mode 100644 index 00000000..37dea0e4 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.25t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 3.0 +Text scale: 1.25 + +Java scale: 3.0 +Font scale: 1.25 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=5] +win.defaultGUI.font.height 5 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 22 +win.frame.captionButtonWidth 36 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.captionFont.height 15 +win.frame.captionGradientsOn true +win.frame.captionHeight 22 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 22 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.frame.smallCaptionFont.height 15 +win.frame.smallCaptionHeight 22 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.icon.font.height 15 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.menu.font.height 15 +win.menu.height 22 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.messagebox.font.height 15 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.status.font.height 15 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=15] +win.tooltip.font.height 15 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.5t.txt b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.5t.txt new file mode 100644 index 00000000..db145105 --- /dev/null +++ b/flatlaf-testing/dumps/desktop-properties/desktop-properties-win-9.0.4--3.0s-1.5t.txt @@ -0,0 +1,120 @@ +Java version: 9.0.4 +OS: Windows 10 + +Screen scale: 3.0 +Text scale: 1.5 + +Java scale: 3.0 +Font scale: 1.5 + +DnD.gestureMotionThreshold 2 +awt.dynamicLayoutSupported true +awt.file.showAttribCol false +awt.file.showHiddenFiles true +awt.font.desktophints {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Text-specific LCD contrast key=120} +awt.mouse.numButtons 5 +awt.multiClickInterval 500 +awt.wheelMousePresent true +win.3d.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.3d.darkShadowColor java.awt.Color[r=105,g=105,b=105] +win.3d.highlightColor java.awt.Color[r=255,g=255,b=255] +win.3d.lightColor java.awt.Color[r=227,g=227,b=227] +win.3d.shadowColor java.awt.Color[r=160,g=160,b=160] +win.ansiFixed.font java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=13] +win.ansiFixed.font.height 13 +win.ansiVar.font java.awt.Font[family=Microsoft Sans Serif,name=Microsoft Sans Serif,style=plain,size=11] +win.ansiVar.font.height 11 +win.button.textColor java.awt.Color[r=0,g=0,b=0] +win.caret.width 1 +win.defaultGUI.font java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=5] +win.defaultGUI.font.height 5 +win.desktop.backgroundColor java.awt.Color[r=0,g=0,b=0] +win.deviceDefault.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.deviceDefault.font.height 16 +win.drag.height 4 +win.drag.width 4 +win.frame.activeBorderColor java.awt.Color[r=180,g=180,b=180] +win.frame.activeCaptionColor java.awt.Color[r=153,g=180,b=209] +win.frame.activeCaptionGradientColor java.awt.Color[r=185,g=209,b=234] +win.frame.backgroundColor java.awt.Color[r=255,g=255,b=255] +win.frame.captionButtonHeight 27 +win.frame.captionButtonWidth 44 +win.frame.captionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.captionFont.height 18 +win.frame.captionGradientsOn true +win.frame.captionHeight 27 +win.frame.captionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.color java.awt.Color[r=100,g=100,b=100] +win.frame.fullWindowDragsOn true +win.frame.inactiveBorderColor java.awt.Color[r=244,g=247,b=252] +win.frame.inactiveCaptionColor java.awt.Color[r=191,g=205,b=219] +win.frame.inactiveCaptionGradientColor java.awt.Color[r=215,g=228,b=242] +win.frame.inactiveCaptionTextColor java.awt.Color[r=0,g=0,b=0] +win.frame.sizingBorderWidth 1 +win.frame.smallCaptionButtonHeight 27 +win.frame.smallCaptionButtonWidth 22 +win.frame.smallCaptionFont java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.frame.smallCaptionFont.height 18 +win.frame.smallCaptionHeight 27 +win.frame.textColor java.awt.Color[r=0,g=0,b=0] +win.highContrast.on false +win.icon.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.icon.font.height 18 +win.icon.hspacing 114 +win.icon.titleWrappingOn true +win.icon.vspacing 75 +win.item.highlightColor java.awt.Color[r=0,g=120,b=215] +win.item.highlightTextColor java.awt.Color[r=255,g=255,b=255] +win.item.hotTrackedColor java.awt.Color[r=0,g=102,b=204] +win.item.hotTrackingOn true +win.mdi.backgroundColor java.awt.Color[r=171,g=171,b=171] +win.menu.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.menu.buttonWidth 19 +win.menu.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.menu.font.height 18 +win.menu.height 27 +win.menu.keyboardCuesOn false +win.menu.textColor java.awt.Color[r=0,g=0,b=0] +win.menubar.backgroundColor java.awt.Color[r=240,g=240,b=240] +win.messagebox.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.messagebox.font.height 18 +win.oemFixed.font java.awt.Font[family=Dialog,name=8514oem,style=plain,size=18] +win.oemFixed.font.height 18 +win.properties.version 3 +win.scrollbar.backgroundColor java.awt.Color[r=200,g=200,b=200] +win.scrollbar.height 17 +win.scrollbar.width 17 +win.sound.asterisk WinPlaySound(SystemAsterisk) +win.sound.close WinPlaySound(Close) +win.sound.default WinPlaySound(.Default) +win.sound.exclamation WinPlaySound(SystemExclamation) +win.sound.exit WinPlaySound(SystemExit) +win.sound.hand WinPlaySound(SystemHand) +win.sound.maximize WinPlaySound(Maximize) +win.sound.menuCommand WinPlaySound(MenuCommand) +win.sound.menuPopup WinPlaySound(MenuPopup) +win.sound.minimize WinPlaySound(Minimize) +win.sound.open WinPlaySound(Open) +win.sound.question WinPlaySound(SystemQuestion) +win.sound.restoreDown WinPlaySound(RestoreDown) +win.sound.restoreUp WinPlaySound(RestoreUp) +win.sound.start WinPlaySound(SystemStart) +win.status.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.status.font.height 18 +win.system.font java.awt.Font[family=Dialog,name=Dialog,style=bold,size=16] +win.system.font.height 16 +win.systemFixed.font java.awt.Font[family=Dialog,name=Fixedsys,style=plain,size=18] +win.systemFixed.font.height 18 +win.text.fontSmoothingContrast 1200 +win.text.fontSmoothingOn true +win.text.fontSmoothingOrientation 1 +win.text.fontSmoothingType 2 +win.text.grayedTextColor java.awt.Color[r=109,g=109,b=109] +win.tooltip.backgroundColor java.awt.Color[r=255,g=255,b=225] +win.tooltip.font java.awt.Font[family=Segoe UI,name=Segoe UI,style=plain,size=18] +win.tooltip.font.height 18 +win.tooltip.textColor java.awt.Color[r=0,g=0,b=0] +win.xpstyle.colorName NormalColor +win.xpstyle.dllName C:\Windows\resources\themes\Aero\Aero.msstyles +win.xpstyle.sizeName NormalSize +win.xpstyle.themeActive true diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_11.0.2.txt b/flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_11.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_11.0.2.txt rename to flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_11.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_9.0.4.txt b/flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_9.0.4.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_9.0.4.txt rename to flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_9.0.4.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_InputMap_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_InputMap_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_InputMap_13.0.2.txt b/flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_InputMap_13.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/AquaLookAndFeel_InputMap_13.0.2.txt rename to flatlaf-testing/dumps/uidefaults/AquaLookAndFeel_InputMap_13.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_11.0.2.txt b/flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_11.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_11.0.2.txt rename to flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_11.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_InputMap_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/BasicLookAndFeel_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/BasicLookAndFeel_InputMap_1.8.0_202.txt diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarculaLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatDarculaLaf_1.8.0_202.txt new file mode 100644 index 00000000..d4e91e74 --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatDarculaLaf_1.8.0_202.txt @@ -0,0 +1,63 @@ +- Class com.formdev.flatlaf.FlatDarkLaf ++ Class com.formdev.flatlaf.FlatDarculaLaf + +- ID FlatLaf - FlatLaf Dark ++ ID FlatLaf - FlatLaf Darcula + +- Name FlatLaf Dark ++ Name FlatLaf Darcula + +- Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ++ Button.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] + +- ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] ++ ComboBox.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] + +- Component.arrowType chevron ++ Component.arrowType triangle + +- Component.focusWidth 0 ++ Component.focusWidth 2 + +- Component.innerFocusWidth 0.5 ++ Component.innerFocusWidth 0 + +- Component.innerOutlineWidth 1.0 ++ Component.innerOutlineWidth 0 + +- FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ FormattedTextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] ++ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] + +- JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI] ++ JXDatePicker.border [lazy] 3,3,3,3 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI] + +- PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ PasswordField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI] ++ ProgressBar.foreground #a0a0a0 javax.swing.plaf.ColorUIResource [UI] + +- ProgressBar.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ++ ProgressBar.selectionForeground #3c3f41 javax.swing.plaf.ColorUIResource [UI] + +- RadioButton.icon.centerDiameter 8 ++ RadioButton.icon.centerDiameter 5 + +- ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ++ ScrollPane.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI] + +- Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] ++ Spinner.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] + +- Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ++ Table.scrollPaneBorder [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI] + +- TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ TextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ++ ToggleButton.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] + diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-linux.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-linux.txt new file mode 100644 index 00000000..53feaf64 --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-linux.txt @@ -0,0 +1,21 @@ +- OS Windows 10 ++ OS Linux + +- Button.defaultButtonFollowsFocus true ++ Button.defaultButtonFollowsFocus false + +- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ++ ProgressBar.font [active] Cantarell plain 13 javax.swing.plaf.FontUIResource [UI] + +- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] ++ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI] + +- ScrollBar.thumbArc 0 ++ ScrollBar.thumbArc 999 + +- ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ++ ScrollBar.thumbInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] + +- defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] ++ defaultFont Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] + diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt new file mode 100644 index 00000000..7a4016df --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt @@ -0,0 +1,36 @@ +- OS Windows 10 ++ OS Mac OS X + +- Button.defaultButtonFollowsFocus true ++ Button.defaultButtonFollowsFocus false + ++ ComboBox.showPopupOnNavigation true + +- Menu.shortcutKeys length=1 [I + [0] 8 ++ Menu.shortcutKeys length=1 [I + [0] 10 + +- MenuItem.acceleratorDelimiter - ++ MenuItem.acceleratorDelimiter + ++ OptionPane.isYesLast true + +- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ++ ProgressBar.font [active] .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] + +- ScrollBar.hoverThumbWithTrack false ++ ScrollBar.hoverThumbWithTrack true + +- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] ++ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI] + +- ScrollBar.thumbArc 0 ++ ScrollBar.thumbArc 999 + +- ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ++ ScrollBar.thumbInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] + +- defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] ++ defaultFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] + diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt similarity index 76% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt index a9006f26..5ef5e6a6 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -1,6 +1,6 @@ Class com.formdev.flatlaf.FlatDarkLaf -ID FlatLaf - Flat Dark -Name Flat Dark +ID FlatLaf - FlatLaf Dark +Name FlatLaf Dark Java 1.8.0_202 OS Windows 10 @@ -65,6 +65,7 @@ Button.arc 6 Button.background #4c5052 javax.swing.plaf.ColorUIResource [UI] Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] Button.borderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] +Button.borderWidth 1 Button.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] Button.default.background #365880 javax.swing.plaf.ColorUIResource [UI] Button.default.boldText true @@ -73,30 +74,35 @@ Button.default.borderWidth 1 Button.default.focusColor #43688c javax.swing.plaf.ColorUIResource [UI] Button.default.focusedBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] Button.default.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Button.default.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.default.hoverBackground #3b5f8b com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) Button.default.hoverBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] -Button.default.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.default.pressedBackground #3f6796 com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) Button.defaultButtonFollowsFocus true +Button.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] -Button.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] +Button.disabledSelectedBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) +Button.disabledText #888888 javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Button.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Button.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.hoverBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) Button.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] Button.iconTextGap 4 Button.light #313131 javax.swing.plaf.ColorUIResource [UI] Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] Button.minimumWidth 72 -Button.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.pressedBackground #5b5f62 com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) Button.rollover true +Button.selectedBackground #656a6c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) +Button.selectedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Button.shadow #646464 javax.swing.plaf.ColorUIResource [UI] Button.textIconGap 4 Button.textShiftOffset 0 -Button.toolbar.hoverBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.hoverBackground #4e5355 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1% autoInverse) Button.toolbar.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -Button.toolbar.pressedBackground #555a5d javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.pressedBackground #565a5d com.formdev.flatlaf.util.DerivedColor [UI] lighten(4% autoInverse) +Button.toolbar.selectedBackground #5d6265 com.formdev.flatlaf.util.DerivedColor [UI] lighten(7% autoInverse) Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] ButtonUI com.formdev.flatlaf.ui.FlatButtonUI @@ -111,8 +117,8 @@ Caret.width [active] 1 CheckBox.arc 4 CheckBox.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -CheckBox.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBox.disabledText #888888 javax.swing.plaf.ColorUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #43494a javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] @@ -121,14 +127,19 @@ CheckBox.icon.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI CheckBox.icon.disabledBorderColor #545556 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.disabledCheckmarkColor #606060 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +CheckBox.icon.hoverBackground #4a5152 com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) CheckBox.icon.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +CheckBox.icon.pressedBackground #52595a com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) CheckBox.icon.selectedBackground #43494a javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.selectedBorderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.selectedFocusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxIcon [UI] CheckBox.iconTextGap 4 +CheckBox.icon[filled].checkmarkColor #43494a javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedBackground #a7a7a7 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedBorderColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedHoverBackground #9f9f9f javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedPressedBackground #989898 javax.swing.plaf.ColorUIResource [UI] CheckBox.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] CheckBox.rollover true CheckBox.textIconGap 4 @@ -137,18 +148,18 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] +CheckBoxMenuItem.acceleratorForeground #959595 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] CheckBoxMenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] -CheckBoxMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +CheckBoxMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false CheckBoxMenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -163,7 +174,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #3c3f41 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -183,11 +194,15 @@ ComboBox.buttonEditableBackground #404445 javax.swing.plaf.ColorUIResource [U ComboBox.buttonHighlight #242424 javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #646464 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonStyle auto ComboBox.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ComboBox.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ComboBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ComboBox.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] +ComboBox.editorColumns 0 +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false +ComboBox.maximumRowCount 15 +ComboBox.minimumWidth 72 ComboBox.noActionOnKeyNavigation false ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] ComboBox.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] @@ -201,14 +216,21 @@ ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI Component.arc 5 Component.arrowType chevron Component.borderColor #646464 javax.swing.plaf.ColorUIResource [UI] +Component.custom.borderColor #bf4040 com.formdev.flatlaf.util.DerivedColor [UI] desaturate(50% relative) Component.disabledBorderColor #646464 javax.swing.plaf.ColorUIResource [UI] +Component.error.borderColor #725555 javax.swing.plaf.ColorUIResource [UI] +Component.error.focusedBorderColor #8b3c3c javax.swing.plaf.ColorUIResource [UI] Component.focusColor #3d6185 javax.swing.plaf.ColorUIResource [UI] Component.focusWidth 0 Component.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] +Component.grayFilter [lazy] [unknown type] com.formdev.flatlaf.util.GrayFilter Component.hideMnemonics true Component.innerFocusWidth 0.5 +Component.innerOutlineWidth 1.0 Component.linkColor #589df6 javax.swing.plaf.ColorUIResource [UI] Component.minimumWidth 64 +Component.warning.borderColor #725627 javax.swing.plaf.ColorUIResource [UI] +Component.warning.focusedBorderColor #ac7920 javax.swing.plaf.ColorUIResource [UI] #---- DatePicker ---- @@ -245,10 +267,10 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +EditorPane.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] EditorPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] EditorPane.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] EditorPane.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -263,7 +285,7 @@ FileChooser.listViewIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil FileChooser.newFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserNewFolderIcon [UI] FileChooser.readOnly false FileChooser.upFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserUpFolderIcon [UI] -FileChooser.useSystemExtensionHiding false +FileChooser.useSystemExtensionHiding true FileChooser.usesSingleFilePane true FileChooserUI com.formdev.flatlaf.ui.FlatFileChooserUI @@ -284,12 +306,12 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -FormattedTextField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.placeholderForeground #888888 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] FormattedTextField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] FormattedTextFieldUI com.formdev.flatlaf.ui.FlatFormattedTextFieldUI @@ -308,16 +330,16 @@ HelpButton.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledBorderColor #545556 javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledQuestionMarkColor #606060 javax.swing.plaf.ColorUIResource [UI] HelpButton.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -HelpButton.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +HelpButton.hoverBackground #4a5152 com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) HelpButton.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] -HelpButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +HelpButton.pressedBackground #52595a com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) HelpButton.questionMarkColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] #---- Hyperlink ---- -Hyperlink.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] +Hyperlink.disabledText #888888 javax.swing.plaf.ColorUIResource [UI] Hyperlink.linkColor #589df6 javax.swing.plaf.ColorUIResource [UI] Hyperlink.visitedColor #589df6 javax.swing.plaf.ColorUIResource [UI] HyperlinkUI com.formdev.flatlaf.swingx.ui.FlatHyperlinkUI @@ -325,7 +347,9 @@ HyperlinkUI com.formdev.flatlaf.swingx.ui.FlatHyperlinkUI #---- InternalFrame ---- -InternalFrame.activeBorderColor #7e7e7e javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeBorderColor #2b2d2e javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeDropShadowInsets 5,5,6,6 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.activeDropShadowOpacity 0.5 InternalFrame.activeTitleBackground #242526 javax.swing.plaf.ColorUIResource [UI] InternalFrame.activeTitleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] InternalFrame.border [lazy] 6,6,6,6 false com.formdev.flatlaf.ui.FlatInternalFrameUI$FlatInternalFrameBorder [UI] @@ -336,22 +360,25 @@ InternalFrame.borderLight #313131 javax.swing.plaf.ColorUIResource [UI] InternalFrame.borderLineWidth 1 InternalFrame.borderMargins 6,6,6,6 javax.swing.plaf.InsetsUIResource [UI] InternalFrame.borderShadow #646464 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.buttonHoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -InternalFrame.buttonPressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +InternalFrame.buttonHoverBackground #3d3f40 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) +InternalFrame.buttonPressedBackground #56585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse) InternalFrame.buttonSize 24,24 javax.swing.plaf.DimensionUIResource [UI] InternalFrame.closeHoverBackground [lazy] #c75450 javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] InternalFrame.closePressedBackground [lazy] #ad3b37 javax.swing.plaf.ColorUIResource [UI] InternalFrame.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +InternalFrame.dropShadowPainted true InternalFrame.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) InternalFrame.iconifyIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameIconifyIcon [UI] -InternalFrame.inactiveBorderColor #646464 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveBorderColor #353739 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveDropShadowInsets 3,3,4,4 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.inactiveDropShadowOpacity 0.75 InternalFrame.inactiveTitleBackground #303234 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.inactiveTitleForeground #777777 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveTitleForeground #888888 javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] -InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameRestoreIcon [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -389,15 +416,15 @@ JXHeader.startBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] JXMonthView.arrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] JXMonthView.background #45494a javax.swing.plaf.ColorUIResource [UI] JXMonthView.daysOfTheWeekForeground #aaaaaa javax.swing.plaf.ColorUIResource [UI] -JXMonthView.disabledArrowColor #777777 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.disabledArrowColor #888888 javax.swing.plaf.ColorUIResource [UI] JXMonthView.flaggedDayForeground #e05555 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.leadingDayForeground #777777 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.leadingDayForeground #888888 javax.swing.plaf.ColorUIResource [UI] JXMonthView.monthDownFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthDownIcon [UI] JXMonthView.monthStringBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] JXMonthView.monthStringForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] JXMonthView.monthUpFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthUpIcon [UI] JXMonthView.selectedBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -JXMonthView.trailingDayForeground #777777 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.trailingDayForeground #888888 javax.swing.plaf.ColorUIResource [UI] JXMonthView.unselectableDayForeground #e05555 javax.swing.plaf.ColorUIResource [UI] JXMonthView.weekOfTheYearForeground #888888 javax.swing.plaf.ColorUIResource [UI] @@ -418,7 +445,7 @@ JideTabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.tabAreaBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] JideTabbedPane.tabRunOverlay 0 JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI @@ -426,9 +453,9 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane #---- Label ---- Label.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Label.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] +Label.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #646464 javax.swing.plaf.ColorUIResource [UI] -Label.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -439,28 +466,29 @@ List.background #45494a javax.swing.plaf.ColorUIResource [UI] List.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] List.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] List.cellMargins 1,6,1,6 javax.swing.plaf.InsetsUIResource [UI] -List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] +List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 List.cellRenderer [active] javax.swing.DefaultListCellRenderer$UIResource [UI] List.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] List.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] List.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] -List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] -List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.font [active] $defaultFont [UI] List.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] List.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] List.selectionInactiveBackground #0d293e javax.swing.plaf.ColorUIResource [UI] List.selectionInactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +List.showCellFocusIndicator false List.timeFactor 1000 ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -Menu.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] +Menu.acceleratorForeground #959595 javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] Menu.background #303234 javax.swing.plaf.ColorUIResource [UI] @@ -468,12 +496,12 @@ Menu.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true -Menu.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Menu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #606060 javax.swing.plaf.ColorUIResource [UI] -Menu.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +Menu.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] Menu.menuPopupOffsetX 0 Menu.menuPopupOffsetY 0 Menu.opaque false @@ -491,11 +519,11 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #515151 javax.swing.plaf.ColorUIResource [UI] -MenuBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -MenuBar.hoverBackground #484c4f javax.swing.plaf.ColorUIResource [UI] -MenuBar.itemMargins 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] +MenuBar.hoverBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) +MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] MenuBar.shadow #646464 javax.swing.plaf.ColorUIResource [UI] MenuBar.windowBindings length=2 [Ljava.lang.Object; [0] F10 @@ -505,21 +533,33 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- +MenuItem.acceleratorArrowGap 2 MenuItem.acceleratorDelimiter - -MenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -MenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] +MenuItem.acceleratorForeground #959595 javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] MenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true -MenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -MenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.checkBackground #3c588b javax.swing.plaf.ColorUIResource [UI] +MenuItem.checkMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.iconTextGap 6 +MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +MenuItem.minimumWidth 72 MenuItem.opaque false MenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +MenuItem.textAcceleratorGap 24 +MenuItem.textNoAcceleratorGap 6 +MenuItem.underlineSelectionBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) +MenuItem.underlineSelectionCheckBackground #3c588b javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionHeight 3 #---- MenuItemCheckBox ---- @@ -568,7 +608,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -589,7 +629,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Panel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -604,25 +644,34 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -PasswordField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +PasswordField.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] PasswordField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -PasswordField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] +PasswordField.placeholderForeground #888888 javax.swing.plaf.ColorUIResource [UI] PasswordField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] PasswordField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +PasswordField.showCapsLock true PasswordFieldUI com.formdev.flatlaf.ui.FlatPasswordFieldUI +#---- Popup ---- + +Popup.dropShadowColor #000000 javax.swing.plaf.ColorUIResource [UI] +Popup.dropShadowInsets -4,-4,4,4 javax.swing.plaf.InsetsUIResource [UI] +Popup.dropShadowOpacity 0.25 +Popup.dropShadowPainted true + + #---- PopupMenu ---- PopupMenu.background #303234 javax.swing.plaf.ColorUIResource [UI] -PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] +PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] lineColor=#5e5e5e javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 PopupMenu.borderColor #5e5e5e javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -647,7 +696,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -662,13 +711,14 @@ ProgressBarUI com.formdev.flatlaf.ui.FlatProgressBarUI RadioButton.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -RadioButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButton.disabledText #888888 javax.swing.plaf.ColorUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 RadioButton.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonIcon [UI] RadioButton.iconTextGap 4 +RadioButton.icon[filled].centerDiameter 5 RadioButton.light #313131 javax.swing.plaf.ColorUIResource [UI] RadioButton.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] RadioButton.rollover true @@ -679,18 +729,18 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] +RadioButtonMenuItem.acceleratorForeground #959595 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] RadioButtonMenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] -RadioButtonMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +RadioButtonMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false RadioButtonMenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -704,11 +754,15 @@ RadioButtonUI com.formdev.flatlaf.ui.FlatRadioButtonUI #---- Resizable ---- -Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] +Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#5e5e5e javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 #---- RootPane ---- +RootPane.activeBorderColor #4d5154 com.formdev.flatlaf.util.DerivedColor [UI] darken(7% autoInverse) +RootPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRootPaneUI$FlatWindowBorder [UI] +RootPane.borderDragThickness 5 +RootPane.cornerDragWidth 16 RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [0] ENTER [1] press @@ -718,6 +772,9 @@ RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [5] press [6] ctrl released ENTER [7] release +RootPane.honorDialogMinimumSizeOnResize true +RootPane.honorFrameMinimumSizeOnResize false +RootPane.inactiveBorderColor #484c4e com.formdev.flatlaf.util.DerivedColor [UI] darken(5% autoInverse) RootPaneUI com.formdev.flatlaf.ui.FlatRootPaneUI @@ -728,28 +785,37 @@ ScrollBar.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonDisabledArrowColor #585858 javax.swing.plaf.ColorUIResource [UI] ScrollBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverThumbColor #717678 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverTrackColor #494c4f javax.swing.plaf.ColorUIResource [UI] -ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI] -ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.hoverButtonBackground #484c4e com.formdev.flatlaf.util.DerivedColor [UI] lighten(5%) +ScrollBar.hoverThumbColor #6e767a com.formdev.flatlaf.util.DerivedColor [UI] lighten(10%) +ScrollBar.hoverThumbWithTrack false +ScrollBar.hoverTrackColor #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(4%) +ScrollBar.maximumThumbSize 100000,100000 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.pressedButtonBackground #54595c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10%) +ScrollBar.pressedThumbColor #7a8387 com.formdev.flatlaf.util.DerivedColor [UI] lighten(15%) +ScrollBar.pressedThumbWithTrack false ScrollBar.showButtons false ScrollBar.squareButtons false -ScrollBar.thumb #585c5e javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumb #565c5f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10%) +ScrollBar.thumbArc 0 ScrollBar.thumbDarkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] ScrollBar.thumbHighlight #242424 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ScrollBar.thumbShadow #646464 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.track #3f4244 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.track #3e4244 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) +ScrollBar.trackArc 0 ScrollBar.trackHighlight #7e7e7e javax.swing.plaf.ColorUIResource [UI] +ScrollBar.trackInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ScrollBar.width 10 ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI #---- ScrollPane ---- -ScrollPane.background #3f4244 javax.swing.plaf.ColorUIResource [UI] +ScrollPane.background #3e4244 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -773,11 +839,11 @@ Slider.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #4c5052 javax.swing.plaf.ColorUIResource [UI] Slider.focus #7e7e7e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Slider.highlight #242424 javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension -Slider.hoverColor #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Slider.hoverColor #808080 com.formdev.flatlaf.util.DerivedColor [UI] darken(15% autoInverse) Slider.minimumHorizontalSize 36,21 java.awt.Dimension Slider.minimumVerticalSize 21,36 java.awt.Dimension Slider.onlyLeftMouseButtonDrag true @@ -800,11 +866,12 @@ Spinner.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] Spinner.buttonBackground #404445 javax.swing.plaf.ColorUIResource [UI] Spinner.buttonDisabledArrowColor #585858 javax.swing.plaf.ColorUIResource [UI] Spinner.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] +Spinner.buttonStyle button Spinner.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Spinner.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] +Spinner.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -838,17 +905,29 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.contentAreaColor #323232 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeArc 4 +TabbedPane.closeCrossFilledSize 7.5 +TabbedPane.closeCrossLineWidth 1.0 +TabbedPane.closeCrossPlainSize 7.5 +TabbedPane.closeForeground #888888 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverBackground #464b4e javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon [UI] +TabbedPane.closePressedBackground #52585b javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closePressedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +TabbedPane.contentAreaColor #646464 javax.swing.plaf.ColorUIResource [UI] TabbedPane.contentOpaque true TabbedPane.contentSeparatorHeight 1 TabbedPane.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -TabbedPane.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #3d4b5c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false +TabbedPane.hiddenTabsNavigation moreTabsButton TabbedPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hoverColor #2e3133 javax.swing.plaf.ColorUIResource [UI] TabbedPane.labelShift 1 @@ -857,13 +936,16 @@ TabbedPane.selectedLabelShift -1 TabbedPane.selectedTabPadInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.selectionFollowsFocus true TabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.showTabSeparators false +TabbedPane.tabAreaAlignment leading TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabHeight 32 -TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabRunOverlay 0 TabbedPane.tabSelectionHeight 3 +TabbedPane.tabSeparatorsFullHeight false TabbedPane.tabsOpaque true -TabbedPane.tabsOverlapBorder true +TabbedPane.tabsOverlapBorder false TabbedPane.textIconGap 4 TabbedPane.underlineColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] TabbedPaneUI com.formdev.flatlaf.ui.FlatTabbedPaneUI @@ -875,7 +957,8 @@ Table.ascendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatAsce Table.background #45494a javax.swing.plaf.ColorUIResource [UI] Table.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] Table.cellMargins 2,3,2,3 javax.swing.plaf.InsetsUIResource [UI] -Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] +Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.consistentHomeEndKeyBehavior true Table.descendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatDescendingSortIcon [UI] Table.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] Table.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -883,9 +966,9 @@ Table.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResourc Table.dropLineShortColor [lazy] #b4c3df javax.swing.plaf.ColorUIResource [UI] Table.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] -Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.font [active] $defaultFont [UI] Table.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Table.gridColor #4c5152 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -906,7 +989,7 @@ TableHeader.background #45494a javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] -TableHeader.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] @@ -944,10 +1027,10 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TextArea.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] TextArea.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] TextArea.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] TextArea.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -968,14 +1051,14 @@ TextField.caretBlinkRate 500 TextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.highlight #242424 javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TextField.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] TextField.light #313131 javax.swing.plaf.ColorUIResource [UI] TextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] +TextField.placeholderForeground #888888 javax.swing.plaf.ColorUIResource [UI] TextField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] TextField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextField.shadow #646464 javax.swing.plaf.ColorUIResource [UI] @@ -989,20 +1072,46 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TextPane.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] TextPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] TextPane.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] TextPane.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI +#---- TitlePane ---- + +TitlePane.background #303234 javax.swing.plaf.ColorUIResource [UI] +TitlePane.buttonHoverBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) +TitlePane.buttonMaximizedHeight 22 +TitlePane.buttonPressedBackground #616569 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse) +TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] +TitlePane.closePressedBackground #99e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.embeddedForeground #959595 javax.swing.plaf.ColorUIResource [UI] +TitlePane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +TitlePane.iconMargins 3,8,3,0 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI] +TitlePane.inactiveBackground #303234 javax.swing.plaf.ColorUIResource [UI] +TitlePane.inactiveForeground #888888 javax.swing.plaf.ColorUIResource [UI] +TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI] +TitlePane.menuBarEmbedded true +TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI] +TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] + + #---- TitledBorder ---- -TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#515151 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] @@ -1016,17 +1125,18 @@ TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI ToggleButton.background #4c5052 javax.swing.plaf.ColorUIResource [UI] ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ToggleButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledSelectedBackground #525658 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToggleButton.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledSelectedBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) +ToggleButton.disabledText #888888 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 ToggleButton.light #313131 javax.swing.plaf.ColorUIResource [UI] ToggleButton.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] -ToggleButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +ToggleButton.pressedBackground #5b5f62 com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) ToggleButton.rollover true -ToggleButton.selectedBackground #64696c javax.swing.plaf.ColorUIResource [UI] +ToggleButton.selectedBackground #656a6c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) ToggleButton.selectedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToggleButton.shadow #646464 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] @@ -1036,9 +1146,9 @@ ToggleButton.tab.underlineColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.underlineHeight 2 ToggleButton.textIconGap 4 ToggleButton.textShiftOffset 0 -ToggleButton.toolbar.hoverBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.pressedBackground #555a5d javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.selectedBackground #5c6164 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.toolbar.hoverBackground #4e5355 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1% autoInverse) +ToggleButton.toolbar.pressedBackground #565a5d com.formdev.flatlaf.util.DerivedColor [UI] lighten(4% autoInverse) +ToggleButton.toolbar.selectedBackground #5d6265 com.formdev.flatlaf.util.DerivedColor [UI] lighten(7% autoInverse) ToggleButtonUI com.formdev.flatlaf.ui.FlatToggleButtonUI @@ -1051,8 +1161,8 @@ ToolBar.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ToolBar.floatingForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ToolBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolBar.floatingForeground #888888 javax.swing.plaf.ColorUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #adadad javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] @@ -1077,11 +1187,9 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI #---- ToolTip ---- ToolTip.background #1e2123 javax.swing.plaf.ColorUIResource [UI] -ToolTip.backgroundInactive #1e2123 javax.swing.plaf.ColorUIResource [UI] ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -ToolTip.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToolTip.foregroundInactive #777777 javax.swing.plaf.ColorUIResource [UI] #---- ToolTipManager ---- @@ -1105,9 +1213,9 @@ Tree.drawsFocusBorderAroundIcon false Tree.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] Tree.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] -Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +Tree.editorBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.hash #505355 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #adadad javax.swing.plaf.ColorUIResource [UI] @@ -1122,6 +1230,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true @@ -1130,6 +1239,7 @@ Tree.selectionBorderColor #000000 javax.swing.plaf.ColorUIResource [UI] Tree.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.selectionInactiveBackground #0d293e javax.swing.plaf.ColorUIResource [UI] Tree.selectionInactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +Tree.showCellFocusIndicator false Tree.textBackground #45494a javax.swing.plaf.ColorUIResource [UI] Tree.textForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] Tree.timeFactor 1000 @@ -1140,7 +1250,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Viewport.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1156,6 +1266,7 @@ controlHighlight #313131 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #242424 javax.swing.plaf.ColorUIResource [UI] controlShadow #646464 javax.swing.plaf.ColorUIResource [UI] controlText #bbbbbb javax.swing.plaf.ColorUIResource [UI] +defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] desktop #45494a javax.swing.plaf.ColorUIResource [UI] @@ -1172,9 +1283,19 @@ inactiveCaptionBorder #393c3d javax.swing.plaf.ColorUIResource [UI] inactiveCaptionText #bbbbbb javax.swing.plaf.ColorUIResource [UI] info #1e2123 javax.swing.plaf.ColorUIResource [UI] infoText #bbbbbb javax.swing.plaf.ColorUIResource [UI] + + +#---- laf ---- + +laf.dark true +laf.scaleFactor [active] 1.0 + + +#---- ---- + menu #3c3f41 javax.swing.plaf.ColorUIResource [UI] menuText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -scrollbar #3f4244 javax.swing.plaf.ColorUIResource [UI] +scrollbar #3e4244 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) #---- swingx/TaskPane ---- @@ -1187,7 +1308,7 @@ swingx/TaskPaneUI com.formdev.flatlaf.swingx.ui.FlatTaskPaneUI text #45494a javax.swing.plaf.ColorUIResource [UI] textHighlight #4b6eaf javax.swing.plaf.ColorUIResource [UI] textHighlightText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -textInactiveText #777777 javax.swing.plaf.ColorUIResource [UI] +textInactiveText #888888 javax.swing.plaf.ColorUIResource [UI] textText #bbbbbb javax.swing.plaf.ColorUIResource [UI] window #3c3f41 javax.swing.plaf.ColorUIResource [UI] windowBorder #bbbbbb javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0_202.txt new file mode 100644 index 00000000..1943aed0 --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatIntelliJLaf_1.8.0_202.txt @@ -0,0 +1,86 @@ +- Class com.formdev.flatlaf.FlatLightLaf ++ Class com.formdev.flatlaf.FlatIntelliJLaf + +- ID FlatLaf - FlatLaf Light ++ ID FlatLaf - FlatLaf IntelliJ + +- Name FlatLaf Light ++ Name FlatLaf IntelliJ + +- Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ++ Button.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] + +- Button.default.background #ffffff javax.swing.plaf.ColorUIResource [UI] ++ Button.default.background #4d8ac9 javax.swing.plaf.ColorUIResource [UI] + ++ Button.default.boldText true + +- Button.default.borderColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] ++ Button.default.borderColor #3d75b2 javax.swing.plaf.ColorUIResource [UI] + +- Button.default.borderWidth 2 ++ Button.default.borderWidth 1 + +- Button.default.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] + +- Button.default.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] ++ Button.default.focusedBorderColor #a9c9f5 javax.swing.plaf.ColorUIResource [UI] + +- Button.default.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ++ Button.default.foreground #ffffff javax.swing.plaf.ColorUIResource [UI] + +- Button.default.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] ++ Button.default.hoverBorderColor #a9c9f5 javax.swing.plaf.ColorUIResource [UI] + +- Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] + +- CheckBox.icon.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] + ++ CheckBox.icon.style filled + +- CheckBox.icon[filled].selectedFocusedCheckmarkColor #e3f1fa javax.swing.plaf.ColorUIResource [UI] + +- ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] ++ ComboBox.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] + +- Component.arrowType chevron ++ Component.arrowType triangle + +- Component.focusWidth 0 ++ Component.focusWidth 2 + +- Component.innerFocusWidth 0.5 ++ Component.innerFocusWidth 0 + +- Component.innerOutlineWidth 1.0 ++ Component.innerOutlineWidth 0 + +- FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ FormattedTextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- HelpButton.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] + +- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] ++ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] + +- JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI] ++ JXDatePicker.border [lazy] 3,3,3,3 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI] + +- PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ PasswordField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ++ ScrollPane.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI] + +- Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] ++ Spinner.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] + +- Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ++ Table.scrollPaneBorder [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI] + +- TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] ++ TextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI] + +- ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ++ ToggleButton.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] + diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-linux.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-linux.txt new file mode 100644 index 00000000..53feaf64 --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-linux.txt @@ -0,0 +1,21 @@ +- OS Windows 10 ++ OS Linux + +- Button.defaultButtonFollowsFocus true ++ Button.defaultButtonFollowsFocus false + +- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ++ ProgressBar.font [active] Cantarell plain 13 javax.swing.plaf.FontUIResource [UI] + +- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] ++ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI] + +- ScrollBar.thumbArc 0 ++ ScrollBar.thumbArc 999 + +- ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ++ ScrollBar.thumbInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] + +- defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] ++ defaultFont Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] + diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-mac.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-mac.txt new file mode 100644 index 00000000..7a4016df --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202-mac.txt @@ -0,0 +1,36 @@ +- OS Windows 10 ++ OS Mac OS X + +- Button.defaultButtonFollowsFocus true ++ Button.defaultButtonFollowsFocus false + ++ ComboBox.showPopupOnNavigation true + +- Menu.shortcutKeys length=1 [I + [0] 8 ++ Menu.shortcutKeys length=1 [I + [0] 10 + +- MenuItem.acceleratorDelimiter - ++ MenuItem.acceleratorDelimiter + ++ OptionPane.isYesLast true + +- ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ++ ProgressBar.font [active] .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] + +- ScrollBar.hoverThumbWithTrack false ++ ScrollBar.hoverThumbWithTrack true + +- ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] ++ ScrollBar.minimumThumbSize 18,18 javax.swing.plaf.DimensionUIResource [UI] + +- ScrollBar.thumbArc 0 ++ ScrollBar.thumbArc 999 + +- ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ++ ScrollBar.thumbInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] + +- defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] ++ defaultFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] + diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt similarity index 78% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt index 0ddf06d9..cb2585b2 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -1,6 +1,6 @@ Class com.formdev.flatlaf.FlatLightLaf -ID FlatLaf - Flat Light -Name Flat Light +ID FlatLaf - FlatLaf Light +Name FlatLaf Light Java 1.8.0_202 OS Windows 10 @@ -65,6 +65,7 @@ Button.arc 6 Button.background #ffffff javax.swing.plaf.ColorUIResource [UI] Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] Button.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +Button.borderWidth 1 Button.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] Button.default.background #ffffff javax.swing.plaf.ColorUIResource [UI] Button.default.borderColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] @@ -73,31 +74,36 @@ Button.default.focusColor #97c3f3 javax.swing.plaf.ColorUIResource [UI] Button.default.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] Button.default.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] Button.default.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Button.default.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.default.hoverBackground #f7f7f7 com.formdev.flatlaf.util.DerivedColor [UI] darken(3% autoInverse) Button.default.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.default.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.default.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) Button.defaultButtonFollowsFocus true +Button.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] +Button.disabledSelectedBackground #dedede com.formdev.flatlaf.util.DerivedColor [UI] darken(13% autoInverse) Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Button.font [active] $defaultFont [UI] Button.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Button.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.hoverBackground #f7f7f7 com.formdev.flatlaf.util.DerivedColor [UI] darken(3% autoInverse) Button.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] Button.iconTextGap 4 Button.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] Button.minimumWidth 72 -Button.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) Button.rollover true +Button.selectedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) +Button.selectedForeground #000000 javax.swing.plaf.ColorUIResource [UI] Button.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] Button.textIconGap 4 Button.textShiftOffset 0 -Button.toolbar.hoverBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.hoverBackground #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(12% autoInverse) Button.toolbar.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -Button.toolbar.pressedBackground #d8d8d8 javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.pressedBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(15% autoInverse) +Button.toolbar.selectedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] ButtonUI com.formdev.flatlaf.ui.FlatButtonUI @@ -113,7 +119,7 @@ CheckBox.arc 4 CheckBox.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] CheckBox.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBox.font [active] $defaultFont [UI] CheckBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.borderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] @@ -123,13 +129,21 @@ CheckBox.icon.disabledBorderColor #bdbdbd javax.swing.plaf.ColorUIResource [U CheckBox.icon.disabledCheckmarkColor #ababab javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.focusedBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +CheckBox.icon.hoverBackground #f7f7f7 com.formdev.flatlaf.util.DerivedColor [UI] darken(3% autoInverse) CheckBox.icon.hoverBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +CheckBox.icon.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) CheckBox.icon.selectedBackground #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.selectedBorderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxIcon [UI] CheckBox.iconTextGap 4 +CheckBox.icon[filled].checkmarkColor #ffffff javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedBackground #4f9ee3 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedBorderColor #4b97d9 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedFocusedBackground #4f9ee3 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedFocusedBorderColor #accff7 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedFocusedCheckmarkColor #e3f1fa javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedHoverBackground #3992e0 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon[filled].selectedPressedBackground #2386dc javax.swing.plaf.ColorUIResource [UI] CheckBox.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] CheckBox.rollover true CheckBox.textIconGap 4 @@ -138,8 +152,8 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] +CheckBoxMenuItem.acceleratorForeground #4d4d4d javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] CheckBoxMenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -147,9 +161,9 @@ CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] CheckBoxMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] CheckBoxMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +CheckBoxMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false CheckBoxMenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -164,7 +178,7 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- ColorChooser.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] ColorChooser.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesDefaultRecentColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] @@ -184,11 +198,15 @@ ComboBox.buttonEditableBackground #fafafa javax.swing.plaf.ColorUIResource [U ComboBox.buttonHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonStyle auto ComboBox.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ComboBox.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ComboBox.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ComboBox.editorColumns 0 +ComboBox.font [active] $defaultFont [UI] ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false +ComboBox.maximumRowCount 15 +ComboBox.minimumWidth 72 ComboBox.noActionOnKeyNavigation false ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] ComboBox.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] @@ -202,14 +220,21 @@ ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI Component.arc 5 Component.arrowType chevron Component.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +Component.custom.borderColor #f38d8d com.formdev.flatlaf.util.DerivedColor [UI] desaturate(20%) lighten(25%) Component.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] +Component.error.borderColor #ebb8bc javax.swing.plaf.ColorUIResource [UI] +Component.error.focusedBorderColor #e53e4d javax.swing.plaf.ColorUIResource [UI] Component.focusColor #97c3f3 javax.swing.plaf.ColorUIResource [UI] Component.focusWidth 0 Component.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] +Component.grayFilter [lazy] [unknown type] com.formdev.flatlaf.util.GrayFilter Component.hideMnemonics true Component.innerFocusWidth 0.5 +Component.innerOutlineWidth 1.0 Component.linkColor #2470b3 javax.swing.plaf.ColorUIResource [UI] Component.minimumWidth 64 +Component.warning.borderColor #fed284 javax.swing.plaf.ColorUIResource [UI] +Component.warning.focusedBorderColor #e2a53a javax.swing.plaf.ColorUIResource [UI] #---- DatePicker ---- @@ -246,7 +271,7 @@ EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F EditorPane.caretBlinkRate 500 EditorPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +EditorPane.font [active] $defaultFont [UI] EditorPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] EditorPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -264,7 +289,7 @@ FileChooser.listViewIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil FileChooser.newFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserNewFolderIcon [UI] FileChooser.readOnly false FileChooser.upFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserUpFolderIcon [UI] -FileChooser.useSystemExtensionHiding false +FileChooser.useSystemExtensionHiding true FileChooser.usesSingleFilePane true FileChooserUI com.formdev.flatlaf.ui.FlatFileChooserUI @@ -285,7 +310,7 @@ FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F FormattedTextField.caretBlinkRate 500 FormattedTextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] FormattedTextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -310,10 +335,10 @@ HelpButton.disabledBorderColor #bdbdbd javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledQuestionMarkColor #ababab javax.swing.plaf.ColorUIResource [UI] HelpButton.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] HelpButton.focusedBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -HelpButton.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +HelpButton.hoverBackground #f7f7f7 com.formdev.flatlaf.util.DerivedColor [UI] darken(3% autoInverse) HelpButton.hoverBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] -HelpButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +HelpButton.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) HelpButton.questionMarkColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] @@ -328,6 +353,8 @@ HyperlinkUI com.formdev.flatlaf.swingx.ui.FlatHyperlinkUI #---- InternalFrame ---- InternalFrame.activeBorderColor #919191 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeDropShadowInsets 5,5,6,6 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.activeDropShadowOpacity 0.25 InternalFrame.activeTitleBackground #ffffff javax.swing.plaf.ColorUIResource [UI] InternalFrame.activeTitleForeground #000000 javax.swing.plaf.ColorUIResource [UI] InternalFrame.border [lazy] 6,6,6,6 false com.formdev.flatlaf.ui.FlatInternalFrameUI$FlatInternalFrameBorder [UI] @@ -338,22 +365,25 @@ InternalFrame.borderLight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] InternalFrame.borderLineWidth 1 InternalFrame.borderMargins 6,6,6,6 javax.swing.plaf.InsetsUIResource [UI] InternalFrame.borderShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.buttonHoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -InternalFrame.buttonPressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +InternalFrame.buttonHoverBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) +InternalFrame.buttonPressedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) InternalFrame.buttonSize 24,24 javax.swing.plaf.DimensionUIResource [UI] InternalFrame.closeHoverBackground [lazy] #db5860 javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] InternalFrame.closePressedBackground [lazy] #d22e38 javax.swing.plaf.ColorUIResource [UI] InternalFrame.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +InternalFrame.dropShadowPainted true InternalFrame.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) InternalFrame.iconifyIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameIconifyIcon [UI] InternalFrame.inactiveBorderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveDropShadowInsets 3,3,4,4 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.inactiveDropShadowOpacity 0.5 InternalFrame.inactiveTitleBackground #fafafa javax.swing.plaf.ColorUIResource [UI] InternalFrame.inactiveTitleForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] -InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameRestoreIcon [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -420,7 +450,7 @@ JideTabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.tabAreaBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] JideTabbedPane.tabRunOverlay 0 JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI @@ -430,7 +460,7 @@ JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPane Label.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Label.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Label.disabledShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Label.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Label.font [active] $defaultFont [UI] Label.foreground #000000 javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI @@ -441,28 +471,29 @@ List.background #ffffff javax.swing.plaf.ColorUIResource [UI] List.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] List.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] List.cellMargins 1,6,1,6 javax.swing.plaf.InsetsUIResource [UI] -List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] +List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 List.cellRenderer [active] javax.swing.DefaultListCellRenderer$UIResource [UI] List.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] List.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] List.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] -List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] -List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.font [active] $defaultFont [UI] List.foreground #000000 javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] List.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] List.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] List.selectionInactiveBackground #d4d4d4 javax.swing.plaf.ColorUIResource [UI] List.selectionInactiveForeground #000000 javax.swing.plaf.ColorUIResource [UI] +List.showCellFocusIndicator false List.timeFactor 1000 ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -Menu.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] +Menu.acceleratorForeground #4d4d4d javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] Menu.background #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -471,11 +502,11 @@ Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true Menu.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Menu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.font [active] $defaultFont [UI] Menu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Menu.icon.arrowColor #666666 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] -Menu.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +Menu.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] Menu.menuPopupOffsetX 0 Menu.menuPopupOffsetY 0 Menu.opaque false @@ -493,11 +524,11 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] MenuBar.borderColor #cdcdcd javax.swing.plaf.ColorUIResource [UI] -MenuBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuBar.font [active] $defaultFont [UI] MenuBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -MenuBar.hoverBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI] -MenuBar.itemMargins 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] +MenuBar.hoverBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) +MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] MenuBar.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] MenuBar.windowBindings length=2 [Ljava.lang.Object; [0] F10 @@ -507,21 +538,33 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- +MenuItem.acceleratorArrowGap 2 MenuItem.acceleratorDelimiter - -MenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -MenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +MenuItem.acceleratorFont [active] $defaultFont [UI] +MenuItem.acceleratorForeground #4d4d4d javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] MenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true +MenuItem.checkBackground #bfd9f2 javax.swing.plaf.ColorUIResource [UI] +MenuItem.checkMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] MenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -MenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.font [active] $defaultFont [UI] MenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.iconTextGap 6 +MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +MenuItem.minimumWidth 72 MenuItem.opaque false MenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +MenuItem.textAcceleratorGap 24 +MenuItem.textNoAcceleratorGap 6 +MenuItem.underlineSelectionBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) +MenuItem.underlineSelectionCheckBackground #bfd9f2 javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionColor #4083c9 javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionHeight 3 #---- MenuItemCheckBox ---- @@ -570,7 +613,7 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +OptionPane.font [active] $defaultFont [UI] OptionPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] @@ -591,7 +634,7 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- Panel.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Panel.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Panel.font [active] $defaultFont [UI] Panel.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -606,7 +649,7 @@ PasswordField.caretBlinkRate 500 PasswordField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PasswordField.font [active] $defaultFont [UI] PasswordField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] PasswordField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -614,17 +657,26 @@ PasswordField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] PasswordField.placeholderForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] PasswordField.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] PasswordField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +PasswordField.showCapsLock true PasswordFieldUI com.formdev.flatlaf.ui.FlatPasswordFieldUI +#---- Popup ---- + +Popup.dropShadowColor #000000 javax.swing.plaf.ColorUIResource [UI] +Popup.dropShadowInsets -4,-4,4,4 javax.swing.plaf.InsetsUIResource [UI] +Popup.dropShadowOpacity 0.15 +Popup.dropShadowPainted true + + #---- PopupMenu ---- PopupMenu.background #ffffff javax.swing.plaf.ColorUIResource [UI] -PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] +PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] lineColor=#adadad javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 PopupMenu.borderColor #adadad javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] PopupMenu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] @@ -649,7 +701,7 @@ ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 ProgressBar.cycleTime 4000 -ProgressBar.font Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] +ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] ProgressBar.foreground #1e82e6 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 @@ -665,12 +717,13 @@ RadioButton.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] RadioButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] RadioButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButton.font [active] $defaultFont [UI] RadioButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 RadioButton.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonIcon [UI] RadioButton.iconTextGap 4 +RadioButton.icon[filled].centerDiameter 5 RadioButton.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] RadioButton.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] RadioButton.rollover true @@ -681,8 +734,8 @@ RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] +RadioButtonMenuItem.acceleratorForeground #4d4d4d javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] RadioButtonMenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -690,9 +743,9 @@ RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] RadioButtonMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] RadioButtonMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +RadioButtonMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false RadioButtonMenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -706,11 +759,15 @@ RadioButtonUI com.formdev.flatlaf.ui.FlatRadioButtonUI #---- Resizable ---- -Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] +Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#adadad javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 #---- RootPane ---- +RootPane.activeBorderColor #707070 javax.swing.plaf.ColorUIResource [UI] +RootPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRootPaneUI$FlatWindowBorder [UI] +RootPane.borderDragThickness 5 +RootPane.cornerDragWidth 16 RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [0] ENTER [1] press @@ -720,6 +777,9 @@ RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [5] press [6] ctrl released ENTER [7] release +RootPane.honorDialogMinimumSizeOnResize true +RootPane.honorFrameMinimumSizeOnResize false +RootPane.inactiveBorderColor #a3a3a3 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse) RootPaneUI com.formdev.flatlaf.ui.FlatRootPaneUI @@ -730,28 +790,37 @@ ScrollBar.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] ScrollBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverThumbColor #c3c3c3 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverTrackColor #ededed javax.swing.plaf.ColorUIResource [UI] -ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI] -ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.hoverButtonBackground #e5e5e5 com.formdev.flatlaf.util.DerivedColor [UI] darken(5%) +ScrollBar.hoverThumbColor #c3c3c3 com.formdev.flatlaf.util.DerivedColor [UI] darken(10%) +ScrollBar.hoverThumbWithTrack false +ScrollBar.hoverTrackColor #ededed com.formdev.flatlaf.util.DerivedColor [UI] darken(3%) +ScrollBar.maximumThumbSize 100000,100000 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.pressedButtonBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(10%) +ScrollBar.pressedThumbColor #a9a9a9 com.formdev.flatlaf.util.DerivedColor [UI] darken(20%) +ScrollBar.pressedThumbWithTrack false ScrollBar.showButtons false ScrollBar.squareButtons false -ScrollBar.thumb #dcdcdc javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumb #dcdcdc com.formdev.flatlaf.util.DerivedColor [UI] darken(10%) +ScrollBar.thumbArc 0 ScrollBar.thumbDarkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] ScrollBar.thumbHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ScrollBar.thumbShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.track #f5f5f5 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.track #f5f5f5 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) +ScrollBar.trackArc 0 ScrollBar.trackHighlight #9e9e9e javax.swing.plaf.ColorUIResource [UI] +ScrollBar.trackInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ScrollBar.width 10 ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI #---- ScrollPane ---- -ScrollPane.background #f5f5f5 javax.swing.plaf.ColorUIResource [UI] +ScrollPane.background #f5f5f5 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] ScrollPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI @@ -775,11 +844,11 @@ Slider.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Slider.disabledForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] Slider.focus #9e9e9e javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Slider.font [active] $defaultFont [UI] Slider.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension -Slider.hoverColor #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Slider.hoverColor #949494 com.formdev.flatlaf.util.DerivedColor [UI] lighten(15% autoInverse) Slider.minimumHorizontalSize 36,21 java.awt.Dimension Slider.minimumVerticalSize 21,36 java.awt.Dimension Slider.onlyLeftMouseButtonDrag true @@ -802,11 +871,12 @@ Spinner.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] Spinner.buttonBackground #fafafa javax.swing.plaf.ColorUIResource [UI] Spinner.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] Spinner.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] +Spinner.buttonStyle button Spinner.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Spinner.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Spinner.font [active] $defaultFont [UI] Spinner.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI @@ -840,6 +910,17 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- TabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeArc 4 +TabbedPane.closeCrossFilledSize 7.5 +TabbedPane.closeCrossLineWidth 1.0 +TabbedPane.closeCrossPlainSize 7.5 +TabbedPane.closeForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverBackground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon [UI] +TabbedPane.closePressedBackground #b3b3b3 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closePressedForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeSize 16,16 javax.swing.plaf.DimensionUIResource [UI] TabbedPane.contentAreaColor #bfbfbf javax.swing.plaf.ColorUIResource [UI] TabbedPane.contentOpaque true TabbedPane.contentSeparatorHeight 1 @@ -848,9 +929,10 @@ TabbedPane.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] TabbedPane.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] TabbedPane.focus #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.focusColor #dae4ed javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false +TabbedPane.hiddenTabsNavigation moreTabsButton TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] TabbedPane.hoverColor #d9d9d9 javax.swing.plaf.ColorUIResource [UI] TabbedPane.labelShift 1 @@ -859,13 +941,16 @@ TabbedPane.selectedLabelShift -1 TabbedPane.selectedTabPadInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.selectionFollowsFocus true TabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.showTabSeparators false +TabbedPane.tabAreaAlignment leading TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabHeight 32 -TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabRunOverlay 0 TabbedPane.tabSelectionHeight 3 +TabbedPane.tabSeparatorsFullHeight false TabbedPane.tabsOpaque true -TabbedPane.tabsOverlapBorder true +TabbedPane.tabsOverlapBorder false TabbedPane.textIconGap 4 TabbedPane.underlineColor #4083c9 javax.swing.plaf.ColorUIResource [UI] TabbedPaneUI com.formdev.flatlaf.ui.FlatTabbedPaneUI @@ -877,7 +962,8 @@ Table.ascendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatAsce Table.background #ffffff javax.swing.plaf.ColorUIResource [UI] Table.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] Table.cellMargins 2,3,2,3 javax.swing.plaf.InsetsUIResource [UI] -Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] +Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.consistentHomeEndKeyBehavior true Table.descendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatDescendingSortIcon [UI] Table.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] Table.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -885,9 +971,9 @@ Table.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResourc Table.dropLineShortColor [lazy] #15416a javax.swing.plaf.ColorUIResource [UI] Table.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] Table.focusCellForeground #000000 javax.swing.plaf.ColorUIResource [UI] -Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] -Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.font [active] $defaultFont [UI] Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Table.gridColor #f7f7f7 javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] @@ -908,7 +994,7 @@ TableHeader.background #ffffff javax.swing.plaf.ColorUIResource [UI] TableHeader.bottomSeparatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] TableHeader.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -TableHeader.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TableHeader.font [active] $defaultFont [UI] TableHeader.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 TableHeader.separatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] @@ -946,7 +1032,7 @@ TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextArea.caretBlinkRate 500 TextArea.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextArea.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextArea.font [active] $defaultFont [UI] TextArea.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextArea.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -970,7 +1056,7 @@ TextField.caretBlinkRate 500 TextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] TextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextField.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextField.font [active] $defaultFont [UI] TextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextField.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] TextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] @@ -991,7 +1077,7 @@ TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F TextPane.caretBlinkRate 500 TextPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextPane.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TextPane.font [active] $defaultFont [UI] TextPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] TextPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] @@ -1001,10 +1087,36 @@ TextPane.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI +#---- TitlePane ---- + +TitlePane.background #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.buttonHoverBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) +TitlePane.buttonMaximizedHeight 22 +TitlePane.buttonPressedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) +TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] +TitlePane.closePressedBackground #99e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.embeddedForeground #595959 javax.swing.plaf.ColorUIResource [UI] +TitlePane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TitlePane.iconMargins 3,8,3,0 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI] +TitlePane.inactiveBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI] +TitlePane.menuBarEmbedded true +TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI] +TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] + + #---- TitledBorder ---- -TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#d1d1d1 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +TitledBorder.font [active] $defaultFont [UI] TitledBorder.titleColor #000000 javax.swing.plaf.ColorUIResource [UI] @@ -1018,17 +1130,18 @@ TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI ToggleButton.background #ffffff javax.swing.plaf.ColorUIResource [UI] ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ToggleButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledSelectedBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledSelectedBackground #dedede com.formdev.flatlaf.util.DerivedColor [UI] darken(13% autoInverse) ToggleButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] ToggleButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 ToggleButton.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] ToggleButton.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] -ToggleButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +ToggleButton.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) ToggleButton.rollover true -ToggleButton.selectedBackground #cfcfcf javax.swing.plaf.ColorUIResource [UI] +ToggleButton.selectedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) ToggleButton.selectedForeground #000000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] @@ -1038,9 +1151,9 @@ ToggleButton.tab.underlineColor #4083c9 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.underlineHeight 2 ToggleButton.textIconGap 4 ToggleButton.textShiftOffset 0 -ToggleButton.toolbar.hoverBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.pressedBackground #d8d8d8 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.selectedBackground #cfcfcf javax.swing.plaf.ColorUIResource [UI] +ToggleButton.toolbar.hoverBackground #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(12% autoInverse) +ToggleButton.toolbar.pressedBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(15% autoInverse) +ToggleButton.toolbar.selectedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse) ToggleButtonUI com.formdev.flatlaf.ui.FlatToggleButtonUI @@ -1054,7 +1167,7 @@ ToolBar.dockingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.dockingForeground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToolBar.floatingForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToolBar.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolBar.font [active] $defaultFont [UI] ToolBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #afafaf javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -1079,11 +1192,9 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI #---- ToolTip ---- ToolTip.background #fafafa javax.swing.plaf.ColorUIResource [UI] -ToolTip.backgroundInactive #fafafa javax.swing.plaf.ColorUIResource [UI] -ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -ToolTip.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#919191 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +ToolTip.font [active] $defaultFont [UI] ToolTip.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -ToolTip.foregroundInactive #8c8c8c javax.swing.plaf.ColorUIResource [UI] #---- ToolTipManager ---- @@ -1107,9 +1218,9 @@ Tree.drawsFocusBorderAroundIcon false Tree.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] Tree.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] Tree.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] -Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +Tree.editorBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#000000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Tree.font [active] $defaultFont [UI] Tree.foreground #000000 javax.swing.plaf.ColorUIResource [UI] Tree.hash #e6e6e6 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #afafaf javax.swing.plaf.ColorUIResource [UI] @@ -1124,6 +1235,7 @@ Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.paintLines false Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true @@ -1132,6 +1244,7 @@ Tree.selectionBorderColor #000000 javax.swing.plaf.ColorUIResource [UI] Tree.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Tree.selectionInactiveBackground #d4d4d4 javax.swing.plaf.ColorUIResource [UI] Tree.selectionInactiveForeground #000000 javax.swing.plaf.ColorUIResource [UI] +Tree.showCellFocusIndicator false Tree.textBackground #ffffff javax.swing.plaf.ColorUIResource [UI] Tree.textForeground #000000 javax.swing.plaf.ColorUIResource [UI] Tree.timeFactor 1000 @@ -1142,7 +1255,7 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- Viewport.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Viewport.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] +Viewport.font [active] $defaultFont [UI] Viewport.foreground #000000 javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1158,6 +1271,7 @@ controlHighlight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] controlShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] controlText #000000 javax.swing.plaf.ColorUIResource [UI] +defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] desktop #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -1174,9 +1288,19 @@ inactiveCaptionBorder #bfcddb javax.swing.plaf.ColorUIResource [UI] inactiveCaptionText #000000 javax.swing.plaf.ColorUIResource [UI] info #fafafa javax.swing.plaf.ColorUIResource [UI] infoText #000000 javax.swing.plaf.ColorUIResource [UI] + + +#---- laf ---- + +laf.dark false +laf.scaleFactor [active] 1.0 + + +#---- ---- + menu #f2f2f2 javax.swing.plaf.ColorUIResource [UI] menuText #000000 javax.swing.plaf.ColorUIResource [UI] -scrollbar #f5f5f5 javax.swing.plaf.ColorUIResource [UI] +scrollbar #f5f5f5 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%) #---- swingx/TaskPane ---- diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt similarity index 90% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt rename to flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt index f680e51e..443c66c6 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202-mac.txt @@ -1,6 +1,6 @@ Class com.formdev.flatlaf.FlatLightLaf -ID FlatLaf - Flat Light -Name Flat Light +ID FlatLaf - FlatLaf Light +Name FlatLaf Light Java 1.8.0_202 OS Mac OS X @@ -166,7 +166,7 @@ FileChooser.ancestorInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [ #---- FormattedTextField ---- -FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResource [UI] +FormattedTextField.focusInputMap [lazy] 70 javax.swing.plaf.InputMapUIResource [UI] alt BACK_SPACE delete-previous-word alt DELETE delete-next-word alt KP_LEFT caret-previous-word @@ -210,8 +210,6 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc KP_RIGHT caret-forward KP_UP increment LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP increment @@ -226,8 +224,6 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -239,32 +235,22 @@ FormattedTextField.focusInputMap [lazy] 76 javax.swing.plaf.InputMapUIResourc shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line #---- List ---- -List.focusInputMap.RightToLeft [lazy] 16 javax.swing.plaf.InputMapUIResource [UI] - ctrl KP_LEFT selectNextColumnChangeLead - ctrl KP_RIGHT selectPreviousColumnChangeLead - ctrl LEFT selectNextColumnChangeLead - ctrl RIGHT selectPreviousColumnChangeLead +List.focusInputMap.RightToLeft [lazy] 8 javax.swing.plaf.InputMapUIResource [UI] KP_LEFT selectNextColumn KP_RIGHT selectPreviousColumn LEFT selectNextColumn RIGHT selectPreviousColumn - shift ctrl KP_LEFT selectNextColumnExtendSelection - shift ctrl KP_RIGHT selectPreviousColumnExtendSelection - shift ctrl LEFT selectNextColumnExtendSelection - shift ctrl RIGHT selectPreviousColumnExtendSelection shift KP_LEFT selectNextColumnExtendSelection shift KP_RIGHT selectPreviousColumnExtendSelection shift LEFT selectNextColumnExtendSelection shift RIGHT selectPreviousColumnExtendSelection -List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource [UI] +List.focusInputMap [lazy] 27 javax.swing.plaf.InputMapUIResource [UI] meta A selectAll meta C copy meta V paste @@ -272,8 +258,6 @@ List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource COPY copy CUT cut DOWN selectNextRow - END selectLastRow - HOME selectFirstRow KP_DOWN selectNextRow KP_LEFT selectPreviousColumn KP_RIGHT selectNextColumn @@ -298,7 +282,7 @@ List.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource #---- PasswordField ---- -PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource [UI] +PasswordField.focusInputMap [lazy] 67 javax.swing.plaf.InputMapUIResource [UI] alt KP_LEFT caret-begin-line alt KP_RIGHT caret-end-line alt LEFT caret-begin-line @@ -339,8 +323,6 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource KP_RIGHT caret-forward KP_UP caret-begin-line LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP caret-begin-line @@ -355,8 +337,6 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -368,23 +348,45 @@ PasswordField.focusInputMap [lazy] 73 javax.swing.plaf.InputMapUIResource shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line #---- PopupMenu ---- -PopupMenu.selectedWindowInputMapBindings.RightToLeft length=8 [Ljava.lang.Object; - [0] LEFT - [1] selectChild - [2] KP_LEFT - [3] selectChild - [4] RIGHT - [5] selectParent - [6] KP_RIGHT - [7] selectParent +PopupMenu.selectedWindowInputMapBindings.RightToLeft length=32 [Ljava.lang.Object; + [0] ESCAPE + [1] cancel + [2] DOWN + [3] selectNext + [4] KP_DOWN + [5] selectNext + [6] UP + [7] selectPrevious + [8] KP_UP + [9] selectPrevious + [10] LEFT + [11] selectParent + [12] KP_LEFT + [13] selectParent + [14] RIGHT + [15] selectChild + [16] KP_RIGHT + [17] selectChild + [18] ENTER + [19] return + [20] ctrl ENTER + [21] return + [22] SPACE + [23] return + [24] LEFT + [25] selectChild + [26] KP_LEFT + [27] selectChild + [28] RIGHT + [29] selectParent + [30] KP_RIGHT + [31] selectParent PopupMenu.selectedWindowInputMapBindings length=24 [Ljava.lang.Object; [0] ESCAPE [1] cancel @@ -446,24 +448,6 @@ ScrollBar.ancestorInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource PAGE_UP negativeBlockIncrement RIGHT positiveUnitIncrement UP negativeUnitIncrement -ScrollBar.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] - KP_LEFT positiveUnitIncrement - KP_RIGHT negativeUnitIncrement - LEFT positiveUnitIncrement - RIGHT negativeUnitIncrement -ScrollBar.focusInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] - DOWN positiveUnitIncrement - END maxScroll - HOME minScroll - KP_DOWN positiveUnitIncrement - KP_LEFT negativeUnitIncrement - KP_RIGHT positiveUnitIncrement - KP_UP negativeUnitIncrement - LEFT negativeUnitIncrement - PAGE_DOWN positiveBlockIncrement - PAGE_UP negativeBlockIncrement - RIGHT positiveUnitIncrement - UP negativeUnitIncrement #---- ScrollPane ---- @@ -536,16 +520,12 @@ SplitPane.ancestorInputMap [lazy] 14 javax.swing.plaf.InputMapUIResource #---- TabbedPane ---- -TabbedPane.ancestorInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI] - ctrl KP_UP requestFocus +TabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] ctrl PAGE_DOWN navigatePageDown ctrl PAGE_UP navigatePageUp ctrl TAB navigateNext - ctrl UP requestFocus shift ctrl TAB navigatePrevious -TabbedPane.focusInputMap [lazy] 10 javax.swing.plaf.InputMapUIResource [UI] - ctrl DOWN requestFocusForVisibleComponent - ctrl KP_DOWN requestFocusForVisibleComponent +TabbedPane.focusInputMap [lazy] 8 javax.swing.plaf.InputMapUIResource [UI] DOWN navigateDown KP_DOWN navigateDown KP_LEFT navigateLeft @@ -571,7 +551,7 @@ Table.ancestorInputMap.RightToLeft [lazy] 12 javax.swing.plaf.InputMapUIResou shift KP_RIGHT selectPreviousColumnExtendSelection shift LEFT selectNextColumnExtendSelection shift RIGHT selectPreviousColumnExtendSelection -Table.ancestorInputMap [lazy] 38 javax.swing.plaf.InputMapUIResource [UI] +Table.ancestorInputMap [lazy] 34 javax.swing.plaf.InputMapUIResource [UI] alt TAB focusHeader meta A selectAll meta C copy @@ -580,26 +560,22 @@ Table.ancestorInputMap [lazy] 38 javax.swing.plaf.InputMapUIResource COPY copy CUT cut DOWN selectNextRow - END selectLastColumn ENTER selectNextRowCell ESCAPE cancel - HOME selectFirstColumn KP_DOWN selectNextRow KP_LEFT selectPreviousColumn KP_RIGHT selectNextColumn KP_UP selectPreviousRow LEFT selectPreviousColumn - PAGE_DOWN scrollDownChangeSelection - PAGE_UP scrollUpChangeSelection PASTE paste RIGHT selectNextColumn TAB selectNextColumnCell UP selectPreviousRow shift alt TAB focusHeader shift DOWN selectNextRowExtendSelection - shift END selectLastColumnExtendSelection + shift END selectLastRowExtendSelection shift ENTER selectPreviousRowCell - shift HOME selectFirstColumnExtendSelection + shift HOME selectFirstRowExtendSelection shift KP_DOWN selectNextRowExtendSelection shift KP_LEFT selectPreviousColumnExtendSelection shift KP_RIGHT selectNextColumnExtendSelection @@ -721,7 +697,7 @@ TextArea.focusInputMap [lazy] 83 javax.swing.plaf.InputMapUIResource #---- TextField ---- -TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource [UI] +TextField.focusInputMap [lazy] 69 javax.swing.plaf.InputMapUIResource [UI] alt BACK_SPACE delete-previous-word alt DELETE delete-next-word alt KP_LEFT caret-previous-word @@ -764,8 +740,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource KP_RIGHT caret-forward KP_UP caret-begin-line LEFT caret-backward - PAGE_DOWN page-down - PAGE_UP page-up PASTE paste-from-clipboard RIGHT caret-forward UP caret-begin-line @@ -780,8 +754,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource shift meta KP_RIGHT selection-end-line shift meta KP_UP selection-begin shift meta LEFT selection-begin-line - shift meta PAGE_DOWN selection-page-right - shift meta PAGE_UP selection-page-left shift meta RIGHT selection-end-line shift meta UP selection-begin shift BACK_SPACE delete-previous @@ -793,8 +765,6 @@ TextField.focusInputMap [lazy] 75 javax.swing.plaf.InputMapUIResource shift KP_RIGHT selection-forward shift KP_UP selection-begin-line shift LEFT selection-backward - shift PAGE_DOWN selection-page-down - shift PAGE_UP selection-page-up shift RIGHT selection-forward shift UP selection-begin-line @@ -911,12 +881,24 @@ ToolBar.ancestorInputMap [lazy] 8 javax.swing.plaf.InputMapUIResource [ Tree.ancestorInputMap [lazy] 1 javax.swing.plaf.InputMapUIResource [UI] ESCAPE cancel -Tree.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] +Tree.focusInputMap.RightToLeft [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] + alt KP_LEFT selectChild + alt KP_RIGHT selectParent + alt LEFT selectChild + alt RIGHT selectParent KP_LEFT selectChild KP_RIGHT selectParent LEFT selectChild RIGHT selectParent -Tree.focusInputMap [lazy] 19 javax.swing.plaf.InputMapUIResource [UI] + shift KP_LEFT selectChild + shift KP_RIGHT selectParent + shift LEFT selectChild + shift RIGHT selectParent +Tree.focusInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource [UI] + alt KP_LEFT selectParent + alt KP_RIGHT selectChild + alt LEFT selectParent + alt RIGHT selectChild meta A selectAll meta C copy meta V paste @@ -933,6 +915,12 @@ Tree.focusInputMap [lazy] 19 javax.swing.plaf.InputMapUIResource RIGHT selectChild UP selectPrevious shift DOWN selectNextExtendSelection + shift END selectLastExtendSelection + shift HOME selectFirstExtendSelection shift KP_DOWN selectNextExtendSelection + shift KP_LEFT selectParent + shift KP_RIGHT selectChild shift KP_UP selectPreviousExtendSelection + shift LEFT selectParent + shift RIGHT selectChild shift UP selectPreviousExtendSelection diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt similarity index 99% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt index 54a4e89a..02d5e355 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_InputMap_1.8.0_202.txt @@ -1,6 +1,6 @@ Class com.formdev.flatlaf.FlatLightLaf -ID FlatLaf - Flat Light -Name Flat Light +ID FlatLaf - FlatLaf Light +Name FlatLaf Light Java 1.8.0_202 OS Windows 10 @@ -583,8 +583,8 @@ Table.ancestorInputMap [lazy] 71 javax.swing.plaf.InputMapUIResource TAB selectNextColumnCell UP selectPreviousRow shift ctrl DOWN selectNextRowExtendSelection - shift ctrl END selectLastRowExtendSelection - shift ctrl HOME selectFirstRowExtendSelection + shift ctrl END selectLastColumnExtendSelection + shift ctrl HOME selectFirstColumnExtendSelection shift ctrl KP_DOWN selectNextRowExtendSelection shift ctrl KP_LEFT selectPreviousColumnExtendSelection shift ctrl KP_RIGHT selectNextColumnExtendSelection @@ -597,9 +597,9 @@ Table.ancestorInputMap [lazy] 71 javax.swing.plaf.InputMapUIResource shift ctrl UP selectPreviousRowExtendSelection shift DELETE cut shift DOWN selectNextRowExtendSelection - shift END selectLastColumnExtendSelection + shift END selectLastRowExtendSelection shift ENTER selectPreviousRowCell - shift HOME selectFirstColumnExtendSelection + shift HOME selectFirstRowExtendSelection shift INSERT paste shift KP_DOWN selectNextRowExtendSelection shift KP_LEFT selectPreviousColumnExtendSelection diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt similarity index 52% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt rename to flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt index 15d57e48..1c29e8dd 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202-mac.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0_202.txt @@ -1,8 +1,8 @@ -Class com.formdev.flatlaf.FlatLightLaf -ID FlatLaf - Flat Light -Name Flat Light +Class com.formdev.flatlaf.testing.FlatTestLaf +ID FlatLaf - Flat Test +Name Flat Test Java 1.8.0_202 -OS Mac OS X +OS Windows 10 #---- ---- @@ -62,42 +62,49 @@ BusyLabelUI com.formdev.flatlaf.swingx.ui.FlatBusyLabelUI #---- Button ---- Button.arc 6 -Button.background #ffffff javax.swing.plaf.ColorUIResource [UI] +Button.background #ccffcc javax.swing.plaf.ColorUIResource [UI] Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] -Button.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Button.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -Button.default.background #ffffff javax.swing.plaf.ColorUIResource [UI] -Button.default.borderColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] -Button.default.borderWidth 2 -Button.default.focusColor #97c3f3 javax.swing.plaf.ColorUIResource [UI] -Button.default.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] -Button.default.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.default.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Button.default.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.default.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.default.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.defaultButtonFollowsFocus false -Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] -Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] -Button.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] -Button.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Button.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Button.borderWidth 1 +Button.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +Button.default.borderWidth 1 +Button.default.endBackground #888888 javax.swing.plaf.ColorUIResource [UI] +Button.default.endBorderColor #0000ff javax.swing.plaf.ColorUIResource [UI] +Button.default.focusColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Button.default.focusedBackground #00ffff javax.swing.plaf.ColorUIResource [UI] +Button.default.focusedBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] +Button.default.foreground #880000 javax.swing.plaf.ColorUIResource [UI] +Button.default.hoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +Button.default.hoverBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Button.default.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] +Button.default.startBackground #dddddd javax.swing.plaf.ColorUIResource [UI] +Button.default.startBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Button.defaultButtonFollowsFocus true +Button.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +Button.disabledBorderColor #000088 javax.swing.plaf.ColorUIResource [UI] +Button.disabledText #000088 javax.swing.plaf.ColorUIResource [UI] +Button.endBackground #bbbbbb javax.swing.plaf.ColorUIResource [UI] +Button.endBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Button.focusedBackground #00ffff javax.swing.plaf.ColorUIResource [UI] +Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] +Button.font [active] $defaultFont [UI] +Button.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] Button.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] +Button.hoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +Button.hoverBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] Button.iconTextGap 4 Button.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] Button.minimumWidth 72 -Button.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Button.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] Button.rollover true -Button.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +Button.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +Button.startBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +Button.startBorderColor #0000ff javax.swing.plaf.ColorUIResource [UI] Button.textIconGap 4 Button.textShiftOffset 0 -Button.toolbar.hoverBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.hoverBackground #ffffff javax.swing.plaf.ColorUIResource [UI] Button.toolbar.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -Button.toolbar.pressedBackground #d8d8d8 javax.swing.plaf.ColorUIResource [UI] +Button.toolbar.pressedBackground #eeeeee javax.swing.plaf.ColorUIResource [UI] Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] ButtonUI com.formdev.flatlaf.ui.FlatButtonUI @@ -110,24 +117,25 @@ Caret.width [active] 1 #---- CheckBox ---- CheckBox.arc 4 -CheckBox.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +CheckBox.background #ccffcc javax.swing.plaf.ColorUIResource [UI] CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -CheckBox.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +CheckBox.disabledText #000088 javax.swing.plaf.ColorUIResource [UI] +CheckBox.font [active] $defaultFont [UI] +CheckBox.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.background #ffffff javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.borderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.checkmarkColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.borderColor #878787 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.checkmarkColor #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.disabledBorderColor #bdbdbd javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.disabledCheckmarkColor #ababab javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.focusedBackground #00ffff javax.swing.plaf.ColorUIResource [UI] CheckBox.icon.focusedBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -CheckBox.icon.hoverBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -CheckBox.icon.selectedBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.selectedBorderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.hoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.hoverBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.selectedBackground #4d89c9 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.selectedBorderColor #4982cc javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon.selectedFocusedBorderColor #accff7 javax.swing.plaf.ColorUIResource [UI] CheckBox.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxIcon [UI] CheckBox.iconTextGap 4 CheckBox.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] @@ -138,21 +146,21 @@ CheckBox.textShiftOffset 0 #---- CheckBoxMenuItem ---- -CheckBoxMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.acceleratorFont [active] $defaultFont [UI] +CheckBoxMenuItem.acceleratorForeground #ff8888 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] CheckBoxMenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] CheckBoxMenuItem.borderPainted true CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] -CheckBoxMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +CheckBoxMenuItem.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.font [active] $defaultFont [UI] +CheckBoxMenuItem.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] CheckBoxMenuItem.opaque false -CheckBoxMenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] CheckBoxMenuItemUI com.formdev.flatlaf.ui.FlatCheckBoxMenuItemUI @@ -163,10 +171,10 @@ CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI #---- ColorChooser ---- -ColorChooser.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ColorChooser.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.swatchesDefaultRecentColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +ColorChooser.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +ColorChooser.font [active] $defaultFont [UI] +ColorChooser.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +ColorChooser.swatchesDefaultRecentColor #ccffcc javax.swing.plaf.ColorUIResource [UI] ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] ColorChooser.swatchesSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] ColorChooserUI com.formdev.flatlaf.ui.FlatColorChooserUI @@ -177,22 +185,26 @@ ColorChooserUI com.formdev.flatlaf.ui.FlatColorChooserUI ComboBox.background #ffffff javax.swing.plaf.ColorUIResource [UI] ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] ComboBox.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonDarkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonDarkShadow #696969 javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonEditableBackground #fafafa javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonEditableBackground #cccccc javax.swing.plaf.ColorUIResource [UI] ComboBox.buttonHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -ComboBox.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ComboBox.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ComboBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonHoverArrowColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonShadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonStyle auto +ComboBox.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +ComboBox.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +ComboBox.editorColumns 0 +ComboBox.font [active] $defaultFont [UI] +ComboBox.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] ComboBox.isEnterSelectablePopup false +ComboBox.maximumRowCount 15 +ComboBox.minimumWidth 72 ComboBox.noActionOnKeyNavigation false ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -ComboBox.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -ComboBox.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +ComboBox.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +ComboBox.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] ComboBox.timeFactor 1000 ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI @@ -201,14 +213,15 @@ ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI Component.arc 5 Component.arrowType chevron -Component.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Component.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] +Component.borderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Component.disabledBorderColor #000088 javax.swing.plaf.ColorUIResource [UI] Component.focusColor #97c3f3 javax.swing.plaf.ColorUIResource [UI] Component.focusWidth 0 -Component.focusedBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] +Component.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] +Component.grayFilter [lazy] [unknown type] com.formdev.flatlaf.util.GrayFilter Component.hideMnemonics true Component.innerFocusWidth 0.5 -Component.linkColor #2470b3 javax.swing.plaf.ColorUIResource [UI] +Component.innerOutlineWidth 1.0 Component.minimumWidth 64 @@ -219,17 +232,17 @@ DatePickerUI com.formdev.flatlaf.swingx.ui.FlatDatePickerUI #---- Desktop ---- -Desktop.background #e6ebf0 javax.swing.plaf.ColorUIResource [UI] +Desktop.background #aaffee javax.swing.plaf.ColorUIResource [UI] Desktop.minOnScreenInsets 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] #---- DesktopIcon ---- -DesktopIcon.background #c6d2dd javax.swing.plaf.ColorUIResource [UI] +DesktopIcon.background #44ffda javax.swing.plaf.ColorUIResource [UI] DesktopIcon.border [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] DesktopIcon.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] DesktopIcon.closeSize 20,20 javax.swing.plaf.DimensionUIResource [UI] -DesktopIcon.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +DesktopIcon.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] DesktopIcon.iconSize 64,64 javax.swing.plaf.DimensionUIResource [UI] DesktopIconUI com.formdev.flatlaf.ui.FlatDesktopIconUI @@ -244,15 +257,15 @@ DesktopPaneUI com.formdev.flatlaf.ui.FlatDesktopPaneUI EditorPane.background #ffffff javax.swing.plaf.ColorUIResource [UI] EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] EditorPane.caretBlinkRate 500 -EditorPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -EditorPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -EditorPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -EditorPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -EditorPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +EditorPane.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +EditorPane.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +EditorPane.font [active] $defaultFont [UI] +EditorPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +EditorPane.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +EditorPane.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] EditorPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -EditorPane.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -EditorPane.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +EditorPane.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +EditorPane.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] EditorPaneUI com.formdev.flatlaf.ui.FlatEditorPaneUI @@ -264,7 +277,7 @@ FileChooser.listViewIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil FileChooser.newFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserNewFolderIcon [UI] FileChooser.readOnly false FileChooser.upFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserUpFolderIcon [UI] -FileChooser.useSystemExtensionHiding false +FileChooser.useSystemExtensionHiding true FileChooser.usesSingleFilePane true FileChooserUI com.formdev.flatlaf.ui.FlatFileChooserUI @@ -283,16 +296,16 @@ FileView.hardDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil FormattedTextField.background #ffffff javax.swing.plaf.ColorUIResource [UI] FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] FormattedTextField.caretBlinkRate 500 -FormattedTextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -FormattedTextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.font [active] $defaultFont [UI] +FormattedTextField.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] FormattedTextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -FormattedTextField.placeholderForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.placeholderForeground #000088 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] FormattedTextFieldUI com.formdev.flatlaf.ui.FlatFormattedTextFieldUI @@ -304,56 +317,59 @@ HeaderUI com.formdev.flatlaf.swingx.ui.FlatHeaderUI #---- HelpButton ---- HelpButton.background #ffffff javax.swing.plaf.ColorUIResource [UI] -HelpButton.borderColor #b0b0b0 javax.swing.plaf.ColorUIResource [UI] +HelpButton.borderColor #878787 javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledBorderColor #bdbdbd javax.swing.plaf.ColorUIResource [UI] HelpButton.disabledQuestionMarkColor #ababab javax.swing.plaf.ColorUIResource [UI] -HelpButton.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] +HelpButton.focusedBackground #00ffff javax.swing.plaf.ColorUIResource [UI] HelpButton.focusedBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] -HelpButton.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -HelpButton.hoverBorderColor #7b9fc7 javax.swing.plaf.ColorUIResource [UI] +HelpButton.hoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +HelpButton.hoverBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] -HelpButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -HelpButton.questionMarkColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] +HelpButton.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] +HelpButton.questionMarkColor #0000ff javax.swing.plaf.ColorUIResource [UI] #---- Hyperlink ---- -Hyperlink.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Hyperlink.linkColor #2470b3 javax.swing.plaf.ColorUIResource [UI] -Hyperlink.visitedColor #2470b3 javax.swing.plaf.ColorUIResource [UI] +Hyperlink.disabledText #000088 javax.swing.plaf.ColorUIResource [UI] +Hyperlink.linkColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Hyperlink.visitedColor #0000ff javax.swing.plaf.ColorUIResource [UI] HyperlinkUI com.formdev.flatlaf.swingx.ui.FlatHyperlinkUI #---- InternalFrame ---- -InternalFrame.activeBorderColor #919191 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.activeTitleBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -InternalFrame.activeTitleForeground #000000 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeDropShadowInsets 5,5,6,6 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.activeTitleBackground #880000 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.activeTitleForeground #ffaaaa javax.swing.plaf.ColorUIResource [UI] InternalFrame.border [lazy] 6,6,6,6 false com.formdev.flatlaf.ui.FlatInternalFrameUI$FlatInternalFrameBorder [UI] -InternalFrame.borderColor #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.borderDarkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderColor #ccffcc javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderDarkShadow #696969 javax.swing.plaf.ColorUIResource [UI] InternalFrame.borderHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] InternalFrame.borderLight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] InternalFrame.borderLineWidth 1 InternalFrame.borderMargins 6,6,6,6 javax.swing.plaf.InsetsUIResource [UI] -InternalFrame.borderShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.buttonHoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -InternalFrame.buttonPressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +InternalFrame.borderShadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.buttonHoverBackground #006600 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.buttonPressedBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] InternalFrame.buttonSize 24,24 javax.swing.plaf.DimensionUIResource [UI] -InternalFrame.closeHoverBackground [lazy] #db5860 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.closeHoverBackground #000088 javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] InternalFrame.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] -InternalFrame.closePressedBackground [lazy] #d22e38 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.closePressedBackground #0000ff javax.swing.plaf.ColorUIResource [UI] InternalFrame.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +InternalFrame.dropShadowPainted true InternalFrame.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) InternalFrame.iconifyIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameIconifyIcon [UI] -InternalFrame.inactiveBorderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.inactiveTitleBackground #fafafa javax.swing.plaf.ColorUIResource [UI] -InternalFrame.inactiveTitleForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveBorderColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveDropShadowInsets 3,3,4,4 javax.swing.plaf.InsetsUIResource [UI] +InternalFrame.inactiveTitleBackground #008800 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.inactiveTitleForeground #aaffaa javax.swing.plaf.ColorUIResource [UI] InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] -InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] +InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameRestoreIcon [UI] +InternalFrame.titleFont [active] $defaultFont [UI] #---- InternalFrameTitlePane ---- @@ -371,8 +387,8 @@ InternalFrameUI com.formdev.flatlaf.ui.FlatInternalFrameUI #---- JXBusyLabel ---- -JXBusyLabel.baseColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -JXBusyLabel.highlightColor #808080 javax.swing.plaf.ColorUIResource [UI] +JXBusyLabel.baseColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +JXBusyLabel.highlightColor #ff0000 javax.swing.plaf.ColorUIResource [UI] #---- JXDatePicker ---- @@ -382,87 +398,90 @@ JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swin #---- JXHeader ---- -JXHeader.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -JXHeader.startBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +JXHeader.background #ff8888 javax.swing.plaf.ColorUIResource [UI] +JXHeader.descriptionForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] +JXHeader.startBackground #ffcccc javax.swing.plaf.ColorUIResource [UI] +JXHeader.titleForeground #0000ff javax.swing.plaf.ColorUIResource [UI] #---- JXMonthView ---- -JXMonthView.arrowColor #000000 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.arrowColor #0000ff javax.swing.plaf.ColorUIResource [UI] JXMonthView.background #ffffff javax.swing.plaf.ColorUIResource [UI] -JXMonthView.daysOfTheWeekForeground #444444 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.disabledArrowColor #8c8c8c javax.swing.plaf.ColorUIResource [UI] -JXMonthView.flaggedDayForeground #e02222 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.leadingDayForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +JXMonthView.daysOfTheWeekForeground #00ff00 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.disabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] +JXMonthView.flaggedDayForeground #00ffff javax.swing.plaf.ColorUIResource [UI] +JXMonthView.leadingDayForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] JXMonthView.monthDownFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthDownIcon [UI] -JXMonthView.monthStringBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] -JXMonthView.monthStringForeground #000000 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.monthStringBackground #00ff00 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.monthStringForeground #0000ff javax.swing.plaf.ColorUIResource [UI] JXMonthView.monthUpFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthUpIcon [UI] -JXMonthView.selectedBackground #b9cef8 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.trailingDayForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -JXMonthView.unselectableDayForeground #e02222 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.weekOfTheYearForeground #666666 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.selectedBackground #aaffaa javax.swing.plaf.ColorUIResource [UI] +JXMonthView.trailingDayForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] +JXMonthView.unselectableDayForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +JXMonthView.weekOfTheYearForeground #0000ff javax.swing.plaf.ColorUIResource [UI] #---- JXTitledPanel ---- -JXTitledPanel.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +JXTitledPanel.borderColor #0000ff javax.swing.plaf.ColorUIResource [UI] JXTitledPanel.captionInsets 4,10,4,10 javax.swing.plaf.InsetsUIResource [UI] -JXTitledPanel.titleBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] -JXTitledPanel.titleForeground #222222 javax.swing.plaf.ColorUIResource [UI] +JXTitledPanel.titleBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] +JXTitledPanel.titleForeground #ff00ff javax.swing.plaf.ColorUIResource [UI] #---- JideTabbedPane ---- -JideTabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +JideTabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.contentBorderInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.tabAreaBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +JideTabbedPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +JideTabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI] +JideTabbedPane.tabAreaBackground #ccffcc javax.swing.plaf.ColorUIResource [UI] JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] JideTabbedPane.tabRunOverlay 0 JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI #---- Label ---- -Label.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Label.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Label.disabledShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Label.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Label.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Label.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +Label.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +Label.disabledShadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +Label.font [active] $defaultFont [UI] +Label.foreground #008800 javax.swing.plaf.ColorUIResource [UI] LabelUI com.formdev.flatlaf.ui.FlatLabelUI #---- List ---- -List.background #ffffff javax.swing.plaf.ColorUIResource [UI] +List.background #f0ffff javax.swing.plaf.ColorUIResource [UI] List.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -List.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] +List.cellFocusColor #ff0000 javax.swing.plaf.ColorUIResource [UI] List.cellMargins 1,6,1,6 javax.swing.plaf.InsetsUIResource [UI] -List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] +List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] List.cellRenderer [active] javax.swing.DefaultListCellRenderer$UIResource [UI] -List.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] -List.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] -List.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] -List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] -List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -List.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +List.dropCellBackground #ff0000 javax.swing.plaf.ColorUIResource [UI] +List.dropCellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI] +List.dropLineColor #0000ff javax.swing.plaf.ColorUIResource [UI] +List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#880000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#880000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +List.font [active] $defaultFont [UI] +List.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] -List.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -List.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -List.selectionInactiveBackground #d4d4d4 javax.swing.plaf.ColorUIResource [UI] -List.selectionInactiveForeground #000000 javax.swing.plaf.ColorUIResource [UI] +List.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +List.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +List.selectionInactiveBackground #888888 javax.swing.plaf.ColorUIResource [UI] +List.selectionInactiveForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +List.showCellFocusIndicator false List.timeFactor 1000 ListUI com.formdev.flatlaf.ui.FlatListUI #---- Menu ---- -Menu.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Menu.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +Menu.acceleratorFont [active] $defaultFont [UI] +Menu.acceleratorForeground #ff8888 javax.swing.plaf.ColorUIResource [UI] Menu.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] Menu.background #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -470,20 +489,20 @@ Menu.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.F Menu.borderPainted true Menu.cancelMode hideLastSubmenu Menu.crossMenuMnemonic true -Menu.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -Menu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Menu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Menu.icon.arrowColor #666666 javax.swing.plaf.ColorUIResource [UI] +Menu.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +Menu.font [active] $defaultFont [UI] +Menu.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Menu.icon.arrowColor #4d89c9 javax.swing.plaf.ColorUIResource [UI] Menu.icon.disabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] -Menu.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +Menu.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] Menu.menuPopupOffsetX 0 Menu.menuPopupOffsetY 0 Menu.opaque false Menu.preserveTopLevelSelection false -Menu.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -Menu.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Menu.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +Menu.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] Menu.shortcutKeys length=1 [I - [0] 10 + [0] 8 Menu.submenuPopupOffsetX [active] -4 Menu.submenuPopupOffsetY [active] -4 @@ -492,13 +511,13 @@ Menu.submenuPopupOffsetY [active] -4 MenuBar.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] -MenuBar.borderColor #cdcdcd javax.swing.plaf.ColorUIResource [UI] -MenuBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +MenuBar.borderColor #4444ff javax.swing.plaf.ColorUIResource [UI] +MenuBar.font [active] $defaultFont [UI] +MenuBar.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -MenuBar.hoverBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI] -MenuBar.itemMargins 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -MenuBar.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +MenuBar.hoverBackground #ffdddd javax.swing.plaf.ColorUIResource [UI] +MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] +MenuBar.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] MenuBar.windowBindings length=2 [Ljava.lang.Object; [0] F10 [1] takeFocus @@ -507,26 +526,38 @@ MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI #---- MenuItem ---- -MenuItem.acceleratorDelimiter -MenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +MenuItem.acceleratorArrowGap 2 +MenuItem.acceleratorDelimiter - +MenuItem.acceleratorFont [active] $defaultFont [UI] +MenuItem.acceleratorForeground #ff8888 javax.swing.plaf.ColorUIResource [UI] MenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] MenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] MenuItem.borderPainted true -MenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -MenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.checkBackground #ccccff javax.swing.plaf.ColorUIResource [UI] +MenuItem.checkMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +MenuItem.font [active] $defaultFont [UI] +MenuItem.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +MenuItem.iconTextGap 6 +MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +MenuItem.minimumWidth 72 MenuItem.opaque false -MenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -MenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +MenuItem.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +MenuItem.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +MenuItem.textAcceleratorGap 24 +MenuItem.textNoAcceleratorGap 6 +MenuItem.underlineSelectionBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionCheckBackground #ccccff javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionColor #ffff00 javax.swing.plaf.ColorUIResource [UI] +MenuItem.underlineSelectionHeight 3 #---- MenuItemCheckBox ---- -MenuItemCheckBox.icon.checkmarkColor #4f9ee3 javax.swing.plaf.ColorUIResource [UI] +MenuItemCheckBox.icon.checkmarkColor #4d89c9 javax.swing.plaf.ColorUIResource [UI] MenuItemCheckBox.icon.disabledCheckmarkColor #ababab javax.swing.plaf.ColorUIResource [UI] @@ -562,7 +593,7 @@ Objects.YellowDark #d9a343 javax.swing.plaf.ColorUIResource [UI] #---- OptionPane ---- -OptionPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +OptionPane.background #ffdddd javax.swing.plaf.ColorUIResource [UI] OptionPane.border [lazy] 12,12,12,12 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] OptionPane.buttonAreaBorder [lazy] 12,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] OptionPane.buttonClickThreshhold 500 @@ -570,11 +601,15 @@ OptionPane.buttonMinimumWidth [active] 72 OptionPane.buttonOrientation 4 OptionPane.buttonPadding 8 OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -OptionPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +OptionPane.font [active] $defaultFont [UI] +OptionPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +OptionPane.icon.errorColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +OptionPane.icon.foreground #ffffff javax.swing.plaf.ColorUIResource [UI] +OptionPane.icon.informationColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +OptionPane.icon.questionColor #0000ff javax.swing.plaf.ColorUIResource [UI] +OptionPane.icon.warningColor #ffcc00 javax.swing.plaf.ColorUIResource [UI] OptionPane.iconMessageGap 16 OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] -OptionPane.isYesLast true OptionPane.maxCharactersPerLine 80 OptionPane.messageAreaBorder [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] OptionPane.messagePadding 3 @@ -591,9 +626,9 @@ OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI #---- Panel ---- -Panel.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Panel.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Panel.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Panel.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +Panel.font [active] $defaultFont [UI] +Panel.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] PanelUI com.formdev.flatlaf.ui.FlatPanelUI @@ -602,38 +637,46 @@ PanelUI com.formdev.flatlaf.ui.FlatPanelUI PasswordField.background #ffffff javax.swing.plaf.ColorUIResource [UI] PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] PasswordField.capsLockIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatCapsLockIcon [UI] -PasswordField.capsLockIconColor #64000000 javax.swing.plaf.ColorUIResource [UI] PasswordField.caretBlinkRate 500 -PasswordField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -PasswordField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +PasswordField.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +PasswordField.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] PasswordField.echoChar '\u2022' -PasswordField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -PasswordField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -PasswordField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -PasswordField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +PasswordField.font [active] $defaultFont [UI] +PasswordField.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +PasswordField.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +PasswordField.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] PasswordField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -PasswordField.placeholderForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -PasswordField.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -PasswordField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +PasswordField.placeholderForeground #000088 javax.swing.plaf.ColorUIResource [UI] +PasswordField.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +PasswordField.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +PasswordField.showCapsLock true PasswordFieldUI com.formdev.flatlaf.ui.FlatPasswordFieldUI +#---- Popup ---- + +Popup.dropShadowColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +Popup.dropShadowInsets -6,6,6,6 javax.swing.plaf.InsetsUIResource [UI] +Popup.dropShadowOpacity 0.5 +Popup.dropShadowPainted true + + #---- PopupMenu ---- PopupMenu.background #ffffff javax.swing.plaf.ColorUIResource [UI] -PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] -PopupMenu.borderColor #adadad javax.swing.plaf.ColorUIResource [UI] +PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] lineColor=#0000ff javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +PopupMenu.borderColor #0000ff javax.swing.plaf.ColorUIResource [UI] PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] PopupMenu.consumeEventOnClose false -PopupMenu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -PopupMenu.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +PopupMenu.font [active] $defaultFont [UI] +PopupMenu.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] #---- PopupMenuSeparator ---- -PopupMenuSeparator.height 9 -PopupMenuSeparator.stripeIndent 4 -PopupMenuSeparator.stripeWidth 1 +PopupMenuSeparator.height 30 +PopupMenuSeparator.stripeIndent 1 +PopupMenuSeparator.stripeWidth 3 PopupMenuSeparatorUI com.formdev.flatlaf.ui.FlatPopupMenuSeparatorUI @@ -645,58 +688,59 @@ PopupMenuUI com.formdev.flatlaf.ui.FlatPopupMenuUI #---- ProgressBar ---- ProgressBar.arc 4 -ProgressBar.background #d1d1d1 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.background #88ff88 javax.swing.plaf.ColorUIResource [UI] ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] ProgressBar.cellLength 1 ProgressBar.cellSpacing 0 -ProgressBar.cycleTime 4000 -ProgressBar.font .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] -ProgressBar.foreground #1e82e6 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.cycleTime 10000 +ProgressBar.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI] +ProgressBar.foreground #33737373 javax.swing.plaf.ColorUIResource [UI] ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] ProgressBar.repaintInterval 15 -ProgressBar.selectionBackground #000000 javax.swing.plaf.ColorUIResource [UI] -ProgressBar.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +ProgressBar.selectionBackground #000088 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.selectionForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] ProgressBar.verticalSize 4,146 javax.swing.plaf.DimensionUIResource [UI] ProgressBarUI com.formdev.flatlaf.ui.FlatProgressBarUI #---- RadioButton ---- -RadioButton.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +RadioButton.background #ccffcc javax.swing.plaf.ColorUIResource [UI] RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -RadioButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -RadioButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +RadioButton.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +RadioButton.disabledText #000088 javax.swing.plaf.ColorUIResource [UI] +RadioButton.font [active] $defaultFont [UI] +RadioButton.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] RadioButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButton.icon.centerDiameter 8 RadioButton.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonIcon [UI] RadioButton.iconTextGap 4 +RadioButton.icon[filled].centerDiameter 5 RadioButton.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] RadioButton.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] RadioButton.rollover true -RadioButton.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +RadioButton.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] RadioButton.textIconGap 4 RadioButton.textShiftOffset 0 #---- RadioButtonMenuItem ---- -RadioButtonMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.acceleratorForeground #505050 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.acceleratorFont [active] $defaultFont [UI] +RadioButtonMenuItem.acceleratorForeground #ff8888 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] RadioButtonMenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] RadioButtonMenuItem.borderPainted true RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] -RadioButtonMenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] +RadioButtonMenuItem.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.font [active] $defaultFont [UI] +RadioButtonMenuItem.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI] RadioButtonMenuItem.opaque false -RadioButtonMenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] RadioButtonMenuItemUI com.formdev.flatlaf.ui.FlatRadioButtonMenuItemUI @@ -707,11 +751,14 @@ RadioButtonUI com.formdev.flatlaf.ui.FlatRadioButtonUI #---- Resizable ---- -Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] +Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#0000ff javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 #---- RootPane ---- +RootPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRootPaneUI$FlatWindowBorder [UI] +RootPane.borderDragThickness 5 +RootPane.cornerDragWidth 16 RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [0] ENTER [1] press @@ -721,74 +768,83 @@ RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; [5] press [6] ctrl released ENTER [7] release +RootPane.honorDialogMinimumSizeOnResize true +RootPane.honorFrameMinimumSizeOnResize false RootPaneUI com.formdev.flatlaf.ui.FlatRootPaneUI #---- ScrollBar ---- ScrollBar.allowsAbsolutePositioning true -ScrollBar.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.background #ccffcc javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] ScrollBar.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] -ScrollBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverThumbColor #c3c3c3 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverTrackColor #ededed javax.swing.plaf.ColorUIResource [UI] -ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI] -ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.hoverThumbColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.hoverThumbWithTrack false +ScrollBar.hoverTrackColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.maximumThumbSize 100000,100000 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.minimumThumbSize 10,10 javax.swing.plaf.DimensionUIResource [UI] +ScrollBar.pressedThumbWithTrack false ScrollBar.showButtons false ScrollBar.squareButtons false -ScrollBar.thumb #dcdcdc javax.swing.plaf.ColorUIResource [UI] -ScrollBar.thumbDarkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumb #33737373 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbArc 0 +ScrollBar.thumbDarkShadow #696969 javax.swing.plaf.ColorUIResource [UI] ScrollBar.thumbHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] -ScrollBar.thumbShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.track #f5f5f5 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.trackHighlight #9e9e9e javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +ScrollBar.thumbShadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.track #88ff88 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.trackArc 0 +ScrollBar.trackHighlight #696969 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.trackInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] ScrollBar.width 10 ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI #---- ScrollPane ---- -ScrollPane.background #f5f5f5 javax.swing.plaf.ColorUIResource [UI] +ScrollPane.background #88ff88 javax.swing.plaf.ColorUIResource [UI] ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] ScrollPane.fillUpperCorner true -ScrollPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ScrollPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ScrollPane.font [active] $defaultFont [UI] +ScrollPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] ScrollPane.smoothScrolling true ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI #---- Separator ---- -Separator.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Separator.foreground #d1d1d1 javax.swing.plaf.ColorUIResource [UI] -Separator.height 3 +Separator.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +Separator.foreground #00bb00 javax.swing.plaf.ColorUIResource [UI] +Separator.height 20 Separator.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -Separator.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Separator.stripeIndent 1 -Separator.stripeWidth 1 +Separator.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +Separator.stripeIndent 5 +Separator.stripeWidth 10 SeparatorUI com.formdev.flatlaf.ui.FlatSeparatorUI #---- Slider ---- -Slider.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Slider.disabledForeground #c0c0c0 javax.swing.plaf.ColorUIResource [UI] -Slider.focus #9e9e9e javax.swing.plaf.ColorUIResource [UI] +Slider.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +Slider.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] +Slider.focus #696969 javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Slider.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Slider.focusedColor #97c3f3 javax.swing.plaf.ColorUIResource [UI] +Slider.font [active] $defaultFont [UI] +Slider.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] Slider.horizontalSize 200,21 java.awt.Dimension -Slider.hoverColor #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +Slider.hoverColor #0000ff javax.swing.plaf.ColorUIResource [UI] Slider.minimumHorizontalSize 36,21 java.awt.Dimension Slider.minimumVerticalSize 21,36 java.awt.Dimension Slider.onlyLeftMouseButtonDrag true -Slider.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -Slider.thumbColor #6e6e6e javax.swing.plaf.ColorUIResource [UI] +Slider.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +Slider.thumbColor #880000 javax.swing.plaf.ColorUIResource [UI] Slider.thumbWidth 11 -Slider.tickColor #888888 javax.swing.plaf.ColorUIResource [UI] -Slider.trackColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +Slider.tickColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Slider.trackColor #00bb00 javax.swing.plaf.ColorUIResource [UI] Slider.trackWidth 3 Slider.verticalSize 21,200 java.awt.Dimension SliderUI com.formdev.flatlaf.ui.FlatSliderUI @@ -800,37 +856,38 @@ Spinner.arrowButtonSize 16,5 java.awt.Dimension Spinner.background #ffffff javax.swing.plaf.ColorUIResource [UI] Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] Spinner.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] -Spinner.buttonBackground #fafafa javax.swing.plaf.ColorUIResource [UI] +Spinner.buttonBackground #cccccc javax.swing.plaf.ColorUIResource [UI] Spinner.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI] -Spinner.buttonHoverArrowColor #999999 javax.swing.plaf.ColorUIResource [UI] -Spinner.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Spinner.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +Spinner.buttonHoverArrowColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Spinner.buttonStyle button +Spinner.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +Spinner.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI] Spinner.editorAlignment 11 Spinner.editorBorderPainted false -Spinner.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Spinner.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Spinner.font [active] $defaultFont [UI] +Spinner.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI #---- SplitPane ---- -SplitPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +SplitPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI] SplitPane.centerOneTouchButtons true SplitPane.continuousLayout true -SplitPane.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +SplitPane.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] SplitPane.dividerSize 5 SplitPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] SplitPane.oneTouchButtonOffset [active] 2 SplitPane.oneTouchButtonSize [active] 6 -SplitPane.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +SplitPane.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] #---- SplitPaneDivider ---- -SplitPaneDivider.draggingColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -SplitPaneDivider.oneTouchArrowColor #666666 javax.swing.plaf.ColorUIResource [UI] -SplitPaneDivider.oneTouchHoverArrowColor #333333 javax.swing.plaf.ColorUIResource [UI] +SplitPaneDivider.draggingColor #880000 javax.swing.plaf.ColorUIResource [UI] +SplitPaneDivider.oneTouchArrowColor #00ff00 javax.swing.plaf.ColorUIResource [UI] +SplitPaneDivider.oneTouchHoverArrowColor #ff0000 javax.swing.plaf.ColorUIResource [UI] #---- SplitPane ---- @@ -840,79 +897,98 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI #---- TabbedPane ---- -TabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.contentAreaColor #bfbfbf javax.swing.plaf.ColorUIResource [UI] +TabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeArc 999 +TabbedPane.closeCrossFilledSize 6.5 +TabbedPane.closeCrossLineWidth 2.0 +TabbedPane.closeCrossPlainSize 12.0 +TabbedPane.closeForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverBackground #aa0000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon [UI] +TabbedPane.closePressedBackground #00ff00 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closePressedForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.closeSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +TabbedPane.contentAreaColor #ff0000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.contentOpaque true TabbedPane.contentSeparatorHeight 1 -TabbedPane.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -TabbedPane.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] -TabbedPane.focus #000000 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.focusColor #dae4ed javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] +TabbedPane.focus #ff0000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.focusColor #dddddd javax.swing.plaf.ColorUIResource [UI] +TabbedPane.font [active] $defaultFont [UI] +TabbedPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] TabbedPane.hasFullBorder false +TabbedPane.hiddenTabsNavigation moreTabsButton TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -TabbedPane.hoverColor #d9d9d9 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.hoverColor #eeeeee javax.swing.plaf.ColorUIResource [UI] TabbedPane.labelShift 1 TabbedPane.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.selectedBackground #00ff00 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.selectedForeground #0000ff javax.swing.plaf.ColorUIResource [UI] TabbedPane.selectedLabelShift -1 TabbedPane.selectedTabPadInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.selectionFollowsFocus true -TabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI] +TabbedPane.showTabSeparators false +TabbedPane.tabAreaAlignment leading TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabHeight 32 -TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI] TabbedPane.tabRunOverlay 0 TabbedPane.tabSelectionHeight 3 +TabbedPane.tabSeparatorColor #0000ff javax.swing.plaf.ColorUIResource [UI] +TabbedPane.tabSeparatorsFullHeight false TabbedPane.tabsOpaque true -TabbedPane.tabsOverlapBorder true +TabbedPane.tabsOverlapBorder false TabbedPane.textIconGap 4 -TabbedPane.underlineColor #4083c9 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.underlineColor #ffff00 javax.swing.plaf.ColorUIResource [UI] TabbedPaneUI com.formdev.flatlaf.ui.FlatTabbedPaneUI #---- Table ---- Table.ascendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatAscendingSortIcon [UI] -Table.background #ffffff javax.swing.plaf.ColorUIResource [UI] -Table.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] +Table.background #fffff0 javax.swing.plaf.ColorUIResource [UI] +Table.cellFocusColor #ff0000 javax.swing.plaf.ColorUIResource [UI] Table.cellMargins 2,3,2,3 javax.swing.plaf.InsetsUIResource [UI] -Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] +Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] lineColor=#ff0000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.consistentHomeEndKeyBehavior true Table.descendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatDescendingSortIcon [UI] -Table.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] -Table.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] -Table.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] -Table.dropLineShortColor [lazy] #15416a javax.swing.plaf.ColorUIResource [UI] +Table.dropCellBackground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Table.dropCellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI] +Table.dropLineColor #0000ff javax.swing.plaf.ColorUIResource [UI] +Table.dropLineShortColor #ffff00 javax.swing.plaf.ColorUIResource [UI] Table.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -Table.focusCellForeground #000000 javax.swing.plaf.ColorUIResource [UI] -Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] -Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Table.gridColor #f7f7f7 javax.swing.plaf.ColorUIResource [UI] +Table.focusCellForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] lineColor=#ff0000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#ff0000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Table.font [active] $defaultFont [UI] +Table.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Table.gridColor #00ffff javax.swing.plaf.ColorUIResource [UI] Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] -Table.rowHeight 20 +Table.rowHeight 25 Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] -Table.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -Table.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -Table.selectionInactiveBackground #d4d4d4 javax.swing.plaf.ColorUIResource [UI] -Table.selectionInactiveForeground #000000 javax.swing.plaf.ColorUIResource [UI] +Table.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +Table.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +Table.selectionInactiveBackground #888888 javax.swing.plaf.ColorUIResource [UI] +Table.selectionInactiveForeground #ffffff javax.swing.plaf.ColorUIResource [UI] Table.showHorizontalLines false Table.showVerticalLines false -Table.sortIconColor #afafaf javax.swing.plaf.ColorUIResource [UI] +Table.sortIconColor #ffff00 javax.swing.plaf.ColorUIResource [UI] #---- TableHeader ---- -TableHeader.background #ffffff javax.swing.plaf.ColorUIResource [UI] -TableHeader.bottomSeparatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] +TableHeader.background #4444ff javax.swing.plaf.ColorUIResource [UI] +TableHeader.bottomSeparatorColor #00ff00 javax.swing.plaf.ColorUIResource [UI] TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -TableHeader.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -TableHeader.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TableHeader.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TableHeader.focusCellBackground #4444ff javax.swing.plaf.ColorUIResource [UI] +TableHeader.font [active] $defaultFont [UI] +TableHeader.foreground #ffffff javax.swing.plaf.ColorUIResource [UI] TableHeader.height 25 -TableHeader.separatorColor #e6e6e6 javax.swing.plaf.ColorUIResource [UI] +TableHeader.separatorColor #00ff00 javax.swing.plaf.ColorUIResource [UI] TableHeaderUI com.formdev.flatlaf.ui.FlatTableHeaderUI @@ -923,20 +999,20 @@ TableUI com.formdev.flatlaf.ui.FlatTableUI #---- TaskPane ---- -TaskPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TaskPane.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +TaskPane.background #00ff00 javax.swing.plaf.ColorUIResource [UI] +TaskPane.borderColor #0000ff javax.swing.plaf.ColorUIResource [UI] TaskPane.contentInsets 10,10,10,10 javax.swing.plaf.InsetsUIResource [UI] -TaskPane.specialTitleBackground #afafaf javax.swing.plaf.ColorUIResource [UI] -TaskPane.specialTitleForeground #222222 javax.swing.plaf.ColorUIResource [UI] -TaskPane.specialTitleOver #666666 javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleBackgroundGradientStart #dfdfdf javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleForeground #222222 javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleOver #666666 javax.swing.plaf.ColorUIResource [UI] +TaskPane.specialTitleBackground #00ffff javax.swing.plaf.ColorUIResource [UI] +TaskPane.specialTitleForeground #444444 javax.swing.plaf.ColorUIResource [UI] +TaskPane.specialTitleOver #dd0000 javax.swing.plaf.ColorUIResource [UI] +TaskPane.titleBackgroundGradientStart #ffff00 javax.swing.plaf.ColorUIResource [UI] +TaskPane.titleForeground #ff00ff javax.swing.plaf.ColorUIResource [UI] +TaskPane.titleOver #0000aa javax.swing.plaf.ColorUIResource [UI] #---- TaskPaneContainer ---- -TaskPaneContainer.background #e6ebf0 javax.swing.plaf.ColorUIResource [UI] +TaskPaneContainer.background #ff8888 javax.swing.plaf.ColorUIResource [UI] TaskPaneContainer.border [lazy] 10,10,10,10 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] @@ -945,15 +1021,15 @@ TaskPaneContainer.border [lazy] 10,10,10,10 false com.formdev.flatlaf. TextArea.background #ffffff javax.swing.plaf.ColorUIResource [UI] TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] TextArea.caretBlinkRate 500 -TextArea.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -TextArea.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextArea.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextArea.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -TextArea.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextArea.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +TextArea.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +TextArea.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +TextArea.font [active] $defaultFont [UI] +TextArea.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +TextArea.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +TextArea.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] TextArea.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextArea.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -TextArea.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TextArea.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +TextArea.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] TextAreaUI com.formdev.flatlaf.ui.FlatTextAreaUI @@ -968,20 +1044,20 @@ TextComponent.selectAllOnFocusPolicy once TextField.background #ffffff javax.swing.plaf.ColorUIResource [UI] TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] TextField.caretBlinkRate 500 -TextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -TextField.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -TextField.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TextField.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +TextField.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +TextField.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +TextField.font [active] $defaultFont [UI] +TextField.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] TextField.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] -TextField.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextField.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +TextField.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +TextField.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] TextField.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] TextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextField.placeholderForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -TextField.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -TextField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -TextField.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +TextField.placeholderForeground #000088 javax.swing.plaf.ColorUIResource [UI] +TextField.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +TextField.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +TextField.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] TextFieldUI com.formdev.flatlaf.ui.FlatTextFieldUI @@ -990,23 +1066,46 @@ TextFieldUI com.formdev.flatlaf.ui.FlatTextFieldUI TextPane.background #ffffff javax.swing.plaf.ColorUIResource [UI] TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] TextPane.caretBlinkRate 500 -TextPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] -TextPane.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -TextPane.inactiveBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -TextPane.inactiveForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] +TextPane.caretForeground #0000ff javax.swing.plaf.ColorUIResource [UI] +TextPane.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +TextPane.font [active] $defaultFont [UI] +TextPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +TextPane.inactiveBackground #f0f0f0 javax.swing.plaf.ColorUIResource [UI] +TextPane.inactiveForeground #000088 javax.swing.plaf.ColorUIResource [UI] TextPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextPane.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -TextPane.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TextPane.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +TextPane.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI +#---- TitlePane ---- + +TitlePane.background #00ff00 javax.swing.plaf.ColorUIResource [UI] +TitlePane.buttonMaximizedHeight 22 +TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI] +TitlePane.closePressedBackground #99e81123 javax.swing.plaf.ColorUIResource [UI] +TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.foreground #0000ff javax.swing.plaf.ColorUIResource [UI] +TitlePane.iconMargins 3,8,3,0 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] +TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI] +TitlePane.inactiveBackground #008800 javax.swing.plaf.ColorUIResource [UI] +TitlePane.inactiveForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI] +TitlePane.menuBarEmbedded true +TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI] +TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI] +TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] + + #---- TitledBorder ---- -TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TitledBorder.titleColor #000000 javax.swing.plaf.ColorUIResource [UI] +TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#ff00ff javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +TitledBorder.font [active] $defaultFont [UI] +TitledBorder.titleColor #ff00ff javax.swing.plaf.ColorUIResource [UI] #---- TitledPanel ---- @@ -1016,54 +1115,58 @@ TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI #---- ToggleButton ---- -ToggleButton.background #ffffff javax.swing.plaf.ColorUIResource [UI] +ToggleButton.background #ddddff javax.swing.plaf.ColorUIResource [UI] ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] -ToggleButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledSelectedBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToggleButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledSelectedBackground #44dd44 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledText #000088 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.focusedBackground #00ffff javax.swing.plaf.ColorUIResource [UI] +ToggleButton.font [active] $defaultFont [UI] +ToggleButton.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] ToggleButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ToggleButton.hoverBackground #ffff00 javax.swing.plaf.ColorUIResource [UI] ToggleButton.iconTextGap 4 ToggleButton.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] ToggleButton.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] -ToggleButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] +ToggleButton.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI] ToggleButton.rollover true -ToggleButton.selectedBackground #cfcfcf javax.swing.plaf.ColorUIResource [UI] +ToggleButton.selectedBackground #44ff44 javax.swing.plaf.ColorUIResource [UI] ToggleButton.selectedForeground #000000 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.disabledUnderlineColor #ababab javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.focusBackground #dae4ed javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.hoverBackground #d9d9d9 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.underlineColor #4083c9 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.focusBackground #dddddd javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.hoverBackground #eeeeee javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.selectedBackground #00ff00 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.tab.underlineColor #ffff00 javax.swing.plaf.ColorUIResource [UI] ToggleButton.tab.underlineHeight 2 ToggleButton.textIconGap 4 ToggleButton.textShiftOffset 0 -ToggleButton.toolbar.hoverBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.pressedBackground #d8d8d8 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.selectedBackground #cfcfcf javax.swing.plaf.ColorUIResource [UI] +ToggleButton.toolbar.hoverBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +ToggleButton.toolbar.pressedBackground #eeeeee javax.swing.plaf.ColorUIResource [UI] +ToggleButton.toolbar.selectedBackground #dddddd javax.swing.plaf.ColorUIResource [UI] ToggleButtonUI com.formdev.flatlaf.ui.FlatToggleButtonUI #---- ToolBar ---- -ToolBar.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] +ToolBar.background #ccffcc javax.swing.plaf.ColorUIResource [UI] ToolBar.border [lazy] 2,2,2,2 false com.formdev.flatlaf.ui.FlatToolBarBorder [UI] ToolBar.borderMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] -ToolBar.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] -ToolBar.dockingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ToolBar.dockingForeground #000000 javax.swing.plaf.ColorUIResource [UI] -ToolBar.floatingBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -ToolBar.floatingForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI] -ToolBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToolBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ToolBar.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI] +ToolBar.dockingBackground #ccffcc javax.swing.plaf.ColorUIResource [UI] +ToolBar.dockingForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] +ToolBar.floatingBackground #ccffcc javax.swing.plaf.ColorUIResource [UI] +ToolBar.floatingForeground #000088 javax.swing.plaf.ColorUIResource [UI] +ToolBar.font [active] $defaultFont [UI] +ToolBar.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] ToolBar.gripColor #afafaf javax.swing.plaf.ColorUIResource [UI] ToolBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] ToolBar.isRollover true ToolBar.light #e3e3e3 javax.swing.plaf.ColorUIResource [UI] -ToolBar.separatorColor #d1d1d1 javax.swing.plaf.ColorUIResource [UI] +ToolBar.separatorColor #00bb00 javax.swing.plaf.ColorUIResource [UI] ToolBar.separatorWidth 7 -ToolBar.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] +ToolBar.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] ToolBar.spacingBorder [lazy] 1,2,1,2 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] @@ -1079,12 +1182,10 @@ ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI #---- ToolTip ---- -ToolTip.background #fafafa javax.swing.plaf.ColorUIResource [UI] -ToolTip.backgroundInactive #fafafa javax.swing.plaf.ColorUIResource [UI] -ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -ToolTip.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToolTip.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -ToolTip.foregroundInactive #8c8c8c javax.swing.plaf.ColorUIResource [UI] +ToolTip.background #eeeeff javax.swing.plaf.ColorUIResource [UI] +ToolTip.border [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +ToolTip.font [active] $defaultFont [UI] +ToolTip.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] #---- ToolTipManager ---- @@ -1099,20 +1200,21 @@ ToolTipUI com.formdev.flatlaf.ui.FlatToolTipUI #---- Tree ---- -Tree.background #ffffff javax.swing.plaf.ColorUIResource [UI] +Tree.background #fff0ff javax.swing.plaf.ColorUIResource [UI] Tree.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] Tree.changeSelectionWithFocus true Tree.closedIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTreeClosedIcon [UI] Tree.collapsedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeCollapsedIcon [UI] Tree.drawsFocusBorderAroundIcon false -Tree.dropCellBackground [lazy] #3f8fd9 javax.swing.plaf.ColorUIResource [UI] -Tree.dropCellForeground [lazy] #ffffff javax.swing.plaf.ColorUIResource [UI] -Tree.dropLineColor [lazy] #6aa7e1 javax.swing.plaf.ColorUIResource [UI] -Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +Tree.dropCellBackground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Tree.dropCellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI] +Tree.dropLineColor #0000ff javax.swing.plaf.ColorUIResource [UI] +Tree.editorBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] lineColor=#ff0000 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000 +Tree.editorBorderSelectionColor #0000ff javax.swing.plaf.ColorUIResource [UI] Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Tree.foreground #000000 javax.swing.plaf.ColorUIResource [UI] -Tree.hash #e6e6e6 javax.swing.plaf.ColorUIResource [UI] +Tree.font [active] $defaultFont [UI] +Tree.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] +Tree.hash #ff0000 javax.swing.plaf.ColorUIResource [UI] Tree.icon.closedColor #afafaf javax.swing.plaf.ColorUIResource [UI] Tree.icon.collapsedColor #afafaf javax.swing.plaf.ColorUIResource [UI] Tree.icon.expandedColor #afafaf javax.swing.plaf.ColorUIResource [UI] @@ -1122,19 +1224,21 @@ Tree.leafIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTre Tree.leftChildIndent 7 Tree.lineTypeDashed false Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTreeOpenIcon [UI] -Tree.paintLines false +Tree.paintLines true Tree.rendererFillBackground false Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] +Tree.repaintWholeRow true Tree.rightChildIndent 11 Tree.rowHeight 0 Tree.scrollsOnExpand true -Tree.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI] -Tree.selectionBorderColor #000000 javax.swing.plaf.ColorUIResource [UI] -Tree.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -Tree.selectionInactiveBackground #d4d4d4 javax.swing.plaf.ColorUIResource [UI] -Tree.selectionInactiveForeground #000000 javax.swing.plaf.ColorUIResource [UI] -Tree.textBackground #ffffff javax.swing.plaf.ColorUIResource [UI] -Tree.textForeground #000000 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionBackground #00aa00 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionForeground #ffff00 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionInactiveBackground #888888 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionInactiveForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Tree.showCellFocusIndicator false +Tree.textBackground #fff0ff javax.swing.plaf.ColorUIResource [UI] +Tree.textForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] Tree.timeFactor 1000 Tree.wideSelection true TreeUI com.formdev.flatlaf.ui.FlatTreeUI @@ -1142,9 +1246,9 @@ TreeUI com.formdev.flatlaf.ui.FlatTreeUI #---- Viewport ---- -Viewport.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -Viewport.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Viewport.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Viewport.background #ccffcc javax.swing.plaf.ColorUIResource [UI] +Viewport.font [active] $defaultFont [UI] +Viewport.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI] ViewportUI com.formdev.flatlaf.ui.FlatViewportUI @@ -1152,13 +1256,14 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI activeCaption #99b4d1 javax.swing.plaf.ColorUIResource [UI] activeCaptionBorder #99b4d1 javax.swing.plaf.ColorUIResource [UI] -activeCaptionText #000000 javax.swing.plaf.ColorUIResource [UI] -control #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -controlDkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +activeCaptionText #ff0000 javax.swing.plaf.ColorUIResource [UI] +control #ccffcc javax.swing.plaf.ColorUIResource [UI] +controlDkShadow #696969 javax.swing.plaf.ColorUIResource [UI] controlHighlight #e3e3e3 javax.swing.plaf.ColorUIResource [UI] controlLtHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] -controlShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI] -controlText #000000 javax.swing.plaf.ColorUIResource [UI] +controlShadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI] +controlText #ff0000 javax.swing.plaf.ColorUIResource [UI] +defaultFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI] desktop #ffffff javax.swing.plaf.ColorUIResource [UI] @@ -1172,12 +1277,22 @@ html.pendingImage [lazy] 38,38 sun.swing.ImageIconUIResource [UI inactiveCaption #bfcddb javax.swing.plaf.ColorUIResource [UI] inactiveCaptionBorder #bfcddb javax.swing.plaf.ColorUIResource [UI] -inactiveCaptionText #000000 javax.swing.plaf.ColorUIResource [UI] -info #fafafa javax.swing.plaf.ColorUIResource [UI] -infoText #000000 javax.swing.plaf.ColorUIResource [UI] -menu #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -menuText #000000 javax.swing.plaf.ColorUIResource [UI] -scrollbar #f5f5f5 javax.swing.plaf.ColorUIResource [UI] +inactiveCaptionText #ff0000 javax.swing.plaf.ColorUIResource [UI] +info #eeeeff javax.swing.plaf.ColorUIResource [UI] +infoText #ff0000 javax.swing.plaf.ColorUIResource [UI] + + +#---- laf ---- + +laf.dark false +laf.scaleFactor [active] 1.0 + + +#---- ---- + +menu #ccffcc javax.swing.plaf.ColorUIResource [UI] +menuText #ff0000 javax.swing.plaf.ColorUIResource [UI] +scrollbar #88ff88 javax.swing.plaf.ColorUIResource [UI] #---- swingx/TaskPane ---- @@ -1188,10 +1303,10 @@ swingx/TaskPaneUI com.formdev.flatlaf.swingx.ui.FlatTaskPaneUI #---- ---- text #ffffff javax.swing.plaf.ColorUIResource [UI] -textHighlight #2675bf javax.swing.plaf.ColorUIResource [UI] -textHighlightText #ffffff javax.swing.plaf.ColorUIResource [UI] -textInactiveText #8c8c8c javax.swing.plaf.ColorUIResource [UI] -textText #000000 javax.swing.plaf.ColorUIResource [UI] -window #f2f2f2 javax.swing.plaf.ColorUIResource [UI] -windowBorder #000000 javax.swing.plaf.ColorUIResource [UI] -windowText #000000 javax.swing.plaf.ColorUIResource [UI] +textHighlight #00aa00 javax.swing.plaf.ColorUIResource [UI] +textHighlightText #ffff00 javax.swing.plaf.ColorUIResource [UI] +textInactiveText #000088 javax.swing.plaf.ColorUIResource [UI] +textText #ff0000 javax.swing.plaf.ColorUIResource [UI] +window #ccffcc javax.swing.plaf.ColorUIResource [UI] +windowBorder #ff0000 javax.swing.plaf.ColorUIResource [UI] +windowText #ff0000 javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_1.8.0_202.txt new file mode 100644 index 00000000..08a2d17d --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_1.8.0_202.txt @@ -0,0 +1,860 @@ +Class com.sun.java.swing.plaf.gtk.GTKLookAndFeel +ID GTK +Name GTK look and feel +Java 1.8.0_202 +OS Linux + + +#---- ---- + +AATextInfoPropertyKey [unknown type] sun.swing.SwingUtilities2$AATextInfo + + +#---- ArrowButton ---- + +ArrowButton.size 13 +ArrowButtonUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- AuditoryCues ---- + +AuditoryCues.allAuditoryCues length=13 [Ljava.lang.Object; + [0] CheckBoxMenuItem.commandSound + [1] InternalFrame.closeSound + [2] InternalFrame.maximizeSound + [3] InternalFrame.minimizeSound + [4] InternalFrame.restoreDownSound + [5] InternalFrame.restoreUpSound + [6] MenuItem.commandSound + [7] OptionPane.errorSound + [8] OptionPane.informationSound + [9] OptionPane.questionSound + [10] OptionPane.warningSound + [11] PopupMenu.popupSound + [12] RadioButtonMenuItem.commandSound +AuditoryCues.cueList length=13 [Ljava.lang.Object; + [0] CheckBoxMenuItem.commandSound + [1] InternalFrame.closeSound + [2] InternalFrame.maximizeSound + [3] InternalFrame.minimizeSound + [4] InternalFrame.restoreDownSound + [5] InternalFrame.restoreUpSound + [6] MenuItem.commandSound + [7] OptionPane.errorSound + [8] OptionPane.informationSound + [9] OptionPane.questionSound + [10] OptionPane.warningSound + [11] PopupMenu.popupSound + [12] RadioButtonMenuItem.commandSound +AuditoryCues.noAuditoryCues length=1 [Ljava.lang.Object; + [0] mute + + +#---- Button ---- + +Button.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Button.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,3,3,3 false javax.swing.plaf.basic.BasicBorders$ButtonBorder [UI] + 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +Button.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +Button.defaultButtonFollowsFocus false +Button.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Button.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Button.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +Button.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Button.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +Button.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Button.textIconGap 4 +Button.textShiftOffset 0 +ButtonUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- CheckBox ---- + +CheckBox.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +CheckBox.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$RadioButtonBorder [UI] + 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +CheckBox.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +CheckBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +CheckBox.icon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +CheckBox.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +CheckBox.textIconGap 4 +CheckBox.textShiftOffset 0 + + +#---- CheckBoxMenuItem ---- + +CheckBoxMenuItem.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.acceleratorForeground #2e3436 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.alignAcceleratorText false +CheckBoxMenuItem.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +CheckBoxMenuItem.borderPainted false +CheckBoxMenuItem.checkIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +CheckBoxMenuItem.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +CheckBoxMenuItem.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +CheckBoxMenuItem.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +CheckBoxMenuItemUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- CheckBox ---- + +CheckBoxUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ColorChooser ---- + +ColorChooser.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ColorChooser.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ColorChooser.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ColorChooser.panels [active] length=1 [Ljavax.swing.colorchooser.AbstractColorChooserPanel; + [0] [unknown type] com.sun.java.swing.plaf.gtk.GTKColorChooserPanel +ColorChooser.showPreviewPanelText false +ColorChooser.swatchesDefaultRecentColor #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ColorChooser.swatchesRecentSwatchSize 10,10 java.awt.Dimension +ColorChooser.swatchesSwatchSize 10,10 java.awt.Dimension +ColorChooserUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ComboBox ---- + +ComboBox.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonDarkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ComboBox.buttonShadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +ComboBox.disabledBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ComboBox.disabledForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +ComboBox.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ComboBox.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ComboBox.isEnterSelectablePopup true +ComboBox.noActionOnKeyNavigation false +ComboBox.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +ComboBox.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +ComboBox.timeFactor 1000 +ComboBoxUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Desktop ---- + +Desktop.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Desktop.minOnScreenInsets 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] + + +#---- DesktopIcon ---- + +DesktopIcon.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 true javax.swing.border.BevelBorder + line: #e8e8e7 javax.swing.plaf.ColorUIResource [UI] 1 false 1,1,1,1 true javax.swing.border.LineBorder +DesktopIconUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- DesktopPane ---- + +DesktopPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- EditorPane ---- + +EditorPane.background #ffffff javax.swing.plaf.ColorUIResource [UI] +EditorPane.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +EditorPane.caretAspectRatio 0.025 +EditorPane.caretBlinkRate 1200 +EditorPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +EditorPane.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +EditorPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +EditorPane.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +EditorPane.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] +EditorPane.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +EditorPane.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +EditorPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- FileChooser ---- + +FileChooser.detailsViewIcon [lazy] null +FileChooser.homeFolderIcon [lazy] null +FileChooser.listViewIcon [lazy] null +FileChooser.newFolderIcon [lazy] null +FileChooser.readOnly false +FileChooser.upFolderIcon [lazy] null +FileChooser.useSystemExtensionHiding false +FileChooser.usesSingleFilePane false +FileChooserUI com.sun.java.swing.plaf.gtk.GTKLookAndFeel + + +#---- FileView ---- + +FileView.computerIcon [lazy] null +FileView.directoryIcon [lazy] 16,18 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) +FileView.fileIcon [lazy] 16,20 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) +FileView.floppyDriveIcon [lazy] null +FileView.hardDriveIcon [lazy] null + + +#---- FormattedTextField ---- + +FormattedTextField.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.border [lazy] 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$FieldBorder [UI] +FormattedTextField.caretAspectRatio 0.025 +FormattedTextField.caretBlinkRate 1200 +FormattedTextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +FormattedTextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.inactiveBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +FormattedTextField.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +FormattedTextField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +FormattedTextFieldUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- InternalFrame ---- + +InternalFrame.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 true javax.swing.border.BevelBorder + line: #e8e8e7 javax.swing.plaf.ColorUIResource [UI] 1 false 1,1,1,1 true javax.swing.border.LineBorder +InternalFrame.borderColor #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderDarkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderLight #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.borderShadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +InternalFrame.closeIcon [lazy] 14,16 javax.swing.plaf.basic.BasicIconFactory$EmptyFrameIcon +InternalFrame.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) +InternalFrame.iconifyIcon [lazy] 14,16 javax.swing.plaf.basic.BasicIconFactory$EmptyFrameIcon +InternalFrame.layoutTitlePaneAtOrigin true +InternalFrame.maximizeIcon [lazy] 14,16 javax.swing.plaf.basic.BasicIconFactory$EmptyFrameIcon +InternalFrame.minimizeIcon [lazy] 14,16 javax.swing.plaf.basic.BasicIconFactory$EmptyFrameIcon +InternalFrame.titleFont [lazy] Dialog bold 12 javax.swing.plaf.FontUIResource [UI] +InternalFrame.useTaskBar true +InternalFrame.windowBindings length=6 [Ljava.lang.Object; + [0] shift ESCAPE + [1] showSystemMenu + [2] ctrl SPACE + [3] showSystemMenu + [4] ESCAPE + [5] hideSystemMenu + + +#---- InternalFrameTitlePane ---- + +InternalFrameTitlePane.titlePaneLayout [lazy] [unknown type] com.sun.java.swing.plaf.gtk.Metacity$TitlePaneLayout +InternalFrameTitlePaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- InternalFrame ---- + +InternalFrameUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Label ---- + +Label.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Label.disabledForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Label.disabledShadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Label.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Label.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +LabelUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- List ---- + +List.background #ffffff javax.swing.plaf.ColorUIResource [UI] +List.cellRenderer [active] javax.swing.DefaultListCellRenderer$UIResource [UI] +List.dropLineColor #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +List.focusCellHighlightBorder [lazy] 0,0,0,0 true com.sun.java.swing.plaf.gtk.GTKPainter$ListTableFocusBorder [UI] +List.focusSelectedCellHighlightBorder [lazy] 0,0,0,0 true com.sun.java.swing.plaf.gtk.GTKPainter$ListTableFocusBorder [UI] +List.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +List.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +List.noFocusBorder [lazy] 0,0,0,0 true com.sun.java.swing.plaf.gtk.GTKPainter$ListTableFocusBorder [UI] +List.rendererUseUIBorder false +List.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +List.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +List.timeFactor 1000 +ListUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Menu ---- + +Menu.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI] +Menu.acceleratorForeground #2e3436 javax.swing.plaf.ColorUIResource [UI] +Menu.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Menu.alignAcceleratorText false +Menu.arrowIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$MenuArrowIcon [UI] +Menu.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Menu.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +Menu.borderPainted false +Menu.cancelMode hideMenuTree +Menu.crossMenuMnemonic true +Menu.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Menu.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] +Menu.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +Menu.menuPopupOffsetX 0 +Menu.menuPopupOffsetY 0 +Menu.preserveTopLevelSelection false +Menu.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +Menu.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Menu.shortcutKeys length=1 [I + [0] 8 +Menu.submenuPopupOffsetX 0 +Menu.submenuPopupOffsetY 0 +Menu.useMenuBarForTopLevelMenus true + + +#---- MenuBar ---- + +MenuBar.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +MenuBar.border [lazy] 0,0,2,0 false javax.swing.plaf.basic.BasicBorders$MenuBarBorder [UI] +MenuBar.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +MenuBar.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] +MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +MenuBar.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +MenuBar.windowBindings length=2 [Ljava.lang.Object; + [0] F10 + [1] takeFocus +MenuBarUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- MenuItem ---- + +MenuItem.acceleratorDelimiter + +MenuItem.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI] +MenuItem.acceleratorForeground #2e3436 javax.swing.plaf.ColorUIResource [UI] +MenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +MenuItem.alignAcceleratorText false +MenuItem.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +MenuItem.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +MenuItem.borderPainted false +MenuItem.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +MenuItem.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] +MenuItem.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +MenuItem.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +MenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +MenuItemUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Menu ---- + +MenuUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- OptionPane ---- + +OptionPane.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +OptionPane.border [lazy] 10,10,12,10 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] +OptionPane.buttonAreaBorder [lazy] 6,0,0,0 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] +OptionPane.buttonClickThreshhold 500 +OptionPane.buttonOrientation 4 +OptionPane.buttonPadding 10 +OptionPane.errorIcon [lazy] null +OptionPane.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +OptionPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +OptionPane.informationIcon [lazy] null +OptionPane.isYesLast true +OptionPane.messageAreaBorder [lazy] 0,0,0,0 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] +OptionPane.messageForeground #000000 javax.swing.plaf.ColorUIResource [UI] +OptionPane.minimumSize 262,90 javax.swing.plaf.DimensionUIResource [UI] +OptionPane.questionIcon [lazy] null +OptionPane.sameSizeButtons true +OptionPane.setButtonMargin false +OptionPane.warningIcon [lazy] null +OptionPane.windowBindings length=2 [Ljava.lang.Object; + [0] ESCAPE + [1] close +OptionPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Panel ---- + +Panel.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Panel.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Panel.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +PanelUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- PasswordField ---- + +PasswordField.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +PasswordField.border [lazy] 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$FieldBorder [UI] +PasswordField.caretAspectRatio 0.025 +PasswordField.caretBlinkRate 1200 +PasswordField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +PasswordField.echoChar '*' +PasswordField.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +PasswordField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +PasswordField.inactiveBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +PasswordField.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +PasswordField.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +PasswordField.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +PasswordField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +PasswordFieldUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- PopupMenu ---- + +PopupMenu.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +PopupMenu.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 true javax.swing.border.BevelBorder + line: #e8e8e7 javax.swing.plaf.ColorUIResource [UI] 1 false 1,1,1,1 true javax.swing.border.LineBorder +PopupMenu.consumeEventOnClose true +PopupMenu.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +PopupMenu.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] + + +#---- PopupMenuSeparator ---- + +PopupMenuSeparatorUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- PopupMenu ---- + +PopupMenuUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ProgressBar ---- + +ProgressBar.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.border [lazy] line: #00ff00 java.awt.Color 2 false 2,2,2,2 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +ProgressBar.cellLength 1 +ProgressBar.cellSpacing 0 +ProgressBar.cycleTime 3000 +ProgressBar.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ProgressBar.foreground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.horizontalSize 148,18 javax.swing.plaf.DimensionUIResource [UI] +ProgressBar.repaintInterval 50 +ProgressBar.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.selectionForeground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ProgressBar.verticalSize 20,78 javax.swing.plaf.DimensionUIResource [UI] +ProgressBarUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- RadioButton ---- + +RadioButton.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +RadioButton.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$RadioButtonBorder [UI] + 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +RadioButton.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +RadioButton.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +RadioButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +RadioButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +RadioButton.icon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +RadioButton.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +RadioButton.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +RadioButton.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +RadioButton.textIconGap 4 +RadioButton.textShiftOffset 0 + + +#---- RadioButtonMenuItem ---- + +RadioButtonMenuItem.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.acceleratorForeground #2e3436 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.acceleratorSelectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.alignAcceleratorText false +RadioButtonMenuItem.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +RadioButtonMenuItem.borderPainted false +RadioButtonMenuItem.checkIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +RadioButtonMenuItem.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +RadioButtonMenuItem.foreground #2e3436 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +RadioButtonMenuItem.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +RadioButtonMenuItemUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- RadioButton ---- + +RadioButtonUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- RootPane ---- + +RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; + [0] ENTER + [1] press + [2] released ENTER + [3] release + [4] ctrl ENTER + [5] press + [6] ctrl released ENTER + [7] release +RootPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ScrollBar ---- + +ScrollBar.allowsAbsolutePositioning true +ScrollBar.alwaysShowThumb true +ScrollBar.background #e0e0e0 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.foreground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.maximumThumbSize 4096,4096 java.awt.Dimension +ScrollBar.minimumThumbSize 8,8 java.awt.Dimension +ScrollBar.squareButtons false +ScrollBar.thumb #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbDarkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbHeight 14 +ScrollBar.thumbHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ScrollBar.thumbShadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.track #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.trackHighlight #000000 javax.swing.plaf.ColorUIResource [UI] +ScrollBar.width 16 +ScrollBarUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ScrollPane ---- + +ScrollPane.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ScrollPane.border [lazy] 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$FieldBorder [UI] +ScrollPane.fillLowerCorner true +ScrollPane.fillUpperCorner true +ScrollPane.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ScrollPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ScrollPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Separator ---- + +Separator.background #ffffff javax.swing.plaf.ColorUIResource [UI] +Separator.foreground #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Separator.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +Separator.insets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +Separator.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Separator.thickness 2 +SeparatorUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Slider ---- + +Slider.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Slider.focus #000000 javax.swing.plaf.ColorUIResource [UI] +Slider.focusInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] +Slider.font [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI] +Slider.foreground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Slider.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +Slider.horizontalSize 200,21 java.awt.Dimension +Slider.minimumHorizontalSize 36,21 java.awt.Dimension +Slider.minimumVerticalSize 21,36 java.awt.Dimension +Slider.onlyLeftMouseButtonDrag false +Slider.paintValue true +Slider.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Slider.thumbHeight 14 +Slider.thumbWidth 30 +Slider.tickColor #000000 java.awt.Color +Slider.verticalSize 21,200 java.awt.Dimension +SliderUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Spinner ---- + +Spinner.arrowButtonSize 16,5 java.awt.Dimension +Spinner.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Spinner.border [lazy] 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$FieldBorder [UI] +Spinner.disableOnBoundaryValues true +Spinner.editorAlignment 10 +Spinner.editorBorderPainted false +Spinner.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Spinner.foreground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +SpinnerUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- SplitPane ---- + +SplitPane.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +SplitPane.border [lazy] 1,1,1,1 true javax.swing.plaf.basic.BasicBorders$SplitPaneBorder [UI] +SplitPane.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +SplitPane.dividerSize 7 +SplitPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +SplitPane.oneTouchButtonSize 5 +SplitPane.oneTouchOffset 2 +SplitPane.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +SplitPane.size 7 +SplitPane.supportsOneTouchButtons false + + +#---- SplitPaneDivider ---- + +SplitPaneDivider.border [lazy] 1,1,1,1 true javax.swing.plaf.basic.BasicBorders$SplitPaneDividerBorder [UI] +SplitPaneDivider.draggingColor #404040 javax.swing.plaf.ColorUIResource [UI] + + +#---- SplitPane ---- + +SplitPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Synth ---- + +Synth.doNotSetTextAA true + + +#---- TabbedPane ---- + +TabbedPane.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.contentBorderInsets 2,2,3,3 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.contentOpaque true +TabbedPane.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.focus #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +TabbedPane.isTabRollover false +TabbedPane.labelShift 3 +TabbedPane.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.selectedLabelShift 3 +TabbedPane.selectedTabPadInsets 2,2,0,1 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.selectionFollowsFocus true +TabbedPane.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +TabbedPane.tabAreaInsets 3,2,0,2 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.tabInsets 0,4,1,4 javax.swing.plaf.InsetsUIResource [UI] +TabbedPane.tabRunOverlay 2 +TabbedPane.tabsOpaque true +TabbedPane.tabsOverlapBorder false +TabbedPane.textIconGap 4 +TabbedPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Table ---- + +Table.ascendingSortIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +Table.background #ffffff javax.swing.plaf.ColorUIResource [UI] +Table.descendingSortIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$DelegatingIcon [UI] +Table.dropLineColor #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Table.dropLineShortColor #000000 javax.swing.plaf.ColorUIResource [UI] +Table.focusCellBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Table.focusCellForeground #2e3436 javax.swing.plaf.ColorUIResource [UI] +Table.focusCellHighlightBorder [lazy] 0,0,0,0 true com.sun.java.swing.plaf.gtk.GTKPainter$ListTableFocusBorder [UI] +Table.focusSelectedCellHighlightBorder [lazy] 0,0,0,0 true com.sun.java.swing.plaf.gtk.GTKPainter$ListTableFocusBorder [UI] +Table.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Table.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Table.gridColor #808080 javax.swing.plaf.ColorUIResource [UI] +Table.scrollPaneBorder [lazy] 0,0,0,0 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] +Table.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +Table.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Table.sortIconColor #a4a4a1 javax.swing.plaf.ColorUIResource [UI] + + +#---- TableHeader ---- + +TableHeader.alignSorterArrow true +TableHeader.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TableHeader.cellBorder [lazy] 2,2,2,2 true javax.swing.plaf.BorderUIResource$BevelBorderUIResource [UI] +TableHeader.focusCellBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +TableHeader.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TableHeader.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TableHeaderUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Table ---- + +TableUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- TextArea ---- + +TextArea.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TextArea.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +TextArea.caretAspectRatio 0.025 +TextArea.caretBlinkRate 1200 +TextArea.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TextArea.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TextArea.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TextArea.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +TextArea.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +TextArea.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +TextArea.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TextAreaUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- TextField ---- + +TextField.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TextField.border [lazy] 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$FieldBorder [UI] +TextField.caretAspectRatio 0.025 +TextField.caretBlinkRate 1200 +TextField.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TextField.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +TextField.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TextField.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TextField.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +TextField.inactiveBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TextField.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +TextField.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +TextField.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +TextField.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +TextField.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TextField.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +TextFieldUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- TextPane ---- + +TextPane.background #ffffff javax.swing.plaf.ColorUIResource [UI] +TextPane.border [lazy] 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +TextPane.caretAspectRatio 0.025 +TextPane.caretBlinkRate 1200 +TextPane.caretForeground #000000 javax.swing.plaf.ColorUIResource [UI] +TextPane.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TextPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +TextPane.inactiveForeground #8b8e8f javax.swing.plaf.ColorUIResource [UI] +TextPane.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] +TextPane.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +TextPane.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +TextPaneUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- TitledBorder ---- + +TitledBorder.border [lazy] 1,1,1,1 true com.sun.java.swing.plaf.gtk.GTKPainter$TitledBorder [UI] +TitledBorder.font Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +TitledBorder.titleColor #000000 javax.swing.plaf.ColorUIResource [UI] + + +#---- ToggleButton ---- + +ToggleButton.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.border [lazy] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI] + 2,2,2,2 false javax.swing.plaf.basic.BasicBorders$ToggleButtonBorder [UI] + 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI] +ToggleButton.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ToggleButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ToggleButton.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.margin 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] +ToggleButton.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +ToggleButton.textIconGap 4 +ToggleButton.textShiftOffset 0 +ToggleButtonUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ToolBar ---- + +ToolBar.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToolBar.border [lazy] 2,2,2,2 true javax.swing.plaf.BorderUIResource$EtchedBorderUIResource [UI] +ToolBar.darkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +ToolBar.dockingBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToolBar.dockingForeground #ff0000 javax.swing.plaf.ColorUIResource [UI] +ToolBar.floatingBackground #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToolBar.floatingForeground #404040 javax.swing.plaf.ColorUIResource [UI] +ToolBar.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ToolBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ToolBar.handleIcon [active] 10,10 com.sun.java.swing.plaf.gtk.GTKIconFactory$ToolBarHandleIcon [UI] +ToolBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI] +ToolBar.light #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToolBar.separatorSize 10,10 javax.swing.plaf.DimensionUIResource [UI] +ToolBar.shadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] + + +#---- ToolBarSeparator ---- + +ToolBarSeparatorUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ToolBar ---- + +ToolBarUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ToolTip ---- + +ToolTip.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +ToolTip.border [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +ToolTip.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +ToolTip.foreground #000000 javax.swing.plaf.ColorUIResource [UI] + + +#---- ToolTipManager ---- + +ToolTipManager.enableToolTipMode allWindows + + +#---- ToolTip ---- + +ToolTipUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Tree ---- + +Tree.background #ffffff javax.swing.plaf.ColorUIResource [UI] +Tree.changeSelectionWithFocus true +Tree.collapsedIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$SynthExpanderIcon [UI] +Tree.drawHorizontalLines false +Tree.drawVerticalLines false +Tree.drawsFocusBorder true +Tree.drawsFocusBorderAroundIcon false +Tree.dropLineColor #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] +Tree.expandedIcon [lazy] 13,13 com.sun.java.swing.plaf.gtk.GTKIconFactory$SynthExpanderIcon [UI] +Tree.expanderSize 10 +Tree.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Tree.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +Tree.hash #808080 javax.swing.plaf.ColorUIResource [UI] +Tree.leftChildIndent 2 +Tree.lineTypeDashed false +Tree.padding 4 +Tree.paintLines true +Tree.repaintWholeRow true +Tree.rightChildIndent 12 +Tree.rowHeight -1 +Tree.scrollsHorizontallyAndVertically false +Tree.scrollsOnExpand false +Tree.selectionBackground #4a90d9 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionBorderColor #000000 javax.swing.plaf.ColorUIResource [UI] +Tree.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI] +Tree.textBackground #ffffff javax.swing.plaf.ColorUIResource [UI] +Tree.textForeground #000000 javax.swing.plaf.ColorUIResource [UI] +Tree.timeFactor 1000 +TreeUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- Viewport ---- + +Viewport.background #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +Viewport.font [lazy] Cantarell plain 15 javax.swing.plaf.FontUIResource [UI] +Viewport.foreground #000000 javax.swing.plaf.ColorUIResource [UI] +ViewportUI javax.swing.plaf.synth.SynthLookAndFeel + + +#---- ---- + +black #000000 javax.swing.plaf.ColorUIResource [UI] +caretColor #000000 javax.swing.plaf.ColorUIResource [UI] +control #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +controlDkShadow #000000 javax.swing.plaf.ColorUIResource [UI] +controlHighlight #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +controlLtHighlight #ffffff javax.swing.plaf.ColorUIResource [UI] +controlShadow #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +controlText #000000 javax.swing.plaf.ColorUIResource [UI] +dark #a4a4a1 javax.swing.plaf.ColorUIResource [UI] +desktop #e8e8e7 javax.swing.plaf.ColorUIResource [UI] + + +#---- html ---- + +html.missingImage [lazy] 38,38 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) +html.pendingImage [lazy] 38,38 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) + + +#---- ---- + +info #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +infoText #000000 javax.swing.plaf.ColorUIResource [UI] +light #ffffff javax.swing.plaf.ColorUIResource [UI] +menu #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +menuText #2e3436 javax.swing.plaf.ColorUIResource [UI] +mid #d2d2d0 javax.swing.plaf.ColorUIResource [UI] +scrollbar #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +text #ffffff javax.swing.plaf.ColorUIResource [UI] +textHighlight #4a90d9 javax.swing.plaf.ColorUIResource [UI] +textHighlightText #ffffff javax.swing.plaf.ColorUIResource [UI] +textInactiveText #8b8e8f javax.swing.plaf.ColorUIResource [UI] +textText #000000 javax.swing.plaf.ColorUIResource [UI] +white #ffffff javax.swing.plaf.ColorUIResource [UI] +window #e8e8e7 javax.swing.plaf.ColorUIResource [UI] +windowText #000000 javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_InputMap_1.8.0_202.txt new file mode 100644 index 00000000..73a2957a --- /dev/null +++ b/flatlaf-testing/dumps/uidefaults/GTKLookAndFeel_InputMap_1.8.0_202.txt @@ -0,0 +1,874 @@ +Class com.sun.java.swing.plaf.gtk.GTKLookAndFeel +ID GTK +Name GTK look and feel +Java 1.8.0_202 +OS Linux + + +#---- Button ---- + +Button.focusInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] + ENTER pressed + SPACE pressed + released ENTER released + released SPACE released + + +#---- CheckBox ---- + +CheckBox.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + SPACE pressed + released SPACE released + + +#---- ComboBox ---- + +ComboBox.ancestorInputMap [lazy] 15 javax.swing.plaf.InputMapUIResource [UI] + alt DOWN togglePopup + alt KP_DOWN togglePopup + alt KP_UP togglePopup + alt UP togglePopup + DOWN selectNext + END endPassThrough + ENTER enterPressed + ESCAPE hidePopup + HOME homePassThrough + KP_DOWN selectNext + KP_UP selectPrevious + PAGE_DOWN pageDownPassThrough + PAGE_UP pageUpPassThrough + SPACE spacePopup + UP selectPrevious + + +#---- Desktop ---- + +Desktop.ancestorInputMap [lazy] 29 javax.swing.plaf.InputMapUIResource [UI] + ctrl alt F6 selectNextFrame + ctrl F10 maximize + ctrl F12 navigateNext + ctrl F4 close + ctrl F5 restore + ctrl F6 selectNextFrame + ctrl F7 move + ctrl F8 resize + ctrl F9 minimize + ctrl TAB selectNextFrame + DOWN down + ESCAPE escape + KP_DOWN down + KP_LEFT left + KP_RIGHT right + KP_UP up + LEFT left + RIGHT right + UP up + shift ctrl alt F6 selectPreviousFrame + shift ctrl F12 navigatePrevious + shift DOWN shrinkDown + shift KP_DOWN shrinkDown + shift KP_LEFT shrinkLeft + shift KP_RIGHT shrinkRight + shift KP_UP shrinkUp + shift LEFT shrinkLeft + shift RIGHT shrinkRight + shift UP shrinkUp + + +#---- EditorPane ---- + +EditorPane.focusInputMap [lazy] 61 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl BACK_SPACE delete-previous-word + ctrl C copy-to-clipboard + ctrl DELETE delete-next-word + ctrl END caret-end + ctrl H delete-previous + ctrl HOME caret-begin + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-previous-word + ctrl KP_RIGHT caret-next-word + ctrl LEFT caret-previous-word + ctrl RIGHT caret-next-word + ctrl SPACE activate-link-action + ctrl T next-link-action + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + DOWN caret-down + END caret-end-line + ENTER insert-break + HOME caret-begin-line + KP_DOWN caret-down + KP_LEFT caret-backward + KP_RIGHT caret-forward + KP_UP caret-up + LEFT caret-backward + PAGE_DOWN page-down + PAGE_UP page-up + PASTE paste-from-clipboard + RIGHT caret-forward + TAB insert-tab + UP caret-up + shift ctrl END selection-end + shift ctrl HOME selection-begin + shift ctrl KP_LEFT selection-previous-word + shift ctrl KP_RIGHT selection-next-word + shift ctrl LEFT selection-previous-word + shift ctrl O toggle-componentOrientation + shift ctrl PAGE_DOWN selection-page-right + shift ctrl PAGE_UP selection-page-left + shift ctrl RIGHT selection-next-word + shift ctrl T previous-link-action + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift DOWN selection-down + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_DOWN selection-down + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift KP_UP selection-up + shift LEFT selection-backward + shift PAGE_DOWN selection-page-down + shift PAGE_UP selection-page-up + shift RIGHT selection-forward + shift UP selection-up + + +#---- FileChooser ---- + +FileChooser.ancestorInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + ctrl ENTER approveSelection + ESCAPE cancelSelection + + +#---- FormattedTextField ---- + +FormattedTextField.focusInputMap [lazy] 44 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl BACK_SPACE delete-previous-word + ctrl C copy-to-clipboard + ctrl DELETE delete-next-word + ctrl H delete-previous + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-previous-word + ctrl KP_RIGHT caret-next-word + ctrl LEFT caret-previous-word + ctrl RIGHT caret-next-word + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + DOWN decrement + END caret-end-line + ENTER notify-field-accept + ESCAPE reset-field-edit + HOME caret-begin-line + KP_DOWN decrement + KP_LEFT caret-backward + KP_RIGHT caret-forward + KP_UP increment + LEFT caret-backward + PASTE paste-from-clipboard + RIGHT caret-forward + UP increment + shift ctrl KP_LEFT selection-previous-word + shift ctrl KP_RIGHT selection-next-word + shift ctrl LEFT selection-previous-word + shift ctrl O toggle-componentOrientation + shift ctrl RIGHT selection-next-word + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift LEFT selection-backward + shift RIGHT selection-forward + + +#---- List ---- + +List.focusInputMap.RightToLeft [lazy] 16 javax.swing.plaf.InputMapUIResource [UI] + ctrl KP_LEFT selectNextColumnChangeLead + ctrl KP_RIGHT selectPreviousColumnChangeLead + ctrl LEFT selectNextColumnChangeLead + ctrl RIGHT selectPreviousColumnChangeLead + KP_LEFT selectNextColumn + KP_RIGHT selectPreviousColumn + LEFT selectNextColumn + RIGHT selectPreviousColumn + shift ctrl KP_LEFT selectNextColumnExtendSelection + shift ctrl KP_RIGHT selectPreviousColumnExtendSelection + shift ctrl LEFT selectNextColumnExtendSelection + shift ctrl RIGHT selectPreviousColumnExtendSelection + shift KP_LEFT selectNextColumnExtendSelection + shift KP_RIGHT selectPreviousColumnExtendSelection + shift LEFT selectNextColumnExtendSelection + shift RIGHT selectPreviousColumnExtendSelection +List.focusInputMap [lazy] 64 javax.swing.plaf.InputMapUIResource [UI] + ctrl A selectAll + ctrl BACK_SLASH clearSelection + ctrl C copy + ctrl DOWN selectNextRowChangeLead + ctrl END selectLastRowChangeLead + ctrl HOME selectFirstRowChangeLead + ctrl INSERT copy + ctrl KP_DOWN selectNextRowChangeLead + ctrl KP_LEFT selectPreviousColumnChangeLead + ctrl KP_RIGHT selectNextColumnChangeLead + ctrl KP_UP selectPreviousRowChangeLead + ctrl LEFT selectPreviousColumnChangeLead + ctrl PAGE_DOWN scrollDownChangeLead + ctrl PAGE_UP scrollUpChangeLead + ctrl RIGHT selectNextColumnChangeLead + ctrl SLASH selectAll + ctrl SPACE toggleAndAnchor + ctrl UP selectPreviousRowChangeLead + ctrl V paste + ctrl X cut + COPY copy + CUT cut + DOWN selectNextRow + END selectLastRow + HOME selectFirstRow + KP_DOWN selectNextRow + KP_LEFT selectPreviousColumn + KP_RIGHT selectNextColumn + KP_UP selectPreviousRow + LEFT selectPreviousColumn + PAGE_DOWN scrollDown + PAGE_UP scrollUp + PASTE paste + RIGHT selectNextColumn + SPACE addToSelection + UP selectPreviousRow + shift ctrl DOWN selectNextRowExtendSelection + shift ctrl END selectLastRowExtendSelection + shift ctrl HOME selectFirstRowExtendSelection + shift ctrl KP_DOWN selectNextRowExtendSelection + shift ctrl KP_LEFT selectPreviousColumnExtendSelection + shift ctrl KP_RIGHT selectNextColumnExtendSelection + shift ctrl KP_UP selectPreviousRowExtendSelection + shift ctrl LEFT selectPreviousColumnExtendSelection + shift ctrl PAGE_DOWN scrollDownExtendSelection + shift ctrl PAGE_UP scrollUpExtendSelection + shift ctrl RIGHT selectNextColumnExtendSelection + shift ctrl SPACE moveSelectionTo + shift ctrl UP selectPreviousRowExtendSelection + shift DELETE cut + shift DOWN selectNextRowExtendSelection + shift END selectLastRowExtendSelection + shift HOME selectFirstRowExtendSelection + shift INSERT paste + shift KP_DOWN selectNextRowExtendSelection + shift KP_LEFT selectPreviousColumnExtendSelection + shift KP_RIGHT selectNextColumnExtendSelection + shift KP_UP selectPreviousRowExtendSelection + shift LEFT selectPreviousColumnExtendSelection + shift PAGE_DOWN scrollDownExtendSelection + shift PAGE_UP scrollUpExtendSelection + shift RIGHT selectNextColumnExtendSelection + shift SPACE extendTo + shift UP selectPreviousRowExtendSelection + + +#---- PasswordField ---- + +PasswordField.focusInputMap [lazy] 37 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl C copy-to-clipboard + ctrl H delete-previous + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-begin-line + ctrl KP_RIGHT caret-end-line + ctrl LEFT caret-begin-line + ctrl RIGHT caret-end-line + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + END caret-end-line + ENTER notify-field-accept + HOME caret-begin-line + KP_LEFT caret-backward + KP_RIGHT caret-forward + LEFT caret-backward + PASTE paste-from-clipboard + RIGHT caret-forward + shift ctrl KP_LEFT selection-begin-line + shift ctrl KP_RIGHT selection-end-line + shift ctrl LEFT selection-begin-line + shift ctrl O toggle-componentOrientation + shift ctrl RIGHT selection-end-line + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift LEFT selection-backward + shift RIGHT selection-forward + + +#---- PopupMenu ---- + +PopupMenu.selectedWindowInputMapBindings.RightToLeft length=8 [Ljava.lang.Object; + [0] LEFT + [1] selectChild + [2] KP_LEFT + [3] selectChild + [4] RIGHT + [5] selectParent + [6] KP_RIGHT + [7] selectParent +PopupMenu.selectedWindowInputMapBindings length=22 [Ljava.lang.Object; + [0] ESCAPE + [1] cancel + [2] DOWN + [3] selectNext + [4] KP_DOWN + [5] selectNext + [6] UP + [7] selectPrevious + [8] KP_UP + [9] selectPrevious + [10] LEFT + [11] selectParent + [12] KP_LEFT + [13] selectParent + [14] RIGHT + [15] selectChild + [16] KP_RIGHT + [17] selectChild + [18] ENTER + [19] return + [20] SPACE + [21] return + + +#---- RadioButton ---- + +RadioButton.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + SPACE pressed + released SPACE released + + +#---- RootPane ---- + +RootPane.ancestorInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + CONTEXT_MENU postPopup + shift F10 postPopup + + +#---- ScrollBar ---- + +ScrollBar.ancestorInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] + KP_LEFT positiveUnitIncrement + KP_RIGHT negativeUnitIncrement + LEFT positiveUnitIncrement + RIGHT negativeUnitIncrement +ScrollBar.ancestorInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] + DOWN positiveUnitIncrement + END maxScroll + HOME minScroll + KP_DOWN positiveUnitIncrement + KP_LEFT negativeUnitIncrement + KP_RIGHT positiveUnitIncrement + KP_UP negativeUnitIncrement + LEFT negativeUnitIncrement + PAGE_DOWN positiveBlockIncrement + PAGE_UP negativeBlockIncrement + RIGHT positiveUnitIncrement + UP negativeUnitIncrement + + +#---- ScrollPane ---- + +ScrollPane.ancestorInputMap.RightToLeft [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + ctrl PAGE_DOWN scrollLeft + ctrl PAGE_UP scrollRight +ScrollPane.ancestorInputMap [lazy] 14 javax.swing.plaf.InputMapUIResource [UI] + ctrl END scrollEnd + ctrl HOME scrollHome + ctrl PAGE_DOWN scrollRight + ctrl PAGE_UP scrollLeft + DOWN unitScrollDown + KP_DOWN unitScrollDown + KP_LEFT unitScrollLeft + KP_RIGHT unitScrollRight + KP_UP unitScrollUp + LEFT unitScrollLeft + PAGE_DOWN scrollDown + PAGE_UP scrollUp + RIGHT unitScrollRight + UP unitScrollUp + + +#---- Slider ---- + +Slider.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] + KP_LEFT positiveUnitIncrement + KP_RIGHT negativeUnitIncrement + LEFT positiveUnitIncrement + RIGHT negativeUnitIncrement +Slider.focusInputMap [lazy] 12 javax.swing.plaf.InputMapUIResource [UI] + DOWN negativeUnitIncrement + END maxScroll + HOME minScroll + KP_DOWN negativeUnitIncrement + KP_LEFT negativeUnitIncrement + KP_RIGHT positiveUnitIncrement + KP_UP positiveUnitIncrement + LEFT negativeUnitIncrement + PAGE_DOWN negativeBlockIncrement + PAGE_UP positiveBlockIncrement + RIGHT positiveUnitIncrement + UP positiveUnitIncrement + + +#---- Spinner ---- + +Spinner.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] + DOWN decrement + KP_DOWN decrement + KP_UP increment + UP increment + + +#---- SplitPane ---- + +SplitPane.ancestorInputMap [lazy] 14 javax.swing.plaf.InputMapUIResource [UI] + ctrl TAB focusOutForward + DOWN positiveIncrement + END selectMax + F6 toggleFocus + F8 startResize + HOME selectMin + KP_DOWN positiveIncrement + KP_LEFT negativeIncrement + KP_RIGHT positiveIncrement + KP_UP negativeIncrement + LEFT negativeIncrement + RIGHT positiveIncrement + UP negativeIncrement + shift ctrl TAB focusOutBackward + + +#---- TabbedPane ---- + +TabbedPane.ancestorInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI] + ctrl KP_UP requestFocus + ctrl PAGE_DOWN navigatePageDown + ctrl PAGE_UP navigatePageUp + ctrl TAB navigateNext + ctrl UP requestFocus + shift ctrl TAB navigatePrevious +TabbedPane.focusInputMap [lazy] 11 javax.swing.plaf.InputMapUIResource [UI] + ctrl DOWN requestFocusForVisibleComponent + ctrl KP_DOWN requestFocusForVisibleComponent + DOWN navigateDown + KP_DOWN navigateDown + KP_LEFT navigateLeft + KP_RIGHT navigateRight + KP_UP navigateUp + LEFT navigateLeft + RIGHT navigateRight + SPACE selectTabWithFocus + UP navigateUp + + +#---- Table ---- + +Table.ancestorInputMap.RightToLeft [lazy] 18 javax.swing.plaf.InputMapUIResource [UI] + ctrl KP_LEFT selectNextColumnChangeLead + ctrl LEFT selectNextColumnChangeLead + ctrl PAGE_DOWN scrollLeftChangeSelection + ctrl PAGE_UP scrollRightChangeSelection + KP_LEFT selectNextColumn + KP_RIGHT selectPreviousColumn + LEFT selectNextColumn + RIGHT selectPreviousColumn + shift ctrl KP_LEFT selectNextColumnExtendSelection + shift ctrl KP_RIGHT selectPreviousColumnExtendSelection + shift ctrl LEFT selectNextColumnExtendSelection + shift ctrl PAGE_DOWN scrollLeftExtendSelection + shift ctrl PAGE_UP scrollRightExtendSelection + shift ctrl RIGHT selectPreviousColumnExtendSelection + shift KP_LEFT selectNextColumnExtendSelection + shift KP_RIGHT selectPreviousColumnChangeLead + shift LEFT selectNextColumnExtendSelection + shift RIGHT selectPreviousColumnChangeLead +Table.ancestorInputMap [lazy] 71 javax.swing.plaf.InputMapUIResource [UI] + ctrl A selectAll + ctrl BACK_SLASH clearSelection + ctrl C copy + ctrl DOWN selectNextRowChangeLead + ctrl END selectLastRow + ctrl HOME selectFirstRow + ctrl INSERT copy + ctrl KP_DOWN selectNextRowChangeLead + ctrl KP_LEFT selectPreviousColumnChangeLead + ctrl KP_RIGHT selectNextColumnChangeLead + ctrl KP_UP selectPreviousRowChangeLead + ctrl LEFT selectPreviousColumnChangeLead + ctrl PAGE_DOWN scrollRightChangeSelection + ctrl PAGE_UP scrollLeftChangeSelection + ctrl RIGHT selectNextColumnChangeLead + ctrl SLASH selectAll + ctrl SPACE toggleAndAnchor + ctrl UP selectPreviousRowChangeLead + ctrl V paste + ctrl X cut + COPY copy + CUT cut + DOWN selectNextRow + END selectLastColumn + ENTER selectNextRowCell + ESCAPE cancel + F2 startEditing + F8 focusHeader + HOME selectFirstColumn + KP_DOWN selectNextRow + KP_LEFT selectPreviousColumn + KP_RIGHT selectNextColumn + KP_UP selectPreviousRow + LEFT selectPreviousColumn + PAGE_DOWN scrollDownChangeSelection + PAGE_UP scrollUpChangeSelection + PASTE paste + RIGHT selectNextColumn + SPACE addToSelection + TAB selectNextColumnCell + UP selectPreviousRow + shift ctrl DOWN selectNextRowExtendSelection + shift ctrl END selectLastRowExtendSelection + shift ctrl HOME selectFirstRowExtendSelection + shift ctrl KP_DOWN selectNextRowExtendSelection + shift ctrl KP_LEFT selectPreviousColumnExtendSelection + shift ctrl KP_RIGHT selectNextColumnExtendSelection + shift ctrl KP_UP selectPreviousRowExtendSelection + shift ctrl LEFT selectPreviousColumnExtendSelection + shift ctrl PAGE_DOWN scrollRightExtendSelection + shift ctrl PAGE_UP scrollLeftExtendSelection + shift ctrl RIGHT selectNextColumnExtendSelection + shift ctrl SPACE moveSelectionTo + shift ctrl UP selectPreviousRowExtendSelection + shift DELETE cut + shift DOWN selectNextRowExtendSelection + shift END selectLastColumnExtendSelection + shift ENTER selectPreviousRowCell + shift HOME selectFirstColumnExtendSelection + shift INSERT paste + shift KP_DOWN selectNextRowExtendSelection + shift KP_LEFT selectPreviousColumnExtendSelection + shift KP_RIGHT selectNextColumnExtendSelection + shift KP_UP selectPreviousRowExtendSelection + shift LEFT selectPreviousColumnExtendSelection + shift PAGE_DOWN scrollDownExtendSelection + shift PAGE_UP scrollUpExtendSelection + shift RIGHT selectNextColumnExtendSelection + shift SPACE extendTo + shift TAB selectPreviousColumnCell + shift UP selectPreviousRowExtendSelection + + +#---- TableHeader ---- + +TableHeader.ancestorInputMap [lazy] 14 javax.swing.plaf.InputMapUIResource [UI] + alt KP_LEFT moveColumnLeft + alt KP_RIGHT moveColumnRight + alt LEFT moveColumnLeft + alt RIGHT moveColumnRight + ESCAPE focusTable + KP_LEFT selectColumnToLeft + KP_RIGHT selectColumnToRight + LEFT selectColumnToLeft + RIGHT selectColumnToRight + SPACE toggleSortOrder + shift alt KP_LEFT resizeLeft + shift alt KP_RIGHT resizeRight + shift alt LEFT resizeLeft + shift alt RIGHT resizeRight + + +#---- TextArea ---- + +TextArea.focusInputMap [lazy] 61 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl BACK_SPACE delete-previous-word + ctrl C copy-to-clipboard + ctrl DELETE delete-next-word + ctrl END caret-end + ctrl H delete-previous + ctrl HOME caret-begin + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-previous-word + ctrl KP_RIGHT caret-next-word + ctrl LEFT caret-previous-word + ctrl RIGHT caret-next-word + ctrl SPACE activate-link-action + ctrl T next-link-action + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + DOWN caret-down + END caret-end-line + ENTER insert-break + HOME caret-begin-line + KP_DOWN caret-down + KP_LEFT caret-backward + KP_RIGHT caret-forward + KP_UP caret-up + LEFT caret-backward + PAGE_DOWN page-down + PAGE_UP page-up + PASTE paste-from-clipboard + RIGHT caret-forward + TAB insert-tab + UP caret-up + shift ctrl END selection-end + shift ctrl HOME selection-begin + shift ctrl KP_LEFT selection-previous-word + shift ctrl KP_RIGHT selection-next-word + shift ctrl LEFT selection-previous-word + shift ctrl O toggle-componentOrientation + shift ctrl PAGE_DOWN selection-page-right + shift ctrl PAGE_UP selection-page-left + shift ctrl RIGHT selection-next-word + shift ctrl T previous-link-action + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift DOWN selection-down + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_DOWN selection-down + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift KP_UP selection-up + shift LEFT selection-backward + shift PAGE_DOWN selection-page-down + shift PAGE_UP selection-page-up + shift RIGHT selection-forward + shift UP selection-up + + +#---- TextField ---- + +TextField.focusInputMap [lazy] 39 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl BACK_SPACE delete-previous-word + ctrl C copy-to-clipboard + ctrl DELETE delete-next-word + ctrl H delete-previous + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-previous-word + ctrl KP_RIGHT caret-next-word + ctrl LEFT caret-previous-word + ctrl RIGHT caret-next-word + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + END caret-end-line + ENTER notify-field-accept + HOME caret-begin-line + KP_LEFT caret-backward + KP_RIGHT caret-forward + LEFT caret-backward + PASTE paste-from-clipboard + RIGHT caret-forward + shift ctrl KP_LEFT selection-previous-word + shift ctrl KP_RIGHT selection-next-word + shift ctrl LEFT selection-previous-word + shift ctrl O toggle-componentOrientation + shift ctrl RIGHT selection-next-word + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift LEFT selection-backward + shift RIGHT selection-forward + + +#---- TextPane ---- + +TextPane.focusInputMap [lazy] 61 javax.swing.plaf.InputMapUIResource [UI] + ctrl A select-all + ctrl BACK_SLASH unselect + ctrl BACK_SPACE delete-previous-word + ctrl C copy-to-clipboard + ctrl DELETE delete-next-word + ctrl END caret-end + ctrl H delete-previous + ctrl HOME caret-begin + ctrl INSERT copy-to-clipboard + ctrl KP_LEFT caret-previous-word + ctrl KP_RIGHT caret-next-word + ctrl LEFT caret-previous-word + ctrl RIGHT caret-next-word + ctrl SPACE activate-link-action + ctrl T next-link-action + ctrl V paste-from-clipboard + ctrl X cut-to-clipboard + BACK_SPACE delete-previous + COPY copy-to-clipboard + CUT cut-to-clipboard + DELETE delete-next + DOWN caret-down + END caret-end-line + ENTER insert-break + HOME caret-begin-line + KP_DOWN caret-down + KP_LEFT caret-backward + KP_RIGHT caret-forward + KP_UP caret-up + LEFT caret-backward + PAGE_DOWN page-down + PAGE_UP page-up + PASTE paste-from-clipboard + RIGHT caret-forward + TAB insert-tab + UP caret-up + shift ctrl END selection-end + shift ctrl HOME selection-begin + shift ctrl KP_LEFT selection-previous-word + shift ctrl KP_RIGHT selection-next-word + shift ctrl LEFT selection-previous-word + shift ctrl O toggle-componentOrientation + shift ctrl PAGE_DOWN selection-page-right + shift ctrl PAGE_UP selection-page-left + shift ctrl RIGHT selection-next-word + shift ctrl T previous-link-action + shift BACK_SPACE delete-previous + shift DELETE cut-to-clipboard + shift DOWN selection-down + shift END selection-end-line + shift HOME selection-begin-line + shift INSERT paste-from-clipboard + shift KP_DOWN selection-down + shift KP_LEFT selection-backward + shift KP_RIGHT selection-forward + shift KP_UP selection-up + shift LEFT selection-backward + shift PAGE_DOWN selection-page-down + shift PAGE_UP selection-page-up + shift RIGHT selection-forward + shift UP selection-up + + +#---- ToggleButton ---- + +ToggleButton.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI] + SPACE pressed + released SPACE released + + +#---- ToolBar ---- + +ToolBar.ancestorInputMap [lazy] 8 javax.swing.plaf.InputMapUIResource [UI] + DOWN navigateDown + KP_DOWN navigateDown + KP_LEFT navigateLeft + KP_RIGHT navigateRight + KP_UP navigateUp + LEFT navigateLeft + RIGHT navigateRight + UP navigateUp + + +#---- Tree ---- + +Tree.ancestorInputMap [lazy] 1 javax.swing.plaf.InputMapUIResource [UI] + ESCAPE cancel +Tree.focusInputMap.RightToLeft [lazy] 4 javax.swing.plaf.InputMapUIResource [UI] + KP_LEFT selectChild + KP_RIGHT selectParent + LEFT selectChild + RIGHT selectParent +Tree.focusInputMap [lazy] 60 javax.swing.plaf.InputMapUIResource [UI] + ctrl A selectAll + ctrl BACK_SLASH clearSelection + ctrl C copy + ctrl DOWN selectNextChangeLead + ctrl END selectLastChangeLead + ctrl HOME selectFirstChangeLead + ctrl INSERT copy + ctrl KP_DOWN selectNextChangeLead + ctrl KP_LEFT scrollLeft + ctrl KP_RIGHT scrollRight + ctrl KP_UP selectPreviousChangeLead + ctrl LEFT scrollLeft + ctrl PAGE_DOWN scrollDownChangeLead + ctrl PAGE_UP scrollUpChangeLead + ctrl RIGHT scrollRight + ctrl SLASH selectAll + ctrl SPACE toggleAndAnchor + ctrl UP selectPreviousChangeLead + ctrl V paste + ctrl X cut + BACK_SPACE moveSelectionToParent + COPY copy + CUT cut + DOWN selectNext + END selectLast + F2 startEditing + HOME selectFirst + KP_DOWN selectNext + KP_LEFT selectParent + KP_RIGHT selectChild + KP_UP selectPrevious + LEFT selectParent + PAGE_DOWN scrollDownChangeSelection + PAGE_UP scrollUpChangeSelection + PASTE paste + RIGHT selectChild + SPACE addToSelection + UP selectPrevious + shift ctrl DOWN selectNextExtendSelection + shift ctrl END selectLastExtendSelection + shift ctrl HOME selectFirstExtendSelection + shift ctrl KP_DOWN selectNextExtendSelection + shift ctrl KP_UP selectPreviousExtendSelection + shift ctrl PAGE_DOWN scrollDownExtendSelection + shift ctrl PAGE_UP scrollUpExtendSelection + shift ctrl SPACE moveSelectionTo + shift ctrl UP selectPreviousExtendSelection + shift DELETE cut + shift DOWN selectNextExtendSelection + shift END selectLastExtendSelection + shift HOME selectFirstExtendSelection + shift INSERT paste + shift KP_DOWN selectNextExtendSelection + shift KP_UP selectPreviousExtendSelection + shift PAGE_DOWN scrollDownExtendSelection + shift PAGE_UP scrollUpExtendSelection + shift SPACE extendTo + shift UP selectPreviousExtendSelection + typed + expand + typed - collapse diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_11.0.2.txt b/flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_11.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_11.0.2.txt rename to flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_11.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_9.0.4.txt b/flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_9.0.4.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_9.0.4.txt rename to flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_9.0.4.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_InputMap_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/MetalLookAndFeel_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/MetalLookAndFeel_InputMap_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_10.0.2.txt b/flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_10.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_10.0.2.txt rename to flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_10.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_9.0.4.txt b/flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_9.0.4.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_9.0.4.txt rename to flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_9.0.4.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_InputMap_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_InputMap_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_InputMap_10.0.2.txt b/flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_InputMap_10.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/NimbusLookAndFeel_InputMap_10.0.2.txt rename to flatlaf-testing/dumps/uidefaults/NimbusLookAndFeel_InputMap_10.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_11.0.2.txt b/flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_11.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_11.0.2.txt rename to flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_11.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_12.0.2.txt b/flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_12.0.2.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_12.0.2.txt rename to flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_12.0.2.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_9.0.4.txt b/flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_9.0.4.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_9.0.4.txt rename to flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_9.0.4.txt diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_InputMap_1.8.0_202.txt b/flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_InputMap_1.8.0_202.txt similarity index 100% rename from flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/WindowsLookAndFeel_InputMap_1.8.0_202.txt rename to flatlaf-testing/dumps/uidefaults/WindowsLookAndFeel_InputMap_1.8.0_202.txt diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.java new file mode 100644 index 00000000..831a132d --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.java @@ -0,0 +1,124 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.*; +import javax.swing.*; +import com.formdev.flatlaf.util.Animator; +import com.formdev.flatlaf.util.CubicBezierEasing; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatAnimatorTest + extends FlatTestPanel +{ + private Animator linearAnimator; + private Animator easeInOutAnimator; + + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatAnimatorTest" ); + frame.showFrame( FlatAnimatorTest::new ); + } ); + } + + FlatAnimatorTest() { + initComponents(); + } + + private void start() { + startLinear(); + startEaseInOut(); + } + + private void startLinear() { + if( linearAnimator != null ) { + linearAnimator.stop(); + linearAnimator.start(); + } else { + linearAnimator = new Animator( 1000, fraction -> { + linearScrollBar.setValue( Math.round( fraction * linearScrollBar.getMaximum() ) ); + } ); + linearAnimator.start(); + } + } + + private void startEaseInOut() { + if( easeInOutAnimator != null ) { + easeInOutAnimator.stop(); + easeInOutAnimator.start(); + } else { + easeInOutAnimator = new Animator( 1000, fraction -> { + easeInOutScrollBar.setValue( Math.round( fraction * easeInOutScrollBar.getMaximum() ) ); + } ); + easeInOutAnimator.setInterpolator( CubicBezierEasing.EASE_IN_OUT ); + easeInOutAnimator.start(); + } + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JLabel label1 = new JLabel(); + linearScrollBar = new JScrollBar(); + JLabel label2 = new JLabel(); + easeInOutScrollBar = new JScrollBar(); + startButton = new JButton(); + + //======== this ======== + setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[fill]" + + "[grow,fill]", + // rows + "[]" + + "[]" + + "[]")); + + //---- label1 ---- + label1.setText("Linear:"); + add(label1, "cell 0 0"); + + //---- linearScrollBar ---- + linearScrollBar.setOrientation(Adjustable.HORIZONTAL); + linearScrollBar.setBlockIncrement(1); + add(linearScrollBar, "cell 1 0"); + + //---- label2 ---- + label2.setText("Ease in out:"); + add(label2, "cell 0 1"); + + //---- easeInOutScrollBar ---- + easeInOutScrollBar.setOrientation(Adjustable.HORIZONTAL); + easeInOutScrollBar.setBlockIncrement(1); + add(easeInOutScrollBar, "cell 1 1"); + + //---- startButton ---- + startButton.setText("Start"); + startButton.addActionListener(e -> start()); + add(startButton, "cell 0 2"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JScrollBar linearScrollBar; + private JScrollBar easeInOutScrollBar; + private JButton startButton; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.jfd new file mode 100644 index 00000000..bb92a129 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatorTest.jfd @@ -0,0 +1,62 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14.0.2" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$columnConstraints": "[fill][grow,fill]" + "$rowConstraints": "[][][]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "Linear:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JScrollBar" ) { + name: "linearScrollBar" + "orientation": 0 + "blockIncrement": 1 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "Ease in out:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JScrollBar" ) { + name: "easeInOutScrollBar" + "orientation": 0 + "blockIncrement": 1 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "startButton" + "text": "Start" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "start", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 415, 350 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.java index 0d1b7328..0a4b5b1b 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.java @@ -59,10 +59,10 @@ public class FlatChooserTest "ltr,insets dialog,hidemode 3", // columns "[]" + - "[]", + "[grow]", // rows "[top]" + - "[top]" + + "[grow,fill]" + "[]")); //---- colorChooserLabel ---- @@ -73,7 +73,7 @@ public class FlatChooserTest //---- fileChooserLabel ---- fileChooserLabel.setText("JFileChooser:"); add(fileChooserLabel, "cell 0 1"); - add(fileChooser1, "cell 1 1"); + add(fileChooser1, "cell 1 1,growx"); //---- label1 ---- label1.setText("icons:"); diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.jfd index d304aa13..7cb82d64 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatChooserTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -8,8 +8,8 @@ new FormModel { } add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" - "$columnConstraints": "[][]" - "$rowConstraints": "[top][top][]" + "$columnConstraints": "[][grow]" + "$rowConstraints": "[top][grow,fill][]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -32,7 +32,7 @@ new FormModel { add( new FormComponent( "javax.swing.JFileChooser" ) { name: "fileChooser1" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" + "value": "cell 1 1,growx" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label1" diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.java index 56d3f67c..dc01cd27 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.java @@ -16,11 +16,21 @@ package com.formdev.flatlaf.testing; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; import javax.swing.*; import javax.swing.table.*; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; import com.formdev.flatlaf.icons.FlatMenuArrowIcon; import net.miginfocom.swing.*; @@ -37,8 +47,78 @@ public class FlatComponents2Test } ); } + private final TestListModel listModel; + private final TestTreeModel treeModel; + private final TestTableModel tableModel; + FlatComponents2Test() { initComponents(); + + // list model + listModel = new TestListModel( (Integer) listRowCountSpinner.getValue() ); + list1.setModel( listModel ); + list2.setModel( listModel ); + + // tree model + treeModel = new TestTreeModel( (Integer) treeRowCountSpinner.getValue() ); + tree1.setModel( treeModel ); + tree2.setModel( treeModel ); + + // table model + tableModel = new TestTableModel( (Integer) tableRowCountSpinner.getValue() ); + table1.setModel( tableModel ); + + // table column editors + TableColumnModel cm = table1.getColumnModel(); + String[] months = new String[] { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }; + cm.getColumn(2).setCellEditor( new DefaultCellEditor( new JComboBox<>( months ) ) ); + JComboBox editableComboBox = new JComboBox<>( months ); + editableComboBox.setEditable( true ); + cm.getColumn(3).setCellEditor( new DefaultCellEditor( editableComboBox ) ); + + expandTree( tree1 ); + expandTree( tree2 ); + } + + private void expandTree( JTree tree ) { + int count = tree.getRowCount(); + for( int i = count - 1; i >= 0; i-- ) + tree.expandRow( i ); + } + + private void listRowCountChanged() { + listModel.setSize( (Integer) listRowCountSpinner.getValue() ); + } + + private void treeRowCountChanged() { + int rowCount = (Integer) treeRowCountSpinner.getValue(); + + // round to 20 + if( rowCount % 20 != 0 ) { + rowCount += 20 - (rowCount % 20); + treeRowCountSpinner.setValue( rowCount ); + } + + int oldCount1 = tree1.getRowCount(); + int oldCount2 = tree2.getRowCount(); + + treeModel.setRowCount( rowCount ); + + int newCount1 = tree1.getRowCount(); + int newCount2 = tree2.getRowCount(); + + // expand added rows + for( int i = newCount1 - 1; i >= oldCount1; i-- ) + tree1.expandRow( i ); + for( int i = newCount2 - 1; i >= oldCount2; i-- ) + tree2.expandRow( i ); + } + + private void tableRowCountChanged() { + tableModel.setRowCount( (Integer) tableRowCountSpinner.getValue() ); } private void dndChanged() { @@ -83,7 +163,41 @@ public class FlatComponents2Test scrollPane5.setCorner( JScrollPane.UPPER_TRAILING_CORNER, button ); } - @SuppressWarnings( { "unchecked", "rawtypes" } ) + private void rowSelectionChanged() { + table1.setRowSelectionAllowed( rowSelectionCheckBox.isSelected() ); + } + + private void columnSelectionChanged() { + table1.setColumnSelectionAllowed( columnSelectionCheckBox.isSelected() ); + } + + private void showHorizontalLinesChanged() { + table1.setShowHorizontalLines( showHorizontalLinesCheckBox.isSelected() ); + } + + private void showVerticalLinesChanged() { + table1.setShowVerticalLines( showVerticalLinesCheckBox.isSelected() ); + } + + private void intercellSpacingChanged() { + table1.setIntercellSpacing( intercellSpacingCheckBox.isSelected() ? new Dimension( 1, 1 ) : new Dimension() ); + } + + private void redGridColorChanged() { + table1.setGridColor( redGridColorCheckBox.isSelected() ? Color.red : UIManager.getColor( "Table.gridColor" ) ); + } + + @Override + public void updateUI() { + super.updateUI(); + + EventQueue.invokeLater( () -> { + showHorizontalLinesChanged(); + showVerticalLinesChanged(); + intercellSpacingChanged(); + } ); + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JLabel textFieldLabel = new JLabel(); @@ -94,14 +208,29 @@ public class FlatComponents2Test list1 = new JList<>(); JScrollPane scrollPane2 = new JScrollPane(); list2 = new JList<>(); + JPanel listOptionsPanel = new JPanel(); + JLabel listRowCountLabel = new JLabel(); + listRowCountSpinner = new JSpinner(); JLabel treeLabel = new JLabel(); JScrollPane scrollPane3 = new JScrollPane(); tree1 = new JTree(); JScrollPane scrollPane4 = new JScrollPane(); tree2 = new JTree(); + JPanel treeOptionsPanel = new JPanel(); + JLabel treeRowCountLabel = new JLabel(); + treeRowCountSpinner = new JSpinner(); JLabel tableLabel = new JLabel(); scrollPane5 = new JScrollPane(); table1 = new JTable(); + JPanel tableOptionsPanel = new JPanel(); + JLabel tableRowCountLabel = new JLabel(); + tableRowCountSpinner = new JSpinner(); + showHorizontalLinesCheckBox = new JCheckBox(); + showVerticalLinesCheckBox = new JCheckBox(); + intercellSpacingCheckBox = new JCheckBox(); + redGridColorCheckBox = new JCheckBox(); + rowSelectionCheckBox = new JCheckBox(); + columnSelectionCheckBox = new JCheckBox(); dndCheckBox = new JCheckBox(); tableHeaderButtonCheckBox = new JCheckBox(); @@ -110,14 +239,14 @@ public class FlatComponents2Test "ltr,insets dialog,hidemode 3", // columns "[]" + - "[200]" + - "[200]", + "[200,fill]" + + "[200,fill]" + + "[fill]", // rows "[]" + - "[]" + - "[::200]" + - "[150,grow]" + - "[]")); + "[150,grow,sizegroup 1,fill]" + + "[150,grow,sizegroup 1,fill]" + + "[150,grow,sizegroup 1,fill]")); //---- textFieldLabel ---- textFieldLabel.setText("JTextField:"); @@ -134,74 +263,47 @@ public class FlatComponents2Test //---- listLabel ---- listLabel.setText("JList:"); - add(listLabel, "cell 0 1"); + add(listLabel, "cell 0 1,aligny top,growy 0"); //======== scrollPane1 ======== { - - //---- list1 ---- - list1.setModel(new AbstractListModel() { - String[] values = { - "item 1", - "item 2", - "item 3", - "item 4", - "item 5", - "item 6", - "item 7", - "item 8", - "item 9", - "item 10", - "item 11", - "item 12", - "item 13", - "item 14", - "item 15" - }; - @Override - public int getSize() { return values.length; } - @Override - public String getElementAt(int i) { return values[i]; } - }); scrollPane1.setViewportView(list1); } - add(scrollPane1, "cell 1 1,growx"); + add(scrollPane1, "cell 1 1"); //======== scrollPane2 ======== { //---- list2 ---- - list2.setModel(new AbstractListModel() { - String[] values = { - "item 1", - "item 2", - "item 3", - "item 4", - "item 5", - "item 6", - "item 7", - "item 8", - "item 9", - "item 10", - "item 11", - "item 12", - "item 13", - "item 14", - "item 15" - }; - @Override - public int getSize() { return values.length; } - @Override - public String getElementAt(int i) { return values[i]; } - }); list2.setEnabled(false); scrollPane2.setViewportView(list2); } - add(scrollPane2, "cell 2 1,growx"); + add(scrollPane2, "cell 2 1"); + + //======== listOptionsPanel ======== + { + listOptionsPanel.setLayout(new MigLayout( + "hidemode 3", + // columns + "[fill]" + + "[90,fill]", + // rows + "[]")); + + //---- listRowCountLabel ---- + listRowCountLabel.setText("Row count:"); + listOptionsPanel.add(listRowCountLabel, "cell 0 0"); + + //---- listRowCountSpinner ---- + listRowCountSpinner.setModel(new SpinnerNumberModel(20, 0, null, 10)); + listRowCountSpinner.addChangeListener(e -> listRowCountChanged()); + listOptionsPanel.add(listRowCountSpinner, "cell 1 0"); + } + add(listOptionsPanel, "cell 3 1"); //---- treeLabel ---- treeLabel.setText("JTree:"); - add(treeLabel, "cell 0 2"); + add(treeLabel, "cell 0 2,aligny top,growy 0"); //======== scrollPane3 ======== { @@ -211,7 +313,7 @@ public class FlatComponents2Test tree1.setEditable(true); scrollPane3.setViewportView(tree1); } - add(scrollPane3, "cell 1 2,growx"); + add(scrollPane3, "cell 1 2"); //======== scrollPane4 ======== { @@ -220,114 +322,156 @@ public class FlatComponents2Test tree2.setEnabled(false); scrollPane4.setViewportView(tree2); } - add(scrollPane4, "cell 2 2,growx"); + add(scrollPane4, "cell 2 2"); + + //======== treeOptionsPanel ======== + { + treeOptionsPanel.setLayout(new MigLayout( + "hidemode 3", + // columns + "[fill]" + + "[90,fill]", + // rows + "[]")); + + //---- treeRowCountLabel ---- + treeRowCountLabel.setText("Row count:"); + treeOptionsPanel.add(treeRowCountLabel, "cell 0 0"); + + //---- treeRowCountSpinner ---- + treeRowCountSpinner.setModel(new SpinnerNumberModel(20, 20, null, 20)); + treeRowCountSpinner.addChangeListener(e -> treeRowCountChanged()); + treeOptionsPanel.add(treeRowCountSpinner, "cell 1 0"); + } + add(treeOptionsPanel, "cell 3 2"); //---- tableLabel ---- tableLabel.setText("JTable:"); - add(tableLabel, "cell 0 3"); + add(tableLabel, "cell 0 3,aligny top,growy 0"); //======== scrollPane5 ======== { //---- table1 ---- - table1.setModel(new DefaultTableModel( - new Object[][] { - {"item 1", "item 1b", "January", "July", 123, null}, - {"item 2", "item 2b", "February", "August", 456, true}, - {"item 3", null, "March", null, null, null}, - {"item 4", null, "April", null, null, null}, - {"item 5", null, "May", null, null, null}, - {"item 6", null, "June", null, null, null}, - {"item 7", null, "July", null, null, null}, - {"item 8", null, "August", null, null, null}, - {"item 9", null, "September", null, null, null}, - {"item 10", null, "October", null, null, null}, - {"item 11", null, "November", null, null, null}, - {"item 12", null, "December", null, null, null}, - }, - new String[] { - "Not editable", "Text", "Combo", "Combo Editable", "Integer", "Boolean" - } - ) { - Class[] columnTypes = new Class[] { - Object.class, Object.class, String.class, String.class, Integer.class, Boolean.class - }; - boolean[] columnEditable = new boolean[] { - false, true, true, true, true, true - }; - @Override - public Class getColumnClass(int columnIndex) { - return columnTypes[columnIndex]; - } - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - return columnEditable[columnIndex]; - } - }); - { - TableColumnModel cm = table1.getColumnModel(); - cm.getColumn(2).setCellEditor(new DefaultCellEditor( - new JComboBox(new DefaultComboBoxModel(new String[] { - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - })))); - cm.getColumn(3).setCellEditor(new DefaultCellEditor( - new JComboBox(new DefaultComboBoxModel(new String[] { - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - })))); - } table1.setAutoCreateRowSorter(true); scrollPane5.setViewportView(table1); } - add(scrollPane5, "cell 1 3 2 1,growx,width 300"); + add(scrollPane5, "cell 1 3 2 1,width 300"); - //---- dndCheckBox ---- - dndCheckBox.setText("enable drag and drop"); - dndCheckBox.setMnemonic('D'); - dndCheckBox.addActionListener(e -> dndChanged()); - add(dndCheckBox, "cell 0 4 3 1"); + //======== tableOptionsPanel ======== + { + tableOptionsPanel.setLayout(new MigLayout( + "hidemode 3", + // columns + "[]" + + "[90,fill]", + // rows + "[]" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]")); - //---- tableHeaderButtonCheckBox ---- - tableHeaderButtonCheckBox.setText("show button in table header"); - tableHeaderButtonCheckBox.addActionListener(e -> tableHeaderButtonChanged()); - add(tableHeaderButtonCheckBox, "cell 0 4 3 1"); + //---- tableRowCountLabel ---- + tableRowCountLabel.setText("Row count:"); + tableOptionsPanel.add(tableRowCountLabel, "cell 0 0"); + + //---- tableRowCountSpinner ---- + tableRowCountSpinner.setModel(new SpinnerNumberModel(20, 0, null, 10)); + tableRowCountSpinner.addChangeListener(e -> tableRowCountChanged()); + tableOptionsPanel.add(tableRowCountSpinner, "cell 1 0"); + + //---- showHorizontalLinesCheckBox ---- + showHorizontalLinesCheckBox.setText("show horizontal lines"); + showHorizontalLinesCheckBox.addActionListener(e -> showHorizontalLinesChanged()); + tableOptionsPanel.add(showHorizontalLinesCheckBox, "cell 0 1 2 1"); + + //---- showVerticalLinesCheckBox ---- + showVerticalLinesCheckBox.setText("show vertical lines"); + showVerticalLinesCheckBox.addActionListener(e -> showVerticalLinesChanged()); + tableOptionsPanel.add(showVerticalLinesCheckBox, "cell 0 2 2 1"); + + //---- intercellSpacingCheckBox ---- + intercellSpacingCheckBox.setText("intercell spacing"); + intercellSpacingCheckBox.addActionListener(e -> intercellSpacingChanged()); + tableOptionsPanel.add(intercellSpacingCheckBox, "cell 0 3 2 1"); + + //---- redGridColorCheckBox ---- + redGridColorCheckBox.setText("red grid color"); + redGridColorCheckBox.addActionListener(e -> redGridColorChanged()); + tableOptionsPanel.add(redGridColorCheckBox, "cell 0 4 2 1"); + + //---- rowSelectionCheckBox ---- + rowSelectionCheckBox.setText("row selection"); + rowSelectionCheckBox.setSelected(true); + rowSelectionCheckBox.addActionListener(e -> rowSelectionChanged()); + tableOptionsPanel.add(rowSelectionCheckBox, "cell 0 5 2 1"); + + //---- columnSelectionCheckBox ---- + columnSelectionCheckBox.setText("column selection"); + columnSelectionCheckBox.addActionListener(e -> columnSelectionChanged()); + tableOptionsPanel.add(columnSelectionCheckBox, "cell 0 6 2 1"); + + //---- dndCheckBox ---- + dndCheckBox.setText("enable drag and drop"); + dndCheckBox.setMnemonic('D'); + dndCheckBox.addActionListener(e -> dndChanged()); + tableOptionsPanel.add(dndCheckBox, "cell 0 7 2 1"); + + //---- tableHeaderButtonCheckBox ---- + tableHeaderButtonCheckBox.setText("show button in table header"); + tableHeaderButtonCheckBox.addActionListener(e -> tableHeaderButtonChanged()); + tableOptionsPanel.add(tableHeaderButtonCheckBox, "cell 0 8 2 1"); + } + add(tableOptionsPanel, "cell 3 3"); // JFormDesigner - End of component initialization //GEN-END:initComponents - - ((JComboBox)((DefaultCellEditor)table1.getColumnModel().getColumn( 3 ).getCellEditor()).getComponent()).setEditable( true ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables private JList list1; private JList list2; + private JSpinner listRowCountSpinner; private JTree tree1; private JTree tree2; + private JSpinner treeRowCountSpinner; private JScrollPane scrollPane5; private JTable table1; + private JSpinner tableRowCountSpinner; + private JCheckBox showHorizontalLinesCheckBox; + private JCheckBox showVerticalLinesCheckBox; + private JCheckBox intercellSpacingCheckBox; + private JCheckBox redGridColorCheckBox; + private JCheckBox rowSelectionCheckBox; + private JCheckBox columnSelectionCheckBox; private JCheckBox dndCheckBox; private JCheckBox tableHeaderButtonCheckBox; // JFormDesigner - End of variables declaration //GEN-END:variables + private final String[] randomRowStrings = new String[1000]; + private final Random random = new Random(); + + private String randomRowString( int row ) { + int index = row % randomRowStrings.length; + + String s = randomRowStrings[index]; + if( s != null ) + return s; + + char[] chars = new char[3 + random.nextInt( 15 - 3 )]; + for( int i = 0; i < chars.length; i++ ) + chars[i] = (char) ((i == 0 ? 'A' : 'a') + random.nextInt( 26 )); + if( chars.length > 6 ) + chars[chars.length / 2] = ' '; + s = new String( chars ); + + randomRowStrings[index] = s; + return s; + } + //---- class DummyTransferHandler ----------------------------------------- private static class DummyTransferHandler @@ -361,4 +505,234 @@ public class FlatComponents2Test return false; } } + + //---- class TestListModel ------------------------------------------------ + + private class TestListModel + extends AbstractListModel + { + private int size; + + TestListModel( int size ) { + setSize( size ); + } + + void setSize( int size ) { + int oldSize = this.size; + this.size = size; + + // fire event + if( size > oldSize ) + fireIntervalAdded( this, oldSize, size - 1 ); + else if( size < oldSize ) + fireIntervalRemoved( this, size, oldSize - 1 ); + } + + @Override + public int getSize() { + return size; + } + + @Override + public String getElementAt( int index ) { + return (index < 20) + ? "item " + (index + 1) + : "item " + (index + 1) + " " + randomRowString( index ); + } + } + + //---- TestTreeModel ------------------------------------------------------ + + private class TestTreeModel + extends DefaultTreeModel + { + private int rowCount; + + TestTreeModel( int rowCount ) { + super( new DefaultMutableTreeNode( "JTree" ) ); + setRowCount( rowCount ); + } + + void setRowCount( int rowCount ) { + if( rowCount < 20 ) + rowCount = 20; + + if( rowCount > this.rowCount ) { + // add nodes + int oldRootChildCount = root.getChildCount(); + while( rowCount > this.rowCount ) { + addTwentyNodes( (DefaultMutableTreeNode) root, this.rowCount ); + this.rowCount += 20; + } + + // fire event + int newRootChildCount = root.getChildCount(); + if( newRootChildCount > oldRootChildCount ) { + int[] childIndices = new int[newRootChildCount - oldRootChildCount]; + for( int i = 0; i < childIndices.length; i++ ) + childIndices[i] = oldRootChildCount + i; + nodesWereInserted( root, childIndices ); + } + } else if( rowCount < this.rowCount ) { + // remove nodes + int oldRootChildCount = root.getChildCount(); + List removedChildren = new ArrayList<>(); + while( this.rowCount > rowCount ) { + int index = root.getChildCount() - 1; + removedChildren.add( 0, root.getChildAt( index ) ); + ((DefaultMutableTreeNode)root).remove( index ); + this.rowCount -= 20; + } + + // fire event + int newRootChildCount = root.getChildCount(); + if( newRootChildCount < oldRootChildCount ) { + int[] childIndices = new int[oldRootChildCount - newRootChildCount]; + for( int i = 0; i < childIndices.length; i++ ) + childIndices[i] = newRootChildCount + i; + nodesWereRemoved( root, childIndices, removedChildren.toArray() ); + } + } + } + + private void addTwentyNodes( DefaultMutableTreeNode root, int firstRowIndex ) { + if( firstRowIndex == 0 ) { + DefaultMutableTreeNode n = new DefaultMutableTreeNode( "colors" ); + n.add( new DefaultMutableTreeNode( "blue" ) ); + n.add( new DefaultMutableTreeNode( "violet" ) ); + n.add( new DefaultMutableTreeNode( "red" ) ); + n.add( new DefaultMutableTreeNode( "yellow" ) ); + root.add( n ); + + n = new DefaultMutableTreeNode( "sports" ); + n.add( new DefaultMutableTreeNode( "basketball" ) ); + n.add( new DefaultMutableTreeNode( "soccer" ) ); + n.add( new DefaultMutableTreeNode( "football" ) ); + n.add( new DefaultMutableTreeNode( "hockey" ) ); + root.add( n ); + + n = new DefaultMutableTreeNode( "food" ); + n.add( new DefaultMutableTreeNode( "hot dogs" ) ); + + DefaultMutableTreeNode n2 = new DefaultMutableTreeNode( "pizza" ); + n2.add( new DefaultMutableTreeNode( "pizza aglio e olio" ) ); + n2.add( new DefaultMutableTreeNode( "pizza calabrese" ) ); + n2.add( new DefaultMutableTreeNode( "pizza infernale" ) ); + n2.add( new DefaultMutableTreeNode( "pizza margherita bianca" ) ); + n2.add( new DefaultMutableTreeNode( "pizza quattro stagioni" ) ); + n.add( n2 ); + + n.add( new DefaultMutableTreeNode( "ravioli" ) ); + n.add( new DefaultMutableTreeNode( "bananas" ) ); + root.add( n ); + } else { + DefaultMutableTreeNode n = new DefaultMutableTreeNode( "item " + firstRowIndex + " " + randomRowString( firstRowIndex ) ); + for( int i = 1; i < 20; i++ ) { + int index = firstRowIndex + i; + n.add( new DefaultMutableTreeNode( "item " + index + " " + randomRowString( index ) ) ); + } + root.add( n ); + } + } + } + + //---- TestTableModel ----------------------------------------------------- + + private class TestTableModel + extends AbstractTableModel + { + private final String[] columnNames = new String[] { + "Not editable", "Text", "Combo", "Combo Editable", "Integer", "Boolean" + }; + + private final Class[] columnTypes = new Class[] { + Object.class, Object.class, String.class, String.class, Integer.class, Boolean.class + }; + + private final boolean[] columnEditable = new boolean[] { + false, true, true, true, true, true + }; + + private final Object[][] rows = new Object[][] { + { "item 1", "item 1b", "January", "July", 123, null }, + { "item 2", "item 2b", "February", "August", 456, true }, + { "item 3", null, "March", null, null, null }, + { "item 4", null, "April", null, null, null }, + { "item 5", null, "May", null, null, null }, + { "item 6", null, "June", null, null, null }, + { "item 7", null, "July", null, null, null }, + { "item 8", null, "August", null, null, null }, + { "item 9", null, "September", null, null, null }, + { "item 10", null, "October", null, null, null }, + { "item 11", null, "November", null, null, null }, + { "item 12", null, "December", null, null, null }, + }; + + private int rowCount = rows.length; + private final Map moreRowsMap = new HashMap<>(); + + TestTableModel( int rowCount ) { + setRowCount( rowCount ); + } + + void setRowCount( int rowCount ) { + int oldRowCount = this.rowCount; + this.rowCount = rowCount; + + // fire event + if( rowCount > oldRowCount ) + fireTableRowsInserted( oldRowCount, rowCount - 1 ); + else if( rowCount < oldRowCount ) + fireTableRowsDeleted( rowCount, oldRowCount - 1 ); + } + + @Override + public int getRowCount() { + return rowCount; + } + + @Override + public int getColumnCount() { + return columnNames.length; + } + + @Override + public String getColumnName( int columnIndex ) { + return columnNames[columnIndex]; + } + + @Override + public Class getColumnClass( int columnIndex ) { + return columnTypes[columnIndex]; + } + + @Override + public boolean isCellEditable( int rowIndex, int columnIndex ) { + return columnEditable[columnIndex]; + } + + @Override + public Object getValueAt( int rowIndex, int columnIndex ) { + if( rowIndex < rows.length ) + return rows[rowIndex][columnIndex]; + + Object[] row = moreRowsMap.get( rowIndex ); + Object value = (row != null) + ? row[columnIndex] + : (columnIndex == 1 ? randomRowString( rowIndex ) : null); + return (columnIndex == 0 && value == null) ? "item " + (rowIndex + 1) : value; + } + + @Override + public void setValueAt( Object value, int rowIndex, int columnIndex ) { + if( rowIndex < rows.length ) + rows[rowIndex][columnIndex] = value; + else { + Object[] row = moreRowsMap.computeIfAbsent( rowIndex, k -> new Object[getColumnCount()] ); + row[columnIndex] = value; + } + + fireTableCellUpdated( rowIndex, columnIndex ); + } + } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.jfd index 7b992ea7..96e3a3ac 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponents2Test.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -8,8 +8,8 @@ new FormModel { } add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" - "$columnConstraints": "[][200][200]" - "$rowConstraints": "[][][::200][150,grow][]" + "$columnConstraints": "[][200,fill][200,fill][fill]" + "$rowConstraints": "[][150,grow,sizegroup 1,fill][150,grow,sizegroup 1,fill][150,grow,sizegroup 1,fill]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -35,58 +35,24 @@ new FormModel { name: "listLabel" "text": "JList:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" + "value": "cell 0 1,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane1" add( new FormComponent( "javax.swing.JList" ) { name: "list1" - "model": new javax.swing.DefaultListModel { - addElement( "item 1" ) - addElement( "item 2" ) - addElement( "item 3" ) - addElement( "item 4" ) - addElement( "item 5" ) - addElement( "item 6" ) - addElement( "item 7" ) - addElement( "item 8" ) - addElement( "item 9" ) - addElement( "item 10" ) - addElement( "item 11" ) - addElement( "item 12" ) - addElement( "item 13" ) - addElement( "item 14" ) - addElement( "item 15" ) - } auxiliary() { "JavaCodeGenerator.typeParameters": "String" "JavaCodeGenerator.variableLocal": false } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1,growx" + "value": "cell 1 1" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane2" add( new FormComponent( "javax.swing.JList" ) { name: "list2" - "model": new javax.swing.DefaultListModel { - addElement( "item 1" ) - addElement( "item 2" ) - addElement( "item 3" ) - addElement( "item 4" ) - addElement( "item 5" ) - addElement( "item 6" ) - addElement( "item 7" ) - addElement( "item 8" ) - addElement( "item 9" ) - addElement( "item 10" ) - addElement( "item 11" ) - addElement( "item 12" ) - addElement( "item 13" ) - addElement( "item 14" ) - addElement( "item 15" ) - } "enabled": false auxiliary() { "JavaCodeGenerator.typeParameters": "String" @@ -94,13 +60,42 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1,growx" + "value": "cell 2 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "hidemode 3" + "$columnConstraints": "[fill][90,fill]" + "$rowConstraints": "[]" + } ) { + name: "listOptionsPanel" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "listRowCountLabel" + "text": "Row count:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "listRowCountSpinner" + "model": &SpinnerNumberModel0 new javax.swing.SpinnerNumberModel { + minimum: 0 + stepSize: 10 + value: 20 + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "listRowCountChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "treeLabel" "text": "JTree:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" + "value": "cell 0 2,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane3" @@ -113,7 +108,7 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2,growx" + "value": "cell 1 2" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane4" @@ -125,13 +120,42 @@ new FormModel { } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 2,growx" + "value": "cell 2 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "hidemode 3" + "$columnConstraints": "[fill][90,fill]" + "$rowConstraints": "[]" + } ) { + name: "treeOptionsPanel" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "treeRowCountLabel" + "text": "Row count:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "treeRowCountSpinner" + "model": new javax.swing.SpinnerNumberModel { + minimum: 20 + stepSize: 20 + value: 20 + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "treeRowCountChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 2" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "tableLabel" "text": "JTable:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 3" + "value": "cell 0 3,aligny top,growy 0" } ) add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "scrollPane5" @@ -140,164 +164,124 @@ new FormModel { } add( new FormComponent( "javax.swing.JTable" ) { name: "table1" - "model": new com.jformdesigner.model.SwingTableModel( new java.util.Vector { - add( new java.util.Vector { - add( "item 1" ) - add( "item 1b" ) - add( "January" ) - add( "July" ) - add( 123 ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 2" ) - add( "item 2b" ) - add( "February" ) - add( "August" ) - add( 456 ) - add( true ) - } ) - add( new java.util.Vector { - add( "item 3" ) - add( null ) - add( "March" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 4" ) - add( null ) - add( "April" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 5" ) - add( null ) - add( "May" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 6" ) - add( null ) - add( "June" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 7" ) - add( null ) - add( "July" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 8" ) - add( null ) - add( "August" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 9" ) - add( null ) - add( "September" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 10" ) - add( null ) - add( "October" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 11" ) - add( null ) - add( "November" ) - add( null ) - add( null ) - add( null ) - } ) - add( new java.util.Vector { - add( "item 12" ) - add( null ) - add( "December" ) - add( null ) - add( null ) - add( null ) - } ) - }, new java.util.Vector { - add( "Not editable" ) - add( "Text" ) - add( "Combo" ) - add( "Combo Editable" ) - add( "Integer" ) - add( "Boolean" ) - }, new java.util.Vector { - add( null ) - add( null ) - add( class java.lang.String ) - add( class java.lang.String ) - add( class java.lang.Integer ) - add( class java.lang.Boolean ) - }, new java.util.Vector { - add( false ) - add( null ) - add( null ) - add( null ) - add( null ) - add( null ) - }, new java.util.Vector { - add( null ) - add( null ) - add( new com.jformdesigner.model.SwingTableColumn( new java.lang.Object[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], 0, 0, 0, true ) ) - add( new com.jformdesigner.model.SwingTableColumn( new java.lang.Object[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], 0, 0, 0, true ) ) - add( null ) - add( null ) - } ) "autoCreateRowSorter": true auxiliary() { "JavaCodeGenerator.variableLocal": false } } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3 2 1,growx,width 300" + "value": "cell 1 3 2 1,width 300" } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "dndCheckBox" - "text": "enable drag and drop" - "mnemonic": 68 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "dndChanged", false ) ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "hidemode 3" + "$columnConstraints": "[][90,fill]" + "$rowConstraints": "[][]0[]0[]0[]0[]0[]0[]0[]" + } ) { + name: "tableOptionsPanel" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tableRowCountLabel" + "text": "Row count:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "tableRowCountSpinner" + "model": #SpinnerNumberModel0 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "tableRowCountChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showHorizontalLinesCheckBox" + "text": "show horizontal lines" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showHorizontalLinesChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showVerticalLinesCheckBox" + "text": "show vertical lines" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showVerticalLinesChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "intercellSpacingCheckBox" + "text": "intercell spacing" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "intercellSpacingChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "redGridColorCheckBox" + "text": "red grid color" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "redGridColorChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "rowSelectionCheckBox" + "text": "row selection" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rowSelectionChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "columnSelectionCheckBox" + "text": "column selection" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "columnSelectionChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "dndCheckBox" + "text": "enable drag and drop" + "mnemonic": 68 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "dndChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tableHeaderButtonCheckBox" + "text": "show button in table header" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tableHeaderButtonChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8 2 1" + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 4 3 1" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "tableHeaderButtonCheckBox" - "text": "show button in table header" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tableHeaderButtonChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 4 3 1" + "value": "cell 3 3" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 715 ) + "size": new java.awt.Dimension( 790, 825 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java index 69847c07..18a184f2 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java @@ -19,6 +19,7 @@ package com.formdev.flatlaf.testing; import java.awt.*; import javax.swing.*; import javax.swing.border.*; +import com.formdev.flatlaf.FlatClientProperties; import net.miginfocom.swing.*; /** @@ -54,6 +55,22 @@ public class FlatComponentsTest progressBar4.setIndeterminate( indeterminate ); } + private void borderPaintedChanged() { + boolean borderPainted = borderPaintedCheckBox.isSelected(); + + for( Component c : getComponents() ) { + if( c instanceof AbstractButton ) + ((AbstractButton)c).setBorderPainted( borderPainted ); + else if( c instanceof JProgressBar ) + ((JProgressBar)c).setBorderPainted( borderPainted ); + else if( c instanceof JToolBar ) + ((JToolBar)c).setBorderPainted( borderPainted ); + + if( c instanceof JCheckBox ) + ((JCheckBox)c).setBorderPaintedFlat( borderPainted ); + } + } + private void contentAreaFilledChanged() { boolean contentAreaFilled = contentAreaFilledCheckBox.isSelected(); @@ -63,16 +80,68 @@ public class FlatComponentsTest } } + private void focusPaintedChanged() { + boolean focusPainted = focusPaintedCheckBox.isSelected(); + + for( Component c : getComponents() ) { + if( c instanceof AbstractButton ) + ((AbstractButton)c).setFocusPainted( focusPainted ); + } + } + + private void roundRectChanged() { + Boolean roundRect = roundRectCheckBox.isSelected() ? true : null; + + for( Component c : getComponents() ) { + if( c instanceof JComponent ) + ((JComponent)c).putClientProperty( FlatClientProperties.COMPONENT_ROUND_RECT, roundRect ); + } + } + + private void buttonTypeChanged() { + String buttonType = (String) buttonTypeComboBox.getSelectedItem(); + if( "-".equals( buttonType ) ) + buttonType = null; + + for( Component c : getComponents() ) { + if( c instanceof AbstractButton ) + ((AbstractButton)c).putClientProperty( FlatClientProperties.BUTTON_TYPE, buttonType ); + } + } + + private void outlineChanged() { + FlatTestFrame frame = (FlatTestFrame) SwingUtilities.getAncestorOfClass( FlatTestFrame.class, this ); + if( frame == null ) + return; + + Object outline = errorOutlineRadioButton.isSelected() ? "error" + : warningOutlineRadioButton.isSelected() ? "warning" + : magentaOutlineRadioButton.isSelected() ? Color.magenta + : magentaCyanOutlineRadioButton.isSelected() ? new Color[] { Color.magenta, Color.cyan } + : null; + + frame.updateComponentsRecur( this, (c, type) -> { + if( c instanceof JComponent ) + ((JComponent)c).putClientProperty( FlatClientProperties.OUTLINE, outline ); + } ); + + frame.repaint(); + textField1.requestFocusInWindow(); + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JLabel labelLabel = new JLabel(); JLabel label1 = new JLabel(); JLabel label2 = new JLabel(); + FlatComponentsTest.TestMultiLineLabel testMultiLineLabel1 = new FlatComponentsTest.TestMultiLineLabel(); JLabel buttonLabel = new JLabel(); JButton button1 = new JButton(); JButton button17 = new JButton(); + JButton button22 = new JButton(); JButton button2 = new JButton(); JButton button18 = new JButton(); + JButton button23 = new JButton(); FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton(); JButton button3 = new JButton(); JButton button12 = new JButton(); @@ -80,17 +149,21 @@ public class FlatComponentsTest JButton button14 = new JButton(); JButton button15 = new JButton(); JButton button16 = new JButton(); + JButton button20 = new JButton(); JLabel toggleButtonLabel = new JLabel(); JToggleButton toggleButton1 = new JToggleButton(); JToggleButton toggleButton9 = new JToggleButton(); + JToggleButton toggleButton19 = new JToggleButton(); JToggleButton toggleButton2 = new JToggleButton(); JToggleButton toggleButton10 = new JToggleButton(); + JToggleButton toggleButton20 = new JToggleButton(); JToggleButton toggleButton3 = new JToggleButton(); JToggleButton toggleButton4 = new JToggleButton(); JToggleButton toggleButton11 = new JToggleButton(); JToggleButton toggleButton12 = new JToggleButton(); JToggleButton toggleButton13 = new JToggleButton(); JToggleButton toggleButton14 = new JToggleButton(); + JToggleButton toggleButton18 = new JToggleButton(); JLabel checkBoxLabel = new JLabel(); JCheckBox checkBox1 = new JCheckBox(); JCheckBox checkBox2 = new JCheckBox(); @@ -103,35 +176,41 @@ public class FlatComponentsTest JRadioButton radioButton2 = new JRadioButton(); JRadioButton radioButton3 = new JRadioButton(); JRadioButton radioButton4 = new JRadioButton(); - contentAreaFilledCheckBox = new JCheckBox(); JLabel comboBoxLabel = new JLabel(); JComboBox comboBox1 = new JComboBox<>(); JComboBox comboBox2 = new JComboBox<>(); JComboBox comboBox3 = new JComboBox<>(); JComboBox comboBox4 = new JComboBox<>(); JComboBox comboBox5 = new JComboBox<>(); + JComboBox comboBox6 = new JComboBox<>(); JLabel spinnerLabel = new JLabel(); JSpinner spinner1 = new JSpinner(); JSpinner spinner2 = new JSpinner(); + FlatComponentsTest.ButtonlessSpinner buttonlessSpinner1 = new FlatComponentsTest.ButtonlessSpinner(); + FlatComponentsTest.ButtonlessSpinner buttonlessSpinner2 = new FlatComponentsTest.ButtonlessSpinner(); JComboBox comboBox7 = new JComboBox<>(); + JSpinner spinner3 = new JSpinner(); JLabel textFieldLabel = new JLabel(); - JTextField textField1 = new JTextField(); + textField1 = new JTextField(); JTextField textField2 = new JTextField(); JTextField textField3 = new JTextField(); JTextField textField4 = new JTextField(); JTextField textField6 = new JTextField(); + JTextField textField5 = new JTextField(); JLabel formattedTextFieldLabel = new JLabel(); JFormattedTextField formattedTextField1 = new JFormattedTextField(); JFormattedTextField formattedTextField2 = new JFormattedTextField(); JFormattedTextField formattedTextField3 = new JFormattedTextField(); JFormattedTextField formattedTextField4 = new JFormattedTextField(); JFormattedTextField formattedTextField5 = new JFormattedTextField(); + JFormattedTextField formattedTextField6 = new JFormattedTextField(); JLabel passwordFieldLabel = new JLabel(); JPasswordField passwordField1 = new JPasswordField(); JPasswordField passwordField2 = new JPasswordField(); JPasswordField passwordField3 = new JPasswordField(); JPasswordField passwordField4 = new JPasswordField(); JPasswordField passwordField5 = new JPasswordField(); + JPasswordField passwordField6 = new JPasswordField(); JLabel textAreaLabel = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); JTextArea textArea1 = new JTextArea(); @@ -181,6 +260,21 @@ public class FlatComponentsTest JButton button10 = new JButton(); JButton button11 = new JButton(); JToggleButton toggleButton7 = new JToggleButton(); + JScrollPane scrollPane15 = new JScrollPane(); + JPanel panel3 = new JPanel(); + JButton button21 = new JButton(); + JPanel panel5 = new JPanel(); + buttonTypeComboBox = new JComboBox<>(); + borderPaintedCheckBox = new JCheckBox(); + roundRectCheckBox = new JCheckBox(); + contentAreaFilledCheckBox = new JCheckBox(); + JPanel panel4 = new JPanel(); + noOutlineRadioButton = new JRadioButton(); + errorOutlineRadioButton = new JRadioButton(); + warningOutlineRadioButton = new JRadioButton(); + magentaOutlineRadioButton = new JRadioButton(); + magentaCyanOutlineRadioButton = new JRadioButton(); + focusPaintedCheckBox = new JCheckBox(); JLabel scrollBarLabel = new JLabel(); JScrollBar scrollBar1 = new JScrollBar(); JScrollBar scrollBar4 = new JScrollBar(); @@ -211,6 +305,18 @@ public class FlatComponentsTest JToggleButton toggleButton15 = new JToggleButton(); JToggleButton toggleButton16 = new JToggleButton(); JToggleButton toggleButton17 = new JToggleButton(); + JLabel label3 = new JLabel(); + JToolBar toolBar3 = new JToolBar(); + JButton button26 = new JButton(); + JButton button27 = new JButton(); + JToggleButton toggleButton23 = new JToggleButton(); + JToggleButton toggleButton24 = new JToggleButton(); + JLabel label4 = new JLabel(); + JToolBar toolBar4 = new JToolBar(); + JButton button28 = new JButton(); + JButton button29 = new JButton(); + JToggleButton toggleButton25 = new JToggleButton(); + JToggleButton toggleButton26 = new JToggleButton(); //======== this ======== setLayout(new MigLayout( @@ -221,7 +327,8 @@ public class FlatComponentsTest "[]" + "[]" + "[]" + - "[]", + "[]" + + "[left]", // rows "[]" + "[]" + @@ -253,48 +360,65 @@ public class FlatComponentsTest add(labelLabel, "cell 0 0"); //---- label1 ---- - label1.setText("enabled"); + label1.setText("Enabled"); label1.setDisplayedMnemonic('E'); add(label1, "cell 1 0"); //---- label2 ---- - label2.setText("disabled"); + label2.setText("Disabled"); label2.setDisplayedMnemonic('D'); label2.setEnabled(false); add(label2, "cell 2 0"); + //---- testMultiLineLabel1 ---- + testMultiLineLabel1.setText("Multi-line label based on JTextArea\n2nd line"); + add(testMultiLineLabel1, "cell 3 0 2 1"); + //---- buttonLabel ---- buttonLabel.setText("JButton:"); add(buttonLabel, "cell 0 1"); //---- button1 ---- - button1.setText("enabled"); + button1.setText("Enabled"); button1.setDisplayedMnemonicIndex(0); button1.setToolTipText("This button is enabled."); add(button1, "cell 1 1"); //---- button17 ---- - button17.setText("square"); + button17.setText("Sq"); button17.putClientProperty("JButton.buttonType", "square"); button17.putClientProperty("JComponent.minimumWidth", 0); add(button17, "cell 1 1"); + //---- button22 ---- + button22.setText("Rd"); + button22.putClientProperty("JButton.buttonType", "roundRect"); + button22.putClientProperty("JComponent.minimumWidth", 0); + add(button22, "cell 1 1"); + //---- button2 ---- - button2.setText("disabled"); + button2.setText("Disabled"); button2.setDisplayedMnemonicIndex(0); button2.setEnabled(false); button2.setToolTipText("This button is disabled."); add(button2, "cell 2 1"); //---- button18 ---- - button18.setText("square"); + button18.setText("Sq"); button18.putClientProperty("JButton.buttonType", "square"); button18.setEnabled(false); button18.putClientProperty("JComponent.minimumWidth", 0); add(button18, "cell 2 1"); + //---- button23 ---- + button23.setText("Rd"); + button23.putClientProperty("JButton.buttonType", "roundRect"); + button23.setEnabled(false); + button23.putClientProperty("JComponent.minimumWidth", 0); + add(button23, "cell 2 1"); + //---- button5 ---- - button5.setText("default"); + button5.setText("Default"); button5.setDisplayedMnemonicIndex(0); button5.setToolTipText("Tool tip with\nmultiple\nlines."); add(button5, "cell 3 1"); @@ -326,37 +450,53 @@ public class FlatComponentsTest button16.setText("#"); add(button16, "cell 5 1"); + //---- button20 ---- + button20.setText("Empty border"); + button20.setBorder(BorderFactory.createEmptyBorder()); + add(button20, "cell 6 1"); + //---- toggleButtonLabel ---- toggleButtonLabel.setText("JToggleButton:"); add(toggleButtonLabel, "cell 0 2"); //---- toggleButton1 ---- - toggleButton1.setText("enabled"); + toggleButton1.setText("Enabled"); add(toggleButton1, "cell 1 2"); //---- toggleButton9 ---- - toggleButton9.setText("square"); + toggleButton9.setText("Sq"); toggleButton9.putClientProperty("JButton.buttonType", "square"); add(toggleButton9, "cell 1 2"); + //---- toggleButton19 ---- + toggleButton19.setText("Rd"); + toggleButton19.putClientProperty("JButton.buttonType", "roundRect"); + add(toggleButton19, "cell 1 2"); + //---- toggleButton2 ---- - toggleButton2.setText("disabled"); + toggleButton2.setText("Disabled"); toggleButton2.setEnabled(false); add(toggleButton2, "cell 2 2"); //---- toggleButton10 ---- - toggleButton10.setText("square"); + toggleButton10.setText("Sq"); toggleButton10.putClientProperty("JButton.buttonType", "square"); toggleButton10.setEnabled(false); add(toggleButton10, "cell 2 2"); + //---- toggleButton20 ---- + toggleButton20.setText("Rd"); + toggleButton20.putClientProperty("JButton.buttonType", "roundRect"); + toggleButton20.setEnabled(false); + add(toggleButton20, "cell 2 2"); + //---- toggleButton3 ---- - toggleButton3.setText("selected"); + toggleButton3.setText("Selected"); toggleButton3.setSelected(true); add(toggleButton3, "cell 3 2"); //---- toggleButton4 ---- - toggleButton4.setText("selected disabled"); + toggleButton4.setText("Selected disabled"); toggleButton4.setEnabled(false); toggleButton4.setSelected(true); add(toggleButton4, "cell 4 2"); @@ -381,40 +521,45 @@ public class FlatComponentsTest toggleButton14.setSelected(true); add(toggleButton14, "cell 5 2"); + //---- toggleButton18 ---- + toggleButton18.setText("Empty border"); + toggleButton18.setBorder(BorderFactory.createEmptyBorder()); + add(toggleButton18, "cell 6 2"); + //---- checkBoxLabel ---- checkBoxLabel.setText("JCheckBox"); add(checkBoxLabel, "cell 0 3"); //---- checkBox1 ---- - checkBox1.setText("enabled"); + checkBox1.setText("Enabled"); checkBox1.setMnemonic('A'); add(checkBox1, "cell 1 3"); //---- checkBox2 ---- - checkBox2.setText("disabled"); + checkBox2.setText("Disabled"); checkBox2.setEnabled(false); checkBox2.setMnemonic('D'); add(checkBox2, "cell 2 3"); //---- checkBox3 ---- - checkBox3.setText("selected"); + checkBox3.setText("Selected"); checkBox3.setSelected(true); add(checkBox3, "cell 3 3"); //---- checkBox4 ---- - checkBox4.setText("selected disabled"); + checkBox4.setText("Selected disabled"); checkBox4.setSelected(true); checkBox4.setEnabled(false); add(checkBox4, "cell 4 3"); //---- toggleButton5 ---- - toggleButton5.setText("tab"); + toggleButton5.setText("Tab"); toggleButton5.putClientProperty("JButton.buttonType", "tab"); toggleButton5.setSelected(true); add(toggleButton5, "cell 5 3"); //---- toggleButton8 ---- - toggleButton8.setText("tab"); + toggleButton8.setText("Tab"); toggleButton8.putClientProperty("JButton.buttonType", "tab"); toggleButton8.setEnabled(false); toggleButton8.setSelected(true); @@ -425,33 +570,27 @@ public class FlatComponentsTest add(radioButtonLabel, "cell 0 4"); //---- radioButton1 ---- - radioButton1.setText("enabled"); + radioButton1.setText("Enabled"); radioButton1.setMnemonic('N'); add(radioButton1, "cell 1 4"); //---- radioButton2 ---- - radioButton2.setText("disabled"); + radioButton2.setText("Disabled"); radioButton2.setEnabled(false); radioButton2.setMnemonic('S'); add(radioButton2, "cell 2 4"); //---- radioButton3 ---- - radioButton3.setText("selected"); + radioButton3.setText("Selected"); radioButton3.setSelected(true); add(radioButton3, "cell 3 4"); //---- radioButton4 ---- - radioButton4.setText("selected disabled"); + radioButton4.setText("Selected disabled"); radioButton4.setSelected(true); radioButton4.setEnabled(false); add(radioButton4, "cell 4 4"); - //---- contentAreaFilledCheckBox ---- - contentAreaFilledCheckBox.setText("contentAreaFilled"); - contentAreaFilledCheckBox.setSelected(true); - contentAreaFilledCheckBox.addActionListener(e -> contentAreaFilledChanged()); - add(contentAreaFilledCheckBox, "cell 5 4"); - //---- comboBoxLabel ---- comboBoxLabel.setText("JComboBox:"); add(comboBoxLabel, "cell 0 5"); @@ -459,7 +598,7 @@ public class FlatComponentsTest //---- comboBox1 ---- comboBox1.setEditable(true); comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { - "editable", + "Editable", "a", "bb", "ccc", @@ -472,13 +611,14 @@ public class FlatComponentsTest "jj", "kkk" })); + comboBox1.setMaximumRowCount(6); add(comboBox1, "cell 1 5,growx"); //---- comboBox2 ---- comboBox2.setEditable(true); comboBox2.setEnabled(false); comboBox2.setModel(new DefaultComboBoxModel<>(new String[] { - "disabled", + "Disabled", "a", "bb", "ccc" @@ -487,7 +627,7 @@ public class FlatComponentsTest //---- comboBox3 ---- comboBox3.setModel(new DefaultComboBoxModel<>(new String[] { - "not editable", + "Not editable", "a", "bb", "ccc", @@ -500,11 +640,12 @@ public class FlatComponentsTest "jj", "kkk" })); + comboBox3.setMaximumRowCount(6); add(comboBox3, "cell 3 5,growx"); //---- comboBox4 ---- comboBox4.setModel(new DefaultComboBoxModel<>(new String[] { - "not editable disabled", + "Not editable disabled", "a", "bb", "ccc" @@ -513,14 +654,23 @@ public class FlatComponentsTest add(comboBox4, "cell 4 5,growx"); //---- comboBox5 ---- - comboBox5.setPrototypeDisplayValue("12345"); comboBox5.setModel(new DefaultComboBoxModel<>(new String[] { - "wide popup if text is longer", + "Wide popup if text is longer", "aa", "bbb", "cccc" })); - add(comboBox5, "cell 5 5,growx"); + add(comboBox5, "cell 5 5,growx,wmax 100"); + + //---- comboBox6 ---- + comboBox6.setBorder(BorderFactory.createEmptyBorder()); + comboBox6.setModel(new DefaultComboBoxModel<>(new String[] { + "Empty border", + "a", + "b", + "c" + })); + add(comboBox6, "cell 6 5"); //---- spinnerLabel ---- spinnerLabel.setText("JSpinner:"); @@ -530,96 +680,118 @@ public class FlatComponentsTest //---- spinner2 ---- spinner2.setEnabled(false); add(spinner2, "cell 2 6,growx"); + add(buttonlessSpinner1, "cell 3 6,growx"); + add(buttonlessSpinner2, "cell 4 6,growx"); //---- comboBox7 ---- comboBox7.setEditable(true); - comboBox7.putClientProperty("JTextField.placeholderText", "placeholder"); + comboBox7.putClientProperty("JTextField.placeholderText", "Placeholder"); add(comboBox7, "cell 5 6,growx"); + //---- spinner3 ---- + spinner3.setBorder(BorderFactory.createEmptyBorder()); + spinner3.setModel(new SpinnerNumberModel(12345, null, null, 1)); + add(spinner3, "cell 6 6"); + //---- textFieldLabel ---- textFieldLabel.setText("JTextField:"); add(textFieldLabel, "cell 0 7"); //---- textField1 ---- - textField1.setText("editable"); + textField1.setText("Editable"); add(textField1, "cell 1 7,growx"); //---- textField2 ---- - textField2.setText("disabled"); + textField2.setText("Disabled"); textField2.setEnabled(false); add(textField2, "cell 2 7,growx"); //---- textField3 ---- - textField3.setText("not editable"); + textField3.setText("Not editable"); textField3.setEditable(false); add(textField3, "cell 3 7,growx"); //---- textField4 ---- - textField4.setText("not editable disabled"); + textField4.setText("Not editable disabled"); textField4.setEnabled(false); textField4.setEditable(false); add(textField4, "cell 4 7,growx"); //---- textField6 ---- - textField6.putClientProperty("JTextField.placeholderText", "placeholder"); + textField6.putClientProperty("JTextField.placeholderText", "Placeholder"); add(textField6, "cell 5 7,growx"); + //---- textField5 ---- + textField5.setText("Empty border"); + textField5.setBorder(BorderFactory.createEmptyBorder()); + add(textField5, "cell 6 7"); + //---- formattedTextFieldLabel ---- formattedTextFieldLabel.setText("JFormattedTextField:"); add(formattedTextFieldLabel, "cell 0 8"); //---- formattedTextField1 ---- - formattedTextField1.setText("editable"); + formattedTextField1.setText("Editable"); add(formattedTextField1, "cell 1 8,growx"); //---- formattedTextField2 ---- - formattedTextField2.setText("disabled"); + formattedTextField2.setText("Disabled"); formattedTextField2.setEnabled(false); add(formattedTextField2, "cell 2 8,growx"); //---- formattedTextField3 ---- - formattedTextField3.setText("not editable"); + formattedTextField3.setText("Not editable"); formattedTextField3.setEditable(false); add(formattedTextField3, "cell 3 8,growx"); //---- formattedTextField4 ---- - formattedTextField4.setText("not editable disabled"); + formattedTextField4.setText("Not editable disabled"); formattedTextField4.setEnabled(false); formattedTextField4.setEditable(false); add(formattedTextField4, "cell 4 8,growx"); //---- formattedTextField5 ---- - formattedTextField5.putClientProperty("JTextField.placeholderText", "placeholder"); + formattedTextField5.putClientProperty("JTextField.placeholderText", "Placeholder"); add(formattedTextField5, "cell 5 8,growx"); + //---- formattedTextField6 ---- + formattedTextField6.setText("Empty border"); + formattedTextField6.setBorder(BorderFactory.createEmptyBorder()); + add(formattedTextField6, "cell 6 8"); + //---- passwordFieldLabel ---- passwordFieldLabel.setText("JPasswordField:"); add(passwordFieldLabel, "cell 0 9"); //---- passwordField1 ---- - passwordField1.setText("editable"); + passwordField1.setText("Editable"); add(passwordField1, "cell 1 9,growx"); //---- passwordField2 ---- - passwordField2.setText("disabled"); + passwordField2.setText("Disabled"); passwordField2.setEnabled(false); add(passwordField2, "cell 2 9,growx"); //---- passwordField3 ---- - passwordField3.setText("not editable"); + passwordField3.setText("Not editable"); passwordField3.setEditable(false); add(passwordField3, "cell 3 9,growx"); //---- passwordField4 ---- - passwordField4.setText("not editable disabled"); + passwordField4.setText("Not editable disabled"); passwordField4.setEnabled(false); passwordField4.setEditable(false); add(passwordField4, "cell 4 9,growx"); //---- passwordField5 ---- - passwordField5.putClientProperty("JTextField.placeholderText", "placeholder"); + passwordField5.putClientProperty("JTextField.placeholderText", "Placeholder"); add(passwordField5, "cell 5 9,growx"); + //---- passwordField6 ---- + passwordField6.setText("empty border"); + passwordField6.setBorder(BorderFactory.createEmptyBorder()); + add(passwordField6, "cell 6 9"); + //---- textAreaLabel ---- textAreaLabel.setText("JTextArea:"); add(textAreaLabel, "cell 0 10"); @@ -630,7 +802,7 @@ public class FlatComponentsTest scrollPane1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea1 ---- - textArea1.setText("editable"); + textArea1.setText("Editable"); textArea1.setRows(2); scrollPane1.setViewportView(textArea1); } @@ -642,7 +814,7 @@ public class FlatComponentsTest scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea2 ---- - textArea2.setText("disabled"); + textArea2.setText("Disabled"); textArea2.setRows(2); textArea2.setEnabled(false); scrollPane2.setViewportView(textArea2); @@ -655,7 +827,7 @@ public class FlatComponentsTest scrollPane3.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea3 ---- - textArea3.setText("not editable"); + textArea3.setText("Not editable"); textArea3.setRows(2); textArea3.setEditable(false); scrollPane3.setViewportView(textArea3); @@ -668,7 +840,7 @@ public class FlatComponentsTest scrollPane4.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textArea4 ---- - textArea4.setText("not editable disabled"); + textArea4.setText("Not editable disabled"); textArea4.setRows(2); textArea4.setEditable(false); textArea4.setEnabled(false); @@ -678,7 +850,7 @@ public class FlatComponentsTest //---- textArea5 ---- textArea5.setRows(2); - textArea5.setText("no scroll pane"); + textArea5.setText("No scroll pane"); add(textArea5, "cell 5 10,growx"); //---- editorPaneLabel ---- @@ -691,7 +863,7 @@ public class FlatComponentsTest scrollPane5.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane1 ---- - editorPane1.setText("editable"); + editorPane1.setText("Editable"); scrollPane5.setViewportView(editorPane1); } add(scrollPane5, "cell 1 11,growx"); @@ -702,7 +874,7 @@ public class FlatComponentsTest scrollPane6.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane2 ---- - editorPane2.setText("disabled"); + editorPane2.setText("Disabled"); editorPane2.setEnabled(false); scrollPane6.setViewportView(editorPane2); } @@ -714,7 +886,7 @@ public class FlatComponentsTest scrollPane7.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane3 ---- - editorPane3.setText("not editable"); + editorPane3.setText("Not editable"); editorPane3.setEditable(false); scrollPane7.setViewportView(editorPane3); } @@ -726,7 +898,7 @@ public class FlatComponentsTest scrollPane8.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- editorPane4 ---- - editorPane4.setText("not editable disabled"); + editorPane4.setText("Not editable disabled"); editorPane4.setEditable(false); editorPane4.setEnabled(false); scrollPane8.setViewportView(editorPane4); @@ -734,7 +906,7 @@ public class FlatComponentsTest add(scrollPane8, "cell 4 11,growx"); //---- editorPane5 ---- - editorPane5.setText("no scroll pane"); + editorPane5.setText("No scroll pane"); add(editorPane5, "cell 5 11,growx"); //---- textPaneLabel ---- @@ -747,7 +919,7 @@ public class FlatComponentsTest scrollPane9.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane1 ---- - textPane1.setText("editable"); + textPane1.setText("Editable"); scrollPane9.setViewportView(textPane1); } add(scrollPane9, "cell 1 12,growx"); @@ -758,7 +930,7 @@ public class FlatComponentsTest scrollPane10.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane2 ---- - textPane2.setText("disabled"); + textPane2.setText("Disabled"); textPane2.setEnabled(false); scrollPane10.setViewportView(textPane2); } @@ -770,7 +942,7 @@ public class FlatComponentsTest scrollPane11.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane3 ---- - textPane3.setText("not editable"); + textPane3.setText("Not editable"); textPane3.setEditable(false); scrollPane11.setViewportView(textPane3); } @@ -782,7 +954,7 @@ public class FlatComponentsTest scrollPane12.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //---- textPane4 ---- - textPane4.setText("not editable disabled"); + textPane4.setText("Not editable disabled"); textPane4.setEditable(false); textPane4.setEnabled(false); scrollPane12.setViewportView(textPane4); @@ -790,7 +962,7 @@ public class FlatComponentsTest add(scrollPane12, "cell 4 12,growx"); //---- textPane5 ---- - textPane5.setText("no scroll pane"); + textPane5.setText("No scroll pane"); add(textPane5, "cell 5 12,growx"); //---- scrollPaneLabel ---- @@ -884,6 +1056,107 @@ public class FlatComponentsTest } add(toolBar2, "cell 4 13 1 6,growy"); + //======== scrollPane15 ======== + { + scrollPane15.setBorder(BorderFactory.createEmptyBorder()); + + //======== panel3 ======== + { + panel3.setPreferredSize(new Dimension(800, 400)); + panel3.setLayout(new BorderLayout()); + + //---- button21 ---- + button21.setText("I'm a large button in a scrollpane with empty border"); + button21.setVerticalAlignment(SwingConstants.TOP); + button21.setHorizontalAlignment(SwingConstants.LEFT); + panel3.add(button21, BorderLayout.CENTER); + } + scrollPane15.setViewportView(panel3); + } + add(scrollPane15, "cell 6 10 1 3,growy,width 100,height 50"); + + //======== panel5 ======== + { + panel5.setBorder(new TitledBorder("Control")); + panel5.setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[]" + + "[]", + // rows + "[]" + + "[]" + + "[]" + + "[]")); + + //---- buttonTypeComboBox ---- + buttonTypeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "-", + "square", + "roundRect", + "tab", + "help" + })); + buttonTypeComboBox.addActionListener(e -> buttonTypeChanged()); + panel5.add(buttonTypeComboBox, "cell 0 0"); + + //---- borderPaintedCheckBox ---- + borderPaintedCheckBox.setText("borderPainted"); + borderPaintedCheckBox.setSelected(true); + borderPaintedCheckBox.addActionListener(e -> borderPaintedChanged()); + panel5.add(borderPaintedCheckBox, "cell 1 0"); + + //---- roundRectCheckBox ---- + roundRectCheckBox.setText("roundRect"); + roundRectCheckBox.addActionListener(e -> roundRectChanged()); + panel5.add(roundRectCheckBox, "cell 0 1"); + + //---- contentAreaFilledCheckBox ---- + contentAreaFilledCheckBox.setText("contentAreaFilled"); + contentAreaFilledCheckBox.setSelected(true); + contentAreaFilledCheckBox.addActionListener(e -> contentAreaFilledChanged()); + panel5.add(contentAreaFilledCheckBox, "cell 1 1"); + + //======== panel4 ======== + { + panel4.setLayout(new BoxLayout(panel4, BoxLayout.Y_AXIS)); + + //---- noOutlineRadioButton ---- + noOutlineRadioButton.setText("no outline"); + noOutlineRadioButton.setSelected(true); + noOutlineRadioButton.addActionListener(e -> outlineChanged()); + panel4.add(noOutlineRadioButton); + + //---- errorOutlineRadioButton ---- + errorOutlineRadioButton.setText("error"); + errorOutlineRadioButton.addActionListener(e -> outlineChanged()); + panel4.add(errorOutlineRadioButton); + + //---- warningOutlineRadioButton ---- + warningOutlineRadioButton.setText("warning"); + warningOutlineRadioButton.addActionListener(e -> outlineChanged()); + panel4.add(warningOutlineRadioButton); + + //---- magentaOutlineRadioButton ---- + magentaOutlineRadioButton.setText("magenta"); + magentaOutlineRadioButton.addActionListener(e -> outlineChanged()); + panel4.add(magentaOutlineRadioButton); + + //---- magentaCyanOutlineRadioButton ---- + magentaCyanOutlineRadioButton.setText("magenta / cyan"); + magentaCyanOutlineRadioButton.addActionListener(e -> outlineChanged()); + panel4.add(magentaCyanOutlineRadioButton); + } + panel5.add(panel4, "cell 0 2 1 2"); + + //---- focusPaintedCheckBox ---- + focusPaintedCheckBox.setText("focusPainted"); + focusPaintedCheckBox.setSelected(true); + focusPaintedCheckBox.addActionListener(e -> focusPaintedChanged()); + panel5.add(focusPaintedCheckBox, "cell 1 2"); + } + add(panel5, "cell 5 13 2 10,grow"); + //---- scrollBarLabel ---- scrollBarLabel.setText("JScrollBar:"); add(scrollBarLabel, "cell 0 14"); @@ -1029,19 +1302,99 @@ public class FlatComponentsTest toggleButton17.setSelected(true); toolBar1.add(toggleButton17); } - add(toolBar1, "cell 1 23 3 1,growx"); + add(toolBar1, "cell 1 23 5 1"); + + //---- label3 ---- + label3.setText("Square:"); + add(label3, "cell 1 23 5 1"); + + //======== toolBar3 ======== + { + + //---- button26 ---- + button26.setIcon(UIManager.getIcon("Tree.closedIcon")); + button26.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(button26); + + //---- button27 ---- + button27.setIcon(UIManager.getIcon("Tree.openIcon")); + button27.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(button27); + + //---- toggleButton23 ---- + toggleButton23.setIcon(UIManager.getIcon("FileView.computerIcon")); + toggleButton23.setSelected(true); + toggleButton23.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(toggleButton23); + + //---- toggleButton24 ---- + toggleButton24.setIcon(UIManager.getIcon("FileView.floppyDriveIcon")); + toggleButton24.setSelected(true); + toggleButton24.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(toggleButton24); + } + add(toolBar3, "cell 1 23 5 1"); + + //---- label4 ---- + label4.setText("Round:"); + add(label4, "cell 1 23 5 1"); + + //======== toolBar4 ======== + { + + //---- button28 ---- + button28.setIcon(UIManager.getIcon("Tree.closedIcon")); + button28.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(button28); + + //---- button29 ---- + button29.setIcon(UIManager.getIcon("Tree.openIcon")); + button29.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(button29); + + //---- toggleButton25 ---- + toggleButton25.setIcon(UIManager.getIcon("FileView.computerIcon")); + toggleButton25.setSelected(true); + toggleButton25.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(toggleButton25); + + //---- toggleButton26 ---- + toggleButton26.setIcon(UIManager.getIcon("FileView.floppyDriveIcon")); + toggleButton26.setSelected(true); + toggleButton26.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(toggleButton26); + } + add(toolBar4, "cell 1 23 5 1"); + + //---- buttonGroup1 ---- + ButtonGroup buttonGroup1 = new ButtonGroup(); + buttonGroup1.add(noOutlineRadioButton); + buttonGroup1.add(errorOutlineRadioButton); + buttonGroup1.add(warningOutlineRadioButton); + buttonGroup1.add(magentaOutlineRadioButton); + buttonGroup1.add(magentaCyanOutlineRadioButton); // JFormDesigner - End of component initialization //GEN-END:initComponents -// BasicComboBoxRenderer customaRenderer = new BasicComboBoxRenderer(); -// customaRenderer.setBorder( new LineBorder( Color.red ) ); -// comboBox1.setRenderer( customaRenderer ); -// comboBox3.setRenderer( customaRenderer ); +// BasicComboBoxRenderer customRenderer = new BasicComboBoxRenderer(); +// customRenderer.setBorder( new LineBorder( Color.red ) ); +// comboBox1.setRenderer( customRenderer ); +// comboBox3.setRenderer( customRenderer ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables - private JCheckBox contentAreaFilledCheckBox; + private JTextField textField1; private JProgressBar progressBar3; private JProgressBar progressBar4; + private JComboBox buttonTypeComboBox; + private JCheckBox borderPaintedCheckBox; + private JCheckBox roundRectCheckBox; + private JCheckBox contentAreaFilledCheckBox; + private JRadioButton noOutlineRadioButton; + private JRadioButton errorOutlineRadioButton; + private JRadioButton warningOutlineRadioButton; + private JRadioButton magentaOutlineRadioButton; + private JRadioButton magentaCyanOutlineRadioButton; + private JCheckBox focusPaintedCheckBox; private JSlider slider3; private JProgressBar progressBar1; private JProgressBar progressBar2; @@ -1058,4 +1411,42 @@ public class FlatComponentsTest return true; } } + + //---- class TestMultiLineLabel ------------------------------------------- + + private static class TestMultiLineLabel + extends JTextArea + { + public TestMultiLineLabel() { + setEditable( false ); + setFocusable( false ); + } + + @Override + public void updateUI() { + super.updateUI(); + setBackground( UIManager.getColor( "Label.background" ) ); + setForeground( UIManager.getColor( "Label.foreground" ) ); + setFont( UIManager.getFont( "Label.font" ) ); + setBorder( null ); + } + } + + //---- class ButtonlessSpinner -------------------------------------------- + + private static class ButtonlessSpinner + extends JSpinner + { + @Override + public void updateUI() { + super.updateUI(); + + // remove arrow buttons + for( Component c : getComponents() ) { + String name = c.getName(); + if( "Spinner.nextButton".equals( name ) || "Spinner.previousButton".equals( name ) ) + remove( c ); + } + } + } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd index 28154222..6833b3e9 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -8,7 +8,7 @@ new FormModel { } add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" - "$columnConstraints": "[][][][][][]" + "$columnConstraints": "[][][][][][][left]" "$rowConstraints": "[][][][][][][][][][][][][][][][][][][][][][][][]" } ) { name: "this" @@ -20,19 +20,25 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label1" - "text": "enabled" + "text": "Enabled" "displayedMnemonic": 69 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 0" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label2" - "text": "disabled" + "text": "Disabled" "displayedMnemonic": 68 "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 0" } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestMultiLineLabel" ) { + name: "testMultiLineLabel1" + "text": "Multi-line label based on JTextArea\n2nd line" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 2 1" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "buttonLabel" "text": "JButton:" @@ -41,7 +47,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button1" - "text": "enabled" + "text": "Enabled" "displayedMnemonicIndex": 0 "toolTipText": "This button is enabled." }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -49,15 +55,23 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button17" - "text": "square" + "text": "Sq" "$client.JButton.buttonType": "square" "$client.JComponent.minimumWidth": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button22" + "text": "Rd" + "$client.JButton.buttonType": "roundRect" + "$client.JComponent.minimumWidth": 0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button2" - "text": "disabled" + "text": "Disabled" "displayedMnemonicIndex": 0 "enabled": false "toolTipText": "This button is disabled." @@ -66,16 +80,25 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button18" - "text": "square" + "text": "Sq" "$client.JButton.buttonType": "square" "enabled": false "$client.JComponent.minimumWidth": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button23" + "text": "Rd" + "$client.JButton.buttonType": "roundRect" + "enabled": false + "$client.JComponent.minimumWidth": 0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestDefaultButton" ) { name: "button5" - "text": "default" + "text": "Default" "displayedMnemonicIndex": 0 "toolTipText": "Tool tip with\nmultiple\nlines." }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -120,6 +143,13 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button20" + "text": "Empty border" + "border": &EmptyBorder0 new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 1" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "toggleButtonLabel" "text": "JToggleButton:" @@ -128,42 +158,57 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton1" - "text": "enabled" + "text": "Enabled" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton9" - "text": "square" + "text": "Sq" "$client.JButton.buttonType": "square" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton19" + "text": "Rd" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 2" } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton10" - "text": "square" + "text": "Sq" "$client.JButton.buttonType": "square" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton20" + "text": "Rd" + "$client.JButton.buttonType": "roundRect" + "enabled": false + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton3" - "text": "selected" + "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 2" } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton4" - "text": "selected disabled" + "text": "Selected disabled" "enabled": false "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -197,6 +242,13 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton18" + "text": "Empty border" + "border": #EmptyBorder0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 2" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "checkBoxLabel" "text": "JCheckBox" @@ -205,14 +257,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox1" - "text": "enabled" + "text": "Enabled" "mnemonic": 65 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 3" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox2" - "text": "disabled" + "text": "Disabled" "enabled": false "mnemonic": 68 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -220,14 +272,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox3" - "text": "selected" + "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 3" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "checkBox4" - "text": "selected disabled" + "text": "Selected disabled" "selected": true "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -235,7 +287,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton5" - "text": "tab" + "text": "Tab" "$client.JButton.buttonType": "tab" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -243,7 +295,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton8" - "text": "tab" + "text": "Tab" "$client.JButton.buttonType": "tab" "enabled": false "selected": true @@ -258,14 +310,14 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton1" - "text": "enabled" + "text": "Enabled" "mnemonic": 78 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 4" } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton2" - "text": "disabled" + "text": "Disabled" "enabled": false "mnemonic": 83 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -273,30 +325,19 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton3" - "text": "selected" + "text": "Selected" "selected": true }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 4" } ) add( new FormComponent( "javax.swing.JRadioButton" ) { name: "radioButton4" - "text": "selected disabled" + "text": "Selected disabled" "selected": true "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 4 4" } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "contentAreaFilledCheckBox" - "text": "contentAreaFilled" - "selected": true - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "contentAreaFilledChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 4" - } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "comboBoxLabel" "text": "JComboBox:" @@ -307,8 +348,8 @@ new FormModel { name: "comboBox1" "editable": true "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "editable" - addElement( "editable" ) + selectedItem: "Editable" + addElement( "Editable" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -321,6 +362,7 @@ new FormModel { addElement( "jj" ) addElement( "kkk" ) } + "maximumRowCount": 6 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 5,growx" } ) @@ -329,8 +371,8 @@ new FormModel { "editable": true "enabled": false "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "disabled" - addElement( "disabled" ) + selectedItem: "Disabled" + addElement( "Disabled" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -341,8 +383,8 @@ new FormModel { add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox3" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "not editable" - addElement( "not editable" ) + selectedItem: "Not editable" + addElement( "Not editable" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -355,14 +397,15 @@ new FormModel { addElement( "jj" ) addElement( "kkk" ) } + "maximumRowCount": 6 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 5,growx" } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox4" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "not editable disabled" - addElement( "not editable disabled" ) + selectedItem: "Not editable disabled" + addElement( "Not editable disabled" ) addElement( "a" ) addElement( "bb" ) addElement( "ccc" ) @@ -373,16 +416,28 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox5" - "prototypeDisplayValue": "12345" "model": new javax.swing.DefaultComboBoxModel { - selectedItem: "wide popup if text is longer" - addElement( "wide popup if text is longer" ) + selectedItem: "Wide popup if text is longer" + addElement( "Wide popup if text is longer" ) addElement( "aa" ) addElement( "bbb" ) addElement( "cccc" ) } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 5,growx" + "value": "cell 5 5,growx,wmax 100" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox6" + "border": #EmptyBorder0 + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "Empty border" + addElement( "Empty border" ) + addElement( "a" ) + addElement( "b" ) + addElement( "c" ) + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 5" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "spinnerLabel" @@ -401,16 +456,35 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 6,growx" } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$ButtonlessSpinner" ) { + name: "buttonlessSpinner1" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 6,growx" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$ButtonlessSpinner" ) { + name: "buttonlessSpinner2" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 6,growx" + } ) add( new FormComponent( "javax.swing.JComboBox" ) { name: "comboBox7" "editable": true - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" auxiliary() { "JavaCodeGenerator.typeParameters": "String" } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 6,growx" } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner3" + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + "model": new javax.swing.SpinnerNumberModel { + value: 12345 + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 6" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "textFieldLabel" "text": "JTextField:" @@ -419,27 +493,30 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField1" - "text": "editable" + "text": "Editable" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 7,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 7,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 7,growx" } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -447,10 +524,17 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextField" ) { name: "textField6" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 7,growx" } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField5" + "text": "Empty border" + "border": #EmptyBorder0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 7" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "formattedTextFieldLabel" "text": "JFormattedTextField:" @@ -459,27 +543,27 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField1" - "text": "editable" + "text": "Editable" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 8,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 8,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 8,growx" } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -487,10 +571,17 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JFormattedTextField" ) { name: "formattedTextField5" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 8,growx" } ) + add( new FormComponent( "javax.swing.JFormattedTextField" ) { + name: "formattedTextField6" + "text": "Empty border" + "border": #EmptyBorder0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 8" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "passwordFieldLabel" "text": "JPasswordField:" @@ -499,27 +590,27 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField1" - "text": "editable" + "text": "Editable" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 9,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField2" - "text": "disabled" + "text": "Disabled" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 9,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField3" - "text": "not editable" + "text": "Not editable" "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 9,growx" } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField4" - "text": "not editable disabled" + "text": "Not editable disabled" "enabled": false "editable": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -527,10 +618,17 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JPasswordField" ) { name: "passwordField5" - "$client.JTextField.placeholderText": "placeholder" + "$client.JTextField.placeholderText": "Placeholder" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 9,growx" } ) + add( new FormComponent( "javax.swing.JPasswordField" ) { + name: "passwordField6" + "text": "empty border" + "border": #EmptyBorder0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 9" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "textAreaLabel" "text": "JTextArea:" @@ -543,7 +641,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea1" - "text": "editable" + "text": "Editable" "rows": 2 } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -555,7 +653,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea2" - "text": "disabled" + "text": "Disabled" "rows": 2 "enabled": false } ) @@ -568,7 +666,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea3" - "text": "not editable" + "text": "Not editable" "rows": 2 "editable": false } ) @@ -581,7 +679,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea4" - "text": "not editable disabled" + "text": "Not editable disabled" "rows": 2 "editable": false "enabled": false @@ -592,7 +690,7 @@ new FormModel { add( new FormComponent( "javax.swing.JTextArea" ) { name: "textArea5" "rows": 2 - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 10,growx" } ) @@ -608,7 +706,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane1" - "text": "editable" + "text": "Editable" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 11,growx" @@ -619,7 +717,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane2" - "text": "disabled" + "text": "Disabled" "enabled": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -631,7 +729,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane3" - "text": "not editable" + "text": "Not editable" "editable": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -643,7 +741,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane4" - "text": "not editable disabled" + "text": "Not editable disabled" "editable": false "enabled": false } ) @@ -652,7 +750,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane5" - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 11,growx" } ) @@ -668,7 +766,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane1" - "text": "editable" + "text": "Editable" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 12,growx" @@ -679,7 +777,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane2" - "text": "disabled" + "text": "Disabled" "enabled": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -691,7 +789,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane3" - "text": "not editable" + "text": "Not editable" "editable": false } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { @@ -703,7 +801,7 @@ new FormModel { "horizontalScrollBarPolicy": 31 add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane4" - "text": "not editable disabled" + "text": "Not editable disabled" "editable": false "enabled": false } ) @@ -712,7 +810,7 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane5" - "text": "no scroll pane" + "text": "No scroll pane" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 5 12,growx" } ) @@ -840,6 +938,147 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 4 13 1 6,growy" } ) + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + name: "scrollPane15" + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel3" + "preferredSize": new java.awt.Dimension( 800, 400 ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button21" + "text": "I'm a large button in a scrollpane with empty border" + "verticalAlignment": 1 + "horizontalAlignment": 2 + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 10 1 3,growy,width 100,height 50" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$columnConstraints": "[][]" + "$rowConstraints": "[][][][]" + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + } ) { + name: "panel5" + "border": new javax.swing.border.TitledBorder( "Control" ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "buttonTypeComboBox" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "-" + addElement( "-" ) + addElement( "square" ) + addElement( "roundRect" ) + addElement( "tab" ) + addElement( "help" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "buttonTypeChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "borderPaintedCheckBox" + "text": "borderPainted" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "borderPaintedChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "roundRectCheckBox" + "text": "roundRect" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "roundRectChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "contentAreaFilledCheckBox" + "text": "contentAreaFilled" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "contentAreaFilledChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class javax.swing.BoxLayout ) { + "axis": 1 + } ) { + name: "panel4" + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "noOutlineRadioButton" + "text": "no outline" + "$buttonGroup": new FormReference( "buttonGroup1" ) + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "outlineChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "errorOutlineRadioButton" + "text": "error" + "$buttonGroup": new FormReference( "buttonGroup1" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "outlineChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "warningOutlineRadioButton" + "text": "warning" + "$buttonGroup": new FormReference( "buttonGroup1" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "outlineChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "magentaOutlineRadioButton" + "text": "magenta" + "$buttonGroup": &FormReference0 new FormReference( "buttonGroup1" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "outlineChanged", false ) ) + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "magentaCyanOutlineRadioButton" + "text": "magenta / cyan" + "$buttonGroup": #FormReference0 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "outlineChanged", false ) ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2 1 2" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "focusPaintedCheckBox" + "text": "focusPainted" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "focusPaintedChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 5 13 2 10,grow" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "scrollBarLabel" "text": "JScrollBar:" @@ -1028,12 +1267,12 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton15" - "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" ) + "icon": &SwingIcon4 new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" ) "selected": true } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton16" - "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" ) + "icon": &SwingIcon5 new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" ) "selected": true } ) add( new FormComponent( "javax.swing.JToggleButton" ) { @@ -1042,11 +1281,82 @@ new FormModel { "selected": true } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 23 3 1,growx" + "value": "cell 1 23 5 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "Square:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 23 5 1" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "toolBar3" + add( new FormComponent( "javax.swing.JButton" ) { + name: "button26" + "icon": #SwingIcon1 + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button27" + "icon": #SwingIcon2 + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton23" + "icon": #SwingIcon4 + "selected": true + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton24" + "icon": #SwingIcon5 + "selected": true + "$client.JButton.buttonType": "square" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 23 5 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "Round:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 23 5 1" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "toolBar4" + add( new FormComponent( "javax.swing.JButton" ) { + name: "button28" + "icon": #SwingIcon1 + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button29" + "icon": #SwingIcon2 + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton25" + "icon": #SwingIcon4 + "selected": true + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton26" + "icon": #SwingIcon5 + "selected": true + "$client.JButton.buttonType": "roundRect" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 23 5 1" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 1005, 800 ) + "size": new java.awt.Dimension( 1135, 800 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "buttonGroup1" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 810 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.java index daf5779e..fed8ad65 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.java @@ -1,14 +1,31 @@ /* - * Created by JFormDesigner on Tue Aug 27 21:47:02 CEST 2019 + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.formdev.flatlaf.testing; -import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER; -import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_SHOW_TAB_SEPARATORS; +import static com.formdev.flatlaf.FlatClientProperties.*; import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.function.BiConsumer; import javax.swing.*; import javax.swing.border.*; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.extras.TriStateCheckBox; +import com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon; +import com.formdev.flatlaf.util.ScaledImageIcon; import com.jgoodies.forms.layout.*; import net.miginfocom.swing.*; @@ -21,104 +38,400 @@ public class FlatContainerTest public static void main( String[] args ) { SwingUtilities.invokeLater( () -> { FlatTestFrame frame = FlatTestFrame.create( args, "FlatContainerTest" ); + frame.useApplyComponentOrientation = true; frame.showFrame( FlatContainerTest::new ); } ); } public FlatContainerTest() { initComponents(); + + tabCountChanged(); + + tabsClosableCheckBox.setSelected( true ); + tabsClosableChanged(); + putTabbedPanesClientProperty( TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT, "Close" ); + + tabScrollCheckBox.setSelected( true ); + tabScrollChanged(); } private void tabScrollChanged() { int tabLayoutPolicy = tabScrollCheckBox.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT; - tabbedPane1.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane2.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane3.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane4.setTabLayoutPolicy( tabLayoutPolicy ); + for( JTabbedPane tabbedPane : allTabbedPanes ) + tabbedPane.setTabLayoutPolicy( tabLayoutPolicy ); + + int tabCount = (Integer) tabCountSpinner.getValue(); + if( tabLayoutPolicy == JTabbedPane.SCROLL_TAB_LAYOUT && tabCount == 4 ) + tabCountSpinner.setValue( 8 ); + else if( tabLayoutPolicy == JTabbedPane.WRAP_TAB_LAYOUT && tabCount == 8 ) + tabCountSpinner.setValue( 4 ); } private void showTabSeparatorsChanged() { Boolean showTabSeparators = showTabSeparatorsCheckBox.isSelected() ? true : null; - tabbedPane1.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane2.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane3.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); - tabbedPane4.putClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); + putTabbedPanesClientProperty( TABBED_PANE_SHOW_TAB_SEPARATORS, showTabSeparators ); + } + + private void hideContentSeparatorChanged() { + Boolean showContentSeparator = hideContentSeparatorCheckBox.isSelected() ? false : null; + putTabbedPanesClientProperty( TABBED_PANE_SHOW_CONTENT_SEPARATOR, showContentSeparator ); } private void hasFullBorderChanged() { Boolean hasFullBorder = hasFullBorderCheckBox.isSelected() ? true : null; - tabbedPane1.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane2.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane3.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane4.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + putTabbedPanesClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); } - private void moreTabsChanged() { - boolean moreTabs = moreTabsCheckBox.isSelected(); - addRemoveMoreTabs( tabbedPane1, moreTabs ); - addRemoveMoreTabs( tabbedPane2, moreTabs ); - addRemoveMoreTabs( tabbedPane3, moreTabs ); - addRemoveMoreTabs( tabbedPane4, moreTabs ); + private void putTabbedPanesClientProperty( String key, Object value ) { + for( JTabbedPane tabbedPane : allTabbedPanes ) + tabbedPane.putClientProperty( key, value ); } - private void addRemoveMoreTabs( JTabbedPane tabbedPane, boolean add ) { - if( add ) { - tabbedPane.addTab( "Tab 4", new JLabel( "tab 4" ) ); - tabbedPane.addTab( "Tab 5", new JLabel( "tab 5" ) ); - } else { - int tabCount = tabbedPane.getTabCount(); - if( tabCount > 3 ) { - for( int i = 0; i < 2; i++ ) - tabbedPane.removeTabAt( tabbedPane.getTabCount() - 1 ); + private void tabCountChanged() { + for( JTabbedPane tabbedPane : allTabbedPanes ) + tabCountChanged( tabbedPane ); + } + + private void tabCountChanged( JTabbedPane tabbedPane ) { + int oldTabCount = tabbedPane.getTabCount(); + int newTabCount = (Integer) tabCountSpinner.getValue(); + + if( newTabCount > oldTabCount ) { + for( int i = oldTabCount + 1; i <= newTabCount; i++ ) + addTab( tabbedPane ); + } else if( newTabCount < oldTabCount ) { + while( tabbedPane.getTabCount() > newTabCount ) + tabbedPane.removeTabAt( tabbedPane.getTabCount() - 1 ); + } + + customTabsChanged( tabbedPane ); + tabBackForegroundChanged( tabbedPane ); + setTabIcons( tabbedPane ); + } + + private void addTab( JTabbedPane tabbedPane ) { + switch( tabbedPane.getTabCount() ) { + case 0: + tabbedPane.addTab( "Tab 1", null, new Panel1(), "First tab." ); + break; + + case 1: + JComponent tab2 = new Panel2(); + tab2.setBorder( new LineBorder( Color.magenta ) ); + tabbedPane.addTab( "Second Tab", null, tab2, "This is the second tab." ); + break; + + case 2: + tabbedPane.addTab( "Disabled", createTab( "tab content 3" ) ); + tabbedPane.setEnabledAt( 2, false ); + tabbedPane.setToolTipTextAt( 2, "Disabled tab." ); + break; + + case 3: + tabbedPane.addTab( "Tab 4", new JLabel( "non-opaque content", SwingConstants.CENTER ) ); + break; + + default: + int index = tabbedPane.getTabCount() + 1; + tabbedPane.addTab( "Tab " + index, createTab( "tab content " + index ) ); + break; + } + + } + + private JComponent createTab( String text ) { + JLabel label = new JLabel( text ); + label.setHorizontalAlignment( SwingConstants.CENTER ); + + JPanel tab = new JPanel( new BorderLayout() ); + tab.add( label, BorderLayout.CENTER ); + return tab; + } + + private void tabIconsChanged() { + for( JTabbedPane tabbedPane : allTabbedPanes ) + setTabIcons( tabbedPane ); + + tabIconSizeSpinner.setEnabled( tabIconsCheckBox.isSelected() ); + } + + private void setTabIcons( JTabbedPane tabbedPane ) { + boolean showTabIcons = tabIconsCheckBox.isSelected(); + Object iconSize = tabIconSizeSpinner.getValue(); + + Icon icon = null; + Icon disabledIcon = null; + if( showTabIcons ) { + ImageIcon imageIcon = new ImageIcon( getClass().getResource( "/com/formdev/flatlaf/testing/test" + iconSize + ".png" ) ); + icon = new ScaledImageIcon( imageIcon ); + disabledIcon = UIManager.getLookAndFeel().getDisabledIcon( tabbedPane, imageIcon ); + if( disabledIcon instanceof ImageIcon ) + disabledIcon = new ScaledImageIcon( (ImageIcon) disabledIcon ); + } + + int tabCount = tabbedPane.getTabCount(); + for( int i = 0; i < tabCount; i++ ) { + tabbedPane.setIconAt( i, icon ); + tabbedPane.setDisabledIconAt( i, disabledIcon ); + } + } + + private void iconPlacementChanged() { + Object iconPlacement = null; + switch( (String) iconPlacementField.getSelectedItem() ) { + case "leading": iconPlacement = SwingConstants.LEADING; break; + case "trailing": iconPlacement = SwingConstants.TRAILING; break; + case "top": iconPlacement = SwingConstants.TOP; break; + case "bottom": iconPlacement = SwingConstants.BOTTOM; break; + } + putTabbedPanesClientProperty( TABBED_PANE_TAB_ICON_PLACEMENT, iconPlacement ); + } + + private void customBorderChanged() { + Border border = customBorderCheckBox.isSelected() + ? new MatteBorder( 10, 20, 25, 35, Color.green ) + : null; + + for( JTabbedPane tabbedPane : allTabbedPanes ) + tabbedPane.setBorder( border ); + } + + private void customTabsChanged() { + for( JTabbedPane tabbedPane : allTabbedPanes ) + customTabsChanged( tabbedPane ); + } + + private void customTabsChanged( JTabbedPane tabbedPane ) { + boolean customTabs = customTabsCheckBox.isSelected(); + int tabCount = tabbedPane.getTabCount(); + if( tabCount > 1 ) + tabbedPane.setTabComponentAt( 1, customTabs ? new JButton( tabbedPane.getTitleAt( 1 ) ) : null ); + if( tabCount > 3 ) + tabbedPane.setTabComponentAt( 3, customTabs ? createCustomTab( tabbedPane.getTitleAt( 3 ) ) : null ); + if( tabCount > 5 ) + tabbedPane.setTabComponentAt( 5, customTabs ? new JCheckBox( tabbedPane.getTitleAt( 5 ) ) : null ); + } + + private Component createCustomTab( String tabTitle ) { + JButton closeButton; + if( UIManager.getLookAndFeel() instanceof FlatLaf ) { + closeButton = new JButton( new FlatInternalFrameCloseIcon() ); + closeButton.setContentAreaFilled( false ); + closeButton.setBorder( null ); + } else + closeButton = new JButton( "x" ); + + JPanel tab = new JPanel( new BorderLayout( 5, 0 ) ); + tab.setOpaque( false ); + tab.add( closeButton, BorderLayout.EAST ); + tab.add( new JLabel( tabTitle ), BorderLayout.CENTER ); + return tab; + } + + private void htmlTabsChanged() { + for( JTabbedPane tabbedPane : allTabbedPanes ) + htmlTabsChanged( tabbedPane ); + } + + private void htmlTabsChanged( JTabbedPane tabbedPane ) { + boolean html = htmlTabsCheckBox.isSelected(); + boolean multiLine = multiLineTabsCheckBox.isSelected(); + String s = multiLine + ? "Bold Tab
Second Line " + : (html ? "Bold Tab " : "Tab "); + int tabCount = tabbedPane.getTabCount(); + if( tabCount > 0 ) + tabbedPane.setTitleAt( 0, s + "1" ); + if( tabCount > 3 ) + tabbedPane.setTitleAt( 3, s + "4" ); + } + + private void tabPlacementChanged() { + int tabPlacement = -1; + switch( (String) tabPlacementField.getSelectedItem() ) { + case "top": tabPlacement = SwingConstants.TOP; break; + case "bottom": tabPlacement = SwingConstants.BOTTOM; break; + case "left": tabPlacement = SwingConstants.LEFT; break; + case "right": tabPlacement = SwingConstants.RIGHT; break; + } + + tabbedPane1.setTabPlacement( (tabPlacement >= 0) ? tabPlacement : SwingConstants.TOP ); + tabbedPane2.setTabPlacement( (tabPlacement >= 0) ? tabPlacement : SwingConstants.BOTTOM ); + tabbedPane3.setTabPlacement( (tabPlacement >= 0) ? tabPlacement : SwingConstants.LEFT ); + tabbedPane4.setTabPlacement( (tabPlacement >= 0) ? tabPlacement : SwingConstants.RIGHT ); + } + + private void hiddenTabsNavigationChanged() { + String value = (String) hiddenTabsNavigationField.getSelectedItem(); + if( "default".equals( value ) ) + value = null; + putTabbedPanesClientProperty( TABBED_PANE_HIDDEN_TABS_NAVIGATION, value ); + } + + private void tabAreaAlignmentChanged() { + String value = (String) tabAreaAlignmentField.getSelectedItem(); + if( "default".equals( value ) ) + value = null; + putTabbedPanesClientProperty( TABBED_PANE_TAB_AREA_ALIGNMENT, value ); + } + + private void tabWidthModeChanged() { + String value = (String) tabWidthModeField.getSelectedItem(); + if( "default".equals( value ) ) + value = null; + putTabbedPanesClientProperty( TABBED_PANE_TAB_WIDTH_MODE, value ); + } + + private void tabBackForegroundChanged() { + for( JTabbedPane tabbedPane : allTabbedPanes ) + tabBackForegroundChanged( tabbedPane ); + } + + private void tabBackForegroundChanged( JTabbedPane tabbedPane ) { + boolean enabled = tabBackForegroundCheckBox.isSelected(); + int tabCount = tabbedPane.getTabCount(); + if( tabCount > 0 ) + tabbedPane.setBackgroundAt( 0, enabled ? Color.red : null ); + if( tabCount > 1 ) + tabbedPane.setForegroundAt( 1, enabled ? Color.red : null ); + } + + private void leadingComponentChanged() { + leadingTrailingComponentChanged( leadingComponentCheckBox.isSelected(), TABBED_PANE_LEADING_COMPONENT, "L", 4 ); + } + + private void trailingComponentChanged() { + leadingTrailingComponentChanged( trailingComponentCheckBox.isSelected(), TABBED_PANE_TRAILING_COMPONENT, "Trailing", 12 ); + } + + private void leadingTrailingComponentChanged( boolean enabled, String key, String text, int gap ) { + for( JTabbedPane tabbedPane : allTabbedPanes ) { + JComponent c = null; + if( enabled ) { + c = new JLabel( text ); + c.setOpaque( true ); + c.setBackground( key.equals( TABBED_PANE_LEADING_COMPONENT ) ? Color.cyan : Color.orange ); + c.setBorder( new EmptyBorder( gap, gap, gap, gap ) ); + } + tabbedPane.putClientProperty( key, c ); + } + } + + private void tabsClosableChanged() { + boolean closable = tabsClosableCheckBox.isSelected(); + putTabbedPanesClientProperty( TABBED_PANE_TAB_CLOSABLE, closable ? true : null ); + + if( closable ) { + putTabbedPanesClientProperty( TABBED_PANE_TAB_CLOSE_CALLBACK, + (BiConsumer) (tabbedPane, tabIndex) -> { + AWTEvent e = EventQueue.getCurrentEvent(); + int modifiers = (e instanceof MouseEvent) ? ((MouseEvent)e).getModifiers() : 0; + JOptionPane.showMessageDialog( this, "Closed tab '" + tabbedPane.getTitleAt( tabIndex ) + "'." + + "\n\n(modifiers: " + MouseEvent.getMouseModifiersText( modifiers ) + ")", + "Tab Closed", JOptionPane.PLAIN_MESSAGE ); + } ); + } + } + + private void secondTabClosableChanged() { + Boolean value = secondTabClosableCheckBox.getValue(); + + for( JTabbedPane tabbedPane : allTabbedPanes ) { + if( tabbedPane.getTabCount() > 1 ) { + Component c = tabbedPane.getComponentAt( 1 ); + ((JComponent)c).putClientProperty( TABBED_PANE_TAB_CLOSABLE, value ); } } } + private void tabAreaInsetsChanged() { + Insets insets = tabAreaInsetsCheckBox.isSelected() ? new Insets( 5, 5, 10, 10 ) : null; + putTabbedPanesClientProperty( TABBED_PANE_TAB_AREA_INSETS, insets ); + } + + private void smallerTabHeightChanged() { + Integer tabHeight = smallerTabHeightCheckBox.isSelected() ? 26 : null; + putTabbedPanesClientProperty( TABBED_PANE_TAB_HEIGHT, tabHeight ); + } + + private void smallerInsetsChanged() { + Insets insets = smallerInsetsCheckBox.isSelected() ? new Insets( 2, 2, 2, 2 ) : null; + putTabbedPanesClientProperty( TABBED_PANE_TAB_INSETS, insets ); + } + + private void secondTabWiderChanged() { + Insets insets = secondTabWiderCheckBox.isSelected() ? new Insets( 4, 20, 4, 20 ) : null; + + for( JTabbedPane tabbedPane : allTabbedPanes ) { + if( tabbedPane.getTabCount() > 1 ) { + Component c = tabbedPane.getComponentAt( 1 ); + ((JComponent)c).putClientProperty( TABBED_PANE_TAB_INSETS, insets ); + } + } + } + + private void minimumTabWidthChanged() { + Integer minimumTabWidth = minimumTabWidthCheckBox.isSelected() ? 100 : null; + putTabbedPanesClientProperty( TABBED_PANE_MINIMUM_TAB_WIDTH, minimumTabWidth ); + } + + private void maximumTabWidthChanged() { + Integer maximumTabWidth = maximumTabWidthCheckBox.isSelected() ? 60 : null; + putTabbedPanesClientProperty( TABBED_PANE_MAXIMUM_TAB_WIDTH, maximumTabWidth ); + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JPanel panel9 = new JPanel(); JLabel splitPaneLabel = new JLabel(); JSplitPane splitPane3 = new JSplitPane(); JSplitPane splitPane1 = new JSplitPane(); - JPanel panel10 = new JPanel(); - JTextField textField2 = new JTextField(); - JButton button1 = new JButton(); - JPanel panel11 = new JPanel(); - JTextField textField3 = new JTextField(); - JButton button2 = new JButton(); + FlatContainerTest.Panel1 panel15 = new FlatContainerTest.Panel1(); + FlatContainerTest.Panel2 panel21 = new FlatContainerTest.Panel2(); JSplitPane splitPane2 = new JSplitPane(); JPanel panel12 = new JPanel(); + JLabel label3 = new JLabel(); JPanel panel13 = new JPanel(); + JLabel label4 = new JLabel(); JLabel tabbedPaneLabel = new JLabel(); tabbedPane1 = new JTabbedPane(); - JPanel panel1 = new JPanel(); - JLabel label1 = new JLabel(); - JTextField textField4 = new JTextField(); - JButton button3 = new JButton(); - JPanel panel2 = new JPanel(); - JTextField textField5 = new JTextField(); - JButton button4 = new JButton(); - JLabel label2 = new JLabel(); tabbedPane3 = new JTabbedPane(); - JPanel panel5 = new JPanel(); - JLabel label5 = new JLabel(); - JPanel panel6 = new JPanel(); - JLabel label6 = new JLabel(); tabbedPane2 = new JTabbedPane(); - JPanel panel3 = new JPanel(); - JLabel label3 = new JLabel(); - JPanel panel4 = new JPanel(); - JLabel label4 = new JLabel(); tabbedPane4 = new JTabbedPane(); - JPanel panel7 = new JPanel(); - JLabel label7 = new JLabel(); - JPanel panel8 = new JPanel(); - JLabel label8 = new JLabel(); - JPanel panel14 = new JPanel(); - moreTabsCheckBox = new JCheckBox(); + FlatTestFrame.NoRightToLeftPanel tabbedPaneControlPanel = new FlatTestFrame.NoRightToLeftPanel(); tabScrollCheckBox = new JCheckBox(); - showTabSeparatorsCheckBox = new JCheckBox(); + JLabel tabCountLabel = new JLabel(); + tabCountSpinner = new JSpinner(); + customTabsCheckBox = new JCheckBox(); + htmlTabsCheckBox = new JCheckBox(); + multiLineTabsCheckBox = new JCheckBox(); + JLabel hiddenTabsNavigationLabel = new JLabel(); + hiddenTabsNavigationField = new JComboBox<>(); + tabBackForegroundCheckBox = new JCheckBox(); + JLabel tabPlacementLabel = new JLabel(); + tabPlacementField = new JComboBox<>(); + tabIconsCheckBox = new JCheckBox(); + tabIconSizeSpinner = new JSpinner(); + iconPlacementField = new JComboBox<>(); + JLabel tabAreaAlignmentLabel = new JLabel(); + tabAreaAlignmentField = new JComboBox<>(); + JLabel tabWidthModeLabel = new JLabel(); + tabWidthModeField = new JComboBox<>(); + tabsClosableCheckBox = new JCheckBox(); + customBorderCheckBox = new JCheckBox(); + tabAreaInsetsCheckBox = new JCheckBox(); + secondTabClosableCheckBox = new TriStateCheckBox(); hasFullBorderCheckBox = new JCheckBox(); + smallerTabHeightCheckBox = new JCheckBox(); + leadingComponentCheckBox = new JCheckBox(); + hideContentSeparatorCheckBox = new JCheckBox(); + smallerInsetsCheckBox = new JCheckBox(); + trailingComponentCheckBox = new JCheckBox(); + showTabSeparatorsCheckBox = new JCheckBox(); + secondTabWiderCheckBox = new JCheckBox(); + minimumTabWidthCheckBox = new JCheckBox(); + maximumTabWidthCheckBox = new JCheckBox(); CellConstraints cc = new CellConstraints(); //======== this ======== @@ -133,8 +446,8 @@ public class FlatContainerTest { panel9.setOpaque(false); panel9.setLayout(new FormLayout( - "70dlu:grow, $lcgap, 70dlu:grow", - "default, $lgap, fill:70dlu, $lgap, pref, 2*($lgap, fill:70dlu:grow), $lgap, pref")); + "70dlu:grow, $ugap, 70dlu:grow", + "default, $lgap, fill:70dlu, $pgap, pref, $lgap, fill:80dlu:grow, $ugap, fill:80dlu:grow, $pgap, pref")); //---- splitPaneLabel ---- splitPaneLabel.setText("JSplitPane:"); @@ -149,35 +462,13 @@ public class FlatContainerTest splitPane1.setResizeWeight(0.5); splitPane1.setOneTouchExpandable(true); - //======== panel10 ======== - { - panel10.setBackground(Color.orange); - panel10.setLayout(new FlowLayout()); + //---- panel15 ---- + panel15.setBackground(new Color(217, 163, 67)); + splitPane1.setLeftComponent(panel15); - //---- textField2 ---- - textField2.setText("some text"); - panel10.add(textField2); - - //---- button1 ---- - button1.setText("..."); - panel10.add(button1); - } - splitPane1.setLeftComponent(panel10); - - //======== panel11 ======== - { - panel11.setBackground(Color.magenta); - panel11.setLayout(new FlowLayout()); - - //---- textField3 ---- - textField3.setText("some text"); - panel11.add(textField3); - - //---- button2 ---- - button2.setText("..."); - panel11.add(button2); - } - splitPane1.setRightComponent(panel11); + //---- panel21 ---- + panel21.setBackground(new Color(98, 181, 67)); + splitPane1.setRightComponent(panel21); } splitPane3.setLeftComponent(splitPane1); @@ -189,15 +480,27 @@ public class FlatContainerTest //======== panel12 ======== { - panel12.setBackground(Color.orange); - panel12.setLayout(new FlowLayout()); + panel12.setBackground(new Color(242, 101, 34)); + panel12.setLayout(new BorderLayout()); + + //---- label3 ---- + label3.setText("TOP"); + label3.setHorizontalAlignment(SwingConstants.CENTER); + label3.setForeground(Color.white); + panel12.add(label3, BorderLayout.CENTER); } splitPane2.setTopComponent(panel12); //======== panel13 ======== { - panel13.setBackground(Color.magenta); - panel13.setLayout(new FlowLayout()); + panel13.setBackground(new Color(64, 182, 224)); + panel13.setLayout(new BorderLayout()); + + //---- label4 ---- + label4.setText("BOTTOM"); + label4.setHorizontalAlignment(SwingConstants.CENTER); + label4.setForeground(Color.white); + panel13.add(label4, BorderLayout.CENTER); } splitPane2.setBottomComponent(panel13); } @@ -208,171 +511,236 @@ public class FlatContainerTest //---- tabbedPaneLabel ---- tabbedPaneLabel.setText("JTabbedPane:"); panel9.add(tabbedPaneLabel, cc.xy(1, 5)); - - //======== tabbedPane1 ======== - { - - //======== panel1 ======== - { - panel1.setLayout(new FlowLayout()); - - //---- label1 ---- - label1.setText("TOP"); - panel1.add(label1); - - //---- textField4 ---- - textField4.setText("some text"); - panel1.add(textField4); - - //---- button3 ---- - button3.setText("..."); - panel1.add(button3); - } - tabbedPane1.addTab("Tab 1", panel1); - - //======== panel2 ======== - { - panel2.setBorder(new LineBorder(Color.magenta)); - panel2.setLayout(new FlowLayout()); - - //---- textField5 ---- - textField5.setText("some text"); - panel2.add(textField5); - - //---- button4 ---- - button4.setText("..."); - panel2.add(button4); - } - tabbedPane1.addTab("Tab 2", panel2); - - //---- label2 ---- - label2.setText("text"); - tabbedPane1.addTab("Tab 3", label2); - } panel9.add(tabbedPane1, cc.xy(1, 7)); //======== tabbedPane3 ======== { tabbedPane3.setTabPlacement(SwingConstants.LEFT); - - //======== panel5 ======== - { - panel5.setLayout(new FlowLayout()); - - //---- label5 ---- - label5.setText("LEFT"); - panel5.add(label5); - } - tabbedPane3.addTab("Tab 1", panel5); - - //======== panel6 ======== - { - panel6.setBorder(new LineBorder(Color.magenta)); - panel6.setLayout(new FlowLayout()); - } - tabbedPane3.addTab("Tab 2", panel6); - - //---- label6 ---- - label6.setText("text"); - tabbedPane3.addTab("Tab 3", label6); } panel9.add(tabbedPane3, cc.xy(3, 7)); //======== tabbedPane2 ======== { tabbedPane2.setTabPlacement(SwingConstants.BOTTOM); - - //======== panel3 ======== - { - panel3.setLayout(new FlowLayout()); - - //---- label3 ---- - label3.setText("BOTTOM"); - panel3.add(label3); - } - tabbedPane2.addTab("Tab 1", panel3); - - //======== panel4 ======== - { - panel4.setBorder(new LineBorder(Color.magenta)); - panel4.setLayout(new FlowLayout()); - } - tabbedPane2.addTab("Tab 2", panel4); - tabbedPane2.setEnabledAt(1, false); - - //---- label4 ---- - label4.setText("text"); - tabbedPane2.addTab("Tab 3", label4); } panel9.add(tabbedPane2, cc.xy(1, 9)); //======== tabbedPane4 ======== { tabbedPane4.setTabPlacement(SwingConstants.RIGHT); - - //======== panel7 ======== - { - panel7.setLayout(new FlowLayout()); - - //---- label7 ---- - label7.setText("RIGHT"); - panel7.add(label7); - } - tabbedPane4.addTab("Tab 1", panel7); - - //======== panel8 ======== - { - panel8.setBorder(new LineBorder(Color.magenta)); - panel8.setLayout(new FlowLayout()); - } - tabbedPane4.addTab("Tab 2", panel8); - - //---- label8 ---- - label8.setText("text"); - tabbedPane4.addTab("Tab 3", label8); } panel9.add(tabbedPane4, cc.xy(3, 9)); - //======== panel14 ======== + //======== tabbedPaneControlPanel ======== { - panel14.setOpaque(false); - panel14.setLayout(new MigLayout( + tabbedPaneControlPanel.setOpaque(false); + tabbedPaneControlPanel.setLayout(new MigLayout( "insets 0,hidemode 3", // columns "[]" + - "[]" + - "[]" + + "[fill]" + "[]", // rows - "[center]")); - - //---- moreTabsCheckBox ---- - moreTabsCheckBox.setText("more tabs"); - moreTabsCheckBox.setMnemonic('M'); - moreTabsCheckBox.addActionListener(e -> moreTabsChanged()); - panel14.add(moreTabsCheckBox, "cell 0 0"); + "[center]" + + "[]" + + "[]" + + "[]para" + + "[]" + + "[]para" + + "[]" + + "[]para" + + "[]" + + "[]")); //---- tabScrollCheckBox ---- - tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL"); + tabScrollCheckBox.setText("Use scroll layout"); tabScrollCheckBox.setMnemonic('S'); tabScrollCheckBox.addActionListener(e -> tabScrollChanged()); - panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0"); + tabbedPaneControlPanel.add(tabScrollCheckBox, "cell 0 0,alignx left,growx 0"); - //---- showTabSeparatorsCheckBox ---- - showTabSeparatorsCheckBox.setText("JTabbedPane.showTabSeparators"); - showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged()); - panel14.add(showTabSeparatorsCheckBox, "cell 2 0"); + //---- tabCountLabel ---- + tabCountLabel.setText("Tab count:"); + tabbedPaneControlPanel.add(tabCountLabel, "cell 1 0"); + + //---- tabCountSpinner ---- + tabCountSpinner.setModel(new SpinnerNumberModel(4, 0, null, 1)); + tabCountSpinner.addChangeListener(e -> tabCountChanged()); + tabbedPaneControlPanel.add(tabCountSpinner, "cell 1 0"); + + //---- customTabsCheckBox ---- + customTabsCheckBox.setText("Custom tabs"); + customTabsCheckBox.addActionListener(e -> customTabsChanged()); + tabbedPaneControlPanel.add(customTabsCheckBox, "cell 2 0"); + + //---- htmlTabsCheckBox ---- + htmlTabsCheckBox.setText("HTML"); + htmlTabsCheckBox.addActionListener(e -> htmlTabsChanged()); + tabbedPaneControlPanel.add(htmlTabsCheckBox, "cell 2 0"); + + //---- multiLineTabsCheckBox ---- + multiLineTabsCheckBox.setText("multi-line"); + multiLineTabsCheckBox.addActionListener(e -> htmlTabsChanged()); + tabbedPaneControlPanel.add(multiLineTabsCheckBox, "cell 2 0"); + + //---- hiddenTabsNavigationLabel ---- + hiddenTabsNavigationLabel.setText("Hidden tabs navigation:"); + tabbedPaneControlPanel.add(hiddenTabsNavigationLabel, "cell 0 1"); + + //---- hiddenTabsNavigationField ---- + hiddenTabsNavigationField.setModel(new DefaultComboBoxModel<>(new String[] { + "default", + "moreTabsButton", + "arrowButtons" + })); + hiddenTabsNavigationField.addActionListener(e -> hiddenTabsNavigationChanged()); + tabbedPaneControlPanel.add(hiddenTabsNavigationField, "cell 1 1"); + + //---- tabBackForegroundCheckBox ---- + tabBackForegroundCheckBox.setText("Tab back/foreground"); + tabBackForegroundCheckBox.addActionListener(e -> tabBackForegroundChanged()); + tabbedPaneControlPanel.add(tabBackForegroundCheckBox, "cell 2 1"); + + //---- tabPlacementLabel ---- + tabPlacementLabel.setText("Tab placement:"); + tabbedPaneControlPanel.add(tabPlacementLabel, "cell 0 2"); + + //---- tabPlacementField ---- + tabPlacementField.setModel(new DefaultComboBoxModel<>(new String[] { + "default", + "top", + "bottom", + "left", + "right" + })); + tabPlacementField.addActionListener(e -> tabPlacementChanged()); + tabbedPaneControlPanel.add(tabPlacementField, "cell 1 2"); + + //---- tabIconsCheckBox ---- + tabIconsCheckBox.setText("Tab icons"); + tabIconsCheckBox.addActionListener(e -> tabIconsChanged()); + tabbedPaneControlPanel.add(tabIconsCheckBox, "cell 2 2"); + + //---- tabIconSizeSpinner ---- + tabIconSizeSpinner.setModel(new SpinnerListModel(new String[] {"16", "24", "32", "48", "64"})); + tabIconSizeSpinner.setEnabled(false); + tabIconSizeSpinner.addChangeListener(e -> tabIconsChanged()); + tabbedPaneControlPanel.add(tabIconSizeSpinner, "cell 2 2"); + + //---- iconPlacementField ---- + iconPlacementField.setModel(new DefaultComboBoxModel<>(new String[] { + "leading", + "trailing", + "top", + "bottom" + })); + iconPlacementField.addActionListener(e -> iconPlacementChanged()); + tabbedPaneControlPanel.add(iconPlacementField, "cell 2 2"); + + //---- tabAreaAlignmentLabel ---- + tabAreaAlignmentLabel.setText("Tab area alignment:"); + tabbedPaneControlPanel.add(tabAreaAlignmentLabel, "cell 0 3"); + + //---- tabAreaAlignmentField ---- + tabAreaAlignmentField.setModel(new DefaultComboBoxModel<>(new String[] { + "default", + "leading", + "trailing", + "center", + "fill" + })); + tabAreaAlignmentField.addActionListener(e -> tabAreaAlignmentChanged()); + tabbedPaneControlPanel.add(tabAreaAlignmentField, "cell 1 3"); + + //---- tabWidthModeLabel ---- + tabWidthModeLabel.setText("Tab width mode:"); + tabbedPaneControlPanel.add(tabWidthModeLabel, "cell 2 3"); + + //---- tabWidthModeField ---- + tabWidthModeField.setModel(new DefaultComboBoxModel<>(new String[] { + "default", + "preferred", + "equal", + "compact" + })); + tabWidthModeField.addActionListener(e -> tabWidthModeChanged()); + tabbedPaneControlPanel.add(tabWidthModeField, "cell 2 3"); + + //---- tabsClosableCheckBox ---- + tabsClosableCheckBox.setText("Tabs closable"); + tabsClosableCheckBox.addActionListener(e -> tabsClosableChanged()); + tabbedPaneControlPanel.add(tabsClosableCheckBox, "cell 0 4"); + + //---- customBorderCheckBox ---- + customBorderCheckBox.setText("Custom border"); + customBorderCheckBox.addActionListener(e -> customBorderChanged()); + tabbedPaneControlPanel.add(customBorderCheckBox, "cell 1 4"); + + //---- tabAreaInsetsCheckBox ---- + tabAreaInsetsCheckBox.setText("Tab area insets (5,5,10,10)"); + tabAreaInsetsCheckBox.addActionListener(e -> tabAreaInsetsChanged()); + tabbedPaneControlPanel.add(tabAreaInsetsCheckBox, "cell 2 4"); + + //---- secondTabClosableCheckBox ---- + secondTabClosableCheckBox.setText("Second Tab closable"); + secondTabClosableCheckBox.addActionListener(e -> secondTabClosableChanged()); + tabbedPaneControlPanel.add(secondTabClosableCheckBox, "cell 0 5"); //---- hasFullBorderCheckBox ---- - hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder"); - hasFullBorderCheckBox.setMnemonic('F'); + hasFullBorderCheckBox.setText("Show content border"); hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged()); - panel14.add(hasFullBorderCheckBox, "cell 3 0,alignx left,growx 0"); + tabbedPaneControlPanel.add(hasFullBorderCheckBox, "cell 1 5,alignx left,growx 0"); + + //---- smallerTabHeightCheckBox ---- + smallerTabHeightCheckBox.setText("Smaller tab height (26)"); + smallerTabHeightCheckBox.addActionListener(e -> smallerTabHeightChanged()); + tabbedPaneControlPanel.add(smallerTabHeightCheckBox, "cell 2 5"); + + //---- leadingComponentCheckBox ---- + leadingComponentCheckBox.setText("Leading component"); + leadingComponentCheckBox.addActionListener(e -> leadingComponentChanged()); + tabbedPaneControlPanel.add(leadingComponentCheckBox, "cell 0 6"); + + //---- hideContentSeparatorCheckBox ---- + hideContentSeparatorCheckBox.setText("Hide content separator"); + hideContentSeparatorCheckBox.addActionListener(e -> hideContentSeparatorChanged()); + tabbedPaneControlPanel.add(hideContentSeparatorCheckBox, "cell 1 6"); + + //---- smallerInsetsCheckBox ---- + smallerInsetsCheckBox.setText("Smaller tab insets (2,2,2,2)"); + smallerInsetsCheckBox.addActionListener(e -> smallerInsetsChanged()); + tabbedPaneControlPanel.add(smallerInsetsCheckBox, "cell 2 6"); + + //---- trailingComponentCheckBox ---- + trailingComponentCheckBox.setText("Trailing component"); + trailingComponentCheckBox.addActionListener(e -> trailingComponentChanged()); + tabbedPaneControlPanel.add(trailingComponentCheckBox, "cell 0 7"); + + //---- showTabSeparatorsCheckBox ---- + showTabSeparatorsCheckBox.setText("Show tab separators"); + showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged()); + tabbedPaneControlPanel.add(showTabSeparatorsCheckBox, "cell 1 7"); + + //---- secondTabWiderCheckBox ---- + secondTabWiderCheckBox.setText("Second Tab insets wider (4,20,4,20)"); + secondTabWiderCheckBox.addActionListener(e -> secondTabWiderChanged()); + tabbedPaneControlPanel.add(secondTabWiderCheckBox, "cell 2 7"); + + //---- minimumTabWidthCheckBox ---- + minimumTabWidthCheckBox.setText("Minimum tab width (100)"); + minimumTabWidthCheckBox.addActionListener(e -> minimumTabWidthChanged()); + tabbedPaneControlPanel.add(minimumTabWidthCheckBox, "cell 2 8"); + + //---- maximumTabWidthCheckBox ---- + maximumTabWidthCheckBox.setText("Maximum tab width (60)"); + maximumTabWidthCheckBox.addActionListener(e -> maximumTabWidthChanged()); + tabbedPaneControlPanel.add(maximumTabWidthCheckBox, "cell 2 9"); } - panel9.add(panel14, cc.xywh(1, 11, 3, 1)); + panel9.add(tabbedPaneControlPanel, cc.xywh(1, 11, 3, 1)); } add(panel9, "cell 0 0"); // JFormDesigner - End of component initialization //GEN-END:initComponents + + allTabbedPanes = new JTabbedPane[] { tabbedPane1, tabbedPane2, tabbedPane3, tabbedPane4 }; } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @@ -380,9 +748,114 @@ public class FlatContainerTest private JTabbedPane tabbedPane3; private JTabbedPane tabbedPane2; private JTabbedPane tabbedPane4; - private JCheckBox moreTabsCheckBox; private JCheckBox tabScrollCheckBox; - private JCheckBox showTabSeparatorsCheckBox; + private JSpinner tabCountSpinner; + private JCheckBox customTabsCheckBox; + private JCheckBox htmlTabsCheckBox; + private JCheckBox multiLineTabsCheckBox; + private JComboBox hiddenTabsNavigationField; + private JCheckBox tabBackForegroundCheckBox; + private JComboBox tabPlacementField; + private JCheckBox tabIconsCheckBox; + private JSpinner tabIconSizeSpinner; + private JComboBox iconPlacementField; + private JComboBox tabAreaAlignmentField; + private JComboBox tabWidthModeField; + private JCheckBox tabsClosableCheckBox; + private JCheckBox customBorderCheckBox; + private JCheckBox tabAreaInsetsCheckBox; + private TriStateCheckBox secondTabClosableCheckBox; private JCheckBox hasFullBorderCheckBox; + private JCheckBox smallerTabHeightCheckBox; + private JCheckBox leadingComponentCheckBox; + private JCheckBox hideContentSeparatorCheckBox; + private JCheckBox smallerInsetsCheckBox; + private JCheckBox trailingComponentCheckBox; + private JCheckBox showTabSeparatorsCheckBox; + private JCheckBox secondTabWiderCheckBox; + private JCheckBox minimumTabWidthCheckBox; + private JCheckBox maximumTabWidthCheckBox; // JFormDesigner - End of variables declaration //GEN-END:variables + + private JTabbedPane[] allTabbedPanes; + + //---- class Tab1Panel ---------------------------------------------------- + + private static class Panel1 + extends JPanel + { + private Panel1() { + initComponents(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JLabel label1 = new JLabel(); + JTextField textField4 = new JTextField(); + JButton button3 = new JButton(); + + //======== this ======== + setLayout(new MigLayout( + "hidemode 3,align center center", + // columns + "[fill]" + + "[fill]" + + "[fill]", + // rows + "[fill]")); + + //---- label1 ---- + label1.setText("text"); + add(label1, "cell 0 0"); + + //---- textField4 ---- + textField4.setText("some text"); + add(textField4, "cell 1 0"); + + //---- button3 ---- + button3.setText("..."); + add(button3, "cell 2 0"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + // JFormDesigner - End of variables declaration //GEN-END:variables + } + + //---- class Tab2Panel ---------------------------------------------------- + + private static class Panel2 + extends JPanel + { + private Panel2() { + initComponents(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JTextField textField5 = new JTextField(); + JButton button4 = new JButton(); + + //======== this ======== + setLayout(new MigLayout( + "insets 0,hidemode 3,align center center", + // columns + "[fill]" + + "[fill]", + // rows + "[fill]")); + + //---- textField5 ---- + textField5.setText("more text"); + add(textField5, "cell 0 0"); + + //---- button4 ---- + button4.setText("..."); + add(button4, "cell 1 0"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + // JFormDesigner - End of variables declaration //GEN-END:variables + } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.jfd index 8fc771a9..2fb4ea68 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatContainerTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -13,8 +13,8 @@ new FormModel { } ) { name: "this" add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jgoodies.forms.layout.FormLayout ) { - "$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow" - "$rowSpecs": "default, linegap, fill:70dlu, linegap, pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref" + "$columnSpecs": "70dlu:grow, unrelgap, 70dlu:grow" + "$rowSpecs": "default, linegap, fill:70dlu, pargap, pref, linegap, fill:80dlu:grow, unrelgap, fill:80dlu:grow, pargap, pref" } ) { name: "panel9" "opaque": false @@ -29,31 +29,15 @@ new FormModel { name: "splitPane1" "resizeWeight": 0.5 "oneTouchExpandable": true - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel10" - "background": sfield java.awt.Color orange - add( new FormComponent( "javax.swing.JTextField" ) { - name: "textField2" - "text": "some text" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "button1" - "text": "..." - } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatContainerTest$Panel1" ) { + name: "panel15" + "background": new java.awt.Color( 217, 163, 67, 255 ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "left" } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel11" - "background": sfield java.awt.Color magenta - add( new FormComponent( "javax.swing.JTextField" ) { - name: "textField3" - "text": "some text" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "button2" - "text": "..." - } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatContainerTest$Panel2" ) { + name: "panel21" + "background": new java.awt.Color( 98, 181, 67, 255 ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "right" } ) @@ -65,15 +49,31 @@ new FormModel { "orientation": 0 "resizeWeight": 0.5 "oneTouchExpandable": true - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { name: "panel12" - "background": sfield java.awt.Color orange + "background": new java.awt.Color( 242, 101, 34, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "TOP" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "left" } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { name: "panel13" - "background": sfield java.awt.Color magenta + "background": new java.awt.Color( 64, 182, 224, 255 ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "BOTTOM" + "horizontalAlignment": 0 + "foreground": sfield java.awt.Color white + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "right" } ) @@ -96,43 +96,6 @@ new FormModel { auxiliary() { "JavaCodeGenerator.variableLocal": false } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel1" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label1" - "text": "TOP" - } ) - add( new FormComponent( "javax.swing.JTextField" ) { - name: "textField4" - "text": "some text" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "button3" - "text": "..." - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel2" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color magenta, 1, false ) - add( new FormComponent( "javax.swing.JTextField" ) { - name: "textField5" - "text": "some text" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "button4" - "text": "..." - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label2" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { "gridX": 1 "gridY": 7 @@ -143,27 +106,6 @@ new FormModel { auxiliary() { "JavaCodeGenerator.variableLocal": false } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel5" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label5" - "text": "LEFT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel6" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label6" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { "gridX": 3 "gridY": 7 @@ -174,28 +116,6 @@ new FormModel { auxiliary() { "JavaCodeGenerator.variableLocal": false } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel3" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label3" - "text": "BOTTOM" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel4" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - "enabled": false - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label4" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { "gridY": 9 } ) @@ -205,80 +125,365 @@ new FormModel { auxiliary() { "JavaCodeGenerator.variableLocal": false } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel7" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label7" - "text": "RIGHT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel8" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label8" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { "gridX": 3 "gridY": 9 } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestFrame$NoRightToLeftPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets 0,hidemode 3" - "$columnConstraints": "[][][][]" - "$rowConstraints": "[center]" + "$columnConstraints": "[][fill][]" + "$rowConstraints": "[center][][][]para[][]para[][]para[][]" } ) { - name: "panel14" + name: "tabbedPaneControlPanel" "opaque": false - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "moreTabsCheckBox" - "text": "more tabs" - "mnemonic": 77 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "moreTabsChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "tabScrollCheckBox" - "text": "tabLayoutPolicy = SCROLL" + "text": "Use scroll layout" "mnemonic": 83 auxiliary() { "JavaCodeGenerator.variableLocal": false } addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabScrollChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0,alignx left,growx 0" + "value": "cell 0 0,alignx left,growx 0" } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "showTabSeparatorsCheckBox" - "text": "JTabbedPane.showTabSeparators" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabCountLabel" + "text": "Tab count:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "tabCountSpinner" + "model": new javax.swing.SpinnerNumberModel { + minimum: 0 + value: 4 + } auxiliary() { "JavaCodeGenerator.variableLocal": false } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTabSeparatorsChanged", false ) ) + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "tabCountChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "customTabsCheckBox" + "text": "Custom tabs" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "customTabsChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 0" } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "htmlTabsCheckBox" + "text": "HTML" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "htmlTabsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "multiLineTabsCheckBox" + "text": "multi-line" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "htmlTabsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "hiddenTabsNavigationLabel" + "text": "Hidden tabs navigation:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "hiddenTabsNavigationField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "default" + addElement( "default" ) + addElement( "moreTabsButton" ) + addElement( "arrowButtons" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hiddenTabsNavigationChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tabBackForegroundCheckBox" + "text": "Tab back/foreground" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabBackForegroundChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabPlacementLabel" + "text": "Tab placement:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "tabPlacementField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "default" + addElement( "default" ) + addElement( "top" ) + addElement( "bottom" ) + addElement( "left" ) + addElement( "right" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabPlacementChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tabIconsCheckBox" + "text": "Tab icons" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabIconsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "tabIconSizeSpinner" + "model": new javax.swing.SpinnerListModel { + list: new java.util.ArrayList { + add( "16" ) + add( "24" ) + add( "32" ) + add( "48" ) + add( "64" ) + } + } + "enabled": false + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "tabIconsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "iconPlacementField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "leading" + addElement( "leading" ) + addElement( "trailing" ) + addElement( "top" ) + addElement( "bottom" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "iconPlacementChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabAreaAlignmentLabel" + "text": "Tab area alignment:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "tabAreaAlignmentField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "default" + addElement( "default" ) + addElement( "leading" ) + addElement( "trailing" ) + addElement( "center" ) + addElement( "fill" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabAreaAlignmentChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabWidthModeLabel" + "text": "Tab width mode:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "tabWidthModeField" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "default" + addElement( "default" ) + addElement( "preferred" ) + addElement( "equal" ) + addElement( "compact" ) + } + auxiliary() { + "JavaCodeGenerator.variableLocal": false + "JavaCodeGenerator.typeParameters": "String" + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabWidthModeChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tabsClosableCheckBox" + "text": "Tabs closable" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabsClosableChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "customBorderCheckBox" + "text": "Custom border" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "customBorderChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tabAreaInsetsCheckBox" + "text": "Tab area insets (5,5,10,10)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabAreaInsetsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) { + name: "secondTabClosableCheckBox" + "text": "Second Tab closable" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "secondTabClosableChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "hasFullBorderCheckBox" - "text": "JTabbedPane.hasFullBorder" - "mnemonic": 70 + "text": "Show content border" auxiliary() { "JavaCodeGenerator.variableLocal": false } addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hasFullBorderChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 3 0,alignx left,growx 0" + "value": "cell 1 5,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "smallerTabHeightCheckBox" + "text": "Smaller tab height (26)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "smallerTabHeightChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "leadingComponentCheckBox" + "text": "Leading component" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "leadingComponentChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "hideContentSeparatorCheckBox" + "text": "Hide content separator" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hideContentSeparatorChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "smallerInsetsCheckBox" + "text": "Smaller tab insets (2,2,2,2)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "smallerInsetsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "trailingComponentCheckBox" + "text": "Trailing component" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "trailingComponentChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "showTabSeparatorsCheckBox" + "text": "Show tab separators" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTabSeparatorsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "secondTabWiderCheckBox" + "text": "Second Tab insets wider (4,20,4,20)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "secondTabWiderChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "minimumTabWidthCheckBox" + "text": "Minimum tab width (100)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "minimumTabWidthChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 8" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "maximumTabWidthCheckBox" + "text": "Maximum tab width (60)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximumTabWidthChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 9" } ) }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { "gridY": 11 @@ -289,7 +494,63 @@ new FormModel { } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 625, 515 ) + "size": new java.awt.Dimension( 810, 860 ) + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "hidemode 3,align center center" + "$columnConstraints": "[fill][fill][fill]" + "$rowConstraints": "[fill]" + } ) { + name: "panel1" + auxiliary() { + "JavaCodeGenerator.className": "Panel1" + } + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField4" + "text": "some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button3" + "text": "..." + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 890 ) + "size": new java.awt.Dimension( 291, 118 ) + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3,align center center" + "$columnConstraints": "[fill][fill]" + "$rowConstraints": "[fill]" + } ) { + name: "panel2" + auxiliary() { + "JavaCodeGenerator.className": "Panel2" + } + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField5" + "text": "more text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button4" + "text": "..." + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 340, 890 ) + "size": new java.awt.Dimension( 291, 118 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.java new file mode 100644 index 00000000..18c5a0cb --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.java @@ -0,0 +1,523 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.*; +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.plaf.basic.BasicComboBoxEditor; +import com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon; +import com.formdev.flatlaf.util.UIScale; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatCustomBordersTest + extends FlatTestPanel +{ + private static final Color RED = new Color( 0x60ff0000, true ); + private static final Color GREEN = new Color( 0x6000ff00, true ); + private static final Color MAGENTA = new Color( 0x60ff00ff, true ); + private static final Color ORANGE = new Color( 0x60ffc800, true ); + + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatCustomBordersTest" ); + frame.showFrame( FlatCustomBordersTest::new ); + } ); + } + + FlatCustomBordersTest() { + initComponents(); + applyCustomBorders(); + } + + @Override + public void updateUI() { + super.updateUI(); + + if( textField2 != null ) + applyCustomBorders(); + } + + private void applyCustomBorders() { + LineBorder lineBorder = new LineBorder( MAGENTA, UIScale.scale( 3 ) ); + + applyCustomInsideBorder( button2, "Button.border" ); + applyCustomInsideBorder( button6, "Button.border" ); + applyCustomOutsideBorder( button3, "Button.border" ); + applyCustomOutsideBorder( button7, "Button.border" ); + button4.setBorder( lineBorder ); + button8.setBorder( lineBorder ); + + applyCustomInsideBorder( comboBox2, "ComboBox.border" ); + applyCustomInsideBorder( comboBox6, "ComboBox.border" ); + applyCustomOutsideBorder( comboBox3, "ComboBox.border" ); + applyCustomOutsideBorder( comboBox7, "ComboBox.border" ); + comboBox4.setBorder( lineBorder ); + comboBox8.setBorder( lineBorder ); + + applyCustomInsideBorder( comboBox10, "ComboBox.border" ); + applyCustomInsideBorder( comboBox14, "ComboBox.border" ); + applyCustomOutsideBorder( comboBox11, "ComboBox.border" ); + applyCustomOutsideBorder( comboBox15, "ComboBox.border" ); + comboBox12.setBorder( lineBorder ); + comboBox16.setBorder( lineBorder ); + + applyCustomInsideBorder( spinner2, "Spinner.border" ); + applyCustomInsideBorder( spinner6, "Spinner.border" ); + applyCustomOutsideBorder( spinner3, "Spinner.border" ); + applyCustomOutsideBorder( spinner7, "Spinner.border" ); + spinner4.setBorder( lineBorder ); + spinner8.setBorder( lineBorder ); + + applyCustomInsideBorder( textField2, "TextField.border" ); + applyCustomInsideBorder( textField6, "TextField.border" ); + applyCustomOutsideBorder( textField3, "TextField.border" ); + applyCustomOutsideBorder( textField7, "TextField.border" ); + textField4.setBorder( lineBorder ); + textField8.setBorder( lineBorder ); + + applyCustomComboBoxEditorBorder( comboBox17 ); + applyCustomComboBoxEditorBorder( comboBox18 ); + applyCustomComboBoxEditorBorderWithIcon( comboBox19 ); + applyCustomComboBoxEditorBorderWithIcon( comboBox20 ); + applyCustomComboBoxEditorBorder( comboBox21, null ); + applyCustomComboBoxEditorBorder( comboBox22, null ); + } + + private void applyCustomInsideBorder( JComponent c, String uiKey ) { + c.setBorder( new CompoundBorder( UIManager.getBorder( uiKey ), new LineBorder( RED, UIScale.scale( 3 ) ) ) ); + } + + private void applyCustomOutsideBorder( JComponent c, String uiKey ) { + c.setBorder( new CompoundBorder( new LineBorder( GREEN, UIScale.scale( 3 ) ), UIManager.getBorder( uiKey ) ) ); + } + + private void applyCustomComboBoxEditorBorder( JComboBox comboBox ) { + applyCustomComboBoxEditorBorder( comboBox, new LineBorder( ORANGE, UIScale.scale( 3 ) ) ); + } + + private void applyCustomComboBoxEditorBorderWithIcon( JComboBox comboBox ) { + applyCustomComboBoxEditorBorder( comboBox, new BorderWithIcon() ); + } + + private void applyCustomComboBoxEditorBorder( JComboBox comboBox, Border border ) { + JTextField customTextField = new JTextField(); + if( border != null ) + customTextField.setBorder( border ); + comboBox.setEditor( new BasicComboBoxEditor() { + @Override + protected JTextField createEditorComponent() { + return customTextField; + } + } ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + label1 = new JLabel(); + label3 = new JLabel(); + label4 = new JLabel(); + label2 = new JLabel(); + label8 = new JLabel(); + label9 = new JLabel(); + label10 = new JLabel(); + label7 = new JLabel(); + button1 = new JButton(); + button2 = new JButton(); + button3 = new JButton(); + button4 = new JButton(); + button5 = new JButton(); + button6 = new JButton(); + button7 = new JButton(); + button8 = new JButton(); + label5 = new JLabel(); + comboBox1 = new JComboBox<>(); + comboBox2 = new JComboBox<>(); + comboBox3 = new JComboBox<>(); + comboBox4 = new JComboBox<>(); + comboBox5 = new JComboBox<>(); + comboBox6 = new JComboBox<>(); + comboBox7 = new JComboBox<>(); + comboBox8 = new JComboBox<>(); + comboBox9 = new JComboBox<>(); + comboBox10 = new JComboBox<>(); + comboBox11 = new JComboBox<>(); + comboBox12 = new JComboBox<>(); + comboBox17 = new JComboBox<>(); + comboBox19 = new JComboBox<>(); + comboBox21 = new JComboBox<>(); + comboBox13 = new JComboBox<>(); + comboBox14 = new JComboBox<>(); + comboBox15 = new JComboBox<>(); + comboBox16 = new JComboBox<>(); + comboBox18 = new JComboBox<>(); + comboBox20 = new JComboBox<>(); + comboBox22 = new JComboBox<>(); + label6 = new JLabel(); + spinner1 = new JSpinner(); + spinner2 = new JSpinner(); + spinner3 = new JSpinner(); + spinner4 = new JSpinner(); + spinner5 = new JSpinner(); + spinner6 = new JSpinner(); + spinner7 = new JSpinner(); + spinner8 = new JSpinner(); + textFieldLabel = new JLabel(); + textField1 = new JTextField(); + textField2 = new JTextField(); + textField3 = new JTextField(); + textField4 = new JTextField(); + textField5 = new JTextField(); + textField6 = new JTextField(); + textField7 = new JTextField(); + textField8 = new JTextField(); + + //======== this ======== + setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[]" + + "[fill]" + + "[fill]" + + "[fill]" + + "[fill]" + + "[fill]" + + "[fill]" + + "[fill]", + // rows + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]")); + + //---- label1 ---- + label1.setText("plain"); + add(label1, "cell 1 0"); + + //---- label3 ---- + label3.setText("custom inside"); + add(label3, "cell 2 0"); + + //---- label4 ---- + label4.setText("custom outside"); + add(label4, "cell 3 0"); + + //---- label2 ---- + label2.setText("LineBorder"); + add(label2, "cell 4 0"); + + //---- label8 ---- + label8.setText("custom editor"); + add(label8, "cell 5 0"); + + //---- label9 ---- + label9.setText("with icon"); + add(label9, "cell 6 0"); + + //---- label10 ---- + label10.setText("with default border"); + add(label10, "cell 7 0"); + + //---- label7 ---- + label7.setText("JButton:"); + add(label7, "cell 0 1"); + + //---- button1 ---- + button1.setText("text"); + add(button1, "cell 1 1"); + + //---- button2 ---- + button2.setText("text"); + add(button2, "cell 2 1"); + + //---- button3 ---- + button3.setText("text"); + add(button3, "cell 3 1"); + + //---- button4 ---- + button4.setText("text"); + add(button4, "cell 4 1"); + + //---- button5 ---- + button5.setText("text"); + button5.putClientProperty("JButton.buttonType", "roundRect"); + add(button5, "cell 1 2"); + + //---- button6 ---- + button6.setText("text"); + button6.putClientProperty("JButton.buttonType", "roundRect"); + add(button6, "cell 2 2"); + + //---- button7 ---- + button7.setText("text"); + button7.putClientProperty("JButton.buttonType", "roundRect"); + add(button7, "cell 3 2"); + + //---- button8 ---- + button8.setText("text"); + button8.putClientProperty("JButton.buttonType", "roundRect"); + add(button8, "cell 4 2"); + + //---- label5 ---- + label5.setText("JComboBox:"); + add(label5, "cell 0 3"); + add(comboBox1, "cell 1 3"); + add(comboBox2, "cell 2 3"); + add(comboBox3, "cell 3 3"); + add(comboBox4, "cell 4 3"); + + //---- comboBox5 ---- + comboBox5.putClientProperty("JComponent.roundRect", true); + add(comboBox5, "cell 1 4"); + + //---- comboBox6 ---- + comboBox6.putClientProperty("JComponent.roundRect", true); + add(comboBox6, "cell 2 4"); + + //---- comboBox7 ---- + comboBox7.putClientProperty("JComponent.roundRect", true); + add(comboBox7, "cell 3 4"); + + //---- comboBox8 ---- + comboBox8.putClientProperty("JComponent.roundRect", true); + add(comboBox8, "cell 4 4"); + + //---- comboBox9 ---- + comboBox9.setEditable(true); + add(comboBox9, "cell 1 5"); + + //---- comboBox10 ---- + comboBox10.setEditable(true); + add(comboBox10, "cell 2 5"); + + //---- comboBox11 ---- + comboBox11.setEditable(true); + add(comboBox11, "cell 3 5"); + + //---- comboBox12 ---- + comboBox12.setEditable(true); + add(comboBox12, "cell 4 5"); + + //---- comboBox17 ---- + comboBox17.setEditable(true); + add(comboBox17, "cell 5 5"); + + //---- comboBox19 ---- + comboBox19.setEditable(true); + add(comboBox19, "cell 6 5"); + + //---- comboBox21 ---- + comboBox21.setEditable(true); + add(comboBox21, "cell 7 5"); + + //---- comboBox13 ---- + comboBox13.putClientProperty("JComponent.roundRect", true); + comboBox13.setEditable(true); + add(comboBox13, "cell 1 6"); + + //---- comboBox14 ---- + comboBox14.putClientProperty("JComponent.roundRect", true); + comboBox14.setEditable(true); + add(comboBox14, "cell 2 6"); + + //---- comboBox15 ---- + comboBox15.putClientProperty("JComponent.roundRect", true); + comboBox15.setEditable(true); + add(comboBox15, "cell 3 6"); + + //---- comboBox16 ---- + comboBox16.putClientProperty("JComponent.roundRect", true); + comboBox16.setEditable(true); + add(comboBox16, "cell 4 6"); + + //---- comboBox18 ---- + comboBox18.putClientProperty("JComponent.roundRect", true); + comboBox18.setEditable(true); + add(comboBox18, "cell 5 6"); + + //---- comboBox20 ---- + comboBox20.putClientProperty("JComponent.roundRect", true); + comboBox20.setEditable(true); + add(comboBox20, "cell 6 6"); + + //---- comboBox22 ---- + comboBox22.putClientProperty("JComponent.roundRect", true); + comboBox22.setEditable(true); + add(comboBox22, "cell 7 6"); + + //---- label6 ---- + label6.setText("JSpinner:"); + add(label6, "cell 0 7"); + add(spinner1, "cell 1 7"); + add(spinner2, "cell 2 7"); + add(spinner3, "cell 3 7"); + add(spinner4, "cell 4 7"); + + //---- spinner5 ---- + spinner5.putClientProperty("JComponent.roundRect", true); + add(spinner5, "cell 1 8"); + + //---- spinner6 ---- + spinner6.putClientProperty("JComponent.roundRect", true); + add(spinner6, "cell 2 8"); + + //---- spinner7 ---- + spinner7.putClientProperty("JComponent.roundRect", true); + add(spinner7, "cell 3 8"); + + //---- spinner8 ---- + spinner8.putClientProperty("JComponent.roundRect", true); + add(spinner8, "cell 4 8"); + + //---- textFieldLabel ---- + textFieldLabel.setText("JTextField:"); + add(textFieldLabel, "cell 0 9"); + + //---- textField1 ---- + textField1.setText("text"); + textField1.putClientProperty("JComponent.roundRect", false); + add(textField1, "cell 1 9,growx"); + + //---- textField2 ---- + textField2.putClientProperty("JComponent.roundRect", false); + textField2.setText("text"); + add(textField2, "cell 2 9"); + + //---- textField3 ---- + textField3.setText("text"); + add(textField3, "cell 3 9"); + + //---- textField4 ---- + textField4.putClientProperty("JComponent.roundRect", false); + textField4.setText("text"); + add(textField4, "cell 4 9"); + + //---- textField5 ---- + textField5.setText("text"); + textField5.putClientProperty("JComponent.roundRect", true); + add(textField5, "cell 1 10,growx"); + + //---- textField6 ---- + textField6.putClientProperty("JComponent.roundRect", true); + textField6.setText("text"); + add(textField6, "cell 2 10"); + + //---- textField7 ---- + textField7.setText("text"); + textField7.putClientProperty("JComponent.roundRect", true); + add(textField7, "cell 3 10"); + + //---- textField8 ---- + textField8.putClientProperty("JComponent.roundRect", true); + textField8.setText("text"); + add(textField8, "cell 4 10"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JLabel label1; + private JLabel label3; + private JLabel label4; + private JLabel label2; + private JLabel label8; + private JLabel label9; + private JLabel label10; + private JLabel label7; + private JButton button1; + private JButton button2; + private JButton button3; + private JButton button4; + private JButton button5; + private JButton button6; + private JButton button7; + private JButton button8; + private JLabel label5; + private JComboBox comboBox1; + private JComboBox comboBox2; + private JComboBox comboBox3; + private JComboBox comboBox4; + private JComboBox comboBox5; + private JComboBox comboBox6; + private JComboBox comboBox7; + private JComboBox comboBox8; + private JComboBox comboBox9; + private JComboBox comboBox10; + private JComboBox comboBox11; + private JComboBox comboBox12; + private JComboBox comboBox17; + private JComboBox comboBox19; + private JComboBox comboBox21; + private JComboBox comboBox13; + private JComboBox comboBox14; + private JComboBox comboBox15; + private JComboBox comboBox16; + private JComboBox comboBox18; + private JComboBox comboBox20; + private JComboBox comboBox22; + private JLabel label6; + private JSpinner spinner1; + private JSpinner spinner2; + private JSpinner spinner3; + private JSpinner spinner4; + private JSpinner spinner5; + private JSpinner spinner6; + private JSpinner spinner7; + private JSpinner spinner8; + private JLabel textFieldLabel; + private JTextField textField1; + private JTextField textField2; + private JTextField textField3; + private JTextField textField4; + private JTextField textField5; + private JTextField textField6; + private JTextField textField7; + private JTextField textField8; + // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class BorderWithIcon ----------------------------------------------- + + private static class BorderWithIcon + implements Border + { + private final FlatFileViewFloppyDriveIcon icon = new FlatFileViewFloppyDriveIcon(); + + @Override + public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { + icon.paintIcon( c, g, x + width - icon.getIconWidth() - 2, y + ((height - icon.getIconHeight()) / 2) ); + } + + @Override + public boolean isBorderOpaque() { + return false; + } + + @Override + public Insets getBorderInsets( Component c ) { + return new Insets( 0, 0, 0, icon.getIconWidth() + 4 ); + } + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.jfd new file mode 100644 index 00000000..36dea94b --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatCustomBordersTest.jfd @@ -0,0 +1,435 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$columnConstraints": "[][fill][fill][fill][fill][fill][fill][fill]" + "$rowConstraints": "[][][][][][][][][][][]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "plain" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "custom inside" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "custom outside" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "LineBorder" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label8" + "text": "custom editor" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 5 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label9" + "text": "with icon" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label10" + "text": "with default border" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 7 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label7" + "text": "JButton:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button1" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button2" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button3" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button4" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button5" + "text": "text" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button6" + "text": "text" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button7" + "text": "text" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 2" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button8" + "text": "text" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "JComboBox:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox1" + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox2" + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox3" + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox4" + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 3" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox5" + "$client.JComponent.roundRect": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox6" + "$client.JComponent.roundRect": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox7" + "$client.JComponent.roundRect": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 4" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox8" + "$client.JComponent.roundRect": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 4" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox9" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox10" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox11" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox12" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox17" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 5 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox19" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox21" + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 7 5" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox13" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox14" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox15" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox16" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox18" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 5 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox20" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 6" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox22" + "$client.JComponent.roundRect": true + "editable": true + auxiliary() { + "JavaCodeGenerator.typeParameters": "String" + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 7 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "text": "JSpinner:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner1" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner2" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner3" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 7" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner4" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 7" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner5" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 8" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner6" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 8" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner7" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 8" + } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "spinner8" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 8" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "textFieldLabel" + "text": "JTextField:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 9" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField1" + "text": "text" + "$client.JComponent.roundRect": false + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 9,growx" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField2" + "$client.JComponent.roundRect": false + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 9" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField3" + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 9" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField4" + "$client.JComponent.roundRect": false + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 9" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField5" + "text": "text" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 10,growx" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField6" + "$client.JComponent.roundRect": true + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 10" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField7" + "text": "text" + "$client.JComponent.roundRect": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 10" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField8" + "$client.JComponent.roundRect": true + "text": "text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 10" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 915, 715 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDesktopPropertiesDump.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDesktopPropertiesDump.java new file mode 100644 index 00000000..36f3e172 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDesktopPropertiesDump.java @@ -0,0 +1,113 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.Font; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.Toolkit; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Locale; +import javax.swing.SwingUtilities; + +/** + * Dumps desktop properties. + * + * @author Karl Tauber + */ +public class FlatDesktopPropertiesDump +{ + public static void main( String[] args ) { + System.setProperty( "line.separator", "\n" ); + + SwingUtilities.invokeLater( () -> { + printDesktopProperties(); + } ); + } + + private static void printDesktopProperties() { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH ); + + // Java scale factor + GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment() + .getDefaultScreenDevice().getDefaultConfiguration(); + double javaScale = gc.getDefaultTransform().getScaleX(); + float fontScale; + + double screenScale = javaScale; + float textScale = 1; + + if( osName.startsWith( "windows" ) ) { + // text scale factor + Font winFont = (Font) toolkit.getDesktopProperty( "win.messagebox.font" ); + fontScale = roundToQuater( winFont.getSize() / 12f ); + textScale = fontScale; + + // Java 8 + if( System.getProperty( "java.version" ).startsWith( "1.8" ) ) { + // screen scale factor + Font winFont2 = (Font) toolkit.getDesktopProperty( "win.defaultGUI.font" ); + screenScale = roundToQuater( winFont2.getSize() / 11f ); + + // text scale factor + textScale = roundToQuater( textScale / (float) screenScale ); + } + } else + throw new RuntimeException( "OS not supported" ); + + File dir = new File( "dumps/desktop-properties" ); + dir.mkdirs(); + + String osPrefix = osName.startsWith( "windows" ) ? "win" + : osName.startsWith( "mac" ) ? "mac" + : osName.startsWith( "linux" ) ? "linux" + : "unknown"; + String javaVersion = System.getProperty( "java.version" ); + + File file = new File( dir, "desktop-properties-" + osPrefix + "-" + javaVersion + + "--" + screenScale + "s-" + textScale + "t.txt" ); + + try( PrintStream out = new PrintStream( file ) ) { + out.println( "Java version: " + System.getProperty( "java.version" ) ); + out.println( "OS: " + System.getProperty( "os.name" ) ); + out.println(); + + out.println( "Screen scale: " + screenScale ); + out.println( "Text scale: " + textScale ); + out.println(); + + out.println( "Java scale: " + javaScale ); + out.println( "Font scale: " + fontScale ); + out.println(); + + String[] winPropNames = (String[]) toolkit.getDesktopProperty( "win.propNames" ); + for( String propName : winPropNames ) { + Object value = toolkit.getDesktopProperty( propName ); + out.printf( "%-40s %s\n", propName, String.valueOf( value ) ); + } + } catch( IOException ex ) { + ex.printStackTrace(); + } + } + + private static float roundToQuater( float value ) { + return Math.round( value * 4f ) / 4f; + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.java new file mode 100644 index 00000000..944de42f --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.java @@ -0,0 +1,938 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageProducer; +import java.awt.image.RGBImageFilter; +import java.beans.*; +import java.net.URL; +import javax.swing.*; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.util.MultiResolutionImageSupport; +import com.formdev.flatlaf.util.SystemInfo; +import com.formdev.flatlaf.util.UIScale; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatDisabledIconsTest + extends FlatTestPanel +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatDisabledIconsTest" ); + frame.showFrame( FlatDisabledIconsTest::new ); + } ); + } + + FlatDisabledIconsTest() { + initComponents(); + + RGBImageFilter plasticLafFilter = new PlasticRGBGrayFilter(); + RGBImageFilter intellijTextFilter = new IntelliJGrayFilter( 20, 0, 100 ); + RGBImageFilter netbeansFilter = new NetBeansDisabledButtonFilter(); + + for( Component c : enabledToolBar.getComponents() ) { + AbstractButton b = (AbstractButton) c; + Icon icon = b.getIcon(); + + JToggleButton cb = new JToggleButton( icon ); + cb.setEnabled( false ); + currentLafToolBar.add( cb ); + basicLafToolBar.add( new FilterButton( null, icon ) ); + metalLafToolBar.add( new FilterButton( null, icon ) ); + plasticToolBar.add( new FilterButton( plasticLafFilter, icon ) ); + intellijTextToolBar.add( new FilterButton( intellijTextFilter, icon ) ); + intellijLightToolBar.add( new FilterButton( null, icon ) ); + intellijDarkToolBar.add( new FilterButton( null, icon ) ); + netbeansToolBar.add( new FilterButton( netbeansFilter, icon ) ); + } + + Icon zipIcon = zipButton.getIcon(); + JToggleButton cb = new JToggleButton( zipIcon ); + cb.setEnabled( false ); + zipToolBar.add( cb ); + zipToolBar.add( new FilterButton( null, zipIcon ) ); + zipToolBar.add( new FilterButton( null, zipIcon ) ); + zipToolBar.add( new FilterButton( plasticLafFilter, zipIcon ) ); + zipToolBar.add( new FilterButton( intellijTextFilter, zipIcon ) ); + zipToolBar.add( new FilterButton( null, zipIcon ) ); + zipToolBar.add( new FilterButton( null, zipIcon ) ); + zipToolBar.add( new FilterButton( netbeansFilter, zipIcon ) ); + + basicLafReset(); + metalLafReset(); + + intelliJTextFilterController.defaultBrightness = 20; + intelliJTextFilterController.defaultContrast = 0; + intelliJTextFilterController.reset(); + + // values from intellijlaf.properties + intelliJLightFilterController.defaultBrightness = 33; + intelliJLightFilterController.defaultContrast = -35; + intelliJLightFilterController.reset(); + + // values from darcula.properties + intelliJDarkFilterController.defaultBrightness = -70; + intelliJDarkFilterController.defaultContrast = -70; + intelliJDarkFilterController.reset(); + + toolBars = new JToolBar[] { + enabledToolBar, + currentLafToolBar, + basicLafToolBar, + metalLafToolBar, + plasticToolBar, + intellijTextToolBar, + intellijLightToolBar, + intellijDarkToolBar, + netbeansToolBar + }; + } + + private void selectedChanged() { + boolean armed = selectedCheckBox.isSelected(); + for( Component c : getComponents() ) { + if( c instanceof JToolBar ) { + for( Component c2 : ((JToolBar)c).getComponents() ) { + if( c2 instanceof JToggleButton ) + ((JToggleButton)c2).getModel().setSelected( armed ); + } + } + } + } + + private final JToolBar[] toolBars; + private Icon[] oldIcons; + private static final String[] COLOR_NAMES = { + "Actions.Red", + "Actions.Yellow", + "Actions.Green", + "Actions.Blue", + "Actions.Grey", + "Actions.GreyInline", + + "Objects.Grey", + "Objects.Blue", + "Objects.Green", + "Objects.Yellow", + "Objects.YellowDark", + "Objects.Purple", + "Objects.Pink", + "Objects.Red", + "Objects.RedStatus", + "Objects.GreenAndroid", + "Objects.BlackText", + + "", // black + }; + + private void paletteIconsChanged() { + if( paletteIconsCheckBox.isSelected() ) { + oldIcons = new Icon[COLOR_NAMES.length]; + for( int i = 0; i < COLOR_NAMES.length; i++ ) + oldIcons[i] = ((JToggleButton)enabledToolBar.getComponent( i )).getIcon(); + + for( int i = 0; i < COLOR_NAMES.length; i++ ) { + ColorIcon icon = new ColorIcon( UIManager.getColor( COLOR_NAMES[i] ) ); + for( JToolBar toolBar : toolBars ) + ((JToggleButton)toolBar.getComponent( i )).setIcon( icon ); + } + } else if( oldIcons != null ){ + for( int i = 0; i < COLOR_NAMES.length; i++ ) { + for( JToolBar toolBar : toolBars ) + ((JToggleButton)toolBar.getComponent( i )).setIcon( oldIcons[i] ); + } + } + } + + private void basicLafChanged() { + boolean brighter = basicLafBrighterCheckBox.isSelected(); + int percent = basicLafPercentSlider.getValue(); + + basicLafPercentValue.setText( String.valueOf( percent ) ); + + RGBImageFilter filter = new GrayFilter( brighter, percent ); + updateFilter( basicLafToolBar, 2, filter ); + } + + private void basicLafReset() { + basicLafBrighterCheckBox.setSelected( true ); + basicLafPercentSlider.setValue( 50 ); + basicLafChanged(); + } + + private void metalLafChanged() { + int min = metalLafMinSlider.getValue(); + int max = metalLafMaxSlider.getValue(); + + metalLafMinValue.setText( String.valueOf( min ) ); + metalLafMaxValue.setText( String.valueOf( max ) ); + + RGBImageFilter filter = new MetalDisabledButtonImageFilter( min, max ); + updateFilter( metalLafToolBar, 3, filter ); + } + + private void metalLafReset() { + metalLafMinSlider.setValue( 180 ); + metalLafMaxSlider.setValue( 215 ); + metalLafChanged(); + } + + private void intelliJTextFilterChanged(PropertyChangeEvent e) { + updateFilter( intellijTextToolBar, 5, (RGBImageFilter) e.getNewValue() ); + } + + private void intelliJLightFilterChanged(PropertyChangeEvent e) { + updateFilter( intellijLightToolBar, 6, (RGBImageFilter) e.getNewValue() ); + } + + private void intelliJDarkFilterChanged(PropertyChangeEvent e) { + updateFilter( intellijDarkToolBar, 7, (RGBImageFilter) e.getNewValue() ); + } + + private void updateFilter( JToolBar toolBar, int zipIndex, RGBImageFilter filter ) { + for( Component c : toolBar.getComponents() ) + ((FilterButton)c).setFilter( filter ); + + ((FilterButton)zipToolBar.getComponent( zipIndex )).setFilter( filter ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JLabel enabledLabel = new JLabel(); + enabledToolBar = new JToolBar(); + JToggleButton button1 = new JToggleButton(); + JToggleButton button2 = new JToggleButton(); + JToggleButton button3 = new JToggleButton(); + JToggleButton button4 = new JToggleButton(); + JToggleButton button5 = new JToggleButton(); + JToggleButton button6 = new JToggleButton(); + JToggleButton button7 = new JToggleButton(); + JToggleButton button8 = new JToggleButton(); + JToggleButton button9 = new JToggleButton(); + JToggleButton button10 = new JToggleButton(); + JToggleButton button11 = new JToggleButton(); + JToggleButton button12 = new JToggleButton(); + JToggleButton button13 = new JToggleButton(); + JToggleButton button14 = new JToggleButton(); + JToggleButton button15 = new JToggleButton(); + JToggleButton button16 = new JToggleButton(); + JToggleButton button17 = new JToggleButton(); + JToggleButton button18 = new JToggleButton(); + JLabel currentLabel = new JLabel(); + currentLafToolBar = new JToolBar(); + JLabel basicLafLabel = new JLabel(); + basicLafToolBar = new JToolBar(); + JPanel panel2 = new JPanel(); + basicLafBrighterCheckBox = new JCheckBox(); + JLabel basicLafPercentLabel = new JLabel(); + basicLafPercentSlider = new JSlider(); + basicLafPercentValue = new JLabel(); + JButton basicLafResetButton = new JButton(); + JLabel metalLafLabel = new JLabel(); + metalLafToolBar = new JToolBar(); + JPanel panel4 = new JPanel(); + JLabel metalLafMinLabel = new JLabel(); + metalLafMinSlider = new JSlider(); + metalLafMinValue = new JLabel(); + JButton metalLafResetButton = new JButton(); + JLabel metalLafMaxLabel = new JLabel(); + metalLafMaxSlider = new JSlider(); + metalLafMaxValue = new JLabel(); + JLabel plasticLabel = new JLabel(); + plasticToolBar = new JToolBar(); + JLabel intellijTextLabel = new JLabel(); + intellijTextToolBar = new JToolBar(); + intelliJTextFilterController = new FlatDisabledIconsTest.IntelliJFilterController(); + JLabel intellijLightLabel = new JLabel(); + intellijLightToolBar = new JToolBar(); + intelliJLightFilterController = new FlatDisabledIconsTest.IntelliJFilterController(); + JLabel intellijDarkLabel = new JLabel(); + intellijDarkToolBar = new JToolBar(); + intelliJDarkFilterController = new FlatDisabledIconsTest.IntelliJFilterController(); + JLabel netbeansLabel = new JLabel(); + netbeansToolBar = new JToolBar(); + zipToolBar = new JToolBar(); + zipButton = new JToggleButton(); + selectedCheckBox = new JCheckBox(); + paletteIconsCheckBox = new JCheckBox(); + + //======== this ======== + setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[fill]" + + "[fill]" + + "[left]" + + "[fill]", + // rows + "[]" + + "[]" + + "[center]" + + "[center]" + + "[center]" + + "[center]" + + "[center]" + + "[center]" + + "[center]para" + + "[center]" + + "[]")); + + //---- enabledLabel ---- + enabledLabel.setText("enabled"); + add(enabledLabel, "cell 0 0"); + + //======== enabledToolBar ======== + { + + //---- button1 ---- + button1.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif"))); + enabledToolBar.add(button1); + + //---- button2 ---- + button2.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif"))); + enabledToolBar.add(button2); + + //---- button3 ---- + button3.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif"))); + enabledToolBar.add(button3); + + //---- button4 ---- + button4.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif"))); + enabledToolBar.add(button4); + + //---- button5 ---- + button5.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif"))); + enabledToolBar.add(button5); + + //---- button6 ---- + button6.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif"))); + enabledToolBar.add(button6); + enabledToolBar.add(button7); + enabledToolBar.add(button8); + enabledToolBar.add(button9); + enabledToolBar.add(button10); + enabledToolBar.add(button11); + enabledToolBar.add(button12); + enabledToolBar.add(button13); + enabledToolBar.add(button14); + enabledToolBar.add(button15); + enabledToolBar.add(button16); + enabledToolBar.add(button17); + enabledToolBar.add(button18); + } + add(enabledToolBar, "cell 1 0"); + + //---- currentLabel ---- + currentLabel.setText("current LaF"); + add(currentLabel, "cell 0 1"); + add(currentLafToolBar, "cell 1 1"); + + //---- basicLafLabel ---- + basicLafLabel.setText("Basic LaF"); + add(basicLafLabel, "cell 0 2"); + add(basicLafToolBar, "cell 1 2"); + + //======== panel2 ======== + { + panel2.setLayout(new MigLayout( + "insets 0,hidemode 3,gap 0 0", + // columns + "[60,fill]" + + "[fill]" + + "[25,right]rel" + + "[fill]", + // rows + "[center]" + + "[center]")); + + //---- basicLafBrighterCheckBox ---- + basicLafBrighterCheckBox.setText("brighter"); + basicLafBrighterCheckBox.addActionListener(e -> basicLafChanged()); + panel2.add(basicLafBrighterCheckBox, "cell 0 0 2 1,alignx left,growx 0"); + + //---- basicLafPercentLabel ---- + basicLafPercentLabel.setText("Percent"); + panel2.add(basicLafPercentLabel, "cell 0 1"); + + //---- basicLafPercentSlider ---- + basicLafPercentSlider.setToolTipText("Percent"); + basicLafPercentSlider.setValue(0); + basicLafPercentSlider.addChangeListener(e -> basicLafChanged()); + panel2.add(basicLafPercentSlider, "cell 1 1"); + + //---- basicLafPercentValue ---- + basicLafPercentValue.setText("000"); + panel2.add(basicLafPercentValue, "cell 2 1"); + + //---- basicLafResetButton ---- + basicLafResetButton.setText("Reset"); + basicLafResetButton.addActionListener(e -> basicLafReset()); + panel2.add(basicLafResetButton, "cell 3 0 1 2"); + } + add(panel2, "cell 2 2"); + + //---- metalLafLabel ---- + metalLafLabel.setText("Metal LaF"); + add(metalLafLabel, "cell 0 3"); + add(metalLafToolBar, "cell 1 3"); + + //======== panel4 ======== + { + panel4.setLayout(new MigLayout( + "insets 0,hidemode 3,gap 0 0", + // columns + "[60,fill]" + + "[fill]" + + "[25,right]rel" + + "[fill]", + // rows + "[center]" + + "[center]")); + + //---- metalLafMinLabel ---- + metalLafMinLabel.setText("Min"); + panel4.add(metalLafMinLabel, "cell 0 0"); + + //---- metalLafMinSlider ---- + metalLafMinSlider.setMaximum(255); + metalLafMinSlider.addChangeListener(e -> metalLafChanged()); + panel4.add(metalLafMinSlider, "cell 1 0"); + + //---- metalLafMinValue ---- + metalLafMinValue.setText("000"); + panel4.add(metalLafMinValue, "cell 2 0"); + + //---- metalLafResetButton ---- + metalLafResetButton.setText("Reset"); + metalLafResetButton.addActionListener(e -> metalLafReset()); + panel4.add(metalLafResetButton, "cell 3 0 1 2"); + + //---- metalLafMaxLabel ---- + metalLafMaxLabel.setText("Max"); + panel4.add(metalLafMaxLabel, "cell 0 1"); + + //---- metalLafMaxSlider ---- + metalLafMaxSlider.setMaximum(255); + metalLafMaxSlider.addChangeListener(e -> metalLafChanged()); + panel4.add(metalLafMaxSlider, "cell 1 1"); + + //---- metalLafMaxValue ---- + metalLafMaxValue.setText("000"); + panel4.add(metalLafMaxValue, "cell 2 1"); + } + add(panel4, "cell 2 3"); + + //---- plasticLabel ---- + plasticLabel.setText("Plastic LaF"); + add(plasticLabel, "cell 0 4"); + add(plasticToolBar, "cell 1 4"); + + //---- intellijTextLabel ---- + intellijTextLabel.setText("IntelliJ text"); + add(intellijTextLabel, "cell 0 5"); + add(intellijTextToolBar, "cell 1 5"); + + //---- intelliJTextFilterController ---- + intelliJTextFilterController.addPropertyChangeListener("filter", e -> intelliJTextFilterChanged(e)); + add(intelliJTextFilterController, "cell 2 5"); + + //---- intellijLightLabel ---- + intellijLightLabel.setText("IntelliJ light"); + add(intellijLightLabel, "cell 0 6"); + add(intellijLightToolBar, "cell 1 6"); + + //---- intelliJLightFilterController ---- + intelliJLightFilterController.addPropertyChangeListener("filter", e -> intelliJLightFilterChanged(e)); + add(intelliJLightFilterController, "cell 2 6"); + + //---- intellijDarkLabel ---- + intellijDarkLabel.setText("IntelliJ dark"); + add(intellijDarkLabel, "cell 0 7"); + add(intellijDarkToolBar, "cell 1 7"); + + //---- intelliJDarkFilterController ---- + intelliJDarkFilterController.addPropertyChangeListener("filter", e -> intelliJDarkFilterChanged(e)); + add(intelliJDarkFilterController, "cell 2 7"); + + //---- netbeansLabel ---- + netbeansLabel.setText("NetBeans"); + add(netbeansLabel, "cell 0 8"); + add(netbeansToolBar, "cell 1 8"); + + //======== zipToolBar ======== + { + + //---- zipButton ---- + zipButton.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png"))); + zipToolBar.add(zipButton); + } + add(zipToolBar, "cell 1 9 3 1"); + + //---- selectedCheckBox ---- + selectedCheckBox.setText("selected"); + selectedCheckBox.addActionListener(e -> selectedChanged()); + add(selectedCheckBox, "cell 0 10"); + + //---- paletteIconsCheckBox ---- + paletteIconsCheckBox.setText("palette icons"); + paletteIconsCheckBox.addActionListener(e -> paletteIconsChanged()); + add(paletteIconsCheckBox, "cell 1 10,alignx left,growx 0"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + + button7.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark.png" ) ); + button8.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark.png" ) ); + button9.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark.png" ) ); + button10.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark.png" ) ); + button11.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark.png" ) ); + button12.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark.png" ) ); + + button13.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark@2x.png" ) ); + button14.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark@2x.png" ) ); + button15.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark@2x.png" ) ); + button16.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark@2x.png" ) ); + button17.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark@2x.png" ) ); + button18.setIcon( new LightOrDarkIcon( + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search@2x.png", + "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark@2x.png" ) ); + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JToolBar enabledToolBar; + private JToolBar currentLafToolBar; + private JToolBar basicLafToolBar; + private JCheckBox basicLafBrighterCheckBox; + private JSlider basicLafPercentSlider; + private JLabel basicLafPercentValue; + private JToolBar metalLafToolBar; + private JSlider metalLafMinSlider; + private JLabel metalLafMinValue; + private JSlider metalLafMaxSlider; + private JLabel metalLafMaxValue; + private JToolBar plasticToolBar; + private JToolBar intellijTextToolBar; + private FlatDisabledIconsTest.IntelliJFilterController intelliJTextFilterController; + private JToolBar intellijLightToolBar; + private FlatDisabledIconsTest.IntelliJFilterController intelliJLightFilterController; + private JToolBar intellijDarkToolBar; + private FlatDisabledIconsTest.IntelliJFilterController intelliJDarkFilterController; + private JToolBar netbeansToolBar; + private JToolBar zipToolBar; + private JToggleButton zipButton; + private JCheckBox selectedCheckBox; + private JCheckBox paletteIconsCheckBox; + // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class LightOrDarkIcon ---------------------------------------------- + + private static class LightOrDarkIcon + extends ImageIcon + { + private final ImageIcon lightIcon; + private final ImageIcon darkIcon; + + LightOrDarkIcon( String lightIconName, String darkIconName ) { + this.lightIcon = loadIcon( lightIconName ); + this.darkIcon = loadIcon( darkIconName ); + } + + private static ImageIcon loadIcon( String iconName ) { + ImageIcon icon = new ImageIcon( LightOrDarkIcon.class.getResource( iconName ) ); + + if( SystemInfo.isMacOS || !MultiResolutionImageSupport.isAvailable() || !iconName.endsWith( ".png" ) ) + return icon; + + String iconName2x = iconName.replace( ".png", "@2x.png" ); + URL url2x = LightOrDarkIcon.class.getResource( iconName2x ); + if( url2x == null ) + return icon; + + ImageIcon icon2x = new ImageIcon( url2x ); + return new ImageIcon( MultiResolutionImageSupport.create( 0, icon.getImage(), icon2x.getImage() ) ); + } + + private ImageIcon getCurrentIcon() { + return FlatLaf.isLafDark() ? darkIcon : lightIcon; + } + + @Override + public int getIconWidth() { + return getCurrentIcon().getIconWidth(); + } + + @Override + public int getIconHeight() { + return getCurrentIcon().getIconHeight(); + } + + @Override + public synchronized void paintIcon( Component c, Graphics g, int x, int y ) { + getCurrentIcon().paintIcon( c, g, x, y ); + } + + @Override + public Image getImage() { + return getCurrentIcon().getImage(); + } + } + + //---- class ColorIcon ---------------------------------------------------- + + private static class ColorIcon + extends ImageIcon + { + ColorIcon( Color color ) { + super( createColorImage( color ) ); + } + + private static Image createColorImage( Color color ) { + if( color == null ) + color = Color.black; + + BufferedImage image = new BufferedImage( UIScale.scale( 16 ), UIScale.scale( 16 ), BufferedImage.TYPE_INT_ARGB ); + Graphics2D g = image.createGraphics(); + try { + g.setColor( color ); + g.fillRect( UIScale.scale( 1 ), UIScale.scale( 2 ), UIScale.scale( 14 ), UIScale.scale( 12 ) ); + } finally { + g.dispose(); + } + return image; + } + } + + //---- class IntelliJFilterController ------------------------------------ + + private static class IntelliJFilterController + extends JPanel + { + int defaultBrightness; + int defaultContrast; + + private IntelliJFilterController() { + initComponents(); + } + + private void changed() { + int brightness = intellijBrightnessSlider.getValue(); + int contrast = intellijContrastSlider.getValue(); + + intellijBrightnessValue.setText( String.valueOf( brightness ) ); + intellijContrastValue.setText( String.valueOf( contrast ) ); + + RGBImageFilter filter = new IntelliJGrayFilter( brightness, contrast, 100 ); + firePropertyChange( "filter", null, filter ); + } + + private void reset() { + intellijBrightnessSlider.setValue( defaultBrightness ); + intellijContrastSlider.setValue( defaultContrast ); + changed(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JLabel intellijBrightnessLabel = new JLabel(); + intellijBrightnessSlider = new JSlider(); + intellijBrightnessValue = new JLabel(); + JLabel intellijContrastLabel = new JLabel(); + intellijContrastSlider = new JSlider(); + intellijContrastValue = new JLabel(); + JButton intellijLightResetButton = new JButton(); + + //======== this ======== + setLayout(new MigLayout( + "insets 0,hidemode 3,gap 0 0", + // columns + "[60,fill]" + + "[fill]" + + "[25,right]rel" + + "[fill]", + // rows + "[center]" + + "[center]")); + + //---- intellijBrightnessLabel ---- + intellijBrightnessLabel.setText("Brightness"); + add(intellijBrightnessLabel, "cell 0 0"); + + //---- intellijBrightnessSlider ---- + intellijBrightnessSlider.setMinimum(-100); + intellijBrightnessSlider.addChangeListener(e -> changed()); + add(intellijBrightnessSlider, "cell 1 0"); + + //---- intellijBrightnessValue ---- + intellijBrightnessValue.setText("000"); + add(intellijBrightnessValue, "cell 2 0"); + + //---- intellijContrastLabel ---- + intellijContrastLabel.setText("Contrast"); + add(intellijContrastLabel, "cell 0 1"); + + //---- intellijContrastSlider ---- + intellijContrastSlider.setMinimum(-100); + intellijContrastSlider.addChangeListener(e -> changed()); + add(intellijContrastSlider, "cell 1 1"); + + //---- intellijContrastValue ---- + intellijContrastValue.setText("-000"); + add(intellijContrastValue, "cell 2 1"); + + //---- intellijLightResetButton ---- + intellijLightResetButton.setText("Reset"); + intellijLightResetButton.addActionListener(e -> reset()); + add(intellijLightResetButton, "cell 3 0 1 2"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JSlider intellijBrightnessSlider; + private JLabel intellijBrightnessValue; + private JSlider intellijContrastSlider; + private JLabel intellijContrastValue; + // JFormDesigner - End of variables declaration //GEN-END:variables + } + + //---- class FilterButton ------------------------------------------------- + + private static class FilterButton + extends JToggleButton + { + private RGBImageFilter filter; + + FilterButton( RGBImageFilter filter, Icon icon ) { + this.filter = filter; + + setEnabled( false ); + setIcon( icon ); + } + + @Override + public void setIcon( Icon defaultIcon ) { + super.setIcon( defaultIcon ); + + if( filter != null ) + updateDisabledIcon(); + } + + void setFilter( RGBImageFilter filter ) { + this.filter = filter; + updateDisabledIcon(); + } + + @Override + public void updateUI() { + super.updateUI(); + updateDisabledIcon(); + } + + private void updateDisabledIcon() { + setDisabledIcon( createDisabledIcon( getIcon() ) ); + } + + protected Icon createDisabledIcon( Icon icon ) { + if( !(icon instanceof ImageIcon) ) + return null; + + Image image = ((ImageIcon) icon).getImage(); + ImageProducer producer = new FilteredImageSource( image.getSource(), filter ); + Image disabledImage = Toolkit.getDefaultToolkit().createImage( producer ); + return new ImageIcon( disabledImage ); + } + } + + //---- class PlasticRGBGrayFilter ----------------------------------------- + + // from https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java#L415-L434 + // license https://github.com/openjdk/jdk/blob/master/LICENSE + private static class MetalDisabledButtonImageFilter + extends RGBImageFilter + { + private final float min; + private final float factor; + + MetalDisabledButtonImageFilter(int min, int max) { + canFilterIndexColorModel = true; + this.min = min; + this.factor = (max - min) / 255f; + } + + @Override + public int filterRGB(int x, int y, int rgb) { + // Coefficients are from the sRGB color space: + int gray = Math.min(255, (int)(((0.2125f * ((rgb >> 16) & 0xFF)) + + (0.7154f * ((rgb >> 8) & 0xFF)) + + (0.0721f * (rgb & 0xFF)) + .5f) * factor + min)); + + return (rgb & 0xff000000) | (gray << 16) | (gray << 8) | + (gray << 0); + } + } + + //---- class PlasticRGBGrayFilter ----------------------------------------- + + // from https://github.com/JFormDesigner/swing-jgoodies-looks/blob/master/src/main/java/com/jgoodies/looks/common/RGBGrayFilter.java + // license https://github.com/JFormDesigner/swing-jgoodies-looks/blob/master/LICENSE.txt + private static final class PlasticRGBGrayFilter + extends RGBImageFilter + { + private PlasticRGBGrayFilter() { + canFilterIndexColorModel = true; + } + + @Override + public int filterRGB(int x, int y, int rgb) { + // Find the average of red, green, and blue. + float avg = (((rgb >> 16) & 0xff) / 255f + + ((rgb >> 8) & 0xff) / 255f + + (rgb & 0xff) / 255f) / 3; + // Pull out the alpha channel. + float alpha = (((rgb >> 24) & 0xff) / 255f); + + // Calculate the average. + // Sun's formula: Math.min(1.0f, (1f - avg) / (100.0f / 35.0f) + avg); + // The following formula uses less operations and hence is faster. + avg = Math.min(1.0f, 0.35f + 0.65f * avg); + // Convert back into RGB. + return (int) (alpha * 255f) << 24 | + (int) (avg * 255f) << 16 | + (int) (avg * 255f) << 8 | + (int) (avg * 255f); + } + } + + //---- class IntelliJGrayFilter ------------------------------------------- + + // from https://github.com/JetBrains/intellij-community/blob/3840eab54746f5c4f301bb3ac78f00a980b5fd6e/platform/util/ui/src/com/intellij/util/ui/UIUtil.java#L253-L347 + // license https://github.com/JetBrains/intellij-community/blob/master/LICENSE.txt + private static class IntelliJGrayFilter + extends RGBImageFilter + { + private float brightness; + private float contrast; + private int alpha; + + private int origContrast; + private int origBrightness; + + /** + * @param brightness in range [-100..100] where 0 has no effect + * @param contrast in range [-100..100] where 0 has no effect + * @param alpha in range [0..100] where 0 is transparent, 100 has no effect + */ + public IntelliJGrayFilter(int brightness, int contrast, int alpha) { + setBrightness(brightness); + setContrast(contrast); + setAlpha(alpha); + } + + private void setBrightness(int brightness) { + origBrightness = Math.max(-100, Math.min(100, brightness)); + this.brightness = (float)(Math.pow(origBrightness, 3) / (100f * 100f)); // cubic in [0..100] + } + + private void setContrast(int contrast) { + origContrast = Math.max(-100, Math.min(100, contrast)); + this.contrast = origContrast / 100f; + } + + private void setAlpha(int alpha) { + this.alpha = Math.max(0, Math.min(100, alpha)); + } + + @Override + public int filterRGB(int x, int y, int rgb) { + // Use NTSC conversion formula. + int gray = (int)(0.30 * (rgb >> 16 & 0xff) + + 0.59 * (rgb >> 8 & 0xff) + + 0.11 * (rgb & 0xff)); + + if (brightness >= 0) { + gray = (int)((gray + brightness * 255) / (1 + brightness)); + } + else { + gray = (int)(gray / (1 - brightness)); + } + + if (contrast >= 0) { + if (gray >= 127) { + gray = (int)(gray + (255 - gray) * contrast); + } + else { + gray = (int)(gray - gray * contrast); + } + } + else { + gray = (int)(127 + (gray - 127) * (contrast + 1)); + } + + int a = ((rgb >> 24) & 0xff) * alpha / 100; + + return (a << 24) | (gray << 16) | (gray << 8) | gray; + } + } + + //---- NetBeansDisabledButtonFilter --------------------------------------- + + // from https://github.com/apache/netbeans/blob/166e2bb491c29f6778223c6e9e16f70664252bce/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java#L1202-L1221 + // license https://github.com/apache/netbeans/blob/master/LICENSE + private static class NetBeansDisabledButtonFilter + extends RGBImageFilter + { + NetBeansDisabledButtonFilter() { + canFilterIndexColorModel = true; + } + + @Override + public int filterRGB(int x, int y, int rgb) { + // Reduce the color bandwidth in quarter (>> 2) and Shift 0x88. + return (rgb & 0xff000000) + 0x888888 + ((((rgb >> 16) & 0xff) >> 2) << 16) + ((((rgb >> 8) & 0xff) >> 2) << 8) + (((rgb) & 0xff) >> 2); + } + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.jfd new file mode 100644 index 00000000..1e4e2bab --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatDisabledIconsTest.jfd @@ -0,0 +1,456 @@ +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$columnConstraints": "[fill][fill][left][fill]" + "$rowConstraints": "[][][center][center][center][center][center][center][center]para[center][]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "enabledLabel" + "text": "enabled" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "enabledToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button1" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button2" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button3" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button4" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button5" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button6" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif" ) + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button7" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button8" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button9" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button10" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button11" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button12" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button13" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button14" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button15" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button16" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button17" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "button18" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "currentLabel" + "text": "current LaF" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "currentLafToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "basicLafLabel" + "text": "Basic LaF" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "basicLafToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3,gap 0 0" + "$columnConstraints": "[60,fill][fill][25,right]rel[fill]" + "$rowConstraints": "[center][center]" + } ) { + name: "panel2" + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "basicLafBrighterCheckBox" + "text": "brighter" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "basicLafChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0 2 1,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "basicLafPercentLabel" + "text": "Percent" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JSlider" ) { + name: "basicLafPercentSlider" + "toolTipText": "Percent" + "value": 0 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "basicLafChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "basicLafPercentValue" + "text": "000" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "basicLafResetButton" + "text": "Reset" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "basicLafReset", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 1 2" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "metalLafLabel" + "text": "Metal LaF" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "metalLafToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3,gap 0 0" + "$columnConstraints": "[60,fill][fill][25,right]rel[fill]" + "$rowConstraints": "[center][center]" + } ) { + name: "panel4" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "metalLafMinLabel" + "text": "Min" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JSlider" ) { + name: "metalLafMinSlider" + "maximum": 255 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "metalLafChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "metalLafMinValue" + "text": "000" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "metalLafResetButton" + "text": "Reset" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "metalLafReset", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "metalLafMaxLabel" + "text": "Max" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JSlider" ) { + name: "metalLafMaxSlider" + "maximum": 255 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "metalLafChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "metalLafMaxValue" + "text": "000" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "plasticLabel" + "text": "Plastic LaF" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "plasticToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijTextLabel" + "text": "IntelliJ text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "intellijTextToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) { + name: "intelliJTextFilterController" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJTextFilterChanged", true, "filter" ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijLightLabel" + "text": "IntelliJ light" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "intellijLightToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) { + name: "intelliJLightFilterController" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJLightFilterChanged", true, "filter" ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijDarkLabel" + "text": "IntelliJ dark" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "intellijDarkToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) { + name: "intelliJDarkFilterController" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJDarkFilterChanged", true, "filter" ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "netbeansLabel" + "text": "NetBeans" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "netbeansToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 8" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "zipToolBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "zipButton" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 9 3 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "selectedCheckBox" + "text": "selected" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "selectedChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 10" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "paletteIconsCheckBox" + "text": "palette icons" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paletteIconsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 10,alignx left,growx 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 1095, 625 ) + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3,gap 0 0" + "$columnConstraints": "[60,fill][fill][25,right]rel[fill]" + "$rowConstraints": "[center][center]" + } ) { + name: "panel1" + auxiliary() { + "JavaCodeGenerator.className": "IntelliJFilterController" + } + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijBrightnessLabel" + "text": "Brightness" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JSlider" ) { + name: "intellijBrightnessSlider" + "minimum": -100 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijBrightnessValue" + "text": "000" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijContrastLabel" + "text": "Contrast" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JSlider" ) { + name: "intellijContrastSlider" + "minimum": -100 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "intellijContrastValue" + "text": "-000" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "intellijLightResetButton" + "text": "Reset" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "reset", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 1 2" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 660 ) + "size": new java.awt.Dimension( 286, 39 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.java index cfd48649..72fd3b19 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.java @@ -18,6 +18,7 @@ package com.formdev.flatlaf.testing; import java.awt.*; import javax.swing.*; +import com.formdev.flatlaf.util.StringUtils; import com.formdev.flatlaf.util.UIScale; import net.miginfocom.swing.*; @@ -36,6 +37,18 @@ public class FlatHtmlTest FlatHtmlTest() { initComponents(); + + String html = label1.getText(); + label2.setText( html ); + toolTip1.setTipText( html ); + toolTip2.setTipText( html ); + + String html2 = StringUtils.removeLeading( StringUtils.removeTrailing( html, "" ), "" ); + editorPane1.setText( html2 ); + editorPane2.setText( html2 ); + textPane1.setText( html2 ); + textPane2.setText( html2 ); + increaseFontSize(); } @@ -45,6 +58,37 @@ public class FlatHtmlTest editorPaneLabel = new JLabel(); textPaneLabel = new JLabel(); toolTipLabel = new JLabel(); + panel1 = new JPanel(); + label5 = new JLabel(); + label6 = new JLabel(); + label7 = new JLabel(); + label3 = new JLabel(); + button1 = new JButton(); + button2 = new JButton(); + label11 = new JLabel(); + toggleButton1 = new JToggleButton(); + toggleButton2 = new JToggleButton(); + label12 = new JLabel(); + checkBox1 = new JCheckBox(); + checkBox2 = new JCheckBox(); + label13 = new JLabel(); + radioButton1 = new JRadioButton(); + radioButton2 = new JRadioButton(); + label8 = new JLabel(); + menu1 = new JMenu(); + menu2 = new JMenu(); + label4 = new JLabel(); + menuItem1 = new JMenuItem(); + menuItem2 = new JMenuItem(); + label9 = new JLabel(); + checkBoxMenuItem1 = new JCheckBoxMenuItem(); + checkBoxMenuItem2 = new JCheckBoxMenuItem(); + label10 = new JLabel(); + radioButtonMenuItem1 = new JRadioButtonMenuItem(); + radioButtonMenuItem2 = new JRadioButtonMenuItem(); + label14 = new JLabel(); + label15 = new JLabel(); + label16 = new JLabel(); label1 = new JLabel(); scrollPane15 = new JScrollPane(); editorPane1 = new JEditorPane(); @@ -65,6 +109,7 @@ public class FlatHtmlTest "[fill]" + "[fill]" + "[fill]" + + "[fill]" + "[fill]", // rows "[]" + @@ -87,8 +132,162 @@ public class FlatHtmlTest toolTipLabel.setText("JToolTip:"); add(toolTipLabel, "cell 3 0"); + //======== panel1 ======== + { + panel1.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[fill]" + + "[fill]" + + "[fill]", + // rows + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]")); + + //---- label5 ---- + label5.setText("JLabel:"); + panel1.add(label5, "cell 0 0"); + + //---- label6 ---- + label6.setText("Some Bold Text"); + panel1.add(label6, "cell 1 0"); + + //---- label7 ---- + label7.setText("Some text"); + panel1.add(label7, "cell 2 0"); + + //---- label3 ---- + label3.setText("JButon:"); + panel1.add(label3, "cell 0 1"); + + //---- button1 ---- + button1.setText("Some Bold Text"); + panel1.add(button1, "cell 1 1"); + + //---- button2 ---- + button2.setText("Some text"); + panel1.add(button2, "cell 2 1"); + + //---- label11 ---- + label11.setText("JToggleButton:"); + panel1.add(label11, "cell 0 2"); + + //---- toggleButton1 ---- + toggleButton1.setText("Some Bold Text"); + toggleButton1.setSelected(true); + panel1.add(toggleButton1, "cell 1 2"); + + //---- toggleButton2 ---- + toggleButton2.setText("Some text"); + toggleButton2.setSelected(true); + panel1.add(toggleButton2, "cell 2 2"); + + //---- label12 ---- + label12.setText("JCheckBox:"); + panel1.add(label12, "cell 0 3"); + + //---- checkBox1 ---- + checkBox1.setText("Some Bold Text"); + panel1.add(checkBox1, "cell 1 3"); + + //---- checkBox2 ---- + checkBox2.setText("Some text"); + panel1.add(checkBox2, "cell 2 3"); + + //---- label13 ---- + label13.setText("JRadioButton:"); + panel1.add(label13, "cell 0 4"); + + //---- radioButton1 ---- + radioButton1.setText("Some Bold Text"); + panel1.add(radioButton1, "cell 1 4"); + + //---- radioButton2 ---- + radioButton2.setText("Some text"); + panel1.add(radioButton2, "cell 2 4"); + + //---- label8 ---- + label8.setText("JMenu:"); + panel1.add(label8, "cell 0 5"); + + //======== menu1 ======== + { + menu1.setText("Some Bold Text"); + } + panel1.add(menu1, "cell 1 5"); + + //======== menu2 ======== + { + menu2.setText("Some text"); + } + panel1.add(menu2, "cell 2 5"); + + //---- label4 ---- + label4.setText("JMenuItem:"); + panel1.add(label4, "cell 0 6"); + + //---- menuItem1 ---- + menuItem1.setText("Some Bold Text"); + panel1.add(menuItem1, "cell 1 6"); + + //---- menuItem2 ---- + menuItem2.setText("Some text"); + panel1.add(menuItem2, "cell 2 6"); + + //---- label9 ---- + label9.setText("JCheckBoxMenuItem:"); + panel1.add(label9, "cell 0 7"); + + //---- checkBoxMenuItem1 ---- + checkBoxMenuItem1.setText("Some Bold Text"); + checkBoxMenuItem1.setSelected(true); + panel1.add(checkBoxMenuItem1, "cell 1 7"); + + //---- checkBoxMenuItem2 ---- + checkBoxMenuItem2.setText("Some text"); + checkBoxMenuItem2.setSelected(true); + panel1.add(checkBoxMenuItem2, "cell 2 7"); + + //---- label10 ---- + label10.setText("JRadioButtonMenuItem:"); + panel1.add(label10, "cell 0 8"); + + //---- radioButtonMenuItem1 ---- + radioButtonMenuItem1.setText("Some Bold Text"); + radioButtonMenuItem1.setSelected(true); + panel1.add(radioButtonMenuItem1, "cell 1 8"); + + //---- radioButtonMenuItem2 ---- + radioButtonMenuItem2.setText("Some text"); + radioButtonMenuItem2.setSelected(true); + panel1.add(radioButtonMenuItem2, "cell 2 8"); + + //---- label14 ---- + label14.setText("JToolTip:"); + panel1.add(label14, "cell 0 9"); + + //---- label15 ---- + label15.setText("(move mouse here)"); + label15.setToolTipText("Some Bold Text"); + panel1.add(label15, "cell 1 9"); + + //---- label16 ---- + label16.setText("(move mouse here)"); + label16.setToolTipText("Some text"); + panel1.add(label16, "cell 2 9"); + } + add(panel1, "cell 4 0 1 3,aligny top,growy 0"); + //---- label1 ---- - label1.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + label1.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph


Col 1Col 2
abcdef
  • item 1
  • item 2
"); add(label1, "cell 0 1"); //======== scrollPane15 ======== @@ -96,7 +295,7 @@ public class FlatHtmlTest //---- editorPane1 ---- editorPane1.setContentType("text/html"); - editorPane1.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + editorPane1.setText("text"); scrollPane15.setViewportView(editorPane1); } add(scrollPane15, "cell 1 1,grow"); @@ -106,17 +305,17 @@ public class FlatHtmlTest //---- textPane1 ---- textPane1.setContentType("text/html"); - textPane1.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + textPane1.setText("text"); scrollPane16.setViewportView(textPane1); } add(scrollPane16, "cell 2 1"); //---- toolTip1 ---- - toolTip1.setTipText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + toolTip1.setTipText("text"); add(toolTip1, "cell 3 1"); //---- label2 ---- - label2.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + label2.setText("text"); add(label2, "cell 0 2"); //======== scrollPane17 ======== @@ -124,7 +323,7 @@ public class FlatHtmlTest //---- editorPane2 ---- editorPane2.setContentType("text/html"); - editorPane2.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + editorPane2.setText("text"); scrollPane17.setViewportView(editorPane2); } add(scrollPane17, "cell 1 2,grow"); @@ -134,13 +333,13 @@ public class FlatHtmlTest //---- textPane2 ---- textPane2.setContentType("text/html"); - textPane2.setText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + textPane2.setText("text"); scrollPane18.setViewportView(textPane2); } add(scrollPane18, "cell 2 2"); //---- toolTip2 ---- - toolTip2.setTipText("HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

"); + toolTip2.setTipText("text"); add(toolTip2, "cell 3 2"); // JFormDesigner - End of component initialization //GEN-END:initComponents } @@ -170,6 +369,37 @@ public class FlatHtmlTest private JLabel editorPaneLabel; private JLabel textPaneLabel; private JLabel toolTipLabel; + private JPanel panel1; + private JLabel label5; + private JLabel label6; + private JLabel label7; + private JLabel label3; + private JButton button1; + private JButton button2; + private JLabel label11; + private JToggleButton toggleButton1; + private JToggleButton toggleButton2; + private JLabel label12; + private JCheckBox checkBox1; + private JCheckBox checkBox2; + private JLabel label13; + private JRadioButton radioButton1; + private JRadioButton radioButton2; + private JLabel label8; + private JMenu menu1; + private JMenu menu2; + private JLabel label4; + private JMenuItem menuItem1; + private JMenuItem menuItem2; + private JLabel label9; + private JCheckBoxMenuItem checkBoxMenuItem1; + private JCheckBoxMenuItem checkBoxMenuItem2; + private JLabel label10; + private JRadioButtonMenuItem radioButtonMenuItem1; + private JRadioButtonMenuItem radioButtonMenuItem2; + private JLabel label14; + private JLabel label15; + private JLabel label16; private JLabel label1; private JScrollPane scrollPane15; private JEditorPane editorPane1; diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd index df2c31ec..785f930a 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatHtmlTest.jfd @@ -1,11 +1,11 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" root: new FormRoot { add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" - "$columnConstraints": "[fill][fill][fill][fill]" + "$columnConstraints": "[fill][fill][fill][fill][fill]" "$rowConstraints": "[][top][top]" } ) { name: "this" @@ -33,9 +33,206 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 0" } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[fill][fill][fill]" + "$rowConstraints": "[][][][][][][][][][]" + } ) { + name: "panel1" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "JLabel:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label7" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "JButon:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button1" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label11" + "text": "JToggleButton:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton1" + "text": "Some Bold Text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton2" + "text": "Some text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label12" + "text": "JCheckBox:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "checkBox1" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "checkBox2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label13" + "text": "JRadioButton:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "radioButton1" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "radioButton2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label8" + "text": "JMenu:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu1" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "JMenuItem:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem1" + "text": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem2" + "text": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label9" + "text": "JCheckBoxMenuItem:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem1" + "text": "Some Bold Text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem2" + "text": "Some text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label10" + "text": "JRadioButtonMenuItem:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8" + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem1" + "text": "Some Bold Text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 8" + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem2" + "text": "Some text" + "selected": true + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 8" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label14" + "text": "JToolTip:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 9" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label15" + "text": "(move mouse here)" + "toolTipText": "Some Bold Text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 9" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label16" + "text": "(move mouse here)" + "toolTipText": "Some text" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 9" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 4 0 1 3,aligny top,growy 0" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label1" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph


Col 1Col 2
abcdef
  • item 1
  • item 2
" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 1" } ) @@ -44,7 +241,7 @@ new FormModel { add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane1" "contentType": "text/html" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "text" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1,grow" @@ -54,20 +251,20 @@ new FormModel { add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane1" "contentType": "text/html" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "text" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 1" } ) add( new FormComponent( "javax.swing.JToolTip" ) { name: "toolTip1" - "tipText": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "tipText": "text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 1" } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "label2" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 2" } ) @@ -76,7 +273,7 @@ new FormModel { add( new FormComponent( "javax.swing.JEditorPane" ) { name: "editorPane2" "contentType": "text/html" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "text" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2,grow" @@ -86,14 +283,14 @@ new FormModel { add( new FormComponent( "javax.swing.JTextPane" ) { name: "textPane2" "contentType": "text/html" - "text": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "text": "text" } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 2" } ) add( new FormComponent( "javax.swing.JToolTip" ) { name: "toolTip2" - "tipText": "HTML
Sample content
text with link

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Paragraph

" + "tipText": "text" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 3 2" } ) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.java index 4c2a7567..ede122a5 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.java @@ -1,5 +1,17 @@ /* - * Created by JFormDesigner on Tue Aug 27 21:47:02 CEST 2019 + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.formdev.flatlaf.testing; @@ -7,6 +19,7 @@ package com.formdev.flatlaf.testing; import java.awt.*; import java.beans.PropertyVetoException; import javax.swing.*; +import com.formdev.flatlaf.extras.TriStateCheckBox; import com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon; import com.formdev.flatlaf.util.UIScale; import net.miginfocom.swing.*; @@ -50,8 +63,18 @@ public class FlatInternalFrameTest maximizableCheckBox.isSelected(), iconifiableCheckBox.isSelected() ); - if( iconCheckBox.isSelected() ) + if( iconCheckBox.getState() == TriStateCheckBox.State.SELECTED ) internalFrame.setFrameIcon( new FlatFileViewFloppyDriveIcon() ); + else if( iconCheckBox.getState() == TriStateCheckBox.State.UNSELECTED ) + internalFrame.setFrameIcon( null ); + + if( menuBarCheckBox.isSelected() ) { + JMenuBar menuBar = new JMenuBar(); + JMenu menu = new JMenu( "I'm a Menu Bar" ); + menu.add( new JMenuItem( "Menu Item" ) ); + menuBar.add( menu ); + internalFrame.setJMenuBar( menuBar ); + } JPanel panel = new JPanel() { private final Color color = new Color( (int) (Math.random() * 0xffffff) | 0x20000000, true ); @@ -92,7 +115,8 @@ public class FlatInternalFrameTest closableCheckBox = new JCheckBox(); iconifiableCheckBox = new JCheckBox(); maximizableCheckBox = new JCheckBox(); - iconCheckBox = new JCheckBox(); + iconCheckBox = new TriStateCheckBox(); + menuBarCheckBox = new JCheckBox(); titleLabel = new JLabel(); titleField = new JTextField(); createFrameButton = new JButton(); @@ -152,6 +176,10 @@ public class FlatInternalFrameTest iconCheckBox.setText("Frame icon"); paletteContentPane.add(iconCheckBox, "cell 0 2"); + //---- menuBarCheckBox ---- + menuBarCheckBox.setText("Menu Bar"); + paletteContentPane.add(menuBarCheckBox, "cell 1 2"); + //---- titleLabel ---- titleLabel.setText("Frame title:"); paletteContentPane.add(titleLabel, "cell 0 3"); @@ -163,7 +191,7 @@ public class FlatInternalFrameTest paletteContentPane.add(createFrameButton, "cell 1 4,alignx right,growx 0"); } desktopPane.add(palette, JLayeredPane.PALETTE_LAYER); - palette.setBounds(15, 25, 220, 185); + palette.setBounds(15, 25, 275, 185); } add(desktopPane, "cell 0 0,width 600,height 600"); // JFormDesigner - End of component initialization //GEN-END:initComponents @@ -179,7 +207,8 @@ public class FlatInternalFrameTest private JCheckBox closableCheckBox; private JCheckBox iconifiableCheckBox; private JCheckBox maximizableCheckBox; - private JCheckBox iconCheckBox; + private TriStateCheckBox iconCheckBox; + private JCheckBox menuBarCheckBox; private JLabel titleLabel; private JTextField titleField; private JButton createFrameButton; diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.jfd index e74e2a14..d9a9a8ef 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatInternalFrameTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -50,12 +50,18 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1,alignx left,growx 0" } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { + add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) { name: "iconCheckBox" "text": "Frame icon" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 2" } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "menuBarCheckBox" + "text": "Menu Bar" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "titleLabel" "text": "Frame title:" @@ -77,7 +83,7 @@ new FormModel { }, new FormLayoutConstraints( null ) { "x": 15 "y": 25 - "width": 220 + "width": 275 "height": 185 "layer": 100 } ) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.java index 52d8390a..a61d2322 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.java @@ -16,10 +16,19 @@ package com.formdev.flatlaf.testing; +import java.awt.Color; import java.awt.Component; import java.awt.Container; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.event.*; +import java.util.function.Supplier; import javax.swing.*; +import javax.swing.plaf.ColorUIResource; +import com.formdev.flatlaf.FlatLaf; +import com.formdev.flatlaf.icons.FlatAbstractIcon; +import com.formdev.flatlaf.util.UIScale; import net.miginfocom.swing.*; /** @@ -31,12 +40,15 @@ public class FlatMenusTest public static void main( String[] args ) { SwingUtilities.invokeLater( () -> { FlatTestFrame frame = FlatTestFrame.create( args, "FlatMenusTest" ); + frame.useApplyComponentOrientation = true; frame.showFrame( FlatMenusTest::new ); } ); } FlatMenusTest() { initComponents(); + + largerCheckBox.setSelected( LargerMenuItem.useLargerSize ); } private void armedChanged() { @@ -54,6 +66,20 @@ public class FlatMenusTest } } + private void underlineChanged() { + UIManager.put( "MenuItem.selectionType", underlineCheckBox.isSelected() ? "underline" : null ); + + if( armedCheckBox.isSelected() ) + FlatLaf.updateUI(); + } + + private void popupMenubackgroundChanged() { + UIManager.put( "PopupMenu.background", popupMenubackgroundCheckBox.isSelected() + ? new ColorUIResource( Color.yellow ) + : null ); + FlatLaf.updateUI(); + } + private void showPopupMenuButtonActionPerformed(ActionEvent e) { Component invoker = (Component) e.getSource(); PopupMenu popupMenu = new PopupMenu(); @@ -61,16 +87,109 @@ public class FlatMenusTest popupMenu.show( invoker, 0, invoker.getHeight() ); } + private void largerChanged() { + LargerMenuItem.useLargerSize = largerCheckBox.isSelected(); + menuBar2.revalidate(); + } + + private void accelChanged() { + updateAccel( menuBar2, () -> { + return accelCheckBox.isSelected() ? getRandomKeyStroke() : null; + } ); + } + + private void updateAccel( Component c, Supplier keyStrokeSupplier ) { + if( c instanceof JMenuItem && !(c instanceof JMenu) ) + ((JMenuItem)c).setAccelerator( keyStrokeSupplier.get() ); + + if( c instanceof Container ) { + for( Component c2 : ((Container)c).getComponents() ) + updateAccel( c2, keyStrokeSupplier ); + } + if( c instanceof JMenu ) { + randomKeyStrokeIndex = 0; + JMenu menu = (JMenu) c; + int itemCount = menu.getItemCount(); + for( int i = 0; i < itemCount; i++ ) + updateAccel( menu.getItem( i ), keyStrokeSupplier ); + } + } + + private KeyStroke getRandomKeyStroke() { + if( randomKeyStrokeIndex >= randomKeyStrokes.length ) + randomKeyStrokeIndex = 0; + return randomKeyStrokes[randomKeyStrokeIndex++]; + } + + private int randomKeyStrokeIndex = 0; + private final KeyStroke[] randomKeyStrokes = { + KeyStroke.getKeyStroke( KeyEvent.VK_F2, 0 ), + KeyStroke.getKeyStroke( KeyEvent.VK_A, KeyEvent.CTRL_MASK ), + KeyStroke.getKeyStroke( KeyEvent.VK_B, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK ), + KeyStroke.getKeyStroke( KeyEvent.VK_BACK_SPACE, 0 ), + KeyStroke.getKeyStroke( KeyEvent.VK_PAGE_UP, 0 ), + KeyStroke.getKeyStroke( KeyEvent.VK_C, KeyEvent.ALT_MASK ), + KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ), + KeyStroke.getKeyStroke( KeyEvent.VK_F10, 0 ), + KeyStroke.getKeyStroke( KeyEvent.VK_0, 0 ), + }; + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JLabel menuBarLabel = new JLabel(); JMenuBar menuBar1 = new JMenuBar(); JMenu menu5 = new JMenu(); + JMenuItem menuItem35 = new JMenuItem(); JMenuItem menuItem7 = new JMenuItem(); + JMenuItem menuItem34 = new JMenuItem(); JMenuItem menuItem8 = new JMenuItem(); + JMenuItem menuItem38 = new JMenuItem(); + JMenu menu11 = new JMenu(); + JMenuItem menuItem36 = new JMenuItem(); + JMenuItem menuItem37 = new JMenuItem(); + JCheckBoxMenuItem checkBoxMenuItem6 = new JCheckBoxMenuItem(); + JCheckBoxMenuItem checkBoxMenuItem7 = new JCheckBoxMenuItem(); + JCheckBoxMenuItem checkBoxMenuItem8 = new JCheckBoxMenuItem(); + JRadioButtonMenuItem radioButtonMenuItem5 = new JRadioButtonMenuItem(); + JRadioButtonMenuItem radioButtonMenuItem6 = new JRadioButtonMenuItem(); + JRadioButtonMenuItem radioButtonMenuItem8 = new JRadioButtonMenuItem(); + JRadioButtonMenuItem radioButtonMenuItem9 = new JRadioButtonMenuItem(); + JRadioButtonMenuItem radioButtonMenuItem10 = new JRadioButtonMenuItem(); JMenu menu6 = new JMenu(); JMenuItem menuItem5 = new JMenuItem(); JMenuItem menuItem6 = new JMenuItem(); + FlatMenusTest.MenuWithAccelerator menuWithAccelerator1 = new FlatMenusTest.MenuWithAccelerator(); + FlatMenusTest.MenuWithAccelerator menuWithAccelerator2 = new FlatMenusTest.MenuWithAccelerator(); + JMenuItem menuItem40 = new JMenuItem(); + JMenuItem menuItem39 = new JMenuItem(); + menuBar2 = new JMenuBar(); + JMenu menu8 = new JMenu(); + FlatMenusTest.LargerMenuItem menuItem13 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem14 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem27 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem15 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem16 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem28 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem18 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem17 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem19 = new FlatMenusTest.LargerMenuItem(); + JMenuItem menuItem31 = new JMenuItem(); + JMenu menu9 = new JMenu(); + FlatMenusTest.LargerMenuItem menuItem20 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem21 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem29 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem22 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem23 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem30 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem25 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem24 = new FlatMenusTest.LargerMenuItem(); + FlatMenusTest.LargerMenuItem menuItem26 = new FlatMenusTest.LargerMenuItem(); + JMenuItem menuItem32 = new JMenuItem(); + JMenu menu10 = new JMenu(); + FlatMenusTest.LargerMenuItem menuItem33 = new FlatMenusTest.LargerMenuItem(); + JPanel panel5 = new JPanel(); + largerCheckBox = new JCheckBox(); + accelCheckBox = new JCheckBox(); JPanel panel1 = new JPanel(); JLabel menuLabel = new JLabel(); JMenu menu1 = new JMenu(); @@ -100,6 +219,8 @@ public class FlatMenusTest JLabel popupMenuLabel = new JLabel(); JButton showPopupMenuButton = new JButton(); armedCheckBox = new JCheckBox(); + underlineCheckBox = new JCheckBox(); + popupMenubackgroundCheckBox = new JCheckBox(); //======== this ======== setLayout(new MigLayout( @@ -114,6 +235,8 @@ public class FlatMenusTest "[]" + "[top]" + "[]" + + "[]" + + "[]" + "[]")); //---- menuBarLabel ---- @@ -127,16 +250,90 @@ public class FlatMenusTest { menu5.setText("text"); menu5.setMnemonic('T'); + menu5.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png"))); + + //---- menuItem35 ---- + menuItem35.setText("text"); + menu5.add(menuItem35); //---- menuItem7 ---- menuItem7.setText("text"); menuItem7.setMnemonic('X'); + menuItem7.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png"))); + menuItem7.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK|KeyEvent.SHIFT_MASK)); menu5.add(menuItem7); + //---- menuItem34 ---- + menuItem34.setText("longer text longer text"); + menuItem34.setMnemonic('E'); + menuItem34.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0)); + menu5.add(menuItem34); + //---- menuItem8 ---- - menuItem8.setText("text"); + menuItem8.setText("longer text longer text longer"); menuItem8.setMnemonic('E'); menu5.add(menuItem8); + + //---- menuItem38 ---- + menuItem38.setText("some HTML text"); + menu5.add(menuItem38); + + //======== menu11 ======== + { + menu11.setText("sub menu"); + + //---- menuItem36 ---- + menuItem36.setText("text"); + menu11.add(menuItem36); + + //---- menuItem37 ---- + menuItem37.setText("text"); + menu11.add(menuItem37); + } + menu5.add(menu11); + menu5.addSeparator(); + + //---- checkBoxMenuItem6 ---- + checkBoxMenuItem6.setText("check"); + checkBoxMenuItem6.setSelected(true); + menu5.add(checkBoxMenuItem6); + + //---- checkBoxMenuItem7 ---- + checkBoxMenuItem7.setText("check with icon"); + checkBoxMenuItem7.setSelected(true); + checkBoxMenuItem7.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png"))); + menu5.add(checkBoxMenuItem7); + + //---- checkBoxMenuItem8 ---- + checkBoxMenuItem8.setText("check with larger icon"); + checkBoxMenuItem8.setSelected(true); + menu5.add(checkBoxMenuItem8); + menu5.addSeparator(); + + //---- radioButtonMenuItem5 ---- + radioButtonMenuItem5.setText("radio 1"); + radioButtonMenuItem5.setSelected(true); + menu5.add(radioButtonMenuItem5); + + //---- radioButtonMenuItem6 ---- + radioButtonMenuItem6.setText("radio 2"); + menu5.add(radioButtonMenuItem6); + menu5.addSeparator(); + + //---- radioButtonMenuItem8 ---- + radioButtonMenuItem8.setText("radio with icon 1"); + radioButtonMenuItem8.setSelected(true); + radioButtonMenuItem8.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png"))); + menu5.add(radioButtonMenuItem8); + + //---- radioButtonMenuItem9 ---- + radioButtonMenuItem9.setText("radio with icon 2"); + radioButtonMenuItem9.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png"))); + menu5.add(radioButtonMenuItem9); + + //---- radioButtonMenuItem10 ---- + radioButtonMenuItem10.setText("radio with larger icon"); + menu5.add(radioButtonMenuItem10); } menuBar1.add(menu5); @@ -153,8 +350,206 @@ public class FlatMenusTest menu6.add(menuItem6); } menuBar1.add(menu6); + + //======== menuWithAccelerator1 ======== + { + menuWithAccelerator1.setText("text"); + menuWithAccelerator1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0)); + + //======== menuWithAccelerator2 ======== + { + menuWithAccelerator2.setText("text"); + menuWithAccelerator2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK)); + + //---- menuItem40 ---- + menuItem40.setText("text"); + menuWithAccelerator2.add(menuItem40); + } + menuWithAccelerator1.add(menuWithAccelerator2); + + //---- menuItem39 ---- + menuItem39.setText("text"); + menuItem39.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK)); + menuWithAccelerator1.add(menuItem39); + } + menuBar1.add(menuWithAccelerator1); } - add(menuBar1, "cell 1 0 4 1,growx"); + add(menuBar1, "cell 1 0 2 1,growx"); + + //======== menuBar2 ======== + { + + //======== menu8 ======== + { + menu8.setText("text position"); + menu8.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png"))); + menu8.setHorizontalTextPosition(SwingConstants.CENTER); + menu8.setVerticalTextPosition(SwingConstants.BOTTOM); + + //---- menuItem13 ---- + menuItem13.setText("vert top"); + menuItem13.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem13.setVerticalTextPosition(SwingConstants.TOP); + menu8.add(menuItem13); + + //---- menuItem14 ---- + menuItem14.setText("vert bottom"); + menuItem14.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem14.setVerticalTextPosition(SwingConstants.BOTTOM); + menu8.add(menuItem14); + + //---- menuItem27 ---- + menuItem27.setText("horz leading"); + menuItem27.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem27.setHorizontalTextPosition(SwingConstants.LEADING); + menu8.add(menuItem27); + + //---- menuItem15 ---- + menuItem15.setText("horz left"); + menuItem15.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem15.setHorizontalTextPosition(SwingConstants.LEFT); + menu8.add(menuItem15); + + //---- menuItem16 ---- + menuItem16.setText("horz right"); + menuItem16.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem16.setHorizontalTextPosition(SwingConstants.RIGHT); + menu8.add(menuItem16); + + //---- menuItem28 ---- + menuItem28.setText("horz trailing"); + menuItem28.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menu8.add(menuItem28); + + //---- menuItem18 ---- + menuItem18.setText("horz center / vert top"); + menuItem18.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem18.setHorizontalTextPosition(SwingConstants.CENTER); + menuItem18.setVerticalTextPosition(SwingConstants.TOP); + menu8.add(menuItem18); + + //---- menuItem17 ---- + menuItem17.setText("horz center / vert bottom"); + menuItem17.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem17.setHorizontalTextPosition(SwingConstants.CENTER); + menuItem17.setVerticalTextPosition(SwingConstants.BOTTOM); + menu8.add(menuItem17); + + //---- menuItem19 ---- + menuItem19.setText("horz center / vert center"); + menuItem19.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem19.setHorizontalTextPosition(SwingConstants.CENTER); + menu8.add(menuItem19); + + //---- menuItem31 ---- + menuItem31.setText("1234567890123456789012345678901234567890"); + menu8.add(menuItem31); + } + menuBar2.add(menu8); + + //======== menu9 ======== + { + menu9.setText("alignment"); + menu9.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png"))); + menu9.setHorizontalTextPosition(SwingConstants.CENTER); + menu9.setVerticalTextPosition(SwingConstants.TOP); + + //---- menuItem20 ---- + menuItem20.setText("vert top"); + menuItem20.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem20.setVerticalAlignment(SwingConstants.TOP); + menu9.add(menuItem20); + + //---- menuItem21 ---- + menuItem21.setText("vert bottom"); + menuItem21.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem21.setVerticalAlignment(SwingConstants.BOTTOM); + menu9.add(menuItem21); + + //---- menuItem29 ---- + menuItem29.setText("horz leading"); + menuItem29.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menu9.add(menuItem29); + + //---- menuItem22 ---- + menuItem22.setText("horz left"); + menuItem22.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem22.setHorizontalAlignment(SwingConstants.LEFT); + menu9.add(menuItem22); + + //---- menuItem23 ---- + menuItem23.setText("horz right"); + menuItem23.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem23.setHorizontalAlignment(SwingConstants.RIGHT); + menu9.add(menuItem23); + + //---- menuItem30 ---- + menuItem30.setText("horz trailing"); + menuItem30.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem30.setHorizontalAlignment(SwingConstants.TRAILING); + menu9.add(menuItem30); + + //---- menuItem25 ---- + menuItem25.setText("horz center / vert top"); + menuItem25.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem25.setHorizontalAlignment(SwingConstants.CENTER); + menuItem25.setVerticalAlignment(SwingConstants.TOP); + menu9.add(menuItem25); + + //---- menuItem24 ---- + menuItem24.setText("horz center / vert bottom"); + menuItem24.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem24.setHorizontalAlignment(SwingConstants.CENTER); + menuItem24.setVerticalAlignment(SwingConstants.BOTTOM); + menu9.add(menuItem24); + + //---- menuItem26 ---- + menuItem26.setText("horz center / vert center"); + menuItem26.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menuItem26.setHorizontalAlignment(SwingConstants.CENTER); + menu9.add(menuItem26); + + //---- menuItem32 ---- + menuItem32.setText("1234567890123456789012345678901234567890"); + menu9.add(menuItem32); + } + menuBar2.add(menu9); + + //======== menu10 ======== + { + menu10.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menu10.setHorizontalTextPosition(SwingConstants.CENTER); + menu10.setVerticalTextPosition(SwingConstants.TOP); + + //---- menuItem33 ---- + menuItem33.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png"))); + menu10.add(menuItem33); + } + menuBar2.add(menu10); + } + add(menuBar2, "cell 3 0 2 1,growx"); + + //======== panel5 ======== + { + panel5.setLayout(new MigLayout( + "ltr,insets 0,hidemode 3", + // columns + "[]", + // rows + "[]0" + + "[]")); + + //---- largerCheckBox ---- + largerCheckBox.setText("larger"); + largerCheckBox.addActionListener(e -> largerChanged()); + panel5.add(largerCheckBox, "cell 0 0"); + + //---- accelCheckBox ---- + accelCheckBox.setText("accel"); + accelCheckBox.addActionListener(e -> accelChanged()); + panel5.add(accelCheckBox, "cell 0 1"); + } + add(panel5, "cell 3 0 2 1"); //======== panel1 ======== { @@ -197,7 +592,7 @@ public class FlatMenusTest panel1.add(checkBoxMenuItemLabel, "cell 0 2"); //---- checkBoxMenuItem1 ---- - checkBoxMenuItem1.setText("enabled"); + checkBoxMenuItem1.setText("enabled"); checkBoxMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0)); checkBoxMenuItem1.setMnemonic('A'); panel1.add(checkBoxMenuItem1, "cell 1 2"); @@ -207,7 +602,7 @@ public class FlatMenusTest panel1.add(radioButtonMenuItemLabel, "cell 0 3"); //---- radioButtonMenuItem1 ---- - radioButtonMenuItem1.setText("enabled"); + radioButtonMenuItem1.setText("enabled"); radioButtonMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0)); radioButtonMenuItem1.setMnemonic('B'); panel1.add(radioButtonMenuItem1, "cell 1 3"); @@ -361,13 +756,50 @@ public class FlatMenusTest armedCheckBox.setMnemonic('A'); armedCheckBox.addActionListener(e -> armedChanged()); add(armedCheckBox, "cell 0 3"); + + //---- underlineCheckBox ---- + underlineCheckBox.setText("underline menu selection"); + underlineCheckBox.addActionListener(e -> underlineChanged()); + add(underlineCheckBox, "cell 0 4 2 1"); + + //---- popupMenubackgroundCheckBox ---- + popupMenubackgroundCheckBox.setText("yellow popup menu background"); + popupMenubackgroundCheckBox.addActionListener(e -> popupMenubackgroundChanged()); + add(popupMenubackgroundCheckBox, "cell 0 5 2 1"); + + //---- buttonGroup1 ---- + ButtonGroup buttonGroup1 = new ButtonGroup(); + buttonGroup1.add(radioButtonMenuItem5); + buttonGroup1.add(radioButtonMenuItem6); + + //---- buttonGroup2 ---- + ButtonGroup buttonGroup2 = new ButtonGroup(); + buttonGroup2.add(radioButtonMenuItem8); + buttonGroup2.add(radioButtonMenuItem9); + buttonGroup2.add(radioButtonMenuItem10); // JFormDesigner - End of component initialization //GEN-END:initComponents + + Icon largerIcon = new FlatAbstractIcon( 16, 16, Color.orange ) { + @Override + protected void paintIcon( Component c, Graphics2D g2 ) { + g2.fillRect( 0, 0, 16, 16 ); + } + }; + checkBoxMenuItem8.setIcon( largerIcon ); + radioButtonMenuItem10.setIcon( largerIcon ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JMenuBar menuBar2; + private JCheckBox largerCheckBox; + private JCheckBox accelCheckBox; private JCheckBox armedCheckBox; + private JCheckBox underlineCheckBox; + private JCheckBox popupMenubackgroundCheckBox; // JFormDesigner - End of variables declaration //GEN-END:variables + //---- class PopupMenu ---------------------------------------------------- + private class PopupMenu extends JPopupMenu { private PopupMenu() { initComponents(); @@ -417,4 +849,54 @@ public class FlatMenusTest // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - End of variables declaration //GEN-END:variables } + + //---- class LargerMenuItem ----------------------------------------------- + + public static class LargerMenuItem + extends JMenuItem + { + static boolean useLargerSize = true; + + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + return useLargerSize + ? new Dimension( size.width + UIScale.scale( 40 ), + size.height + UIScale.scale( 30 ) ) + : size; + } + + @Override + protected void paintComponent( Graphics g ) { + super.paintComponent( g ); + + g.setColor( UIManager.getColor( "Separator.foreground" ) ); + g.drawLine( 0, 0, getWidth(), 0 ); + g.drawLine( 0, getHeight(), getWidth(), getHeight() ); + } + } + + //---- class MenuWithAccelerator ------------------------------------------ + + public static class MenuWithAccelerator + extends JMenu + { + private KeyStroke accelerator; + + @Override + public KeyStroke getAccelerator() { + return accelerator; + } + + @Override + public void setAccelerator( KeyStroke keyStroke ) { + KeyStroke oldAccelerator = accelerator; + this.accelerator = keyStroke; + + revalidate(); + repaint(); + + firePropertyChange( "accelerator", oldAccelerator, accelerator ); + } + } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.jfd index 2700ef0b..da5bdd77 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMenusTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -9,7 +9,7 @@ new FormModel { add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" "$columnConstraints": "[125][][][][]" - "$rowConstraints": "[][top][][]" + "$rowConstraints": "[][top][][][][]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -24,16 +24,99 @@ new FormModel { name: "menu5" "text": "text" "mnemonic": 84 + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png" ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem35" + "text": "text" + } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "menuItem7" "text": "text" "mnemonic": 88 + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png" ) + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 195, false ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem34" + "text": "longer text longer text" + "mnemonic": 69 + "accelerator": static javax.swing.KeyStroke getKeyStroke( 115, 0, false ) } ) add( new FormComponent( "javax.swing.JMenuItem" ) { name: "menuItem8" - "text": "text" + "text": "longer text longer text longer" "mnemonic": 69 } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem38" + "text": "some HTML text" + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu11" + "text": "sub menu" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem36" + "text": "text" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem37" + "text": "text" + } ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator3" + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem6" + "text": "check" + "selected": true + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem7" + "text": "check with icon" + "selected": true + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png" ) + } ) + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem8" + "text": "check with larger icon" + "selected": true + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator5" + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem5" + "text": "radio 1" + "$buttonGroup": new FormReference( "buttonGroup1" ) + "selected": true + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem6" + "text": "radio 2" + "$buttonGroup": new FormReference( "buttonGroup1" ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator4" + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem8" + "text": "radio with icon 1" + "selected": true + "$buttonGroup": new FormReference( "buttonGroup2" ) + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png" ) + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem9" + "text": "radio with icon 2" + "$buttonGroup": &FormReference0 new FormReference( "buttonGroup2" ) + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png" ) + } ) + add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { + name: "radioButtonMenuItem10" + "text": "radio with larger icon" + "$buttonGroup": #FormReference0 + } ) } ) add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { name: "menu6" @@ -47,8 +130,206 @@ new FormModel { "text": "text" } ) } ) + add( new FormContainer( "com.formdev.flatlaf.testing.FlatMenusTest$MenuWithAccelerator", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menuWithAccelerator1" + "text": "text" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 122, 0, false ) + add( new FormContainer( "com.formdev.flatlaf.testing.FlatMenusTest$MenuWithAccelerator", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menuWithAccelerator2" + "text": "text" + "accelerator": &KeyStroke0 static javax.swing.KeyStroke getKeyStroke( 72, 130, false ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem40" + "text": "text" + } ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem39" + "text": "text" + "accelerator": #KeyStroke0 + } ) + } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0 4 1,growx" + "value": "cell 1 0 2 1,growx" + } ) + add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { + name: "menuBar2" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu8" + "text": "text position" + "icon": &SwingIcon0 new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png" ) + "horizontalTextPosition": 0 + "verticalTextPosition": 3 + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem13" + "text": "vert top" + "icon": &SwingIcon1 new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png" ) + "verticalTextPosition": 1 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem14" + "text": "vert bottom" + "icon": #SwingIcon1 + "verticalTextPosition": 3 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem27" + "text": "horz leading" + "icon": &SwingIcon2 new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png" ) + "horizontalTextPosition": 10 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem15" + "text": "horz left" + "icon": #SwingIcon2 + "horizontalTextPosition": 2 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem16" + "text": "horz right" + "icon": #SwingIcon2 + "horizontalTextPosition": 4 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem28" + "text": "horz trailing" + "icon": #SwingIcon2 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem18" + "text": "horz center / vert top" + "icon": #SwingIcon2 + "horizontalTextPosition": 0 + "verticalTextPosition": 1 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem17" + "text": "horz center / vert bottom" + "icon": #SwingIcon2 + "horizontalTextPosition": 0 + "verticalTextPosition": 3 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem19" + "text": "horz center / vert center" + "icon": #SwingIcon2 + "horizontalTextPosition": 0 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem31" + "text": "1234567890123456789012345678901234567890" + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu9" + "text": "alignment" + "icon": #SwingIcon0 + "horizontalTextPosition": 0 + "verticalTextPosition": 1 + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem20" + "text": "vert top" + "icon": #SwingIcon1 + "verticalAlignment": 1 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem21" + "text": "vert bottom" + "icon": #SwingIcon1 + "verticalAlignment": 3 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem29" + "text": "horz leading" + "icon": #SwingIcon2 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem22" + "text": "horz left" + "icon": #SwingIcon2 + "horizontalAlignment": 2 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem23" + "text": "horz right" + "icon": #SwingIcon2 + "horizontalAlignment": 4 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem30" + "text": "horz trailing" + "icon": #SwingIcon2 + "horizontalAlignment": 11 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem25" + "text": "horz center / vert top" + "icon": #SwingIcon2 + "horizontalAlignment": 0 + "verticalAlignment": 1 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem24" + "text": "horz center / vert bottom" + "icon": #SwingIcon2 + "horizontalAlignment": 0 + "verticalAlignment": 3 + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem26" + "text": "horz center / vert center" + "icon": #SwingIcon2 + "horizontalAlignment": 0 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "menuItem32" + "text": "1234567890123456789012345678901234567890" + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu10" + "icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png" ) + "horizontalTextPosition": 0 + "verticalTextPosition": 1 + add( new FormComponent( "com.formdev.flatlaf.testing.FlatMenusTest$LargerMenuItem" ) { + name: "menuItem33" + "icon": #SwingIcon1 + } ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 2 1,growx" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$columnConstraints": "[]" + "$rowConstraints": "[]0[]" + "$layoutConstraints": "ltr,insets 0,hidemode 3" + } ) { + name: "panel5" + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "largerCheckBox" + "text": "larger" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "largerChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "accelCheckBox" + "text": "accel" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "accelChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 0 2 1" } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$columnConstraints": "[125,left][fill]" @@ -92,8 +373,8 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { name: "checkBoxMenuItem1" - "text": "enabled" - "accelerator": &KeyStroke0 static javax.swing.KeyStroke getKeyStroke( 112, 0, false ) + "text": "enabled" + "accelerator": &KeyStroke1 static javax.swing.KeyStroke getKeyStroke( 112, 0, false ) "mnemonic": 65 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" @@ -106,8 +387,8 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) { name: "radioButtonMenuItem1" - "text": "enabled" - "accelerator": #KeyStroke0 + "text": "enabled" + "accelerator": #KeyStroke1 "mnemonic": 66 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 3" @@ -154,7 +435,7 @@ new FormModel { name: "checkBoxMenuItem2" "text": "disabled" "enabled": false - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 "mnemonic": 83 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 2" @@ -163,7 +444,7 @@ new FormModel { name: "radioButtonMenuItem2" "text": "disabled" "enabled": false - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 "mnemonic": 76 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 3" @@ -189,7 +470,7 @@ new FormModel { name: "menuItem3" "text": "selected" "selected": true - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 1" } ) @@ -197,7 +478,7 @@ new FormModel { name: "checkBoxMenuItem3" "text": "selected" "selected": true - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 2" } ) @@ -205,7 +486,7 @@ new FormModel { name: "radioButtonMenuItem3" "text": "selected" "selected": true - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 3" } ) @@ -231,7 +512,7 @@ new FormModel { "text": "selected disabled" "selected": true "enabled": false - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 1" } ) @@ -240,7 +521,7 @@ new FormModel { "text": "selected disabled" "enabled": false "selected": true - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 2" } ) @@ -249,7 +530,7 @@ new FormModel { "text": "selected disabled" "enabled": false "selected": true - "accelerator": #KeyStroke0 + "accelerator": #KeyStroke1 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 3" } ) @@ -280,6 +561,26 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 3" } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "underlineCheckBox" + "text": "underline menu selection" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "underlineChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "popupMenubackgroundCheckBox" + "text": "yellow popup menu background" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "popupMenubackgroundChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5 2 1" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) "size": new java.awt.Dimension( 790, 380 ) @@ -321,5 +622,15 @@ new FormModel { }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 430 ) } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "buttonGroup1" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 564 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "buttonGroup2" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 616 ) + } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.java new file mode 100644 index 00000000..4c756b0a --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.java @@ -0,0 +1,449 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatMnemonicsTest + extends FlatTestPanel +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatMnemonicsTest" ); + frame.showFrame( FlatMnemonicsTest::new, panel -> ((FlatMnemonicsTest)panel).menuBar ); + } ); + } + + FlatMnemonicsTest() { + initComponents(); + } + + private void menuItemActionPerformed(ActionEvent e) { + SwingUtilities.invokeLater( () -> { + JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE ); + } ); + } + + private void textArea1KeyReleased(KeyEvent e) { + if( e.getKeyCode() == KeyEvent.VK_ALT ) { + System.out.println( "++++ consume Alt key on release +++++++++++++++++++++++++++++++++++++++++++++++++++++" ); + e.consume(); + } + } + + private void alwaysShowMnemonicsChanged() { + UIManager.put( "Component.hideMnemonics", !alwaysShowMnemonicsCheckBox.isSelected() ); + SwingUtilities.windowForComponent( this ).repaint(); + } + + private void openDialog() { + JOptionPane.showMessageDialog( this, new FlatMnemonicsTest() ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JLabel label1 = new JLabel(); + JTextField textField1 = new JTextField(); + JLabel label2 = new JLabel(); + JTextField textField2 = new JTextField(); + JLabel label3 = new JLabel(); + JComboBox comboBox1 = new JComboBox<>(); + JCheckBox checkBox1 = new JCheckBox(); + JButton button1 = new JButton(); + JLabel label4 = new JLabel(); + JScrollPane scrollPane1 = new JScrollPane(); + JTextArea textArea1 = new JTextArea(); + JTabbedPane tabbedPane1 = new JTabbedPane(); + JPanel panel1 = new JPanel(); + JLabel label7 = new JLabel(); + JPanel panel2 = new JPanel(); + JLabel label6 = new JLabel(); + JPanel panel3 = new JPanel(); + JLabel label5 = new JLabel(); + alwaysShowMnemonicsCheckBox = new JCheckBox(); + JButton button2 = new JButton(); + menuBar = new JMenuBar(); + JMenu fileMenu = new JMenu(); + JMenuItem newMenuItem = new JMenuItem(); + JMenuItem openMenuItem = new JMenuItem(); + JMenuItem closeMenuItem = new JMenuItem(); + JMenuItem closeMenuItem2 = new JMenuItem(); + JMenuItem exitMenuItem = new JMenuItem(); + JMenu editMenu = new JMenu(); + JMenuItem undoMenuItem = new JMenuItem(); + JMenuItem redoMenuItem = new JMenuItem(); + JMenuItem cutMenuItem = new JMenuItem(); + JMenuItem copyMenuItem = new JMenuItem(); + JMenuItem pasteMenuItem = new JMenuItem(); + JMenuItem deleteMenuItem = new JMenuItem(); + JMenu viewMenu = new JMenu(); + JCheckBoxMenuItem checkBoxMenuItem1 = new JCheckBoxMenuItem(); + JMenu menu1 = new JMenu(); + JMenu subViewsMenu = new JMenu(); + JMenu subSubViewsMenu = new JMenu(); + JMenuItem errorLogViewMenuItem = new JMenuItem(); + JMenuItem searchViewMenuItem = new JMenuItem(); + JMenuItem projectViewMenuItem = new JMenuItem(); + JMenuItem structureViewMenuItem = new JMenuItem(); + JMenuItem propertiesViewMenuItem = new JMenuItem(); + JMenu helpMenu = new JMenu(); + JMenuItem aboutMenuItem = new JMenuItem(); + JPopupMenu popupMenu1 = new JPopupMenu(); + JMenuItem cutMenuItem2 = new JMenuItem(); + JMenuItem copyMenuItem2 = new JMenuItem(); + JMenuItem pasteMenuItem2 = new JMenuItem(); + + //======== this ======== + setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[fill]" + + "[150,fill]para" + + "[300,grow,fill]", + // rows + "[]" + + "[]" + + "[]" + + "[]" + + "[]para" + + "[]" + + "[]para" + + "[]")); + + //---- label1 ---- + label1.setText("Name"); + label1.setLabelFor(textField1); + label1.setDisplayedMnemonic('N'); + add(label1, "cell 0 0,alignx left,growx 0"); + + //---- textField1 ---- + textField1.setComponentPopupMenu(popupMenu1); + add(textField1, "cell 1 0"); + + //---- label2 ---- + label2.setText("Phone"); + label2.setLabelFor(textField2); + label2.setDisplayedMnemonic('P'); + add(label2, "cell 0 1"); + + //---- textField2 ---- + textField2.setComponentPopupMenu(popupMenu1); + add(textField2, "cell 1 1"); + + //---- label3 ---- + label3.setText("Planet"); + label3.setDisplayedMnemonic('A'); + label3.setLabelFor(comboBox1); + add(label3, "cell 0 2"); + + //---- comboBox1 ---- + comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { + "Earth", + "Moon", + "Mars" + })); + comboBox1.setComponentPopupMenu(popupMenu1); + add(comboBox1, "cell 1 2"); + + //---- checkBox1 ---- + checkBox1.setText("Astronaut"); + checkBox1.setMnemonic('S'); + checkBox1.setComponentPopupMenu(popupMenu1); + add(checkBox1, "cell 1 3"); + + //---- button1 ---- + button1.setText("Lift off"); + button1.setMnemonic('L'); + button1.setComponentPopupMenu(popupMenu1); + add(button1, "cell 1 4,alignx left,growx 0"); + + //---- label4 ---- + label4.setText("Text area that consumes Alt key:"); + label4.setLabelFor(textArea1); + label4.setDisplayedMnemonic('T'); + add(label4, "cell 1 5"); + + //======== scrollPane1 ======== + { + + //---- textArea1 ---- + textArea1.setRows(4); + textArea1.setComponentPopupMenu(popupMenu1); + textArea1.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + textArea1KeyReleased(e); + } + }); + scrollPane1.setViewportView(textArea1); + } + add(scrollPane1, "cell 1 6,grow"); + + //======== tabbedPane1 ======== + { + + //======== panel1 ======== + { + panel1.setLayout(new FlowLayout()); + + //---- label7 ---- + label7.setText("Guitar"); + panel1.add(label7); + } + tabbedPane1.addTab("Guitar", panel1); + tabbedPane1.setMnemonicAt(0, 'G'); + + //======== panel2 ======== + { + panel2.setLayout(new FlowLayout()); + + //---- label6 ---- + label6.setText("Drums"); + panel2.add(label6); + } + tabbedPane1.addTab("Drums", panel2); + tabbedPane1.setMnemonicAt(1, 'D'); + + //======== panel3 ======== + { + panel3.setLayout(new FlowLayout()); + + //---- label5 ---- + label5.setText("Keyboard"); + panel3.add(label5); + } + tabbedPane1.addTab("Keyboard", panel3); + tabbedPane1.setMnemonicAt(2, 'K'); + } + add(tabbedPane1, "cell 2 6,aligny top,growy 0"); + + //---- alwaysShowMnemonicsCheckBox ---- + alwaysShowMnemonicsCheckBox.setText("Always show mnemonics"); + alwaysShowMnemonicsCheckBox.setMnemonic('M'); + alwaysShowMnemonicsCheckBox.addActionListener(e -> alwaysShowMnemonicsChanged()); + add(alwaysShowMnemonicsCheckBox, "cell 0 7 2 1,alignx left,growx 0"); + + //---- button2 ---- + button2.setText("Open Dialog"); + button2.addActionListener(e -> openDialog()); + add(button2, "cell 2 7,alignx left,growx 0"); + + //======== menuBar ======== + { + + //======== fileMenu ======== + { + fileMenu.setText("File"); + fileMenu.setMnemonic('F'); + + //---- newMenuItem ---- + newMenuItem.setText("New"); + newMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK)); + newMenuItem.setMnemonic('N'); + newMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(newMenuItem); + + //---- openMenuItem ---- + openMenuItem.setText("Open"); + openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.ALT_MASK)); + openMenuItem.setMnemonic('O'); + openMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(openMenuItem); + fileMenu.addSeparator(); + + //---- closeMenuItem ---- + closeMenuItem.setText("Close"); + closeMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK|KeyEvent.ALT_MASK)); + closeMenuItem.setMnemonic('C'); + closeMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(closeMenuItem); + + //---- closeMenuItem2 ---- + closeMenuItem2.setText("Close All"); + closeMenuItem2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.ALT_MASK|KeyEvent.SHIFT_MASK)); + closeMenuItem2.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(closeMenuItem2); + fileMenu.addSeparator(); + + //---- exitMenuItem ---- + exitMenuItem.setText("Exit"); + exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()|KeyEvent.ALT_MASK|KeyEvent.SHIFT_MASK)); + exitMenuItem.setMnemonic('X'); + exitMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(exitMenuItem); + } + menuBar.add(fileMenu); + + //======== editMenu ======== + { + editMenu.setText("Edit"); + editMenu.setMnemonic('E'); + + //---- undoMenuItem ---- + undoMenuItem.setText("Undo"); + undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + undoMenuItem.setMnemonic('U'); + undoMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(undoMenuItem); + + //---- redoMenuItem ---- + redoMenuItem.setText("Redo"); + redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + redoMenuItem.setMnemonic('R'); + redoMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(redoMenuItem); + editMenu.addSeparator(); + + //---- cutMenuItem ---- + cutMenuItem.setText("Cut"); + cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + cutMenuItem.setMnemonic('C'); + editMenu.add(cutMenuItem); + + //---- copyMenuItem ---- + copyMenuItem.setText("Copy"); + copyMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + copyMenuItem.setMnemonic('O'); + editMenu.add(copyMenuItem); + + //---- pasteMenuItem ---- + pasteMenuItem.setText("Paste"); + pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + pasteMenuItem.setMnemonic('P'); + editMenu.add(pasteMenuItem); + editMenu.addSeparator(); + + //---- deleteMenuItem ---- + deleteMenuItem.setText("Delete"); + deleteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); + deleteMenuItem.setMnemonic('D'); + deleteMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(deleteMenuItem); + } + menuBar.add(editMenu); + + //======== viewMenu ======== + { + viewMenu.setText("View"); + viewMenu.setMnemonic('V'); + + //---- checkBoxMenuItem1 ---- + checkBoxMenuItem1.setText("Show Toolbar"); + checkBoxMenuItem1.setSelected(true); + checkBoxMenuItem1.setMnemonic('T'); + checkBoxMenuItem1.addActionListener(e -> menuItemActionPerformed(e)); + viewMenu.add(checkBoxMenuItem1); + + //======== menu1 ======== + { + menu1.setText("Show View"); + menu1.setMnemonic('V'); + + //======== subViewsMenu ======== + { + subViewsMenu.setText("Sub Views"); + subViewsMenu.setMnemonic('S'); + + //======== subSubViewsMenu ======== + { + subSubViewsMenu.setText("Sub sub Views"); + subSubViewsMenu.setMnemonic('U'); + + //---- errorLogViewMenuItem ---- + errorLogViewMenuItem.setText("Error Log"); + errorLogViewMenuItem.setMnemonic('E'); + errorLogViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + subSubViewsMenu.add(errorLogViewMenuItem); + } + subViewsMenu.add(subSubViewsMenu); + + //---- searchViewMenuItem ---- + searchViewMenuItem.setText("Search"); + searchViewMenuItem.setMnemonic('S'); + searchViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + subViewsMenu.add(searchViewMenuItem); + } + menu1.add(subViewsMenu); + + //---- projectViewMenuItem ---- + projectViewMenuItem.setText("Project"); + projectViewMenuItem.setMnemonic('P'); + projectViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(projectViewMenuItem); + + //---- structureViewMenuItem ---- + structureViewMenuItem.setText("Structure"); + structureViewMenuItem.setMnemonic('T'); + structureViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(structureViewMenuItem); + + //---- propertiesViewMenuItem ---- + propertiesViewMenuItem.setText("Properties"); + propertiesViewMenuItem.setMnemonic('O'); + propertiesViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(propertiesViewMenuItem); + } + viewMenu.add(menu1); + } + menuBar.add(viewMenu); + + //======== helpMenu ======== + { + helpMenu.setText("Help"); + helpMenu.setMnemonic('H'); + + //---- aboutMenuItem ---- + aboutMenuItem.setText("About"); + aboutMenuItem.setMnemonic('A'); + aboutMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + helpMenu.add(aboutMenuItem); + } + menuBar.add(helpMenu); + } + + //======== popupMenu1 ======== + { + + //---- cutMenuItem2 ---- + cutMenuItem2.setText("Cut"); + cutMenuItem2.setMnemonic('C'); + popupMenu1.add(cutMenuItem2); + + //---- copyMenuItem2 ---- + copyMenuItem2.setText("Copy"); + copyMenuItem2.setMnemonic('O'); + popupMenu1.add(copyMenuItem2); + + //---- pasteMenuItem2 ---- + pasteMenuItem2.setText("Paste"); + pasteMenuItem2.setMnemonic('P'); + popupMenu1.add(pasteMenuItem2); + } + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JCheckBox alwaysShowMnemonicsCheckBox; + private JMenuBar menuBar; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.jfd new file mode 100644 index 00000000..231dcf17 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatMnemonicsTest.jfd @@ -0,0 +1,349 @@ +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$columnConstraints": "[fill][150,fill]para[300,grow,fill]" + "$rowConstraints": "[][][][][]para[][]para[]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "Name" + "labelFor": new FormReference( "textField1" ) + "displayedMnemonic": 78 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField1" + "componentPopupMenu": &FormReference0 new FormReference( "popupMenu1" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "Phone" + "labelFor": new FormReference( "textField2" ) + "displayedMnemonic": 80 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField2" + "componentPopupMenu": #FormReference0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "Planet" + "displayedMnemonic": 65 + "labelFor": new FormReference( "comboBox1" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "comboBox1" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "Earth" + addElement( "Earth" ) + addElement( "Moon" ) + addElement( "Mars" ) + } + "componentPopupMenu": #FormReference0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "checkBox1" + "text": "Astronaut" + "mnemonic": 83 + "componentPopupMenu": #FormReference0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button1" + "text": "Lift off" + "mnemonic": 76 + "componentPopupMenu": #FormReference0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "Text area that consumes Alt key:" + "labelFor": new FormReference( "textArea1" ) + "displayedMnemonic": 84 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + name: "scrollPane1" + add( new FormComponent( "javax.swing.JTextArea" ) { + name: "textArea1" + "rows": 4 + "componentPopupMenu": #FormReference0 + addEvent( new FormEvent( "java.awt.event.KeyListener", "keyReleased", "textArea1KeyReleased", true ) ) + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6,grow" + } ) + add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabbedPane1" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel1" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label7" + "text": "Guitar" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Guitar" + "mnemonic": 71 + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel2" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "text": "Drums" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Drums" + "mnemonic": 68 + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel3" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "Keyboard" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Keyboard" + "mnemonic": 75 + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6,aligny top,growy 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "alwaysShowMnemonicsCheckBox" + "text": "Always show mnemonics" + "mnemonic": 77 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alwaysShowMnemonicsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7 2 1,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button2" + "text": "Open Dialog" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7,alignx left,growx 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 790, 380 ) + } ) + add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { + name: "menuBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "fileMenu" + "text": "File" + "mnemonic": 70 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "newMenuItem" + "text": "New" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 130, false ) + "mnemonic": 78 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "openMenuItem" + "text": "Open" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 520, false ) + "mnemonic": 79 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator2" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "closeMenuItem" + "text": "Close" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 650, false ) + "mnemonic": 67 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "closeMenuItem2" + "text": "Close All" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 585, false ) + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator1" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "exitMenuItem" + "text": "Exit" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 74, 4811, false ) + "mnemonic": 88 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "editMenu" + "text": "Edit" + "mnemonic": 69 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "undoMenuItem" + "text": "Undo" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 90, 4226, false ) + "mnemonic": 85 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "redoMenuItem" + "text": "Redo" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 89, 4226, false ) + "mnemonic": 82 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator4" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "cutMenuItem" + "text": "Cut" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 88, 4226, false ) + "mnemonic": 67 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "copyMenuItem" + "text": "Copy" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 67, 4226, false ) + "mnemonic": 79 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "pasteMenuItem" + "text": "Paste" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 86, 4226, false ) + "mnemonic": 80 + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator3" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "deleteMenuItem" + "text": "Delete" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 127, 0, false ) + "mnemonic": 68 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "viewMenu" + "text": "View" + "mnemonic": 86 + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem1" + "text": "Show Toolbar" + "selected": true + "mnemonic": 84 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu1" + "text": "Show View" + "mnemonic": 86 + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "subViewsMenu" + "text": "Sub Views" + "mnemonic": 83 + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "subSubViewsMenu" + "text": "Sub sub Views" + "mnemonic": 85 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "errorLogViewMenuItem" + "text": "Error Log" + "mnemonic": 69 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "searchViewMenuItem" + "text": "Search" + "mnemonic": 83 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "projectViewMenuItem" + "text": "Project" + "mnemonic": 80 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "structureViewMenuItem" + "text": "Structure" + "mnemonic": 84 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "propertiesViewMenuItem" + "text": "Properties" + "mnemonic": 79 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "helpMenu" + "text": "Help" + "mnemonic": 72 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "aboutMenuItem" + "text": "About" + "mnemonic": 65 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 410 ) + "size": new java.awt.Dimension( 255, 30 ) + } ) + add( new FormContainer( "javax.swing.JPopupMenu", new FormLayoutManager( class javax.swing.JPopupMenu ) ) { + name: "popupMenu1" + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "cutMenuItem2" + "text": "Cut" + "mnemonic": 67 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "copyMenuItem2" + "text": "Copy" + "mnemonic": 79 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "pasteMenuItem2" + "text": "Paste" + "mnemonic": 80 + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 300, 415 ) + "size": new java.awt.Dimension( 91, 87 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java index aed743a4..38b90638 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.java @@ -21,13 +21,14 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.*; import javax.swing.border.*; +import com.formdev.flatlaf.demo.ScrollablePanel; import net.miginfocom.swing.*; /** * @author Karl Tauber */ public class FlatOptionPaneTest - extends FlatTestPanel + extends JScrollPane { public static void main( String[] args ) { SwingUtilities.invokeLater( () -> { @@ -55,6 +56,7 @@ public class FlatOptionPaneTest private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + ScrollablePanel panel9 = new ScrollablePanel(); JLabel plainLabel = new JLabel(); JPanel panel1 = new JPanel(); JOptionPane plainOptionPane = new JOptionPane(); @@ -89,194 +91,200 @@ public class FlatOptionPaneTest FlatOptionPaneTest.ShowDialogLinkLabel customShowDialogLabel = new FlatOptionPaneTest.ShowDialogLinkLabel(); //======== this ======== - setLayout(new MigLayout( - "flowy,ltr,insets dialog,hidemode 3", - // columns - "[]" + - "[]" + - "[fill]", - // rows - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]" + - "[top]")); + setBorder(BorderFactory.createEmptyBorder()); - //---- plainLabel ---- - plainLabel.setText("Plain"); - add(plainLabel, "cell 0 0"); - - //======== panel1 ======== + //======== panel9 ======== { - panel1.setBorder(LineBorder.createGrayLineBorder()); - panel1.setLayout(new BorderLayout()); + panel9.setLayout(new MigLayout( + "flowy,ltr,insets dialog,hidemode 3", + // columns + "[]" + + "[]" + + "[fill]", + // rows + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]" + + "[top]")); - //---- plainOptionPane ---- - plainOptionPane.setMessage("Hello world."); - panel1.add(plainOptionPane, BorderLayout.CENTER); + //---- plainLabel ---- + plainLabel.setText("Plain"); + panel9.add(plainLabel, "cell 0 0"); + + //======== panel1 ======== + { + panel1.setBorder(LineBorder.createGrayLineBorder()); + panel1.setLayout(new BorderLayout()); + + //---- plainOptionPane ---- + plainOptionPane.setMessage("Hello world."); + panel1.add(plainOptionPane, BorderLayout.CENTER); + } + panel9.add(panel1, "cell 1 0"); + + //---- plainShowDialogLabel ---- + plainShowDialogLabel.setOptionPane(plainOptionPane); + plainShowDialogLabel.setTitleLabel(plainLabel); + panel9.add(plainShowDialogLabel, "cell 2 0"); + + //---- errorLabel ---- + errorLabel.setText("Error"); + panel9.add(errorLabel, "cell 0 1"); + + //======== panel2 ======== + { + panel2.setBorder(LineBorder.createGrayLineBorder()); + panel2.setLayout(new BorderLayout()); + + //---- errorOptionPane ---- + errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); + errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); + panel2.add(errorOptionPane, BorderLayout.CENTER); + } + panel9.add(panel2, "cell 1 1"); + + //---- errorShowDialogLabel ---- + errorShowDialogLabel.setTitleLabel(errorLabel); + errorShowDialogLabel.setOptionPane(errorOptionPane); + panel9.add(errorShowDialogLabel, "cell 2 1"); + + //---- informationLabel ---- + informationLabel.setText("Information"); + panel9.add(informationLabel, "cell 0 2"); + + //======== panel3 ======== + { + panel3.setBorder(LineBorder.createGrayLineBorder()); + panel3.setLayout(new BorderLayout()); + + //---- informationOptionPane ---- + informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); + informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); + panel3.add(informationOptionPane, BorderLayout.CENTER); + } + panel9.add(panel3, "cell 1 2"); + + //---- informationShowDialogLabel ---- + informationShowDialogLabel.setOptionPane(informationOptionPane); + informationShowDialogLabel.setTitleLabel(informationLabel); + panel9.add(informationShowDialogLabel, "cell 2 2"); + + //---- questionLabel ---- + questionLabel.setText("Question"); + panel9.add(questionLabel, "cell 0 3"); + + //======== panel4 ======== + { + panel4.setBorder(LineBorder.createGrayLineBorder()); + panel4.setLayout(new BorderLayout()); + + //---- questionOptionPane ---- + questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); + questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); + questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); + panel4.add(questionOptionPane, BorderLayout.CENTER); + } + panel9.add(panel4, "cell 1 3"); + + //---- questionShowDialogLabel ---- + questionShowDialogLabel.setOptionPane(questionOptionPane); + questionShowDialogLabel.setTitleLabel(questionLabel); + panel9.add(questionShowDialogLabel, "cell 2 3"); + + //---- warningLabel ---- + warningLabel.setText("Warning"); + panel9.add(warningLabel, "cell 0 4"); + + //======== panel5 ======== + { + panel5.setBorder(LineBorder.createGrayLineBorder()); + panel5.setLayout(new BorderLayout()); + + //---- warningOptionPane ---- + warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); + warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); + panel5.add(warningOptionPane, BorderLayout.CENTER); + } + panel9.add(panel5, "cell 1 4"); + + //---- warningShowDialogLabel ---- + warningShowDialogLabel.setOptionPane(warningOptionPane); + warningShowDialogLabel.setTitleLabel(warningLabel); + panel9.add(warningShowDialogLabel, "cell 2 4"); + + //---- inputLabel ---- + inputLabel.setText("Input"); + panel9.add(inputLabel, "cell 0 5"); + + //======== panel7 ======== + { + panel7.setBorder(LineBorder.createGrayLineBorder()); + panel7.setLayout(new BorderLayout()); + + //---- inputOptionPane ---- + inputOptionPane.setWantsInput(true); + inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputOptionPane.setMessage("Enter whatever you want:"); + panel7.add(inputOptionPane, BorderLayout.CENTER); + } + panel9.add(panel7, "cell 1 5"); + + //---- inputShowDialogLabel ---- + inputShowDialogLabel.setOptionPane(inputOptionPane); + inputShowDialogLabel.setTitleLabel(inputLabel); + panel9.add(inputShowDialogLabel, "cell 2 5"); + + //---- inputIconLabel ---- + inputIconLabel.setText("Input + icon"); + panel9.add(inputIconLabel, "cell 0 6"); + + //======== panel8 ======== + { + panel8.setBorder(LineBorder.createGrayLineBorder()); + panel8.setLayout(new BorderLayout()); + + //---- inputIconOptionPane ---- + inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); + inputIconOptionPane.setWantsInput(true); + inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); + inputIconOptionPane.setMessage("Enter something:"); + panel8.add(inputIconOptionPane, BorderLayout.CENTER); + } + panel9.add(panel8, "cell 1 6"); + + //---- inputIconShowDialogLabel ---- + inputIconShowDialogLabel.setTitleLabel(inputIconLabel); + inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); + panel9.add(inputIconShowDialogLabel, "cell 2 6"); + + //---- customLabel ---- + customLabel.setText("Custom"); + panel9.add(customLabel, "cell 0 7"); + + //======== panel6 ======== + { + panel6.setBorder(LineBorder.createGrayLineBorder()); + panel6.setLayout(new BorderLayout()); + + //---- customOptionPane ---- + customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); + panel6.add(customOptionPane, BorderLayout.CENTER); + } + panel9.add(panel6, "cell 1 7"); + + //---- customShowDialogLabel ---- + customShowDialogLabel.setOptionPane(customOptionPane); + customShowDialogLabel.setTitleLabel(customLabel); + panel9.add(customShowDialogLabel, "cell 2 7"); } - add(panel1, "cell 1 0"); - - //---- plainShowDialogLabel ---- - plainShowDialogLabel.setOptionPane(plainOptionPane); - plainShowDialogLabel.setTitleLabel(plainLabel); - add(plainShowDialogLabel, "cell 2 0"); - - //---- errorLabel ---- - errorLabel.setText("Error"); - add(errorLabel, "cell 0 1"); - - //======== panel2 ======== - { - panel2.setBorder(LineBorder.createGrayLineBorder()); - panel2.setLayout(new BorderLayout()); - - //---- errorOptionPane ---- - errorOptionPane.setMessageType(JOptionPane.ERROR_MESSAGE); - errorOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - errorOptionPane.setMessage("Your PC ran into a problem. Buy a new one."); - panel2.add(errorOptionPane, BorderLayout.CENTER); - } - add(panel2, "cell 1 1"); - - //---- errorShowDialogLabel ---- - errorShowDialogLabel.setTitleLabel(errorLabel); - errorShowDialogLabel.setOptionPane(errorOptionPane); - add(errorShowDialogLabel, "cell 2 1"); - - //---- informationLabel ---- - informationLabel.setText("Information"); - add(informationLabel, "cell 0 2"); - - //======== panel3 ======== - { - panel3.setBorder(LineBorder.createGrayLineBorder()); - panel3.setLayout(new BorderLayout()); - - //---- informationOptionPane ---- - informationOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - informationOptionPane.setOptionType(JOptionPane.YES_NO_OPTION); - informationOptionPane.setMessage("Text with\nmultiple lines\n(use \\n to separate lines)"); - panel3.add(informationOptionPane, BorderLayout.CENTER); - } - add(panel3, "cell 1 2"); - - //---- informationShowDialogLabel ---- - informationShowDialogLabel.setOptionPane(informationOptionPane); - informationShowDialogLabel.setTitleLabel(informationLabel); - add(informationShowDialogLabel, "cell 2 2"); - - //---- questionLabel ---- - questionLabel.setText("Question"); - add(questionLabel, "cell 0 3"); - - //======== panel4 ======== - { - panel4.setBorder(LineBorder.createGrayLineBorder()); - panel4.setLayout(new BorderLayout()); - - //---- questionOptionPane ---- - questionOptionPane.setMessageType(JOptionPane.QUESTION_MESSAGE); - questionOptionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION); - questionOptionPane.setMessage("Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters."); - panel4.add(questionOptionPane, BorderLayout.CENTER); - } - add(panel4, "cell 1 3"); - - //---- questionShowDialogLabel ---- - questionShowDialogLabel.setOptionPane(questionOptionPane); - questionShowDialogLabel.setTitleLabel(questionLabel); - add(questionShowDialogLabel, "cell 2 3"); - - //---- warningLabel ---- - warningLabel.setText("Warning"); - add(warningLabel, "cell 0 4"); - - //======== panel5 ======== - { - panel5.setBorder(LineBorder.createGrayLineBorder()); - panel5.setLayout(new BorderLayout()); - - //---- warningOptionPane ---- - warningOptionPane.setMessageType(JOptionPane.WARNING_MESSAGE); - warningOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - warningOptionPane.setMessage("I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines."); - panel5.add(warningOptionPane, BorderLayout.CENTER); - } - add(panel5, "cell 1 4"); - - //---- warningShowDialogLabel ---- - warningShowDialogLabel.setOptionPane(warningOptionPane); - warningShowDialogLabel.setTitleLabel(warningLabel); - add(warningShowDialogLabel, "cell 2 4"); - - //---- inputLabel ---- - inputLabel.setText("Input"); - add(inputLabel, "cell 0 5"); - - //======== panel7 ======== - { - panel7.setBorder(LineBorder.createGrayLineBorder()); - panel7.setLayout(new BorderLayout()); - - //---- inputOptionPane ---- - inputOptionPane.setWantsInput(true); - inputOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputOptionPane.setMessage("Enter whatever you want:"); - panel7.add(inputOptionPane, BorderLayout.CENTER); - } - add(panel7, "cell 1 5"); - - //---- inputShowDialogLabel ---- - inputShowDialogLabel.setOptionPane(inputOptionPane); - inputShowDialogLabel.setTitleLabel(inputLabel); - add(inputShowDialogLabel, "cell 2 5"); - - //---- inputIconLabel ---- - inputIconLabel.setText("Input + icon"); - add(inputIconLabel, "cell 0 6"); - - //======== panel8 ======== - { - panel8.setBorder(LineBorder.createGrayLineBorder()); - panel8.setLayout(new BorderLayout()); - - //---- inputIconOptionPane ---- - inputIconOptionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE); - inputIconOptionPane.setWantsInput(true); - inputIconOptionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION); - inputIconOptionPane.setMessage("Enter something:"); - panel8.add(inputIconOptionPane, BorderLayout.CENTER); - } - add(panel8, "cell 1 6"); - - //---- inputIconShowDialogLabel ---- - inputIconShowDialogLabel.setTitleLabel(inputIconLabel); - inputIconShowDialogLabel.setOptionPane(inputIconOptionPane); - add(inputIconShowDialogLabel, "cell 2 6"); - - //---- customLabel ---- - customLabel.setText("Custom"); - add(customLabel, "cell 0 7"); - - //======== panel6 ======== - { - panel6.setBorder(LineBorder.createGrayLineBorder()); - panel6.setLayout(new BorderLayout()); - - //---- customOptionPane ---- - customOptionPane.setIcon(UIManager.getIcon("Tree.leafIcon")); - panel6.add(customOptionPane, BorderLayout.CENTER); - } - add(panel6, "cell 1 7"); - - //---- customShowDialogLabel ---- - customShowDialogLabel.setOptionPane(customOptionPane); - customShowDialogLabel.setTitleLabel(customLabel); - add(customShowDialogLabel, "cell 2 7"); + setViewportView(panel9); // JFormDesigner - End of component initialization //GEN-END:initComponents } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd index 529f099f..ff83c766 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatOptionPaneTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -6,240 +6,244 @@ new FormModel { auxiliary() { "JavaCodeGenerator.defaultVariableLocal": true } - add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" - "$columnConstraints": "[][][fill]" - "$rowConstraints": "[top][top][top][top][top][top][top][top]" - } ) { + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { name: "this" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "plainLabel" - "text": "Plain" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel1" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "plainOptionPane" - "message": "Hello world." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + "border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 ) + add( new FormContainer( "com.formdev.flatlaf.demo.ScrollablePanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "flowy,ltr,insets dialog,hidemode 3" + "$columnConstraints": "[][][fill]" + "$rowConstraints": "[top][top][top][top][top][top][top][top]" + } ) { + name: "panel9" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "plainLabel" + "text": "Plain" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "plainShowDialogLabel" - "optionPane": new FormReference( "plainOptionPane" ) - "titleLabel": new FormReference( "plainLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "errorLabel" - "text": "Error" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel2" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "errorOptionPane" - "messageType": 0 - "optionType": 2 - "message": "Your PC ran into a problem. Buy a new one." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel1" + "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color gray, 1, false ) + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "plainOptionPane" + "message": "Hello world." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "errorShowDialogLabel" - "titleLabel": new FormReference( "errorLabel" ) - "optionPane": new FormReference( "errorOptionPane" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "informationLabel" - "text": "Information" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel3" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "informationOptionPane" - "messageType": 1 - "optionType": 0 - "message": "Text with\nmultiple lines\n(use \\n to separate lines)" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "informationShowDialogLabel" - "optionPane": new FormReference( "informationOptionPane" ) - "titleLabel": new FormReference( "informationLabel" ) - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "questionLabel" - "text": "Question" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 3" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel4" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "questionOptionPane" - "messageType": 3 - "optionType": 1 - "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 3" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "questionShowDialogLabel" - "optionPane": new FormReference( "questionOptionPane" ) - "titleLabel": new FormReference( "questionLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 3" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "warningLabel" - "text": "Warning" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 4" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel5" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "warningOptionPane" - "messageType": 2 - "optionType": 2 - "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 4" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "warningShowDialogLabel" - "optionPane": new FormReference( "warningOptionPane" ) - "titleLabel": new FormReference( "warningLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 4" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputLabel" - "text": "Input" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 5" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel7" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputOptionPane" - "wantsInput": true - "optionType": 2 - "message": "Enter whatever you want:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 5" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "inputShowDialogLabel" - "optionPane": new FormReference( "inputOptionPane" ) - "titleLabel": new FormReference( "inputLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 5" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "inputIconLabel" - "text": "Input + icon" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 6" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel8" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "inputIconOptionPane" - "messageType": 1 - "wantsInput": true - "optionType": 2 - "message": "Enter something:" - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" - } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 6" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "inputIconShowDialogLabel" - "titleLabel": new FormReference( "inputIconLabel" ) - "optionPane": new FormReference( "inputIconOptionPane" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 6" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "customLabel" - "text": "Custom" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 7" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { - name: "panel6" - "border": #LineBorder0 - add( new FormComponent( "javax.swing.JOptionPane" ) { - name: "customOptionPane" - "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "plainShowDialogLabel" + "optionPane": new FormReference( "plainOptionPane" ) + "titleLabel": new FormReference( "plainLabel" ) auxiliary() { "JavaCodeGenerator.variableLocal": false } - }, new FormLayoutConstraints( class java.lang.String ) { - "value": "Center" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "errorLabel" + "text": "Error" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel2" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "errorOptionPane" + "messageType": 0 + "optionType": 2 + "message": "Your PC ran into a problem. Buy a new one." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "errorShowDialogLabel" + "titleLabel": new FormReference( "errorLabel" ) + "optionPane": new FormReference( "errorOptionPane" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "informationLabel" + "text": "Information" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel3" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "informationOptionPane" + "messageType": 1 + "optionType": 0 + "message": "Text with\nmultiple lines\n(use \\n to separate lines)" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "informationShowDialogLabel" + "optionPane": new FormReference( "informationOptionPane" ) + "titleLabel": new FormReference( "informationLabel" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "questionLabel" + "text": "Question" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel4" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "questionOptionPane" + "messageType": 3 + "optionType": 1 + "message": "Answer the question. What question? Don't know. Just writing useless text to make this longer than 80 characters." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "questionShowDialogLabel" + "optionPane": new FormReference( "questionOptionPane" ) + "titleLabel": new FormReference( "questionLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 3" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "warningLabel" + "text": "Warning" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel5" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "warningOptionPane" + "messageType": 2 + "optionType": 2 + "message": "I like bold,
and I like italic,
and I like to have
many lines.
Lots of lines." + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 4" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "warningShowDialogLabel" + "optionPane": new FormReference( "warningOptionPane" ) + "titleLabel": new FormReference( "warningLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputLabel" + "text": "Input" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel7" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputOptionPane" + "wantsInput": true + "optionType": 2 + "message": "Enter whatever you want:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "inputShowDialogLabel" + "optionPane": new FormReference( "inputOptionPane" ) + "titleLabel": new FormReference( "inputLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "inputIconLabel" + "text": "Input + icon" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel8" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "inputIconOptionPane" + "messageType": 1 + "wantsInput": true + "optionType": 2 + "message": "Enter something:" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "inputIconShowDialogLabel" + "titleLabel": new FormReference( "inputIconLabel" ) + "optionPane": new FormReference( "inputIconOptionPane" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 6" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "customLabel" + "text": "Custom" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "panel6" + "border": #LineBorder0 + add( new FormComponent( "javax.swing.JOptionPane" ) { + name: "customOptionPane" + "icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 7" + } ) + add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { + name: "customShowDialogLabel" + "optionPane": new FormReference( "customOptionPane" ) + "titleLabel": new FormReference( "customLabel" ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 7" } ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 7" - } ) - add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) { - name: "customShowDialogLabel" - "optionPane": new FormReference( "customOptionPane" ) - "titleLabel": new FormReference( "customLabel" ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 7" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 790, 920 ) + "size": new java.awt.Dimension( 840, 900 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.java new file mode 100644 index 00000000..155a65c3 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.java @@ -0,0 +1,250 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.geom.AffineTransform; +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import com.formdev.flatlaf.FlatSystemProperties; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.Graphics2DProxy; +import com.formdev.flatlaf.util.HiDPIUtils; +import com.formdev.flatlaf.util.JavaCompatibility; +import com.formdev.flatlaf.util.SystemInfo; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatPaintingStringTest + extends JPanel +{ + public static void main( String[] args ) { + System.setProperty( FlatSystemProperties.UI_SCALE, "1x" ); + System.setProperty( "sun.java2d.uiScale", "1x" ); + + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatPaintingStringTest" ); + + ToolTipManager.sharedInstance().setInitialDelay( 0 ); + ToolTipManager.sharedInstance().setDismissDelay( 10000 ); + + frame.showFrame( FlatPaintingStringTest::new ); + } ); + } + + FlatPaintingStringTest() { + initComponents(); + + add( new JLabel() ); + add( new JLabel( "none" ) ); + add( new JLabel( "flatlaf" ) ); + add( new JLabel( "0.25*scale" ) ); + add( new JLabel( "0.5*scale" ) ); + if( SystemInfo.isJava_9_orLater ) { + add( new JLabel( "0.25" ) ); + add( new JLabel( "0.5" ) ); + add( new JLabel( "0.625" ) ); + add( new JLabel( "0.75" ) ); + add( new JLabel( "0.875" ) ); + } else { + add( new JLabel( "0.625*scale" ) ); + add( new JLabel( "0.75*scale" ) ); + add( new JLabel( "0.875*scale" ) ); + } + + YCorrectionFunction none = (g, scaleFactor) -> 0; + YCorrectionFunction flatlaf = (g, scaleFactor) -> { + return SystemInfo.isJava_9_orLater + ? HiDPIUtils.computeTextYCorrection( g ) + : (scaleFactor > 1 ? -(0.625f * scaleFactor) : 0); + }; + YCorrectionFunction oneQSysScale = (g, scaleFactor) -> -(0.25f * scaleFactor); + YCorrectionFunction halfSysScale = (g, scaleFactor) -> -(0.5f * scaleFactor); + YCorrectionFunction fiveEightsQSysScale = (g, scaleFactor) -> -(0.625f * scaleFactor); + YCorrectionFunction threeQSysScale = (g, scaleFactor) -> -(0.75f * scaleFactor); + YCorrectionFunction sevenEightsSysScale = (g, scaleFactor) -> -(0.875f * scaleFactor); + YCorrectionFunction oneQ = (g, scaleFactor) -> -0.25f; + YCorrectionFunction half = (g, scaleFactor) -> -0.5f; + YCorrectionFunction fiveEights = (g, scaleFactor) -> -0.625f; + YCorrectionFunction threeQ = (g, scaleFactor) -> -0.75f; + YCorrectionFunction sevenEights = (g, scaleFactor) -> -0.875f; + + float[] scaleFactors = new float[] { 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 3f, 3.5f, 4f }; + + for( float scaleFactor : scaleFactors ) { + add( new JLabel( String.valueOf( scaleFactor ) ), "newLine" ); + + add( scaleFactor, none ); + add( scaleFactor, flatlaf ); + add( scaleFactor, oneQSysScale ); + add( scaleFactor, halfSysScale ); + if( SystemInfo.isJava_9_orLater ) { + add( scaleFactor, oneQ ); + add( scaleFactor, half ); + add( scaleFactor, fiveEights ); + add( scaleFactor, threeQ ); + add( scaleFactor, sevenEights ); + } else { + add( scaleFactor, fiveEightsQSysScale ); + add( scaleFactor, threeQSysScale ); + add( scaleFactor, sevenEightsSysScale ); + } + } + } + + private void add( float scaleFactor, YCorrectionFunction correctionFunction ) { + if( SystemInfo.isJava_9_orLater ) { + add( new Painter( scaleFactor, correctionFunction, 0 ), "split 4, gapx 0 0" ); + add( new Painter( scaleFactor, correctionFunction, 0.25f ), "gapx 0 0" ); + add( new Painter( scaleFactor, correctionFunction, 0.5f ), "gapx 0 0" ); + add( new Painter( scaleFactor, correctionFunction, 0.75f ), "gapx 0 0" ); + } else + add( new Painter( scaleFactor, correctionFunction, 0 ) ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + + //======== this ======== + setBorder(null); + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[fill]", + // rows + "[top]")); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + // JFormDesigner - End of variables declaration //GEN-END:variables + + private interface YCorrectionFunction { + float computeTextYCorrection( Graphics2D g, float scaleFactor ); + } + + //---- class Painter ------------------------------------------------------ + + public static class Painter + extends JLabel + { + private final float scaleFactor; + private final YCorrectionFunction correctionFunction; + private final float yOffset; + + public Painter( float scaleFactor, YCorrectionFunction correctionFunction, float yOffset ) { + super( "E" ); + this.scaleFactor = scaleFactor; + this.correctionFunction = correctionFunction; + this.yOffset = yOffset; + setBorder( new EmptyBorder( 2, 0, 2, 0 ) ); + + if( !SystemInfo.isJava_9_orLater ) { + Font font = getFont(); + setFont( font.deriveFont( (float) Math.round( font.getSize() * scaleFactor ) ) ); + } + } + + @Override + public Dimension getPreferredSize() { + Dimension size = super.getPreferredSize(); + Insets insets = getInsets(); + int leftRight = insets.left + insets.right; + return new Dimension( + scale( size.width -leftRight ) + leftRight, + scale( size.height ) ); + } + + @Override + protected void paintComponent( Graphics g ) { + Graphics2D g2 = (Graphics2D) g; + FlatUIUtils.setRenderingHints( g2 ); + + // simulate component y position at a fraction + if( scaleFactor > 1 && SystemInfo.isJava_9_orLater ) + g2.translate( 0, yOffset ); + + int width = getWidth(); + int height = getHeight(); + Insets insets = getInsets(); + FontMetrics fm = getFontMetrics( getFont() ); + + // paint lines at 1x + HiDPIUtils.paintAtScale1x( g2, 0, 0, width, height, + (g2d, x2, y2, width2, height2, scaleFactor2) -> { +// g.setColor( Color.blue ); +// g.drawLine( 0, 0, width2, 0 ); +// g.drawLine( 0, height2 - 1, width2, height2 - 1 ); + + int baseline = (int) Math.round( (insets.top + fm.getAscent()) * scaleFactor2 + * (SystemInfo.isJava_9_orLater ? scaleFactor : 1f) ) - 1; + int topline = height2 - baseline - 1; + + g.setColor( Color.red ); + g.drawLine( 0, baseline, width2, baseline ); + g.drawLine( 0, topline, width2, topline ); + } ); + + // move x before scaling to have same left inset at all scale factors + g.translate( insets.left, 0 ); + + // scale + if( SystemInfo.isJava_9_orLater ) + ((Graphics2D)g).scale( scaleFactor, scaleFactor ); + + // compute Y correction + float yCorrection = correctionFunction.computeTextYCorrection( g2, scaleFactor ); + + // create graphics that applies Y correction + Graphics2D cg = new Graphics2DProxy( g2 ) { + @Override + public void drawString( String str, int x, int y ) { + super.drawString( str, x, y + yCorrection ); + } + + @Override + public void drawString( String str, float x, float y ) { + super.drawString( str, x, y + yCorrection ); + } + }; + + // draw string + g.setColor( getForeground() ); + int y = insets.top + fm.getAscent(); + JavaCompatibility.drawStringUnderlineCharAt( this, cg, "E", -1, 0, y ); + + // set tooltip text + if( getToolTipText() == null ) { + AffineTransform t = g2.getTransform(); + double textY = t.getTranslateY() + (y * t.getScaleY()); + setToolTipText( textY + " + " + yCorrection + " = " + (textY + yCorrection) ); + } + } + + private int scale( int value ) { + return SystemInfo.isJava_9_orLater ? Math.round( value * scaleFactor ) : value; + } + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.jfd new file mode 100644 index 00000000..c5fb3d83 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatPaintingStringTest.jfd @@ -0,0 +1,21 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[fill]" + "$rowConstraints": "[top]" + } ) { + name: "this" + "border": sfield com.jformdesigner.model.FormObject NULL_VALUE + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 450, 300 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatScreenInfo.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatScreenInfo.java new file mode 100644 index 00000000..4083af15 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatScreenInfo.java @@ -0,0 +1,126 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.DisplayMode; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.geom.AffineTransform; +import javax.swing.SwingUtilities; + +/** + * Displays information about screens connected to a computer. + * + * This is a single-file program that can be compiled/run without any other + * FlatLaf code or dependencies. + * + * Since Java 11, you can run this program from source with: + * java FlatScreenInfo.java + * + * @author Karl Tauber + */ +public class FlatScreenInfo +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + printScreenInfo(); + } ); + } + + private static void printScreenInfo() { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice defaultScreenDevice = graphicsEnvironment.getDefaultScreenDevice(); + GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices(); + + System.out.print( "Scale factors: " ); + for( GraphicsDevice gd : screenDevices ) { + GraphicsConfiguration gc = gd.getDefaultConfiguration(); + + if( gd != screenDevices[0] ) + System.out.print( " / " ); + + System.out.print( (int) (gc.getDefaultTransform().getScaleX() * 100) ); + System.out.print( "%" ); + } + System.out.println(); + + System.out.println( "Java version: " + System.getProperty( "java.version" ) ); + System.out.println( "Java vendor: " + System.getProperty( "java.vendor" ) ); + + for( GraphicsDevice gd : screenDevices ) { + GraphicsConfiguration gc = gd.getDefaultConfiguration(); + DisplayMode displayMode = gd.getDisplayMode(); + Rectangle bounds = gc.getBounds(); + int width = displayMode.getWidth(); + int height = displayMode.getHeight(); + double boundsScaleX = (bounds.width > width) + ? (double) bounds.width / (double) width + : -((double) width / (double) bounds.width); + double boundsScaleY = (bounds.height > height) + ? (double) bounds.height / (double) height + : -((double) height / (double) bounds.height); + boundsScaleX = Math.round( boundsScaleX * 1000. ) / 1000.; + boundsScaleY = Math.round( boundsScaleY * 1000. ) / 1000.; + Insets screenInsets = toolkit.getScreenInsets( gc ); + AffineTransform defaultTransform = gc.getDefaultTransform(); + double scaleX = defaultTransform.getScaleX(); + double scaleY = defaultTransform.getScaleY(); + + System.out.println(); + System.out.print( "ID: " + gd.getIDstring() ); + if( gd == defaultScreenDevice ) + System.out.print( " (main)" ); + System.out.println(); + + System.out.printf( "Size: %d x %d / %d Bit / %d Hz%n", + displayMode.getWidth(), displayMode.getHeight(), + displayMode.getBitDepth(), displayMode.getRefreshRate() ); + System.out.printf( "Bounds: %d x %d / x %d / y %d", + bounds.width, bounds.height, bounds.x, bounds.y ); + if( Math.abs( boundsScaleX ) != 1 || Math.abs( boundsScaleY ) != 1 ) + System.out.printf( " (scale %s)", toString( boundsScaleX, boundsScaleY ) ); + System.out.println(); + System.out.printf( "Insets: left %d / right %d / top %d / bottom %d%n", + screenInsets.left, screenInsets.right, screenInsets.top, screenInsets.bottom ); + System.out.println( "Scale: " + toString( scaleX, scaleY ) ); + + // report warning if screen bounds intersects with another screen + // https://github.com/JFormDesigner/FlatLaf/issues/177 + for( GraphicsDevice gd2 : screenDevices ) { + if( gd2 == gd ) + continue; + + Rectangle bounds2 = gd2.getDefaultConfiguration().getBounds(); + if( bounds2.intersects( bounds ) ) { + System.out.println( "Warning: bounds of this screen intersect with bounds of " + gd2.getIDstring() ); + System.out.println( " this can lead to misplaced popups" ); + } + } + } + } + + private static String toString( double scaleX, double scaleY ) { + return (scaleX == scaleY) + ? String.valueOf( scaleX ) + : scaleX + " / " + scaleY; + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java index 3d25767e..02b99e06 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.java @@ -23,6 +23,7 @@ import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.function.BiConsumer; +import java.util.function.Function; import java.util.function.Supplier; import javax.swing.*; import javax.swing.UIManager.LookAndFeelInfo; @@ -34,6 +35,7 @@ import com.formdev.flatlaf.FlatDarkLaf; import com.formdev.flatlaf.FlatIntelliJLaf; import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.FlatSystemProperties; import com.formdev.flatlaf.IntelliJTheme; import com.formdev.flatlaf.demo.LookAndFeelsComboBox; import com.formdev.flatlaf.demo.DemoPrefs; @@ -60,17 +62,28 @@ public class FlatTestFrame private FlatInspector inspector; public boolean useApplyComponentOrientation; + public boolean applyComponentOrientationToFrame; public static FlatTestFrame create( String[] args, String title ) { DemoPrefs.init( PREFS_ROOT_PATH ); // set scale factor - if( System.getProperty( "flatlaf.uiScale", System.getProperty( "sun.java2d.uiScale" ) ) == null ) { + if( System.getProperty( FlatSystemProperties.UI_SCALE ) == null ) { String scaleFactor = DemoPrefs.getState().get( KEY_SCALE_FACTOR, null ); if( scaleFactor != null ) - System.setProperty( "flatlaf.uiScale", scaleFactor ); + System.setProperty( FlatSystemProperties.UI_SCALE, scaleFactor ); } + // install inspectors + FlatInspector.install( "ctrl shift alt X" ); + FlatUIDefaultsInspector.install( "ctrl shift alt Y" ); + + // disable animated Laf change + System.setProperty( "flatlaf.animatedLafChange", "false" ); + + // test loading custom defaults from package + FlatLaf.registerCustomDefaultsSource( "com.formdev.flatlaf.testing.customdefaults" ); + // set look and feel DemoPrefs.initLaf( args ); @@ -99,65 +112,89 @@ public class FlatTestFrame className.equals( "com.sun.java.swing.plaf.motif.MotifLookAndFeel" ) ) continue; - if( (SystemInfo.IS_WINDOWS && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) || - (SystemInfo.IS_MAC && className.equals( "com.apple.laf.AquaLookAndFeel") ) || - (SystemInfo.IS_LINUX && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel") ) ) + if( (SystemInfo.isWindows && className.equals( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" )) || + (SystemInfo.isMacOS && className.equals( "com.apple.laf.AquaLookAndFeel" )) || + (SystemInfo.isLinux && className.equals( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" )) ) name += " (F9)"; else if( className.equals( MetalLookAndFeel.class.getName() ) ) - name += " (F10)"; + name += " (F12)"; else if( className.equals( NimbusLookAndFeel.class.getName() ) ) name += " (F11)"; lafModel.addElement( new LookAndFeelInfo( name, className ) ); } - String substanceClassName = "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel"; - if( SystemInfo.IS_JAVA_9_OR_LATER && isClassAvailable( substanceClassName ) ) { - lafModel.addElement( new LookAndFeelInfo( "Substance (F5)", substanceClassName ) ); - registerSwitchToLookAndFeel( KeyEvent.VK_F5, substanceClassName ); + String substanceLightClassName = "org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel"; + if( SystemInfo.isJava_9_orLater && isClassAvailable( substanceLightClassName ) ) { + lafModel.addElement( new LookAndFeelInfo( "Substance Business (F5)", substanceLightClassName ) ); + registerSwitchToLookAndFeel( "F5", substanceLightClassName ); + } + + String substanceDarkClassName = "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel"; + if( SystemInfo.isJava_9_orLater && isClassAvailable( substanceDarkClassName ) ) { + lafModel.addElement( new LookAndFeelInfo( "Substance Graphite Aqua (Ctrl+F5)", substanceDarkClassName ) ); + registerSwitchToLookAndFeel( "ctrl F5", substanceDarkClassName ); } String webLafClassName = "com.alee.laf.WebLookAndFeel"; if( isClassAvailable( webLafClassName ) ) { - lafModel.addElement( new LookAndFeelInfo( "WebLaf (F12)", webLafClassName ) ); - registerSwitchToLookAndFeel( KeyEvent.VK_F12, webLafClassName ); + lafModel.addElement( new LookAndFeelInfo( "WebLaf (Ctrl+F12)", webLafClassName ) ); + registerSwitchToLookAndFeel( "ctrl F12", webLafClassName ); } String looksPlasticClassName = "com.jgoodies.looks.plastic.PlasticLookAndFeel"; if( isClassAvailable( looksPlasticClassName ) ) { lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Plastic (F6)", looksPlasticClassName ) ); - registerSwitchToLookAndFeel( KeyEvent.VK_F6, looksPlasticClassName ); + registerSwitchToLookAndFeel( "F6", looksPlasticClassName ); } String looksWindowsClassName = "com.jgoodies.looks.windows.WindowsLookAndFeel"; - if( isClassAvailable( looksWindowsClassName ) ) { + if( SystemInfo.isWindows && isClassAvailable( looksWindowsClassName ) ) { lafModel.addElement( new LookAndFeelInfo( "JGoodies Looks Windows (F7)", looksWindowsClassName ) ); - registerSwitchToLookAndFeel( KeyEvent.VK_F7, looksWindowsClassName ); + registerSwitchToLookAndFeel( "F7", looksWindowsClassName ); } lookAndFeelComboBox.setModel( lafModel ); updateScaleFactorComboBox(); - String scaleFactor = System.getProperty( "flatlaf.uiScale", System.getProperty( "sun.java2d.uiScale" ) ); + String scaleFactor = System.getProperty( FlatSystemProperties.UI_SCALE ); if( scaleFactor != null ) scaleFactorComboBox.setSelectedItem( scaleFactor ); + updateFontSizeSpinner(); + updateSizeVariantComboBox(); + // register F1, F2, ... keys to switch to Light, Dark or other LaFs - registerSwitchToLookAndFeel( KeyEvent.VK_F1, FlatLightLaf.class.getName() ); - registerSwitchToLookAndFeel( KeyEvent.VK_F2, FlatDarkLaf.class.getName() ); - registerSwitchToLookAndFeel( KeyEvent.VK_F3, FlatIntelliJLaf.class.getName() ); - registerSwitchToLookAndFeel( KeyEvent.VK_F4, FlatDarculaLaf.class.getName() ); + registerSwitchToLookAndFeel( "F1", FlatLightLaf.class.getName() ); + registerSwitchToLookAndFeel( "F2", FlatDarkLaf.class.getName() ); + registerSwitchToLookAndFeel( "F3", FlatIntelliJLaf.class.getName() ); + registerSwitchToLookAndFeel( "F4", FlatDarculaLaf.class.getName() ); - registerSwitchToLookAndFeel( KeyEvent.VK_F8, FlatTestLaf.class.getName() ); + registerSwitchToLookAndFeel( "F8", FlatTestLaf.class.getName() ); - if( SystemInfo.IS_WINDOWS ) - registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); - else if( SystemInfo.IS_MAC ) - registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.apple.laf.AquaLookAndFeel" ); - else if( SystemInfo.IS_LINUX ) - registerSwitchToLookAndFeel( KeyEvent.VK_F9, "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" ); - registerSwitchToLookAndFeel( KeyEvent.VK_F10, MetalLookAndFeel.class.getName() ); - registerSwitchToLookAndFeel( KeyEvent.VK_F11, NimbusLookAndFeel.class.getName() ); + if( SystemInfo.isWindows ) + registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" ); + else if( SystemInfo.isMacOS ) + registerSwitchToLookAndFeel( "F9", "com.apple.laf.AquaLookAndFeel" ); + else if( SystemInfo.isLinux ) + registerSwitchToLookAndFeel( "F9", "com.sun.java.swing.plaf.gtk.GTKLookAndFeel" ); + registerSwitchToLookAndFeel( "F12", MetalLookAndFeel.class.getName() ); + registerSwitchToLookAndFeel( "F11", NimbusLookAndFeel.class.getName() ); + + // register Ctrl+0, Ctrl++ and Ctrl+- to change font size + int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + ((JComponent)getContentPane()).registerKeyboardAction( + e -> restoreFont(), + KeyStroke.getKeyStroke( KeyEvent.VK_0, menuShortcutKeyMask ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + ((JComponent)getContentPane()).registerKeyboardAction( + e -> incrFont(), + KeyStroke.getKeyStroke( KeyEvent.VK_PLUS, menuShortcutKeyMask ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + ((JComponent)getContentPane()).registerKeyboardAction( + e -> decrFont(), + KeyStroke.getKeyStroke( KeyEvent.VK_MINUS, menuShortcutKeyMask ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); // register ESC key to close frame ((JComponent)getContentPane()).registerKeyboardAction( @@ -198,11 +235,29 @@ public class FlatTestFrame // enable/disable scale factor combobox updateScaleFactorComboBox(); + // enable/disable font size spinner + updateFontSizeSpinner(); + + // show/hide size variant combobox + updateSizeVariantComboBox(); + // this is necessary because embedded JOptionPane's "steal" the default button getRootPane().setDefaultButton( closeButton ); } ); } } ); + + UIScale.addPropertyChangeListener( e -> { + // update title because user scale factor may change + updateTitle(); + } ); + } + + @Override + public void dispose() { + super.dispose(); + + FlatUIDefaultsInspector.hide(); } private void updateTitle() { @@ -218,12 +273,16 @@ public class FlatTestFrame setTitle( newTitle ); } - private void registerSwitchToLookAndFeel( int keyCode, String lafClassName ) { + private void registerSwitchToLookAndFeel( String keyStrokeStr, String lafClassName ) { + KeyStroke keyStroke = KeyStroke.getKeyStroke( keyStrokeStr ); + if( keyStroke == null ) + throw new IllegalArgumentException( "Invalid key stroke '" + keyStrokeStr + "'" ); + ((JComponent)getContentPane()).registerKeyboardAction( e -> { selectLookAndFeel( lafClassName ); }, - KeyStroke.getKeyStroke( keyCode, 0, false ), + keyStroke, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); } @@ -231,16 +290,23 @@ public class FlatTestFrame try { Class.forName( className, false, getClass().getClassLoader() ); return true; - } catch( ClassNotFoundException ex ) { + } catch( Throwable ex ) { return false; } } public void showFrame( Supplier contentFactory ) { + showFrame( contentFactory, null ); + } + + public void showFrame( Supplier contentFactory, Function menuBarFactory ) { this.contentFactory = contentFactory; this.content = contentFactory.get(); - contentPanel.getContentPane().add( content ); + if( menuBarFactory != null ) + setJMenuBar( menuBarFactory.apply( content ) ); + + contentPanel.add( content ); pack(); setLocationRelativeTo( null ); setVisible( true ); @@ -271,14 +337,27 @@ public class FlatTestFrame private void applyLookAndFeel( String lafClassName, IntelliJTheme theme, boolean pack ) { EventQueue.invokeLater( () -> { try { + // clear custom default font before switching to other LaF + Font defaultFont = null; + if( UIManager.getLookAndFeel() instanceof FlatLaf ) { + Font font = UIManager.getFont( "defaultFont" ); + if( font != UIManager.getLookAndFeelDefaults().getFont( "defaultFont" ) ) + defaultFont = font; + } + UIManager.put( "defaultFont", null ); + // change look and feel if( theme != null ) UIManager.setLookAndFeel( IntelliJTheme.createLaf( theme ) ); else UIManager.setLookAndFeel( lafClassName ); + // restore custom default font when switched to other FlatLaf LaF + if( defaultFont != null && UIManager.getLookAndFeel() instanceof FlatLaf ) + UIManager.put( "defaultFont", defaultFont ); + // update all components - FlatLaf.updateUI(); + updateUI2(); // increase size of frame if necessary if( pack ) @@ -315,18 +394,43 @@ public class FlatTestFrame } ); } + private static void updateUI2() { + KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); + Component permanentFocusOwner = keyboardFocusManager.getPermanentFocusOwner(); + JSpinner spinner = (permanentFocusOwner != null) + ? (JSpinner) SwingUtilities.getAncestorOfClass( JSpinner.class, permanentFocusOwner ) + : null; + + FlatLaf.updateUI(); + + if( spinner != null && keyboardFocusManager.getPermanentFocusOwner() == null ) { + JComponent editor = spinner.getEditor(); + JTextField textField = (editor instanceof JSpinner.DefaultEditor) + ? ((JSpinner.DefaultEditor)editor).getTextField() + : null; + if( textField != null ) + textField.requestFocusInWindow(); + } + } + private void explicitColorsChanged() { EventQueue.invokeLater( () -> { boolean explicit = explicitColorsCheckBox.isSelected(); ColorUIResource restoreColor = new ColorUIResource( Color.white ); + boolean dark = FlatLaf.isLafDark(); + Color magenta = dark ? Color.magenta.darker() : Color.magenta; + Color orange = dark ? Color.orange.darker() : Color.orange; + Color blue = dark ? Color.blue.darker() : Color.blue; + Color green = dark ? Color.green.darker() : Color.green; + updateComponentsRecur( content, (c, type) -> { if( type == "view" || type == "tab" ) { - c.setForeground( explicit ? Color.magenta : restoreColor ); - c.setBackground( explicit ? Color.orange : restoreColor ); + c.setForeground( explicit ? magenta : restoreColor ); + c.setBackground( explicit ? orange : restoreColor ); } else { - c.setForeground( explicit ? Color.blue : restoreColor ); - c.setBackground( explicit ? Color.green : restoreColor ); + c.setForeground( explicit ? blue : restoreColor ); + c.setBackground( explicit ? green : restoreColor ); } } ); @@ -350,7 +454,9 @@ public class FlatTestFrame ? ComponentOrientation.RIGHT_TO_LEFT : ComponentOrientation.LEFT_TO_RIGHT; - if( useApplyComponentOrientation ) + if( applyComponentOrientationToFrame ) + applyComponentOrientation( orientation ); + else if( useApplyComponentOrientation ) content.applyComponentOrientation( orientation ); else { updateComponentsRecur( content, (c, type) -> { @@ -369,8 +475,12 @@ public class FlatTestFrame } private void inspectChanged() { - if( inspector == null ) - inspector = new FlatInspector( contentPanel ); + if( inspector == null ) { + inspector = new FlatInspector( getRootPane() ); + inspector.addPropertyChangeListener( e -> { + inspectCheckBox.setSelected( inspector.isEnabled() ); + } ); + } inspector.setEnabled( inspectCheckBox.isSelected() ); } @@ -383,13 +493,16 @@ public class FlatTestFrame scaleFactorComboBox.setPopupVisible( false ); if( scaleFactor != null ) { - System.setProperty( "flatlaf.uiScale", scaleFactor ); + System.setProperty( FlatSystemProperties.UI_SCALE, scaleFactor ); DemoPrefs.getState().put( KEY_SCALE_FACTOR, scaleFactor ); } else { - System.clearProperty( "flatlaf.uiScale" ); + System.clearProperty( FlatSystemProperties.UI_SCALE ); DemoPrefs.getState().remove( KEY_SCALE_FACTOR ); } + // always clear default font because a new font size is computed based on the scale factor + UIManager.put( "defaultFont", null ); + LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); IntelliJTheme theme = (lookAndFeel instanceof IntelliJTheme.ThemeLaf) ? ((IntelliJTheme.ThemeLaf)lookAndFeel).getTheme() @@ -398,10 +511,64 @@ public class FlatTestFrame } private void updateScaleFactorComboBox() { - scaleFactorComboBox.setEnabled( !UIScale.isSystemScalingEnabled() && UIManager.getLookAndFeel() instanceof FlatLaf ); + scaleFactorComboBox.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf ); } - private void updateComponentsRecur( Container container, BiConsumer action ) { + private void restoreFont() { + fontSizeSpinner.setValue( 0 ); + } + + private void incrFont() { + fontSizeSpinner.setValue( fontSizeSpinner.getNextValue() ); + } + + private void decrFont() { + fontSizeSpinner.setValue( fontSizeSpinner.getPreviousValue() ); + } + + private void fontSizeChanged() { + if( !(UIManager.getLookAndFeel() instanceof FlatLaf) ) + return; + + Object value = fontSizeSpinner.getValue(); + int newFontSize = (value instanceof Integer) ? (Integer) value : 0; + + Font font = UIManager.getFont( "defaultFont" ); + if( font == null || font.getSize() == newFontSize ) + return; + + Font newFont = (newFontSize >= 8) ? font.deriveFont( (float) newFontSize ) : null; + UIManager.put( "defaultFont", newFont ); + + if( newFont == null ) + updateFontSizeSpinner(); + + updateUI2(); + } + + private void updateFontSizeSpinner() { + fontSizeSpinner.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf ); + fontSizeSpinner.setValue( UIManager.getFont( "Label.font" ).getSize() ); + } + + private void sizeVariantChanged() { + String sel = (String) sizeVariantComboBox.getSelectedItem(); + String sizeVariant = "default".equals( sel ) ? null : sel; + + updateComponentsRecur( content, (c, type) -> { + if( c instanceof JComponent ) + ((JComponent)c).putClientProperty( "JComponent.sizeVariant", sizeVariant ); + } ); + } + + private void updateSizeVariantComboBox() { + LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); + boolean visible = lookAndFeel instanceof NimbusLookAndFeel || + "com.apple.laf.AquaLookAndFeel".equals( lookAndFeel.getClass().getName() ); + sizeVariantComboBox.setVisible( visible ); + } + + void updateComponentsRecur( Container container, BiConsumer action ) { for( Component c : container.getComponents() ) { if( c instanceof JPanel || c instanceof JDesktopPane ) { updateComponentsRecur( (Container) c, action ); @@ -443,9 +610,9 @@ public class FlatTestFrame } private void recreateContent() { - contentPanel.getContentPane().remove( content ); + contentPanel.remove( content ); content = contentFactory.get(); - contentPanel.getContentPane().add( content ); + contentPanel.add( content ); if( rightToLeftCheckBox.isSelected() ) rightToLeftChanged(); @@ -461,16 +628,18 @@ public class FlatTestFrame private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents dialogPane = new JPanel(); - contentPanel = new JRootPane(); + contentPanel = new JPanel(); buttonBar = new JPanel(); lookAndFeelComboBox = new LookAndFeelsComboBox(); scaleFactorComboBox = new JComboBox<>(); + fontSizeSpinner = new JSpinner(); rightToLeftCheckBox = new JCheckBox(); enabledCheckBox = new JCheckBox(); inspectCheckBox = new JCheckBox(); explicitColorsCheckBox = new JCheckBox(); backgroundCheckBox = new JCheckBox(); opaqueTriStateCheckBox = new TriStateCheckBox(); + sizeVariantComboBox = new JComboBox<>(); closeButton = new JButton(); themesPanel = new IJThemesPanel(); @@ -485,8 +654,7 @@ public class FlatTestFrame //======== contentPanel ======== { - Container contentPanelContentPane = contentPanel.getContentPane(); - contentPanelContentPane.setLayout(new MigLayout( + contentPanel.setLayout(new MigLayout( "insets 0,hidemode 3", // columns "[grow,fill]", @@ -508,6 +676,8 @@ public class FlatTestFrame "[fill]" + "[fill]" + "[fill]" + + "[fill]" + + "[fill]" + "[grow,fill]" + "[button,fill]", // rows @@ -525,7 +695,7 @@ public class FlatTestFrame "1.25", "1.5", "1.75", - "2.0", + "2", "2.25", "2.5", "3", @@ -536,46 +706,63 @@ public class FlatTestFrame scaleFactorComboBox.addActionListener(e -> scaleFactorChanged()); buttonBar.add(scaleFactorComboBox, "cell 1 0"); + //---- fontSizeSpinner ---- + fontSizeSpinner.putClientProperty("JComponent.minimumWidth", 50); + fontSizeSpinner.setModel(new SpinnerNumberModel(0, 0, null, 1)); + fontSizeSpinner.addChangeListener(e -> fontSizeChanged()); + buttonBar.add(fontSizeSpinner, "cell 2 0"); + //---- rightToLeftCheckBox ---- rightToLeftCheckBox.setText("right-to-left"); rightToLeftCheckBox.setMnemonic('R'); rightToLeftCheckBox.addActionListener(e -> rightToLeftChanged()); - buttonBar.add(rightToLeftCheckBox, "cell 2 0"); + buttonBar.add(rightToLeftCheckBox, "cell 3 0"); //---- enabledCheckBox ---- enabledCheckBox.setText("enabled"); enabledCheckBox.setMnemonic('E'); enabledCheckBox.setSelected(true); enabledCheckBox.addActionListener(e -> enabledChanged()); - buttonBar.add(enabledCheckBox, "cell 3 0"); + buttonBar.add(enabledCheckBox, "cell 4 0"); //---- inspectCheckBox ---- inspectCheckBox.setText("inspect"); inspectCheckBox.setMnemonic('I'); inspectCheckBox.addActionListener(e -> inspectChanged()); - buttonBar.add(inspectCheckBox, "cell 4 0"); + buttonBar.add(inspectCheckBox, "cell 5 0"); //---- explicitColorsCheckBox ---- explicitColorsCheckBox.setText("explicit colors"); explicitColorsCheckBox.setMnemonic('X'); explicitColorsCheckBox.addActionListener(e -> explicitColorsChanged()); - buttonBar.add(explicitColorsCheckBox, "cell 5 0"); + buttonBar.add(explicitColorsCheckBox, "cell 6 0"); //---- backgroundCheckBox ---- backgroundCheckBox.setText("background"); backgroundCheckBox.setMnemonic('B'); backgroundCheckBox.addActionListener(e -> backgroundChanged()); - buttonBar.add(backgroundCheckBox, "cell 6 0"); + buttonBar.add(backgroundCheckBox, "cell 7 0"); //---- opaqueTriStateCheckBox ---- opaqueTriStateCheckBox.setText("opaque"); opaqueTriStateCheckBox.setMnemonic('O'); opaqueTriStateCheckBox.addActionListener(e -> opaqueChanged()); - buttonBar.add(opaqueTriStateCheckBox, "cell 7 0"); + buttonBar.add(opaqueTriStateCheckBox, "cell 8 0"); + + //---- sizeVariantComboBox ---- + sizeVariantComboBox.setModel(new DefaultComboBoxModel<>(new String[] { + "mini", + "small", + "default", + "large" + })); + sizeVariantComboBox.setSelectedIndex(2); + sizeVariantComboBox.addActionListener(e -> sizeVariantChanged()); + buttonBar.add(sizeVariantComboBox, "cell 9 0"); //---- closeButton ---- closeButton.setText("Close"); - buttonBar.add(closeButton, "cell 9 0"); + buttonBar.add(closeButton, "cell 11 0"); } dialogPane.add(buttonBar, BorderLayout.SOUTH); dialogPane.add(themesPanel, BorderLayout.EAST); @@ -586,17 +773,33 @@ public class FlatTestFrame // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables private JPanel dialogPane; - private JRootPane contentPanel; + private JPanel contentPanel; private JPanel buttonBar; private LookAndFeelsComboBox lookAndFeelComboBox; private JComboBox scaleFactorComboBox; + private JSpinner fontSizeSpinner; private JCheckBox rightToLeftCheckBox; private JCheckBox enabledCheckBox; private JCheckBox inspectCheckBox; private JCheckBox explicitColorsCheckBox; private JCheckBox backgroundCheckBox; private TriStateCheckBox opaqueTriStateCheckBox; + private JComboBox sizeVariantComboBox; private JButton closeButton; private IJThemesPanel themesPanel; // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class NoRightToLeftPanel ------------------------------------------- + + public static class NoRightToLeftPanel + extends JPanel + { + public NoRightToLeftPanel() { + } + + @Override + public void applyComponentOrientation( ComponentOrientation o ) { + // ignore + } + } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd index f92a2a2f..e174c4d5 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatTestFrame.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -10,7 +10,7 @@ new FormModel { "defaultCloseOperation": 2 add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { name: "dialogPane" - add( new FormContainer( "javax.swing.JRootPane", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets 0,hidemode 3" "$columnConstraints": "[grow,fill]" "$rowConstraints": "[grow,fill]" @@ -21,7 +21,7 @@ new FormModel { } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets dialog" - "$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]" + "$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]" "$rowSpecs": "[fill]" } ) { name: "buttonBar" @@ -41,7 +41,7 @@ new FormModel { addElement( "1.25" ) addElement( "1.5" ) addElement( "1.75" ) - addElement( "2.0" ) + addElement( "2" ) addElement( "2.25" ) addElement( "2.5" ) addElement( "3" ) @@ -56,13 +56,23 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 0" } ) + add( new FormComponent( "javax.swing.JSpinner" ) { + name: "fontSizeSpinner" + "$client.JComponent.minimumWidth": 50 + "model": new javax.swing.SpinnerNumberModel { + minimum: 0 + } + addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "fontSizeChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0" + } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "rightToLeftCheckBox" "text": "right-to-left" "mnemonic": 82 addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightToLeftChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" + "value": "cell 3 0" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "enabledCheckBox" @@ -71,7 +81,7 @@ new FormModel { "selected": true addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "enabledChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 3 0" + "value": "cell 4 0" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "inspectCheckBox" @@ -79,7 +89,7 @@ new FormModel { "mnemonic": 73 addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "inspectChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 4 0" + "value": "cell 5 0" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "explicitColorsCheckBox" @@ -87,7 +97,7 @@ new FormModel { "mnemonic": 88 addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "explicitColorsChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 5 0" + "value": "cell 6 0" } ) add( new FormComponent( "javax.swing.JCheckBox" ) { name: "backgroundCheckBox" @@ -95,7 +105,7 @@ new FormModel { "mnemonic": 66 addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "backgroundChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 6 0" + "value": "cell 7 0" } ) add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) { name: "opaqueTriStateCheckBox" @@ -103,13 +113,27 @@ new FormModel { "mnemonic": 79 addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "opaqueChanged", false ) ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 7 0" + "value": "cell 8 0" + } ) + add( new FormComponent( "javax.swing.JComboBox" ) { + name: "sizeVariantComboBox" + "model": new javax.swing.DefaultComboBoxModel { + selectedItem: "mini" + addElement( "mini" ) + addElement( "small" ) + addElement( "default" ) + addElement( "large" ) + } + "selectedIndex": 2 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "sizeVariantChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 9 0" } ) add( new FormComponent( "javax.swing.JButton" ) { name: "closeButton" "text": "Close" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 9 0" + "value": "cell 11 0" } ) }, new FormLayoutConstraints( class java.lang.String ) { "value": "South" diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.java new file mode 100644 index 00000000..b513149d --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.java @@ -0,0 +1,694 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing; + +import java.awt.*; +import java.awt.Dialog.ModalityType; +import java.awt.event.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import javax.swing.*; +import com.formdev.flatlaf.FlatClientProperties; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatWindowDecorationsTest + extends FlatTestPanel +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + // enable custom window decoration (if LaF supports it) + JFrame.setDefaultLookAndFeelDecorated( true ); + JDialog.setDefaultLookAndFeelDecorated( true ); + + FlatTestFrame frame = FlatTestFrame.create( args, "FlatWindowDecorationsTest" ); + frame.applyComponentOrientationToFrame = true; + + // WARNING: Do not this in real-world programs. +// frame.setUndecorated( true ); +// frame.getRootPane().setWindowDecorationStyle( JRootPane.FRAME ); + + Class cls = FlatWindowDecorationsTest.class; + List images = Arrays.asList( + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test16.png" ) ).getImage(), + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test24.png" ) ).getImage(), + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test32.png" ) ).getImage(), + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test48.png" ) ).getImage(), + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test64.png" ) ).getImage(), + new ImageIcon( cls.getResource( "/com/formdev/flatlaf/testing/test128.png" ) ).getImage() + ); + // shuffle to test whether FlatLaf chooses the right size + Collections.shuffle( images ); + frame.setIconImages( images ); + + frame.showFrame( FlatWindowDecorationsTest::new, panel -> ((FlatWindowDecorationsTest)panel).menuBar ); + } ); + } + + private List images; + + FlatWindowDecorationsTest() { + initComponents(); + } + + @Override + public void addNotify() { + super.addNotify(); + + Window window = SwingUtilities.windowForComponent( this ); + menuBarCheckBox.setEnabled( window instanceof JFrame ); + menuBarEmbeddedCheckBox.setEnabled( window instanceof JFrame ); + menuBarVisibleCheckBox.setEnabled( window instanceof JFrame ); + maximizedBoundsCheckBox.setEnabled( window instanceof Frame ); + + addMenuButton.setEnabled( menuBarCheckBox.isEnabled() ); + removeMenuButton.setEnabled( menuBarCheckBox.isEnabled() ); + changeMenuButton.setEnabled( menuBarCheckBox.isEnabled() ); + + boolean windowHasIcons = (window != null && !window.getIconImages().isEmpty()); + iconNoneRadioButton.setEnabled( windowHasIcons ); + iconTestAllRadioButton.setEnabled( windowHasIcons ); + iconTestRandomRadioButton.setEnabled( windowHasIcons ); + + if( window instanceof Frame ) + undecoratedCheckBox.setSelected( ((Frame)window).isUndecorated() ); + else if( window instanceof Dialog ) + undecoratedCheckBox.setSelected( ((Dialog)window).isUndecorated() ); + + JRootPane rootPane = getWindowRootPane(); + if( rootPane != null ) { + int style = rootPane.getWindowDecorationStyle(); + if( style == JRootPane.NONE ) + styleNoneRadioButton.setSelected( true ); + else if( style == JRootPane.FRAME ) + styleFrameRadioButton.setSelected( true ); + else if( style == JRootPane.PLAIN_DIALOG ) + stylePlainRadioButton.setSelected( true ); + else if( style == JRootPane.INFORMATION_DIALOG ) + styleInfoRadioButton.setSelected( true ); + else + throw new RuntimeException(); // not used + } + } + + private void menuBarChanged() { + Window window = SwingUtilities.windowForComponent( this ); + if( window instanceof JFrame ) { + ((JFrame)window).setJMenuBar( menuBarCheckBox.isSelected() ? menuBar : null ); + window.revalidate(); + window.repaint(); + } + } + + private void menuBarEmbeddedChanged() { + JRootPane rootPane = getWindowRootPane(); + if( rootPane != null ) + rootPane.putClientProperty( FlatClientProperties.MENU_BAR_EMBEDDED, menuBarEmbeddedCheckBox.isSelected() ); + } + + private void menuBarVisibleChanged() { + menuBar.setVisible( menuBarVisibleCheckBox.isSelected() ); + } + + private void addMenu() { + JMenu menu = new JMenu( "Hello" ); + menu.add( new JMenuItem( "world" ) ); + menuBar.add( menu ); + menuBar.revalidate(); + } + + private void removeMenu() { + int menuCount = menuBar.getMenuCount(); + if( menuCount <= 0 ) + return; + + menuBar.remove( menuCount - 1 ); + menuBar.revalidate(); + } + + private void changeMenu() { + int menuCount = menuBar.getMenuCount(); + if( menuCount <= 0 ) + return; + + int len = new Random().nextInt( 20 ); + String text = "1234567890abcdefghij".substring( 0, len + 1 ); + menuBar.getMenu( menuCount - 1 ).setText( text ); + } + + private void resizableChanged() { + Window window = SwingUtilities.windowForComponent( this ); + if( window instanceof Frame ) + ((Frame)window).setResizable( resizableCheckBox.isSelected() ); + else if( window instanceof Dialog ) + ((Dialog)window).setResizable( resizableCheckBox.isSelected() ); + } + + private void undecoratedChanged() { + Window window = SwingUtilities.windowForComponent( this ); + if( window == null ) + return; + + window.dispose(); + + if( window instanceof Frame ) + ((Frame)window).setUndecorated( undecoratedCheckBox.isSelected() ); + else if( window instanceof Dialog ) + ((Dialog)window).setUndecorated( undecoratedCheckBox.isSelected() ); + + window.setVisible( true ); + } + + private void maximizedBoundsChanged() { + Window window = SwingUtilities.windowForComponent( this ); + if( window instanceof Frame ) { + ((Frame)window).setMaximizedBounds( maximizedBoundsCheckBox.isSelected() + ? new Rectangle( 50, 100, 1000, 700 ) + : null ); + } + } + + private void menuItemActionPerformed(ActionEvent e) { + SwingUtilities.invokeLater( () -> { + JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE ); + } ); + } + + private void openDialog() { + Window owner = SwingUtilities.windowForComponent( this ); + JDialog dialog = new JDialog( owner, "Dialog", ModalityType.APPLICATION_MODAL ); + dialog.add( new FlatWindowDecorationsTest() ); + dialog.pack(); + dialog.setLocationRelativeTo( this ); + dialog.setVisible( true ); + } + + private void decorationStyleChanged() { + int style; + if( styleFrameRadioButton.isSelected() ) + style = JRootPane.FRAME; + else if( stylePlainRadioButton.isSelected() ) + style = JRootPane.PLAIN_DIALOG; + else if( styleInfoRadioButton.isSelected() ) + style = JRootPane.INFORMATION_DIALOG; + else if( styleErrorRadioButton.isSelected() ) + style = JRootPane.ERROR_DIALOG; + else if( styleQuestionRadioButton.isSelected() ) + style = JRootPane.QUESTION_DIALOG; + else if( styleWarningRadioButton.isSelected() ) + style = JRootPane.WARNING_DIALOG; + else if( styleColorChooserRadioButton.isSelected() ) + style = JRootPane.COLOR_CHOOSER_DIALOG; + else if( styleFileChooserRadioButton.isSelected() ) + style = JRootPane.FILE_CHOOSER_DIALOG; + else + style = JRootPane.NONE; + + JRootPane rootPane = getWindowRootPane(); + if( rootPane != null ) + rootPane.setWindowDecorationStyle( style ); + } + + private void iconChanged() { + Window window = SwingUtilities.windowForComponent( this ); + if( window == null ) + return; + + if( images == null ) + images = window.getIconImages(); + + if( iconNoneRadioButton.isSelected() ) + window.setIconImage( null ); + else if( iconTestAllRadioButton.isSelected() ) + window.setIconImages( images ); + else if( iconTestRandomRadioButton.isSelected() ) + window.setIconImage( images.get( (int) (Math.random() * images.size()) ) ); + } + + private JRootPane getWindowRootPane() { + Window window = SwingUtilities.windowForComponent( this ); + if( window instanceof JFrame ) + return ((JFrame)window).getRootPane(); + else if( window instanceof JDialog ) + return ((JDialog)window).getRootPane(); + return null; + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + menuBarCheckBox = new JCheckBox(); + addMenuButton = new JButton(); + removeMenuButton = new JButton(); + changeMenuButton = new JButton(); + menuBarEmbeddedCheckBox = new JCheckBox(); + menuBarVisibleCheckBox = new JCheckBox(); + resizableCheckBox = new JCheckBox(); + maximizedBoundsCheckBox = new JCheckBox(); + undecoratedCheckBox = new JCheckBox(); + JLabel label1 = new JLabel(); + JLabel label2 = new JLabel(); + JPanel panel1 = new JPanel(); + styleNoneRadioButton = new JRadioButton(); + styleFrameRadioButton = new JRadioButton(); + stylePlainRadioButton = new JRadioButton(); + styleInfoRadioButton = new JRadioButton(); + styleErrorRadioButton = new JRadioButton(); + styleQuestionRadioButton = new JRadioButton(); + styleWarningRadioButton = new JRadioButton(); + styleColorChooserRadioButton = new JRadioButton(); + styleFileChooserRadioButton = new JRadioButton(); + JPanel panel2 = new JPanel(); + iconNoneRadioButton = new JRadioButton(); + iconTestAllRadioButton = new JRadioButton(); + iconTestRandomRadioButton = new JRadioButton(); + JButton openDialogButton = new JButton(); + menuBar = new JMenuBar(); + JMenu fileMenu = new JMenu(); + JMenuItem newMenuItem = new JMenuItem(); + JMenuItem openMenuItem = new JMenuItem(); + JMenuItem closeMenuItem = new JMenuItem(); + JMenuItem closeMenuItem2 = new JMenuItem(); + JMenuItem exitMenuItem = new JMenuItem(); + JMenu editMenu = new JMenu(); + JMenuItem undoMenuItem = new JMenuItem(); + JMenuItem redoMenuItem = new JMenuItem(); + JMenuItem cutMenuItem = new JMenuItem(); + JMenuItem copyMenuItem = new JMenuItem(); + JMenuItem pasteMenuItem = new JMenuItem(); + JMenuItem deleteMenuItem = new JMenuItem(); + JMenu viewMenu = new JMenu(); + JCheckBoxMenuItem checkBoxMenuItem1 = new JCheckBoxMenuItem(); + JMenu menu1 = new JMenu(); + JMenu subViewsMenu = new JMenu(); + JMenu subSubViewsMenu = new JMenu(); + JMenuItem errorLogViewMenuItem = new JMenuItem(); + JMenuItem searchViewMenuItem = new JMenuItem(); + JMenuItem projectViewMenuItem = new JMenuItem(); + JMenuItem structureViewMenuItem = new JMenuItem(); + JMenuItem propertiesViewMenuItem = new JMenuItem(); + JMenu helpMenu = new JMenu(); + JMenuItem aboutMenuItem = new JMenuItem(); + + //======== this ======== + setLayout(new MigLayout( + "ltr,insets dialog,hidemode 3", + // columns + "[left]para" + + "[left]", + // rows + "para[]0" + + "[]0" + + "[]0" + + "[]0" + + "[]" + + "[]" + + "[top]" + + "[]")); + + //---- menuBarCheckBox ---- + menuBarCheckBox.setText("menu bar"); + menuBarCheckBox.setSelected(true); + menuBarCheckBox.addActionListener(e -> menuBarChanged()); + add(menuBarCheckBox, "cell 0 0"); + + //---- addMenuButton ---- + addMenuButton.setText("Add menu"); + addMenuButton.addActionListener(e -> addMenu()); + add(addMenuButton, "cell 1 0 1 2,align left top,grow 0 0"); + + //---- removeMenuButton ---- + removeMenuButton.setText("Remove menu"); + removeMenuButton.addActionListener(e -> removeMenu()); + add(removeMenuButton, "cell 1 0 1 2,align left top,grow 0 0"); + + //---- changeMenuButton ---- + changeMenuButton.setText("Change menu"); + changeMenuButton.addActionListener(e -> changeMenu()); + add(changeMenuButton, "cell 1 0 1 2,align left top,grow 0 0"); + + //---- menuBarEmbeddedCheckBox ---- + menuBarEmbeddedCheckBox.setText("embedded menu bar"); + menuBarEmbeddedCheckBox.setSelected(true); + menuBarEmbeddedCheckBox.addActionListener(e -> menuBarEmbeddedChanged()); + add(menuBarEmbeddedCheckBox, "cell 0 1"); + + //---- menuBarVisibleCheckBox ---- + menuBarVisibleCheckBox.setText("menu bar visible"); + menuBarVisibleCheckBox.setSelected(true); + menuBarVisibleCheckBox.addActionListener(e -> menuBarVisibleChanged()); + add(menuBarVisibleCheckBox, "cell 0 2"); + + //---- resizableCheckBox ---- + resizableCheckBox.setText("resizable"); + resizableCheckBox.setSelected(true); + resizableCheckBox.addActionListener(e -> resizableChanged()); + add(resizableCheckBox, "cell 0 3"); + + //---- maximizedBoundsCheckBox ---- + maximizedBoundsCheckBox.setText("maximized bounds (50,100, 1000,700)"); + maximizedBoundsCheckBox.addActionListener(e -> maximizedBoundsChanged()); + add(maximizedBoundsCheckBox, "cell 1 3"); + + //---- undecoratedCheckBox ---- + undecoratedCheckBox.setText("undecorated"); + undecoratedCheckBox.addActionListener(e -> undecoratedChanged()); + add(undecoratedCheckBox, "cell 0 4"); + + //---- label1 ---- + label1.setText("Style:"); + add(label1, "cell 0 5"); + + //---- label2 ---- + label2.setText("Icon:"); + add(label2, "cell 1 5"); + + //======== panel1 ======== + { + panel1.setLayout(new MigLayout( + "ltr,insets 0,hidemode 3,gap 0 0", + // columns + "[fill]", + // rows + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]" + + "[]")); + + //---- styleNoneRadioButton ---- + styleNoneRadioButton.setText("none"); + styleNoneRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleNoneRadioButton, "cell 0 0"); + + //---- styleFrameRadioButton ---- + styleFrameRadioButton.setText("frame"); + styleFrameRadioButton.setSelected(true); + styleFrameRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleFrameRadioButton, "cell 0 1"); + + //---- stylePlainRadioButton ---- + stylePlainRadioButton.setText("plain dialog"); + stylePlainRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(stylePlainRadioButton, "cell 0 2"); + + //---- styleInfoRadioButton ---- + styleInfoRadioButton.setText("info dialog"); + styleInfoRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleInfoRadioButton, "cell 0 3"); + + //---- styleErrorRadioButton ---- + styleErrorRadioButton.setText("error dialog"); + styleErrorRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleErrorRadioButton, "cell 0 4"); + + //---- styleQuestionRadioButton ---- + styleQuestionRadioButton.setText("question dialog"); + styleQuestionRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleQuestionRadioButton, "cell 0 5"); + + //---- styleWarningRadioButton ---- + styleWarningRadioButton.setText("warning dialog"); + styleWarningRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleWarningRadioButton, "cell 0 6"); + + //---- styleColorChooserRadioButton ---- + styleColorChooserRadioButton.setText("color chooser dialog"); + styleColorChooserRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleColorChooserRadioButton, "cell 0 7"); + + //---- styleFileChooserRadioButton ---- + styleFileChooserRadioButton.setText("file chooser dialog"); + styleFileChooserRadioButton.addActionListener(e -> decorationStyleChanged()); + panel1.add(styleFileChooserRadioButton, "cell 0 8"); + } + add(panel1, "cell 0 6"); + + //======== panel2 ======== + { + panel2.setLayout(new MigLayout( + "ltr,insets 0,hidemode 3,gap 0 0", + // columns + "[fill]", + // rows + "[]" + + "[]" + + "[]")); + + //---- iconNoneRadioButton ---- + iconNoneRadioButton.setText("none"); + iconNoneRadioButton.addActionListener(e -> iconChanged()); + panel2.add(iconNoneRadioButton, "cell 0 0"); + + //---- iconTestAllRadioButton ---- + iconTestAllRadioButton.setText("test all"); + iconTestAllRadioButton.setSelected(true); + iconTestAllRadioButton.addActionListener(e -> iconChanged()); + panel2.add(iconTestAllRadioButton, "cell 0 1"); + + //---- iconTestRandomRadioButton ---- + iconTestRandomRadioButton.setText("test random"); + iconTestRandomRadioButton.addActionListener(e -> iconChanged()); + panel2.add(iconTestRandomRadioButton, "cell 0 2"); + } + add(panel2, "cell 1 6"); + + //---- openDialogButton ---- + openDialogButton.setText("Open Dialog"); + openDialogButton.addActionListener(e -> openDialog()); + add(openDialogButton, "cell 0 7"); + + //======== menuBar ======== + { + + //======== fileMenu ======== + { + fileMenu.setText("File"); + fileMenu.setMnemonic('F'); + + //---- newMenuItem ---- + newMenuItem.setText("New"); + newMenuItem.setMnemonic('N'); + newMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(newMenuItem); + + //---- openMenuItem ---- + openMenuItem.setText("Open"); + openMenuItem.setMnemonic('O'); + openMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(openMenuItem); + fileMenu.addSeparator(); + + //---- closeMenuItem ---- + closeMenuItem.setText("Close"); + closeMenuItem.setMnemonic('C'); + closeMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(closeMenuItem); + + //---- closeMenuItem2 ---- + closeMenuItem2.setText("Close All"); + closeMenuItem2.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(closeMenuItem2); + fileMenu.addSeparator(); + + //---- exitMenuItem ---- + exitMenuItem.setText("Exit"); + exitMenuItem.setMnemonic('X'); + exitMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + fileMenu.add(exitMenuItem); + } + menuBar.add(fileMenu); + + //======== editMenu ======== + { + editMenu.setText("Edit"); + editMenu.setMnemonic('E'); + + //---- undoMenuItem ---- + undoMenuItem.setText("Undo"); + undoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + undoMenuItem.setMnemonic('U'); + undoMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(undoMenuItem); + + //---- redoMenuItem ---- + redoMenuItem.setText("Redo"); + redoMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + redoMenuItem.setMnemonic('R'); + redoMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(redoMenuItem); + editMenu.addSeparator(); + + //---- cutMenuItem ---- + cutMenuItem.setText("Cut"); + cutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + cutMenuItem.setMnemonic('C'); + editMenu.add(cutMenuItem); + + //---- copyMenuItem ---- + copyMenuItem.setText("Copy"); + copyMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + copyMenuItem.setMnemonic('O'); + editMenu.add(copyMenuItem); + + //---- pasteMenuItem ---- + pasteMenuItem.setText("Paste"); + pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + pasteMenuItem.setMnemonic('P'); + editMenu.add(pasteMenuItem); + editMenu.addSeparator(); + + //---- deleteMenuItem ---- + deleteMenuItem.setText("Delete"); + deleteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); + deleteMenuItem.setMnemonic('D'); + deleteMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + editMenu.add(deleteMenuItem); + } + menuBar.add(editMenu); + + //======== viewMenu ======== + { + viewMenu.setText("View"); + viewMenu.setMnemonic('V'); + + //---- checkBoxMenuItem1 ---- + checkBoxMenuItem1.setText("Show Toolbar"); + checkBoxMenuItem1.setSelected(true); + checkBoxMenuItem1.setMnemonic('T'); + checkBoxMenuItem1.addActionListener(e -> menuItemActionPerformed(e)); + viewMenu.add(checkBoxMenuItem1); + + //======== menu1 ======== + { + menu1.setText("Show View"); + menu1.setMnemonic('V'); + + //======== subViewsMenu ======== + { + subViewsMenu.setText("Sub Views"); + subViewsMenu.setMnemonic('S'); + + //======== subSubViewsMenu ======== + { + subSubViewsMenu.setText("Sub sub Views"); + subSubViewsMenu.setMnemonic('U'); + + //---- errorLogViewMenuItem ---- + errorLogViewMenuItem.setText("Error Log"); + errorLogViewMenuItem.setMnemonic('E'); + errorLogViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + subSubViewsMenu.add(errorLogViewMenuItem); + } + subViewsMenu.add(subSubViewsMenu); + + //---- searchViewMenuItem ---- + searchViewMenuItem.setText("Search"); + searchViewMenuItem.setMnemonic('S'); + searchViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + subViewsMenu.add(searchViewMenuItem); + } + menu1.add(subViewsMenu); + + //---- projectViewMenuItem ---- + projectViewMenuItem.setText("Project"); + projectViewMenuItem.setMnemonic('P'); + projectViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(projectViewMenuItem); + + //---- structureViewMenuItem ---- + structureViewMenuItem.setText("Structure"); + structureViewMenuItem.setMnemonic('T'); + structureViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(structureViewMenuItem); + + //---- propertiesViewMenuItem ---- + propertiesViewMenuItem.setText("Properties"); + propertiesViewMenuItem.setMnemonic('O'); + propertiesViewMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + menu1.add(propertiesViewMenuItem); + } + viewMenu.add(menu1); + } + menuBar.add(viewMenu); + + //======== helpMenu ======== + { + helpMenu.setText("Help"); + helpMenu.setMnemonic('H'); + + //---- aboutMenuItem ---- + aboutMenuItem.setText("About"); + aboutMenuItem.setMnemonic('A'); + aboutMenuItem.addActionListener(e -> menuItemActionPerformed(e)); + helpMenu.add(aboutMenuItem); + } + menuBar.add(helpMenu); + } + + //---- styleButtonGroup ---- + ButtonGroup styleButtonGroup = new ButtonGroup(); + styleButtonGroup.add(styleNoneRadioButton); + styleButtonGroup.add(styleFrameRadioButton); + styleButtonGroup.add(stylePlainRadioButton); + styleButtonGroup.add(styleInfoRadioButton); + styleButtonGroup.add(styleErrorRadioButton); + styleButtonGroup.add(styleQuestionRadioButton); + styleButtonGroup.add(styleWarningRadioButton); + styleButtonGroup.add(styleColorChooserRadioButton); + styleButtonGroup.add(styleFileChooserRadioButton); + + //---- iconButtonGroup ---- + ButtonGroup iconButtonGroup = new ButtonGroup(); + iconButtonGroup.add(iconNoneRadioButton); + iconButtonGroup.add(iconTestAllRadioButton); + iconButtonGroup.add(iconTestRandomRadioButton); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JCheckBox menuBarCheckBox; + private JButton addMenuButton; + private JButton removeMenuButton; + private JButton changeMenuButton; + private JCheckBox menuBarEmbeddedCheckBox; + private JCheckBox menuBarVisibleCheckBox; + private JCheckBox resizableCheckBox; + private JCheckBox maximizedBoundsCheckBox; + private JCheckBox undecoratedCheckBox; + private JRadioButton styleNoneRadioButton; + private JRadioButton styleFrameRadioButton; + private JRadioButton stylePlainRadioButton; + private JRadioButton styleInfoRadioButton; + private JRadioButton styleErrorRadioButton; + private JRadioButton styleQuestionRadioButton; + private JRadioButton styleWarningRadioButton; + private JRadioButton styleColorChooserRadioButton; + private JRadioButton styleFileChooserRadioButton; + private JRadioButton iconNoneRadioButton; + private JRadioButton iconTestAllRadioButton; + private JRadioButton iconTestRandomRadioButton; + private JMenuBar menuBar; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.jfd new file mode 100644 index 00000000..f73e537f --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatWindowDecorationsTest.jfd @@ -0,0 +1,462 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "ltr,insets dialog,hidemode 3" + "$columnConstraints": "[left]para[left]" + "$rowConstraints": "para[]0[]0[]0[]0[][][top][]" + } ) { + name: "this" + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "menuBarCheckBox" + "text": "menu bar" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "addMenuButton" + "text": "Add menu" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "addMenu", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0 1 2,align left top,grow 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "removeMenuButton" + "text": "Remove menu" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "removeMenu", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0 1 2,align left top,grow 0 0" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "changeMenuButton" + "text": "Change menu" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "changeMenu", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0 1 2,align left top,grow 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "menuBarEmbeddedCheckBox" + "text": "embedded menu bar" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "menuBarVisibleCheckBox" + "text": "menu bar visible" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarVisibleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "resizableCheckBox" + "text": "resizable" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "maximizedBoundsCheckBox" + "text": "maximized bounds (50,100, 1000,700)" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximizedBoundsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "undecoratedCheckBox" + "text": "undecorated" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "undecoratedChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "Style:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "Icon:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 5" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$columnConstraints": "[fill]" + "$rowConstraints": "[][][][][][][][][]" + "$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0" + } ) { + name: "panel1" + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleNoneRadioButton" + "text": "none" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleFrameRadioButton" + "text": "frame" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "stylePlainRadioButton" + "text": "plain dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleInfoRadioButton" + "text": "info dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleErrorRadioButton" + "text": "error dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 4" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleQuestionRadioButton" + "text": "question dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 5" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleWarningRadioButton" + "text": "warning dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleColorChooserRadioButton" + "text": "color chooser dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "styleFileChooserRadioButton" + "text": "file chooser dialog" + "$buttonGroup": new FormReference( "styleButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "decorationStyleChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 8" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 6" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$columnConstraints": "[fill]" + "$rowConstraints": "[][][]" + "$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0" + } ) { + name: "panel2" + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "iconNoneRadioButton" + "text": "none" + "$buttonGroup": new FormReference( "iconButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "iconChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "iconTestAllRadioButton" + "text": "test all" + "selected": true + "$buttonGroup": new FormReference( "iconButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "iconChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JRadioButton" ) { + name: "iconTestRandomRadioButton" + "text": "test random" + "$buttonGroup": new FormReference( "iconButtonGroup" ) + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "iconChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 6" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "openDialogButton" + "text": "Open Dialog" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 7" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 550, 440 ) + } ) + add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { + name: "menuBar" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "fileMenu" + "text": "File" + "mnemonic": 70 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "newMenuItem" + "text": "New" + "mnemonic": 78 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "openMenuItem" + "text": "Open" + "mnemonic": 79 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator2" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "closeMenuItem" + "text": "Close" + "mnemonic": 67 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "closeMenuItem2" + "text": "Close All" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator1" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "exitMenuItem" + "text": "Exit" + "mnemonic": 88 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "editMenu" + "text": "Edit" + "mnemonic": 69 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "undoMenuItem" + "text": "Undo" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 90, 4226, false ) + "mnemonic": 85 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "redoMenuItem" + "text": "Redo" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 89, 4226, false ) + "mnemonic": 82 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator4" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "cutMenuItem" + "text": "Cut" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 88, 4226, false ) + "mnemonic": 67 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "copyMenuItem" + "text": "Copy" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 67, 4226, false ) + "mnemonic": 79 + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "pasteMenuItem" + "text": "Paste" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 86, 4226, false ) + "mnemonic": 80 + } ) + add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) { + name: "separator3" + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "deleteMenuItem" + "text": "Delete" + "accelerator": static javax.swing.KeyStroke getKeyStroke( 127, 0, false ) + "mnemonic": 68 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "viewMenu" + "text": "View" + "mnemonic": 86 + add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) { + name: "checkBoxMenuItem1" + "text": "Show Toolbar" + "selected": true + "mnemonic": 84 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "menu1" + "text": "Show View" + "mnemonic": 86 + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "subViewsMenu" + "text": "Sub Views" + "mnemonic": 83 + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "subSubViewsMenu" + "text": "Sub sub Views" + "mnemonic": 85 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "errorLogViewMenuItem" + "text": "Error Log" + "mnemonic": 69 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "searchViewMenuItem" + "text": "Search" + "mnemonic": 83 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "projectViewMenuItem" + "text": "Project" + "mnemonic": 80 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "structureViewMenuItem" + "text": "Structure" + "mnemonic": 84 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "propertiesViewMenuItem" + "text": "Properties" + "mnemonic": 79 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + } ) + add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { + name: "helpMenu" + "text": "Help" + "mnemonic": 72 + add( new FormComponent( "javax.swing.JMenuItem" ) { + name: "aboutMenuItem" + "text": "About" + "mnemonic": 65 + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuItemActionPerformed", true ) ) + } ) + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 470 ) + "size": new java.awt.Dimension( 255, 30 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "styleButtonGroup" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 520 ) + } ) + add( new FormNonVisual( "javax.swing.ButtonGroup" ) { + name: "iconButtonGroup" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 570 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.java index b75b7ba6..f010302f 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.java @@ -39,6 +39,29 @@ public class FlatExtrasTest triStateLabel1.setText( triStateCheckBox1.getState().toString() ); triStateLabel2.setText( triStateCheckBox2.getState().toString() ); + + addSVGIcon( "actions/copy.svg" ); + addSVGIcon( "actions/colors.svg" ); + addSVGIcon( "actions/execute.svg" ); + addSVGIcon( "actions/suspend.svg" ); + addSVGIcon( "actions/intentionBulb.svg" ); + addSVGIcon( "actions/quickfixOffBulb.svg" ); + + addSVGIcon( "objects/abstractClass.svg" ); + addSVGIcon( "objects/abstractMethod.svg" ); + addSVGIcon( "objects/annotationtype.svg" ); + addSVGIcon( "objects/annotationtype.svg" ); + addSVGIcon( "objects/css.svg" ); + addSVGIcon( "objects/javaScript.svg" ); + addSVGIcon( "objects/xhtml.svg" ); + + addSVGIcon( "errorDialog.svg" ); + addSVGIcon( "informationDialog.svg" ); + addSVGIcon( "warningDialog.svg" ); + } + + private void addSVGIcon( String name ) { + svgIconsPanel.add( new JLabel( new FlatSVGIcon( "com/formdev/flatlaf/demo/extras/svg/" + name ) ) ); } private void triStateCheckBox1Changed() { @@ -56,6 +79,9 @@ public class FlatExtrasTest triStateLabel1 = new JLabel(); triStateCheckBox2 = new TriStateCheckBox(); triStateLabel2 = new JLabel(); + label2 = new JLabel(); + svgIconsPanel = new JPanel(); + label3 = new JLabel(); //======== this ======== setLayout(new MigLayout( @@ -66,6 +92,8 @@ public class FlatExtrasTest "[left]", // rows "[]" + + "[]" + + "[]" + "[]")); //---- label1 ---- @@ -79,7 +107,8 @@ public class FlatExtrasTest //---- triStateLabel1 ---- triStateLabel1.setText("text"); - add(triStateLabel1, "cell 2 0"); + triStateLabel1.setEnabled(false); + add(triStateLabel1, "cell 2 0,gapx 30"); //---- triStateCheckBox2 ---- triStateCheckBox2.setText("third state disabled"); @@ -89,7 +118,27 @@ public class FlatExtrasTest //---- triStateLabel2 ---- triStateLabel2.setText("text"); - add(triStateLabel2, "cell 2 1"); + triStateLabel2.setEnabled(false); + add(triStateLabel2, "cell 2 1,gapx 30"); + + //---- label2 ---- + label2.setText("SVG Icons:"); + add(label2, "cell 0 2"); + + //======== svgIconsPanel ======== + { + svgIconsPanel.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[fill]", + // rows + "[grow,center]")); + } + add(svgIconsPanel, "cell 1 2 2 1"); + + //---- label3 ---- + label3.setText("The icons may change colors when switching to another theme."); + add(label3, "cell 1 3 2 1"); // JFormDesigner - End of component initialization //GEN-END:initComponents } @@ -99,5 +148,8 @@ public class FlatExtrasTest private JLabel triStateLabel1; private TriStateCheckBox triStateCheckBox2; private JLabel triStateLabel2; + private JLabel label2; + private JPanel svgIconsPanel; + private JLabel label3; // JFormDesigner - End of variables declaration //GEN-END:variables } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.jfd index 231e5b93..85f30970 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/extras/FlatExtrasTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -6,7 +6,7 @@ new FormModel { add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "ltr,insets dialog,hidemode 3" "$columnConstraints": "[][][left]" - "$rowConstraints": "[][]" + "$rowConstraints": "[][][][]" } ) { name: "this" add( new FormComponent( "javax.swing.JLabel" ) { @@ -25,8 +25,9 @@ new FormModel { add( new FormComponent( "javax.swing.JLabel" ) { name: "triStateLabel1" "text": "text" + "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0" + "value": "cell 2 0,gapx 30" } ) add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) { name: "triStateCheckBox2" @@ -39,12 +40,34 @@ new FormModel { add( new FormComponent( "javax.swing.JLabel" ) { name: "triStateLabel2" "text": "text" + "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 1" + "value": "cell 2 1,gapx 30" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "SVG Icons:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[fill]" + "$rowConstraints": "[grow,center]" + } ) { + name: "svgIconsPanel" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2 2 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "The icons may change colors when switching to another theme." + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 3 2 1" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 400, 300 ) + "size": new java.awt.Dimension( 500, 300 ) } ) } } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.java new file mode 100644 index 00000000..cc6c1414 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.java @@ -0,0 +1,157 @@ +/* + * Copyright 2019 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 + * + * http://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.testing.glazedlists; + +import java.util.Comparator; +import javax.swing.*; +import com.formdev.flatlaf.testing.*; +import com.formdev.flatlaf.testing.FlatTestFrame; +import ca.odell.glazedlists.BasicEventList; +import ca.odell.glazedlists.EventList; +import ca.odell.glazedlists.SortedList; +import ca.odell.glazedlists.gui.TableFormat; +import ca.odell.glazedlists.swing.AdvancedTableModel; +import ca.odell.glazedlists.swing.GlazedListsSwing; +import ca.odell.glazedlists.swing.TableComparatorChooser; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatGlazedListsTest + extends FlatTestPanel +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatGlazedListsTest" ); + frame.showFrame( FlatGlazedListsTest::new ); + } ); + } + + FlatGlazedListsTest() { + initComponents(); + + EventList itemEventList = new BasicEventList<>(); + itemEventList.add( new Item( "item 1", "item 1b", "January", 123, null ) ); + itemEventList.add( new Item( "item 2", "item 2b", "February", 456, true ) ); + itemEventList.add( new Item( "item 3", null, "March", null, false ) ); + itemEventList.add( new Item( "item 4", null, "April", 234, true ) ); + itemEventList.add( new Item( "item 5", null, "May", null, false ) ); + itemEventList.add( new Item( "item 6", null, "June", null, null ) ); + itemEventList.add( new Item( "item 7", null, "July", null, null ) ); + itemEventList.add( new Item( "item 8", null, "August", null, null ) ); + itemEventList.add( new Item( "item 9", null, "September", null, null ) ); + itemEventList.add( new Item( "item 10", null, "October", null, null ) ); + itemEventList.add( new Item( "item 11", null, "November", null, null ) ); + itemEventList.add( new Item( "item 12", null, "December", null, null ) ); + + Comparator itemComparator = Comparator.comparing( Item::getName ); + SortedList sortedItems = new SortedList<>( itemEventList, itemComparator ); + AdvancedTableModel tableModel = GlazedListsSwing.eventTableModelWithThreadProxyList( sortedItems, new ItemTableFormat() ); + itemsTable.setModel( tableModel ); + TableComparatorChooser tableComparatorChooser = TableComparatorChooser.install( + itemsTable, sortedItems, TableComparatorChooser.MULTIPLE_COLUMN_MOUSE ); + tableComparatorChooser.appendComparator( 0, 0, false ); + + TableComparatorChooser.setIconPath( "resources/windowsxp" ); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + scrollPane1 = new JScrollPane(); + itemsTable = new JTable(); + + //======== this ======== + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[grow,fill]", + // rows + "[grow,fill]")); + + //======== scrollPane1 ======== + { + scrollPane1.setViewportView(itemsTable); + } + add(scrollPane1, "cell 0 0,growx,width 300"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JScrollPane scrollPane1; + private JTable itemsTable; + // JFormDesigner - End of variables declaration //GEN-END:variables + + //---- class Item --------------------------------------------------------- + + private static class Item + { + final String name; + final String desc; + final String month; + final Integer number; + final Boolean bool; + + Item( String name, String desc, String month, Integer number, Boolean bool ) { + this.name = name; + this.desc = desc; + this.month = month; + this.number = number; + this.bool = bool; + } + + String getName() { + return name; + } + } + + //---- class ItemTableFormat ---------------------------------------------- + + private static class ItemTableFormat + implements TableFormat + { + private static String[] COLUMN_NAMES = { + "Name", + "Description", + "Month", + "Integer", + "Boolean", + }; + + @Override + public int getColumnCount() { + return COLUMN_NAMES.length; + } + + @Override + public String getColumnName( int column ) { + return COLUMN_NAMES[column]; + } + + @Override + public Object getColumnValue( Item item, int column ) { + switch( column ) { + case 0: return item.name; + case 1: return item.desc; + case 2: return item.month; + case 3: return item.number; + case 4: return item.bool; + } + throw new IllegalStateException(); + } + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.jfd new file mode 100644 index 00000000..02c995cf --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/glazedlists/FlatGlazedListsTest.jfd @@ -0,0 +1,34 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "13.0.2" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[grow,fill]" + "$rowConstraints": "[grow,fill]" + } ) { + name: "this" + add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { + name: "scrollPane1" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormComponent( "javax.swing.JTable" ) { + name: "itemsTable" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0,growx,width 300" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 500, 500 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java index 30c96d2a..ac36c871 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java @@ -20,15 +20,24 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Insets; +import java.io.BufferedReader; import java.io.File; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; import java.io.StringWriter; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.util.Arrays; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; import java.util.function.Predicate; import javax.swing.Icon; import javax.swing.ImageIcon; @@ -43,6 +52,7 @@ import javax.swing.UIDefaults; import javax.swing.UIDefaults.ActiveValue; import javax.swing.UIDefaults.LazyValue; import javax.swing.UIManager; +import javax.swing.UIManager.LookAndFeelInfo; import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.LineBorder; @@ -50,6 +60,13 @@ import javax.swing.plaf.BorderUIResource; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicLookAndFeel; import com.formdev.flatlaf.*; +import com.formdev.flatlaf.intellijthemes.FlatAllIJThemes; +import com.formdev.flatlaf.testing.FlatTestLaf; +import com.formdev.flatlaf.ui.FlatLineBorder; +import com.formdev.flatlaf.util.ColorFunctions.ColorFunction; +import com.formdev.flatlaf.util.ColorFunctions.HSLIncreaseDecrease; +import com.formdev.flatlaf.util.DerivedColor; +import com.formdev.flatlaf.util.StringUtils; import com.formdev.flatlaf.util.SystemInfo; /** @@ -66,25 +83,32 @@ public class UIDefaultsDump private JComponent dummyComponent; public static void main( String[] args ) { + Locale.setDefault( Locale.ENGLISH ); System.setProperty( "sun.java2d.uiScale", "1x" ); - System.setProperty( "flatlaf.uiScale", "1x" ); + System.setProperty( FlatSystemProperties.UI_SCALE, "1x" ); - File dir = new File( "src/main/resources/com/formdev/flatlaf/testing/uidefaults" ); + File dir = new File( "dumps/uidefaults" ); dump( FlatLightLaf.class.getName(), dir ); dump( FlatDarkLaf.class.getName(), dir ); -// dump( FlatIntelliJLaf.class.getName(), dir ); -// dump( FlatDarculaLaf.class.getName(), dir ); -// + if( SystemInfo.isWindows ) { + dump( FlatIntelliJLaf.class.getName(), dir ); + dump( FlatDarculaLaf.class.getName(), dir ); + } + + dump( FlatTestLaf.class.getName(), dir ); + // dump( MyBasicLookAndFeel.class.getName(), dir ); // dump( MetalLookAndFeel.class.getName(), dir ); // dump( NimbusLookAndFeel.class.getName(), dir ); // -// if( SystemInfo.IS_WINDOWS ) +// if( SystemInfo.isWindows ) // dump( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", dir ); -// else if( SystemInfo.IS_MAC ) +// else if( SystemInfo.isMacOS ) // dump( "com.apple.laf.AquaLookAndFeel", dir ); +// else if( SystemInfo.isLinux ) +// dump( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel", dir ); // // dump( "com.jgoodies.looks.plastic.PlasticLookAndFeel", dir ); // dump( "com.jgoodies.looks.windows.WindowsLookAndFeel", dir ); @@ -97,6 +121,26 @@ public class UIDefaultsDump // // TODO Auto-generated catch block // ex.printStackTrace(); // } + +// dumpIntelliJThemes( dir ); + + // dump UI keys + UIDefaultsKeysDump.main( new String[0] ); + } + + @SuppressWarnings( "unused" ) + private static void dumpIntelliJThemes( File dir ) { + dir = new File( dir, "intellijthemes" ); + + for( LookAndFeelInfo info : FlatAllIJThemes.INFOS ) { + String lafClassName = info.getClassName(); + String relativeLafClassName = StringUtils.removeLeading( lafClassName, "com.formdev.flatlaf.intellijthemes." ); + File dir2 = relativeLafClassName.lastIndexOf( '.' ) >= 0 + ? new File( dir, relativeLafClassName.substring( 0, relativeLafClassName.lastIndexOf( '.' ) ).replace( '.', '/' ) ) + : dir; + + dump( lafClassName, dir2 ); + } } private static void dump( String lookAndFeelClassName, File dir ) { @@ -107,35 +151,131 @@ public class UIDefaultsDump return; } - LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); - - dump( dir, "", lookAndFeel, key -> !key.contains( "InputMap" ) ); - if( lookAndFeel.getClass() != FlatLightLaf.class ) - return; - - dump( dir, "_InputMap", lookAndFeel, key -> key.contains( "InputMap" ) ); + dump( dir, null ); } - private static void dump( File dir, String nameSuffix, LookAndFeel lookAndFeel, Predicate keyFilter ) { + private static void dump( File dir, String name ) { + LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); + + dump( dir, name, "", lookAndFeel, key -> !key.contains( "InputMap" ) ); + + if( lookAndFeel.getClass() == FlatLightLaf.class || !(lookAndFeel instanceof FlatLaf) ) + dump( dir, name, "_InputMap", lookAndFeel, key -> key.contains( "InputMap" ) ); + } + + private static void dump( File dir, String name, String nameSuffix, + LookAndFeel lookAndFeel, Predicate keyFilter ) + { // dump to string StringWriter stringWriter = new StringWriter( 100000 ); new UIDefaultsDump( lookAndFeel ).dump( new PrintWriter( stringWriter ), keyFilter ); - Class lookAndFeelClass = lookAndFeel instanceof MyBasicLookAndFeel - ? BasicLookAndFeel.class - : lookAndFeel.getClass(); - String osSuffix = (SystemInfo.IS_MAC && lookAndFeel instanceof FlatLaf) ? "-mac" : ""; - File file = new File( dir, lookAndFeelClass.getSimpleName() + nameSuffix + "_" - + System.getProperty( "java.version" ) + osSuffix + ".txt" ); + if( name == null ) { + name = lookAndFeel instanceof MyBasicLookAndFeel + ? BasicLookAndFeel.class.getSimpleName() + : lookAndFeel.getClass().getSimpleName(); + } + String osSuffix = (SystemInfo.isMacOS && lookAndFeel instanceof FlatLaf) + ? "-mac" + : ((SystemInfo.isLinux && lookAndFeel instanceof FlatLaf) + ? "-linux" + : ""); + String javaVersion = System.getProperty( "java.version" ); + File file = new File( dir, name + nameSuffix + "_" + + javaVersion + osSuffix + ".txt" ); + + // build differences + String content; + File origFile = null; + if( !osSuffix.isEmpty() && nameSuffix.isEmpty() ) + origFile = new File( dir, name + nameSuffix + "_" + javaVersion + ".txt" ); + else if( lookAndFeel instanceof FlatIntelliJLaf && SystemInfo.isWindows ) + origFile = new File( dir, "FlatLightLaf_" + javaVersion + ".txt" ); + else if( lookAndFeel instanceof FlatDarculaLaf && SystemInfo.isWindows ) + origFile = new File( dir, "FlatDarkLaf_" + javaVersion + ".txt" ); + if( origFile != null ) { + try { + Map defaults1 = parse( new FileReader( origFile ) ); + Map defaults2 = parse( new StringReader( stringWriter.toString() ) ); + + content = diff( defaults1, defaults2 ); + } catch( Exception ex ) { + ex.printStackTrace(); + return; + } + } else + content = stringWriter.toString().replace( "\r", "" ); // write to file + file.getParentFile().mkdirs(); try( FileWriter fileWriter = new FileWriter( file ) ) { - fileWriter.write( stringWriter.toString().replace( "\r", "" ) ); + fileWriter.write( content ); } catch( IOException ex ) { ex.printStackTrace(); } } + private static String diff( Map defaults1, Map defaults2 ) { + TreeSet keys = new TreeSet<>(); + keys.addAll( defaults1.keySet() ); + keys.addAll( defaults2.keySet() ); + + StringBuilder buf = new StringBuilder( 10000 ); + + // diff header values + for( String key : new String[] { "Class", "ID", "Name", "Java", "OS" } ) + diffValue( buf, key, defaults1.remove( key ), defaults2.remove( key ) ); + + // diff values + for( String key : keys ) + diffValue( buf, key, defaults1.get( key ), defaults2.get( key ) ); + + return buf.toString(); + } + + private static void diffValue( StringBuilder buf, String key, String value1, String value2 ) { + if( !Objects.equals( value1, value2 ) ) { + if( value1 != null ) + buf.append( "- " ).append( key ).append( value1 ).append( '\n' ); + if( value2 != null ) + buf.append( "+ " ).append( key ).append( value2 ).append( '\n' ); + buf.append( '\n' ); + } + } + + private static Map parse( Reader in ) throws IOException { + Map defaults = new LinkedHashMap<>(); + try( BufferedReader reader = new BufferedReader( in ) ) { + String lastKey = null; + + String line; + while( (line = reader.readLine()) != null ) { + String trimmedLine = line.trim(); + if( trimmedLine.isEmpty() || trimmedLine.startsWith( "#" ) ) { + lastKey = null; + continue; + } + + if( Character.isWhitespace( line.charAt( 0 ) ) ) { + String value = defaults.get( lastKey ); + value += '\n' + line; + defaults.put( lastKey, value ); + } else { + int sep = line.indexOf( ' ' ); + if( sep < 0 ) + throw new IOException( line ); + + String key = line.substring( 0, sep ); + String value = line.substring( sep ); + defaults.put( key, value ); + + lastKey = key; + } + } + } + return defaults; + } + private UIDefaultsDump( LookAndFeel lookAndFeel ) { this.lookAndFeel = lookAndFeel; this.defaults = lookAndFeel.getDefaults(); @@ -243,6 +383,31 @@ public class UIDefaultsDump out.printf( hasAlpha ? "#%08x %s" : "#%06x %s", hasAlpha ? color.getRGB() : (color.getRGB() & 0xffffff), dumpClass( color ) ); + + if( color instanceof DerivedColor ) { + out.print( " " ); + DerivedColor derivedColor = (DerivedColor) color; + for( ColorFunction function : derivedColor.getFunctions() ) { + out.print( " " ); + dumpColorFunction( out, function ); + } + } + } + + private void dumpColorFunction( PrintWriter out, ColorFunction function ) { + if( function instanceof HSLIncreaseDecrease ) { + HSLIncreaseDecrease func = (HSLIncreaseDecrease) function; + String name; + switch( func.hslIndex ) { + case 2: name = func.increase ? "lighten" : "darken"; break; + case 1: name = func.increase ? "saturate" : "desaturate"; break; + default: throw new IllegalArgumentException(); + } + out.printf( "%s(%.0f%%%s%s)", name, func.amount, + (func.relative ? " relative" : ""), + (func.autoInverse ? " autoInverse" : "") ); + } else + throw new IllegalArgumentException( "unknown color function: " + function ); } private void dumpFont( PrintWriter out, Font font ) { @@ -323,6 +488,13 @@ public class UIDefaultsDump insets.top, insets.left, insets.bottom, insets.right, border.isBorderOpaque(), dumpClass( border ) ); + + if( border instanceof FlatLineBorder ) { + FlatLineBorder lineBorder = (FlatLineBorder) border; + out.print( " lineColor=" ); + dumpColor( out, lineBorder.getLineColor() ); + out.printf( " lineThickness=%f", lineBorder.getLineThickness() ); + } } } @@ -368,7 +540,16 @@ public class UIDefaultsDump private void dumpActiveValue( PrintWriter out, ActiveValue value ) { out.print( "[active] " ); - dumpValue( out, value.createValue( defaults ) ); + Object realValue = value.createValue( defaults ); + + if( realValue instanceof Font && realValue == UIManager.getFont( "defaultFont" ) ) { + // dump "$defaultFont" for the default font to make it easier to + // compare Windows/Linux dumps with macOS dumps + out.print( "$defaultFont" ); + if( realValue instanceof UIResource ) + out.print( " [UI]" ); + } else + dumpValue( out, realValue ); } private String dumpClass( Object value ) { diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsKeysDump.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsKeysDump.java new file mode 100644 index 00000000..b0abaa38 --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsKeysDump.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.testing.uidefaults; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import com.formdev.flatlaf.*; + +/** + * Collects all FlatLaf UI defaults keys and dumps them to a file. + * + * @author Karl Tauber + */ +public class UIDefaultsKeysDump +{ + public static void main( String[] args ) { + Locale.setDefault( Locale.ENGLISH ); + System.setProperty( "sun.java2d.uiScale", "1x" ); + System.setProperty( FlatSystemProperties.UI_SCALE, "1x" ); + + File keysFile = new File( "../flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt" ); + + HashSet keys = new HashSet<>(); + + collectKeys( FlatLightLaf.class.getName(), keys ); + collectKeys( FlatDarkLaf.class.getName(), keys ); + collectKeys( FlatIntelliJLaf.class.getName(), keys ); + collectKeys( FlatDarculaLaf.class.getName(), keys ); + + try( Writer fileWriter = new BufferedWriter( new FileWriter( keysFile ) ) ) { + String[] sortedKeys = keys.toArray( new String[keys.size()] ); + Arrays.sort( sortedKeys ); + for( String key : sortedKeys ) { + fileWriter.write( key ); + fileWriter.write( "\n" ); + } + } catch( IOException ex ) { + ex.printStackTrace(); + } + } + + private static void collectKeys( String lookAndFeelClassName, HashSet keys ) { + try { + UIManager.setLookAndFeel( lookAndFeelClassName ); + } catch( Exception ex ) { + ex.printStackTrace(); + return; + } + + UIDefaults defaults = UIManager.getLookAndFeel().getDefaults(); + + for( Object key : defaults.keySet() ) { + if( key instanceof String ) + keys.add( (String) key ); + } + } +} diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties index b70f564d..109fb330 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/FlatTestLaf.properties @@ -16,16 +16,20 @@ #---- variables ---- -@background=#ccffcc -@foreground=#ff0000 -@selectionBackground=#00aa00 -@selectionForeground=#ffff00 -@selectionInactiveBackground=#888888 -@selectionInactiveForeground=#ffffff -@disabledText=#000088 -@textComponentBackground=#ffffff +@background=#cfc +@foreground=#f00 +@selectionBackground=#0a0 +@selectionForeground=#ff0 +@selectionInactiveBackground=#888 +@selectionInactiveForeground=#fff +@disabledText=#008 +@textComponentBackground=#fff @menuBackground=#fff -@cellFocusColor=#ff0000 +@menuHoverBackground=darken(@menuBackground,10%) +@menuCheckBackground=#ccf +@menuAcceleratorForeground=#f88 +@menuAcceleratorSelectionForeground=#fff +@cellFocusColor=#f00 @icon=#afafaf @dropCellBackground=#f00 @@ -36,20 +40,10 @@ #---- globals ---- -*.background=@background -*.foreground=@foreground -*.textBackground=#ccffcc -*.textForeground=#ff0000 -*.caretForeground=#0000ff +*.caretForeground=#00f *.inactiveBackground=#f0f0f0 -*.inactiveForeground=#000088 -*.selectionBackground=@selectionBackground -*.selectionForeground=@selectionForeground +*.inactiveForeground=#008 *.disabledBackground=#e0e0e0 -*.disabledForeground=@disabledText -*.disabledText=@disabledText -*.acceleratorForeground=#ff8888 -*.acceleratorSelectionForeground=#ffffff #---- system colors ---- @@ -66,68 +60,78 @@ controlDkShadow=#696969 Button.startBackground=#fff Button.endBackground=#bbb -Button.focusedBackground=#00ffff -Button.hoverBackground=#ffff00 +Button.focusedBackground=#0ff +Button.hoverBackground=#ff0 Button.pressedBackground=#FFC800 Button.startBorderColor=#00f Button.endBorderColor=#f00 -Button.disabledBorderColor=#000088 +Button.disabledBorderColor=#008 Button.focusedBorderColor=#466d94 -Button.hoverBorderColor=#ff0000 +Button.hoverBorderColor=#f00 Button.default.startBackground=#ddd Button.default.endBackground=#888 -Button.default.foreground=#880000 -Button.default.focusedBackground=#00ffff -Button.default.hoverBackground=#ffff00 +Button.default.foreground=#800 +Button.default.focusedBackground=#0ff +Button.default.hoverBackground=#ff0 Button.default.pressedBackground=#FFC800 Button.default.startBorderColor=#f00 Button.default.endBorderColor=#00f -Button.default.hoverBorderColor=#ff0000 +Button.default.hoverBorderColor=#f00 Button.default.focusedBorderColor=#537699 -Button.default.focusColor=#ff0000 +Button.default.focusColor=#f00 -Button.toolbar.hoverBackground=#ffffff -Button.toolbar.pressedBackground=#eeeeee +Button.toolbar.hoverBackground=#fff +Button.toolbar.pressedBackground=#eee #---- CheckBox ---- +# enabled CheckBox.icon.borderColor=#878787 -CheckBox.icon.disabledBorderColor=#BDBDBD +CheckBox.icon.background=#fff CheckBox.icon.selectedBorderColor=#4982CC -CheckBox.icon.focusedBorderColor=#7B9FC7 -CheckBox.icon.hoverBorderColor=#ff0000 -CheckBox.icon.selectedFocusedBorderColor=#ACCFF7 -CheckBox.icon.background=#FFFFFF -CheckBox.icon.disabledBackground=#F2F2F2 -CheckBox.icon.focusedBackground=#00ffff -CheckBox.icon.hoverBackground=#ffff00 -CheckBox.icon.pressedBackground=#FFC800 CheckBox.icon.selectedBackground=#4D89C9 -CheckBox.icon.checkmarkColor=#FFFFFF +CheckBox.icon.checkmarkColor=#fff + +# disabled +CheckBox.icon.disabledBorderColor=#BDBDBD +CheckBox.icon.disabledBackground=#F2F2F2 CheckBox.icon.disabledCheckmarkColor=#ABABAB +# focused +CheckBox.icon.focusedBorderColor=#7B9FC7 +CheckBox.icon.focusedBackground=#0ff +CheckBox.icon.selectedFocusedBorderColor=#ACCFF7 + +# hover +CheckBox.icon.hoverBorderColor=#f00 +CheckBox.icon.hoverBackground=#ff0 + +# pressed +CheckBox.icon.pressedBackground=#FFC800 + #---- ComboBox ---- -ComboBox.background=#ffffff +ComboBox.background=#fff ComboBox.buttonBackground=#f0f0f0 -ComboBox.buttonEditableBackground=#cccccc -ComboBox.buttonArrowColor=#666666 +ComboBox.buttonEditableBackground=#ccc +ComboBox.buttonArrowColor=#666 ComboBox.buttonDisabledArrowColor=#ABABAB -ComboBox.buttonHoverArrowColor=#ff0000 +ComboBox.buttonHoverArrowColor=#f00 #---- Component ---- -Component.borderColor=#ff0000 -Component.disabledBorderColor=#000088 +Component.borderColor=#f00 +Component.disabledBorderColor=#008 Component.focusedBorderColor=#466d94 Component.focusColor=#97c3f3 #Component.focusWidth=5 #Component.arc=8 +Component.grayFilter=25,25,100 #---- Desktop ---- @@ -142,7 +146,7 @@ DesktopIcon.background=darken($Desktop.background,20%) #---- HelpButton ---- -HelpButton.questionMarkColor=#0000ff +HelpButton.questionMarkColor=#00f #---- InternalFrame ---- @@ -165,16 +169,16 @@ InternalFrame.closePressedForeground=#fff #---- Label ---- -Label.foreground=#008800 -Label.disabledForeground=#000088 +Label.foreground=#080 +Label.disabledForeground=#008 #---- List ---- List.background=#f0ffff List.cellNoFocusBorder=1,6,1,6 -List.focusSelectedCellHighlightBorder=1,6,1,6,#880000 -List.focusCellHighlightBorder=1,6,1,6,#880000 +List.focusSelectedCellHighlightBorder=1,6,1,6,#800 +List.focusCellHighlightBorder=1,6,1,6,#800 #---- Menu ---- @@ -185,7 +189,7 @@ Menu.icon.disabledArrowColor=#ABABAB #---- MenuBar ---- -MenuBar.borderColor=#4444ff +MenuBar.borderColor=#44f MenuBar.hoverBackground=#fdd @@ -197,19 +201,26 @@ MenuItemCheckBox.icon.disabledCheckmarkColor=#ABABAB #---- OptionPane ---- -OptionPane.background=#ffdddd -OptionPane.foreground=#ff0000 +OptionPane.background=#fdd +OptionPane.foreground=#f00 -OptionPane.icon.errorColor=#ff0000 -OptionPane.icon.informationColor=#00ff00 -OptionPane.icon.questionColor=#0000ff -OptionPane.icon.warningColor=#ffcc00 -OptionPane.icon.foreground=#ffffff +OptionPane.icon.errorColor=#f00 +OptionPane.icon.informationColor=#0f0 +OptionPane.icon.questionColor=#00f +OptionPane.icon.warningColor=#fc0 +OptionPane.icon.foreground=#fff + + +#---- Popup ---- + +Popup.dropShadowColor=#0f0 +Popup.dropShadowOpacity=0.5 +Popup.dropShadowInsets=-6,6,6,6 #---- PopupMenu ---- -PopupMenu.borderColor=#0000ff +PopupMenu.borderColor=#00f #---- PopupMenuSeparator ---- @@ -221,24 +232,24 @@ PopupMenuSeparator.stripeIndent=1 #---- ProgressBar ---- -ProgressBar.background=#88ff88 +ProgressBar.background=#8f8 ProgressBar.foreground=#73737333 -ProgressBar.selectionForeground=#ff0000 -ProgressBar.selectionBackground=#000088 +ProgressBar.selectionForeground=#f00 +ProgressBar.selectionBackground=#008 ProgressBar.cycleTime=10000 #---- ScrollBar ---- -ScrollBar.track=#88ff88 +ScrollBar.track=#8f8 ScrollBar.thumb=#73737333 -ScrollBar.hoverTrackColor=#00ff00 -ScrollBar.hoverThumbColor=#ff0000 +ScrollBar.hoverTrackColor=#0f0 +ScrollBar.hoverThumbColor=#f00 #---- Separator ---- -Separator.foreground=#00bb00 +Separator.foreground=#0b0 Separator.height=20 Separator.stripeWidth=10 Separator.stripeIndent=5 @@ -246,77 +257,99 @@ Separator.stripeIndent=5 #---- Slider ---- -Slider.trackColor=#00bb00 -Slider.thumbColor=#880000 -Slider.tickColor=#ff0000 +Slider.trackColor=#0b0 +Slider.thumbColor=#800 +Slider.tickColor=#f00 Slider.focusedColor=$Component.focusColor -Slider.hoverColor=#0000ff -Slider.disabledForeground=#000088 +Slider.hoverColor=#00f +Slider.disabledForeground=#008 #---- SplitPane ---- -SplitPaneDivider.draggingColor=#880000 -SplitPaneDivider.oneTouchArrowColor=#00ff00 -SplitPaneDivider.oneTouchHoverArrowColor=#ff0000 +SplitPaneDivider.draggingColor=#800 +SplitPaneDivider.oneTouchArrowColor=#0f0 +SplitPaneDivider.oneTouchHoverArrowColor=#f00 #---- TabbedPane ---- -TabbedPane.disabledForeground=#777777 +TabbedPane.disabledForeground=#777 TabbedPane.selectedBackground=#0f0 TabbedPane.selectedForeground=#00f -TabbedPane.underlineColor=#4A88C7 +TabbedPane.underlineColor=#ff0 TabbedPane.disabledUnderlineColor=#7a7a7a -TabbedPane.hoverColor=#eeeeee -TabbedPane.focusColor=#dddddd +TabbedPane.hoverColor=#eee +TabbedPane.focusColor=#ddd TabbedPane.tabSeparatorColor=#00f -TabbedPane.contentAreaColor=#bbbbbb +TabbedPane.contentAreaColor=#f00 + +TabbedPane.closeSize=16,16 +TabbedPane.closeArc=999 +TabbedPane.closeCrossPlainSize={float}12 +TabbedPane.closeCrossFilledSize={float}6.5 +TabbedPane.closeCrossLineWidth={float}2 +#TabbedPane.closeBackground=#faa +TabbedPane.closeForeground=#f00 +TabbedPane.closeHoverBackground=#a00 +TabbedPane.closeHoverForeground=#fff +TabbedPane.closePressedBackground=#0f0 +TabbedPane.closePressedForeground=#000 #---- Table ---- Table.rowHeight=25 Table.background=#fffff0 -Table.sortIconColor=#ffff00 -Table.gridColor=#00ffff +Table.sortIconColor=#ff0 +Table.gridColor=#0ff #---- TableHeader ---- -TableHeader.background=#4444ff -TableHeader.foreground=#ffffff -TableHeader.separatorColor=#00ff00 -TableHeader.bottomSeparatorColor=#00ff00 +TableHeader.background=#44f +TableHeader.foreground=#fff +TableHeader.separatorColor=#0f0 +TableHeader.bottomSeparatorColor=#0f0 #---- TitledBorder ---- -TitledBorder.titleColor=#ff00ff -TitledBorder.border=1,1,1,1,#ff00ff +TitledBorder.titleColor=#f0f +TitledBorder.border=1,1,1,1,#f0f + + +#---- TitlePane ---- + +TitlePane.background=#0f0 +TitlePane.inactiveBackground=#080 +TitlePane.foreground=#00f +TitlePane.inactiveForeground=#fff #---- ToggleButton ---- -ToggleButton.background=#ddddff -ToggleButton.selectedBackground=#44ff44 -ToggleButton.selectedForeground=#000000 -ToggleButton.disabledSelectedBackground=#44dd44 +ToggleButton.background=#ddf +ToggleButton.selectedBackground=#4f4 +ToggleButton.selectedForeground=#000 +ToggleButton.disabledSelectedBackground=#4d4 -ToggleButton.focusedBackground=#00ffff -ToggleButton.hoverBackground=#ffff00 +ToggleButton.focusedBackground=#0ff +ToggleButton.hoverBackground=#ff0 ToggleButton.pressedBackground=#FFC800 -ToggleButton.toolbar.selectedBackground=#dddddd +ToggleButton.toolbar.selectedBackground=#ddd #---- ToolTip ---- -ToolTip.background=#eeeeff +ToolTip.background=#eef #---- Tree ---- Tree.background=#fff0ff Tree.paintLines=true -Tree.hash=#ff0000 +Tree.hash=#f00 +Tree.editorBorder=1,1,1,1,#f00 +Tree.editorBorderSelectionColor=#00f diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatDarkLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatDarkLaf.properties new file mode 100644 index 00000000..0228f31a --- /dev/null +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatDarkLaf.properties @@ -0,0 +1 @@ +# @background=#000 diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLaf.properties new file mode 100644 index 00000000..cc1b0e74 --- /dev/null +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLaf.properties @@ -0,0 +1,2 @@ +# Component.arc=9999 +# TextComponent.arc=9999 diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLightLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLightLaf.properties new file mode 100644 index 00000000..33afe328 --- /dev/null +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/customdefaults/FlatLightLaf.properties @@ -0,0 +1 @@ +# @background=#fff diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/LICENSE.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/LICENSE.txt new file mode 100644 index 00000000..bc63f393 --- /dev/null +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/LICENSE.txt @@ -0,0 +1,12 @@ +The icons in this folder starting with 'intellij-' are from IntelliJ IDEA Community Edition, +which is licensed under the Apache 2.0 license. Copyright 2000-2020 JetBrains s.r.o. +See: https://github.com/JetBrains/intellij-community/ + +The icons in this folder starting with 'netbeans-' are from Apache NetBeans, +which is licensed under the Apache 2.0 license to the Apache Software Foundation (ASF). +See: https://github.com/apache/netbeans/ + +zip128.png is from +http://www.iconarchive.com/show/plump-icons-by-zerode/Folder-Archive-zip-icon.html +License: Free for non-commercial use. +Commercial usage: Not allowed diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut.png new file mode 100644 index 00000000..c49ce722 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut@2x.png new file mode 100644 index 00000000..72ba5d31 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark.png new file mode 100644 index 00000000..50afa7b9 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark@2x.png new file mode 100644 index 00000000..d2b603cb Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png new file mode 100644 index 00000000..0563a7ab Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png new file mode 100644 index 00000000..9df8e303 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark.png new file mode 100644 index 00000000..54e1b03e Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark@2x.png new file mode 100644 index 00000000..fc404c0e Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search.png new file mode 100644 index 00000000..2b2b1b9c Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search@2x.png new file mode 100644 index 00000000..fa13a324 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark.png new file mode 100644 index 00000000..bdfa83e5 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark@2x.png new file mode 100644 index 00000000..33db2a48 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show.png new file mode 100644 index 00000000..06c417d3 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show@2x.png new file mode 100644 index 00000000..63ca47e5 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png new file mode 100644 index 00000000..9857cce2 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess@2x.png new file mode 100644 index 00000000..682bc81f Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark.png new file mode 100644 index 00000000..d24cc28b Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark@2x.png new file mode 100644 index 00000000..48c41156 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png new file mode 100644 index 00000000..c006c56f Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess@2x.png new file mode 100644 index 00000000..b1a2398e Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark.png new file mode 100644 index 00000000..f1738ad4 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark@2x.png new file mode 100644 index 00000000..a17a1529 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark.png new file mode 100644 index 00000000..d758d2e8 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark@2x.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark@2x.png new file mode 100644 index 00000000..28176a1b Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark@2x.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif new file mode 100644 index 00000000..5a50e326 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif new file mode 100644 index 00000000..2520d4ec Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif new file mode 100644 index 00000000..7424e382 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif new file mode 100644 index 00000000..65c0ec02 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif new file mode 100644 index 00000000..e4288af1 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif new file mode 100644 index 00000000..e2c01c01 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png new file mode 100644 index 00000000..0fd07dbd Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties index 1e6639ae..a917c807 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/swingx/FlatTestLaf.properties @@ -16,59 +16,59 @@ #---- BusyLabel ---- -JXBusyLabel.baseColor=#00ff00 -JXBusyLabel.highlightColor=#ff0000 +JXBusyLabel.baseColor=#0f0 +JXBusyLabel.highlightColor=#f00 #---- Header ---- -JXHeader.background=#ff8888 -JXHeader.startBackground=#ffcccc -JXHeader.titleForeground=#0000ff -JXHeader.descriptionForeground=#ff0000 +JXHeader.background=#f88 +JXHeader.startBackground=#fcc +JXHeader.titleForeground=#00f +JXHeader.descriptionForeground=#f00 #---- Hyperlink ---- -Hyperlink.linkColor=#ff0000 -Hyperlink.visitedColor=#0000ff -Hyperlink.disabledText=#000088 +Hyperlink.linkColor=#f00 +Hyperlink.visitedColor=#00f +Hyperlink.disabledText=#008 #---- MonthView ---- JXMonthView.background=@textComponentBackground -JXMonthView.monthStringBackground=#00ff00 -JXMonthView.monthStringForeground=#0000ff -JXMonthView.daysOfTheWeekForeground=#00ff00 -JXMonthView.weekOfTheYearForeground=#0000ff -JXMonthView.unselectableDayForeground=#0000ff -JXMonthView.selectedBackground=#aaffaa -JXMonthView.flaggedDayForeground=#00ffff +JXMonthView.monthStringBackground=#0f0 +JXMonthView.monthStringForeground=#00f +JXMonthView.daysOfTheWeekForeground=#0f0 +JXMonthView.weekOfTheYearForeground=#00f +JXMonthView.unselectableDayForeground=#00f +JXMonthView.selectedBackground=#afa +JXMonthView.flaggedDayForeground=#0ff JXMonthView.leadingDayForeground=#c0c0c0 JXMonthView.trailingDayForeground=#c0c0c0 -JXMonthView.arrowColor=#0000ff +JXMonthView.arrowColor=#00f JXMonthView.disabledArrowColor=#ABABAB #---- TaskPaneContainer ---- -TaskPaneContainer.background=#ff8888 +TaskPaneContainer.background=#f88 TaskPaneContainer.border=10,10,10,10 #---- TaskPane ---- -TaskPane.background=#00ff00 -TaskPane.borderColor=#0000ff +TaskPane.background=#0f0 +TaskPane.borderColor=#00f TaskPane.contentInsets=10,10,10,10 -TaskPane.titleBackgroundGradientStart=#ffff00 -TaskPane.titleForeground=#ff00ff -TaskPane.titleOver=#0000aa -TaskPane.specialTitleBackground=#00ffff -TaskPane.specialTitleForeground=#444444 -TaskPane.specialTitleOver=#dd0000 +TaskPane.titleBackgroundGradientStart=#ff0 +TaskPane.titleForeground=#f0f +TaskPane.titleOver=#00a +TaskPane.specialTitleBackground=#0ff +TaskPane.specialTitleForeground=#444 +TaskPane.specialTitleOver=#d00 #---- TitledPanel ---- diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test128.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test128.png new file mode 100644 index 00000000..b26ffcea Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test128.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test16.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test16.png new file mode 100644 index 00000000..2e0e2727 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test16.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test24.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test24.png new file mode 100644 index 00000000..bb6da8bf Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test24.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test32.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test32.png new file mode 100644 index 00000000..1cf56f82 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test32.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test48.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test48.png new file mode 100644 index 00000000..9641e283 Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test48.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test64.png b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test64.png new file mode 100644 index 00000000..ad67439b Binary files /dev/null and b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/test64.png differ diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt deleted file mode 100644 index 069e8b8e..00000000 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202-mac.txt +++ /dev/null @@ -1,1195 +0,0 @@ -Class com.formdev.flatlaf.FlatDarkLaf -ID FlatLaf - Flat Dark -Name Flat Dark -Java 1.8.0_202 -OS Mac OS X - - -#---- ---- - -AATextInfoPropertyKey [unknown type] sun.swing.SwingUtilities2$AATextInfo - - -#---- Actions ---- - -Actions.Blue #3592c4 javax.swing.plaf.ColorUIResource [UI] -Actions.Green #499c54 javax.swing.plaf.ColorUIResource [UI] -Actions.Grey #afb1b3 javax.swing.plaf.ColorUIResource [UI] -Actions.GreyInline #7f8b91 javax.swing.plaf.ColorUIResource [UI] -Actions.Red #c75450 javax.swing.plaf.ColorUIResource [UI] -Actions.Yellow #f0a732 javax.swing.plaf.ColorUIResource [UI] - - -#---- AuditoryCues ---- - -AuditoryCues.allAuditoryCues length=13 [Ljava.lang.Object; - [0] CheckBoxMenuItem.commandSound - [1] InternalFrame.closeSound - [2] InternalFrame.maximizeSound - [3] InternalFrame.minimizeSound - [4] InternalFrame.restoreDownSound - [5] InternalFrame.restoreUpSound - [6] MenuItem.commandSound - [7] OptionPane.errorSound - [8] OptionPane.informationSound - [9] OptionPane.questionSound - [10] OptionPane.warningSound - [11] PopupMenu.popupSound - [12] RadioButtonMenuItem.commandSound -AuditoryCues.cueList length=13 [Ljava.lang.Object; - [0] CheckBoxMenuItem.commandSound - [1] InternalFrame.closeSound - [2] InternalFrame.maximizeSound - [3] InternalFrame.minimizeSound - [4] InternalFrame.restoreDownSound - [5] InternalFrame.restoreUpSound - [6] MenuItem.commandSound - [7] OptionPane.errorSound - [8] OptionPane.informationSound - [9] OptionPane.questionSound - [10] OptionPane.warningSound - [11] PopupMenu.popupSound - [12] RadioButtonMenuItem.commandSound -AuditoryCues.noAuditoryCues length=1 [Ljava.lang.Object; - [0] mute - - -#---- BusyLabel ---- - -BusyLabelUI com.formdev.flatlaf.swingx.ui.FlatBusyLabelUI - - -#---- Button ---- - -Button.arc 6 -Button.background #4c5052 javax.swing.plaf.ColorUIResource [UI] -Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] -Button.borderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] -Button.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -Button.default.background #365880 javax.swing.plaf.ColorUIResource [UI] -Button.default.boldText true -Button.default.borderColor #4c708c javax.swing.plaf.ColorUIResource [UI] -Button.default.borderWidth 1 -Button.default.focusColor #43688c javax.swing.plaf.ColorUIResource [UI] -Button.default.focusedBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] -Button.default.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Button.default.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.default.hoverBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] -Button.default.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.defaultButtonFollowsFocus false -Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] -Button.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Button.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Button.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Button.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -Button.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Button.iconTextGap 4 -Button.light #313131 javax.swing.plaf.ColorUIResource [UI] -Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] -Button.minimumWidth 72 -Button.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Button.rollover true -Button.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -Button.textIconGap 4 -Button.textShiftOffset 0 -Button.toolbar.hoverBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] -Button.toolbar.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -Button.toolbar.pressedBackground #555a5d javax.swing.plaf.ColorUIResource [UI] -Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] -ButtonUI com.formdev.flatlaf.ui.FlatButtonUI - - -#---- Caret ---- - -Caret.width [active] 1 - - -#---- CheckBox ---- - -CheckBox.arc 4 -CheckBox.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -CheckBox.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -CheckBox.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.background #43494a javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.borderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.checkmarkColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.disabledBorderColor #545556 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.disabledCheckmarkColor #606060 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -CheckBox.icon.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -CheckBox.icon.selectedBackground #43494a javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.selectedBorderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon.selectedFocusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -CheckBox.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxIcon [UI] -CheckBox.iconTextGap 4 -CheckBox.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] -CheckBox.rollover true -CheckBox.textIconGap 4 -CheckBox.textShiftOffset 0 - - -#---- CheckBoxMenuItem ---- - -CheckBoxMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] -CheckBoxMenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] -CheckBoxMenuItem.borderPainted true -CheckBoxMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon [UI] -CheckBoxMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -CheckBoxMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] -CheckBoxMenuItem.opaque false -CheckBoxMenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -CheckBoxMenuItemUI com.formdev.flatlaf.ui.FlatCheckBoxMenuItemUI - - -#---- CheckBox ---- - -CheckBoxUI com.formdev.flatlaf.ui.FlatCheckBoxUI - - -#---- ColorChooser ---- - -ColorChooser.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ColorChooser.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ColorChooser.swatchesDefaultRecentColor #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ColorChooser.swatchesRecentSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] -ColorChooser.swatchesSwatchSize [active] 16,16 javax.swing.plaf.DimensionUIResource [UI] -ColorChooserUI com.formdev.flatlaf.ui.FlatColorChooserUI - - -#---- ComboBox ---- - -ComboBox.background #45494a javax.swing.plaf.ColorUIResource [UI] -ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] -ComboBox.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonBackground #45494a javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonDarkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonDisabledArrowColor #585858 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonEditableBackground #404445 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonHighlight #242424 javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ComboBox.buttonShadow #646464 javax.swing.plaf.ColorUIResource [UI] -ComboBox.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ComboBox.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ComboBox.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ComboBox.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ComboBox.isEnterSelectablePopup false -ComboBox.noActionOnKeyNavigation false -ComboBox.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -ComboBox.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -ComboBox.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ComboBox.timeFactor 1000 -ComboBoxUI com.formdev.flatlaf.ui.FlatComboBoxUI - - -#---- Component ---- - -Component.arc 5 -Component.arrowType chevron -Component.borderColor #646464 javax.swing.plaf.ColorUIResource [UI] -Component.disabledBorderColor #646464 javax.swing.plaf.ColorUIResource [UI] -Component.focusColor #3d6185 javax.swing.plaf.ColorUIResource [UI] -Component.focusWidth 0 -Component.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -Component.hideMnemonics true -Component.innerFocusWidth 0.5 -Component.linkColor #589df6 javax.swing.plaf.ColorUIResource [UI] -Component.minimumWidth 64 - - -#---- DatePicker ---- - -DatePickerUI com.formdev.flatlaf.swingx.ui.FlatDatePickerUI - - -#---- Desktop ---- - -Desktop.background #3e434c javax.swing.plaf.ColorUIResource [UI] -Desktop.minOnScreenInsets 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] - - -#---- DesktopIcon ---- - -DesktopIcon.background #555c68 javax.swing.plaf.ColorUIResource [UI] -DesktopIcon.border [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -DesktopIcon.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] -DesktopIcon.closeSize 20,20 javax.swing.plaf.DimensionUIResource [UI] -DesktopIcon.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -DesktopIcon.iconSize 64,64 javax.swing.plaf.DimensionUIResource [UI] -DesktopIconUI com.formdev.flatlaf.ui.FlatDesktopIconUI - - -#---- DesktopPane ---- - -DesktopPaneUI com.formdev.flatlaf.ui.FlatDesktopPaneUI - - -#---- EditorPane ---- - -EditorPane.background #45494a javax.swing.plaf.ColorUIResource [UI] -EditorPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -EditorPane.caretBlinkRate 500 -EditorPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -EditorPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -EditorPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -EditorPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -EditorPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -EditorPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -EditorPane.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -EditorPane.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -EditorPaneUI com.formdev.flatlaf.ui.FlatEditorPaneUI - - -#---- FileChooser ---- - -FileChooser.detailsViewIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserDetailsViewIcon [UI] -FileChooser.homeFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserHomeFolderIcon [UI] -FileChooser.listViewIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserListViewIcon [UI] -FileChooser.newFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserNewFolderIcon [UI] -FileChooser.readOnly false -FileChooser.upFolderIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileChooserUpFolderIcon [UI] -FileChooser.useSystemExtensionHiding false -FileChooser.usesSingleFilePane true -FileChooserUI com.formdev.flatlaf.ui.FlatFileChooserUI - - -#---- FileView ---- - -FileView.computerIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewComputerIcon [UI] -FileView.directoryIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewDirectoryIcon [UI] -FileView.fileIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFileIcon [UI] -FileView.floppyDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon [UI] -FileView.hardDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon [UI] - - -#---- FormattedTextField ---- - -FormattedTextField.background #45494a javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] -FormattedTextField.caretBlinkRate 500 -FormattedTextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -FormattedTextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -FormattedTextField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -FormattedTextField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -FormattedTextFieldUI com.formdev.flatlaf.ui.FlatFormattedTextFieldUI - - -#---- Header ---- - -HeaderUI com.formdev.flatlaf.swingx.ui.FlatHeaderUI - - -#---- HelpButton ---- - -HelpButton.background #43494a javax.swing.plaf.ColorUIResource [UI] -HelpButton.borderColor #6b6b6b javax.swing.plaf.ColorUIResource [UI] -HelpButton.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -HelpButton.disabledBorderColor #545556 javax.swing.plaf.ColorUIResource [UI] -HelpButton.disabledQuestionMarkColor #606060 javax.swing.plaf.ColorUIResource [UI] -HelpButton.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -HelpButton.hoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -HelpButton.hoverBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] -HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI] -HelpButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -HelpButton.questionMarkColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] - - -#---- Hyperlink ---- - -Hyperlink.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -Hyperlink.linkColor #589df6 javax.swing.plaf.ColorUIResource [UI] -Hyperlink.visitedColor #589df6 javax.swing.plaf.ColorUIResource [UI] -HyperlinkUI com.formdev.flatlaf.swingx.ui.FlatHyperlinkUI - - -#---- InternalFrame ---- - -InternalFrame.activeBorderColor #7e7e7e javax.swing.plaf.ColorUIResource [UI] -InternalFrame.activeTitleBackground #242526 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.activeTitleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -InternalFrame.border [lazy] 6,6,6,6 false com.formdev.flatlaf.ui.FlatInternalFrameUI$FlatInternalFrameBorder [UI] -InternalFrame.borderColor #3c3f41 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.borderDarkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -InternalFrame.borderHighlight #242424 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.borderLight #313131 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.borderLineWidth 1 -InternalFrame.borderMargins 6,6,6,6 javax.swing.plaf.InsetsUIResource [UI] -InternalFrame.borderShadow #646464 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.buttonHoverBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -InternalFrame.buttonPressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -InternalFrame.buttonSize 24,24 javax.swing.plaf.DimensionUIResource [UI] -InternalFrame.closeHoverBackground [lazy] #c75450 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.closeHoverForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -InternalFrame.closeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon [UI] -InternalFrame.closePressedBackground [lazy] #ad3b37 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI] -InternalFrame.icon [lazy] 16,16 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) -InternalFrame.iconifyIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameIconifyIcon [UI] -InternalFrame.inactiveBorderColor #646464 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.inactiveTitleBackground #303234 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.inactiveTitleForeground #777777 javax.swing.plaf.ColorUIResource [UI] -InternalFrame.maximizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMaximizeIcon [UI] -InternalFrame.minimizeIcon [lazy] 24,24 com.formdev.flatlaf.icons.FlatInternalFrameMinimizeIcon [UI] -InternalFrame.titleFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] - - -#---- InternalFrameTitlePane ---- - -InternalFrameTitlePane.border [lazy] 0,8,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -InternalFrameTitlePane.closeButtonOpacity true -InternalFrameTitlePane.iconifyButtonOpacity true -InternalFrameTitlePane.maximizeButtonOpacity true - - -#---- InternalFrame ---- - -InternalFrameUI com.formdev.flatlaf.ui.FlatInternalFrameUI - - -#---- JXBusyLabel ---- - -JXBusyLabel.baseColor #777777 javax.swing.plaf.ColorUIResource [UI] -JXBusyLabel.highlightColor #e0e0e0 javax.swing.plaf.ColorUIResource [UI] - - -#---- JXDatePicker ---- - -JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI] - - -#---- JXHeader ---- - -JXHeader.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -JXHeader.startBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] - - -#---- JXMonthView ---- - -JXMonthView.arrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] -JXMonthView.background #45494a javax.swing.plaf.ColorUIResource [UI] -JXMonthView.daysOfTheWeekForeground #aaaaaa javax.swing.plaf.ColorUIResource [UI] -JXMonthView.disabledArrowColor #777777 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.flaggedDayForeground #e05555 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.leadingDayForeground #777777 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.monthDownFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthDownIcon [UI] -JXMonthView.monthStringBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.monthStringForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -JXMonthView.monthUpFileName [lazy] 20,20 com.formdev.flatlaf.swingx.ui.FlatMonthUpIcon [UI] -JXMonthView.selectedBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -JXMonthView.trailingDayForeground #777777 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.unselectableDayForeground #e05555 javax.swing.plaf.ColorUIResource [UI] -JXMonthView.weekOfTheYearForeground #888888 javax.swing.plaf.ColorUIResource [UI] - - -#---- JXTitledPanel ---- - -JXTitledPanel.borderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] -JXTitledPanel.captionInsets 4,10,4,10 javax.swing.plaf.InsetsUIResource [UI] -JXTitledPanel.titleBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] -JXTitledPanel.titleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] - - -#---- JideTabbedPane ---- - -JideTabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.contentBorderInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.tabAreaBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] -JideTabbedPane.tabRunOverlay 0 -JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI - - -#---- Label ---- - -Label.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Label.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Label.disabledShadow #646464 javax.swing.plaf.ColorUIResource [UI] -Label.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Label.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -LabelUI com.formdev.flatlaf.ui.FlatLabelUI - - -#---- List ---- - -List.background #45494a javax.swing.plaf.ColorUIResource [UI] -List.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -List.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] -List.cellMargins 1,6,1,6 javax.swing.plaf.InsetsUIResource [UI] -List.cellNoFocusBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Default [UI] -List.cellRenderer [active] javax.swing.DefaultListCellRenderer$UIResource [UI] -List.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] -List.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] -List.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] -List.focusCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Focused [UI] -List.focusSelectedCellHighlightBorder [lazy] 1,6,1,6 false com.formdev.flatlaf.ui.FlatListCellBorder$Selected [UI] -List.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -List.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -List.noFocusBorder 1,1,1,1 false javax.swing.plaf.BorderUIResource$EmptyBorderUIResource [UI] -List.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -List.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -List.selectionInactiveBackground #0d293e javax.swing.plaf.ColorUIResource [UI] -List.selectionInactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -List.timeFactor 1000 -ListUI com.formdev.flatlaf.ui.FlatListUI - - -#---- Menu ---- - -Menu.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Menu.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Menu.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Menu.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuArrowIcon [UI] -Menu.background #303234 javax.swing.plaf.ColorUIResource [UI] -Menu.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] -Menu.borderPainted true -Menu.cancelMode hideLastSubmenu -Menu.crossMenuMnemonic true -Menu.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Menu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Menu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Menu.icon.arrowColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] -Menu.icon.disabledArrowColor #606060 javax.swing.plaf.ColorUIResource [UI] -Menu.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] -Menu.menuPopupOffsetX 0 -Menu.menuPopupOffsetY 0 -Menu.opaque false -Menu.preserveTopLevelSelection false -Menu.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -Menu.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Menu.shortcutKeys length=1 [I - [0] 10 -Menu.submenuPopupOffsetX [active] -4 -Menu.submenuPopupOffsetY [active] -4 - - -#---- MenuBar ---- - -MenuBar.background #303234 javax.swing.plaf.ColorUIResource [UI] -MenuBar.border [lazy] 0,0,1,0 false com.formdev.flatlaf.ui.FlatMenuBarBorder [UI] -MenuBar.borderColor #515151 javax.swing.plaf.ColorUIResource [UI] -MenuBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -MenuBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -MenuBar.hoverBackground #484c4f javax.swing.plaf.ColorUIResource [UI] -MenuBar.itemMargins 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI] -MenuBar.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -MenuBar.windowBindings length=2 [Ljava.lang.Object; - [0] F10 - [1] takeFocus -MenuBarUI com.formdev.flatlaf.ui.FlatMenuBarUI - - -#---- MenuItem ---- - -MenuItem.acceleratorDelimiter -MenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -MenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] -MenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] -MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] -MenuItem.borderPainted true -MenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -MenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -MenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -MenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] -MenuItem.opaque false -MenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -MenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] - - -#---- MenuItemCheckBox ---- - -MenuItemCheckBox.icon.checkmarkColor #a7a7a7 javax.swing.plaf.ColorUIResource [UI] -MenuItemCheckBox.icon.disabledCheckmarkColor #606060 javax.swing.plaf.ColorUIResource [UI] - - -#---- MenuItem ---- - -MenuItemUI com.formdev.flatlaf.ui.FlatMenuItemUI - - -#---- Menu ---- - -MenuUI com.formdev.flatlaf.ui.FlatMenuUI - - -#---- MonthView ---- - -MonthViewUI com.formdev.flatlaf.swingx.ui.FlatMonthViewUI - - -#---- Objects ---- - -Objects.BlackText #231f20 javax.swing.plaf.ColorUIResource [UI] -Objects.Blue #40b6e0 javax.swing.plaf.ColorUIResource [UI] -Objects.Green #62b543 javax.swing.plaf.ColorUIResource [UI] -Objects.GreenAndroid #a4c639 javax.swing.plaf.ColorUIResource [UI] -Objects.Grey #9aa7b0 javax.swing.plaf.ColorUIResource [UI] -Objects.Pink #f98b9e javax.swing.plaf.ColorUIResource [UI] -Objects.Purple #b99bf8 javax.swing.plaf.ColorUIResource [UI] -Objects.Red #f26522 javax.swing.plaf.ColorUIResource [UI] -Objects.RedStatus #e05555 javax.swing.plaf.ColorUIResource [UI] -Objects.Yellow #f4af3d javax.swing.plaf.ColorUIResource [UI] -Objects.YellowDark #d9a343 javax.swing.plaf.ColorUIResource [UI] - - -#---- OptionPane ---- - -OptionPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -OptionPane.border [lazy] 12,12,12,12 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -OptionPane.buttonAreaBorder [lazy] 12,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -OptionPane.buttonClickThreshhold 500 -OptionPane.buttonMinimumWidth [active] 72 -OptionPane.buttonOrientation 4 -OptionPane.buttonPadding 8 -OptionPane.errorIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneErrorIcon [UI] -OptionPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -OptionPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -OptionPane.iconMessageGap 16 -OptionPane.informationIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneInformationIcon [UI] -OptionPane.isYesLast true -OptionPane.maxCharactersPerLine 80 -OptionPane.messageAreaBorder [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -OptionPane.messagePadding 3 -OptionPane.minimumSize 262,90 javax.swing.plaf.DimensionUIResource [UI] -OptionPane.questionIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneQuestionIcon [UI] -OptionPane.sameSizeButtons true -OptionPane.setButtonMargin false -OptionPane.warningIcon [lazy] 32,32 com.formdev.flatlaf.icons.FlatOptionPaneWarningIcon [UI] -OptionPane.windowBindings length=2 [Ljava.lang.Object; - [0] ESCAPE - [1] close -OptionPaneUI com.formdev.flatlaf.ui.FlatOptionPaneUI - - -#---- Panel ---- - -Panel.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Panel.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Panel.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -PanelUI com.formdev.flatlaf.ui.FlatPanelUI - - -#---- PasswordField ---- - -PasswordField.background #45494a javax.swing.plaf.ColorUIResource [UI] -PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] -PasswordField.capsLockIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatCapsLockIcon [UI] -PasswordField.capsLockIconColor #64ffffff javax.swing.plaf.ColorUIResource [UI] -PasswordField.caretBlinkRate 500 -PasswordField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -PasswordField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -PasswordField.echoChar '\u2022' -PasswordField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -PasswordField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -PasswordField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -PasswordField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -PasswordField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -PasswordField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] -PasswordField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -PasswordField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -PasswordFieldUI com.formdev.flatlaf.ui.FlatPasswordFieldUI - - -#---- PopupMenu ---- - -PopupMenu.background #303234 javax.swing.plaf.ColorUIResource [UI] -PopupMenu.border [lazy] 4,1,4,1 false com.formdev.flatlaf.ui.FlatPopupMenuBorder [UI] -PopupMenu.borderColor #5e5e5e javax.swing.plaf.ColorUIResource [UI] -PopupMenu.borderInsets 4,1,4,1 javax.swing.plaf.InsetsUIResource [UI] -PopupMenu.consumeEventOnClose false -PopupMenu.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -PopupMenu.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] - - -#---- PopupMenuSeparator ---- - -PopupMenuSeparator.height 9 -PopupMenuSeparator.stripeIndent 4 -PopupMenuSeparator.stripeWidth 1 -PopupMenuSeparatorUI com.formdev.flatlaf.ui.FlatPopupMenuSeparatorUI - - -#---- PopupMenu ---- - -PopupMenuUI com.formdev.flatlaf.ui.FlatPopupMenuUI - - -#---- ProgressBar ---- - -ProgressBar.arc 4 -ProgressBar.background #555555 javax.swing.plaf.ColorUIResource [UI] -ProgressBar.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -ProgressBar.cellLength 1 -ProgressBar.cellSpacing 0 -ProgressBar.cycleTime 4000 -ProgressBar.font .SF NS Text plain 11 javax.swing.plaf.FontUIResource [UI] -ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI] -ProgressBar.horizontalSize 146,4 javax.swing.plaf.DimensionUIResource [UI] -ProgressBar.repaintInterval 15 -ProgressBar.selectionBackground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ProgressBar.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ProgressBar.verticalSize 4,146 javax.swing.plaf.DimensionUIResource [UI] -ProgressBarUI com.formdev.flatlaf.ui.FlatProgressBarUI - - -#---- RadioButton ---- - -RadioButton.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -RadioButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -RadioButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -RadioButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -RadioButton.icon.centerDiameter 8 -RadioButton.icon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonIcon [UI] -RadioButton.iconTextGap 4 -RadioButton.light #313131 javax.swing.plaf.ColorUIResource [UI] -RadioButton.margin 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] -RadioButton.rollover true -RadioButton.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -RadioButton.textIconGap 4 -RadioButton.textShiftOffset 0 - - -#---- RadioButtonMenuItem ---- - -RadioButtonMenuItem.acceleratorFont .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.acceleratorForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.acceleratorSelectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenuItemArrowIcon [UI] -RadioButtonMenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI] -RadioButtonMenuItem.borderPainted true -RadioButtonMenuItem.checkIcon [lazy] 15,15 com.formdev.flatlaf.icons.FlatRadioButtonMenuItemIcon [UI] -RadioButtonMenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -RadioButtonMenuItem.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.margin 2,8,2,8 javax.swing.plaf.InsetsUIResource [UI] -RadioButtonMenuItem.opaque false -RadioButtonMenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -RadioButtonMenuItemUI com.formdev.flatlaf.ui.FlatRadioButtonMenuItemUI - - -#---- RadioButton ---- - -RadioButtonUI com.formdev.flatlaf.ui.FlatRadioButtonUI - - -#---- Resizable ---- - -Resizable.resizeBorder [lazy] 4,4,4,4 false com.formdev.flatlaf.ui.FlatLineBorder [UI] - - -#---- RootPane ---- - -RootPane.defaultButtonWindowKeyBindings length=8 [Ljava.lang.Object; - [0] ENTER - [1] press - [2] released ENTER - [3] release - [4] ctrl ENTER - [5] press - [6] ctrl released ENTER - [7] release -RootPaneUI com.formdev.flatlaf.ui.FlatRootPaneUI - - -#---- ScrollBar ---- - -ScrollBar.allowsAbsolutePositioning true -ScrollBar.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.buttonDisabledArrowColor #585858 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverThumbColor #717678 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.hoverTrackColor #494c4f javax.swing.plaf.ColorUIResource [UI] -ScrollBar.maximumThumbSize 4096,4096 javax.swing.plaf.DimensionUIResource [UI] -ScrollBar.minimumThumbSize 8,8 javax.swing.plaf.DimensionUIResource [UI] -ScrollBar.showButtons false -ScrollBar.squareButtons false -ScrollBar.thumb #585c5e javax.swing.plaf.ColorUIResource [UI] -ScrollBar.thumbDarkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ScrollBar.thumbHighlight #242424 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.thumbShadow #646464 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.track #3f4244 javax.swing.plaf.ColorUIResource [UI] -ScrollBar.trackHighlight #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ScrollBar.width 10 -ScrollBarUI com.formdev.flatlaf.ui.FlatScrollBarUI - - -#---- ScrollPane ---- - -ScrollPane.background #3f4244 javax.swing.plaf.ColorUIResource [UI] -ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] -ScrollPane.fillUpperCorner true -ScrollPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ScrollPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ScrollPane.smoothScrolling true -ScrollPaneUI com.formdev.flatlaf.ui.FlatScrollPaneUI - - -#---- Separator ---- - -Separator.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Separator.foreground #515151 javax.swing.plaf.ColorUIResource [UI] -Separator.height 3 -Separator.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -Separator.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -Separator.stripeIndent 1 -Separator.stripeWidth 1 -SeparatorUI com.formdev.flatlaf.ui.FlatSeparatorUI - - -#---- Slider ---- - -Slider.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Slider.disabledForeground #4c5052 javax.swing.plaf.ColorUIResource [UI] -Slider.focus #7e7e7e javax.swing.plaf.ColorUIResource [UI] -Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -Slider.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Slider.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Slider.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -Slider.horizontalSize 200,21 java.awt.Dimension -Slider.hoverColor #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -Slider.minimumHorizontalSize 36,21 java.awt.Dimension -Slider.minimumVerticalSize 21,36 java.awt.Dimension -Slider.onlyLeftMouseButtonDrag true -Slider.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -Slider.thumbColor #a6a6a6 javax.swing.plaf.ColorUIResource [UI] -Slider.thumbWidth 11 -Slider.tickColor #888888 javax.swing.plaf.ColorUIResource [UI] -Slider.trackColor #646464 javax.swing.plaf.ColorUIResource [UI] -Slider.trackWidth 3 -Slider.verticalSize 21,200 java.awt.Dimension -SliderUI com.formdev.flatlaf.ui.FlatSliderUI - - -#---- Spinner ---- - -Spinner.arrowButtonSize 16,5 java.awt.Dimension -Spinner.background #45494a javax.swing.plaf.ColorUIResource [UI] -Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] -Spinner.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] -Spinner.buttonBackground #404445 javax.swing.plaf.ColorUIResource [UI] -Spinner.buttonDisabledArrowColor #585858 javax.swing.plaf.ColorUIResource [UI] -Spinner.buttonHoverArrowColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Spinner.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Spinner.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -Spinner.editorAlignment 11 -Spinner.editorBorderPainted false -Spinner.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Spinner.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Spinner.padding 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -SpinnerUI com.formdev.flatlaf.ui.FlatSpinnerUI - - -#---- SplitPane ---- - -SplitPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -SplitPane.centerOneTouchButtons true -SplitPane.continuousLayout true -SplitPane.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -SplitPane.dividerSize 5 -SplitPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -SplitPane.oneTouchButtonOffset [active] 2 -SplitPane.oneTouchButtonSize [active] 6 -SplitPane.shadow #646464 javax.swing.plaf.ColorUIResource [UI] - - -#---- SplitPaneDivider ---- - -SplitPaneDivider.draggingColor #646464 javax.swing.plaf.ColorUIResource [UI] -SplitPaneDivider.oneTouchArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI] -SplitPaneDivider.oneTouchHoverArrowColor #7a7d81 javax.swing.plaf.ColorUIResource [UI] - - -#---- SplitPane ---- - -SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI - - -#---- TabbedPane ---- - -TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.contentAreaColor #323232 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.contentOpaque true -TabbedPane.contentSeparatorHeight 1 -TabbedPane.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -TabbedPane.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] -TabbedPane.focus #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TabbedPane.focusColor #3d4b5c javax.swing.plaf.ColorUIResource [UI] -TabbedPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TabbedPane.hasFullBorder false -TabbedPane.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.hoverColor #2e3133 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.labelShift 1 -TabbedPane.light #313131 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.selectedLabelShift -1 -TabbedPane.selectedTabPadInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -TabbedPane.selectionFollowsFocus true -TabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] -TabbedPane.tabHeight 32 -TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI] -TabbedPane.tabRunOverlay 0 -TabbedPane.tabSelectionHeight 3 -TabbedPane.tabsOpaque true -TabbedPane.tabsOverlapBorder true -TabbedPane.textIconGap 4 -TabbedPane.underlineColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] -TabbedPaneUI com.formdev.flatlaf.ui.FlatTabbedPaneUI - - -#---- Table ---- - -Table.ascendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatAscendingSortIcon [UI] -Table.background #45494a javax.swing.plaf.ColorUIResource [UI] -Table.cellFocusColor #000000 javax.swing.plaf.ColorUIResource [UI] -Table.cellMargins 2,3,2,3 javax.swing.plaf.InsetsUIResource [UI] -Table.cellNoFocusBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Default [UI] -Table.descendingSortIcon [lazy] 10,5 com.formdev.flatlaf.icons.FlatDescendingSortIcon [UI] -Table.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] -Table.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] -Table.dropLineShortColor [lazy] #b4c3df javax.swing.plaf.ColorUIResource [UI] -Table.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] -Table.focusCellForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Focused [UI] -Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] -Table.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Table.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.gridColor #4c5152 javax.swing.plaf.ColorUIResource [UI] -Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI] -Table.rowHeight 20 -Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI] -Table.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -Table.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.selectionInactiveBackground #0d293e javax.swing.plaf.ColorUIResource [UI] -Table.selectionInactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Table.showHorizontalLines false -Table.showVerticalLines false -Table.sortIconColor #adadad javax.swing.plaf.ColorUIResource [UI] - - -#---- TableHeader ---- - -TableHeader.background #45494a javax.swing.plaf.ColorUIResource [UI] -TableHeader.bottomSeparatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] -TableHeader.cellBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -TableHeader.focusCellBackground #45494a javax.swing.plaf.ColorUIResource [UI] -TableHeader.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TableHeader.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TableHeader.height 25 -TableHeader.separatorColor #5e6364 javax.swing.plaf.ColorUIResource [UI] -TableHeaderUI com.formdev.flatlaf.ui.FlatTableHeaderUI - - -#---- Table ---- - -TableUI com.formdev.flatlaf.ui.FlatTableUI - - -#---- TaskPane ---- - -TaskPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TaskPane.borderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] -TaskPane.contentInsets 10,10,10,10 javax.swing.plaf.InsetsUIResource [UI] -TaskPane.specialTitleBackground #afafaf javax.swing.plaf.ColorUIResource [UI] -TaskPane.specialTitleForeground #222222 javax.swing.plaf.ColorUIResource [UI] -TaskPane.specialTitleOver #666666 javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleBackgroundGradientStart #4c5052 javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TaskPane.titleOver #888888 javax.swing.plaf.ColorUIResource [UI] - - -#---- TaskPaneContainer ---- - -TaskPaneContainer.background #3e434c javax.swing.plaf.ColorUIResource [UI] -TaskPaneContainer.border [lazy] 10,10,10,10 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] - - -#---- TextArea ---- - -TextArea.background #45494a javax.swing.plaf.ColorUIResource [UI] -TextArea.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -TextArea.caretBlinkRate 500 -TextArea.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextArea.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextArea.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextArea.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextArea.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextArea.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextArea.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -TextArea.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextAreaUI com.formdev.flatlaf.ui.FlatTextAreaUI - - -#---- TextComponent ---- - -TextComponent.arc 0 -TextComponent.selectAllOnFocusPolicy once - - -#---- TextField ---- - -TextField.background #45494a javax.swing.plaf.ColorUIResource [UI] -TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI] -TextField.caretBlinkRate 500 -TextField.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextField.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -TextField.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextField.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextField.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -TextField.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextField.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextField.light #313131 javax.swing.plaf.ColorUIResource [UI] -TextField.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextField.placeholderForeground #777777 javax.swing.plaf.ColorUIResource [UI] -TextField.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -TextField.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextField.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -TextFieldUI com.formdev.flatlaf.ui.FlatTextFieldUI - - -#---- TextPane ---- - -TextPane.background #45494a javax.swing.plaf.ColorUIResource [UI] -TextPane.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI] -TextPane.caretBlinkRate 500 -TextPane.caretForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextPane.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TextPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextPane.inactiveBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -TextPane.inactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextPane.margin 2,6,2,6 javax.swing.plaf.InsetsUIResource [UI] -TextPane.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -TextPane.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI - - -#---- TitledBorder ---- - -TitledBorder.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatLineBorder [UI] -TitledBorder.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -TitledBorder.titleColor #bbbbbb javax.swing.plaf.ColorUIResource [UI] - - -#---- TitledPanel ---- - -TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI - - -#---- ToggleButton ---- - -ToggleButton.background #4c5052 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] -ToggleButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledSelectedBackground #525658 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToggleButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToggleButton.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.iconTextGap 4 -ToggleButton.light #313131 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI] -ToggleButton.pressedBackground #ff0000 com.formdev.flatlaf.util.DerivedColor [UI] -ToggleButton.rollover true -ToggleButton.selectedBackground #64696c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.selectedForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToggleButton.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.disabledUnderlineColor #7a7a7a javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.focusBackground #3d4b5c javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.hoverBackground #2e3133 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.underlineColor #4a88c7 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.tab.underlineHeight 2 -ToggleButton.textIconGap 4 -ToggleButton.textShiftOffset 0 -ToggleButton.toolbar.hoverBackground #4c5052 javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.pressedBackground #555a5d javax.swing.plaf.ColorUIResource [UI] -ToggleButton.toolbar.selectedBackground #5c6164 javax.swing.plaf.ColorUIResource [UI] -ToggleButtonUI com.formdev.flatlaf.ui.FlatToggleButtonUI - - -#---- ToolBar ---- - -ToolBar.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ToolBar.border [lazy] 2,2,2,2 false com.formdev.flatlaf.ui.FlatToolBarBorder [UI] -ToolBar.borderMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI] -ToolBar.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -ToolBar.dockingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ToolBar.dockingForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToolBar.floatingBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] -ToolBar.floatingForeground #777777 javax.swing.plaf.ColorUIResource [UI] -ToolBar.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToolBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToolBar.gripColor #adadad javax.swing.plaf.ColorUIResource [UI] -ToolBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI] -ToolBar.isRollover true -ToolBar.light #313131 javax.swing.plaf.ColorUIResource [UI] -ToolBar.separatorColor #515151 javax.swing.plaf.ColorUIResource [UI] -ToolBar.separatorWidth 7 -ToolBar.shadow #646464 javax.swing.plaf.ColorUIResource [UI] -ToolBar.spacingBorder [lazy] 1,2,1,2 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] - - -#---- ToolBarSeparator ---- - -ToolBarSeparatorUI com.formdev.flatlaf.ui.FlatToolBarSeparatorUI - - -#---- ToolBar ---- - -ToolBarUI com.formdev.flatlaf.ui.FlatToolBarUI - - -#---- ToolTip ---- - -ToolTip.background #1e2123 javax.swing.plaf.ColorUIResource [UI] -ToolTip.backgroundInactive #1e2123 javax.swing.plaf.ColorUIResource [UI] -ToolTip.border [lazy] 4,6,4,6 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -ToolTip.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -ToolTip.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ToolTip.foregroundInactive #777777 javax.swing.plaf.ColorUIResource [UI] - - -#---- ToolTipManager ---- - -ToolTipManager.enableToolTipMode activeApplication - - -#---- ToolTip ---- - -ToolTipUI com.formdev.flatlaf.ui.FlatToolTipUI - - -#---- Tree ---- - -Tree.background #45494a javax.swing.plaf.ColorUIResource [UI] -Tree.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatEmptyBorder [UI] -Tree.changeSelectionWithFocus true -Tree.closedIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTreeClosedIcon [UI] -Tree.collapsedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeCollapsedIcon [UI] -Tree.drawsFocusBorderAroundIcon false -Tree.dropCellBackground [lazy] #3c588b javax.swing.plaf.ColorUIResource [UI] -Tree.dropCellForeground [lazy] #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.dropLineColor [lazy] #6d8ac0 javax.swing.plaf.ColorUIResource [UI] -Tree.editorBorder [lazy] line: #000000 java.awt.Color 1 false 1,1,1,1 true javax.swing.plaf.BorderUIResource$LineBorderUIResource [UI] -Tree.expandedIcon [lazy] 11,11 com.formdev.flatlaf.icons.FlatTreeExpandedIcon [UI] -Tree.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Tree.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.hash #505355 javax.swing.plaf.ColorUIResource [UI] -Tree.icon.closedColor #adadad javax.swing.plaf.ColorUIResource [UI] -Tree.icon.collapsedColor #adadad javax.swing.plaf.ColorUIResource [UI] -Tree.icon.expandedColor #adadad javax.swing.plaf.ColorUIResource [UI] -Tree.icon.leafColor #adadad javax.swing.plaf.ColorUIResource [UI] -Tree.icon.openColor #adadad javax.swing.plaf.ColorUIResource [UI] -Tree.leafIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTreeLeafIcon [UI] -Tree.leftChildIndent 7 -Tree.lineTypeDashed false -Tree.openIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatTreeOpenIcon [UI] -Tree.paintLines false -Tree.rendererFillBackground false -Tree.rendererMargins 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI] -Tree.rightChildIndent 11 -Tree.rowHeight 0 -Tree.scrollsOnExpand true -Tree.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI] -Tree.selectionBorderColor #000000 javax.swing.plaf.ColorUIResource [UI] -Tree.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.selectionInactiveBackground #0d293e javax.swing.plaf.ColorUIResource [UI] -Tree.selectionInactiveForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.textBackground #45494a javax.swing.plaf.ColorUIResource [UI] -Tree.textForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -Tree.timeFactor 1000 -Tree.wideSelection true -TreeUI com.formdev.flatlaf.ui.FlatTreeUI - - -#---- Viewport ---- - -Viewport.background #3c3f41 javax.swing.plaf.ColorUIResource [UI] -Viewport.font .SF NS Text plain 13 javax.swing.plaf.FontUIResource [UI] -Viewport.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI] -ViewportUI com.formdev.flatlaf.ui.FlatViewportUI - - -#---- ---- - -activeCaption #434e60 javax.swing.plaf.ColorUIResource [UI] -activeCaptionBorder #434e60 javax.swing.plaf.ColorUIResource [UI] -activeCaptionText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -control #3c3f41 javax.swing.plaf.ColorUIResource [UI] -controlDkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] -controlHighlight #313131 javax.swing.plaf.ColorUIResource [UI] -controlLtHighlight #242424 javax.swing.plaf.ColorUIResource [UI] -controlShadow #646464 javax.swing.plaf.ColorUIResource [UI] -controlText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -desktop #45494a javax.swing.plaf.ColorUIResource [UI] - - -#---- html ---- - -html.missingImage [lazy] 38,38 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) -html.pendingImage [lazy] 38,38 sun.swing.ImageIconUIResource [UI] (sun.awt.image.ToolkitImage) - - -#---- ---- - -inactiveCaption #393c3d javax.swing.plaf.ColorUIResource [UI] -inactiveCaptionBorder #393c3d javax.swing.plaf.ColorUIResource [UI] -inactiveCaptionText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -info #1e2123 javax.swing.plaf.ColorUIResource [UI] -infoText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -menu #3c3f41 javax.swing.plaf.ColorUIResource [UI] -menuText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -scrollbar #3f4244 javax.swing.plaf.ColorUIResource [UI] - - -#---- swingx/TaskPane ---- - -swingx/TaskPaneUI com.formdev.flatlaf.swingx.ui.FlatTaskPaneUI - - -#---- ---- - -text #45494a javax.swing.plaf.ColorUIResource [UI] -textHighlight #4b6eaf javax.swing.plaf.ColorUIResource [UI] -textHighlightText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -textInactiveText #777777 javax.swing.plaf.ColorUIResource [UI] -textText #bbbbbb javax.swing.plaf.ColorUIResource [UI] -window #3c3f41 javax.swing.plaf.ColorUIResource [UI] -windowBorder #bbbbbb javax.swing.plaf.ColorUIResource [UI] -windowText #bbbbbb javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-theme-editor/.settings/org.eclipse.jdt.core.prefs b/flatlaf-theme-editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..71b328aa --- /dev/null +++ b/flatlaf-theme-editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,377 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=33 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=32 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=next_line_on_wrap +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=next_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=1 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=false +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/flatlaf-theme-editor/.settings/org.eclipse.jdt.ui.prefs b/flatlaf-theme-editor/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..ef990006 --- /dev/null +++ b/flatlaf-theme-editor/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +formatter_profile=_FlatLaf +formatter_settings_version=19 diff --git a/flatlaf-theme-editor/README.md b/flatlaf-theme-editor/README.md new file mode 100644 index 00000000..049861c7 --- /dev/null +++ b/flatlaf-theme-editor/README.md @@ -0,0 +1,4 @@ +FlatLaf Theme Editor +==================== + +under development \ No newline at end of file diff --git a/flatlaf-theme-editor/build.gradle.kts b/flatlaf-theme-editor/build.gradle.kts new file mode 100644 index 00000000..969d0d08 --- /dev/null +++ b/flatlaf-theme-editor/build.gradle.kts @@ -0,0 +1,53 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + `java-library` +} + +dependencies { + implementation( project( ":flatlaf-core" ) ) + implementation( project( ":flatlaf-extras" ) ) + + implementation( "com.fifesoft:rsyntaxtextarea:3.1.1" ) + implementation( "com.fifesoft:autocomplete:3.1.0" ) +} + +tasks { + jar { + dependsOn( ":flatlaf-core:jar" ) + dependsOn( ":flatlaf-extras:jar" ) + + manifest { + attributes( "Main-Class" to "com.formdev.flatlaf.themeeditor.FlatThemeFileEditor" ) + + if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) + attributes( "Multi-Release" to "true" ) + } + + exclude( "module-info.class" ) + exclude( "META-INF/versions/*/module-info.class" ) + + // include all dependencies in jar + from( { + configurations.runtimeClasspath.get() + .filter { it.name.endsWith( "jar" ) } + .map { zipTree( it ).matching { + exclude( "META-INF/LICENSE" ) + } } + } ) + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/UIDefaultsLoaderAccessor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/UIDefaultsLoaderAccessor.java new file mode 100644 index 00000000..fb4698d1 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/UIDefaultsLoaderAccessor.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf; + +import java.util.Collections; +import java.util.function.Function; +import com.formdev.flatlaf.UIDefaultsLoader.ValueType; + +/** + * Enable accessing package private methods of {@link UIDefaultsLoader}. + * + * @author Karl Tauber + */ +public class UIDefaultsLoaderAccessor +{ + public static Object UNKNOWN = ValueType.UNKNOWN; + public static Object STRING = ValueType.STRING; + public static Object BOOLEAN = ValueType.BOOLEAN; + public static Object CHARACTER = ValueType.CHARACTER; + public static Object INTEGER = ValueType.INTEGER; + public static Object FLOAT = ValueType.FLOAT; + public static Object BORDER = ValueType.BORDER; + public static Object ICON = ValueType.ICON; + public static Object INSETS = ValueType.INSETS; + public static Object DIMENSION = ValueType.DIMENSION; + public static Object COLOR = ValueType.COLOR; + public static Object SCALEDINTEGER = ValueType.SCALEDINTEGER; + public static Object SCALEDFLOAT = ValueType.SCALEDFLOAT; + public static Object SCALEDINSETS = ValueType.SCALEDINSETS; + public static Object SCALEDDIMENSION = ValueType.SCALEDDIMENSION; + public static Object INSTANCE = ValueType.INSTANCE; + public static Object CLASS = ValueType.CLASS; + public static Object GRAYFILTER = ValueType.GRAYFILTER; + public static Object NULL = ValueType.NULL; + public static Object LAZY = ValueType.LAZY; + + public static String resolveValue( String value, Function propertiesGetter ) { + return UIDefaultsLoader.resolveValue( value, propertiesGetter ); + } + + public static Object parseValue( String key, String value, Object[] resultValueType, + Function resolver ) + { + ValueType[] resultValueType2 = new ValueType[1]; + Object result = UIDefaultsLoader.parseValue( key, value, resultValueType2, resolver, Collections.emptyList() ); + resultValueType[0] = resultValueType2[0]; + return result; + } + + public static int parseColorRGBA( String value ) { + return UIDefaultsLoader.parseColorRGBA( value ); + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatCompletionProvider.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatCompletionProvider.java new file mode 100644 index 00000000..e709bc28 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatCompletionProvider.java @@ -0,0 +1,392 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.Point; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.swing.text.BadLocationException; +import javax.swing.text.JTextComponent; +import org.fife.ui.autocomplete.BasicCompletion; +import org.fife.ui.autocomplete.Completion; +import org.fife.ui.autocomplete.CompletionProvider; +import org.fife.ui.autocomplete.CompletionProviderBase; +import org.fife.ui.autocomplete.DefaultCompletionProvider; +import org.fife.ui.autocomplete.FunctionCompletion; +import org.fife.ui.autocomplete.ParameterChoicesProvider; +import org.fife.ui.autocomplete.ParameterizedCompletion; +import org.fife.ui.autocomplete.ParameterizedCompletion.Parameter; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; + +/** + * @author Karl Tauber + */ +class FlatCompletionProvider + extends CompletionProviderBase +{ + private KeyCompletionProvider keyProvider; + private ReferenceCompletionProvider referenceProvider; + private ValueCompletionProvider valueProvider; + + FlatCompletionProvider() { + } + + @Override + public String getAlreadyEnteredText( JTextComponent comp ) { + CompletionProvider provider = getProviderFor( comp ); + return (provider != null) ? provider.getAlreadyEnteredText( comp ) : null; + } + + @Override + public List getCompletionsAt( JTextComponent comp, Point p ) { + CompletionProvider provider = getProviderFor( comp ); + return (provider != null) ? provider.getCompletionsAt( comp, p ) : null; + } + + @Override + public List getParameterizedCompletions( JTextComponent comp ) { + CompletionProvider provider = getProviderFor( comp ); + return (provider != null) ? provider.getParameterizedCompletions( comp ) : null; + } + + @Override + protected List getCompletionsImpl( JTextComponent comp ) { + CompletionProvider provider = getProviderFor( comp ); + return (provider != null) ? provider.getCompletions( comp ) : null; + } + + @Override + public boolean isAutoActivateOkay( JTextComponent comp ) { + CompletionProvider provider = getProviderFor( comp ); + return (provider != null) ? provider.isAutoActivateOkay( comp ) : false; + } + + private CompletionProvider getProviderFor( JTextComponent comp ) { + RSyntaxTextArea rsta = (RSyntaxTextArea) comp; + try { + int caretPosition = rsta.getCaretPosition(); + int currentLine = rsta.getLineOfOffset( caretPosition ); + int lineStart = rsta.getLineStartOffset( currentLine ); + int lineEnd = rsta.getLineEndOffset( currentLine ); + + if( caretPosition <= lineStart ) { + // caret is at the start of the line + String line = rsta.getText( lineStart, lineEnd - lineStart ); + if( line.trim().startsWith( "#" ) ) + return null; + } + + String lineBeforeCaret = rsta.getText( lineStart, caretPosition - lineStart ); + if( lineBeforeCaret.trim().startsWith( "#" ) ) + return null; + + // key + if( lineBeforeCaret.indexOf( '=' ) < 0 ) + return getKeyProvider(); + + // value + for( int i = lineBeforeCaret.length() - 1; i >= 0; i-- ) { + switch( lineBeforeCaret.charAt( i ) ) { + case '=': + case '(': + return getValueProvider(); + + case '$': + case '@': + return getReferenceProvider(); + + case ' ': + case '\t': + case '#': // colors + return null; + } + } + return null; + + } catch( BadLocationException ex ) { + // ignore + return null; + } + } + + private CompletionProvider getKeyProvider() { + if( keyProvider == null ) + keyProvider = KeyCompletionProvider.getInstance(); + return keyProvider; + } + + private CompletionProvider getReferenceProvider() { + if( referenceProvider == null ) + referenceProvider = new ReferenceCompletionProvider(); + return referenceProvider; + } + + private CompletionProvider getValueProvider() { + if( valueProvider == null ) + valueProvider = new ValueCompletionProvider( getReferenceProvider() ); + return valueProvider; + } + + //---- class KeyCompletionProvider ---------------------------------------- + + /** + * A completion provider for keys, which always uses all known/predefined keys. + */ + private static final class KeyCompletionProvider + extends BaseCompletionProvider + { + private static KeyCompletionProvider instance; + + static KeyCompletionProvider getInstance() { + if( instance == null ) + instance = new KeyCompletionProvider(); + return instance; + } + + KeyCompletionProvider() { + setAutoActivationRules( true, "." ); + + // load all keys + HashSet keys = new HashSet<>(); + try { + try( InputStream in = getClass().getResourceAsStream( "/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt" ) ) { + if( in != null ) { + try( BufferedReader reader = new BufferedReader( new InputStreamReader( in, "UTF-8" ) ) ) { + String key; + while( (key = reader.readLine()) != null ) { + keys.add( key ); + } + } + } + } + } catch( IOException ex ) { + ex.printStackTrace(); // TODO + } + + // collect key parts + HashSet keyParts = new HashSet<>(); + for( String key : keys ) { + int delimIndex = key.length() + 1; + while( (delimIndex = key.lastIndexOf( '.', delimIndex - 1 )) >= 0 ) { + String part = key.substring( 0, delimIndex ); + if( !keys.contains( part ) ) + keyParts.add( part ); + } + } + + // add key parts + addWordCompletions( keyParts.toArray( new String[keyParts.size()] ) ); + + // add all keys + addWordCompletions( keys.toArray( new String[keys.size()] ) ); + } + + @Override + protected boolean isValidChar( char ch ) { + return super.isValidChar( ch ) || ch == '.'; + } + } + + //---- class BaseCompletionProvider --------------------------------------- + + //TODO remove if https://github.com/bobbylight/AutoComplete/issues/77 is fixed + private static class BaseCompletionProvider + extends DefaultCompletionProvider + { + private boolean autoActivateAfterLetters; + private String autoActivateChars; + + @Override + public boolean isAutoActivateOkay( JTextComponent comp ) { + int caretPosition = comp.getCaretPosition(); + if( caretPosition <= 0 ) + return false; + + try { + char ch = comp.getText( caretPosition - 1, 1 ).charAt( 0 ); + return (autoActivateAfterLetters && Character.isLetter( ch )) || + (autoActivateChars != null && autoActivateChars.indexOf( ch ) >= 0); + } catch( BadLocationException | IndexOutOfBoundsException ex ) { + // ignore + return false; + } + } + + @Override + public void setAutoActivationRules( boolean letters, String others ) { + autoActivateAfterLetters = letters; + autoActivateChars = others; + } + } + + //---- class ReferenceCompletionProvider ---------------------------------- + + /** + * A completion provider for references within values. Only keys defined + * in current properties file and in base properties files are used. + */ + private static class ReferenceCompletionProvider + extends BaseCompletionProvider + { + private Set lastKeys; + + ReferenceCompletionProvider() { + setAutoActivationRules( true, "$@." ); + } + + @Override + protected boolean isValidChar( char ch ) { + return super.isValidChar( ch ) || ch == '.' || ch == '$' || ch == '@'; + } + + @Override + protected List getCompletionsImpl( JTextComponent comp ) { + updateCompletions( comp ); + return super.getCompletionsImpl( comp ); + } + + @Override + public List getCompletionsAt( JTextComponent comp, Point pt ) { + updateCompletions( comp ); + return super.getCompletionsAt( comp, pt ); + } + + @Override + public List getParameterizedCompletions( JTextComponent comp ) { + updateCompletions( comp ); + return super.getParameterizedCompletions( comp ); + } + + private void updateCompletions( JTextComponent comp ) { + FlatSyntaxTextArea fsta = (FlatSyntaxTextArea) comp; + Set keys = fsta.propertiesSupport.getAllKeys(); + if( keys == lastKeys ) + return; + + completions.clear(); + for( String key : keys ) { + if( key.startsWith( "*." ) || key.startsWith( "[" ) ) + continue; + + if( !key.startsWith( "@" ) ) + key = "$".concat( key ); + + BasicCompletion completion = new BasicCompletion( this, key ); + if( key.startsWith( "@" ) ) + completion.setRelevance( 1 ); + completions.add( completion ); + } + Collections.sort(completions); + } + } + + //---- class ValueCompletionProvider -------------------------------------- + + /** + * A completion provider for values. + */ + private static class ValueCompletionProvider + extends BaseCompletionProvider + implements ParameterChoicesProvider + { + ValueCompletionProvider( CompletionProvider parent ) { + setParent( parent ); + setAutoActivationRules( true, null ); + setParameterizedCompletionParams( '(', ",", ')' ); + setParameterChoicesProvider( this ); + + addFunction( "rgb", + "red", "0-255 or 0-100%", + "green", "0-255 or 0-100%", + "blue", "0-255 or 0-100%" ); + addFunction( "rgba", + "red", "0-255 or 0-100%", + "green", "0-255 or 0-100%", + "blue", "0-255 or 0-100%", + "alpha", "0-255 or 0-100%" ); + + addFunction( "hsl", + "hue", "0-360 representing degrees", + "saturation", "0-100%", + "lightness", "0-100%" ); + addFunction( "hsla", + "hue", "0-360 representing degrees", + "saturation", "0-100%", + "lightness", "0-100%", + "alpha", "0-100%" ); + + String[] hslIncreaseDecreaseParams = { + "color", "a color (e.g. #f00), a reference (e.g. $Other.key) or a color function", + "amount", "0-100%", + "options", "(optional) [relative] [autoInverse] [noAutoInverse] [lazy] [derived]" + }; + addFunction( "lighten", hslIncreaseDecreaseParams ); + addFunction( "darken", hslIncreaseDecreaseParams ); + addFunction( "saturate", hslIncreaseDecreaseParams ); + addFunction( "desaturate", hslIncreaseDecreaseParams ); + } + + private void addFunction( String name, String... paramNamesAndDescs ) { + List params = new ArrayList<>(); + for( int i = 0; i < paramNamesAndDescs.length; i += 2 ) { +// boolean endParam = i + 2 >= paramNamesAndDescs.length; + boolean endParam = false; + Parameter param = new Parameter( null, paramNamesAndDescs[i], endParam ); + param.setDescription( paramNamesAndDescs[i + 1] ); + params.add( param ); + } + + FunctionCompletion f = new FunctionCompletion( this, name, null ) { + @Override + public String toString() { + return getDefinitionString().replace( "(", " (" ).replace( ",", ", " ); + } + }; + + f.setParams( params ); + f.setRelevance( 10 ); + addCompletion( f ); + } + + @Override + public List getParameterChoices( JTextComponent tc, Parameter param ) { + switch( param.getName() ) { + case "amount": + return createParameterChoices( "5%", "10%", "15%", "20%", "25%" ); + + case "options": + return createParameterChoices( "relative", "autoInverse", "noAutoInverse", "lazy", "derived" ); + } + + return null; + } + + private List createParameterChoices( String... values ) { + List result = new ArrayList<>(); + for( String value : values ) + result.add( new BasicCompletion( this, value ) ); + return result; + } + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatOccurrenceMarker.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatOccurrenceMarker.java new file mode 100644 index 00000000..635f278e --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatOccurrenceMarker.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import org.fife.ui.rsyntaxtextarea.OccurrenceMarker; +import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rsyntaxtextarea.TokenImpl; +import org.fife.ui.rtextarea.SmartHighlightPainter; + +/** + * Delegating occurrence marker that does not mark token at caret if it does + * not occur elsewhere. + * + * @author Karl Tauber + */ +class FlatOccurrenceMarker + implements OccurrenceMarker +{ + private final OccurrenceMarker delegate; + + FlatOccurrenceMarker( OccurrenceMarker delegate ) { + this.delegate = delegate; + } + + @Override + public Token getTokenToMark( RSyntaxTextArea textArea ) { + return delegate.getTokenToMark( textArea ); + } + + @Override + public boolean isValidType( RSyntaxTextArea textArea, Token t ) { + return delegate.isValidType( textArea, t ); + } + + @Override + public void markOccurrences( RSyntaxDocument doc, Token t, RSyntaxTextAreaHighlighter h, SmartHighlightPainter p ) { + char[] lexeme = t.getLexeme().toCharArray(); + int type = t.getType(); + int lineCount = doc.getDefaultRootElement().getElementCount(); + + // make a copy of the token because it is overwritten in getTokenListForLine() + Token t2 = new TokenImpl( t ); + + // check whether token occurs more than once + boolean mark = false; + for( int i = 0; i < lineCount && !mark; i++ ) { + Token temp = doc.getTokenListForLine( i ); + while( temp != null && temp.isPaintable() ) { + if( temp.is( type, lexeme ) && temp.getOffset() != t2.getOffset() ) { + mark = true; + break; + } + temp = temp.getNextToken(); + } + } + + if( mark ) + delegate.markOccurrences( doc, t2, h, p ); + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java new file mode 100644 index 00000000..4f629012 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatSyntaxTextArea.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.Color; +import java.util.HashMap; +import java.util.Map; +import javax.swing.text.BadLocationException; +import org.fife.ui.rsyntaxtextarea.TextEditorPane; +import org.fife.ui.rsyntaxtextarea.Token; +import com.formdev.flatlaf.UIDefaultsLoaderAccessor; + +/** + * A text area that supports editing FlatLaf themes. + * + * @author Karl Tauber + */ +class FlatSyntaxTextArea + extends TextEditorPane +{ + private boolean useColorOfColorTokens; + + final FlatThemePropertiesSupport propertiesSupport = new FlatThemePropertiesSupport( this ); + private final Map parsedColorsMap = new HashMap<>(); + + FlatSyntaxTextArea() { + } + + boolean isUseColorOfColorTokens() { + return useColorOfColorTokens; + } + + void setUseColorOfColorTokens( boolean useColorOfColorTokens ) { + this.useColorOfColorTokens = useColorOfColorTokens; + setHighlightCurrentLine( !useColorOfColorTokens ); + } + + @Override + public Color getBackgroundForToken( Token t ) { + if( useColorOfColorTokens && t.getType() == FlatThemeTokenMaker.TOKEN_COLOR ) { + Color color = parseColor( t ); + if( color != null ) + return color; + } + + return super.getBackgroundForToken( t ); + } + + @Override + public Color getForegroundForToken( Token t ) { + if( useColorOfColorTokens && t.getType() == FlatThemeTokenMaker.TOKEN_COLOR && !isCurrentLineHighlighted( t.getOffset() )) { + Color color = parseColor( t ); + if( color != null ) { + return (colorLuminance( color ) > 164 || color.getAlpha() < 96) + ? Color.black + : Color.white; + } + } + + return super.getForegroundForToken( t ); + } + + private Color parseColor( Token token ) { + return parsedColorsMap.computeIfAbsent( token.getLexeme(), s -> { + try { + return new Color( UIDefaultsLoaderAccessor.parseColorRGBA( s ), true ); + } catch( IllegalArgumentException ex ) { + return null; + } + } ); + + } + + private int colorLuminance( Color c ) { + int red = c.getRed(); + int green = c.getGreen(); + int blue = c.getBlue(); + + int min = Math.min( red, Math.min( green, blue ) ); + int max = Math.max( red, Math.max( green, blue ) ); + + return (max + min) / 2; + } + + private boolean isCurrentLineHighlighted( int offset ) { + try { + return getHighlightCurrentLine() && + getSelectionStart() == getSelectionEnd() && + getLineOfOffset( offset ) == getLineOfOffset( getSelectionStart() ); + } catch( BadLocationException ex ) { + return false; + } + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorOverlay.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorOverlay.java new file mode 100644 index 00000000..987e4f4d --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorOverlay.java @@ -0,0 +1,147 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.Rectangle; +import javax.swing.JComponent; +import javax.swing.JLayer; +import javax.swing.plaf.LayerUI; +import javax.swing.text.BadLocationException; +import org.fife.ui.rsyntaxtextarea.Token; +import com.formdev.flatlaf.UIDefaultsLoaderAccessor; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.HSLColor; +import com.formdev.flatlaf.util.UIScale; + +/** + * An overlay layer that paints additional information about line content on the right side. + * + * @author Karl Tauber + */ +class FlatThemeEditorOverlay + extends LayerUI +{ + private static final int COLOR_PREVIEW_WIDTH = 100; + + private Font font; + private Font baseFont; + + @Override + public void paint( Graphics g, JComponent c ) { + // paint the syntax text area + super.paint( g, c ); + + @SuppressWarnings( "unchecked" ) + FlatSyntaxTextArea textArea = ((JLayer)c).getView(); + Rectangle clipBounds = g.getClipBounds(); + + // determine first and last visible lines + int firstVisibleLine; + int lastVisibleLine; + try { + int startOffset = textArea.viewToModel( new Point( 0, clipBounds.y ) ); + int endOffset = textArea.viewToModel( new Point( 0, clipBounds.y + clipBounds.height ) ); + firstVisibleLine = textArea.getLineOfOffset( startOffset ); + lastVisibleLine = textArea.getLineOfOffset( endOffset ); + } catch( BadLocationException ex ) { + // ignore + return; + } + + // compute font (and cache it) + if( baseFont != textArea.getFont() ) { + baseFont = textArea.getFont(); + int fontSize = Math.max( (int) Math.round( baseFont.getSize() * 0.8 ), 8 ); + font = baseFont.deriveFont( (float) fontSize ); + } + + FontMetrics fm = c.getFontMetrics( font ); + int maxTextWidth = fm.stringWidth( "HSL 360 100 100" ); + int textHeight = fm.getAscent() - fm.getLeading(); + + int width = c.getWidth(); + int previewWidth = UIScale.scale( COLOR_PREVIEW_WIDTH ); + int gap = UIScale.scale( 4 ); + + // check whether preview is outside of clip bounds + if( clipBounds.x + clipBounds.width < width - previewWidth - maxTextWidth - gap ) + return; + + g.setFont( font ); + + // paint additional information + for( int line = firstVisibleLine; line <= lastVisibleLine; line++ ) { + Color color = getColorInLine( textArea, line ); + if( color == null ) + continue; + + try { + // paint color preview + int lineEndOffset = textArea.getLineEndOffset( line ); + Rectangle r = textArea.modelToView( lineEndOffset - 1 ); + int pw = Math.min( width - r.x - gap, previewWidth ); + int px = width - pw; + g.setColor( color ); + g.fillRect( px, r.y, pw, r.height ); + + // if color is semi-transparent paint also none-transparent color + int alpha = color.getAlpha(); + if( alpha != 255 && pw > r.height * 2 ) { + g.setColor( new Color( color.getRGB() ) ); + g.fillRect( px + pw - r.height, r.y, r.height, r.height ); + } + + // paint text + int textX = px - maxTextWidth; + if( textX > r.x + gap) { + float[] hsl = HSLColor.fromRGB( color ); + String hslStr = String.format( "HSL %3d %2d %2d", + Math.round( hsl[0] ), Math.round( hsl[1] ), Math.round( hsl[2] ) ); + g.setColor( textArea.getForeground() ); + FlatUIUtils.drawString( textArea, g, hslStr, textX, + r.y + ((r.height - textHeight) / 2) + textHeight ); + } + } catch( BadLocationException ex ) { + // ignore + } + } + } + + private Color getColorInLine( FlatSyntaxTextArea textArea, int line ) { + Object value = textArea.propertiesSupport.getParsedValueAtLine( line ); + if( value instanceof Color ) + return (Color) value; + + Token token = textArea.getTokenListForLine( line ); + for( Token t = token; t != null && t.isPaintable(); t = t.getNextToken() ) { + if( t.getType() == FlatThemeTokenMaker.TOKEN_COLOR ) { + try { + return new Color( UIDefaultsLoaderAccessor.parseColorRGBA( t.getLexeme() ), true ); + } catch( IllegalArgumentException ex ) { + break; + } + } + } + + return null; + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java new file mode 100644 index 00000000..7e2afde3 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeEditorPane.java @@ -0,0 +1,127 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Font; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.List; +import javax.swing.JLayer; +import javax.swing.JPanel; +import org.fife.ui.autocomplete.AutoCompletion; +import org.fife.ui.autocomplete.CompletionProvider; +import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory; +import org.fife.ui.rsyntaxtextarea.FileLocation; +import org.fife.ui.rsyntaxtextarea.SyntaxScheme; +import org.fife.ui.rsyntaxtextarea.Theme; +import org.fife.ui.rsyntaxtextarea.TokenMakerFactory; +import org.fife.ui.rtextarea.RTextScrollPane; +import com.formdev.flatlaf.util.UIScale; + +/** + * A pane that supports editing FlatLaf themes. + * + * @author Karl Tauber + */ +class FlatThemeEditorPane + extends JPanel +{ + private static final String FLATLAF_STYLE = "text/flatlaf"; + + private final RTextScrollPane scrollPane; + private final FlatSyntaxTextArea textArea; + + FlatThemeEditorPane() { + super( new BorderLayout() ); + + // register FlatLaf token maker + AbstractTokenMakerFactory tmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance(); + tmf.putMapping( FLATLAF_STYLE, FlatThemeTokenMaker.class.getName() ); + + // create text area + textArea = new FlatSyntaxTextArea(); + textArea.setSyntaxEditingStyle( FLATLAF_STYLE ); + textArea.setMarkOccurrences( true ); + textArea.addParser( new FlatThemeParser() ); +// textArea.setUseColorOfColorTokens( true ); + + // theme + try( InputStream in = getClass().getResourceAsStream( "light.xml" ) ) { + Theme theme = Theme.load( in ); + theme.apply( textArea ); + } catch( IOException ex ) { + ex.printStackTrace(); + } + + // use semitransparent token background because token background + // is painted over mark occurrences background + SyntaxScheme scheme = textArea.getSyntaxScheme(); + scheme.getStyle( FlatThemeTokenMaker.TOKEN_COLOR ).background = new Color( 0x0a000000, true ); + scheme.getStyle( FlatThemeTokenMaker.TOKEN_VARIABLE ).background = new Color( 0x1800cc00, true ); + + // autocomplete + CompletionProvider provider = new FlatCompletionProvider(); + AutoCompletion ac = new AutoCompletion( provider ); + ac.setAutoCompleteSingleChoices( false ); + ac.setAutoActivationEnabled( true ); + ac.setParameterAssistanceEnabled( true ); + ac.setChoicesWindowSize( UIScale.scale( 300 ), UIScale.scale( 400 ) ); + ac.setDescriptionWindowSize( UIScale.scale( 300 ), UIScale.scale( 400 ) ); + ac.install( textArea ); + + // create overlay layer + JLayer overlay = new JLayer<>( textArea, new FlatThemeEditorOverlay() ); + + // create scroll pane + scrollPane = new RTextScrollPane( overlay ); + scrollPane.setLineNumbersEnabled( true ); + + // scale fonts + if( UIScale.getUserScaleFactor() != 1 ) + textArea.setFont( scaleFont( textArea.getFont() ) ); + + // use same font for line numbers as in editor + scrollPane.getGutter().setLineNumberFont( textArea.getFont() ); + + add( scrollPane, BorderLayout.CENTER ); + } + + private static Font scaleFont( Font font ) { + int newFontSize = UIScale.scale( font.getSize() ); + return font.deriveFont( (float) newFontSize ); + } + + void setBaseFiles( List baseFiles ) { + textArea.propertiesSupport.setBaseFiles( baseFiles ); + } + + void load( FileLocation loc ) throws IOException { + textArea.load( loc, StandardCharsets.ISO_8859_1 ); + } + + void save() { + try { + textArea.save(); + } catch( IOException ex ) { + ex.printStackTrace(); // TODO + } + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java new file mode 100644 index 00000000..49ddd1de --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.BorderLayout; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.awt.event.KeyEvent; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import org.fife.ui.rsyntaxtextarea.FileLocation; +import com.formdev.flatlaf.FlatLightLaf; +import com.formdev.flatlaf.extras.FlatInspector; +import com.formdev.flatlaf.extras.FlatUIDefaultsInspector; +import com.formdev.flatlaf.util.UIScale; + +/** + * TODO + * + * @author Karl Tauber + */ +public class FlatThemeFileEditor + extends JFrame +{ + public static void main( String[] args ) { + File file = new File( args.length > 0 + ? args[0] + : "theme-editor-test.properties" ); // TODO + + List baseFiles = new ArrayList<>(); + for( int i = 1; i < args.length; i++ ) + baseFiles.add( new File( args[i] ) ); + + SwingUtilities.invokeLater( () -> { + FlatLightLaf.install(); + FlatInspector.install( "ctrl alt shift X" ); + FlatUIDefaultsInspector.install( "ctrl shift alt Y" ); + + FlatThemeFileEditor frame = new FlatThemeFileEditor(); + + frame.themeEditorArea.setBaseFiles( baseFiles ); + try { + frame.themeEditorArea.load( FileLocation.create( file ) ); + } catch( IOException ex ) { + ex.printStackTrace(); + } + + int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + ((JComponent)frame.getContentPane()).registerKeyboardAction( + e -> frame.themeEditorArea.save(), + KeyStroke.getKeyStroke( KeyEvent.VK_S, menuShortcutKeyMask ), + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + frame.setSize( Math.min( UIScale.scale( 800 ), screenSize.width ), + screenSize.height - UIScale.scale( 100 ) ); + frame.setLocationRelativeTo( null ); + frame.setVisible( true ); + } ); + } + + public FlatThemeFileEditor() { + initComponents(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + dialogPane = new JPanel(); + themeEditorArea = new FlatThemeEditorPane(); + + //======== this ======== + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + setTitle("FlatLaf Theme Editor"); + Container contentPane = getContentPane(); + contentPane.setLayout(new BorderLayout()); + + //======== dialogPane ======== + { + dialogPane.setLayout(new BorderLayout()); + dialogPane.add(themeEditorArea, BorderLayout.CENTER); + } + contentPane.add(dialogPane, BorderLayout.CENTER); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JPanel dialogPane; + private FlatThemeEditorPane themeEditorArea; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd new file mode 100644 index 00000000..7b56ce1d --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.jfd @@ -0,0 +1,27 @@ +JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormWindow( "javax.swing.JFrame", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "this" + "$locationPolicy": 2 + "$sizePolicy": 2 + "defaultCloseOperation": 3 + "title": "FlatLaf Theme Editor" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) { + name: "dialogPane" + add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemeEditorPane" ) { + name: "themeEditorArea" + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( class java.lang.String ) { + "value": "Center" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 535, 300 ) + } ) + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeParser.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeParser.java new file mode 100644 index 00000000..96f80d95 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeParser.java @@ -0,0 +1,64 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import javax.swing.text.Element; +import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rsyntaxtextarea.parser.AbstractParser; +import org.fife.ui.rsyntaxtextarea.parser.DefaultParseResult; +import org.fife.ui.rsyntaxtextarea.parser.DefaultParserNotice; +import org.fife.ui.rsyntaxtextarea.parser.ParseResult; +import com.formdev.flatlaf.UIDefaultsLoaderAccessor; + +/** + * Parser for FlatLaf properties files that checks for invalid values. + * + * @author Karl Tauber + */ +class FlatThemeParser + extends AbstractParser +{ + private final DefaultParseResult result; + + FlatThemeParser() { + result = new DefaultParseResult( this ); + } + + @Override + public ParseResult parse( RSyntaxDocument doc, String style ) { + Element root = doc.getDefaultRootElement(); + + result.clearNotices(); + result.setParsedLines( 0, root.getElementCount() - 1 ); + + for( Token token : doc ) { + if( token.getType() == FlatThemeTokenMaker.TOKEN_COLOR ) { + try { + UIDefaultsLoaderAccessor.parseColorRGBA( token.getLexeme() ); + } catch( IllegalArgumentException ex ) { + result.addNotice( new DefaultParserNotice( this, + "Invalid color.\n\nUse #RRGGBB, #RRGGBBAA, #RGB or #RGBA", + root.getElementIndex( token.getOffset() ), + token.getOffset(), token.length() ) ); + } + } + } + + return result; + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePropertiesSupport.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePropertiesSupport.java new file mode 100644 index 00000000..9fbf9e0d --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemePropertiesSupport.java @@ -0,0 +1,233 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import java.awt.Color; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.function.Function; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import com.formdev.flatlaf.UIDefaultsLoaderAccessor; + +/** + * Supports parsing content of text area in FlatLaf properties syntax. + * + * @author Karl Tauber + */ +class FlatThemePropertiesSupport + implements DocumentListener +{ + private final FlatSyntaxTextArea textArea; + private final Function propertiesGetter; + private final Function resolver; + private Properties propertiesCache; + private final Map parsedValueCache = new HashMap<>(); + + private File[] baseFiles; + private long[] baseFilesLastModified; + private Properties[] basePropertiesCache; + + private Set allKeysCache; + + FlatThemePropertiesSupport( FlatSyntaxTextArea textArea ) { + this.textArea = textArea; + + propertiesGetter = key -> { + return getProperty( key ); + }; + resolver = v -> { + return resolveValue( v ); + }; + + textArea.getDocument().addDocumentListener( this ); + } + + void setBaseFiles( List baseFiles ) { + int size = baseFiles.size(); + this.baseFiles = baseFiles.toArray( new File[size] ); + + baseFilesLastModified = new long[size]; + basePropertiesCache = new Properties[size]; + } + + private String resolveValue( String value ) { + return UIDefaultsLoaderAccessor.resolveValue( value, propertiesGetter ); + } + + Object getParsedValueAtLine( int line ) { + Integer lineKey = line; + Object parsedValue = parsedValueCache.get( lineKey ); + if( parsedValue != null ) + return !(parsedValue instanceof Exception) ? parsedValue : null; + + KeyValue keyValue = getKeyValueAtLine( line ); + if( keyValue == null ) + return null; + + try { + Object[] resultValueType = new Object[1]; + String value = resolveValue( keyValue.value ); + parsedValue = UIDefaultsLoaderAccessor.parseValue( keyValue.key, value, resultValueType, resolver ); + parsedValueCache.put( lineKey, parsedValue ); + return parsedValue; + } catch( Exception ex ) { + System.out.println( ex.getMessage() ); //TODO + parsedValueCache.put( lineKey, ex ); + return null; + } + } + + private KeyValue getKeyValueAtLine( int line ) { + try { + int startOffset = textArea.getLineStartOffset( line ); + int endOffset = textArea.getLineEndOffset( line ); + String text = textArea.getText( startOffset, endOffset - startOffset ); + + Properties properties = new Properties(); + properties.load( new StringReader( text ) ); + if( properties.isEmpty() ) + return null; + + String key = (String) properties.keys().nextElement(); + String value = properties.getProperty( key ); + return new KeyValue( key, value ); + } catch( BadLocationException | IOException ex ) { + // ignore + return null; + } + } + + private String getProperty( String key ) { + // look in current text area + String value = getProperties().getProperty( key ); + if( value != null ) + return value; + + if( baseFiles == null ) + return null; + + // look in base properties files + for( int i = 0; i < baseFiles.length; i++ ) { + value = getBaseProperties( i ).getProperty( key ); + if( value != null ) + return value; + } + + return null; + } + + private Properties getProperties() { + if( propertiesCache != null ) + return propertiesCache; + + propertiesCache = new Properties(); + try { + propertiesCache.load( new StringReader( textArea.getText() ) ); + } catch( IOException ex ) { + ex.printStackTrace(); //TODO + } + return propertiesCache; + } + + private Properties getBaseProperties( int index ) { + long lastModified = baseFiles[index].lastModified(); + if( baseFilesLastModified[index] != lastModified || basePropertiesCache[index] == null ) { + // (re)load base properties file + baseFilesLastModified[index] = lastModified; + basePropertiesCache[index] = new Properties(); + try( InputStream in = new FileInputStream( baseFiles[index] ) ) { + basePropertiesCache[index].load( in ); + } catch( IOException ex ) { + ex.printStackTrace(); //TODO + } + } + + return basePropertiesCache[index]; + } + + Set getAllKeys() { + if( allKeysCache != null ) + return allKeysCache; + + allKeysCache = new HashSet<>(); + + for( Object key : getProperties().keySet() ) + allKeysCache.add( (String) key ); + + for( int i = 0; i < baseFiles.length; i++ ) { + for( Object key : getBaseProperties( i ).keySet() ) + allKeysCache.add( (String) key ); + } + + return allKeysCache; + } + + private void clearCache() { + propertiesCache = null; + parsedValueCache.clear(); + allKeysCache = null; + } + + //---- interface DocumentListener ---- + + @Override + public void insertUpdate( DocumentEvent e ) { + clearCache(); + } + + @Override + public void removeUpdate( DocumentEvent e ) { + clearCache(); + } + + @Override + public void changedUpdate( DocumentEvent e ) { + } + + //---- class KeyValue ----------------------------------------------------- + + static class CacheLineInfo { + Object parsedValue; + Object valueType; + Exception parseError; + + Color origColor; + } + + //---- class KeyValue ----------------------------------------------------- + + static class KeyValue { + final String key; + final String value; + + KeyValue( String key, String value ) { + this.key = key; + this.value = value; + } + } +} diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java new file mode 100644 index 00000000..f8d7adc3 --- /dev/null +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeTokenMaker.java @@ -0,0 +1,232 @@ +/* + * Copyright 2020 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.themeeditor; + +import org.fife.ui.rsyntaxtextarea.OccurrenceMarker; +import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rsyntaxtextarea.TokenMap; +import org.fife.ui.rsyntaxtextarea.TokenTypes; +import org.fife.ui.rsyntaxtextarea.modes.PropertiesFileTokenMaker; + +/** + * Token maker for FlatLaf properties files. + *

+ * Lets the super class parse the properties file and modify the added tokens. + * The super class uses {@link TokenTypes#RESERVED_WORD} for property keys and + * {@link TokenTypes#LITERAL_STRING_DOUBLE_QUOTE} for property values. + * + * @author Karl Tauber + */ +public class FlatThemeTokenMaker + extends PropertiesFileTokenMaker +{ + static final int TOKEN_PROPERTY = Token.IDENTIFIER; + static final int TOKEN_VARIABLE = Token.VARIABLE; + static final int TOKEN_NUMBER = Token.LITERAL_NUMBER_DECIMAL_INT; + static final int TOKEN_COLOR = Token.LITERAL_NUMBER_HEXADECIMAL; + static final int TOKEN_STRING = Token.LITERAL_STRING_DOUBLE_QUOTE; + static final int TOKEN_FUNCTION = Token.FUNCTION; + static final int TOKEN_TYPE = Token.DATA_TYPE; + + private final TokenMap tokenMap = new TokenMap(); + + public FlatThemeTokenMaker() { + // null, false, true + tokenMap.put( "null", Token.RESERVED_WORD ); + tokenMap.put( "false", Token.LITERAL_BOOLEAN ); + tokenMap.put( "true", Token.LITERAL_BOOLEAN ); + + // functions + tokenMap.put( "rgb", TOKEN_FUNCTION ); + tokenMap.put( "rgba", TOKEN_FUNCTION ); + tokenMap.put( "hsl", TOKEN_FUNCTION ); + tokenMap.put( "hsla", TOKEN_FUNCTION ); + tokenMap.put( "lighten", TOKEN_FUNCTION ); + tokenMap.put( "darken", TOKEN_FUNCTION ); + tokenMap.put( "saturate", TOKEN_FUNCTION ); + tokenMap.put( "desaturate", TOKEN_FUNCTION ); + tokenMap.put( "lazy", TOKEN_FUNCTION ); + + // function options + tokenMap.put( "relative", Token.RESERVED_WORD ); + tokenMap.put( "derived", Token.RESERVED_WORD ); + tokenMap.put( "autoInverse", Token.RESERVED_WORD ); + tokenMap.put( "noAutoInverse", Token.RESERVED_WORD ); + } + + /** + * This method is only invoked from the super class. + */ + @Override + public void addToken( char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink ) { +// debugInputToken( array, start, end, tokenType, startOffset, hyperlink ); + + // ignore invalid token + if( end < start ) + return; + + if( tokenType == Token.RESERVED_WORD ) { + // key + int newTokenType = (array[start] == '@') ? TOKEN_VARIABLE : TOKEN_PROPERTY; + super.addToken( array, start, end, newTokenType, startOffset, hyperlink ); + } else if( tokenType == Token.LITERAL_STRING_DOUBLE_QUOTE ) { + // value + tokenizeValue( array, start, end, startOffset ); + } else if( tokenType == Token.VARIABLE ) { + // '{variable}' + super.addToken( array, start, end, TOKEN_TYPE, startOffset, hyperlink ); + } else { + // comments or operators + super.addToken( array, start, end, tokenType, startOffset, hyperlink ); + } + } + + private void tokenizeValue( char[] array, int start, int end, int startOffset ) { + int newStartOffset = startOffset - start; + + int currentTokenStart = start; + int currentTokenType = Token.NULL; + int parenthesisLevel = 0; + + for( int i = start; i <= end; i++ ) { + int newTokenType; + char ch = array[i]; + if( ch <= ' ' ) + newTokenType = Token.WHITESPACE; + else if( ch == '#' || (currentTokenType == TOKEN_COLOR && RSyntaxUtilities.isHexCharacter( ch )) ) + newTokenType = TOKEN_COLOR; + else if( ch == '$' || (currentTokenType == TOKEN_PROPERTY && isPropertyChar( ch )) ) + newTokenType = TOKEN_PROPERTY; + else if( ch == '@' || (currentTokenType == TOKEN_VARIABLE && isPropertyChar( ch )) ) + newTokenType = TOKEN_VARIABLE; + else if( currentTokenType != TOKEN_STRING && (RSyntaxUtilities.isDigit( ch ) || (currentTokenType == TOKEN_NUMBER && ch == '.')) ) + newTokenType = TOKEN_NUMBER; + else if( ch == ',' || ch == '(' || ch == ')' || ch == '"' || ch == '%' ) + newTokenType = TokenTypes.OPERATOR; + else + newTokenType = TOKEN_STRING; + + if( currentTokenType == Token.NULL ) + currentTokenType = newTokenType; + else if( newTokenType != currentTokenType ) { + addTokenImpl( array, currentTokenStart, i - 1, currentTokenType, newStartOffset + currentTokenStart, parenthesisLevel ); + currentTokenType = newTokenType; + currentTokenStart = i; + } + + if( ch == '(' ) + parenthesisLevel++; + else if( ch == ')' ) + parenthesisLevel--; + } + + if( currentTokenType != Token.NULL ) + addTokenImpl( array, currentTokenStart, end, currentTokenType, newStartOffset + currentTokenStart, parenthesisLevel ); + } + + private void addTokenImpl( char[] array, int start, int end, int tokenType, int startOffset, int parenthesisLevel ) { + if( tokenType == TOKEN_PROPERTY && array[start] == '$' ) { + // separate '$' from property token for mark occurrences to work + super.addToken( array, start, start, TokenTypes.OPERATOR, startOffset, false ); + start++; + startOffset++; + } else if( tokenType == TOKEN_STRING ) { + // check for reserved words, functions, etc + int type = tokenMap.get( array, start, end ); + if( type != -1 ) + tokenType = type; + else if( parenthesisLevel > 0 ) { + // assume property reference if in function parameters + tokenType = TOKEN_PROPERTY; + } + } + +// debugOutputToken( array, start, end, tokenType ); + super.addToken( array, start, end, tokenType, startOffset, false ); + } + + private boolean isPropertyChar( char ch ) { + return RSyntaxUtilities.isLetterOrDigit( ch ) || ch == '.' || ch == '_' || ch == '-'; + } + + @Override + protected OccurrenceMarker createOccurrenceMarker() { + return new FlatOccurrenceMarker( super.createOccurrenceMarker() ); + } + + @Override + public boolean getMarkOccurrencesOfTokenType( int type ) { + switch( type ) { + case TOKEN_PROPERTY: + case TOKEN_VARIABLE: + case TOKEN_COLOR: + case TOKEN_FUNCTION: + case TOKEN_TYPE: + return true; + + default: + return false; + } + } + +/*debug + private java.util.HashMap tokenTypeStrMap; + + private void debugInputToken( char[] array, int start, int end, int tokenType, int startOffset, boolean hyperlink ) { + if( tokenTypeStrMap == null ) { + tokenTypeStrMap = new java.util.HashMap<>(); + for( java.lang.reflect.Field f : TokenTypes.class.getFields() ) { + try { + tokenTypeStrMap.put( (Integer) f.get( null ), f.getName() ); + } catch( IllegalArgumentException | IllegalAccessException ex ) { + ex.printStackTrace(); + } + } + } + + String tokenTypeStr = tokenTypeStrMap.computeIfAbsent( tokenType, t -> { + return "(unknown " + t + ")"; + } ); + + System.out.printf( "%d-%d (%d) %-30s '%s'\n", + start, end, end - start, tokenTypeStr, new String( array, start, end - start + 1 ) ); + } + + private void debugOutputToken( char[] array, int start, int end, int tokenType ) { + String tokenTypeStr = null; + switch( tokenType ) { + case TOKEN_PROPERTY: tokenTypeStr = "PROPERTY"; break; + case TOKEN_VARIABLE: tokenTypeStr = "VARIABLE"; break; + case TOKEN_NUMBER: tokenTypeStr = "NUMBER"; break; + case TOKEN_COLOR: tokenTypeStr = "COLOR"; break; + case TOKEN_STRING: tokenTypeStr = "STRING"; break; + case TOKEN_FUNCTION: tokenTypeStr = "FUNCTION"; break; + case TOKEN_TYPE: tokenTypeStr = "TYPE"; break; + case TokenTypes.OPERATOR: tokenTypeStr = "OPERATOR"; break; + case TokenTypes.WHITESPACE: tokenTypeStr = "WHITESPACE"; break; + case TokenTypes.LITERAL_BOOLEAN: tokenTypeStr = "BOOLEAN"; break; + case TokenTypes.RESERVED_WORD: tokenTypeStr = "RESERVED_WORD"; break; + default: + throw new IllegalArgumentException( String.valueOf( tokenType ) ); + } + + System.out.printf( " %d-%d (%d) %-15s '%s'\n", + start, end, end - start, tokenTypeStr, new String( array, start, end - start + 1 ) ); + } +debug*/ +} diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt new file mode 100644 index 00000000..52c3803d --- /dev/null +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt @@ -0,0 +1,944 @@ +Actions.Blue +Actions.Green +Actions.Grey +Actions.GreyInline +Actions.Red +Actions.Yellow +AuditoryCues.allAuditoryCues +AuditoryCues.cueList +AuditoryCues.noAuditoryCues +BusyLabelUI +Button.arc +Button.background +Button.border +Button.borderColor +Button.borderWidth +Button.darkShadow +Button.default.background +Button.default.boldText +Button.default.borderColor +Button.default.borderWidth +Button.default.focusColor +Button.default.focusedBackground +Button.default.focusedBorderColor +Button.default.foreground +Button.default.hoverBackground +Button.default.hoverBorderColor +Button.default.pressedBackground +Button.defaultButtonFollowsFocus +Button.disabledBackground +Button.disabledBorderColor +Button.disabledSelectedBackground +Button.disabledText +Button.focusInputMap +Button.focusedBackground +Button.focusedBorderColor +Button.font +Button.foreground +Button.highlight +Button.hoverBackground +Button.hoverBorderColor +Button.iconTextGap +Button.light +Button.margin +Button.minimumWidth +Button.pressedBackground +Button.rollover +Button.selectedBackground +Button.selectedForeground +Button.shadow +Button.textIconGap +Button.textShiftOffset +Button.toolbar.hoverBackground +Button.toolbar.margin +Button.toolbar.pressedBackground +Button.toolbar.selectedBackground +Button.toolbar.spacingInsets +ButtonUI +Caret.width +CheckBox.arc +CheckBox.background +CheckBox.border +CheckBox.disabledText +CheckBox.focusInputMap +CheckBox.font +CheckBox.foreground +CheckBox.icon +CheckBox.icon.background +CheckBox.icon.borderColor +CheckBox.icon.checkmarkColor +CheckBox.icon.disabledBackground +CheckBox.icon.disabledBorderColor +CheckBox.icon.disabledCheckmarkColor +CheckBox.icon.focusedBackground +CheckBox.icon.focusedBorderColor +CheckBox.icon.hoverBackground +CheckBox.icon.hoverBorderColor +CheckBox.icon.pressedBackground +CheckBox.icon.selectedBackground +CheckBox.icon.selectedBorderColor +CheckBox.icon.selectedFocusedBorderColor +CheckBox.icon.style +CheckBox.iconTextGap +CheckBox.icon[filled].checkmarkColor +CheckBox.icon[filled].selectedBackground +CheckBox.icon[filled].selectedBorderColor +CheckBox.icon[filled].selectedFocusedBackground +CheckBox.icon[filled].selectedFocusedBorderColor +CheckBox.icon[filled].selectedFocusedCheckmarkColor +CheckBox.icon[filled].selectedHoverBackground +CheckBox.icon[filled].selectedPressedBackground +CheckBox.margin +CheckBox.rollover +CheckBox.textIconGap +CheckBox.textShiftOffset +CheckBoxMenuItem.acceleratorFont +CheckBoxMenuItem.acceleratorForeground +CheckBoxMenuItem.acceleratorSelectionForeground +CheckBoxMenuItem.arrowIcon +CheckBoxMenuItem.background +CheckBoxMenuItem.border +CheckBoxMenuItem.borderPainted +CheckBoxMenuItem.checkIcon +CheckBoxMenuItem.disabledForeground +CheckBoxMenuItem.font +CheckBoxMenuItem.foreground +CheckBoxMenuItem.margin +CheckBoxMenuItem.opaque +CheckBoxMenuItem.selectionBackground +CheckBoxMenuItem.selectionForeground +CheckBoxMenuItemUI +CheckBoxUI +ColorChooser.background +ColorChooser.font +ColorChooser.foreground +ColorChooser.swatchesDefaultRecentColor +ColorChooser.swatchesRecentSwatchSize +ColorChooser.swatchesSwatchSize +ColorChooserUI +ComboBox.ancestorInputMap +ComboBox.background +ComboBox.border +ComboBox.buttonArrowColor +ComboBox.buttonBackground +ComboBox.buttonDarkShadow +ComboBox.buttonDisabledArrowColor +ComboBox.buttonEditableBackground +ComboBox.buttonHighlight +ComboBox.buttonHoverArrowColor +ComboBox.buttonShadow +ComboBox.buttonStyle +ComboBox.disabledBackground +ComboBox.disabledForeground +ComboBox.editorColumns +ComboBox.font +ComboBox.foreground +ComboBox.isEnterSelectablePopup +ComboBox.maximumRowCount +ComboBox.minimumWidth +ComboBox.noActionOnKeyNavigation +ComboBox.padding +ComboBox.selectionBackground +ComboBox.selectionForeground +ComboBox.timeFactor +ComboBoxUI +Component.arc +Component.arrowType +Component.borderColor +Component.custom.borderColor +Component.disabledBorderColor +Component.error.borderColor +Component.error.focusedBorderColor +Component.focusColor +Component.focusWidth +Component.focusedBorderColor +Component.grayFilter +Component.hideMnemonics +Component.innerFocusWidth +Component.innerOutlineWidth +Component.linkColor +Component.minimumWidth +Component.warning.borderColor +Component.warning.focusedBorderColor +DatePickerUI +Desktop.ancestorInputMap +Desktop.background +Desktop.minOnScreenInsets +DesktopIcon.background +DesktopIcon.border +DesktopIcon.closeIcon +DesktopIcon.closeSize +DesktopIcon.foreground +DesktopIcon.iconSize +DesktopIconUI +DesktopPaneUI +EditorPane.background +EditorPane.border +EditorPane.caretBlinkRate +EditorPane.caretForeground +EditorPane.disabledBackground +EditorPane.focusInputMap +EditorPane.font +EditorPane.foreground +EditorPane.inactiveBackground +EditorPane.inactiveForeground +EditorPane.margin +EditorPane.selectionBackground +EditorPane.selectionForeground +EditorPaneUI +FileChooser.ancestorInputMap +FileChooser.detailsViewIcon +FileChooser.homeFolderIcon +FileChooser.listViewIcon +FileChooser.newFolderIcon +FileChooser.readOnly +FileChooser.upFolderIcon +FileChooser.useSystemExtensionHiding +FileChooser.usesSingleFilePane +FileChooserUI +FileView.computerIcon +FileView.directoryIcon +FileView.fileIcon +FileView.floppyDriveIcon +FileView.hardDriveIcon +FormattedTextField.background +FormattedTextField.border +FormattedTextField.caretBlinkRate +FormattedTextField.caretForeground +FormattedTextField.disabledBackground +FormattedTextField.focusInputMap +FormattedTextField.font +FormattedTextField.foreground +FormattedTextField.inactiveBackground +FormattedTextField.inactiveForeground +FormattedTextField.margin +FormattedTextField.placeholderForeground +FormattedTextField.selectionBackground +FormattedTextField.selectionForeground +FormattedTextFieldUI +HeaderUI +HelpButton.background +HelpButton.borderColor +HelpButton.disabledBackground +HelpButton.disabledBorderColor +HelpButton.disabledQuestionMarkColor +HelpButton.focusedBackground +HelpButton.focusedBorderColor +HelpButton.hoverBackground +HelpButton.hoverBorderColor +HelpButton.icon +HelpButton.pressedBackground +HelpButton.questionMarkColor +Hyperlink.disabledText +Hyperlink.linkColor +Hyperlink.visitedColor +HyperlinkUI +InternalFrame.activeBorderColor +InternalFrame.activeDropShadowInsets +InternalFrame.activeDropShadowOpacity +InternalFrame.activeTitleBackground +InternalFrame.activeTitleForeground +InternalFrame.border +InternalFrame.borderColor +InternalFrame.borderDarkShadow +InternalFrame.borderHighlight +InternalFrame.borderLight +InternalFrame.borderLineWidth +InternalFrame.borderMargins +InternalFrame.borderShadow +InternalFrame.buttonHoverBackground +InternalFrame.buttonPressedBackground +InternalFrame.buttonSize +InternalFrame.closeHoverBackground +InternalFrame.closeHoverForeground +InternalFrame.closeIcon +InternalFrame.closePressedBackground +InternalFrame.closePressedForeground +InternalFrame.dropShadowPainted +InternalFrame.icon +InternalFrame.iconifyIcon +InternalFrame.inactiveBorderColor +InternalFrame.inactiveDropShadowInsets +InternalFrame.inactiveDropShadowOpacity +InternalFrame.inactiveTitleBackground +InternalFrame.inactiveTitleForeground +InternalFrame.maximizeIcon +InternalFrame.minimizeIcon +InternalFrame.titleFont +InternalFrameTitlePane.border +InternalFrameTitlePane.closeButtonOpacity +InternalFrameTitlePane.iconifyButtonOpacity +InternalFrameTitlePane.maximizeButtonOpacity +InternalFrameUI +JXBusyLabel.baseColor +JXBusyLabel.highlightColor +JXDatePicker.border +JXHeader.background +JXHeader.startBackground +JXMonthView.arrowColor +JXMonthView.background +JXMonthView.daysOfTheWeekForeground +JXMonthView.disabledArrowColor +JXMonthView.flaggedDayForeground +JXMonthView.leadingDayForeground +JXMonthView.monthDownFileName +JXMonthView.monthStringBackground +JXMonthView.monthStringForeground +JXMonthView.monthUpFileName +JXMonthView.selectedBackground +JXMonthView.trailingDayForeground +JXMonthView.unselectableDayForeground +JXMonthView.weekOfTheYearForeground +JXTitledPanel.borderColor +JXTitledPanel.captionInsets +JXTitledPanel.titleBackground +JXTitledPanel.titleForeground +JideTabbedPane.background +JideTabbedPane.contentBorderInsets +JideTabbedPane.foreground +JideTabbedPane.shadow +JideTabbedPane.tabAreaBackground +JideTabbedPane.tabAreaInsets +JideTabbedPane.tabInsets +JideTabbedPane.tabRunOverlay +JideTabbedPaneUI +Label.background +Label.disabledForeground +Label.disabledShadow +Label.font +Label.foreground +LabelUI +List.background +List.border +List.cellFocusColor +List.cellMargins +List.cellNoFocusBorder +List.cellRenderer +List.dropCellBackground +List.dropCellForeground +List.dropLineColor +List.focusCellHighlightBorder +List.focusInputMap +List.focusInputMap.RightToLeft +List.focusSelectedCellHighlightBorder +List.font +List.foreground +List.noFocusBorder +List.selectionBackground +List.selectionForeground +List.selectionInactiveBackground +List.selectionInactiveForeground +List.showCellFocusIndicator +List.timeFactor +ListUI +Menu.acceleratorFont +Menu.acceleratorForeground +Menu.acceleratorSelectionForeground +Menu.arrowIcon +Menu.background +Menu.border +Menu.borderPainted +Menu.cancelMode +Menu.crossMenuMnemonic +Menu.disabledForeground +Menu.font +Menu.foreground +Menu.icon.arrowColor +Menu.icon.disabledArrowColor +Menu.margin +Menu.menuPopupOffsetX +Menu.menuPopupOffsetY +Menu.opaque +Menu.preserveTopLevelSelection +Menu.selectionBackground +Menu.selectionForeground +Menu.shortcutKeys +Menu.submenuPopupOffsetX +Menu.submenuPopupOffsetY +MenuBar.background +MenuBar.border +MenuBar.borderColor +MenuBar.font +MenuBar.foreground +MenuBar.highlight +MenuBar.hoverBackground +MenuBar.itemMargins +MenuBar.shadow +MenuBar.windowBindings +MenuBarUI +MenuItem.acceleratorArrowGap +MenuItem.acceleratorDelimiter +MenuItem.acceleratorFont +MenuItem.acceleratorForeground +MenuItem.acceleratorSelectionForeground +MenuItem.arrowIcon +MenuItem.background +MenuItem.border +MenuItem.borderPainted +MenuItem.checkBackground +MenuItem.checkMargins +MenuItem.disabledForeground +MenuItem.font +MenuItem.foreground +MenuItem.iconTextGap +MenuItem.margin +MenuItem.minimumIconSize +MenuItem.minimumWidth +MenuItem.opaque +MenuItem.selectionBackground +MenuItem.selectionForeground +MenuItem.textAcceleratorGap +MenuItem.textNoAcceleratorGap +MenuItem.underlineSelectionBackground +MenuItem.underlineSelectionCheckBackground +MenuItem.underlineSelectionColor +MenuItem.underlineSelectionHeight +MenuItemCheckBox.icon.checkmarkColor +MenuItemCheckBox.icon.disabledCheckmarkColor +MenuItemUI +MenuUI +MonthViewUI +Objects.BlackText +Objects.Blue +Objects.Green +Objects.GreenAndroid +Objects.Grey +Objects.Pink +Objects.Purple +Objects.Red +Objects.RedStatus +Objects.Yellow +Objects.YellowDark +OptionPane.background +OptionPane.border +OptionPane.buttonAreaBorder +OptionPane.buttonClickThreshhold +OptionPane.buttonMinimumWidth +OptionPane.buttonOrientation +OptionPane.buttonPadding +OptionPane.errorIcon +OptionPane.font +OptionPane.foreground +OptionPane.iconMessageGap +OptionPane.informationIcon +OptionPane.maxCharactersPerLine +OptionPane.messageAreaBorder +OptionPane.messagePadding +OptionPane.minimumSize +OptionPane.questionIcon +OptionPane.sameSizeButtons +OptionPane.setButtonMargin +OptionPane.warningIcon +OptionPane.windowBindings +OptionPaneUI +Panel.background +Panel.font +Panel.foreground +PanelUI +PasswordField.background +PasswordField.border +PasswordField.capsLockIcon +PasswordField.capsLockIconColor +PasswordField.caretBlinkRate +PasswordField.caretForeground +PasswordField.disabledBackground +PasswordField.echoChar +PasswordField.focusInputMap +PasswordField.font +PasswordField.foreground +PasswordField.inactiveBackground +PasswordField.inactiveForeground +PasswordField.margin +PasswordField.placeholderForeground +PasswordField.selectionBackground +PasswordField.selectionForeground +PasswordField.showCapsLock +PasswordFieldUI +Popup.dropShadowColor +Popup.dropShadowInsets +Popup.dropShadowOpacity +Popup.dropShadowPainted +PopupMenu.background +PopupMenu.border +PopupMenu.borderColor +PopupMenu.borderInsets +PopupMenu.consumeEventOnClose +PopupMenu.font +PopupMenu.foreground +PopupMenu.selectedWindowInputMapBindings +PopupMenu.selectedWindowInputMapBindings.RightToLeft +PopupMenuSeparator.height +PopupMenuSeparator.stripeIndent +PopupMenuSeparator.stripeWidth +PopupMenuSeparatorUI +PopupMenuUI +ProgressBar.arc +ProgressBar.background +ProgressBar.border +ProgressBar.cellLength +ProgressBar.cellSpacing +ProgressBar.cycleTime +ProgressBar.font +ProgressBar.foreground +ProgressBar.horizontalSize +ProgressBar.repaintInterval +ProgressBar.selectionBackground +ProgressBar.selectionForeground +ProgressBar.verticalSize +ProgressBarUI +RadioButton.background +RadioButton.border +RadioButton.darkShadow +RadioButton.disabledText +RadioButton.focusInputMap +RadioButton.font +RadioButton.foreground +RadioButton.highlight +RadioButton.icon +RadioButton.icon.centerDiameter +RadioButton.iconTextGap +RadioButton.icon[filled].centerDiameter +RadioButton.light +RadioButton.margin +RadioButton.rollover +RadioButton.shadow +RadioButton.textIconGap +RadioButton.textShiftOffset +RadioButtonMenuItem.acceleratorFont +RadioButtonMenuItem.acceleratorForeground +RadioButtonMenuItem.acceleratorSelectionForeground +RadioButtonMenuItem.arrowIcon +RadioButtonMenuItem.background +RadioButtonMenuItem.border +RadioButtonMenuItem.borderPainted +RadioButtonMenuItem.checkIcon +RadioButtonMenuItem.disabledForeground +RadioButtonMenuItem.font +RadioButtonMenuItem.foreground +RadioButtonMenuItem.margin +RadioButtonMenuItem.opaque +RadioButtonMenuItem.selectionBackground +RadioButtonMenuItem.selectionForeground +RadioButtonMenuItemUI +RadioButtonUI +Resizable.resizeBorder +RootPane.activeBorderColor +RootPane.ancestorInputMap +RootPane.border +RootPane.borderDragThickness +RootPane.cornerDragWidth +RootPane.defaultButtonWindowKeyBindings +RootPane.honorDialogMinimumSizeOnResize +RootPane.honorFrameMinimumSizeOnResize +RootPane.inactiveBorderColor +RootPaneUI +ScrollBar.allowsAbsolutePositioning +ScrollBar.ancestorInputMap +ScrollBar.ancestorInputMap.RightToLeft +ScrollBar.background +ScrollBar.buttonArrowColor +ScrollBar.buttonDisabledArrowColor +ScrollBar.foreground +ScrollBar.hoverButtonBackground +ScrollBar.hoverThumbColor +ScrollBar.hoverThumbWithTrack +ScrollBar.hoverTrackColor +ScrollBar.maximumThumbSize +ScrollBar.minimumThumbSize +ScrollBar.pressedButtonBackground +ScrollBar.pressedThumbColor +ScrollBar.pressedThumbWithTrack +ScrollBar.showButtons +ScrollBar.squareButtons +ScrollBar.thumb +ScrollBar.thumbArc +ScrollBar.thumbDarkShadow +ScrollBar.thumbHighlight +ScrollBar.thumbInsets +ScrollBar.thumbShadow +ScrollBar.track +ScrollBar.trackArc +ScrollBar.trackHighlight +ScrollBar.trackInsets +ScrollBar.width +ScrollBarUI +ScrollPane.ancestorInputMap +ScrollPane.ancestorInputMap.RightToLeft +ScrollPane.background +ScrollPane.border +ScrollPane.fillUpperCorner +ScrollPane.font +ScrollPane.foreground +ScrollPane.smoothScrolling +ScrollPaneUI +Separator.background +Separator.foreground +Separator.height +Separator.highlight +Separator.shadow +Separator.stripeIndent +Separator.stripeWidth +SeparatorUI +Slider.background +Slider.disabledForeground +Slider.focus +Slider.focusInputMap +Slider.focusInputMap.RightToLeft +Slider.focusInsets +Slider.font +Slider.foreground +Slider.highlight +Slider.horizontalSize +Slider.hoverColor +Slider.minimumHorizontalSize +Slider.minimumVerticalSize +Slider.onlyLeftMouseButtonDrag +Slider.shadow +Slider.thumbColor +Slider.thumbWidth +Slider.tickColor +Slider.trackColor +Slider.trackWidth +Slider.verticalSize +SliderUI +Spinner.ancestorInputMap +Spinner.arrowButtonSize +Spinner.background +Spinner.border +Spinner.buttonArrowColor +Spinner.buttonBackground +Spinner.buttonDisabledArrowColor +Spinner.buttonHoverArrowColor +Spinner.buttonStyle +Spinner.disabledBackground +Spinner.disabledForeground +Spinner.editorAlignment +Spinner.editorBorderPainted +Spinner.font +Spinner.foreground +Spinner.padding +SpinnerUI +SplitPane.ancestorInputMap +SplitPane.background +SplitPane.centerOneTouchButtons +SplitPane.continuousLayout +SplitPane.darkShadow +SplitPane.dividerSize +SplitPane.highlight +SplitPane.oneTouchButtonOffset +SplitPane.oneTouchButtonSize +SplitPane.shadow +SplitPaneDivider.draggingColor +SplitPaneDivider.oneTouchArrowColor +SplitPaneDivider.oneTouchHoverArrowColor +SplitPaneUI +TabbedPane.ancestorInputMap +TabbedPane.background +TabbedPane.closeArc +TabbedPane.closeCrossFilledSize +TabbedPane.closeCrossLineWidth +TabbedPane.closeCrossPlainSize +TabbedPane.closeForeground +TabbedPane.closeHoverBackground +TabbedPane.closeHoverForeground +TabbedPane.closeIcon +TabbedPane.closePressedBackground +TabbedPane.closePressedForeground +TabbedPane.closeSize +TabbedPane.contentAreaColor +TabbedPane.contentOpaque +TabbedPane.contentSeparatorHeight +TabbedPane.darkShadow +TabbedPane.disabledForeground +TabbedPane.disabledUnderlineColor +TabbedPane.focus +TabbedPane.focusColor +TabbedPane.focusInputMap +TabbedPane.font +TabbedPane.foreground +TabbedPane.hasFullBorder +TabbedPane.hiddenTabsNavigation +TabbedPane.highlight +TabbedPane.hoverColor +TabbedPane.labelShift +TabbedPane.light +TabbedPane.selectedLabelShift +TabbedPane.selectedTabPadInsets +TabbedPane.selectionFollowsFocus +TabbedPane.shadow +TabbedPane.showTabSeparators +TabbedPane.tabAreaAlignment +TabbedPane.tabAreaInsets +TabbedPane.tabHeight +TabbedPane.tabInsets +TabbedPane.tabRunOverlay +TabbedPane.tabSelectionHeight +TabbedPane.tabSeparatorsFullHeight +TabbedPane.tabsOpaque +TabbedPane.tabsOverlapBorder +TabbedPane.textIconGap +TabbedPane.underlineColor +TabbedPaneUI +Table.ancestorInputMap +Table.ancestorInputMap.RightToLeft +Table.ascendingSortIcon +Table.background +Table.cellFocusColor +Table.cellMargins +Table.cellNoFocusBorder +Table.consistentHomeEndKeyBehavior +Table.descendingSortIcon +Table.dropCellBackground +Table.dropCellForeground +Table.dropLineColor +Table.dropLineShortColor +Table.focusCellBackground +Table.focusCellForeground +Table.focusCellHighlightBorder +Table.focusSelectedCellHighlightBorder +Table.font +Table.foreground +Table.gridColor +Table.intercellSpacing +Table.rowHeight +Table.scrollPaneBorder +Table.selectionBackground +Table.selectionForeground +Table.selectionInactiveBackground +Table.selectionInactiveForeground +Table.showHorizontalLines +Table.showVerticalLines +Table.sortIconColor +TableHeader.ancestorInputMap +TableHeader.background +TableHeader.bottomSeparatorColor +TableHeader.cellBorder +TableHeader.focusCellBackground +TableHeader.font +TableHeader.foreground +TableHeader.height +TableHeader.separatorColor +TableHeaderUI +TableUI +TaskPane.background +TaskPane.borderColor +TaskPane.contentInsets +TaskPane.specialTitleBackground +TaskPane.specialTitleForeground +TaskPane.specialTitleOver +TaskPane.titleBackgroundGradientStart +TaskPane.titleForeground +TaskPane.titleOver +TaskPaneContainer.background +TaskPaneContainer.border +TextArea.background +TextArea.border +TextArea.caretBlinkRate +TextArea.caretForeground +TextArea.disabledBackground +TextArea.focusInputMap +TextArea.font +TextArea.foreground +TextArea.inactiveBackground +TextArea.inactiveForeground +TextArea.margin +TextArea.selectionBackground +TextArea.selectionForeground +TextAreaUI +TextComponent.arc +TextComponent.selectAllOnFocusPolicy +TextField.background +TextField.border +TextField.caretBlinkRate +TextField.caretForeground +TextField.darkShadow +TextField.disabledBackground +TextField.focusInputMap +TextField.font +TextField.foreground +TextField.highlight +TextField.inactiveBackground +TextField.inactiveForeground +TextField.light +TextField.margin +TextField.placeholderForeground +TextField.selectionBackground +TextField.selectionForeground +TextField.shadow +TextFieldUI +TextPane.background +TextPane.border +TextPane.caretBlinkRate +TextPane.caretForeground +TextPane.disabledBackground +TextPane.focusInputMap +TextPane.font +TextPane.foreground +TextPane.inactiveBackground +TextPane.inactiveForeground +TextPane.margin +TextPane.selectionBackground +TextPane.selectionForeground +TextPaneUI +TitlePane.background +TitlePane.buttonHoverBackground +TitlePane.buttonMaximizedHeight +TitlePane.buttonPressedBackground +TitlePane.buttonSize +TitlePane.closeHoverBackground +TitlePane.closeHoverForeground +TitlePane.closeIcon +TitlePane.closePressedBackground +TitlePane.closePressedForeground +TitlePane.embeddedForeground +TitlePane.foreground +TitlePane.iconMargins +TitlePane.iconSize +TitlePane.iconifyIcon +TitlePane.inactiveBackground +TitlePane.inactiveForeground +TitlePane.maximizeIcon +TitlePane.menuBarEmbedded +TitlePane.menuBarMargins +TitlePane.restoreIcon +TitlePane.titleMargins +TitledBorder.border +TitledBorder.font +TitledBorder.titleColor +TitledPanelUI +ToggleButton.background +ToggleButton.border +ToggleButton.darkShadow +ToggleButton.disabledBackground +ToggleButton.disabledSelectedBackground +ToggleButton.disabledText +ToggleButton.focusInputMap +ToggleButton.font +ToggleButton.foreground +ToggleButton.highlight +ToggleButton.iconTextGap +ToggleButton.light +ToggleButton.margin +ToggleButton.pressedBackground +ToggleButton.rollover +ToggleButton.selectedBackground +ToggleButton.selectedForeground +ToggleButton.shadow +ToggleButton.tab.disabledUnderlineColor +ToggleButton.tab.focusBackground +ToggleButton.tab.hoverBackground +ToggleButton.tab.underlineColor +ToggleButton.tab.underlineHeight +ToggleButton.textIconGap +ToggleButton.textShiftOffset +ToggleButton.toolbar.hoverBackground +ToggleButton.toolbar.pressedBackground +ToggleButton.toolbar.selectedBackground +ToggleButtonUI +ToolBar.ancestorInputMap +ToolBar.background +ToolBar.border +ToolBar.borderMargins +ToolBar.darkShadow +ToolBar.dockingBackground +ToolBar.dockingForeground +ToolBar.floatingBackground +ToolBar.floatingForeground +ToolBar.font +ToolBar.foreground +ToolBar.gripColor +ToolBar.highlight +ToolBar.isRollover +ToolBar.light +ToolBar.separatorColor +ToolBar.separatorWidth +ToolBar.shadow +ToolBar.spacingBorder +ToolBarSeparatorUI +ToolBarUI +ToolTip.background +ToolTip.border +ToolTip.font +ToolTip.foreground +ToolTipManager.enableToolTipMode +ToolTipUI +Tree.ancestorInputMap +Tree.background +Tree.border +Tree.changeSelectionWithFocus +Tree.closedIcon +Tree.collapsedIcon +Tree.drawsFocusBorderAroundIcon +Tree.dropCellBackground +Tree.dropCellForeground +Tree.dropLineColor +Tree.editorBorder +Tree.expandedIcon +Tree.focusInputMap +Tree.focusInputMap.RightToLeft +Tree.font +Tree.foreground +Tree.hash +Tree.icon.closedColor +Tree.icon.collapsedColor +Tree.icon.expandedColor +Tree.icon.leafColor +Tree.icon.openColor +Tree.leafIcon +Tree.leftChildIndent +Tree.lineTypeDashed +Tree.openIcon +Tree.paintLines +Tree.rendererFillBackground +Tree.rendererMargins +Tree.repaintWholeRow +Tree.rightChildIndent +Tree.rowHeight +Tree.scrollsOnExpand +Tree.selectionBackground +Tree.selectionBorderColor +Tree.selectionForeground +Tree.selectionInactiveBackground +Tree.selectionInactiveForeground +Tree.showCellFocusIndicator +Tree.textBackground +Tree.textForeground +Tree.timeFactor +Tree.wideSelection +TreeUI +Viewport.background +Viewport.font +Viewport.foreground +ViewportUI +activeCaption +activeCaptionBorder +activeCaptionText +control +controlDkShadow +controlHighlight +controlLtHighlight +controlShadow +controlText +defaultFont +desktop +html.missingImage +html.pendingImage +inactiveCaption +inactiveCaptionBorder +inactiveCaptionText +info +infoText +laf.dark +laf.scaleFactor +menu +menuText +scrollbar +swingx/TaskPaneUI +text +textHighlight +textHighlightText +textInactiveText +textText +window +windowBorder +windowText diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml new file mode 100644 index 00000000..22d780ec --- /dev/null +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/light.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +