mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Compare commits
68 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9612a81f2e | ||
|
|
2945a36cef | ||
|
|
b84dc5bfcc | ||
|
|
60486fd880 | ||
|
|
891091cebc | ||
|
|
1493ddcf41 | ||
|
|
4299c50537 | ||
|
|
14577c396d | ||
|
|
e9b566241d | ||
|
|
d39b08c035 | ||
|
|
69ac683c8c | ||
|
|
eafd0b3d06 | ||
|
|
310a4989dc | ||
|
|
3d0df51839 | ||
|
|
ede02aaaa5 | ||
|
|
beff149004 | ||
|
|
07db6e8fb0 | ||
|
|
46852c0780 | ||
|
|
a5e41c573f | ||
|
|
9a94395d30 | ||
|
|
04aa61c2bb | ||
|
|
035a13df54 | ||
|
|
e8a6f0ca3d | ||
|
|
1fc519b9de | ||
|
|
2bcf38e2e3 | ||
|
|
8eb44a68cb | ||
|
|
30c7b442a8 | ||
|
|
cee2211108 | ||
|
|
b7bcbccd45 | ||
|
|
d2ccb97eba | ||
|
|
39d56f2603 | ||
|
|
83e904dd2d | ||
|
|
110c787eba | ||
|
|
7c7ff289de | ||
|
|
617a35c51b | ||
|
|
73487ccf65 | ||
|
|
712bff9c99 | ||
|
|
eedfcf86aa | ||
|
|
f730848928 | ||
|
|
61d0574c5c | ||
|
|
2f01e01ec1 | ||
|
|
cbcf66df7f | ||
|
|
cfaeea039b | ||
|
|
a891d1eb54 | ||
|
|
4372052ef0 | ||
|
|
8734b062dc | ||
|
|
343451de65 | ||
|
|
144d65c776 | ||
|
|
a6815574f7 | ||
|
|
e5a116a0d4 | ||
|
|
0beef6b108 | ||
|
|
7341008449 | ||
|
|
49bd53194a | ||
|
|
baf4437efc | ||
|
|
b244f80f81 | ||
|
|
e41c91a42b | ||
|
|
b9a2e3ceac | ||
|
|
fa7dd3bdc4 | ||
|
|
9a8c68b846 | ||
|
|
698e33ddf4 | ||
|
|
909258ba14 | ||
|
|
2ad6bd1d23 | ||
|
|
510ffd41d8 | ||
|
|
4f00591c4e | ||
|
|
5b65ed87cd | ||
|
|
b0121c422d | ||
|
|
a9e9fad222 | ||
|
|
b5fc07acc7 |
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -15,8 +15,12 @@
|
|||||||
# BINARY FILES:
|
# BINARY FILES:
|
||||||
# Disable line ending normalize on checkin.
|
# Disable line ending normalize on checkin.
|
||||||
|
|
||||||
|
*.dll binary
|
||||||
|
*.dylib binary
|
||||||
*.gif binary
|
*.gif binary
|
||||||
*.jar binary
|
*.jar binary
|
||||||
|
*.lib binary
|
||||||
*.png binary
|
*.png binary
|
||||||
*.sketch binary
|
*.sketch binary
|
||||||
|
*.so binary
|
||||||
*.zip binary
|
*.zip binary
|
||||||
|
|||||||
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -33,6 +33,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
- name: Setup Java ${{ matrix.java }}
|
- name: Setup Java ${{ matrix.java }}
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
@@ -60,12 +62,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: FlatLaf-build-artifacts
|
name: FlatLaf-build-artifacts
|
||||||
path: |
|
path: |
|
||||||
flatlaf-core/build/libs
|
flatlaf-*/build/libs
|
||||||
flatlaf-demo/build/libs
|
|
||||||
flatlaf-extras/build/libs
|
|
||||||
flatlaf-intellij-themes/build/libs
|
|
||||||
flatlaf-jide-oss/build/libs
|
|
||||||
flatlaf-swingx/build/libs
|
|
||||||
!**/*-javadoc.jar
|
!**/*-javadoc.jar
|
||||||
!**/*-sources.jar
|
!**/*-sources.jar
|
||||||
|
|
||||||
@@ -75,7 +72,7 @@ jobs:
|
|||||||
needs: build
|
needs: build
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'push' &&
|
github.event_name == 'push' &&
|
||||||
github.ref == 'refs/heads/master' &&
|
github.ref == 'refs/heads/main' &&
|
||||||
github.repository == 'JFormDesigner/FlatLaf'
|
github.repository == 'JFormDesigner/FlatLaf'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
56
.github/workflows/natives.yml
vendored
Normal file
56
.github/workflows/natives.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||||
|
|
||||||
|
name: Native Libraries
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
tags:
|
||||||
|
- '[0-9]*'
|
||||||
|
paths:
|
||||||
|
- 'flatlaf-natives/flatlaf-natives-windows/**'
|
||||||
|
- '.github/workflows/natives.yml'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- 'flatlaf-natives/flatlaf-natives-windows/**'
|
||||||
|
- '.github/workflows/natives.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
|
- name: Setup Java 1.8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
|
||||||
|
- name: Cache Gradle wrapper
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
|
|
||||||
|
- name: Cache Gradle cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/caches
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||||
|
restore-keys: ${{ runner.os }}-gradle
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew :flatlaf-natives-windows:build
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: FlatLaf-natives-windows-build-artifacts
|
||||||
|
path: |
|
||||||
|
flatlaf-natives/flatlaf-natives-windows/build
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,3 +9,5 @@ out/
|
|||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
.vs/
|
||||||
|
.vscode/
|
||||||
|
|||||||
52
CHANGELOG.md
52
CHANGELOG.md
@@ -1,6 +1,58 @@
|
|||||||
FlatLaf Change Log
|
FlatLaf Change Log
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
## 1.1
|
||||||
|
|
||||||
|
#### New features and improvements
|
||||||
|
|
||||||
|
- Windows 10 only:
|
||||||
|
- Native window decorations for Windows 10 enables dark frame/dialog title bar
|
||||||
|
and embedded menu bar with all JREs, while still having native Windows 10
|
||||||
|
border drop shadows, resize behavior, window snapping and system window
|
||||||
|
menu. (PR #267)
|
||||||
|
- Custom window decorations: Support right aligned components in `JFrame`
|
||||||
|
title bar with embedded menu bar (using `Box.createHorizontalGlue()`). (PR
|
||||||
|
#268)
|
||||||
|
- Custom window decorations: Improved centering of window title with embedded
|
||||||
|
menu bar. (PR #268; issue #252)
|
||||||
|
- Custom window decorations: Support unified backgrounds for window title bar,
|
||||||
|
menu bar and main content. If enabled with `UIManager.put(
|
||||||
|
"TitlePane.unifiedBackground", true );` then window title bar and menu bar
|
||||||
|
use same background color as main content. (PR #268; issue #254)
|
||||||
|
- JIDE Common Layer: Support `JideButton`, `JideLabel`, `JideSplitButton`,
|
||||||
|
`JideToggleButton` and `JideToggleSplitButton`.
|
||||||
|
- JIDE Common Layer: The library on Maven Central no longer depends on
|
||||||
|
`com.jidesoft:jide-oss:3.6.18` to avoid problems when another JIDE library
|
||||||
|
should be used. (issue #270)
|
||||||
|
- SwingX: The library on Maven Central no longer depends on
|
||||||
|
`org.swinglabs.swingx:swingx-all:1.6.5-1` to avoid problems when another
|
||||||
|
SwingX library should be used.
|
||||||
|
- Support running in [JetBrains Projector](https://jetbrains.com/projector/).
|
||||||
|
|
||||||
|
#### Fixed bugs
|
||||||
|
|
||||||
|
- IntelliJ Themes: Fixed text color of CheckBoxMenuItem and RadioButtonMenuItem
|
||||||
|
in all "Arc" themes. (issue #259)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0
|
||||||
|
|
||||||
|
#### New features and improvements
|
||||||
|
|
||||||
|
- Extras: UI Inspector: Tooltip is no longer limited to window bounds.
|
||||||
|
|
||||||
|
#### Fixed bugs
|
||||||
|
|
||||||
|
- TabbedPane: Custom `TabbedPane.selectedForeground` color did not work when
|
||||||
|
`TabbedPane.foreground` has also custom color. (issue #257)
|
||||||
|
- FileChooser: Fixed display of date in details view if current user is selected
|
||||||
|
in "Look in" combobox. (Windows 10 only; issue #249)
|
||||||
|
- Table: Fixed wrong grid line thickness in dragged column on HiDPI screens on
|
||||||
|
Java 9+. (issue #236)
|
||||||
|
- PopupFactory: Fixed `NullPointerException` when `PopupFactory.getPopup()` is
|
||||||
|
invoked with parameter `owner` set to `null`.
|
||||||
|
|
||||||
|
|
||||||
## 1.0-rc3
|
## 1.0-rc3
|
||||||
|
|
||||||
#### New features and improvements
|
#### New features and improvements
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -73,11 +73,31 @@ Addons
|
|||||||
- [JIDE Common Layer](flatlaf-jide-oss)
|
- [JIDE Common Layer](flatlaf-jide-oss)
|
||||||
|
|
||||||
|
|
||||||
|
Getting started
|
||||||
|
---------------
|
||||||
|
|
||||||
|
To enable FlatLaf, add following code to your main method before you create any
|
||||||
|
Swing component:
|
||||||
|
|
||||||
|
~~~java
|
||||||
|
FlatLightLaf.install();
|
||||||
|
|
||||||
|
// create UI here...
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
For more information and documentation visit
|
For more information and documentation visit
|
||||||
[FlatLaf Home](https://www.formdev.com/flatlaf/)
|
[FlatLaf Home](https://www.formdev.com/flatlaf/):
|
||||||
|
|
||||||
|
- [Themes](https://www.formdev.com/flatlaf/themes/)
|
||||||
|
- [Customizing](https://www.formdev.com/flatlaf/customizing/)
|
||||||
|
- [How to Customize](https://www.formdev.com/flatlaf/how-to-customize/)
|
||||||
|
- [Properties Files](https://www.formdev.com/flatlaf/properties-files/)
|
||||||
|
- [Client Properties](https://www.formdev.com/flatlaf/client-properties/)
|
||||||
|
- [System Properties](https://www.formdev.com/flatlaf/system-properties/)
|
||||||
|
|
||||||
|
|
||||||
Buzz
|
Buzz
|
||||||
@@ -94,6 +114,9 @@ Applications using FlatLaf
|
|||||||
and much more
|
and much more
|
||||||
- [jclasslib bytecode viewer](https://github.com/ingokegel/jclasslib) 5.5
|
- [jclasslib bytecode viewer](https://github.com/ingokegel/jclasslib) 5.5
|
||||||
- [KeyStore Explorer](https://keystore-explorer.org/) 5.4.3
|
- [KeyStore Explorer](https://keystore-explorer.org/) 5.4.3
|
||||||
|
- 
|
||||||
|
[install4j](https://www.ej-technologies.com/products/install4j/overview.html)
|
||||||
|
9.0 (**commercial**) - the powerful multi-platform Java installer builder
|
||||||
-  [DbVisualizer](https://www.dbvis.com/) 12.0
|
-  [DbVisualizer](https://www.dbvis.com/) 12.0
|
||||||
(**commercial**) - the universal database tool for developers, analysts and
|
(**commercial**) - the universal database tool for developers, analysts and
|
||||||
DBAs
|
DBAs
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
val releaseVersion = "1.0-rc3"
|
val releaseVersion = "1.1"
|
||||||
val developmentVersion = "1.0-rc4-SNAPSHOT"
|
val developmentVersion = "1.2-SNAPSHOT"
|
||||||
|
|
||||||
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion
|
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
add( "java9Compile", sourceSets.main.get().output )
|
||||||
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named<JavaCompile>( "compileJava9Java" ) {
|
named<JavaCompile>( "compileJava9Java" ) {
|
||||||
sourceCompatibility = "9"
|
sourceCompatibility = "9"
|
||||||
|
|||||||
@@ -33,9 +33,17 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
|||||||
sourceSets {
|
sourceSets {
|
||||||
create( "module-info" ) {
|
create( "module-info" ) {
|
||||||
java {
|
java {
|
||||||
// include "src/main/java" here to get compile errors if classes are
|
// include "src/main/java" and "src/main/java9" here to get compile errors if classes are
|
||||||
// used from other modules that are not specified in module dependencies
|
// used from other modules that are not specified in module dependencies
|
||||||
setSrcDirs( listOf( "src/main/module-info", "src/main/java" ) )
|
setSrcDirs( listOf( "src/main/module-info", "src/main/java", "src/main/java9" ) )
|
||||||
|
|
||||||
|
// exclude Java 8 source file if an equally named Java 9+ source file exists
|
||||||
|
exclude {
|
||||||
|
if( it.isDirectory )
|
||||||
|
return@exclude false
|
||||||
|
val java9file = file( "${projectDir}/src/main/java9/${it.path}" )
|
||||||
|
java9file.exists() && java9file != it.file
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,7 +56,8 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
|||||||
dependsOn( extension.paths )
|
dependsOn( extension.paths )
|
||||||
|
|
||||||
options.compilerArgs.add( "--module-path" )
|
options.compilerArgs.add( "--module-path" )
|
||||||
options.compilerArgs.add( configurations.runtimeClasspath.get().asPath )
|
options.compilerArgs.add( configurations.runtimeClasspath.get().asPath
|
||||||
|
+ File.pathSeparator + configurations.compileClasspath.get().asPath )
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|||||||
@@ -27,6 +27,16 @@ java {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
compileJava {
|
||||||
|
// generate JNI headers
|
||||||
|
options.headerOutputDirectory.set( buildDir.resolve( "generated/jni-headers" ) )
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
// build native libraries
|
||||||
|
dependsOn( ":flatlaf-natives-windows:assemble" )
|
||||||
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
archiveBaseName.set( "flatlaf" )
|
archiveBaseName.set( "flatlaf" )
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ import java.util.Properties;
|
|||||||
import java.util.ServiceLoader;
|
import java.util.ServiceLoader;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
@@ -59,9 +57,10 @@ import javax.swing.plaf.UIResource;
|
|||||||
import javax.swing.plaf.basic.BasicLookAndFeel;
|
import javax.swing.plaf.basic.BasicLookAndFeel;
|
||||||
import javax.swing.text.StyleContext;
|
import javax.swing.text.StyleContext;
|
||||||
import javax.swing.text.html.HTMLEditorKit;
|
import javax.swing.text.html.HTMLEditorKit;
|
||||||
|
import com.formdev.flatlaf.ui.FlatNativeWindowBorder;
|
||||||
import com.formdev.flatlaf.ui.FlatPopupFactory;
|
import com.formdev.flatlaf.ui.FlatPopupFactory;
|
||||||
import com.formdev.flatlaf.ui.JBRCustomDecorations;
|
|
||||||
import com.formdev.flatlaf.util.GrayFilter;
|
import com.formdev.flatlaf.util.GrayFilter;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
@@ -74,7 +73,6 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
public abstract class FlatLaf
|
public abstract class FlatLaf
|
||||||
extends BasicLookAndFeel
|
extends BasicLookAndFeel
|
||||||
{
|
{
|
||||||
static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() );
|
|
||||||
private static final String DESKTOPFONTHINTS = "awt.font.desktophints";
|
private static final String DESKTOPFONTHINTS = "awt.font.desktophints";
|
||||||
|
|
||||||
private static List<Object> customDefaultsSources;
|
private static List<Object> customDefaultsSources;
|
||||||
@@ -91,9 +89,6 @@ public abstract class FlatLaf
|
|||||||
|
|
||||||
private Consumer<UIDefaults> postInitialization;
|
private Consumer<UIDefaults> postInitialization;
|
||||||
|
|
||||||
private Boolean oldFrameWindowDecorated;
|
|
||||||
private Boolean oldDialogWindowDecorated;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the application look and feel to the given LaF
|
* Sets the application look and feel to the given LaF
|
||||||
* using {@link UIManager#setLookAndFeel(javax.swing.LookAndFeel)}.
|
* using {@link UIManager#setLookAndFeel(javax.swing.LookAndFeel)}.
|
||||||
@@ -103,7 +98,7 @@ public abstract class FlatLaf
|
|||||||
UIManager.setLookAndFeel( newLookAndFeel );
|
UIManager.setLookAndFeel( newLookAndFeel );
|
||||||
return true;
|
return true;
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize look and feel '" + newLookAndFeel.getClass().getName() + "'.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to initialize look and feel '" + newLookAndFeel.getClass().getName() + "'.", ex );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,28 +140,28 @@ public abstract class FlatLaf
|
|||||||
* Returns whether FlatLaf supports custom window decorations.
|
* Returns whether FlatLaf supports custom window decorations.
|
||||||
* This depends on the operating system and on the used Java runtime.
|
* This depends on the operating system and on the used Java runtime.
|
||||||
* <p>
|
* <p>
|
||||||
* To use custom window decorations in your application, enable them with
|
* This method returns {@code true} on Windows 10 (see exception below), {@code false} otherwise.
|
||||||
* following code (before creating any frames or dialogs). Then custom window
|
|
||||||
* decorations are only enabled if this method returns {@code true}.
|
|
||||||
* <pre>
|
|
||||||
* JFrame.setDefaultLookAndFeelDecorated( true );
|
|
||||||
* JDialog.setDefaultLookAndFeelDecorated( true );
|
|
||||||
* </pre>
|
|
||||||
* <p>
|
* <p>
|
||||||
* Returns {@code true} on Windows 10, {@code false} otherwise.
|
* Returns also {@code false} on Windows 10 if:
|
||||||
* <p>
|
* <ul>
|
||||||
* Return also {@code false} if running on Windows 10 in
|
* <li>FlatLaf native window border support is available (requires Windows 10)</li>
|
||||||
|
* <li>running in
|
||||||
* <a href="https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime">JetBrains Runtime 11 (or later)</a>
|
* <a href="https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime">JetBrains Runtime 11 (or later)</a>
|
||||||
* (<a href="https://github.com/JetBrains/JetBrainsRuntime">source code on github</a>)
|
* (<a href="https://github.com/JetBrains/JetBrainsRuntime">source code on github</a>)
|
||||||
* and JBR supports custom window decorations. In this case, JBR custom decorations
|
* and JBR supports custom window decorations
|
||||||
* are enabled if {@link JFrame#isDefaultLookAndFeelDecorated()} or
|
* </li>
|
||||||
* {@link JDialog#isDefaultLookAndFeelDecorated()} return {@code true}.
|
* </ul>
|
||||||
|
* In this cases, custom decorations are enabled by the root pane.
|
||||||
|
* Usage of {@link JFrame#setDefaultLookAndFeelDecorated(boolean)} or
|
||||||
|
* {@link JDialog#setDefaultLookAndFeelDecorated(boolean)} is not necessary.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean getSupportsWindowDecorations() {
|
public boolean getSupportsWindowDecorations() {
|
||||||
if( SystemInfo.isJetBrainsJVM_11_orLater &&
|
if( SystemInfo.isProjector )
|
||||||
SystemInfo.isWindows_10_orLater &&
|
return false;
|
||||||
JBRCustomDecorations.isSupported() )
|
|
||||||
|
if( SystemInfo.isWindows_10_orLater &&
|
||||||
|
FlatNativeWindowBorder.isSupported() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return SystemInfo.isWindows_10_orLater;
|
return SystemInfo.isWindows_10_orLater;
|
||||||
@@ -265,16 +260,6 @@ public abstract class FlatLaf
|
|||||||
String.format( "a, address { color: #%06x; }", linkColor.getRGB() & 0xffffff ) );
|
String.format( "a, address { 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
|
@Override
|
||||||
@@ -307,14 +292,6 @@ public abstract class FlatLaf
|
|||||||
new HTMLEditorKit().getStyleSheet().addRule( "a, address { color: blue; }" );
|
new HTMLEditorKit().getStyleSheet().addRule( "a, address { color: blue; }" );
|
||||||
postInitialization = null;
|
postInitialization = null;
|
||||||
|
|
||||||
// restore enable/disable window decorations
|
|
||||||
if( oldFrameWindowDecorated != null ) {
|
|
||||||
JFrame.setDefaultLookAndFeelDecorated( oldFrameWindowDecorated );
|
|
||||||
JDialog.setDefaultLookAndFeelDecorated( oldDialogWindowDecorated );
|
|
||||||
oldFrameWindowDecorated = null;
|
|
||||||
oldDialogWindowDecorated = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.uninitialize();
|
super.uninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +318,7 @@ public abstract class FlatLaf
|
|||||||
} else
|
} else
|
||||||
aquaLaf = (BasicLookAndFeel) Class.forName( aquaLafClassName ).newInstance();
|
aquaLaf = (BasicLookAndFeel) Class.forName( aquaLafClassName ).newInstance();
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize Aqua look and feel '" + aquaLafClassName + "'.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to initialize Aqua look and feel '" + aquaLafClassName + "'.", ex );
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,7 +476,7 @@ public abstract class FlatLaf
|
|||||||
// use active value for all fonts to allow changing fonts in all components
|
// use active value for all fonts to allow changing fonts in all components
|
||||||
// (similar as in Nimbus L&F) with:
|
// (similar as in Nimbus L&F) with:
|
||||||
// UIManager.put( "defaultFont", myFont );
|
// UIManager.put( "defaultFont", myFont );
|
||||||
Object activeFont = new ActiveFont( 1 );
|
Object activeFont = new ActiveFont( 1 );
|
||||||
|
|
||||||
// override fonts
|
// override fonts
|
||||||
for( Object key : defaults.keySet() ) {
|
for( Object key : defaults.keySet() ) {
|
||||||
@@ -522,6 +499,13 @@ public abstract class FlatLaf
|
|||||||
return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font );
|
return (font instanceof FontUIResource) ? (FontUIResource) font : new FontUIResource( font );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public static ActiveValue createActiveFontValue( float scaleFactor ) {
|
||||||
|
return new ActiveFont( scaleFactor );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the default color palette for action icons and object icons to the given UIDefaults.
|
* Adds the default color palette for action icons and object icons to the given UIDefaults.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -577,7 +561,7 @@ public abstract class FlatLaf
|
|||||||
.invoke( null, true );
|
.invoke( null, true );
|
||||||
defaults.put( key, value );
|
defaults.put( key, value );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -684,7 +668,7 @@ public abstract class FlatLaf
|
|||||||
// update UI
|
// update UI
|
||||||
updateUI();
|
updateUI();
|
||||||
} catch( UnsupportedLookAndFeelException ex ) {
|
} catch( UnsupportedLookAndFeelException ex ) {
|
||||||
LOG.log( Level.SEVERE, "FlatLaf: Failed to reinitialize look and feel '" + lookAndFeel.getClass().getName() + "'.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to reinitialize look and feel '" + lookAndFeel.getClass().getName() + "'.", ex );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf;
|
package com.formdev.flatlaf;
|
||||||
|
|
||||||
import javax.swing.JDialog;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines/documents own system properties used in FlatLaf.
|
* Defines/documents own system properties used in FlatLaf.
|
||||||
*
|
*
|
||||||
@@ -58,11 +55,13 @@ public interface FlatSystemProperties
|
|||||||
String USE_UBUNTU_FONT = "flatlaf.useUbuntuFont";
|
String USE_UBUNTU_FONT = "flatlaf.useUbuntuFont";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies whether custom look and feel window decorations should be used
|
* Specifies whether FlatLaf native window decorations should be used
|
||||||
* when creating {@code JFrame} or {@code JDialog}.
|
* when creating {@code JFrame} or {@code JDialog}.
|
||||||
* <p>
|
* <p>
|
||||||
* If this system property is set, FlatLaf invokes {@link JFrame#setDefaultLookAndFeelDecorated(boolean)}
|
* Setting this to {@code true} forces using FlatLaf native window decorations
|
||||||
* and {@link JDialog#setDefaultLookAndFeelDecorated(boolean)} on LaF initialization.
|
* even if they are not enabled by the application.
|
||||||
|
* <p>
|
||||||
|
* Setting this to {@code false} disables using FlatLaf native window decorations.
|
||||||
* <p>
|
* <p>
|
||||||
* (requires Window 10)
|
* (requires Window 10)
|
||||||
* <p>
|
* <p>
|
||||||
@@ -81,10 +80,12 @@ public interface FlatSystemProperties
|
|||||||
* Setting this to {@code true} forces using JetBrains Runtime custom window decorations
|
* Setting this to {@code true} forces using JetBrains Runtime custom window decorations
|
||||||
* even if they are not enabled by the application.
|
* even if they are not enabled by the application.
|
||||||
* <p>
|
* <p>
|
||||||
|
* Setting this to {@code false} disables using JetBrains Runtime custom window decorations.
|
||||||
|
* <p>
|
||||||
* (requires Window 10)
|
* (requires Window 10)
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
|
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
|
||||||
* <strong>Default</strong> {@code true}
|
* <strong>Default</strong> none
|
||||||
*/
|
*/
|
||||||
String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations";
|
String USE_JETBRAINS_CUSTOM_DECORATIONS = "flatlaf.useJetBrainsCustomDecorations";
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.plaf.ColorUIResource;
|
import javax.swing.plaf.ColorUIResource;
|
||||||
import com.formdev.flatlaf.json.Json;
|
import com.formdev.flatlaf.json.Json;
|
||||||
import com.formdev.flatlaf.json.ParseException;
|
import com.formdev.flatlaf.json.ParseException;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
import com.formdev.flatlaf.util.StringUtils;
|
import com.formdev.flatlaf.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,7 +76,7 @@ public class IntelliJTheme
|
|||||||
try {
|
try {
|
||||||
return FlatLaf.install( createLaf( in ) );
|
return FlatLaf.install( createLaf( in ) );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
FlatLaf.LOG.log( Level.SEVERE, "FlatLaf: Failed to load IntelliJ theme", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to load IntelliJ theme", ex );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ public class IntelliJTheme
|
|||||||
try {
|
try {
|
||||||
uiValue = UIDefaultsLoader.parseValue( key, valueStr );
|
uiValue = UIDefaultsLoader.parseValue( key, valueStr );
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
UIDefaultsLoader.logParseError( Level.CONFIG, key, valueStr, ex );
|
UIDefaultsLoader.logParseError( key, valueStr, ex, false );
|
||||||
return; // ignore invalid value
|
return; // ignore invalid value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
import com.formdev.flatlaf.util.StringUtils;
|
import com.formdev.flatlaf.util.StringUtils;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
@@ -172,7 +173,7 @@ class LinuxFontPolicy
|
|||||||
if( "1".equals( strs.get( 5 ) ) )
|
if( "1".equals( strs.get( 5 ) ) )
|
||||||
style |= Font.ITALIC;
|
style |= Font.ITALIC;
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
FlatLaf.LOG.log( Level.CONFIG, "FlatLaf: Failed to parse 'font=" + generalFont + "'.", ex );
|
LoggingFacade.INSTANCE.logConfig( "FlatLaf: Failed to parse 'font=" + generalFont + "'.", ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ class LinuxFontPolicy
|
|||||||
if( dpi < 50 )
|
if( dpi < 50 )
|
||||||
dpi = 50;
|
dpi = 50;
|
||||||
} catch( NumberFormatException ex ) {
|
} catch( NumberFormatException ex ) {
|
||||||
FlatLaf.LOG.log( Level.CONFIG, "FlatLaf: Failed to parse 'forceFontDPI=" + forceFontDPI + "'.", ex );
|
LoggingFacade.INSTANCE.logConfig( "FlatLaf: Failed to parse 'forceFontDPI=" + forceFontDPI + "'.", ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ class LinuxFontPolicy
|
|||||||
while( (line = reader.readLine()) != null )
|
while( (line = reader.readLine()) != null )
|
||||||
lines.add( line );
|
lines.add( line );
|
||||||
} catch( IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
FlatLaf.LOG.log( Level.CONFIG, "FlatLaf: Failed to read '" + filename + "'.", ex );
|
LoggingFacade.INSTANCE.logConfig( "FlatLaf: Failed to read '" + filename + "'.", ex );
|
||||||
}
|
}
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.logging.Level;
|
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.UIDefaults.ActiveValue;
|
import javax.swing.UIDefaults.ActiveValue;
|
||||||
@@ -48,6 +47,7 @@ import com.formdev.flatlaf.util.ColorFunctions.ColorFunction;
|
|||||||
import com.formdev.flatlaf.util.DerivedColor;
|
import com.formdev.flatlaf.util.DerivedColor;
|
||||||
import com.formdev.flatlaf.util.GrayFilter;
|
import com.formdev.flatlaf.util.GrayFilter;
|
||||||
import com.formdev.flatlaf.util.HSLColor;
|
import com.formdev.flatlaf.util.HSLColor;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
import com.formdev.flatlaf.util.StringUtils;
|
import com.formdev.flatlaf.util.StringUtils;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
@@ -243,16 +243,20 @@ class UIDefaultsLoader
|
|||||||
try {
|
try {
|
||||||
defaults.put( key, parseValue( key, value, null, resolver, addonClassLoaders ) );
|
defaults.put( key, parseValue( key, value, null, resolver, addonClassLoaders ) );
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
logParseError( Level.SEVERE, key, value, ex );
|
logParseError( key, value, ex, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
FlatLaf.LOG.log( Level.SEVERE, "FlatLaf: Failed to load properties files.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to load properties files.", ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void logParseError( Level level, String key, String value, RuntimeException ex ) {
|
static void logParseError( String key, String value, RuntimeException ex, boolean severe ) {
|
||||||
FlatLaf.LOG.log( level, "FlatLaf: Failed to parse: '" + key + '=' + value + '\'', ex );
|
String message = "FlatLaf: Failed to parse: '" + key + '=' + value + '\'';
|
||||||
|
if( severe )
|
||||||
|
LoggingFacade.INSTANCE.logSevere( message, ex );
|
||||||
|
else
|
||||||
|
LoggingFacade.INSTANCE.logConfig( message, ex );
|
||||||
}
|
}
|
||||||
|
|
||||||
static String resolveValue( String value, Function<String, String> propertiesGetter ) {
|
static String resolveValue( String value, Function<String, String> propertiesGetter ) {
|
||||||
@@ -440,7 +444,7 @@ class UIDefaultsLoader
|
|||||||
try {
|
try {
|
||||||
return findClass( value, addonClassLoaders ).newInstance();
|
return findClass( value, addonClassLoaders ).newInstance();
|
||||||
} catch( InstantiationException | IllegalAccessException | ClassNotFoundException ex ) {
|
} catch( InstantiationException | IllegalAccessException | ClassNotFoundException ex ) {
|
||||||
FlatLaf.LOG.log( Level.SEVERE, "FlatLaf: Failed to instantiate '" + value + "'.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to instantiate '" + value + "'.", ex );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -451,7 +455,7 @@ class UIDefaultsLoader
|
|||||||
try {
|
try {
|
||||||
return findClass( value, addonClassLoaders );
|
return findClass( value, addonClassLoaders );
|
||||||
} catch( ClassNotFoundException ex ) {
|
} catch( ClassNotFoundException ex ) {
|
||||||
FlatLaf.LOG.log( Level.SEVERE, "FlatLaf: Failed to find class '" + value + "'.", ex );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to find class '" + value + "'.", ex );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -928,7 +932,7 @@ class UIDefaultsLoader
|
|||||||
|
|
||||||
Object value = UIManager.get( uiKey );
|
Object value = UIManager.get( uiKey );
|
||||||
if( value == null && !optional )
|
if( value == null && !optional )
|
||||||
FlatLaf.LOG.log( Level.SEVERE, "FlatLaf: '" + uiKey + "' not found in UI defaults." );
|
LoggingFacade.INSTANCE.logSevere( "FlatLaf: '" + uiKey + "' not found in UI defaults.", null );
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,13 @@
|
|||||||
package com.formdev.flatlaf.ui;
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||||
import java.awt.BasicStroke;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Shape;
|
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.geom.Path2D;
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.plaf.basic.BasicArrowButton;
|
import javax.swing.plaf.basic.BasicArrowButton;
|
||||||
@@ -190,73 +187,14 @@ public class FlatArrowButton
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void paintArrow( Graphics2D g ) {
|
protected void paintArrow( Graphics2D g ) {
|
||||||
int direction = getDirection();
|
|
||||||
boolean vert = (direction == NORTH || direction == SOUTH);
|
boolean vert = (direction == NORTH || direction == SOUTH);
|
||||||
|
int x = 0;
|
||||||
// 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( (getWidth() - rw) / 2f + scale( (float) xOffset ) );
|
|
||||||
int y = Math.round( (getHeight() - rh) / 2f + scale( (float) yOffset ) );
|
|
||||||
|
|
||||||
// move arrow for round borders
|
// move arrow for round borders
|
||||||
Container parent = getParent();
|
Container parent = getParent();
|
||||||
if( vert && parent instanceof JComponent && FlatUIUtils.hasRoundBorder( (JComponent) parent ) )
|
if( vert && parent instanceof JComponent && FlatUIUtils.hasRoundBorder( (JComponent) parent ) )
|
||||||
x -= scale( parent.getComponentOrientation().isLeftToRight() ? 1 : -1 );
|
x -= scale( parent.getComponentOrientation().isLeftToRight() ? 1 : -1 );
|
||||||
|
|
||||||
// paint arrow
|
FlatUIUtils.paintArrow( g, x, 0, getWidth(), getHeight(), getDirection(), chevron, arrowWidth, xOffset, yOffset );
|
||||||
g.translate( x, y );
|
|
||||||
/*debug
|
|
||||||
debugPaint( g, vert, rw, rh );
|
|
||||||
debug*/
|
|
||||||
Shape arrowShape = createArrowShape( direction, chevron, w, h );
|
|
||||||
if( chevron ) {
|
|
||||||
g.setStroke( new BasicStroke( scale( 1f ) ) );
|
|
||||||
g.draw( arrowShape );
|
|
||||||
} else {
|
|
||||||
// triangle
|
|
||||||
g.fill( arrowShape );
|
|
||||||
}
|
|
||||||
g.translate( -x, -y );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Shape createArrowShape( int direction, boolean chevron, float w, float h ) {
|
|
||||||
switch( direction ) {
|
|
||||||
case NORTH: return FlatUIUtils.createPath( !chevron, 0,h, (w / 2f),0, w,h );
|
|
||||||
case SOUTH: return FlatUIUtils.createPath( !chevron, 0,0, (w / 2f),h, w,0 );
|
|
||||||
case WEST: return FlatUIUtils.createPath( !chevron, h,0, 0,(w / 2f), h,w );
|
|
||||||
case EAST: return FlatUIUtils.createPath( !chevron, 0,0, h,(w / 2f), 0,w );
|
|
||||||
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*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import java.awt.event.MouseAdapter;
|
|||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.beans.PropertyChangeEvent;
|
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
@@ -274,30 +273,28 @@ public class FlatComboBoxUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new BasicComboBoxUI.PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
Object source = e.getSource();
|
Object source = e.getSource();
|
||||||
String propertyName = e.getPropertyName();
|
String propertyName = e.getPropertyName();
|
||||||
|
|
||||||
if( editor != null &&
|
if( editor != null &&
|
||||||
((source == comboBox && propertyName == "foreground") ||
|
((source == comboBox && propertyName == "foreground") ||
|
||||||
(source == editor && propertyName == "enabled")) )
|
(source == editor && propertyName == "enabled")) )
|
||||||
{
|
{
|
||||||
// fix editor component colors
|
// fix editor component colors
|
||||||
updateEditorColors();
|
updateEditorColors();
|
||||||
} else if( editor != null && source == comboBox && propertyName == "componentOrientation" ) {
|
} else if( editor != null && source == comboBox && propertyName == "componentOrientation" ) {
|
||||||
ComponentOrientation o = (ComponentOrientation) e.getNewValue();
|
ComponentOrientation o = (ComponentOrientation) e.getNewValue();
|
||||||
editor.applyComponentOrientation( o );
|
editor.applyComponentOrientation( o );
|
||||||
} else if( editor != null && FlatClientProperties.PLACEHOLDER_TEXT.equals( propertyName ) )
|
} else if( editor != null && FlatClientProperties.PLACEHOLDER_TEXT.equals( propertyName ) )
|
||||||
editor.repaint();
|
editor.repaint();
|
||||||
else if( FlatClientProperties.COMPONENT_ROUND_RECT.equals( propertyName ) )
|
else if( FlatClientProperties.COMPONENT_ROUND_RECT.equals( propertyName ) )
|
||||||
comboBox.repaint();
|
comboBox.repaint();
|
||||||
else if( FlatClientProperties.MINIMUM_WIDTH.equals( propertyName ) )
|
else if( FlatClientProperties.MINIMUM_WIDTH.equals( propertyName ) )
|
||||||
comboBox.revalidate();
|
comboBox.revalidate();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,14 +645,12 @@ public class FlatComboBoxUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new BasicComboPopup.PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
if( e.getPropertyName() == "renderer" )
|
if( e.getPropertyName() == "renderer" )
|
||||||
list.setCellRenderer( new PopupListCellRenderer() );
|
list.setCellRenderer( new PopupListCellRenderer() );
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,17 @@ import javax.swing.JComboBox;
|
|||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
import javax.swing.JToggleButton;
|
import javax.swing.JToggleButton;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.filechooser.FileView;
|
import javax.swing.filechooser.FileView;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.metal.MetalFileChooserUI;
|
import javax.swing.plaf.metal.MetalFileChooserUI;
|
||||||
|
import javax.swing.table.TableCellRenderer;
|
||||||
import com.formdev.flatlaf.FlatClientProperties;
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
import com.formdev.flatlaf.util.ScaledImageIcon;
|
import com.formdev.flatlaf.util.ScaledImageIcon;
|
||||||
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -190,6 +194,62 @@ public class FlatFileChooserUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected JPanel createDetailsView( JFileChooser fc ) {
|
||||||
|
JPanel p = super.createDetailsView( fc );
|
||||||
|
|
||||||
|
if( !SystemInfo.isWindows )
|
||||||
|
return p;
|
||||||
|
|
||||||
|
// find scroll pane
|
||||||
|
JScrollPane scrollPane = null;
|
||||||
|
for( Component c : p.getComponents() ) {
|
||||||
|
if( c instanceof JScrollPane ) {
|
||||||
|
scrollPane = (JScrollPane) c;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( scrollPane == null )
|
||||||
|
return p;
|
||||||
|
|
||||||
|
// get scroll view, which should be a table
|
||||||
|
Component view = scrollPane.getViewport().getView();
|
||||||
|
if( !(view instanceof JTable) )
|
||||||
|
return p;
|
||||||
|
|
||||||
|
JTable table = (JTable) view;
|
||||||
|
|
||||||
|
// on Windows 10, the date may contain left-to-right (0x200e) and right-to-left (0x200f)
|
||||||
|
// mark characters (see https://en.wikipedia.org/wiki/Left-to-right_mark)
|
||||||
|
// when the "current user" item is selected in the "look in" combobox
|
||||||
|
// --> remove them
|
||||||
|
TableCellRenderer defaultRenderer = table.getDefaultRenderer( Object.class );
|
||||||
|
table.setDefaultRenderer( Object.class, new TableCellRenderer() {
|
||||||
|
@Override
|
||||||
|
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected,
|
||||||
|
boolean hasFocus, int row, int column )
|
||||||
|
{
|
||||||
|
// remove left-to-right and right-to-left mark characters
|
||||||
|
if( value instanceof String && ((String)value).startsWith( "\u200e" ) ) {
|
||||||
|
String str = (String) value;
|
||||||
|
char[] buf = new char[str.length()];
|
||||||
|
int j = 0;
|
||||||
|
for( int i = 0; i < buf.length; i++ ) {
|
||||||
|
char ch = str.charAt( i );
|
||||||
|
if( ch != '\u200e' && ch != '\u200f' )
|
||||||
|
buf[j++] = ch;
|
||||||
|
}
|
||||||
|
value = new String( buf, 0, j );
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultRenderer.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column );
|
||||||
|
}
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize( JComponent c ) {
|
public Dimension getPreferredSize( JComponent c ) {
|
||||||
return UIScale.scale( super.getPreferredSize( c ) );
|
return UIScale.scale( super.getPreferredSize( c ) );
|
||||||
|
|||||||
@@ -16,17 +16,22 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.ui;
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
|
import java.awt.Graphics;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
import javax.swing.ActionMap;
|
import javax.swing.ActionMap;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
|
import javax.swing.JRootPane;
|
||||||
|
import javax.swing.LookAndFeel;
|
||||||
import javax.swing.MenuElement;
|
import javax.swing.MenuElement;
|
||||||
import javax.swing.MenuSelectionManager;
|
import javax.swing.MenuSelectionManager;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ActionMapUIResource;
|
import javax.swing.plaf.ActionMapUIResource;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.plaf.basic.BasicMenuBarUI;
|
import javax.swing.plaf.basic.BasicMenuBarUI;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
@@ -40,12 +45,15 @@ import com.formdev.flatlaf.util.SystemInfo;
|
|||||||
* @uiDefault MenuBar.background Color
|
* @uiDefault MenuBar.background Color
|
||||||
* @uiDefault MenuBar.foreground Color
|
* @uiDefault MenuBar.foreground Color
|
||||||
* @uiDefault MenuBar.border Border
|
* @uiDefault MenuBar.border Border
|
||||||
|
* @uiDefault TitlePane.unifiedBackground boolean
|
||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatMenuBarUI
|
public class FlatMenuBarUI
|
||||||
extends BasicMenuBarUI
|
extends BasicMenuBarUI
|
||||||
{
|
{
|
||||||
|
protected boolean unifiedBackground;
|
||||||
|
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
return new FlatMenuBarUI();
|
return new FlatMenuBarUI();
|
||||||
}
|
}
|
||||||
@@ -55,6 +63,15 @@ public class FlatMenuBarUI
|
|||||||
* Do not add any functionality here.
|
* Do not add any functionality here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void installDefaults() {
|
||||||
|
super.installDefaults();
|
||||||
|
|
||||||
|
LookAndFeel.installProperty( menuBar, "opaque", false );
|
||||||
|
|
||||||
|
unifiedBackground = UIManager.getBoolean( "TitlePane.unifiedBackground" );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void installKeyboardActions() {
|
protected void installKeyboardActions() {
|
||||||
super.installKeyboardActions();
|
super.installKeyboardActions();
|
||||||
@@ -67,6 +84,35 @@ public class FlatMenuBarUI
|
|||||||
map.put( "takeFocus", new TakeFocus() );
|
map.put( "takeFocus", new TakeFocus() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update( Graphics g, JComponent c ) {
|
||||||
|
// do not fill background if menubar is embedded into title pane
|
||||||
|
if( isFillBackground( c ) ) {
|
||||||
|
g.setColor( c.getBackground() );
|
||||||
|
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
||||||
|
}
|
||||||
|
|
||||||
|
paint( g, c );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isFillBackground( JComponent c ) {
|
||||||
|
// paint background in opaque or having custom background color
|
||||||
|
if( c.isOpaque() || !(c.getBackground() instanceof UIResource) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// do not paint background for unified title pane
|
||||||
|
if( unifiedBackground )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// paint background in full screen mode
|
||||||
|
JRootPane rootPane = SwingUtilities.getRootPane( c );
|
||||||
|
if( rootPane == null || FlatUIUtils.isFullScreen( rootPane ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// do not paint background if menu bar is embedded into title pane
|
||||||
|
return rootPane.getJMenuBar() != c || !FlatRootPaneUI.isMenuBarEmbedded( rootPane );
|
||||||
|
}
|
||||||
|
|
||||||
//---- class TakeFocus ----------------------------------------------------
|
//---- class TakeFocus ----------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,313 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.Rectangle;
|
||||||
|
import java.awt.Window;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JRootPane;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
|
import com.formdev.flatlaf.FlatSystemProperties;
|
||||||
|
import com.formdev.flatlaf.ui.JBRCustomDecorations.JBRWindowTopBorder;
|
||||||
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support for custom window decorations with native window border.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatNativeWindowBorder
|
||||||
|
{
|
||||||
|
// check this field before using class JBRCustomDecorations to avoid unnecessary loading of that class
|
||||||
|
private static final boolean canUseJBRCustomDecorations
|
||||||
|
= SystemInfo.isJetBrainsJVM_11_orLater && SystemInfo.isWindows_10_orLater;
|
||||||
|
|
||||||
|
private static Boolean supported;
|
||||||
|
private static Provider nativeProvider;
|
||||||
|
|
||||||
|
public static boolean isSupported() {
|
||||||
|
if( canUseJBRCustomDecorations )
|
||||||
|
return JBRCustomDecorations.isSupported();
|
||||||
|
|
||||||
|
initialize();
|
||||||
|
return supported;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Object install( JRootPane rootPane ) {
|
||||||
|
if( canUseJBRCustomDecorations )
|
||||||
|
return JBRCustomDecorations.install( rootPane );
|
||||||
|
|
||||||
|
if( !isSupported() )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// Check whether root pane already has a window, which is the case when switching LaF.
|
||||||
|
// Also check whether the window is displayable, which is required to install
|
||||||
|
// FlatLaf native window border.
|
||||||
|
// If the window is not displayable, then it was probably closed/disposed but not yet removed
|
||||||
|
// from the list of windows that AWT maintains and returns with Window.getWindows().
|
||||||
|
// It could be also be a window that is currently hidden, but may be shown later.
|
||||||
|
Window window = SwingUtilities.windowForComponent( rootPane );
|
||||||
|
if( window != null && window.isDisplayable() ) {
|
||||||
|
install( window, FlatSystemProperties.USE_WINDOW_DECORATIONS );
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Install FlatLaf native window border, which must be done late,
|
||||||
|
// when the native window is already created, because it needs access to the window.
|
||||||
|
// "ancestor" property change event is fired from JComponent.addNotify() and removeNotify().
|
||||||
|
PropertyChangeListener ancestorListener = e -> {
|
||||||
|
Object newValue = e.getNewValue();
|
||||||
|
if( newValue instanceof Window )
|
||||||
|
install( (Window) newValue, FlatSystemProperties.USE_WINDOW_DECORATIONS );
|
||||||
|
else if( newValue == null && e.getOldValue() instanceof Window )
|
||||||
|
uninstall( (Window) e.getOldValue() );
|
||||||
|
};
|
||||||
|
rootPane.addPropertyChangeListener( "ancestor", ancestorListener );
|
||||||
|
return ancestorListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void install( Window window, String systemPropertyKey ) {
|
||||||
|
if( hasCustomDecoration( window ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do not enable native window border if LaF provides decorations
|
||||||
|
if( UIManager.getLookAndFeel().getSupportsWindowDecorations() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( window instanceof JFrame ) {
|
||||||
|
JFrame frame = (JFrame) window;
|
||||||
|
|
||||||
|
// do not enable native window border if JFrame should use system window decorations
|
||||||
|
// and if not forced to use FlatLaf/JBR native window decorations
|
||||||
|
if( !JFrame.isDefaultLookAndFeelDecorated() &&
|
||||||
|
!UIManager.getBoolean( "TitlePane.useWindowDecorations" ) &&
|
||||||
|
!FlatSystemProperties.getBoolean( systemPropertyKey, false ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do not enable native window border if frame is undecorated
|
||||||
|
if( frame.isUndecorated() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// enable native window border for window
|
||||||
|
setHasCustomDecoration( frame, true );
|
||||||
|
|
||||||
|
// enable Swing window decoration
|
||||||
|
frame.getRootPane().setWindowDecorationStyle( JRootPane.FRAME );
|
||||||
|
|
||||||
|
} else if( window instanceof JDialog ) {
|
||||||
|
JDialog dialog = (JDialog) window;
|
||||||
|
|
||||||
|
// do not enable native window border if JDialog should use system window decorations
|
||||||
|
// and if not forced to use FlatLaf/JBR native window decorations
|
||||||
|
if( !JDialog.isDefaultLookAndFeelDecorated() &&
|
||||||
|
!UIManager.getBoolean( "TitlePane.useWindowDecorations" ) &&
|
||||||
|
!FlatSystemProperties.getBoolean( systemPropertyKey, false ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do not enable native window border if dialog is undecorated
|
||||||
|
if( dialog.isUndecorated() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// enable native window border for window
|
||||||
|
setHasCustomDecoration( dialog, true );
|
||||||
|
|
||||||
|
// enable Swing window decoration
|
||||||
|
dialog.getRootPane().setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void uninstall( JRootPane rootPane, Object data ) {
|
||||||
|
if( canUseJBRCustomDecorations ) {
|
||||||
|
JBRCustomDecorations.uninstall( rootPane, data );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove listener
|
||||||
|
if( data instanceof PropertyChangeListener )
|
||||||
|
rootPane.removePropertyChangeListener( "ancestor", (PropertyChangeListener) data );
|
||||||
|
|
||||||
|
// uninstall native window border, except when switching to another FlatLaf theme
|
||||||
|
Window window = SwingUtilities.windowForComponent( rootPane );
|
||||||
|
if( window != null )
|
||||||
|
uninstall( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void uninstall( Window window ) {
|
||||||
|
if( !hasCustomDecoration( window ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do not uninstall when switching to another FlatLaf theme
|
||||||
|
if( UIManager.getLookAndFeel() instanceof FlatLaf )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// disable native window border for window
|
||||||
|
setHasCustomDecoration( window, false );
|
||||||
|
|
||||||
|
if( window instanceof JFrame ) {
|
||||||
|
JFrame frame = (JFrame) window;
|
||||||
|
|
||||||
|
// disable Swing window decoration
|
||||||
|
frame.getRootPane().setWindowDecorationStyle( JRootPane.NONE );
|
||||||
|
|
||||||
|
} else if( window instanceof JDialog ) {
|
||||||
|
JDialog dialog = (JDialog) window;
|
||||||
|
|
||||||
|
// disable Swing window decoration
|
||||||
|
dialog.getRootPane().setWindowDecorationStyle( JRootPane.NONE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasCustomDecoration( Window window ) {
|
||||||
|
if( canUseJBRCustomDecorations )
|
||||||
|
return JBRCustomDecorations.hasCustomDecoration( window );
|
||||||
|
|
||||||
|
if( !isSupported() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return nativeProvider.hasCustomDecoration( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setHasCustomDecoration( Window window, boolean hasCustomDecoration ) {
|
||||||
|
if( canUseJBRCustomDecorations ) {
|
||||||
|
JBRCustomDecorations.setHasCustomDecoration( window, hasCustomDecoration );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !isSupported() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
nativeProvider.setHasCustomDecoration( window, hasCustomDecoration );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setTitleBarHeightAndHitTestSpots( Window window, int titleBarHeight,
|
||||||
|
List<Rectangle> hitTestSpots, Rectangle appIconBounds )
|
||||||
|
{
|
||||||
|
if( canUseJBRCustomDecorations ) {
|
||||||
|
JBRCustomDecorations.setTitleBarHeightAndHitTestSpots( window, titleBarHeight, hitTestSpots );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !isSupported() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
nativeProvider.setTitleBarHeight( window, titleBarHeight );
|
||||||
|
nativeProvider.setTitleBarHitTestSpots( window, hitTestSpots );
|
||||||
|
nativeProvider.setTitleBarAppIconBounds( window, appIconBounds );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initialize() {
|
||||||
|
if( supported != null )
|
||||||
|
return;
|
||||||
|
supported = false;
|
||||||
|
|
||||||
|
// requires Windows 10
|
||||||
|
if( !SystemInfo.isWindows_10_orLater )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do not use when running in JetBrains Projector
|
||||||
|
if( SystemInfo.isProjector )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// check whether disabled via system property
|
||||||
|
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_WINDOW_DECORATIONS, true ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
/*
|
||||||
|
Class<?> cls = Class.forName( "com.formdev.flatlaf.natives.jna.windows.FlatWindowsNativeWindowBorder" );
|
||||||
|
Method m = cls.getMethod( "getInstance" );
|
||||||
|
nativeProvider = (Provider) m.invoke( null );
|
||||||
|
*/
|
||||||
|
nativeProvider = FlatWindowsNativeWindowBorder.getInstance();
|
||||||
|
|
||||||
|
supported = (nativeProvider != null);
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- interface Provider -------------------------------------------------
|
||||||
|
|
||||||
|
public interface Provider
|
||||||
|
{
|
||||||
|
boolean hasCustomDecoration( Window window );
|
||||||
|
void setHasCustomDecoration( Window window, boolean hasCustomDecoration );
|
||||||
|
void setTitleBarHeight( Window window, int titleBarHeight );
|
||||||
|
void setTitleBarHitTestSpots( Window window, List<Rectangle> hitTestSpots );
|
||||||
|
void setTitleBarAppIconBounds( Window window, Rectangle appIconBounds );
|
||||||
|
|
||||||
|
boolean isColorizationColorAffectsBorders();
|
||||||
|
Color getColorizationColor();
|
||||||
|
int getColorizationColorBalance();
|
||||||
|
|
||||||
|
void addChangeListener( ChangeListener l );
|
||||||
|
void removeChangeListener( ChangeListener l );
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class WindowTopBorder -------------------------------------------
|
||||||
|
|
||||||
|
static class WindowTopBorder
|
||||||
|
extends JBRCustomDecorations.JBRWindowTopBorder
|
||||||
|
{
|
||||||
|
private static WindowTopBorder instance;
|
||||||
|
|
||||||
|
static JBRWindowTopBorder getInstance() {
|
||||||
|
if( canUseJBRCustomDecorations )
|
||||||
|
return JBRWindowTopBorder.getInstance();
|
||||||
|
|
||||||
|
if( instance == null )
|
||||||
|
instance = new WindowTopBorder();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void installListeners() {
|
||||||
|
nativeProvider.addChangeListener( e -> {
|
||||||
|
update();
|
||||||
|
|
||||||
|
// repaint top borders of all windows
|
||||||
|
for( Window window : Window.getWindows() ) {
|
||||||
|
if( window.isDisplayable() )
|
||||||
|
window.repaint( 0, 0, window.getWidth(), 1 );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean isColorizationColorAffectsBorders() {
|
||||||
|
return nativeProvider.isColorizationColorAffectsBorders();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Color getColorizationColor() {
|
||||||
|
return nativeProvider.getColorizationColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
int getColorizationColorBalance() {
|
||||||
|
return nativeProvider.getColorizationColorBalance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,7 +62,7 @@ public class FlatPopupFactory
|
|||||||
public Popup getPopup( Component owner, Component contents, int x, int y )
|
public Popup getPopup( Component owner, Component contents, int x, int y )
|
||||||
throws IllegalArgumentException
|
throws IllegalArgumentException
|
||||||
{
|
{
|
||||||
Point pt = fixToolTipLocation( owner, contents, x, y );
|
Point pt = fixToolTipLocation( contents, x, y );
|
||||||
if( pt != null ) {
|
if( pt != null ) {
|
||||||
x = pt.x;
|
x = pt.x;
|
||||||
y = pt.y;
|
y = pt.y;
|
||||||
@@ -70,7 +70,7 @@ public class FlatPopupFactory
|
|||||||
|
|
||||||
boolean forceHeavyWeight = isOptionEnabled( owner, contents, FlatClientProperties.POPUP_FORCE_HEAVY_WEIGHT, "Popup.forceHeavyWeight" );
|
boolean forceHeavyWeight = isOptionEnabled( owner, contents, FlatClientProperties.POPUP_FORCE_HEAVY_WEIGHT, "Popup.forceHeavyWeight" );
|
||||||
|
|
||||||
if( !isOptionEnabled( owner, contents, FlatClientProperties.POPUP_DROP_SHADOW_PAINTED, "Popup.dropShadowPainted" ) )
|
if( !isOptionEnabled( owner, contents, FlatClientProperties.POPUP_DROP_SHADOW_PAINTED, "Popup.dropShadowPainted" ) || SystemInfo.isProjector )
|
||||||
return new NonFlashingPopup( getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ), contents );
|
return new NonFlashingPopup( getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ), contents );
|
||||||
|
|
||||||
// macOS and Linux adds drop shadow to heavy weight popups
|
// macOS and Linux adds drop shadow to heavy weight popups
|
||||||
@@ -111,6 +111,7 @@ public class FlatPopupFactory
|
|||||||
|
|
||||||
// check whether heavy weight popup window is on same screen as owner component
|
// check whether heavy weight popup window is on same screen as owner component
|
||||||
if( popupWindow == null ||
|
if( popupWindow == null ||
|
||||||
|
owner == null ||
|
||||||
popupWindow.getGraphicsConfiguration() == owner.getGraphicsConfiguration() )
|
popupWindow.getGraphicsConfiguration() == owner.getGraphicsConfiguration() )
|
||||||
return popup;
|
return popup;
|
||||||
|
|
||||||
@@ -211,7 +212,7 @@ public class FlatPopupFactory
|
|||||||
* This method checks whether the current mouse location is within tooltip bounds
|
* 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.
|
* and corrects the y-location so that the tooltip is placed above the mouse location.
|
||||||
*/
|
*/
|
||||||
private Point fixToolTipLocation( Component owner, Component contents, int x, int y ) {
|
private Point fixToolTipLocation( Component contents, int x, int y ) {
|
||||||
if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() )
|
if( !(contents instanceof JToolTip) || !wasInvokedFromToolTipManager() )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -450,10 +451,10 @@ public class FlatPopupFactory
|
|||||||
|
|
||||||
mediumWeightShown = true;
|
mediumWeightShown = true;
|
||||||
|
|
||||||
Window window = SwingUtilities.windowForComponent( owner );
|
if( owner == null )
|
||||||
if( window == null )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Window window = SwingUtilities.windowForComponent( owner );
|
||||||
if( !(window instanceof RootPaneContainer) )
|
if( !(window instanceof RootPaneContainer) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import javax.swing.UIManager;
|
|||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
import javax.swing.plaf.BorderUIResource;
|
import javax.swing.plaf.BorderUIResource;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.RootPaneUI;
|
||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.plaf.basic.BasicRootPaneUI;
|
import javax.swing.plaf.basic.BasicRootPaneUI;
|
||||||
import com.formdev.flatlaf.FlatClientProperties;
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
@@ -70,16 +71,13 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
public class FlatRootPaneUI
|
public class FlatRootPaneUI
|
||||||
extends BasicRootPaneUI
|
extends BasicRootPaneUI
|
||||||
{
|
{
|
||||||
// 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 final Color borderColor = UIManager.getColor( "TitlePane.borderColor" );
|
||||||
|
|
||||||
protected JRootPane rootPane;
|
protected JRootPane rootPane;
|
||||||
protected FlatTitlePane titlePane;
|
protected FlatTitlePane titlePane;
|
||||||
protected FlatWindowResizer windowResizer;
|
protected FlatWindowResizer windowResizer;
|
||||||
|
|
||||||
|
private Object nativeWindowBorderData;
|
||||||
private LayoutManager oldLayout;
|
private LayoutManager oldLayout;
|
||||||
|
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
@@ -97,8 +95,7 @@ public class FlatRootPaneUI
|
|||||||
else
|
else
|
||||||
installBorder();
|
installBorder();
|
||||||
|
|
||||||
if( canUseJBRCustomDecorations )
|
nativeWindowBorderData = FlatNativeWindowBorder.install( rootPane );
|
||||||
JBRCustomDecorations.install( rootPane );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void installBorder() {
|
protected void installBorder() {
|
||||||
@@ -113,6 +110,8 @@ public class FlatRootPaneUI
|
|||||||
public void uninstallUI( JComponent c ) {
|
public void uninstallUI( JComponent c ) {
|
||||||
super.uninstallUI( c );
|
super.uninstallUI( c );
|
||||||
|
|
||||||
|
FlatNativeWindowBorder.uninstall( rootPane, nativeWindowBorderData );
|
||||||
|
|
||||||
uninstallClientDecorations();
|
uninstallClientDecorations();
|
||||||
rootPane = null;
|
rootPane = null;
|
||||||
}
|
}
|
||||||
@@ -139,10 +138,10 @@ public class FlatRootPaneUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void installClientDecorations() {
|
protected void installClientDecorations() {
|
||||||
boolean isJBRSupported = canUseJBRCustomDecorations && JBRCustomDecorations.isSupported();
|
boolean isNativeWindowBorderSupported = FlatNativeWindowBorder.isSupported();
|
||||||
|
|
||||||
// install border
|
// install border
|
||||||
if( rootPane.getWindowDecorationStyle() != JRootPane.NONE && !isJBRSupported )
|
if( rootPane.getWindowDecorationStyle() != JRootPane.NONE && !isNativeWindowBorderSupported )
|
||||||
LookAndFeel.installBorder( rootPane, "RootPane.border" );
|
LookAndFeel.installBorder( rootPane, "RootPane.border" );
|
||||||
else
|
else
|
||||||
LookAndFeel.uninstallBorder( rootPane );
|
LookAndFeel.uninstallBorder( rootPane );
|
||||||
@@ -155,7 +154,7 @@ public class FlatRootPaneUI
|
|||||||
rootPane.setLayout( createRootLayout() );
|
rootPane.setLayout( createRootLayout() );
|
||||||
|
|
||||||
// install window resizer
|
// install window resizer
|
||||||
if( !isJBRSupported )
|
if( !isNativeWindowBorderSupported )
|
||||||
windowResizer = createWindowResizer();
|
windowResizer = createWindowResizer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,6 +228,13 @@ public class FlatRootPaneUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static boolean isMenuBarEmbedded( JRootPane rootPane ) {
|
||||||
|
RootPaneUI ui = rootPane.getUI();
|
||||||
|
return ui instanceof FlatRootPaneUI &&
|
||||||
|
((FlatRootPaneUI)ui).titlePane != null &&
|
||||||
|
((FlatRootPaneUI)ui).titlePane.isMenuBarEmbedded();
|
||||||
|
}
|
||||||
|
|
||||||
//---- class FlatRootLayout -----------------------------------------------
|
//---- class FlatRootLayout -----------------------------------------------
|
||||||
|
|
||||||
protected class FlatRootLayout
|
protected class FlatRootLayout
|
||||||
@@ -299,15 +305,16 @@ public class FlatRootPaneUI
|
|||||||
rootPane.getGlassPane().setBounds( x, y, width, height );
|
rootPane.getGlassPane().setBounds( x, y, width, height );
|
||||||
|
|
||||||
int nextY = 0;
|
int nextY = 0;
|
||||||
if( !isFullScreen && titlePane != null ) {
|
if( titlePane != null ) {
|
||||||
Dimension prefSize = titlePane.getPreferredSize();
|
int prefHeight = !isFullScreen ? titlePane.getPreferredSize().height : 0;
|
||||||
titlePane.setBounds( 0, 0, width, prefSize.height );
|
titlePane.setBounds( 0, 0, width, prefHeight );
|
||||||
nextY += prefSize.height;
|
nextY += prefHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||||
if( menuBar != null && menuBar.isVisible() ) {
|
if( menuBar != null && menuBar.isVisible() ) {
|
||||||
if( !isFullScreen && titlePane != null && titlePane.isMenuBarEmbedded() ) {
|
boolean embedded = !isFullScreen && titlePane != null && titlePane.isMenuBarEmbedded();
|
||||||
|
if( embedded ) {
|
||||||
titlePane.validate();
|
titlePane.validate();
|
||||||
menuBar.setBounds( titlePane.getMenuBarBounds() );
|
menuBar.setBounds( titlePane.getMenuBarBounds() );
|
||||||
} else {
|
} else {
|
||||||
@@ -344,6 +351,9 @@ public class FlatRootPaneUI
|
|||||||
|
|
||||||
//---- class FlatWindowBorder ---------------------------------------------
|
//---- class FlatWindowBorder ---------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Window border used for non-native window decorations.
|
||||||
|
*/
|
||||||
public static class FlatWindowBorder
|
public static class FlatWindowBorder
|
||||||
extends BorderUIResource.EmptyBorderUIResource
|
extends BorderUIResource.EmptyBorderUIResource
|
||||||
{
|
{
|
||||||
@@ -358,7 +368,7 @@ public class FlatRootPaneUI
|
|||||||
@Override
|
@Override
|
||||||
public Insets getBorderInsets( Component c, Insets insets ) {
|
public Insets getBorderInsets( Component c, Insets insets ) {
|
||||||
if( isWindowMaximized( c ) || FlatUIUtils.isFullScreen( c ) ) {
|
if( isWindowMaximized( c ) || FlatUIUtils.isFullScreen( c ) ) {
|
||||||
// hide border if window is maximized
|
// hide border if window is maximized or full screen
|
||||||
insets.top = insets.left = insets.bottom = insets.right = 0;
|
insets.top = insets.left = insets.bottom = insets.right = 0;
|
||||||
return insets;
|
return insets;
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.awt.Insets;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.beans.PropertyChangeEvent;
|
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.swing.InputMap;
|
import javax.swing.InputMap;
|
||||||
@@ -168,30 +167,28 @@ public class FlatScrollBarUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new BasicScrollBarUI.PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
switch( e.getPropertyName() ) {
|
switch( e.getPropertyName() ) {
|
||||||
case FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS:
|
case FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS:
|
||||||
scrollbar.revalidate();
|
scrollbar.revalidate();
|
||||||
scrollbar.repaint();
|
scrollbar.repaint();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "componentOrientation":
|
case "componentOrientation":
|
||||||
// this is missing in BasicScrollBarUI.Handler.propertyChange()
|
// this is missing in BasicScrollBarUI.Handler.propertyChange()
|
||||||
InputMap inputMap = (InputMap) UIManager.get( "ScrollBar.ancestorInputMap" );
|
InputMap inputMap = (InputMap) UIManager.get( "ScrollBar.ancestorInputMap" );
|
||||||
if( !scrollbar.getComponentOrientation().isLeftToRight() ) {
|
if( !scrollbar.getComponentOrientation().isLeftToRight() ) {
|
||||||
InputMap rtlInputMap = (InputMap) UIManager.get( "ScrollBar.ancestorInputMap.RightToLeft" );
|
InputMap rtlInputMap = (InputMap) UIManager.get( "ScrollBar.ancestorInputMap.RightToLeft" );
|
||||||
if( rtlInputMap != null ) {
|
if( rtlInputMap != null ) {
|
||||||
rtlInputMap.setParent( inputMap );
|
rtlInputMap.setParent( inputMap );
|
||||||
inputMap = rtlInputMap;
|
inputMap = rtlInputMap;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SwingUtilities.replaceUIInputMap( scrollbar, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap );
|
}
|
||||||
break;
|
SwingUtilities.replaceUIInputMap( scrollbar, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap );
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,19 +105,17 @@ public class FlatScrollPaneUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected MouseWheelListener createMouseWheelListener() {
|
protected MouseWheelListener createMouseWheelListener() {
|
||||||
return new BasicScrollPaneUI.MouseWheelHandler() {
|
MouseWheelListener superListener = super.createMouseWheelListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void mouseWheelMoved( MouseWheelEvent e ) {
|
if( isSmoothScrollingEnabled() &&
|
||||||
if( isSmoothScrollingEnabled() &&
|
scrollpane.isWheelScrollingEnabled() &&
|
||||||
scrollpane.isWheelScrollingEnabled() &&
|
e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL &&
|
||||||
e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL &&
|
e.getPreciseWheelRotation() != 0 &&
|
||||||
e.getPreciseWheelRotation() != 0 &&
|
e.getPreciseWheelRotation() != e.getWheelRotation() )
|
||||||
e.getPreciseWheelRotation() != e.getWheelRotation() )
|
{
|
||||||
{
|
mouseWheelMovedSmooth( e );
|
||||||
mouseWheelMovedSmooth( e );
|
} else
|
||||||
} else
|
superListener.mouseWheelMoved( e );
|
||||||
super.mouseWheelMoved( e );
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,41 +237,39 @@ public class FlatScrollPaneUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new BasicScrollPaneUI.PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
switch( e.getPropertyName() ) {
|
switch( e.getPropertyName() ) {
|
||||||
case FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS:
|
case FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS:
|
||||||
JScrollBar vsb = scrollpane.getVerticalScrollBar();
|
JScrollBar vsb = scrollpane.getVerticalScrollBar();
|
||||||
JScrollBar hsb = scrollpane.getHorizontalScrollBar();
|
JScrollBar hsb = scrollpane.getHorizontalScrollBar();
|
||||||
if( vsb != null ) {
|
if( vsb != null ) {
|
||||||
vsb.revalidate();
|
vsb.revalidate();
|
||||||
vsb.repaint();
|
vsb.repaint();
|
||||||
}
|
}
|
||||||
if( hsb != null ) {
|
if( hsb != null ) {
|
||||||
hsb.revalidate();
|
hsb.revalidate();
|
||||||
hsb.repaint();
|
hsb.repaint();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case ScrollPaneConstants.LOWER_LEFT_CORNER:
|
|
||||||
case ScrollPaneConstants.LOWER_RIGHT_CORNER:
|
|
||||||
case ScrollPaneConstants.UPPER_LEFT_CORNER:
|
|
||||||
case ScrollPaneConstants.UPPER_RIGHT_CORNER:
|
|
||||||
// remove border from buttons added to corners
|
|
||||||
Object corner = e.getNewValue();
|
|
||||||
if( corner instanceof JButton &&
|
|
||||||
((JButton)corner).getBorder() instanceof FlatButtonBorder &&
|
|
||||||
scrollpane.getViewport() != null &&
|
|
||||||
scrollpane.getViewport().getView() instanceof JTable )
|
|
||||||
{
|
|
||||||
((JButton)corner).setBorder( BorderFactory.createEmptyBorder() );
|
|
||||||
((JButton)corner).setFocusable( false );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
case ScrollPaneConstants.LOWER_LEFT_CORNER:
|
||||||
|
case ScrollPaneConstants.LOWER_RIGHT_CORNER:
|
||||||
|
case ScrollPaneConstants.UPPER_LEFT_CORNER:
|
||||||
|
case ScrollPaneConstants.UPPER_RIGHT_CORNER:
|
||||||
|
// remove border from buttons added to corners
|
||||||
|
Object corner = e.getNewValue();
|
||||||
|
if( corner instanceof JButton &&
|
||||||
|
((JButton)corner).getBorder() instanceof FlatButtonBorder &&
|
||||||
|
scrollpane.getViewport() != null &&
|
||||||
|
scrollpane.getViewport().getView() instanceof JTable )
|
||||||
|
{
|
||||||
|
((JButton)corner).setBorder( BorderFactory.createEmptyBorder() );
|
||||||
|
((JButton)corner).setFocusable( false );
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ public class FlatTabbedPaneUI
|
|||||||
Color color;
|
Color color;
|
||||||
if( tabPane.isEnabled() && tabPane.isEnabledAt( tabIndex ) ) {
|
if( tabPane.isEnabled() && tabPane.isEnabledAt( tabIndex ) ) {
|
||||||
color = tabPane.getForegroundAt( tabIndex );
|
color = tabPane.getForegroundAt( tabIndex );
|
||||||
if( isSelected && (color instanceof UIResource) && selectedForeground != null )
|
if( isSelected && selectedForeground != null && color == tabPane.getForeground() )
|
||||||
color = selectedForeground;
|
color = selectedForeground;
|
||||||
} else
|
} else
|
||||||
color = disabledForeground;
|
color = disabledForeground;
|
||||||
@@ -1559,7 +1559,7 @@ public class FlatTabbedPaneUI
|
|||||||
FlatUIUtils.paintComponentBackground( g, left, top,
|
FlatUIUtils.paintComponentBackground( g, left, top,
|
||||||
getWidth() - left - right,
|
getWidth() - left - right,
|
||||||
getHeight() - top - bottom,
|
getHeight() - top - bottom,
|
||||||
0, scale( buttonArc ) );
|
0, scale( (float) buttonArc ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ import javax.swing.SwingUtilities;
|
|||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicTableUI;
|
import javax.swing.plaf.basic.BasicTableUI;
|
||||||
|
import javax.swing.table.JTableHeader;
|
||||||
import com.formdev.flatlaf.util.Graphics2DProxy;
|
import com.formdev.flatlaf.util.Graphics2DProxy;
|
||||||
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -213,15 +215,18 @@ public class FlatTableUI
|
|||||||
// - do not paint last vertical grid line if line is on right edge of scroll pane
|
// - do not paint last vertical grid line if line is on right edge of scroll pane
|
||||||
// - fix unstable grid line thickness when scaled at 125%, 150%, 175%, 225%, ...
|
// - fix unstable grid line thickness when scaled at 125%, 150%, 175%, 225%, ...
|
||||||
// which paints either 1px or 2px lines depending on location
|
// which paints either 1px or 2px lines depending on location
|
||||||
|
// - on Java 9+, fix wrong grid line thickness in dragged column
|
||||||
|
|
||||||
boolean hideLastVerticalLine = hideLastVerticalLine();
|
boolean hideLastVerticalLine = hideLastVerticalLine();
|
||||||
int tableWidth = table.getWidth();
|
int tableWidth = table.getWidth();
|
||||||
|
JTableHeader header = table.getTableHeader();
|
||||||
|
boolean isDragging = (header != null && header.getDraggedColumn() != null);
|
||||||
|
|
||||||
double systemScaleFactor = UIScale.getSystemScaleFactor( (Graphics2D) g );
|
double systemScaleFactor = UIScale.getSystemScaleFactor( (Graphics2D) g );
|
||||||
double lineThickness = (1. / systemScaleFactor) * (int) systemScaleFactor;
|
double lineThickness = (1. / systemScaleFactor) * (int) systemScaleFactor;
|
||||||
|
|
||||||
// Java 8 uses drawLine() to paint grid lines
|
// Java 8 uses drawLine() to paint grid lines
|
||||||
// Java 9+ uses fillRect() to paint grid lines
|
// Java 9+ uses fillRect() to paint grid lines (except for dragged column)
|
||||||
g = new Graphics2DProxy( (Graphics2D) g ) {
|
g = new Graphics2DProxy( (Graphics2D) g ) {
|
||||||
@Override
|
@Override
|
||||||
public void drawLine( int x1, int y1, int x2, int y2 ) {
|
public void drawLine( int x1, int y1, int x2, int y2 ) {
|
||||||
@@ -231,6 +236,22 @@ public class FlatTableUI
|
|||||||
wasInvokedFromPaintGrid() )
|
wasInvokedFromPaintGrid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// on Java 9+, fix wrong grid line thickness in dragged column
|
||||||
|
if( isDragging &&
|
||||||
|
SystemInfo.isJava_9_orLater &&
|
||||||
|
((horizontalLines && y1 == y2) || (verticalLines && x1 == x2)) &&
|
||||||
|
wasInvokedFromPaintDraggedArea() )
|
||||||
|
{
|
||||||
|
if( y1 == y2 ) {
|
||||||
|
// horizontal grid line
|
||||||
|
super.fill( new Rectangle2D.Double( x1, y1, x2 - x1 + 1, lineThickness ) );
|
||||||
|
} else if( x1 == x2 ) {
|
||||||
|
// vertical grid line
|
||||||
|
super.fill( new Rectangle2D.Double( x1, y1, lineThickness, y2 - y1 + 1 ) );
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
super.drawLine( x1, y1, x2, y2 );
|
super.drawLine( x1, y1, x2, y2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,11 +279,23 @@ public class FlatTableUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean wasInvokedFromPaintGrid() {
|
private boolean wasInvokedFromPaintGrid() {
|
||||||
|
return wasInvokedFromMethod( "paintGrid" );
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean wasInvokedFromPaintDraggedArea() {
|
||||||
|
return wasInvokedFromMethod( "paintDraggedArea" );
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean wasInvokedFromMethod( String methodName ) {
|
||||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||||
for( int i = 0; i < 10 || i < stackTrace.length; i++ ) {
|
for( int i = 0; i < 10 || i < stackTrace.length; i++ ) {
|
||||||
if( "javax.swing.plaf.basic.BasicTableUI".equals( stackTrace[i].getClassName() ) &&
|
if( "javax.swing.plaf.basic.BasicTableUI".equals( stackTrace[i].getClassName() ) ) {
|
||||||
"paintGrid".equals( stackTrace[i].getMethodName() ) )
|
String methodName2 = stackTrace[i].getMethodName();
|
||||||
return true;
|
if( "paintCell".equals( methodName2 ) )
|
||||||
|
return false;
|
||||||
|
if( methodName.equals( methodName2 ) )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.accessibility.AccessibleContext;
|
import javax.accessibility.AccessibleContext;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
|
import javax.swing.Box;
|
||||||
import javax.swing.BoxLayout;
|
import javax.swing.BoxLayout;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
@@ -63,7 +64,7 @@ import javax.swing.border.AbstractBorder;
|
|||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
import com.formdev.flatlaf.FlatClientProperties;
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
import com.formdev.flatlaf.FlatSystemProperties;
|
import com.formdev.flatlaf.FlatSystemProperties;
|
||||||
import com.formdev.flatlaf.ui.JBRCustomDecorations.JBRWindowTopBorder;
|
import com.formdev.flatlaf.ui.FlatNativeWindowBorder.WindowTopBorder;
|
||||||
import com.formdev.flatlaf.util.ScaledImageIcon;
|
import com.formdev.flatlaf.util.ScaledImageIcon;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
@@ -77,12 +78,15 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
* @uiDefault TitlePane.inactiveForeground Color
|
* @uiDefault TitlePane.inactiveForeground Color
|
||||||
* @uiDefault TitlePane.embeddedForeground Color
|
* @uiDefault TitlePane.embeddedForeground Color
|
||||||
* @uiDefault TitlePane.borderColor Color optional
|
* @uiDefault TitlePane.borderColor Color optional
|
||||||
|
* @uiDefault TitlePane.unifiedBackground boolean
|
||||||
* @uiDefault TitlePane.iconSize Dimension
|
* @uiDefault TitlePane.iconSize Dimension
|
||||||
* @uiDefault TitlePane.iconMargins Insets
|
* @uiDefault TitlePane.iconMargins Insets
|
||||||
* @uiDefault TitlePane.titleMargins Insets
|
* @uiDefault TitlePane.titleMargins Insets
|
||||||
* @uiDefault TitlePane.menuBarMargins Insets
|
|
||||||
* @uiDefault TitlePane.menuBarEmbedded boolean
|
* @uiDefault TitlePane.menuBarEmbedded boolean
|
||||||
* @uiDefault TitlePane.buttonMaximizedHeight int
|
* @uiDefault TitlePane.buttonMaximizedHeight int
|
||||||
|
* @uiDefault TitlePane.centerTitle boolean
|
||||||
|
* @uiDefault TitlePane.centerTitleIfMenuBarEmbedded boolean
|
||||||
|
* @uiDefault TitlePane.menuBarTitleGap int
|
||||||
* @uiDefault TitlePane.closeIcon Icon
|
* @uiDefault TitlePane.closeIcon Icon
|
||||||
* @uiDefault TitlePane.iconifyIcon Icon
|
* @uiDefault TitlePane.iconifyIcon Icon
|
||||||
* @uiDefault TitlePane.maximizeIcon Icon
|
* @uiDefault TitlePane.maximizeIcon Icon
|
||||||
@@ -100,9 +104,12 @@ public class FlatTitlePane
|
|||||||
protected final Color embeddedForeground = UIManager.getColor( "TitlePane.embeddedForeground" );
|
protected final Color embeddedForeground = UIManager.getColor( "TitlePane.embeddedForeground" );
|
||||||
protected final Color borderColor = UIManager.getColor( "TitlePane.borderColor" );
|
protected final Color borderColor = UIManager.getColor( "TitlePane.borderColor" );
|
||||||
|
|
||||||
protected final Insets menuBarMargins = UIManager.getInsets( "TitlePane.menuBarMargins" );
|
protected final boolean unifiedBackground = UIManager.getBoolean( "TitlePane.unifiedBackground" );
|
||||||
protected final Dimension iconSize = UIManager.getDimension( "TitlePane.iconSize" );
|
protected final Dimension iconSize = UIManager.getDimension( "TitlePane.iconSize" );
|
||||||
protected final int buttonMaximizedHeight = UIManager.getInt( "TitlePane.buttonMaximizedHeight" );
|
protected final int buttonMaximizedHeight = UIManager.getInt( "TitlePane.buttonMaximizedHeight" );
|
||||||
|
protected final boolean centerTitle = UIManager.getBoolean( "TitlePane.centerTitle" );
|
||||||
|
protected final boolean centerTitleIfMenuBarEmbedded = FlatUIUtils.getUIBoolean( "TitlePane.centerTitleIfMenuBarEmbedded", true );
|
||||||
|
protected final int menuBarTitleGap = FlatUIUtils.getUIInt( "TitlePane.menuBarTitleGap", 20 );
|
||||||
|
|
||||||
protected final JRootPane rootPane;
|
protected final JRootPane rootPane;
|
||||||
|
|
||||||
@@ -147,9 +154,15 @@ public class FlatTitlePane
|
|||||||
protected void addSubComponents() {
|
protected void addSubComponents() {
|
||||||
leftPanel = new JPanel();
|
leftPanel = new JPanel();
|
||||||
iconLabel = new JLabel();
|
iconLabel = new JLabel();
|
||||||
titleLabel = new JLabel();
|
titleLabel = new JLabel() {
|
||||||
|
@Override
|
||||||
|
public void updateUI() {
|
||||||
|
setUI( new FlatTitleLabelUI() );
|
||||||
|
}
|
||||||
|
};
|
||||||
iconLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.iconMargins" ) ) );
|
iconLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.iconMargins" ) ) );
|
||||||
titleLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.titleMargins" ) ) );
|
titleLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.titleMargins" ) ) );
|
||||||
|
titleLabel.setHorizontalAlignment( SwingConstants.CENTER );
|
||||||
|
|
||||||
leftPanel.setLayout( new BoxLayout( leftPanel, BoxLayout.LINE_AXIS ) );
|
leftPanel.setLayout( new BoxLayout( leftPanel, BoxLayout.LINE_AXIS ) );
|
||||||
leftPanel.setOpaque( false );
|
leftPanel.setOpaque( false );
|
||||||
@@ -159,9 +172,7 @@ public class FlatTitlePane
|
|||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||||
return (menuBar != null && menuBar.isVisible() && isMenuBarEmbedded())
|
return hasVisibleEmbeddedMenuBar( menuBar ) ? menuBar.getPreferredSize() : new Dimension();
|
||||||
? FlatUIUtils.addInsets( menuBar.getPreferredSize(), UIScale.scale( menuBarMargins ) )
|
|
||||||
: new Dimension();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
leftPanel.add( menuBarPlaceholder );
|
leftPanel.add( menuBarPlaceholder );
|
||||||
@@ -184,6 +195,18 @@ public class FlatTitlePane
|
|||||||
if( !getComponentOrientation().isLeftToRight() )
|
if( !getComponentOrientation().isLeftToRight() )
|
||||||
leftPanel.setLocation( leftPanel.getX() + (oldWidth - newWidth), leftPanel.getY() );
|
leftPanel.setLocation( leftPanel.getX() + (oldWidth - newWidth), leftPanel.getY() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If menu bar is embedded and contains a horizontal glue component,
|
||||||
|
// then move the title label to the same location as the glue component.
|
||||||
|
// This allows placing any component on the trailing side of the title pane.
|
||||||
|
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||||
|
if( hasVisibleEmbeddedMenuBar( menuBar ) ) {
|
||||||
|
Component horizontalGlue = findHorizontalGlue( menuBar );
|
||||||
|
if( horizontalGlue != null ) {
|
||||||
|
Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, titleLabel );
|
||||||
|
titleLabel.setLocation( titleLabel.getX() + glueLocation.x, titleLabel.getY() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -240,7 +263,7 @@ public class FlatTitlePane
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void activeChanged( boolean active ) {
|
protected void activeChanged( boolean active ) {
|
||||||
boolean hasEmbeddedMenuBar = rootPane.getJMenuBar() != null && rootPane.getJMenuBar().isVisible() && isMenuBarEmbedded();
|
boolean hasEmbeddedMenuBar = hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() );
|
||||||
Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground );
|
Color background = FlatUIUtils.nonUIResource( active ? activeBackground : inactiveBackground );
|
||||||
Color foreground = FlatUIUtils.nonUIResource( active ? activeForeground : inactiveForeground );
|
Color foreground = FlatUIUtils.nonUIResource( active ? activeForeground : inactiveForeground );
|
||||||
Color titleForeground = (hasEmbeddedMenuBar && active) ? FlatUIUtils.nonUIResource( embeddedForeground ) : foreground;
|
Color titleForeground = (hasEmbeddedMenuBar && active) ? FlatUIUtils.nonUIResource( embeddedForeground ) : foreground;
|
||||||
@@ -252,8 +275,6 @@ public class FlatTitlePane
|
|||||||
restoreButton.setForeground( foreground );
|
restoreButton.setForeground( foreground );
|
||||||
closeButton.setForeground( foreground );
|
closeButton.setForeground( foreground );
|
||||||
|
|
||||||
titleLabel.setHorizontalAlignment( hasEmbeddedMenuBar ? SwingConstants.CENTER : SwingConstants.LEADING );
|
|
||||||
|
|
||||||
// this is necessary because hover/pressed colors are derived from background color
|
// this is necessary because hover/pressed colors are derived from background color
|
||||||
iconifyButton.setBackground( background );
|
iconifyButton.setBackground( background );
|
||||||
maximizeButton.setBackground( background );
|
maximizeButton.setBackground( background );
|
||||||
@@ -337,7 +358,7 @@ public class FlatTitlePane
|
|||||||
// show/hide icon
|
// show/hide icon
|
||||||
iconLabel.setVisible( hasIcon );
|
iconLabel.setVisible( hasIcon );
|
||||||
|
|
||||||
updateJBRHitTestSpotsAndTitleBarHeightLater();
|
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -355,7 +376,7 @@ public class FlatTitlePane
|
|||||||
installWindowListeners();
|
installWindowListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateJBRHitTestSpotsAndTitleBarHeightLater();
|
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -394,6 +415,16 @@ public class FlatTitlePane
|
|||||||
window.removeComponentListener( handler );
|
window.removeComponentListener( handler );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this title pane currently has an visible and embedded menubar.
|
||||||
|
*/
|
||||||
|
protected boolean hasVisibleEmbeddedMenuBar( JMenuBar menuBar ) {
|
||||||
|
return menuBar != null && menuBar.isVisible() && isMenuBarEmbedded();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the menubar should be embedded into the title pane.
|
||||||
|
*/
|
||||||
protected boolean isMenuBarEmbedded() {
|
protected boolean isMenuBarEmbedded() {
|
||||||
// not storing value of "TitlePane.menuBarEmbedded" in class to allow changing at runtime
|
// not storing value of "TitlePane.menuBarEmbedded" in class to allow changing at runtime
|
||||||
return UIManager.getBoolean( "TitlePane.menuBarEmbedded" ) &&
|
return UIManager.getBoolean( "TitlePane.menuBarEmbedded" ) &&
|
||||||
@@ -412,13 +443,30 @@ public class FlatTitlePane
|
|||||||
Insets borderInsets = getBorder().getBorderInsets( this );
|
Insets borderInsets = getBorder().getBorderInsets( this );
|
||||||
bounds.height += borderInsets.bottom;
|
bounds.height += borderInsets.bottom;
|
||||||
|
|
||||||
return FlatUIUtils.subtractInsets( bounds, UIScale.scale( getMenuBarMargins() ) );
|
// If menu bar is embedded and contains a horizontal glue component,
|
||||||
|
// then make the menu bar wider so that it completely overlaps the title label.
|
||||||
|
// Since the menu bar is not opaque, the title label is still visible.
|
||||||
|
// The title label is moved to the location of the glue component by the layout manager.
|
||||||
|
// This allows placing any component on the trailing side of the title pane.
|
||||||
|
Component horizontalGlue = findHorizontalGlue( rootPane.getJMenuBar() );
|
||||||
|
if( horizontalGlue != null ) {
|
||||||
|
int titleWidth = Math.max( titleLabel.getWidth(), 0 ); // title width may be negative
|
||||||
|
bounds.width += titleWidth;
|
||||||
|
if( !getComponentOrientation().isLeftToRight() )
|
||||||
|
bounds.x -= titleWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Insets getMenuBarMargins() {
|
protected Component findHorizontalGlue( JMenuBar menuBar ) {
|
||||||
return getComponentOrientation().isLeftToRight()
|
int count = menuBar.getComponentCount();
|
||||||
? menuBarMargins
|
for( int i = count - 1; i >= 0; i-- ) {
|
||||||
: new Insets( menuBarMargins.top, menuBarMargins.right, menuBarMargins.bottom, menuBarMargins.left );
|
Component c = menuBar.getComponent( i );
|
||||||
|
if( c instanceof Box.Filler && c.getMaximumSize().width >= Short.MAX_VALUE )
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void menuBarChanged() {
|
protected void menuBarChanged() {
|
||||||
@@ -435,7 +483,8 @@ public class FlatTitlePane
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void menuBarLayouted() {
|
protected void menuBarLayouted() {
|
||||||
updateJBRHitTestSpotsAndTitleBarHeightLater();
|
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||||
|
revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*debug
|
/*debug
|
||||||
@@ -449,16 +498,25 @@ public class FlatTitlePane
|
|||||||
}
|
}
|
||||||
if( debugHitTestSpots != null ) {
|
if( debugHitTestSpots != null ) {
|
||||||
g.setColor( Color.blue );
|
g.setColor( Color.blue );
|
||||||
|
Point offset = SwingUtilities.convertPoint( this, 0, 0, window );
|
||||||
for( Rectangle r : debugHitTestSpots )
|
for( Rectangle r : debugHitTestSpots )
|
||||||
g.drawRect( r.x, r.y, r.width, r.height );
|
g.drawRect( r.x - offset.x, r.y - offset.y, r.width - 1, r.height - 1 );
|
||||||
|
}
|
||||||
|
if( debugAppIconBounds != null ) {
|
||||||
|
g.setColor( Color.red );
|
||||||
|
Point offset = SwingUtilities.convertPoint( this, 0, 0, window );
|
||||||
|
Rectangle r = debugAppIconBounds;
|
||||||
|
g.drawRect( r.x - offset.x, r.y - offset.y, r.width - 1, r.height - 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug*/
|
debug*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintComponent( Graphics g ) {
|
protected void paintComponent( Graphics g ) {
|
||||||
g.setColor( getBackground() );
|
if( !unifiedBackground ) {
|
||||||
g.fillRect( 0, 0, getWidth(), getHeight() );
|
g.setColor( getBackground() );
|
||||||
|
g.fillRect( 0, 0, getWidth(), getHeight() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void repaintWindowBorder() {
|
protected void repaintWindowBorder() {
|
||||||
@@ -503,9 +561,9 @@ debug*/
|
|||||||
Frame frame = (Frame) window;
|
Frame frame = (Frame) window;
|
||||||
|
|
||||||
// set maximized bounds to avoid that maximized window overlaps Windows task bar
|
// set maximized bounds to avoid that maximized window overlaps Windows task bar
|
||||||
// (if not running in JBR and if not modified from the application)
|
// (if not having native window border and if not modified from the application)
|
||||||
Rectangle oldMaximizedBounds = frame.getMaximizedBounds();
|
Rectangle oldMaximizedBounds = frame.getMaximizedBounds();
|
||||||
if( !hasJBRCustomDecoration() &&
|
if( !hasNativeCustomDecoration() &&
|
||||||
(oldMaximizedBounds == null ||
|
(oldMaximizedBounds == null ||
|
||||||
Objects.equals( oldMaximizedBounds, rootPane.getClientProperty( "_flatlaf.maximizedBounds" ) )) )
|
Objects.equals( oldMaximizedBounds, rootPane.getClientProperty( "_flatlaf.maximizedBounds" ) )) )
|
||||||
{
|
{
|
||||||
@@ -601,65 +659,115 @@ debug*/
|
|||||||
window.dispatchEvent( new WindowEvent( window, WindowEvent.WINDOW_CLOSING ) );
|
window.dispatchEvent( new WindowEvent( window, WindowEvent.WINDOW_CLOSING ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean hasJBRCustomDecoration() {
|
private boolean hasJBRCustomDecoration() {
|
||||||
return FlatRootPaneUI.canUseJBRCustomDecorations &&
|
return window != null && JBRCustomDecorations.hasCustomDecoration( window );
|
||||||
window != null &&
|
|
||||||
JBRCustomDecorations.hasCustomDecoration( window );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateJBRHitTestSpotsAndTitleBarHeightLater() {
|
/**
|
||||||
|
* Returns whether windows uses native window border and has custom decorations enabled.
|
||||||
|
*/
|
||||||
|
protected boolean hasNativeCustomDecoration() {
|
||||||
|
return window != null && FlatNativeWindowBorder.hasCustomDecoration( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateNativeTitleBarHeightAndHitTestSpotsLater() {
|
||||||
EventQueue.invokeLater( () -> {
|
EventQueue.invokeLater( () -> {
|
||||||
updateJBRHitTestSpotsAndTitleBarHeight();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateJBRHitTestSpotsAndTitleBarHeight() {
|
protected void updateNativeTitleBarHeightAndHitTestSpots() {
|
||||||
if( !isDisplayable() )
|
if( !isDisplayable() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !hasJBRCustomDecoration() )
|
if( !hasNativeCustomDecoration() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<Rectangle> hitTestSpots = new ArrayList<>();
|
|
||||||
if( iconLabel.isVisible() )
|
|
||||||
addJBRHitTestSpot( iconLabel, false, hitTestSpots );
|
|
||||||
addJBRHitTestSpot( buttonPanel, false, hitTestSpots );
|
|
||||||
addJBRHitTestSpot( menuBarPlaceholder, true, hitTestSpots );
|
|
||||||
|
|
||||||
int titleBarHeight = getHeight();
|
int titleBarHeight = getHeight();
|
||||||
// slightly reduce height so that component receives mouseExit events
|
// slightly reduce height so that component receives mouseExit events
|
||||||
if( titleBarHeight > 0 )
|
if( titleBarHeight > 0 )
|
||||||
titleBarHeight--;
|
titleBarHeight--;
|
||||||
|
|
||||||
JBRCustomDecorations.setHitTestSpotsAndTitleBarHeight( window, hitTestSpots, titleBarHeight );
|
List<Rectangle> hitTestSpots = new ArrayList<>();
|
||||||
|
Rectangle appIconBounds = null;
|
||||||
|
if( iconLabel.isVisible() ) {
|
||||||
|
// compute real icon size (without insets)
|
||||||
|
Point location = SwingUtilities.convertPoint( iconLabel, 0, 0, window );
|
||||||
|
Insets iconInsets = iconLabel.getInsets();
|
||||||
|
Rectangle iconBounds = new Rectangle(
|
||||||
|
location.x + iconInsets.left,
|
||||||
|
location.y + iconInsets.top,
|
||||||
|
iconLabel.getWidth() - iconInsets.left - iconInsets.right,
|
||||||
|
iconLabel.getHeight() - iconInsets.top - iconInsets.bottom );
|
||||||
|
|
||||||
|
if( hasJBRCustomDecoration() )
|
||||||
|
hitTestSpots.add( iconBounds );
|
||||||
|
else
|
||||||
|
appIconBounds = iconBounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle r = getNativeHitTestSpot( buttonPanel );
|
||||||
|
if( r != null )
|
||||||
|
hitTestSpots.add( r );
|
||||||
|
|
||||||
|
r = getNativeHitTestSpot( menuBarPlaceholder );
|
||||||
|
if( r != null ) {
|
||||||
|
Component horizontalGlue = findHorizontalGlue( rootPane.getJMenuBar() );
|
||||||
|
if( horizontalGlue != null ) {
|
||||||
|
// If menu bar is embedded and contains a horizontal glue component,
|
||||||
|
// then split the hit test spot into two spots so that
|
||||||
|
// the glue component area can used to move the window.
|
||||||
|
|
||||||
|
Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, window );
|
||||||
|
Rectangle r2;
|
||||||
|
if( getComponentOrientation().isLeftToRight() ) {
|
||||||
|
int trailingWidth = (r.x + r.width - HIT_TEST_SPOT_GROW) - glueLocation.x;
|
||||||
|
r.width -= trailingWidth;
|
||||||
|
r2 = new Rectangle( glueLocation.x + horizontalGlue.getWidth(), r.y, trailingWidth, r.height );
|
||||||
|
} else {
|
||||||
|
int leadingWidth = (glueLocation.x + horizontalGlue.getWidth()) - (r.x + HIT_TEST_SPOT_GROW);
|
||||||
|
r.x += leadingWidth;
|
||||||
|
r.width -= leadingWidth;
|
||||||
|
r2 = new Rectangle( glueLocation.x -leadingWidth, r.y, leadingWidth, r.height );
|
||||||
|
}
|
||||||
|
r2.grow( HIT_TEST_SPOT_GROW, HIT_TEST_SPOT_GROW );
|
||||||
|
hitTestSpots.add( r2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
hitTestSpots.add( r );
|
||||||
|
}
|
||||||
|
|
||||||
|
FlatNativeWindowBorder.setTitleBarHeightAndHitTestSpots( window, titleBarHeight, hitTestSpots, appIconBounds );
|
||||||
|
|
||||||
/*debug
|
/*debug
|
||||||
debugHitTestSpots = hitTestSpots;
|
|
||||||
debugTitleBarHeight = titleBarHeight;
|
debugTitleBarHeight = titleBarHeight;
|
||||||
|
debugHitTestSpots = hitTestSpots;
|
||||||
|
debugAppIconBounds = appIconBounds;
|
||||||
repaint();
|
repaint();
|
||||||
debug*/
|
debug*/
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addJBRHitTestSpot( JComponent c, boolean subtractMenuBarMargins, List<Rectangle> hitTestSpots ) {
|
protected Rectangle getNativeHitTestSpot( JComponent c ) {
|
||||||
Dimension size = c.getSize();
|
Dimension size = c.getSize();
|
||||||
if( size.width <= 0 || size.height <= 0 )
|
if( size.width <= 0 || size.height <= 0 )
|
||||||
return;
|
return null;
|
||||||
|
|
||||||
Point location = SwingUtilities.convertPoint( c, 0, 0, window );
|
Point location = SwingUtilities.convertPoint( c, 0, 0, window );
|
||||||
Rectangle r = new Rectangle( location, size );
|
Rectangle r = new Rectangle( location, size );
|
||||||
if( subtractMenuBarMargins )
|
|
||||||
r = FlatUIUtils.subtractInsets( r, UIScale.scale( getMenuBarMargins() ) );
|
|
||||||
// slightly increase rectangle so that component receives mouseExit events
|
// slightly increase rectangle so that component receives mouseExit events
|
||||||
r.grow( 2, 2 );
|
r.grow( HIT_TEST_SPOT_GROW, HIT_TEST_SPOT_GROW );
|
||||||
hitTestSpots.add( r );
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final int HIT_TEST_SPOT_GROW = 2;
|
||||||
|
|
||||||
/*debug
|
/*debug
|
||||||
private List<Rectangle> debugHitTestSpots;
|
|
||||||
private int debugTitleBarHeight;
|
private int debugTitleBarHeight;
|
||||||
|
private List<Rectangle> debugHitTestSpots;
|
||||||
|
private Rectangle debugAppIconBounds;
|
||||||
debug*/
|
debug*/
|
||||||
|
|
||||||
//---- class TitlePaneBorder ----------------------------------------------
|
//---- class FlatTitlePaneBorder ------------------------------------------
|
||||||
|
|
||||||
protected class FlatTitlePaneBorder
|
protected class FlatTitlePaneBorder
|
||||||
extends AbstractBorder
|
extends AbstractBorder
|
||||||
@@ -676,8 +784,8 @@ debug*/
|
|||||||
} else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) )
|
} else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) )
|
||||||
insets.bottom += UIScale.scale( 1 );
|
insets.bottom += UIScale.scale( 1 );
|
||||||
|
|
||||||
if( hasJBRCustomDecoration() )
|
if( hasNativeCustomDecoration() )
|
||||||
insets = FlatUIUtils.addInsets( insets, JBRWindowTopBorder.getInstance().getBorderInsets() );
|
insets = FlatUIUtils.addInsets( insets, WindowTopBorder.getInstance().getBorderInsets() );
|
||||||
|
|
||||||
return insets;
|
return insets;
|
||||||
}
|
}
|
||||||
@@ -695,13 +803,51 @@ debug*/
|
|||||||
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
|
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hasJBRCustomDecoration() )
|
if( hasNativeCustomDecoration() )
|
||||||
JBRWindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height );
|
WindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Border getMenuBarBorder() {
|
protected Border getMenuBarBorder() {
|
||||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||||
return (menuBar != null && menuBar.isVisible() && isMenuBarEmbedded()) ? menuBar.getBorder() : null;
|
return hasVisibleEmbeddedMenuBar( menuBar ) ? menuBar.getBorder() : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class FlatTitleLabelUI ---------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
protected class FlatTitleLabelUI
|
||||||
|
extends FlatLabelUI
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected void paintEnabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
|
||||||
|
boolean hasEmbeddedMenuBar = hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() );
|
||||||
|
int labelWidth = l.getWidth();
|
||||||
|
int textWidth = labelWidth - (textX * 2);
|
||||||
|
int gap = UIScale.scale( menuBarTitleGap );
|
||||||
|
|
||||||
|
// The passed in textX coordinate is always to horizontally center the text within the label bounds.
|
||||||
|
// Modify textX so that the text is painted either centered within the window bounds or leading aligned.
|
||||||
|
boolean center = hasEmbeddedMenuBar ? centerTitleIfMenuBarEmbedded : centerTitle;
|
||||||
|
if( center ) {
|
||||||
|
// If window is wide enough, center title within window bounds.
|
||||||
|
// Otherwise leave it centered within free space (label bounds).
|
||||||
|
int centeredTextX = ((l.getParent().getWidth() - textWidth) / 2) - l.getX();
|
||||||
|
if( centeredTextX >= gap && centeredTextX + textWidth <= labelWidth - gap )
|
||||||
|
textX = centeredTextX;
|
||||||
|
} else {
|
||||||
|
// leading aligned
|
||||||
|
boolean leftToRight = getComponentOrientation().isLeftToRight();
|
||||||
|
Insets insets = l.getInsets();
|
||||||
|
int leadingInset = hasEmbeddedMenuBar ? gap : (leftToRight ? insets.left : insets.right);
|
||||||
|
int leadingTextX = leftToRight ? leadingInset : labelWidth - leadingInset - textWidth;
|
||||||
|
if( leftToRight ? leadingTextX < textX : leadingTextX > textX )
|
||||||
|
textX = leadingTextX;
|
||||||
|
}
|
||||||
|
|
||||||
|
super.paintEnabledText( l, g, s, textX, textY );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -730,7 +876,7 @@ debug*/
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "componentOrientation":
|
case "componentOrientation":
|
||||||
updateJBRHitTestSpotsAndTitleBarHeightLater();
|
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -740,10 +886,10 @@ debug*/
|
|||||||
@Override
|
@Override
|
||||||
public void windowActivated( WindowEvent e ) {
|
public void windowActivated( WindowEvent e ) {
|
||||||
activeChanged( true );
|
activeChanged( true );
|
||||||
updateJBRHitTestSpotsAndTitleBarHeight();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
|
|
||||||
if( hasJBRCustomDecoration() )
|
if( hasNativeCustomDecoration() )
|
||||||
JBRWindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
||||||
|
|
||||||
repaintWindowBorder();
|
repaintWindowBorder();
|
||||||
}
|
}
|
||||||
@@ -751,10 +897,10 @@ debug*/
|
|||||||
@Override
|
@Override
|
||||||
public void windowDeactivated( WindowEvent e ) {
|
public void windowDeactivated( WindowEvent e ) {
|
||||||
activeChanged( false );
|
activeChanged( false );
|
||||||
updateJBRHitTestSpotsAndTitleBarHeight();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
|
|
||||||
if( hasJBRCustomDecoration() )
|
if( hasNativeCustomDecoration() )
|
||||||
JBRWindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
WindowTopBorder.getInstance().repaintBorder( FlatTitlePane.this );
|
||||||
|
|
||||||
repaintWindowBorder();
|
repaintWindowBorder();
|
||||||
}
|
}
|
||||||
@@ -762,7 +908,7 @@ debug*/
|
|||||||
@Override
|
@Override
|
||||||
public void windowStateChanged( WindowEvent e ) {
|
public void windowStateChanged( WindowEvent e ) {
|
||||||
frameStateChanged();
|
frameStateChanged();
|
||||||
updateJBRHitTestSpotsAndTitleBarHeight();
|
updateNativeTitleBarHeightAndHitTestSpots();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---- interface MouseListener ----
|
//---- interface MouseListener ----
|
||||||
@@ -775,7 +921,7 @@ debug*/
|
|||||||
if( e.getSource() == iconLabel ) {
|
if( e.getSource() == iconLabel ) {
|
||||||
// double-click on icon closes window
|
// double-click on icon closes window
|
||||||
close();
|
close();
|
||||||
} else if( !hasJBRCustomDecoration() &&
|
} else if( !hasNativeCustomDecoration() &&
|
||||||
window instanceof Frame &&
|
window instanceof Frame &&
|
||||||
((Frame)window).isResizable() )
|
((Frame)window).isResizable() )
|
||||||
{
|
{
|
||||||
@@ -808,8 +954,8 @@ debug*/
|
|||||||
if( window == null )
|
if( window == null )
|
||||||
return; // should newer occur
|
return; // should newer occur
|
||||||
|
|
||||||
if( hasJBRCustomDecoration() )
|
if( hasNativeCustomDecoration() )
|
||||||
return; // do nothing if running in JBR
|
return; // do nothing if having native window border
|
||||||
|
|
||||||
// restore window if it is maximized
|
// restore window if it is maximized
|
||||||
if( window instanceof Frame ) {
|
if( window instanceof Frame ) {
|
||||||
@@ -852,7 +998,7 @@ debug*/
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentResized( ComponentEvent e ) {
|
public void componentResized( ComponentEvent e ) {
|
||||||
updateJBRHitTestSpotsAndTitleBarHeightLater();
|
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import java.awt.Insets;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
import java.beans.PropertyChangeEvent;
|
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import javax.swing.CellRendererPane;
|
import javax.swing.CellRendererPane;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
@@ -193,40 +192,38 @@ public class FlatTreeUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new BasicTreeUI.PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
if( e.getSource() == tree ) {
|
if( e.getSource() == tree ) {
|
||||||
switch( e.getPropertyName() ) {
|
switch( e.getPropertyName() ) {
|
||||||
case TREE_WIDE_SELECTION:
|
case TREE_WIDE_SELECTION:
|
||||||
case TREE_PAINT_SELECTION:
|
case TREE_PAINT_SELECTION:
|
||||||
tree.repaint();
|
tree.repaint();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "dropLocation":
|
case "dropLocation":
|
||||||
if( isWideSelection() ) {
|
if( isWideSelection() ) {
|
||||||
JTree.DropLocation oldValue = (JTree.DropLocation) e.getOldValue();
|
JTree.DropLocation oldValue = (JTree.DropLocation) e.getOldValue();
|
||||||
repaintWideDropLocation( oldValue );
|
repaintWideDropLocation( oldValue );
|
||||||
repaintWideDropLocation( tree.getDropLocation() );
|
repaintWideDropLocation( tree.getDropLocation() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void repaintWideDropLocation(JTree.DropLocation loc) {
|
|
||||||
if( loc == null || isDropLine( loc ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
Rectangle r = tree.getPathBounds( loc.getPath() );
|
|
||||||
if( r != null )
|
|
||||||
tree.repaint( 0, r.y, tree.getWidth(), r.height );
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void repaintWideDropLocation(JTree.DropLocation loc) {
|
||||||
|
if( loc == null || isDropLine( loc ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Rectangle r = tree.getPathBounds( loc.getPath() );
|
||||||
|
if( r != null )
|
||||||
|
tree.repaint( 0, r.y, tree.getWidth(), r.height );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as super.paintRow(), but supports wide selection and uses
|
* Same as super.paintRow(), but supports wide selection and uses
|
||||||
* inactive selection background/foreground if tree is not focused.
|
* inactive selection background/foreground if tree is not focused.
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.ui;
|
package com.formdev.flatlaf.ui;
|
||||||
|
|
||||||
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Container;
|
import java.awt.Container;
|
||||||
@@ -30,6 +31,7 @@ import java.awt.KeyboardFocusManager;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.RenderingHints;
|
import java.awt.RenderingHints;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
|
import java.awt.Stroke;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.awt.event.FocusEvent;
|
import java.awt.event.FocusEvent;
|
||||||
import java.awt.event.FocusListener;
|
import java.awt.event.FocusListener;
|
||||||
@@ -44,6 +46,7 @@ import java.util.function.Supplier;
|
|||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JTable;
|
import javax.swing.JTable;
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
@@ -119,6 +122,14 @@ public class FlatUIUtils
|
|||||||
return (color != null) ? color : UIManager.getColor( defaultKey );
|
return (color != null) ? color : UIManager.getColor( defaultKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public static boolean getUIBoolean( String key, boolean defaultValue ) {
|
||||||
|
Object value = UIManager.get( key );
|
||||||
|
return (value instanceof Boolean) ? (Boolean) value : defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
public static int getUIInt( String key, int defaultValue ) {
|
public static int getUIInt( String key, int defaultValue ) {
|
||||||
Object value = UIManager.get( key );
|
Object value = UIManager.get( key );
|
||||||
return (value instanceof Integer) ? (Integer) value : defaultValue;
|
return (value instanceof Integer) ? (Integer) value : defaultValue;
|
||||||
@@ -604,6 +615,111 @@ public class FlatUIUtils
|
|||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paints a chevron or triangle arrow in the center of the given rectangle.
|
||||||
|
*
|
||||||
|
* @param g the graphics context used for painting
|
||||||
|
* @param x the x coordinate of the rectangle
|
||||||
|
* @param y the y coordinate of the rectangle
|
||||||
|
* @param width the width of the rectangle
|
||||||
|
* @param height the height of the rectangle
|
||||||
|
* @param direction the arrow direction ({@link SwingConstants#NORTH}, {@link SwingConstants#SOUTH}
|
||||||
|
* {@link SwingConstants#WEST} or {@link SwingConstants#EAST})
|
||||||
|
* @param chevron {@code true} for chevron arrow, {@code false} for triangle arrow
|
||||||
|
* @param arrowSize the width of the painted arrow (for vertical direction) (will be scaled)
|
||||||
|
* @param xOffset a offset added to the x coordinate of the arrow to paint it out-of-center. Usually zero. (will be scaled)
|
||||||
|
* @param yOffset a offset added to the y coordinate of the arrow to paint it out-of-center. Usually zero. (will be scaled)
|
||||||
|
*
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public static void paintArrow( Graphics2D g, int x, int y, int width, int height,
|
||||||
|
int direction, boolean chevron, int arrowSize, int xOffset, int yOffset )
|
||||||
|
{
|
||||||
|
// compute arrow width/height
|
||||||
|
int aw = UIScale.scale( arrowSize + (chevron ? 0 : 1) );
|
||||||
|
int ah = UIScale.scale( (arrowSize / 2) + (chevron ? 0 : 1) );
|
||||||
|
|
||||||
|
// rotate arrow width/height for horizontal directions
|
||||||
|
boolean vert = (direction == SwingConstants.NORTH || direction == SwingConstants.SOUTH);
|
||||||
|
if( !vert ) {
|
||||||
|
int temp = aw;
|
||||||
|
aw = ah;
|
||||||
|
ah = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
// chevron lines end 1px outside of width/height
|
||||||
|
// --> add 1px to arrow width/height for position calculation
|
||||||
|
int extra = chevron ? 1 : 0;
|
||||||
|
|
||||||
|
// compute arrow location
|
||||||
|
int ax = x + Math.round( ((width - (aw + extra)) / 2f) + UIScale.scale( (float) xOffset ) );
|
||||||
|
int ay = y + Math.round( ((height - (ah + extra)) / 2f) + UIScale.scale( (float) yOffset ) );
|
||||||
|
|
||||||
|
// paint arrow
|
||||||
|
g.translate( ax, ay );
|
||||||
|
/*debug
|
||||||
|
debugPaintArrow( g, Color.red, vert, aw + extra, ah + extra );
|
||||||
|
debug*/
|
||||||
|
Shape arrowShape = createArrowShape( direction, chevron, aw, ah );
|
||||||
|
if( chevron ) {
|
||||||
|
Stroke oldStroke = g.getStroke();
|
||||||
|
g.setStroke( new BasicStroke( UIScale.scale( 1f ) ) );
|
||||||
|
g.draw( arrowShape );
|
||||||
|
g.setStroke( oldStroke );
|
||||||
|
} else {
|
||||||
|
// triangle
|
||||||
|
g.fill( arrowShape );
|
||||||
|
}
|
||||||
|
g.translate( -ax, -ay );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a chevron or triangle arrow shape for the given direction and size.
|
||||||
|
* <p>
|
||||||
|
* The chevron shape is a open path that can be painted with {@link Graphics2D#draw(Shape)}.
|
||||||
|
* The triangle shape is a close path that can be painted with {@link Graphics2D#fill(Shape)}.
|
||||||
|
*
|
||||||
|
* @param direction the arrow direction ({@link SwingConstants#NORTH}, {@link SwingConstants#SOUTH}
|
||||||
|
* {@link SwingConstants#WEST} or {@link SwingConstants#EAST})
|
||||||
|
* @param chevron {@code true} for chevron arrow, {@code false} for triangle arrow
|
||||||
|
* @param w the width of the returned shape
|
||||||
|
* @param h the height of the returned shape
|
||||||
|
*
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public static Shape createArrowShape( int direction, boolean chevron, float w, float h ) {
|
||||||
|
switch( direction ) {
|
||||||
|
case SwingConstants.NORTH: return createPath( !chevron, 0,h, (w / 2f),0, w,h );
|
||||||
|
case SwingConstants.SOUTH: return createPath( !chevron, 0,0, (w / 2f),h, w,0 );
|
||||||
|
case SwingConstants.WEST: return createPath( !chevron, w,0, 0,(h / 2f), w,h );
|
||||||
|
case SwingConstants.EAST: return createPath( !chevron, 0,0, w,(h / 2f), 0,h );
|
||||||
|
default: return new Path2D.Float();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*debug
|
||||||
|
private static void debugPaintArrow( Graphics2D g, Color color, boolean vert, int w, int h ) {
|
||||||
|
Color oldColor = g.getColor();
|
||||||
|
g.setColor( color );
|
||||||
|
g.fill( createRectangle( 0, 0, w, h, 1 ) );
|
||||||
|
|
||||||
|
int xy1 = -2;
|
||||||
|
int x2 = w + 1;
|
||||||
|
int y2 = h + 1;
|
||||||
|
for( int i = 0; i < 20; i++ ) {
|
||||||
|
g.fillRect( 0, xy1, 1, 1 );
|
||||||
|
g.fillRect( 0, y2, 1, 1 );
|
||||||
|
g.fillRect( xy1, 0, 1, 1 );
|
||||||
|
g.fillRect( x2, 0, 1, 1 );
|
||||||
|
xy1 -= 2;
|
||||||
|
x2 += 2;
|
||||||
|
y2 += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
g.setColor( oldColor );
|
||||||
|
}
|
||||||
|
debug*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a closed path for the given points.
|
* Creates a closed path for the given points.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,382 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.Dialog;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GraphicsConfiguration;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.Window;
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.Timer;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
import javax.swing.event.EventListenerList;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
|
import com.formdev.flatlaf.util.NativeLibrary;
|
||||||
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Interesting resources:
|
||||||
|
// https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
// https://docs.microsoft.com/en-us/windows/win32/dwm/customframe
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/commit/d2820524a1aa211b1c49b30f659b9b4d07a6f96e
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/pull/18
|
||||||
|
// https://medium.com/swlh/customizing-the-title-bar-of-an-application-window-50a4ac3ed27e
|
||||||
|
// https://github.com/kalbetredev/CustomDecoratedJFrame
|
||||||
|
// https://github.com/Guerra24/NanoUI-win32
|
||||||
|
// https://github.com/oberth/custom-chrome
|
||||||
|
// https://github.com/rossy/borderless-window
|
||||||
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Native window border support for Windows 10 when using custom decorations.
|
||||||
|
* <p>
|
||||||
|
* If the application wants to use custom decorations, the Windows 10 title bar is hidden
|
||||||
|
* (including minimize, maximize and close buttons), but not the resize borders (including drop shadow).
|
||||||
|
* Windows 10 window snapping functionality will remain unaffected:
|
||||||
|
* https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
class FlatWindowsNativeWindowBorder
|
||||||
|
implements FlatNativeWindowBorder.Provider
|
||||||
|
{
|
||||||
|
private final Map<Window, WndProc> windowsMap = Collections.synchronizedMap( new IdentityHashMap<>() );
|
||||||
|
private final EventListenerList listenerList = new EventListenerList();
|
||||||
|
private Timer fireStateChangedTimer;
|
||||||
|
|
||||||
|
private boolean colorizationUpToDate;
|
||||||
|
private boolean colorizationColorAffectsBorders;
|
||||||
|
private Color colorizationColor;
|
||||||
|
private int colorizationColorBalance;
|
||||||
|
|
||||||
|
private static NativeLibrary nativeLibrary;
|
||||||
|
private static FlatWindowsNativeWindowBorder instance;
|
||||||
|
|
||||||
|
static FlatNativeWindowBorder.Provider getInstance() {
|
||||||
|
// requires Windows 10
|
||||||
|
if( !SystemInfo.isWindows_10_orLater )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// load native library
|
||||||
|
if( nativeLibrary == null ) {
|
||||||
|
if( !SystemInfo.isJava_9_orLater ) {
|
||||||
|
// In Java 8, load jawt.dll (part of JRE) explicitly because it
|
||||||
|
// is not found when running application with <jdk>/bin/java.exe.
|
||||||
|
// When using <jdk>/jre/bin/java.exe, it is found.
|
||||||
|
// jawt.dll is located in <jdk>/jre/bin/.
|
||||||
|
// Java 9 and later does not have this problem.
|
||||||
|
try {
|
||||||
|
System.loadLibrary( "jawt" );
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String libraryName = "com/formdev/flatlaf/natives/flatlaf-windows-x86";
|
||||||
|
if( SystemInfo.isX86_64 )
|
||||||
|
libraryName += "_64";
|
||||||
|
|
||||||
|
nativeLibrary = new NativeLibrary( libraryName,
|
||||||
|
FlatWindowsNativeWindowBorder.class.getClassLoader(), true );
|
||||||
|
}
|
||||||
|
|
||||||
|
// check whether native library was successfully loaded
|
||||||
|
if( !nativeLibrary.isLoaded() )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// create new instance
|
||||||
|
if( instance == null )
|
||||||
|
instance = new FlatWindowsNativeWindowBorder();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private FlatWindowsNativeWindowBorder() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomDecoration( Window window ) {
|
||||||
|
return windowsMap.containsKey( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the window whether the application wants use custom decorations.
|
||||||
|
* If {@code true}, the Windows 10 title bar is hidden (including minimize,
|
||||||
|
* maximize and close buttons), but not the resize borders (including drop shadow).
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setHasCustomDecoration( Window window, boolean hasCustomDecoration ) {
|
||||||
|
if( hasCustomDecoration )
|
||||||
|
install( window );
|
||||||
|
else
|
||||||
|
uninstall( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void install( Window window ) {
|
||||||
|
// requires Windows 10
|
||||||
|
if( !SystemInfo.isWindows_10_orLater )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// only JFrame and JDialog are supported
|
||||||
|
if( !(window instanceof JFrame) && !(window instanceof JDialog) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// not supported if frame/dialog is undecorated
|
||||||
|
if( (window instanceof Frame && ((Frame)window).isUndecorated()) ||
|
||||||
|
(window instanceof Dialog && ((Dialog)window).isUndecorated()) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// check whether already installed
|
||||||
|
if( windowsMap.containsKey( window ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// install
|
||||||
|
WndProc wndProc = new WndProc( window );
|
||||||
|
if( wndProc.hwnd == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
windowsMap.put( window, wndProc );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uninstall( Window window ) {
|
||||||
|
WndProc wndProc = windowsMap.remove( window );
|
||||||
|
if( wndProc != null )
|
||||||
|
wndProc.uninstall();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarHeight( Window window, int titleBarHeight ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.titleBarHeight = titleBarHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarHitTestSpots( Window window, List<Rectangle> hitTestSpots ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.hitTestSpots = hitTestSpots.toArray( new Rectangle[hitTestSpots.size()] );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarAppIconBounds( Window window, Rectangle appIconBounds ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.appIconBounds = (appIconBounds != null) ? new Rectangle( appIconBounds ) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isColorizationColorAffectsBorders() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColorAffectsBorders;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color getColorizationColor() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColorizationColorBalance() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColorBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateColorization() {
|
||||||
|
if( colorizationUpToDate )
|
||||||
|
return;
|
||||||
|
colorizationUpToDate = true;
|
||||||
|
|
||||||
|
String subKey = "SOFTWARE\\Microsoft\\Windows\\DWM";
|
||||||
|
|
||||||
|
int value = registryGetIntValue( subKey, "ColorPrevalence", -1 );
|
||||||
|
colorizationColorAffectsBorders = (value > 0);
|
||||||
|
|
||||||
|
value = registryGetIntValue( subKey, "ColorizationColor", -1 );
|
||||||
|
colorizationColor = (value != -1) ? new Color( value ) : null;
|
||||||
|
|
||||||
|
colorizationColorBalance = registryGetIntValue( subKey, "ColorizationColorBalance", -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private native static int registryGetIntValue( String key, String valueName, int defaultValue );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addChangeListener( ChangeListener l ) {
|
||||||
|
listenerList.add( ChangeListener.class, l );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeChangeListener( ChangeListener l ) {
|
||||||
|
listenerList.remove( ChangeListener.class, l );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireStateChanged() {
|
||||||
|
Object[] listeners = listenerList.getListenerList();
|
||||||
|
if( listeners.length == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ChangeEvent e = new ChangeEvent( this );
|
||||||
|
for( int i = 0; i < listeners.length; i += 2 ) {
|
||||||
|
if( listeners[i] == ChangeListener.class )
|
||||||
|
((ChangeListener)listeners[i+1]).stateChanged( e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages,
|
||||||
|
* slightly delay event firing and fire it only once (on the AWT thread).
|
||||||
|
*/
|
||||||
|
void fireStateChangedLaterOnce() {
|
||||||
|
EventQueue.invokeLater( () -> {
|
||||||
|
if( fireStateChangedTimer != null ) {
|
||||||
|
fireStateChangedTimer.restart();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fireStateChangedTimer = new Timer( 300, e -> {
|
||||||
|
fireStateChangedTimer = null;
|
||||||
|
colorizationUpToDate = false;
|
||||||
|
|
||||||
|
fireStateChanged();
|
||||||
|
} );
|
||||||
|
fireStateChangedTimer.setRepeats( false );
|
||||||
|
fireStateChangedTimer.start();
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class WndProc ------------------------------------------------------
|
||||||
|
|
||||||
|
private class WndProc
|
||||||
|
{
|
||||||
|
// WM_NCHITTEST mouse position codes
|
||||||
|
private static final int
|
||||||
|
HTCLIENT = 1,
|
||||||
|
HTCAPTION = 2,
|
||||||
|
HTSYSMENU = 3,
|
||||||
|
HTTOP = 12;
|
||||||
|
|
||||||
|
private Window window;
|
||||||
|
private final long hwnd;
|
||||||
|
|
||||||
|
private int titleBarHeight;
|
||||||
|
private Rectangle[] hitTestSpots;
|
||||||
|
private Rectangle appIconBounds;
|
||||||
|
|
||||||
|
WndProc( Window window ) {
|
||||||
|
this.window = window;
|
||||||
|
|
||||||
|
hwnd = installImpl( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninstall() {
|
||||||
|
uninstallImpl( hwnd );
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
window = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private native long installImpl( Window window );
|
||||||
|
private native void uninstallImpl( long hwnd );
|
||||||
|
|
||||||
|
// invoked from native code
|
||||||
|
private int onNcHitTest( int x, int y, boolean isOnResizeBorder ) {
|
||||||
|
// scale-down mouse x/y
|
||||||
|
Point pt = scaleDown( x, y );
|
||||||
|
int sx = pt.x;
|
||||||
|
int sy = pt.y;
|
||||||
|
|
||||||
|
// return HTSYSMENU if mouse is over application icon
|
||||||
|
// - left-click on HTSYSMENU area shows system menu
|
||||||
|
// - double-left-click sends WM_CLOSE
|
||||||
|
if( appIconBounds != null && appIconBounds.contains( sx, sy ) )
|
||||||
|
return HTSYSMENU;
|
||||||
|
|
||||||
|
boolean isOnTitleBar = (sy < titleBarHeight);
|
||||||
|
|
||||||
|
if( isOnTitleBar ) {
|
||||||
|
// use a second reference to the array to avoid that it can be changed
|
||||||
|
// in another thread while processing the array
|
||||||
|
Rectangle[] hitTestSpots2 = hitTestSpots;
|
||||||
|
for( Rectangle spot : hitTestSpots2 ) {
|
||||||
|
if( spot.contains( sx, sy ) )
|
||||||
|
return HTCLIENT;
|
||||||
|
}
|
||||||
|
return isOnResizeBorder ? HTTOP : HTCAPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isOnResizeBorder ? HTTOP : HTCLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scales down in the same way as AWT.
|
||||||
|
* See AwtWin32GraphicsDevice::ScaleDownX() and ::ScaleDownY()
|
||||||
|
*/
|
||||||
|
private Point scaleDown( int x, int y ) {
|
||||||
|
GraphicsConfiguration gc = window.getGraphicsConfiguration();
|
||||||
|
if( gc == null )
|
||||||
|
return new Point( x, y );
|
||||||
|
|
||||||
|
AffineTransform t = gc.getDefaultTransform();
|
||||||
|
return new Point( clipRound( x / t.getScaleX() ), clipRound( y / t.getScaleY() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rounds in the same way as AWT.
|
||||||
|
* See AwtWin32GraphicsDevice::ClipRound()
|
||||||
|
*/
|
||||||
|
private int clipRound( double value ) {
|
||||||
|
value -= 0.5;
|
||||||
|
if( value < Integer.MIN_VALUE )
|
||||||
|
return Integer.MIN_VALUE;
|
||||||
|
if( value > Integer.MAX_VALUE )
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
return (int) Math.ceil( value );
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoked from native code
|
||||||
|
private boolean isFullscreen() {
|
||||||
|
GraphicsConfiguration gc = window.getGraphicsConfiguration();
|
||||||
|
if( gc == null )
|
||||||
|
return false;
|
||||||
|
return gc.getDevice().getFullScreenWindow() == window;
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoked from native code
|
||||||
|
private void fireStateChangedLaterOnce() {
|
||||||
|
FlatWindowsNativeWindowBorder.this.fireStateChangedLaterOnce();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,17 +29,15 @@ import java.awt.event.HierarchyEvent;
|
|||||||
import java.awt.event.HierarchyListener;
|
import java.awt.event.HierarchyListener;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
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.JRootPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.BorderUIResource;
|
import javax.swing.plaf.BorderUIResource;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.FlatSystemProperties;
|
import com.formdev.flatlaf.FlatSystemProperties;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
import com.formdev.flatlaf.util.HiDPIUtils;
|
import com.formdev.flatlaf.util.HiDPIUtils;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
|
|
||||||
@@ -55,26 +53,29 @@ import com.formdev.flatlaf.util.SystemInfo;
|
|||||||
*/
|
*/
|
||||||
public class JBRCustomDecorations
|
public class JBRCustomDecorations
|
||||||
{
|
{
|
||||||
private static boolean initialized;
|
private static Boolean supported;
|
||||||
private static Method Window_hasCustomDecoration;
|
private static Method Window_hasCustomDecoration;
|
||||||
private static Method Window_setHasCustomDecoration;
|
private static Method Window_setHasCustomDecoration;
|
||||||
private static Method WWindowPeer_setCustomDecorationHitTestSpots;
|
|
||||||
private static Method WWindowPeer_setCustomDecorationTitleBarHeight;
|
private static Method WWindowPeer_setCustomDecorationTitleBarHeight;
|
||||||
|
private static Method WWindowPeer_setCustomDecorationHitTestSpots;
|
||||||
private static Method AWTAccessor_getComponentAccessor;
|
private static Method AWTAccessor_getComponentAccessor;
|
||||||
private static Method AWTAccessor_ComponentAccessor_getPeer;
|
private static Method AWTAccessor_ComponentAccessor_getPeer;
|
||||||
|
|
||||||
public static boolean isSupported() {
|
public static boolean isSupported() {
|
||||||
initialize();
|
initialize();
|
||||||
return Window_setHasCustomDecoration != null;
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void install( JRootPane rootPane ) {
|
static Object install( JRootPane rootPane ) {
|
||||||
if( !isSupported() )
|
if( !isSupported() )
|
||||||
return;
|
return null;
|
||||||
|
|
||||||
// check whether root pane already has a parent, which is the case when switching LaF
|
// check whether root pane already has a parent, which is the case when switching LaF
|
||||||
if( rootPane.getParent() != null )
|
Window window = SwingUtilities.windowForComponent( rootPane );
|
||||||
return;
|
if( window != null ) {
|
||||||
|
FlatNativeWindowBorder.install( window, FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS );
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Use hierarchy listener to wait until the root pane is added to a window.
|
// Use hierarchy listener to wait until the root pane is added to a window.
|
||||||
// Enabling JBR decorations must be done very early, probably before
|
// Enabling JBR decorations must be done very early, probably before
|
||||||
@@ -88,8 +89,9 @@ public class JBRCustomDecorations
|
|||||||
|
|
||||||
Container parent = e.getChangedParent();
|
Container parent = e.getChangedParent();
|
||||||
if( parent instanceof Window )
|
if( parent instanceof Window )
|
||||||
install( (Window) parent );
|
FlatNativeWindowBorder.install( (Window) parent, FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS );
|
||||||
|
|
||||||
|
// remove listener since it is actually not possible to uninstall JBR decorations
|
||||||
// use invokeLater to remove listener to avoid that listener
|
// use invokeLater to remove listener to avoid that listener
|
||||||
// is removed while listener queue is processed
|
// is removed while listener queue is processed
|
||||||
EventQueue.invokeLater( () -> {
|
EventQueue.invokeLater( () -> {
|
||||||
@@ -98,54 +100,20 @@ public class JBRCustomDecorations
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
rootPane.addHierarchyListener( addListener );
|
rootPane.addHierarchyListener( addListener );
|
||||||
|
return addListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void install( Window window ) {
|
static void uninstall( JRootPane rootPane, Object data ) {
|
||||||
if( !isSupported() )
|
// remove listener (if not yet done)
|
||||||
return;
|
if( data instanceof HierarchyListener )
|
||||||
|
rootPane.removeHierarchyListener( (HierarchyListener) data );
|
||||||
|
|
||||||
// do not enable JBR decorations if LaF provides decorations
|
// since it is actually not possible to uninstall JBR decorations,
|
||||||
if( UIManager.getLookAndFeel().getSupportsWindowDecorations() )
|
// simply reduce titleBarHeight so that it is still possible to resize window
|
||||||
return;
|
// and remove hitTestSpots
|
||||||
|
Window window = SwingUtilities.windowForComponent( rootPane );
|
||||||
if( window instanceof JFrame ) {
|
if( window != null )
|
||||||
JFrame frame = (JFrame) window;
|
setHasCustomDecoration( window, false );
|
||||||
|
|
||||||
// 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 ) {
|
static boolean hasCustomDecoration( Window window ) {
|
||||||
@@ -155,45 +123,49 @@ public class JBRCustomDecorations
|
|||||||
try {
|
try {
|
||||||
return (Boolean) Window_hasCustomDecoration.invoke( window );
|
return (Boolean) Window_hasCustomDecoration.invoke( window );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setHasCustomDecoration( Window window ) {
|
static void setHasCustomDecoration( Window window, boolean hasCustomDecoration ) {
|
||||||
if( !isSupported() )
|
if( !isSupported() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Window_setHasCustomDecoration.invoke( window );
|
if( hasCustomDecoration )
|
||||||
|
Window_setHasCustomDecoration.invoke( window );
|
||||||
|
else
|
||||||
|
setTitleBarHeightAndHitTestSpots( window, 4, Collections.emptyList() );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setHitTestSpotsAndTitleBarHeight( Window window, List<Rectangle> hitTestSpots, int titleBarHeight ) {
|
static void setTitleBarHeightAndHitTestSpots( Window window, int titleBarHeight, List<Rectangle> hitTestSpots ) {
|
||||||
if( !isSupported() )
|
if( !isSupported() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object compAccessor = AWTAccessor_getComponentAccessor.invoke( null );
|
Object compAccessor = AWTAccessor_getComponentAccessor.invoke( null );
|
||||||
Object peer = AWTAccessor_ComponentAccessor_getPeer.invoke( compAccessor, window );
|
Object peer = AWTAccessor_ComponentAccessor_getPeer.invoke( compAccessor, window );
|
||||||
WWindowPeer_setCustomDecorationHitTestSpots.invoke( peer, hitTestSpots );
|
|
||||||
WWindowPeer_setCustomDecorationTitleBarHeight.invoke( peer, titleBarHeight );
|
WWindowPeer_setCustomDecorationTitleBarHeight.invoke( peer, titleBarHeight );
|
||||||
|
WWindowPeer_setCustomDecorationHitTestSpots.invoke( peer, hitTestSpots );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initialize() {
|
private static void initialize() {
|
||||||
if( initialized )
|
if( supported != null )
|
||||||
return;
|
return;
|
||||||
initialized = true;
|
supported = false;
|
||||||
|
|
||||||
// requires JetBrains Runtime 11 and Windows 10
|
// requires JetBrains Runtime 11 and Windows 10
|
||||||
if( !SystemInfo.isJetBrainsJVM_11_orLater || !SystemInfo.isWindows_10_orLater )
|
if( !SystemInfo.isJetBrainsJVM_11_orLater || !SystemInfo.isWindows_10_orLater )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// check whether disabled via system property
|
||||||
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ) )
|
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_JETBRAINS_CUSTOM_DECORATIONS, true ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -204,15 +176,17 @@ public class JBRCustomDecorations
|
|||||||
AWTAccessor_ComponentAccessor_getPeer = compAccessorClass.getDeclaredMethod( "getPeer", Component.class );
|
AWTAccessor_ComponentAccessor_getPeer = compAccessorClass.getDeclaredMethod( "getPeer", Component.class );
|
||||||
|
|
||||||
Class<?> peerClass = Class.forName( "sun.awt.windows.WWindowPeer" );
|
Class<?> peerClass = Class.forName( "sun.awt.windows.WWindowPeer" );
|
||||||
WWindowPeer_setCustomDecorationHitTestSpots = peerClass.getDeclaredMethod( "setCustomDecorationHitTestSpots", List.class );
|
|
||||||
WWindowPeer_setCustomDecorationTitleBarHeight = peerClass.getDeclaredMethod( "setCustomDecorationTitleBarHeight", int.class );
|
WWindowPeer_setCustomDecorationTitleBarHeight = peerClass.getDeclaredMethod( "setCustomDecorationTitleBarHeight", int.class );
|
||||||
WWindowPeer_setCustomDecorationHitTestSpots.setAccessible( true );
|
WWindowPeer_setCustomDecorationHitTestSpots = peerClass.getDeclaredMethod( "setCustomDecorationHitTestSpots", List.class );
|
||||||
WWindowPeer_setCustomDecorationTitleBarHeight.setAccessible( true );
|
WWindowPeer_setCustomDecorationTitleBarHeight.setAccessible( true );
|
||||||
|
WWindowPeer_setCustomDecorationHitTestSpots.setAccessible( true );
|
||||||
|
|
||||||
Window_hasCustomDecoration = Window.class.getDeclaredMethod( "hasCustomDecoration" );
|
Window_hasCustomDecoration = Window.class.getDeclaredMethod( "hasCustomDecoration" );
|
||||||
Window_setHasCustomDecoration = Window.class.getDeclaredMethod( "setHasCustomDecoration" );
|
Window_setHasCustomDecoration = Window.class.getDeclaredMethod( "setHasCustomDecoration" );
|
||||||
Window_hasCustomDecoration.setAccessible( true );
|
Window_hasCustomDecoration.setAccessible( true );
|
||||||
Window_setHasCustomDecoration.setAccessible( true );
|
Window_setHasCustomDecoration.setAccessible( true );
|
||||||
|
|
||||||
|
supported = true;
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
@@ -237,15 +211,22 @@ public class JBRCustomDecorations
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private JBRWindowTopBorder() {
|
JBRWindowTopBorder() {
|
||||||
super( 1, 0, 0, 0 );
|
super( 1, 0, 0, 0 );
|
||||||
|
|
||||||
colorizationAffectsBorders = calculateAffectsBorders();
|
update();
|
||||||
activeColor = calculateActiveBorderColor();
|
installListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
void update() {
|
||||||
|
colorizationAffectsBorders = isColorizationColorAffectsBorders();
|
||||||
|
activeColor = calculateActiveBorderColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
void installListeners() {
|
||||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||||
toolkit.addPropertyChangeListener( "win.dwm.colorizationColor.affects.borders", e -> {
|
toolkit.addPropertyChangeListener( "win.dwm.colorizationColor.affects.borders", e -> {
|
||||||
colorizationAffectsBorders = calculateAffectsBorders();
|
colorizationAffectsBorders = isColorizationColorAffectsBorders();
|
||||||
activeColor = calculateActiveBorderColor();
|
activeColor = calculateActiveBorderColor();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -257,46 +238,50 @@ public class JBRCustomDecorations
|
|||||||
toolkit.addPropertyChangeListener( "win.frame.activeBorderColor", l );
|
toolkit.addPropertyChangeListener( "win.frame.activeBorderColor", l );
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean calculateAffectsBorders() {
|
boolean isColorizationColorAffectsBorders() {
|
||||||
Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "win.dwm.colorizationColor.affects.borders" );
|
Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "win.dwm.colorizationColor.affects.borders" );
|
||||||
return (value instanceof Boolean) ? (Boolean) value : true;
|
return (value instanceof Boolean) ? (Boolean) value : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color getColorizationColor() {
|
||||||
|
return (Color) Toolkit.getDefaultToolkit().getDesktopProperty( "win.dwm.colorizationColor" );
|
||||||
|
}
|
||||||
|
|
||||||
|
int getColorizationColorBalance() {
|
||||||
|
Object value = Toolkit.getDefaultToolkit().getDesktopProperty( "win.dwm.colorizationColorBalance" );
|
||||||
|
return (value instanceof Integer) ? (Integer) value : -1;
|
||||||
|
}
|
||||||
|
|
||||||
private Color calculateActiveBorderColor() {
|
private Color calculateActiveBorderColor() {
|
||||||
if( !colorizationAffectsBorders )
|
if( !colorizationAffectsBorders )
|
||||||
return defaultActiveBorder;
|
return defaultActiveBorder;
|
||||||
|
|
||||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
Color colorizationColor = getColorizationColor();
|
||||||
Color colorizationColor = (Color) toolkit.getDesktopProperty( "win.dwm.colorizationColor" );
|
|
||||||
if( colorizationColor != null ) {
|
if( colorizationColor != null ) {
|
||||||
Object colorizationColorBalanceObj = toolkit.getDesktopProperty( "win.dwm.colorizationColorBalance" );
|
int colorizationColorBalance = getColorizationColorBalance();
|
||||||
if( colorizationColorBalanceObj instanceof Integer ) {
|
if( colorizationColorBalance < 0 || colorizationColorBalance > 100 )
|
||||||
int colorizationColorBalance = (Integer) colorizationColorBalanceObj;
|
colorizationColorBalance = 100;
|
||||||
if( colorizationColorBalance < 0 || colorizationColorBalance > 100 )
|
|
||||||
colorizationColorBalance = 100;
|
|
||||||
|
|
||||||
if( colorizationColorBalance == 0 )
|
if( colorizationColorBalance == 0 )
|
||||||
return new Color( 0xD9D9D9 );
|
return new Color( 0xD9D9D9 );
|
||||||
if( colorizationColorBalance == 100 )
|
if( colorizationColorBalance == 100 )
|
||||||
return colorizationColor;
|
return colorizationColor;
|
||||||
|
|
||||||
float alpha = colorizationColorBalance / 100.0f;
|
float alpha = colorizationColorBalance / 100.0f;
|
||||||
float remainder = 1 - alpha;
|
float remainder = 1 - alpha;
|
||||||
int r = Math.round( colorizationColor.getRed() * alpha + 0xD9 * remainder );
|
int r = Math.round( colorizationColor.getRed() * alpha + 0xD9 * remainder );
|
||||||
int g = Math.round( colorizationColor.getGreen() * alpha + 0xD9 * remainder );
|
int g = Math.round( colorizationColor.getGreen() * alpha + 0xD9 * remainder );
|
||||||
int b = Math.round( colorizationColor.getBlue() * alpha + 0xD9 * remainder );
|
int b = Math.round( colorizationColor.getBlue() * alpha + 0xD9 * remainder );
|
||||||
|
|
||||||
// avoid potential IllegalArgumentException in Color constructor
|
// avoid potential IllegalArgumentException in Color constructor
|
||||||
r = Math.min( Math.max( r, 0 ), 255 );
|
r = Math.min( Math.max( r, 0 ), 255 );
|
||||||
g = Math.min( Math.max( g, 0 ), 255 );
|
g = Math.min( Math.max( g, 0 ), 255 );
|
||||||
b = Math.min( Math.max( b, 0 ), 255 );
|
b = Math.min( Math.max( b, 0 ), 255 );
|
||||||
|
|
||||||
return new Color( r, g, b );
|
return new Color( r, g, b );
|
||||||
}
|
|
||||||
return colorizationColor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Color activeBorderColor = (Color) toolkit.getDesktopProperty( "win.frame.activeBorderColor" );
|
Color activeBorderColor = (Color) Toolkit.getDefaultToolkit().getDesktopProperty( "win.frame.activeBorderColor" );
|
||||||
return (activeBorderColor != null) ? activeBorderColor : UIManager.getColor( "MenuBar.borderColor" );
|
return (activeBorderColor != null) ? activeBorderColor : UIManager.getColor( "MenuBar.borderColor" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides Java version compatibility methods.
|
* Provides Java version compatibility methods.
|
||||||
@@ -58,7 +55,7 @@ public class JavaCompatibility
|
|||||||
? new Class[] { JComponent.class, Graphics2D.class, String.class, int.class, float.class, float.class }
|
? new Class[] { JComponent.class, Graphics2D.class, String.class, int.class, float.class, float.class }
|
||||||
: new Class[] { JComponent.class, Graphics.class, String.class, int.class, int.class, int.class } );
|
: new Class[] { JComponent.class, Graphics.class, String.class, int.class, int.class, int.class } );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +67,7 @@ public class JavaCompatibility
|
|||||||
else
|
else
|
||||||
drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, x, y );
|
drawStringUnderlineCharAtMethod.invoke( null, c, g, text, underlinedIndex, x, y );
|
||||||
} catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) {
|
} catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +91,7 @@ public class JavaCompatibility
|
|||||||
: "clipStringIfNecessary",
|
: "clipStringIfNecessary",
|
||||||
new Class[] { JComponent.class, FontMetrics.class, String.class, int.class } );
|
new Class[] { JComponent.class, FontMetrics.class, String.class, int.class } );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +100,7 @@ public class JavaCompatibility
|
|||||||
try {
|
try {
|
||||||
return (String) getClippedStringMethod.invoke( null, c, fm, string, availTextWidth );
|
return (String) getClippedStringMethod.invoke( null, c, fm, string, availTextWidth );
|
||||||
} catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) {
|
} catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException ex ) {
|
||||||
Logger.getLogger( FlatLaf.class.getName() ).log( Level.SEVERE, null, ex );
|
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public interface LoggingFacade
|
||||||
|
{
|
||||||
|
LoggingFacade INSTANCE = new LoggingFacadeImpl();
|
||||||
|
|
||||||
|
void logSevere( String message, Throwable t );
|
||||||
|
void logConfig( String message, Throwable t );
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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 com.formdev.flatlaf.FlatLaf;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
class LoggingFacadeImpl
|
||||||
|
implements LoggingFacade
|
||||||
|
{
|
||||||
|
private static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logSevere( String message, Throwable t ) {
|
||||||
|
LOG.log( Level.SEVERE, message, t );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logConfig( String message, Throwable t ) {
|
||||||
|
LOG.log( Level.CONFIG, message, t );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper class to load native library (.dll, .so or .dylib) stored in Jar.
|
||||||
|
* <p>
|
||||||
|
* Copies native library to users temporary folder before loading it.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class NativeLibrary
|
||||||
|
{
|
||||||
|
private static final String DELETE_SUFFIX = ".delete";
|
||||||
|
private static boolean deletedTemporary;
|
||||||
|
|
||||||
|
private final boolean loaded;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load native library from given classloader.
|
||||||
|
*
|
||||||
|
* @param libraryName resource name of the native library (without "lib" prefix and without extension)
|
||||||
|
* @param classLoader the classloader used to locate the library
|
||||||
|
* @param supported whether the native library is supported on the current platform
|
||||||
|
*/
|
||||||
|
public NativeLibrary( String libraryName, ClassLoader classLoader, boolean supported ) {
|
||||||
|
this.loaded = supported
|
||||||
|
? loadLibraryFromJar( libraryName, classLoader )
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the native library is loaded.
|
||||||
|
* <p>
|
||||||
|
* Returns {@code false} if not supported on current platform as specified in constructor
|
||||||
|
* or if loading failed.
|
||||||
|
*/
|
||||||
|
public boolean isLoaded() {
|
||||||
|
return loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean loadLibraryFromJar( String libraryName, ClassLoader classLoader ) {
|
||||||
|
// add prefix and suffix to library name
|
||||||
|
libraryName = decorateLibraryName( libraryName );
|
||||||
|
|
||||||
|
// find library
|
||||||
|
URL libraryUrl = classLoader.getResource( libraryName );
|
||||||
|
if( libraryUrl == null ) {
|
||||||
|
log( "Library '" + libraryName + "' not found", null );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
File tempFile = null;
|
||||||
|
try {
|
||||||
|
// for development environment
|
||||||
|
if( "file".equals( libraryUrl.getProtocol() ) ) {
|
||||||
|
File libraryFile = new File( libraryUrl.getPath() );
|
||||||
|
if( libraryFile.isFile() ) {
|
||||||
|
// load library without copying
|
||||||
|
System.load( libraryFile.getCanonicalPath() );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create temporary file
|
||||||
|
Path tempPath = createTempFile( libraryName );
|
||||||
|
tempFile = tempPath.toFile();
|
||||||
|
|
||||||
|
// copy library to temporary file
|
||||||
|
try( InputStream in = libraryUrl.openStream() ) {
|
||||||
|
Files.copy( in, tempPath, StandardCopyOption.REPLACE_EXISTING );
|
||||||
|
}
|
||||||
|
|
||||||
|
// load library
|
||||||
|
System.load( tempFile.getCanonicalPath() );
|
||||||
|
|
||||||
|
// delete library
|
||||||
|
deleteOrMarkForDeletion( tempFile );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch( Throwable ex ) {
|
||||||
|
log( null, ex );
|
||||||
|
|
||||||
|
if( tempFile != null )
|
||||||
|
deleteOrMarkForDeletion( tempFile );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String decorateLibraryName( String libraryName ) {
|
||||||
|
if( SystemInfo.isWindows )
|
||||||
|
return libraryName.concat( ".dll" );
|
||||||
|
|
||||||
|
String suffix = SystemInfo.isMacOS ? ".dylib" : ".so";
|
||||||
|
|
||||||
|
int sep = libraryName.lastIndexOf( '/' );
|
||||||
|
return (sep >= 0)
|
||||||
|
? libraryName.substring( 0, sep + 1 ) + "lib" + libraryName.substring( sep + 1 ) + suffix
|
||||||
|
: "lib" + libraryName + suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void log( String msg, Throwable thrown ) {
|
||||||
|
LoggingFacade.INSTANCE.logSevere( msg, thrown );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Path createTempFile( String libraryName ) throws IOException {
|
||||||
|
int sep = libraryName.lastIndexOf( '/' );
|
||||||
|
String name = (sep >= 0) ? libraryName.substring( sep + 1 ) : libraryName;
|
||||||
|
|
||||||
|
int dot = name.lastIndexOf( '.' );
|
||||||
|
String prefix = ((dot >= 0) ? name.substring( 0, dot ) : name) + '-';
|
||||||
|
String suffix = (dot >= 0) ? name.substring( dot ) : "";
|
||||||
|
|
||||||
|
Path tempDir = getTempDir();
|
||||||
|
if( tempDir != null ) {
|
||||||
|
deleteTemporaryFiles( tempDir );
|
||||||
|
|
||||||
|
return Files.createTempFile( tempDir, prefix, suffix );
|
||||||
|
} else
|
||||||
|
return Files.createTempFile( prefix, suffix );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Path getTempDir() throws IOException {
|
||||||
|
if( SystemInfo.isWindows ) {
|
||||||
|
// On Windows, where File.delete() and File.deleteOnExit() does not work
|
||||||
|
// for loaded native libraries, they will be deleted on next application startup.
|
||||||
|
// The default temporary directory may contain hundreds or thousands of files.
|
||||||
|
// To make searching for "marked for deletion" files as fast as possible,
|
||||||
|
// use a sub directory that contains only our temporary native libraries.
|
||||||
|
Path tempDir = Paths.get( System.getProperty( "java.io.tmpdir" ) + "/flatlaf.temp" );
|
||||||
|
Files.createDirectories( tempDir );
|
||||||
|
return tempDir;
|
||||||
|
} else
|
||||||
|
return null; // use standard temporary directory
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void deleteTemporaryFiles( Path tempDir ) {
|
||||||
|
if( deletedTemporary )
|
||||||
|
return;
|
||||||
|
deletedTemporary = true;
|
||||||
|
|
||||||
|
File[] markerFiles = tempDir.toFile().listFiles( (dir, name) -> name.endsWith( DELETE_SUFFIX ) );
|
||||||
|
if( markerFiles == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for( File markerFile : markerFiles ) {
|
||||||
|
File toDeleteFile = new File( markerFile.getParent(), StringUtils.removeTrailing( markerFile.getName(), DELETE_SUFFIX ) );
|
||||||
|
if( !toDeleteFile.exists() || toDeleteFile.delete() )
|
||||||
|
markerFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void deleteOrMarkForDeletion( File file ) {
|
||||||
|
// try to delete the native library
|
||||||
|
if( file.delete() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// not possible to delete on Windows because native library file is locked
|
||||||
|
// --> create "to delete" marker file (used at next startup)
|
||||||
|
try {
|
||||||
|
File markFile = new File( file.getParent(), file.getName() + DELETE_SUFFIX );
|
||||||
|
markFile.createNewFile();
|
||||||
|
} catch( IOException ex2 ) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,9 @@ public class SystemInfo
|
|||||||
public static final boolean isMacOS_10_14_Mojave_orLater;
|
public static final boolean isMacOS_10_14_Mojave_orLater;
|
||||||
public static final boolean isMacOS_10_15_Catalina_orLater;
|
public static final boolean isMacOS_10_15_Catalina_orLater;
|
||||||
|
|
||||||
|
// OS architecture
|
||||||
|
/** @since 1.1 */ public static final boolean isX86_64;
|
||||||
|
|
||||||
// Java versions
|
// Java versions
|
||||||
public static final long javaVersion;
|
public static final long javaVersion;
|
||||||
public static final boolean isJava_9_orLater;
|
public static final boolean isJava_9_orLater;
|
||||||
@@ -51,6 +54,9 @@ public class SystemInfo
|
|||||||
// UI toolkits
|
// UI toolkits
|
||||||
public static final boolean isKDE;
|
public static final boolean isKDE;
|
||||||
|
|
||||||
|
// other
|
||||||
|
/** @since 1.1 */ public static final boolean isProjector;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// platforms
|
// platforms
|
||||||
String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH );
|
String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH );
|
||||||
@@ -65,6 +71,10 @@ public class SystemInfo
|
|||||||
isMacOS_10_14_Mojave_orLater = (isMacOS && osVersion >= toVersion( 10, 14, 0, 0 ));
|
isMacOS_10_14_Mojave_orLater = (isMacOS && osVersion >= toVersion( 10, 14, 0, 0 ));
|
||||||
isMacOS_10_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 ));
|
isMacOS_10_15_Catalina_orLater = (isMacOS && osVersion >= toVersion( 10, 15, 0, 0 ));
|
||||||
|
|
||||||
|
// OS architecture
|
||||||
|
String osArch = System.getProperty( "os.arch" );
|
||||||
|
isX86_64 = osArch.equals( "amd64" ) || osArch.equals( "x86_64" );
|
||||||
|
|
||||||
// Java versions
|
// Java versions
|
||||||
javaVersion = scanVersion( System.getProperty( "java.version" ) );
|
javaVersion = scanVersion( System.getProperty( "java.version" ) );
|
||||||
isJava_9_orLater = (javaVersion >= toVersion( 9, 0, 0, 0 ));
|
isJava_9_orLater = (javaVersion >= toVersion( 9, 0, 0, 0 ));
|
||||||
@@ -78,6 +88,9 @@ public class SystemInfo
|
|||||||
|
|
||||||
// UI toolkits
|
// UI toolkits
|
||||||
isKDE = (isLinux && System.getenv( "KDE_FULL_SESSION" ) != null);
|
isKDE = (isLinux && System.getenv( "KDE_FULL_SESSION" ) != null);
|
||||||
|
|
||||||
|
// other
|
||||||
|
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long scanVersion( String version ) {
|
public static long scanVersion( String version ) {
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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 com.formdev.flatlaf.FlatLaf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
class LoggingFacadeImpl
|
||||||
|
implements LoggingFacade
|
||||||
|
{
|
||||||
|
private static final System.Logger LOG = System.getLogger( FlatLaf.class.getName() );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logSevere( String message, Throwable t ) {
|
||||||
|
LOG.log( System.Logger.Level.ERROR, message, t );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logConfig( String message, Throwable t ) {
|
||||||
|
LOG.log( System.Logger.Level.DEBUG, message, t );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
module com.formdev.flatlaf {
|
module com.formdev.flatlaf {
|
||||||
requires java.desktop;
|
requires java.desktop;
|
||||||
requires java.logging;
|
|
||||||
|
|
||||||
exports com.formdev.flatlaf;
|
exports com.formdev.flatlaf;
|
||||||
exports com.formdev.flatlaf.icons;
|
exports com.formdev.flatlaf.icons;
|
||||||
|
|||||||
@@ -685,13 +685,17 @@ TitledBorder.border = 1,1,1,1,$Separator.foreground
|
|||||||
|
|
||||||
#---- TitlePane ----
|
#---- TitlePane ----
|
||||||
|
|
||||||
|
TitlePane.useWindowDecorations = true
|
||||||
TitlePane.menuBarEmbedded = true
|
TitlePane.menuBarEmbedded = true
|
||||||
|
TitlePane.unifiedBackground = false
|
||||||
TitlePane.iconSize = 16,16
|
TitlePane.iconSize = 16,16
|
||||||
TitlePane.iconMargins = 3,8,3,0
|
TitlePane.iconMargins = 3,8,3,8
|
||||||
TitlePane.menuBarMargins = 0,8,0,22
|
TitlePane.titleMargins = 3,0,3,0
|
||||||
TitlePane.titleMargins = 3,8,3,8
|
|
||||||
TitlePane.buttonSize = 44,30
|
TitlePane.buttonSize = 44,30
|
||||||
TitlePane.buttonMaximizedHeight = 22
|
TitlePane.buttonMaximizedHeight = 22
|
||||||
|
TitlePane.centerTitle = false
|
||||||
|
TitlePane.centerTitleIfMenuBarEmbedded = true
|
||||||
|
TitlePane.menuBarTitleGap = 20
|
||||||
TitlePane.closeIcon = com.formdev.flatlaf.icons.FlatWindowCloseIcon
|
TitlePane.closeIcon = com.formdev.flatlaf.icons.FlatWindowCloseIcon
|
||||||
TitlePane.iconifyIcon = com.formdev.flatlaf.icons.FlatWindowIconifyIcon
|
TitlePane.iconifyIcon = com.formdev.flatlaf.icons.FlatWindowIconifyIcon
|
||||||
TitlePane.maximizeIcon = com.formdev.flatlaf.icons.FlatWindowMaximizeIcon
|
TitlePane.maximizeIcon = com.formdev.flatlaf.icons.FlatWindowMaximizeIcon
|
||||||
|
|||||||
@@ -69,21 +69,33 @@ ToggleButton.endBackground = $ToggleButton.background
|
|||||||
@ijMenuCheckBackgroundL20 = lighten(@selectionBackground,20%,derived noAutoInverse)
|
@ijMenuCheckBackgroundL20 = lighten(@selectionBackground,20%,derived noAutoInverse)
|
||||||
@ijMenuCheckBackgroundD10 = darken(@selectionBackground,10%,derived noAutoInverse)
|
@ijMenuCheckBackgroundD10 = darken(@selectionBackground,10%,derived noAutoInverse)
|
||||||
|
|
||||||
|
[Arc_Theme]CheckBoxMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme]PopupMenu.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme]RadioButtonMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
[Arc_Theme]ProgressBar.selectionBackground = #000
|
[Arc_Theme]ProgressBar.selectionBackground = #000
|
||||||
[Arc_Theme]ProgressBar.selectionForeground = #fff
|
[Arc_Theme]ProgressBar.selectionForeground = #fff
|
||||||
[Arc_Theme]List.selectionInactiveForeground = #fff
|
[Arc_Theme]List.selectionInactiveForeground = #fff
|
||||||
[Arc_Theme]Table.selectionInactiveForeground = #fff
|
[Arc_Theme]Table.selectionInactiveForeground = #fff
|
||||||
[Arc_Theme]Tree.selectionInactiveForeground = #fff
|
[Arc_Theme]Tree.selectionInactiveForeground = #fff
|
||||||
|
|
||||||
|
[Arc_Theme_-_Orange]CheckBoxMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_-_Orange]PopupMenu.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_-_Orange]RadioButtonMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
[Arc_Theme_-_Orange]ProgressBar.selectionBackground = #000
|
[Arc_Theme_-_Orange]ProgressBar.selectionBackground = #000
|
||||||
[Arc_Theme_-_Orange]ProgressBar.selectionForeground = #fff
|
[Arc_Theme_-_Orange]ProgressBar.selectionForeground = #fff
|
||||||
[Arc_Theme_-_Orange]List.selectionInactiveForeground = #fff
|
[Arc_Theme_-_Orange]List.selectionInactiveForeground = #fff
|
||||||
[Arc_Theme_-_Orange]Table.selectionInactiveForeground = #fff
|
[Arc_Theme_-_Orange]Table.selectionInactiveForeground = #fff
|
||||||
[Arc_Theme_-_Orange]Tree.selectionInactiveForeground = #fff
|
[Arc_Theme_-_Orange]Tree.selectionInactiveForeground = #fff
|
||||||
|
|
||||||
|
[Arc_Theme_Dark]CheckBoxMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_Dark]PopupMenu.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_Dark]RadioButtonMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
[Arc_Theme_Dark]ProgressBar.selectionBackground = #ddd
|
[Arc_Theme_Dark]ProgressBar.selectionBackground = #ddd
|
||||||
[Arc_Theme_Dark]ProgressBar.selectionForeground = #ddd
|
[Arc_Theme_Dark]ProgressBar.selectionForeground = #ddd
|
||||||
|
|
||||||
|
[Arc_Theme_Dark_-_Orange]CheckBoxMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_Dark_-_Orange]PopupMenu.foreground = lazy(MenuItem.foreground)
|
||||||
|
[Arc_Theme_Dark_-_Orange]RadioButtonMenuItem.foreground = lazy(MenuItem.foreground)
|
||||||
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionBackground = #ddd
|
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionBackground = #ddd
|
||||||
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionForeground = #fff
|
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionForeground = #fff
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -31,6 +31,7 @@ dependencies {
|
|||||||
implementation( project( ":flatlaf-intellij-themes" ) )
|
implementation( project( ":flatlaf-intellij-themes" ) )
|
||||||
implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" )
|
implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" )
|
||||||
implementation( "com.jgoodies:jgoodies-forms:1.9.0" )
|
implementation( "com.jgoodies:jgoodies-forms:1.9.0" )
|
||||||
|
// implementation( project( ":flatlaf-natives-jna" ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@@ -38,6 +39,7 @@ tasks {
|
|||||||
dependsOn( ":flatlaf-core:jar" )
|
dependsOn( ":flatlaf-core:jar" )
|
||||||
dependsOn( ":flatlaf-extras:jar" )
|
dependsOn( ":flatlaf-extras:jar" )
|
||||||
dependsOn( ":flatlaf-intellij-themes:jar" )
|
dependsOn( ":flatlaf-intellij-themes:jar" )
|
||||||
|
// dependsOn( ":flatlaf-natives-jna:jar" )
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes( "Main-Class" to "com.formdev.flatlaf.demo.FlatLafDemo" )
|
attributes( "Main-Class" to "com.formdev.flatlaf.demo.FlatLafDemo" )
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ import com.formdev.flatlaf.demo.intellijthemes.*;
|
|||||||
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
|
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
|
||||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||||
import com.formdev.flatlaf.extras.FlatUIDefaultsInspector;
|
import com.formdev.flatlaf.extras.FlatUIDefaultsInspector;
|
||||||
|
import com.formdev.flatlaf.extras.components.FlatButton;
|
||||||
|
import com.formdev.flatlaf.extras.components.FlatButton.ButtonType;
|
||||||
import com.formdev.flatlaf.extras.FlatSVGUtils;
|
import com.formdev.flatlaf.extras.FlatSVGUtils;
|
||||||
|
import com.formdev.flatlaf.ui.FlatNativeWindowBorder;
|
||||||
import com.formdev.flatlaf.ui.JBRCustomDecorations;
|
import com.formdev.flatlaf.ui.JBRCustomDecorations;
|
||||||
import net.miginfocom.layout.ConstraintParser;
|
import net.miginfocom.layout.ConstraintParser;
|
||||||
import net.miginfocom.layout.LC;
|
import net.miginfocom.layout.LC;
|
||||||
@@ -142,15 +145,19 @@ class DemoFrame
|
|||||||
boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected();
|
boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected();
|
||||||
|
|
||||||
// change window decoration of demo main frame
|
// change window decoration of demo main frame
|
||||||
dispose();
|
if( FlatNativeWindowBorder.isSupported() ) {
|
||||||
setUndecorated( windowDecorations );
|
FlatNativeWindowBorder.setHasCustomDecoration( this, windowDecorations );
|
||||||
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
||||||
|
} else {
|
||||||
|
dispose();
|
||||||
|
setUndecorated( windowDecorations );
|
||||||
|
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
||||||
|
setVisible( true );
|
||||||
|
}
|
||||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations );
|
menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations );
|
||||||
setVisible( true );
|
|
||||||
|
|
||||||
// enable/disable window decoration for later created frames/dialogs
|
// enable/disable window decoration for later created frames/dialogs
|
||||||
JFrame.setDefaultLookAndFeelDecorated( windowDecorations );
|
UIManager.put( "TitlePane.useWindowDecorations", windowDecorations );
|
||||||
JDialog.setDefaultLookAndFeelDecorated( windowDecorations );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuBarEmbeddedChanged() {
|
private void menuBarEmbeddedChanged() {
|
||||||
@@ -163,6 +170,11 @@ class DemoFrame
|
|||||||
// repaint();
|
// repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void unifiedTitleBar() {
|
||||||
|
UIManager.put( "TitlePane.unifiedBackground", unifiedTitleBarMenuItem.isSelected() );
|
||||||
|
FlatLaf.updateUI();
|
||||||
|
}
|
||||||
|
|
||||||
private void underlineMenuSelection() {
|
private void underlineMenuSelection() {
|
||||||
UIManager.put( "MenuItem.selectionType", underlineMenuSelectionMenuItem.isSelected() ? "underline" : null );
|
UIManager.put( "MenuItem.selectionType", underlineMenuSelectionMenuItem.isSelected() ? "underline" : null );
|
||||||
}
|
}
|
||||||
@@ -327,6 +339,7 @@ class DemoFrame
|
|||||||
optionsMenu = new JMenu();
|
optionsMenu = new JMenu();
|
||||||
windowDecorationsCheckBoxMenuItem = new JCheckBoxMenuItem();
|
windowDecorationsCheckBoxMenuItem = new JCheckBoxMenuItem();
|
||||||
menuBarEmbeddedCheckBoxMenuItem = new JCheckBoxMenuItem();
|
menuBarEmbeddedCheckBoxMenuItem = new JCheckBoxMenuItem();
|
||||||
|
unifiedTitleBarMenuItem = new JCheckBoxMenuItem();
|
||||||
underlineMenuSelectionMenuItem = new JCheckBoxMenuItem();
|
underlineMenuSelectionMenuItem = new JCheckBoxMenuItem();
|
||||||
alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem();
|
alwaysShowMnemonicsMenuItem = new JCheckBoxMenuItem();
|
||||||
animatedLafChangeMenuItem = new JCheckBoxMenuItem();
|
animatedLafChangeMenuItem = new JCheckBoxMenuItem();
|
||||||
@@ -588,6 +601,11 @@ class DemoFrame
|
|||||||
menuBarEmbeddedCheckBoxMenuItem.addActionListener(e -> menuBarEmbeddedChanged());
|
menuBarEmbeddedCheckBoxMenuItem.addActionListener(e -> menuBarEmbeddedChanged());
|
||||||
optionsMenu.add(menuBarEmbeddedCheckBoxMenuItem);
|
optionsMenu.add(menuBarEmbeddedCheckBoxMenuItem);
|
||||||
|
|
||||||
|
//---- unifiedTitleBarMenuItem ----
|
||||||
|
unifiedTitleBarMenuItem.setText("Unified Title Bar");
|
||||||
|
unifiedTitleBarMenuItem.addActionListener(e -> unifiedTitleBar());
|
||||||
|
optionsMenu.add(unifiedTitleBarMenuItem);
|
||||||
|
|
||||||
//---- underlineMenuSelectionMenuItem ----
|
//---- underlineMenuSelectionMenuItem ----
|
||||||
underlineMenuSelectionMenuItem.setText("Use underline menu selection");
|
underlineMenuSelectionMenuItem.setText("Use underline menu selection");
|
||||||
underlineMenuSelectionMenuItem.addActionListener(e -> underlineMenuSelection());
|
underlineMenuSelectionMenuItem.addActionListener(e -> underlineMenuSelection());
|
||||||
@@ -702,6 +720,15 @@ class DemoFrame
|
|||||||
buttonGroup1.add(radioButtonMenuItem3);
|
buttonGroup1.add(radioButtonMenuItem3);
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
|
|
||||||
|
// add "Users" button to menubar
|
||||||
|
FlatButton usersButton = new FlatButton();
|
||||||
|
usersButton.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/users.svg" ) );
|
||||||
|
usersButton.setButtonType( ButtonType.toolBarButton );
|
||||||
|
usersButton.setFocusable( false );
|
||||||
|
usersButton.addActionListener( e -> JOptionPane.showMessageDialog( null, "Hello User! How are you?", "User", JOptionPane.INFORMATION_MESSAGE ) );
|
||||||
|
menuBar1.add( Box.createGlue() );
|
||||||
|
menuBar1.add( usersButton );
|
||||||
|
|
||||||
undoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/undo.svg" ) );
|
undoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/undo.svg" ) );
|
||||||
redoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/redo.svg" ) );
|
redoMenuItem.setIcon( new FlatSVGIcon( "com/formdev/flatlaf/demo/icons/redo.svg" ) );
|
||||||
|
|
||||||
@@ -722,7 +749,7 @@ class DemoFrame
|
|||||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||||
|
|
||||||
boolean supportsWindowDecorations = UIManager.getLookAndFeel()
|
boolean supportsWindowDecorations = UIManager.getLookAndFeel()
|
||||||
.getSupportsWindowDecorations() || JBRCustomDecorations.isSupported();
|
.getSupportsWindowDecorations() || FlatNativeWindowBorder.isSupported();
|
||||||
windowDecorationsCheckBoxMenuItem.setEnabled( supportsWindowDecorations && !JBRCustomDecorations.isSupported() );
|
windowDecorationsCheckBoxMenuItem.setEnabled( supportsWindowDecorations && !JBRCustomDecorations.isSupported() );
|
||||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( supportsWindowDecorations );
|
menuBarEmbeddedCheckBoxMenuItem.setEnabled( supportsWindowDecorations );
|
||||||
|
|
||||||
@@ -744,6 +771,7 @@ class DemoFrame
|
|||||||
private JMenu optionsMenu;
|
private JMenu optionsMenu;
|
||||||
private JCheckBoxMenuItem windowDecorationsCheckBoxMenuItem;
|
private JCheckBoxMenuItem windowDecorationsCheckBoxMenuItem;
|
||||||
private JCheckBoxMenuItem menuBarEmbeddedCheckBoxMenuItem;
|
private JCheckBoxMenuItem menuBarEmbeddedCheckBoxMenuItem;
|
||||||
|
private JCheckBoxMenuItem unifiedTitleBarMenuItem;
|
||||||
private JCheckBoxMenuItem underlineMenuSelectionMenuItem;
|
private JCheckBoxMenuItem underlineMenuSelectionMenuItem;
|
||||||
private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem;
|
private JCheckBoxMenuItem alwaysShowMnemonicsMenuItem;
|
||||||
private JCheckBoxMenuItem animatedLafChangeMenuItem;
|
private JCheckBoxMenuItem animatedLafChangeMenuItem;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8"
|
JFDML JFormDesigner: "7.0.3.1.342" Java: "15" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -360,6 +360,14 @@ new FormModel {
|
|||||||
}
|
}
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) )
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
|
name: "unifiedTitleBarMenuItem"
|
||||||
|
"text": "Unified Title Bar"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "unifiedTitleBar", false ) )
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||||
name: "underlineMenuSelectionMenuItem"
|
name: "underlineMenuSelectionMenuItem"
|
||||||
"text": "Use underline menu selection"
|
"text": "Use underline menu selection"
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
package com.formdev.flatlaf.demo;
|
package com.formdev.flatlaf.demo;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import javax.swing.JDialog;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.extras.FlatInspector;
|
import com.formdev.flatlaf.extras.FlatInspector;
|
||||||
@@ -46,10 +44,6 @@ public class FlatLafDemo
|
|||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
DemoPrefs.init( PREFS_ROOT_PATH );
|
DemoPrefs.init( PREFS_ROOT_PATH );
|
||||||
|
|
||||||
// enable window decorations
|
|
||||||
JFrame.setDefaultLookAndFeelDecorated( true );
|
|
||||||
JDialog.setDefaultLookAndFeelDecorated( true );
|
|
||||||
|
|
||||||
// application specific UI defaults
|
// application specific UI defaults
|
||||||
FlatLaf.registerCustomDefaultsSource( "com.formdev.flatlaf.demo" );
|
FlatLaf.registerCustomDefaultsSource( "com.formdev.flatlaf.demo" );
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect id="frame" width="16" height="16" fill="none"/><path d="M11.6 8.5c1.104 0 1.992-.88 1.992-1.964 0-1.085-.888-1.965-1.992-1.965s-2 .88-2 1.965c0 1.084.896 1.964 2 1.964zm-6-.786c1.328 0 2.392-1.053 2.392-2.357C7.992 4.053 6.928 3 5.6 3 4.272 3 3.2 4.053 3.2 5.357c0 1.304 1.072 2.357 2.4 2.357zm6 2.357c-1.464 0-4.4.723-4.4 2.161V14H16v-1.768c0-1.438-2.936-2.16-4.4-2.16zm-6-.785c-1.864 0-5.6.919-5.6 2.75V14h5.6v-1.768c0-.668.264-1.838 1.896-2.726-.696-.142-1.368-.22-1.896-.22z" fill="#6E6E6E"/></svg>
|
||||||
|
After Width: | Height: | Size: 603 B |
@@ -38,6 +38,9 @@ import java.awt.event.KeyEvent;
|
|||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseMotionAdapter;
|
import java.awt.event.MouseMotionAdapter;
|
||||||
import java.awt.event.MouseMotionListener;
|
import java.awt.event.MouseMotionListener;
|
||||||
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
import java.awt.event.WindowListener;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -48,6 +51,8 @@ import javax.swing.JRootPane;
|
|||||||
import javax.swing.JToolBar;
|
import javax.swing.JToolBar;
|
||||||
import javax.swing.JToolTip;
|
import javax.swing.JToolTip;
|
||||||
import javax.swing.KeyStroke;
|
import javax.swing.KeyStroke;
|
||||||
|
import javax.swing.Popup;
|
||||||
|
import javax.swing.PopupFactory;
|
||||||
import javax.swing.RootPaneContainer;
|
import javax.swing.RootPaneContainer;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
@@ -55,6 +60,7 @@ import javax.swing.border.EmptyBorder;
|
|||||||
import javax.swing.border.LineBorder;
|
import javax.swing.border.LineBorder;
|
||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
@@ -82,7 +88,6 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
public class FlatInspector
|
public class FlatInspector
|
||||||
{
|
{
|
||||||
private static final Integer HIGHLIGHT_LAYER = 401;
|
private static final Integer HIGHLIGHT_LAYER = 401;
|
||||||
private static final Integer TOOLTIP_LAYER = 402;
|
|
||||||
|
|
||||||
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 final int KEY_MODIFIERS_MASK = InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK;
|
||||||
|
|
||||||
@@ -90,6 +95,8 @@ public class FlatInspector
|
|||||||
private final MouseMotionListener mouseMotionListener;
|
private final MouseMotionListener mouseMotionListener;
|
||||||
private final AWTEventListener keyListener;
|
private final AWTEventListener keyListener;
|
||||||
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
|
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
|
||||||
|
private final WindowListener windowListener;
|
||||||
|
private Window window;
|
||||||
|
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
private Component lastComponent;
|
private Component lastComponent;
|
||||||
@@ -99,7 +106,7 @@ public class FlatInspector
|
|||||||
private boolean wasCtrlOrShiftKeyPressed;
|
private boolean wasCtrlOrShiftKeyPressed;
|
||||||
|
|
||||||
private JComponent highlightFigure;
|
private JComponent highlightFigure;
|
||||||
private JToolTip tip;
|
private Popup popup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installs a key listener into the application that allows enabling and disabling
|
* Installs a key listener into the application that allows enabling and disabling
|
||||||
@@ -189,6 +196,18 @@ public class FlatInspector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
windowListener = new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowActivated( WindowEvent e ) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowDeactivated( WindowEvent e ) {
|
||||||
|
hidePopup();
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uninstall() {
|
private void uninstall() {
|
||||||
@@ -221,12 +240,26 @@ public class FlatInspector
|
|||||||
|
|
||||||
rootPane.getGlassPane().setVisible( enabled );
|
rootPane.getGlassPane().setVisible( enabled );
|
||||||
|
|
||||||
|
// add/remove key listener
|
||||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||||
if( enabled )
|
if( enabled )
|
||||||
toolkit.addAWTEventListener( keyListener, AWTEvent.KEY_EVENT_MASK );
|
toolkit.addAWTEventListener( keyListener, AWTEvent.KEY_EVENT_MASK );
|
||||||
else
|
else
|
||||||
toolkit.removeAWTEventListener( keyListener );
|
toolkit.removeAWTEventListener( keyListener );
|
||||||
|
|
||||||
|
// add/remove window listener
|
||||||
|
if( enabled ) {
|
||||||
|
window = SwingUtilities.windowForComponent( rootPane );
|
||||||
|
if( window != null )
|
||||||
|
window.addWindowListener( windowListener );
|
||||||
|
} else {
|
||||||
|
if( window != null ) {
|
||||||
|
window.removeWindowListener( windowListener );
|
||||||
|
window = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// show/hide popup
|
||||||
if( enabled ) {
|
if( enabled ) {
|
||||||
Point pt = new Point( MouseInfo.getPointerInfo().getLocation() );
|
Point pt = new Point( MouseInfo.getPointerInfo().getLocation() );
|
||||||
SwingUtilities.convertPointFromScreen( pt, rootPane );
|
SwingUtilities.convertPointFromScreen( pt, rootPane );
|
||||||
@@ -242,14 +275,19 @@ public class FlatInspector
|
|||||||
highlightFigure.getParent().remove( highlightFigure );
|
highlightFigure.getParent().remove( highlightFigure );
|
||||||
highlightFigure = null;
|
highlightFigure = null;
|
||||||
|
|
||||||
if( tip != null )
|
hidePopup();
|
||||||
tip.getParent().remove( tip );
|
|
||||||
tip = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
propertyChangeSupport.firePropertyChange( "enabled", !enabled, enabled );
|
propertyChangeSupport.firePropertyChange( "enabled", !enabled, enabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void hidePopup() {
|
||||||
|
if( popup != null ) {
|
||||||
|
popup.hide();
|
||||||
|
popup = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if( !rootPane.getGlassPane().isVisible() )
|
if( !rootPane.getGlassPane().isVisible() )
|
||||||
return;
|
return;
|
||||||
@@ -303,7 +341,7 @@ public class FlatInspector
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ignore highlight figure and tooltip
|
// ignore highlight figure and tooltip
|
||||||
if( c == highlightFigure || c == tip )
|
if( c == highlightFigure )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ignore glass pane
|
// ignore glass pane
|
||||||
@@ -357,26 +395,24 @@ public class FlatInspector
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showToolTip( Component c, int x, int y, int parentLevel ) {
|
private void showToolTip( Component c, int x, int y, int parentLevel ) {
|
||||||
if( c == null ) {
|
hidePopup();
|
||||||
if( tip != null )
|
|
||||||
tip.setVisible( false );
|
if( c == null || (window != null && !window.isActive()) )
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if( tip == null ) {
|
|
||||||
tip = new JToolTip();
|
|
||||||
rootPane.getLayeredPane().add( tip, TOOLTIP_LAYER );
|
|
||||||
} else
|
|
||||||
tip.setVisible( true );
|
|
||||||
|
|
||||||
|
JToolTip tip = new JToolTip();
|
||||||
tip.setTipText( buildToolTipText( c, parentLevel ) );
|
tip.setTipText( buildToolTipText( c, parentLevel ) );
|
||||||
|
tip.putClientProperty( FlatClientProperties.POPUP_FORCE_HEAVY_WEIGHT, true );
|
||||||
|
|
||||||
|
Point pt = new Point( x, y );
|
||||||
|
SwingUtilities.convertPointToScreen( pt, rootPane.getGlassPane() );
|
||||||
|
int tx = pt.x + UIScale.scale( 8 );
|
||||||
|
int ty = pt.y + UIScale.scale( 16 );
|
||||||
|
|
||||||
int tx = x + UIScale.scale( 8 );
|
|
||||||
int ty = y + UIScale.scale( 16 );
|
|
||||||
Dimension size = tip.getPreferredSize();
|
Dimension size = tip.getPreferredSize();
|
||||||
|
|
||||||
// position the tip in the visible area
|
// position the tip in the visible area
|
||||||
Rectangle visibleRect = rootPane.getVisibleRect();
|
Rectangle visibleRect = rootPane.getGraphicsConfiguration().getBounds();
|
||||||
if( tx + size.width > visibleRect.x + visibleRect.width )
|
if( tx + size.width > visibleRect.x + visibleRect.width )
|
||||||
tx -= size.width + UIScale.scale( 16 );
|
tx -= size.width + UIScale.scale( 16 );
|
||||||
if( ty + size.height > visibleRect.y + visibleRect.height )
|
if( ty + size.height > visibleRect.y + visibleRect.height )
|
||||||
@@ -386,8 +422,9 @@ public class FlatInspector
|
|||||||
if( ty < visibleRect.y )
|
if( ty < visibleRect.y )
|
||||||
ty = visibleRect.y;
|
ty = visibleRect.y;
|
||||||
|
|
||||||
tip.setBounds( tx, ty, size.width, size.height );
|
PopupFactory popupFactory = PopupFactory.getSharedInstance();
|
||||||
tip.repaint();
|
popup = popupFactory.getPopup( c, tip, tx, ty );
|
||||||
|
popup.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String buildToolTipText( Component c, int parentLevel ) {
|
private static String buildToolTipText( Component c, int parentLevel ) {
|
||||||
@@ -398,7 +435,8 @@ public class FlatInspector
|
|||||||
|
|
||||||
String name = c.getClass().getName();
|
String name = c.getClass().getName();
|
||||||
name = name.substring( name.lastIndexOf( '.' ) + 1 );
|
name = name.substring( name.lastIndexOf( '.' ) + 1 );
|
||||||
appendRow( buf, "Class", name + " (" + c.getClass().getPackage().getName() + ")" );
|
Package pkg = c.getClass().getPackage();
|
||||||
|
appendRow( buf, "Class", name + " (" + (pkg != null ? pkg.getName() : "-") + ")" );
|
||||||
appendRow( buf, "Size", c.getWidth() + ", " + c.getHeight() + " @ " + c.getX() + ", " + c.getY() );
|
appendRow( buf, "Size", c.getWidth() + ", " + c.getHeight() + " @ " + c.getX() + ", " + c.getY() );
|
||||||
|
|
||||||
if( c instanceof Container )
|
if( c instanceof Container )
|
||||||
@@ -473,9 +511,9 @@ public class FlatInspector
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void appendRow( StringBuilder buf, String key, String value ) {
|
private static void appendRow( StringBuilder buf, String key, String value ) {
|
||||||
buf.append( "<tr><td><b>" )
|
buf.append( "<tr><td>" )
|
||||||
.append( key )
|
.append( key )
|
||||||
.append( ":</b></td><td>" )
|
.append( ":</td><td>" )
|
||||||
.append( value )
|
.append( value )
|
||||||
.append( "</td></tr>" );
|
.append( "</td></tr>" );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,3 +210,13 @@ ToggleButton.toolbar.pressedBackground = ToggleButton.background
|
|||||||
ToggleButton.toolbar.selectedBackground = ToggleButton.background
|
ToggleButton.toolbar.selectedBackground = ToggleButton.background
|
||||||
|
|
||||||
ToggleButton.tab.hoverBackground = null
|
ToggleButton.tab.hoverBackground = null
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
JideButton.focusedBackground = JideButton.background
|
||||||
|
JideButton.selectedAndFocusedBackground = JideButton.background
|
||||||
|
JideButton.selectedBackground = JideButton.background
|
||||||
|
JideButton.highlight = null
|
||||||
|
|||||||
@@ -17,25 +17,21 @@
|
|||||||
package com.formdev.flatlaf.intellijthemes;
|
package com.formdev.flatlaf.intellijthemes;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() );
|
|
||||||
|
|
||||||
static IntelliJTheme loadTheme( String name ) {
|
static IntelliJTheme loadTheme( String name ) {
|
||||||
try {
|
try {
|
||||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||||
"/com/formdev/flatlaf/intellijthemes/themes/" + name ) );
|
"/com/formdev/flatlaf/intellijthemes/themes/" + name ) );
|
||||||
} catch( IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||||
LOG.log( Level.SEVERE, msg, ex );
|
LoggingFacade.INSTANCE.logSevere( msg, ex );
|
||||||
throw new RuntimeException( msg, ex );
|
throw new RuntimeException( msg, ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,25 +17,21 @@
|
|||||||
package com.formdev.flatlaf.intellijthemes.materialthemeuilite;
|
package com.formdev.flatlaf.intellijthemes.materialthemeuilite;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
|
import com.formdev.flatlaf.util.LoggingFacade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
static final Logger LOG = Logger.getLogger( FlatLaf.class.getName() );
|
|
||||||
|
|
||||||
static IntelliJTheme loadTheme( String name ) {
|
static IntelliJTheme loadTheme( String name ) {
|
||||||
try {
|
try {
|
||||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||||
"/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) );
|
"/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) );
|
||||||
} catch( IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||||
LOG.log( Level.SEVERE, msg, ex );
|
LoggingFacade.INSTANCE.logSevere( msg, ex );
|
||||||
throw new RuntimeException( msg, ex );
|
throw new RuntimeException( msg, ex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
module com.formdev.flatlaf.intellijthemes {
|
module com.formdev.flatlaf.intellijthemes {
|
||||||
requires java.desktop;
|
requires java.desktop;
|
||||||
requires java.logging;
|
|
||||||
requires com.formdev.flatlaf;
|
requires com.formdev.flatlaf;
|
||||||
|
|
||||||
exports com.formdev.flatlaf.intellijthemes;
|
exports com.formdev.flatlaf.intellijthemes;
|
||||||
|
|||||||
@@ -6,8 +6,13 @@ This addon for FlatLaf adds support for **some**
|
|||||||
|
|
||||||
Following JIDE Common Layer components are currently supported by this addon:
|
Following JIDE Common Layer components are currently supported by this addon:
|
||||||
|
|
||||||
|
- `JideButton`
|
||||||
|
- `JideLabel`
|
||||||
- `JidePopupMenu`
|
- `JidePopupMenu`
|
||||||
|
- `JideSplitButton`
|
||||||
- `JideTabbedPane`
|
- `JideTabbedPane`
|
||||||
|
- `JideToggleButton`
|
||||||
|
- `JideToggleSplitButton`
|
||||||
- `RangeSlider`
|
- `RangeSlider`
|
||||||
- `TristateCheckBox`
|
- `TristateCheckBox`
|
||||||
|
|
||||||
@@ -33,3 +38,9 @@ build script:
|
|||||||
Otherwise download `flatlaf-jide-oss-<version>.jar` here:
|
Otherwise download `flatlaf-jide-oss-<version>.jar` here:
|
||||||
|
|
||||||
[](https://maven-badges.herokuapp.com/maven-central/com.formdev/flatlaf-jide-oss)
|
[](https://maven-badges.herokuapp.com/maven-central/com.formdev/flatlaf-jide-oss)
|
||||||
|
|
||||||
|
|
||||||
|
JIDE Common Layer library `jide-oss-<version>.jar` (or
|
||||||
|
`jide-common-<version>.jar`) is also required:
|
||||||
|
|
||||||
|
[](https://maven-badges.herokuapp.com/maven-central/com.formdev/jide-oss)
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation( project( ":flatlaf-core" ) )
|
implementation( project( ":flatlaf-core" ) )
|
||||||
implementation( "com.jidesoft:jide-oss:3.6.18" )
|
|
||||||
|
// use compileOnly() because there are various JIDE libraries available on Maven Central
|
||||||
|
compileOnly( "com.formdev:jide-oss:3.7.11.1" )
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|||||||
@@ -21,9 +21,12 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
|
import javax.swing.UIDefaults.ActiveValue;
|
||||||
import com.formdev.flatlaf.FlatDefaultsAddon;
|
import com.formdev.flatlaf.FlatDefaultsAddon;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
|
import com.formdev.flatlaf.jideoss.ui.FlatJidePainter;
|
||||||
import com.jidesoft.plaf.LookAndFeelFactory;
|
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||||
|
import com.jidesoft.plaf.UIDefaultsLookup;
|
||||||
import com.jidesoft.plaf.LookAndFeelFactory.UIDefaultsCustomizer;
|
import com.jidesoft.plaf.LookAndFeelFactory.UIDefaultsCustomizer;
|
||||||
import com.jidesoft.plaf.LookAndFeelFactory.UIDefaultsInitializer;
|
import com.jidesoft.plaf.LookAndFeelFactory.UIDefaultsInitializer;
|
||||||
|
|
||||||
@@ -66,6 +69,8 @@ public class FlatJideOssDefaultsAddon
|
|||||||
* Because JIDE overwrites our UI defaults (from properties files) with its
|
* Because JIDE overwrites our UI defaults (from properties files) with its
|
||||||
* own UI defaults, we have to first remember our UI defaults in the initializer
|
* own UI defaults, we have to first remember our UI defaults in the initializer
|
||||||
* (invoked before JIDE overwrites UI defaults) and then restore them in the customizer.
|
* (invoked before JIDE overwrites UI defaults) and then restore them in the customizer.
|
||||||
|
* <p>
|
||||||
|
* Invoked from {@link LookAndFeelFactory#installJideExtension()}.
|
||||||
*/
|
*/
|
||||||
public static class FlatJideUIDefaultsCustomizer
|
public static class FlatJideUIDefaultsCustomizer
|
||||||
implements UIDefaultsInitializer, UIDefaultsCustomizer
|
implements UIDefaultsInitializer, UIDefaultsCustomizer
|
||||||
@@ -96,6 +101,25 @@ public class FlatJideOssDefaultsAddon
|
|||||||
jideDefaults = null;
|
jideDefaults = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// painter
|
||||||
|
UIDefaultsLookup.put( defaults, "Theme.painter", FlatJidePainter.getInstance() );
|
||||||
|
|
||||||
|
// avoid that JideButton and JideSplitButton shift icon on hover/selection
|
||||||
|
defaults.put( "Icon.floating", false );
|
||||||
|
|
||||||
|
// fonts
|
||||||
|
ActiveValue font = FlatLaf.createActiveFontValue( 1f );
|
||||||
|
defaults.put( "JideButton.font", font );
|
||||||
|
defaults.put( "JideLabel.font", font );
|
||||||
|
defaults.put( "JideSplitButton.font", font );
|
||||||
|
defaults.put( "JideTabbedPane.font", font );
|
||||||
|
defaults.put( "JideTabbedPane.selectedTabFont", font );
|
||||||
|
|
||||||
|
// reset standard fonts modified by LookAndFeelFactory.installJideExtension()
|
||||||
|
defaults.put( "FormattedTextField.font", font );
|
||||||
|
defaults.put( "Spinner.font", font );
|
||||||
|
defaults.put( "TextArea.font", font );
|
||||||
|
|
||||||
// TristateCheckBox
|
// TristateCheckBox
|
||||||
defaults.put( "TristateCheckBox.icon", null );
|
defaults.put( "TristateCheckBox.icon", null );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.jideoss.ui;
|
||||||
|
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||||
|
import com.jidesoft.plaf.basic.BasicJideButtonUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link com.jidesoft.swing.JideButton}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatJideButtonUI
|
||||||
|
extends BasicJideButtonUI
|
||||||
|
{
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in JideButton.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
|
return new FlatJideButtonUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.jideoss.ui;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||||
|
import com.jidesoft.plaf.basic.BasicJideLabelUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link com.jidesoft.swing.JideLabel}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatJideLabelUI
|
||||||
|
extends BasicJideLabelUI
|
||||||
|
{
|
||||||
|
private Color disabledForeground;
|
||||||
|
|
||||||
|
private boolean defaults_initialized = false;
|
||||||
|
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in JideLabel.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
|
return FlatUIUtils.createSharedUI( FlatJideLabelUI.class, FlatJideLabelUI::new );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void installDefaults( JLabel c ) {
|
||||||
|
super.installDefaults( c );
|
||||||
|
|
||||||
|
if( !defaults_initialized ) {
|
||||||
|
disabledForeground = UIManager.getColor( "JideLabel.disabledForeground" );
|
||||||
|
|
||||||
|
defaults_initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void uninstallDefaults( JLabel c ) {
|
||||||
|
super.uninstallDefaults( c );
|
||||||
|
defaults_initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintEnabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
|
||||||
|
int mnemIndex = FlatLaf.isShowMnemonics() ? l.getDisplayedMnemonicIndex() : -1;
|
||||||
|
g.setColor( l.getForeground() );
|
||||||
|
FlatUIUtils.drawStringUnderlineCharAt( l, g, s, mnemIndex, textX, textY );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintDisabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
|
||||||
|
int mnemIndex = FlatLaf.isShowMnemonics() ? l.getDisplayedMnemonicIndex() : -1;
|
||||||
|
g.setColor( disabledForeground );
|
||||||
|
FlatUIUtils.drawStringUnderlineCharAt( l, g, s, mnemIndex, textX, textY );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.jideoss.ui;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.Shape;
|
||||||
|
import java.awt.geom.Rectangle2D;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
import com.jidesoft.plaf.basic.BasicPainter;
|
||||||
|
import com.jidesoft.plaf.basic.ThemePainter;
|
||||||
|
import com.jidesoft.swing.JideButton;
|
||||||
|
import com.jidesoft.swing.JideSplitButton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatJidePainter
|
||||||
|
extends BasicPainter
|
||||||
|
{
|
||||||
|
protected final int arc = UIManager.getInt( "Button.arc" );
|
||||||
|
|
||||||
|
public static ThemePainter getInstance() {
|
||||||
|
// always create a new instance of Laf switching
|
||||||
|
return new FlatJidePainter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void installDefaults() {
|
||||||
|
// avoid white background in arrow area of selected split button
|
||||||
|
if( _bk0 == null )
|
||||||
|
_bk0 = UIManager.getColor( "Panel.background" );
|
||||||
|
|
||||||
|
super.installDefaults();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintBackground( JComponent c, Graphics g, Rectangle rect,
|
||||||
|
Color borderColor, Color background, int orientation )
|
||||||
|
{
|
||||||
|
if( (c instanceof JideButton && ((JideButton)c).getButtonStyle() == JideButton.TOOLBAR_STYLE) ||
|
||||||
|
(c instanceof JideSplitButton && ((JideSplitButton)c).getButtonStyle() == JideButton.TOOLBAR_STYLE) )
|
||||||
|
{
|
||||||
|
Color oldColor = g.getColor();
|
||||||
|
g.setColor( FlatUIUtils.deriveColor( background, c.getBackground() ) );
|
||||||
|
Object[] oldRenderingHints = FlatUIUtils.setRenderingHints( g );
|
||||||
|
|
||||||
|
if( c instanceof JideSplitButton ) {
|
||||||
|
// For split buttons, this method is invoked twice:
|
||||||
|
// - first for main button
|
||||||
|
// - second for arrow button
|
||||||
|
// To show a single rounded rectangle for the whole button we always paint
|
||||||
|
// the rounded rectangle with component bounds, but clip to the passed rectangle.
|
||||||
|
|
||||||
|
boolean horizontal = (((JideSplitButton)c).getOrientation() == SwingConstants.HORIZONTAL);
|
||||||
|
|
||||||
|
// for vertical orientation, the graphics context is rotated, but 1px wrong
|
||||||
|
if( !horizontal )
|
||||||
|
g.translate( 0, -1 );
|
||||||
|
|
||||||
|
Shape oldClip = g.getClip();
|
||||||
|
g.clipRect( rect.x, rect.y, rect.width, rect.height );
|
||||||
|
|
||||||
|
FlatUIUtils.paintComponentBackground( (Graphics2D) g, 0, 0,
|
||||||
|
horizontal ? c.getWidth() : c.getHeight(),
|
||||||
|
horizontal ? c.getHeight() : c.getWidth(),
|
||||||
|
0, UIScale.scale( (float) arc ) );
|
||||||
|
|
||||||
|
g.setClip( oldClip );
|
||||||
|
|
||||||
|
// paint separator line
|
||||||
|
if( rect.x > 0 ) {
|
||||||
|
g.setColor( borderColor );
|
||||||
|
((Graphics2D)g).fill( new Rectangle2D.Float( rect.x, rect.y, UIScale.scale( 1f ), rect.height ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !horizontal )
|
||||||
|
g.translate( 0, 1 );
|
||||||
|
} else {
|
||||||
|
FlatUIUtils.paintComponentBackground( (Graphics2D) g, rect.x, rect.y,
|
||||||
|
rect.width, rect.height, 0, UIScale.scale( (float) arc ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
FlatUIUtils.resetRenderingHints( g, oldRenderingHints );
|
||||||
|
g.setColor( oldColor );
|
||||||
|
} else
|
||||||
|
super.paintBackground( c, g, rect, borderColor, background, orientation );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ package com.formdev.flatlaf.jideoss.ui;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import com.formdev.flatlaf.ui.FlatPopupMenuUI;
|
import com.formdev.flatlaf.ui.FlatPopupMenuUI;
|
||||||
|
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||||
import com.jidesoft.plaf.basic.BasicJidePopupMenuUI;
|
import com.jidesoft.plaf.basic.BasicJidePopupMenuUI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,6 +29,10 @@ public class FlatJidePopupMenuUI
|
|||||||
extends FlatPopupMenuUI
|
extends FlatPopupMenuUI
|
||||||
{
|
{
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in JidePopupMenu.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
return new FlatJidePopupMenuUI();
|
return new FlatJidePopupMenuUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.jideoss.ui;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.FontMetrics;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.geom.Rectangle2D;
|
||||||
|
import javax.swing.ButtonModel;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
import com.jidesoft.plaf.LookAndFeelFactory;
|
||||||
|
import com.jidesoft.plaf.UIDefaultsLookup;
|
||||||
|
import com.jidesoft.plaf.basic.BasicJideSplitButtonUI;
|
||||||
|
import com.jidesoft.swing.JideSplitButton;
|
||||||
|
import com.jidesoft.swing.JideSwingUtilities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the Flat LaF UI delegate for {@link com.jidesoft.swing.JideSplitButton}.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatJideSplitButtonUI
|
||||||
|
extends BasicJideSplitButtonUI
|
||||||
|
{
|
||||||
|
protected String arrowType;
|
||||||
|
protected Color buttonArrowColor;
|
||||||
|
protected Color buttonDisabledArrowColor;
|
||||||
|
|
||||||
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in JideSplitButton.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
|
return new FlatJideSplitButtonUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void installDefaults() {
|
||||||
|
super.installDefaults();
|
||||||
|
|
||||||
|
arrowType = UIManager.getString( "Component.arrowType" );
|
||||||
|
buttonArrowColor = UIManager.getColor( "JideSplitButton.buttonArrowColor" );
|
||||||
|
buttonDisabledArrowColor = UIManager.getColor( "JideSplitButton.buttonDisabledArrowColor" );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getRightMargin() {
|
||||||
|
// scale margins
|
||||||
|
_splitButtonMargin = UIScale.scale( 14 );
|
||||||
|
_splitButtonMarginOnMenu = UIScale.scale( 20 );
|
||||||
|
|
||||||
|
return super.getRightMargin();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Rectangle getButtonRect( JComponent c, int orientation, int width, int height ) {
|
||||||
|
return c.getComponentOrientation().isLeftToRight()
|
||||||
|
? new Rectangle( 0, 0, width - _splitButtonMargin + 1, height )
|
||||||
|
: new Rectangle( _splitButtonMargin - 1, 0, width - _splitButtonMargin + 1, height );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Rectangle getDropDownRect( JComponent c, int orientation, int width, int height ) {
|
||||||
|
return c.getComponentOrientation().isLeftToRight()
|
||||||
|
? new Rectangle( width - _splitButtonMargin, 0, _splitButtonMargin, height )
|
||||||
|
: new Rectangle( 0, 0, _splitButtonMargin, height );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text ) {
|
||||||
|
ButtonModel model = menuItem.getModel();
|
||||||
|
if( !model.isEnabled() ||
|
||||||
|
(menuItem instanceof JideSplitButton && !((JideSplitButton)menuItem).isButtonEnabled()) )
|
||||||
|
{
|
||||||
|
FontMetrics fm = menuItem.getFontMetrics( menuItem.getFont() );
|
||||||
|
|
||||||
|
if( !menuItem.getComponentOrientation().isLeftToRight() &&
|
||||||
|
menuItem.getComponentOrientation().isHorizontal() )
|
||||||
|
{
|
||||||
|
Rectangle2D rectText = fm.getStringBounds( text, g );
|
||||||
|
textRect.x = (int) (menuItem.getWidth() - textRect.x - rectText.getWidth() + (4 + menuItem.getHeight() / 2 - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
g.setColor( UIDefaultsLookup.getColor( "Button.disabledForeground" ) );
|
||||||
|
drawStringUnderlineCharAt( menuItem, g, text, -1, textRect.x, textRect.y + fm.getAscent() );
|
||||||
|
} else
|
||||||
|
super.paintText( g, menuItem, textRect, text );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintArrow( JMenuItem menuItem, Graphics g ) {
|
||||||
|
g.setColor( menuItem.isEnabled() ? buttonArrowColor : buttonDisabledArrowColor );
|
||||||
|
|
||||||
|
int orientation = JideSwingUtilities.getOrientationOf( menuItem );
|
||||||
|
int menuWidth = (orientation == SwingConstants.HORIZONTAL) ? menuItem.getWidth() : menuItem.getHeight();
|
||||||
|
int menuHeight = (orientation == SwingConstants.HORIZONTAL) ? menuItem.getHeight() : menuItem.getWidth();
|
||||||
|
Rectangle r = getDropDownRect( menuItem, orientation, menuWidth, menuHeight );
|
||||||
|
|
||||||
|
Object[] oldRenderingHints = FlatUIUtils.setRenderingHints( g );
|
||||||
|
FlatUIUtils.paintArrow( (Graphics2D) g, r.x, r.y, r.width, r.height,
|
||||||
|
SwingConstants.SOUTH, FlatUIUtils.isChevron( arrowType ), 6, 0, 0 );
|
||||||
|
FlatUIUtils.resetRenderingHints( g, oldRenderingHints );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,7 +32,6 @@ import java.awt.event.MouseListener;
|
|||||||
import java.awt.event.MouseMotionListener;
|
import java.awt.event.MouseMotionListener;
|
||||||
import java.awt.geom.Path2D;
|
import java.awt.geom.Path2D;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.beans.PropertyChangeEvent;
|
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
@@ -67,7 +66,10 @@ public class FlatJideTabbedPaneUI
|
|||||||
private Object[] oldRenderingHints;
|
private Object[] oldRenderingHints;
|
||||||
|
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in JideTabbedPane.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
LookAndFeelFactory.installJideExtension();
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
return new FlatJideTabbedPaneUI();
|
return new FlatJideTabbedPaneUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,19 +110,17 @@ public class FlatJideTabbedPaneUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PropertyChangeListener createPropertyChangeListener() {
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
return new PropertyChangeHandler() {
|
PropertyChangeListener superListener = super.createPropertyChangeListener();
|
||||||
@Override
|
return e -> {
|
||||||
public void propertyChange( PropertyChangeEvent e ) {
|
superListener.propertyChange( e );
|
||||||
super.propertyChange( e );
|
|
||||||
|
|
||||||
String propertyName = e.getPropertyName();
|
String propertyName = e.getPropertyName();
|
||||||
if( JideTabbedPane.PROPERTY_SELECTED_INDEX.equals( propertyName ) ) {
|
if( JideTabbedPane.PROPERTY_SELECTED_INDEX.equals( propertyName ) ) {
|
||||||
repaintTab( (Integer) e.getOldValue() );
|
repaintTab( (Integer) e.getOldValue() );
|
||||||
repaintTab( (Integer) e.getNewValue() );
|
repaintTab( (Integer) e.getNewValue() );
|
||||||
} else if( FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER.equals( propertyName ) ) {
|
} else if( FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER.equals( propertyName ) ) {
|
||||||
_tabPane.revalidate();
|
_tabPane.revalidate();
|
||||||
_tabPane.repaint();
|
_tabPane.repaint();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,10 @@ public class FlatRangeSliderUI
|
|||||||
private Object[] oldRenderingHints;
|
private Object[] oldRenderingHints;
|
||||||
|
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
|
// usually JIDE would invoke this in RangeSlider.updateUI(),
|
||||||
|
// but it does not because FlatLaf already has added the UI class to the UI defaults
|
||||||
LookAndFeelFactory.installJideExtension();
|
LookAndFeelFactory.installJideExtension();
|
||||||
|
|
||||||
return new FlatRangeSliderUI();
|
return new FlatRangeSliderUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,16 +16,60 @@
|
|||||||
|
|
||||||
#---- UI delegates ----
|
#---- UI delegates ----
|
||||||
|
|
||||||
|
JideButtonUI = com.formdev.flatlaf.jideoss.ui.FlatJideButtonUI
|
||||||
|
JideLabelUI = com.formdev.flatlaf.jideoss.ui.FlatJideLabelUI
|
||||||
JidePopupMenuUI = com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
JidePopupMenuUI = com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
||||||
|
JideSplitButtonUI = com.formdev.flatlaf.jideoss.ui.FlatJideSplitButtonUI
|
||||||
JideTabbedPaneUI = com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
JideTabbedPaneUI = com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
||||||
RangeSliderUI = com.formdev.flatlaf.jideoss.ui.FlatRangeSliderUI
|
RangeSliderUI = com.formdev.flatlaf.jideoss.ui.FlatRangeSliderUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton and JideToggleButton ----
|
||||||
|
|
||||||
|
JideButton.border = com.formdev.flatlaf.ui.FlatMarginBorder
|
||||||
|
JideButton.margin = $Button.toolbar.margin
|
||||||
|
JideButton.textIconGap = {scaledInteger}4
|
||||||
|
|
||||||
|
JideButton.background = $Button.background
|
||||||
|
JideButton.foreground = $Button.foreground
|
||||||
|
JideButton.focusedBackground = $Button.toolbar.hoverBackground
|
||||||
|
JideButton.selectedBackground = $Button.toolbar.selectedBackground
|
||||||
|
JideButton.selectedAndFocusedBackground = $Button.toolbar.pressedBackground
|
||||||
|
JideButton.borderColor = $Button.borderColor
|
||||||
|
|
||||||
|
JideButton.shadow = $Button.borderColor
|
||||||
|
JideButton.darkShadow = $Button.borderColor
|
||||||
|
JideButton.light = $Button.borderColor
|
||||||
|
JideButton.highlight = $Button.selectedBackground
|
||||||
|
|
||||||
|
Button.disabledForeground = $Button.disabledText
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
JideLabel.background = $Label.background
|
||||||
|
JideLabel.foreground = $Label.foreground
|
||||||
|
JideLabel.disabledForeground = $Label.disabledForeground
|
||||||
|
|
||||||
|
|
||||||
#---- JidePopup ----
|
#---- JidePopup ----
|
||||||
|
|
||||||
Resizable.resizeBorder = 4,4,4,4,$PopupMenu.borderColor
|
Resizable.resizeBorder = 4,4,4,4,$PopupMenu.borderColor
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton and JideToggleSplitButton ----
|
||||||
|
|
||||||
|
JideSplitButton.border = com.formdev.flatlaf.ui.FlatMarginBorder
|
||||||
|
JideSplitButton.margin = $Button.toolbar.margin
|
||||||
|
JideSplitButton.textIconGap = {scaledInteger}4
|
||||||
|
|
||||||
|
JideSplitButton.background = $Button.background
|
||||||
|
JideSplitButton.foreground = $Button.foreground
|
||||||
|
JideSplitButton.selectionForeground = $Button.foreground
|
||||||
|
JideSplitButton.buttonArrowColor = @buttonArrowColor
|
||||||
|
JideSplitButton.buttonDisabledArrowColor = @buttonDisabledArrowColor
|
||||||
|
|
||||||
|
|
||||||
#---- JideTabbedPane ----
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
JideTabbedPane.background = @background
|
JideTabbedPane.background = @background
|
||||||
|
|||||||
5
flatlaf-natives/README.md
Normal file
5
flatlaf-natives/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FlatLaf Native Libraries
|
||||||
|
========================
|
||||||
|
|
||||||
|
- [Windows 10 Native Library](flatlaf-natives-windows)
|
||||||
|
- [Natives using JNA](flatlaf-natives-jna) (for development only)
|
||||||
10
flatlaf-natives/flatlaf-natives-jna/README.md
Normal file
10
flatlaf-natives/flatlaf-natives-jna/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FlatLaf Natives using JNA
|
||||||
|
=========================
|
||||||
|
|
||||||
|
This sub-project contains source code that uses
|
||||||
|
[JNA](https://github.com/java-native-access/jna) to access native operating
|
||||||
|
system API.
|
||||||
|
|
||||||
|
**Note:** Code in this sub-project is **not used** in FlatLaf libraries. It was
|
||||||
|
used to develop/test usage of some native operating system API in Java (with the
|
||||||
|
help of JNA) and was then converted to C++.
|
||||||
25
flatlaf-natives/flatlaf-natives-jna/build.gradle.kts
Normal file
25
flatlaf-natives/flatlaf-natives-jna/build.gradle.kts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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( "net.java.dev.jna:jna:5.7.0" )
|
||||||
|
implementation( "net.java.dev.jna:jna-platform:5.7.0" )
|
||||||
|
}
|
||||||
@@ -0,0 +1,705 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.natives.jna.windows;
|
||||||
|
|
||||||
|
import static com.sun.jna.platform.win32.ShellAPI.*;
|
||||||
|
import static com.sun.jna.platform.win32.WinReg.*;
|
||||||
|
import static com.sun.jna.platform.win32.WinUser.*;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Dialog;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GraphicsConfiguration;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.Window;
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.Timer;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
import javax.swing.event.EventListenerList;
|
||||||
|
import com.formdev.flatlaf.ui.FlatNativeWindowBorder;
|
||||||
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
|
import com.sun.jna.Native;
|
||||||
|
import com.sun.jna.Pointer;
|
||||||
|
import com.sun.jna.Structure;
|
||||||
|
import com.sun.jna.Structure.FieldOrder;
|
||||||
|
import com.sun.jna.platform.win32.Advapi32Util;
|
||||||
|
import com.sun.jna.platform.win32.BaseTSD;
|
||||||
|
import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR;
|
||||||
|
import com.sun.jna.platform.win32.Shell32;
|
||||||
|
import com.sun.jna.platform.win32.User32;
|
||||||
|
import com.sun.jna.platform.win32.WTypes.LPWSTR;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.HMENU;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.HWND;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.LPARAM;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.LRESULT;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.RECT;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.UINT_PTR;
|
||||||
|
import com.sun.jna.platform.win32.WinDef.WPARAM;
|
||||||
|
import com.sun.jna.platform.win32.WinUser.HMONITOR;
|
||||||
|
import com.sun.jna.platform.win32.WinUser.WindowProc;
|
||||||
|
import com.sun.jna.win32.W32APIOptions;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Interesting resources:
|
||||||
|
// https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
// https://docs.microsoft.com/en-us/windows/win32/dwm/customframe
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/commit/d2820524a1aa211b1c49b30f659b9b4d07a6f96e
|
||||||
|
// https://github.com/JetBrains/JetBrainsRuntime/pull/18
|
||||||
|
// https://medium.com/swlh/customizing-the-title-bar-of-an-application-window-50a4ac3ed27e
|
||||||
|
// https://github.com/kalbetredev/CustomDecoratedJFrame
|
||||||
|
// https://github.com/Guerra24/NanoUI-win32
|
||||||
|
// https://github.com/oberth/custom-chrome
|
||||||
|
// https://github.com/rossy/borderless-window
|
||||||
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Native window border support for Windows 10 when using custom decorations.
|
||||||
|
* <p>
|
||||||
|
* If the application wants to use custom decorations, the Windows 10 title bar is hidden
|
||||||
|
* (including minimize, maximize and close buttons), but not the resize borders (including drop shadow).
|
||||||
|
* Windows 10 window snapping functionality will remain unaffected:
|
||||||
|
* https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
public class FlatWindowsNativeWindowBorder
|
||||||
|
implements FlatNativeWindowBorder.Provider
|
||||||
|
{
|
||||||
|
private final Map<Window, WndProc> windowsMap = Collections.synchronizedMap( new IdentityHashMap<>() );
|
||||||
|
private final EventListenerList listenerList = new EventListenerList();
|
||||||
|
private Timer fireStateChangedTimer;
|
||||||
|
|
||||||
|
private boolean colorizationUpToDate;
|
||||||
|
private boolean colorizationColorAffectsBorders;
|
||||||
|
private Color colorizationColor;
|
||||||
|
private int colorizationColorBalance;
|
||||||
|
|
||||||
|
private static FlatWindowsNativeWindowBorder instance;
|
||||||
|
|
||||||
|
public static FlatNativeWindowBorder.Provider getInstance() {
|
||||||
|
if( instance == null )
|
||||||
|
instance = new FlatWindowsNativeWindowBorder();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private FlatWindowsNativeWindowBorder() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomDecoration( Window window ) {
|
||||||
|
return windowsMap.containsKey( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the window whether the application wants use custom decorations.
|
||||||
|
* If {@code true}, the Windows 10 title bar is hidden (including minimize,
|
||||||
|
* maximize and close buttons), but not the resize borders (including drop shadow).
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setHasCustomDecoration( Window window, boolean hasCustomDecoration ) {
|
||||||
|
if( hasCustomDecoration )
|
||||||
|
install( window );
|
||||||
|
else
|
||||||
|
uninstall( window );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void install( Window window ) {
|
||||||
|
// requires Windows 10
|
||||||
|
if( !SystemInfo.isWindows_10_orLater )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// only JFrame and JDialog are supported
|
||||||
|
if( !(window instanceof JFrame) && !(window instanceof JDialog) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// not supported if frame/dialog is undecorated
|
||||||
|
if( (window instanceof Frame && ((Frame)window).isUndecorated()) ||
|
||||||
|
(window instanceof Dialog && ((Dialog)window).isUndecorated()) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// check whether already installed
|
||||||
|
if( windowsMap.containsKey( window ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// install
|
||||||
|
WndProc wndProc = new WndProc( window );
|
||||||
|
windowsMap.put( window, wndProc );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void uninstall( Window window ) {
|
||||||
|
WndProc wndProc = windowsMap.remove( window );
|
||||||
|
if( wndProc != null )
|
||||||
|
wndProc.uninstall();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarHeight( Window window, int titleBarHeight ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.titleBarHeight = titleBarHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarHitTestSpots( Window window, List<Rectangle> hitTestSpots ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.hitTestSpots = hitTestSpots.toArray( new Rectangle[hitTestSpots.size()] );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleBarAppIconBounds( Window window, Rectangle appIconBounds ) {
|
||||||
|
WndProc wndProc = windowsMap.get( window );
|
||||||
|
if( wndProc == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wndProc.appIconBounds = (appIconBounds != null) ? new Rectangle( appIconBounds ) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isColorizationColorAffectsBorders() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColorAffectsBorders;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Color getColorizationColor() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColorizationColorBalance() {
|
||||||
|
updateColorization();
|
||||||
|
return colorizationColorBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateColorization() {
|
||||||
|
if( colorizationUpToDate )
|
||||||
|
return;
|
||||||
|
colorizationUpToDate = true;
|
||||||
|
|
||||||
|
String subKey = "SOFTWARE\\Microsoft\\Windows\\DWM";
|
||||||
|
|
||||||
|
int value = registryGetIntValue( subKey, "ColorPrevalence", -1 );
|
||||||
|
colorizationColorAffectsBorders = (value > 0);
|
||||||
|
|
||||||
|
value = registryGetIntValue( subKey, "ColorizationColor", -1 );
|
||||||
|
colorizationColor = (value != -1) ? new Color( value ) : null;
|
||||||
|
|
||||||
|
colorizationColorBalance = registryGetIntValue( subKey, "ColorizationColorBalance", -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int registryGetIntValue( String key, String valueName, int defaultValue ) {
|
||||||
|
try {
|
||||||
|
return Advapi32Util.registryGetIntValue( HKEY_CURRENT_USER, key, valueName );
|
||||||
|
} catch( RuntimeException ex ) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addChangeListener( ChangeListener l ) {
|
||||||
|
listenerList.add( ChangeListener.class, l );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeChangeListener( ChangeListener l ) {
|
||||||
|
listenerList.remove( ChangeListener.class, l );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireStateChanged() {
|
||||||
|
Object[] listeners = listenerList.getListenerList();
|
||||||
|
if( listeners.length == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ChangeEvent e = new ChangeEvent( this );
|
||||||
|
for( int i = 0; i < listeners.length; i += 2 ) {
|
||||||
|
if( listeners[i] == ChangeListener.class )
|
||||||
|
((ChangeListener)listeners[i+1]).stateChanged( e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages,
|
||||||
|
* slightly delay event firing and fire it only once (on the AWT thread).
|
||||||
|
*/
|
||||||
|
void fireStateChangedLaterOnce() {
|
||||||
|
EventQueue.invokeLater( () -> {
|
||||||
|
if( fireStateChangedTimer != null ) {
|
||||||
|
fireStateChangedTimer.restart();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fireStateChangedTimer = new Timer( 300, e -> {
|
||||||
|
fireStateChangedTimer = null;
|
||||||
|
colorizationUpToDate = false;
|
||||||
|
|
||||||
|
fireStateChanged();
|
||||||
|
} );
|
||||||
|
fireStateChangedTimer.setRepeats( false );
|
||||||
|
fireStateChangedTimer.start();
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class WndProc ------------------------------------------------------
|
||||||
|
|
||||||
|
private class WndProc
|
||||||
|
implements WindowProc
|
||||||
|
{
|
||||||
|
private static final int GWLP_WNDPROC = -4;
|
||||||
|
|
||||||
|
private static final int
|
||||||
|
WM_NCCALCSIZE = 0x0083,
|
||||||
|
WM_NCHITTEST = 0x0084,
|
||||||
|
WM_NCRBUTTONUP = 0x00A5,
|
||||||
|
WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320;
|
||||||
|
|
||||||
|
// WM_NCHITTEST mouse position codes
|
||||||
|
private static final int
|
||||||
|
HTCLIENT = 1,
|
||||||
|
HTCAPTION = 2,
|
||||||
|
HTSYSMENU = 3,
|
||||||
|
HTTOP = 12;
|
||||||
|
|
||||||
|
private static final int ABS_AUTOHIDE = 0x0000001;
|
||||||
|
private static final int ABM_GETAUTOHIDEBAREX = 0x0000000b;
|
||||||
|
|
||||||
|
private static final int
|
||||||
|
SC_SIZE = 0xF000,
|
||||||
|
SC_MOVE = 0xF010,
|
||||||
|
SC_MINIMIZE = 0xF020,
|
||||||
|
SC_MAXIMIZE = 0xF030,
|
||||||
|
SC_CLOSE = 0xF060,
|
||||||
|
SC_RESTORE = 0xF120;
|
||||||
|
|
||||||
|
private static final int
|
||||||
|
MIIM_STATE = 0x00000001,
|
||||||
|
MFT_STRING = 0x00000000,
|
||||||
|
MF_ENABLED = 0x00000000,
|
||||||
|
MF_DISABLED = 0x00000002,
|
||||||
|
TPM_RETURNCMD = 0x0100;
|
||||||
|
|
||||||
|
private Window window;
|
||||||
|
private final HWND hwnd;
|
||||||
|
private final BaseTSD.LONG_PTR defaultWndProc;
|
||||||
|
|
||||||
|
private int titleBarHeight;
|
||||||
|
private Rectangle[] hitTestSpots;
|
||||||
|
private Rectangle appIconBounds;
|
||||||
|
|
||||||
|
WndProc( Window window ) {
|
||||||
|
this.window = window;
|
||||||
|
|
||||||
|
// get window handle
|
||||||
|
hwnd = new HWND( Native.getComponentPointer( window ) );
|
||||||
|
|
||||||
|
// replace window procedure
|
||||||
|
if( SystemInfo.isX86_64 )
|
||||||
|
defaultWndProc = User32Ex.INSTANCE.SetWindowLongPtr( hwnd, GWLP_WNDPROC, this );
|
||||||
|
else
|
||||||
|
defaultWndProc = User32Ex.INSTANCE.SetWindowLong( hwnd, GWLP_WNDPROC, this );
|
||||||
|
|
||||||
|
// remove the OS window title bar
|
||||||
|
updateFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
void uninstall() {
|
||||||
|
// restore original window procedure
|
||||||
|
if( SystemInfo.isX86_64 )
|
||||||
|
User32Ex.INSTANCE.SetWindowLongPtr( hwnd, GWLP_WNDPROC, defaultWndProc );
|
||||||
|
else
|
||||||
|
User32Ex.INSTANCE.SetWindowLong( hwnd, GWLP_WNDPROC, defaultWndProc );
|
||||||
|
|
||||||
|
// show the OS window title bar
|
||||||
|
updateFrame();
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
window = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFrame() {
|
||||||
|
// this sends WM_NCCALCSIZE and removes/shows the window title bar
|
||||||
|
User32.INSTANCE.SetWindowPos( hwnd, hwnd, 0, 0, 0, 0,
|
||||||
|
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: This method is invoked on the AWT-Windows thread (not the AWT-EventQueue thread).
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LRESULT callback( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
switch( uMsg ) {
|
||||||
|
case WM_NCCALCSIZE:
|
||||||
|
return WmNcCalcSize( hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
case WM_NCHITTEST:
|
||||||
|
return WmNcHitTest( hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
case WM_NCRBUTTONUP:
|
||||||
|
if( wParam.longValue() == HTCAPTION || wParam.longValue() == HTSYSMENU )
|
||||||
|
openSystemMenu( hwnd, GET_X_LPARAM( lParam ), GET_Y_LPARAM( lParam ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DWMCOLORIZATIONCOLORCHANGED:
|
||||||
|
fireStateChangedLaterOnce();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
return WmDestroy( hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
return User32Ex.INSTANCE.CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle WM_DESTROY
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-destroy
|
||||||
|
*/
|
||||||
|
private LRESULT WmDestroy( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
// call original AWT window procedure because it may fire window closed event in AwtWindow::WmDestroy()
|
||||||
|
LRESULT lResult = User32Ex.INSTANCE.CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
// restore original window procedure
|
||||||
|
if( SystemInfo.isX86_64 )
|
||||||
|
User32Ex.INSTANCE.SetWindowLongPtr( hwnd, GWLP_WNDPROC, defaultWndProc );
|
||||||
|
else
|
||||||
|
User32Ex.INSTANCE.SetWindowLong( hwnd, GWLP_WNDPROC, defaultWndProc );
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
windowsMap.remove( window );
|
||||||
|
window = null;
|
||||||
|
|
||||||
|
return lResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle WM_NCCALCSIZE
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-nccalcsize
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_OnNcCalcSize() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
private LRESULT WmNcCalcSize( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
if( wParam.intValue() != 1 )
|
||||||
|
return User32Ex.INSTANCE.CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
NCCALCSIZE_PARAMS params = new NCCALCSIZE_PARAMS( new Pointer( lParam.longValue() ) );
|
||||||
|
|
||||||
|
// store the original top before the default window proc applies the default frame
|
||||||
|
int originalTop = params.rgrc[0].top;
|
||||||
|
|
||||||
|
// apply the default frame
|
||||||
|
LRESULT lResult = User32Ex.INSTANCE.CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
if( lResult.longValue() != 0 )
|
||||||
|
return lResult;
|
||||||
|
|
||||||
|
// re-read params from native memory because defaultWndProc changed it
|
||||||
|
params.read();
|
||||||
|
|
||||||
|
// re-apply the original top from before the size of the default frame was applied
|
||||||
|
params.rgrc[0].top = originalTop;
|
||||||
|
|
||||||
|
boolean isMaximized = User32Ex.INSTANCE.IsZoomed( hwnd );
|
||||||
|
if( isMaximized && !isFullscreen() ) {
|
||||||
|
// When a window is maximized, its size is actually a little bit more
|
||||||
|
// than the monitor's work area. The window is positioned and sized in
|
||||||
|
// such a way that the resize handles are outside of the monitor and
|
||||||
|
// then the window is clipped to the monitor so that the resize handle
|
||||||
|
// do not appear because you don't need them (because you can't resize
|
||||||
|
// a window when it's maximized unless you restore it).
|
||||||
|
params.rgrc[0].top += getResizeHandleHeight();
|
||||||
|
|
||||||
|
// check whether taskbar is in the autohide state
|
||||||
|
APPBARDATA autohide = new APPBARDATA();
|
||||||
|
autohide.cbSize = new DWORD( autohide.size() );
|
||||||
|
int state = Shell32.INSTANCE.SHAppBarMessage( new DWORD( ABM_GETSTATE ), autohide ).intValue();
|
||||||
|
if( (state & ABS_AUTOHIDE) != 0 ) {
|
||||||
|
// get monitor info
|
||||||
|
// (using MONITOR_DEFAULTTONEAREST finds right monitor when restoring from minimized)
|
||||||
|
HMONITOR hMonitor = User32.INSTANCE.MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST );
|
||||||
|
MONITORINFO monitorInfo = new MONITORINFO();
|
||||||
|
User32.INSTANCE.GetMonitorInfo( hMonitor, monitorInfo );
|
||||||
|
|
||||||
|
// If there's a taskbar on any side of the monitor, reduce our size
|
||||||
|
// a little bit on that edge.
|
||||||
|
if( hasAutohideTaskbar( ABE_TOP, monitorInfo.rcMonitor ) )
|
||||||
|
params.rgrc[0].top++;
|
||||||
|
if( hasAutohideTaskbar( ABE_BOTTOM, monitorInfo.rcMonitor ) )
|
||||||
|
params.rgrc[0].bottom--;
|
||||||
|
if( hasAutohideTaskbar( ABE_LEFT, monitorInfo.rcMonitor ) )
|
||||||
|
params.rgrc[0].left++;
|
||||||
|
if( hasAutohideTaskbar( ABE_RIGHT, monitorInfo.rcMonitor ) )
|
||||||
|
params.rgrc[0].right--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// write changed params back to native memory
|
||||||
|
params.write();
|
||||||
|
|
||||||
|
return lResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle WM_NCHITTEST
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_OnNcHitTest() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
private LRESULT WmNcHitTest( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
// this will handle the left, right and bottom parts of the frame because we didn't change them
|
||||||
|
LRESULT lResult = User32Ex.INSTANCE.CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
if( lResult.longValue() != HTCLIENT )
|
||||||
|
return lResult;
|
||||||
|
|
||||||
|
// get window rectangle needed to convert mouse x/y from screen to window coordinates
|
||||||
|
RECT rcWindow = new RECT();
|
||||||
|
User32.INSTANCE.GetWindowRect( hwnd, rcWindow );
|
||||||
|
|
||||||
|
// get mouse x/y in window coordinates
|
||||||
|
int x = GET_X_LPARAM( lParam ) - rcWindow.left;
|
||||||
|
int y = GET_Y_LPARAM( lParam ) - rcWindow.top;
|
||||||
|
|
||||||
|
// scale-down mouse x/y
|
||||||
|
Point pt = scaleDown( x, y );
|
||||||
|
int sx = pt.x;
|
||||||
|
int sy = pt.y;
|
||||||
|
|
||||||
|
// return HTSYSMENU if mouse is over application icon
|
||||||
|
// - left-click on HTSYSMENU area shows system menu
|
||||||
|
// - double-left-click sends WM_CLOSE
|
||||||
|
if( appIconBounds != null && appIconBounds.contains( sx, sy ) )
|
||||||
|
return new LRESULT( HTSYSMENU );
|
||||||
|
|
||||||
|
int resizeBorderHeight = getResizeHandleHeight();
|
||||||
|
boolean isOnResizeBorder = (y < resizeBorderHeight) &&
|
||||||
|
(User32.INSTANCE.GetWindowLong( hwnd, GWL_STYLE ) & WS_THICKFRAME) != 0;
|
||||||
|
boolean isOnTitleBar = (sy < titleBarHeight);
|
||||||
|
|
||||||
|
if( isOnTitleBar ) {
|
||||||
|
// use a second reference to the array to avoid that it can be changed
|
||||||
|
// in another thread while processing the array
|
||||||
|
Rectangle[] hitTestSpots2 = hitTestSpots;
|
||||||
|
for( Rectangle spot : hitTestSpots2 ) {
|
||||||
|
if( spot.contains( sx, sy ) )
|
||||||
|
return new LRESULT( HTCLIENT );
|
||||||
|
}
|
||||||
|
return new LRESULT( isOnResizeBorder ? HTTOP : HTCAPTION );
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LRESULT( isOnResizeBorder ? HTTOP : HTCLIENT );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the height of the little space at the top of the window used to
|
||||||
|
* resize the window.
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_GetResizeHandleHeight() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
private int getResizeHandleHeight() {
|
||||||
|
int dpi = User32Ex.INSTANCE.GetDpiForWindow( hwnd );
|
||||||
|
|
||||||
|
// there isn't a SM_CYPADDEDBORDER for the Y axis
|
||||||
|
return User32Ex.INSTANCE.GetSystemMetricsForDpi( SM_CXPADDEDBORDER, dpi )
|
||||||
|
+ User32Ex.INSTANCE.GetSystemMetricsForDpi( SM_CYSIZEFRAME, dpi );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether there is an autohide taskbar on the given edge.
|
||||||
|
*/
|
||||||
|
private boolean hasAutohideTaskbar( int edge, RECT rcMonitor ) {
|
||||||
|
APPBARDATA data = new APPBARDATA();
|
||||||
|
data.cbSize = new DWORD( data.size() );
|
||||||
|
data.uEdge = new UINT( edge );
|
||||||
|
data.rc = rcMonitor;
|
||||||
|
UINT_PTR hTaskbar = Shell32.INSTANCE.SHAppBarMessage( new DWORD( ABM_GETAUTOHIDEBAREX ), data );
|
||||||
|
return hTaskbar.longValue() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scales down in the same way as AWT.
|
||||||
|
* See AwtWin32GraphicsDevice::ScaleDownX() and ::ScaleDownY()
|
||||||
|
*/
|
||||||
|
private Point scaleDown( int x, int y ) {
|
||||||
|
GraphicsConfiguration gc = window.getGraphicsConfiguration();
|
||||||
|
if( gc == null )
|
||||||
|
return new Point( x, y );
|
||||||
|
|
||||||
|
AffineTransform t = gc.getDefaultTransform();
|
||||||
|
return new Point( clipRound( x / t.getScaleX() ), clipRound( y / t.getScaleY() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rounds in the same way as AWT.
|
||||||
|
* See AwtWin32GraphicsDevice::ClipRound()
|
||||||
|
*/
|
||||||
|
private int clipRound( double value ) {
|
||||||
|
value -= 0.5;
|
||||||
|
if( value < Integer.MIN_VALUE )
|
||||||
|
return Integer.MIN_VALUE;
|
||||||
|
if( value > Integer.MAX_VALUE )
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
return (int) Math.ceil( value );
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFullscreen() {
|
||||||
|
GraphicsConfiguration gc = window.getGraphicsConfiguration();
|
||||||
|
if( gc == null )
|
||||||
|
return false;
|
||||||
|
return gc.getDevice().getFullScreenWindow() == window;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same implementation as GET_X_LPARAM(lp) macro in windowsx.h.
|
||||||
|
* X-coordinate is in the low-order short and may be negative.
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest#remarks
|
||||||
|
*/
|
||||||
|
private int GET_X_LPARAM( LPARAM lParam ) {
|
||||||
|
return (short) (lParam.longValue() & 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same implementation as GET_Y_LPARAM(lp) macro in windowsx.h.
|
||||||
|
* Y-coordinate is in the high-order short and may be negative.
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest#remarks
|
||||||
|
*/
|
||||||
|
private int GET_Y_LPARAM( LPARAM lParam ) {
|
||||||
|
return (short) ((lParam.longValue() >> 16) & 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the window's system menu.
|
||||||
|
* The system menu is the menu that opens when the user presses Alt+Space or
|
||||||
|
* right clicks on the title bar
|
||||||
|
*/
|
||||||
|
private void openSystemMenu( HWND hwnd, int x, int y ) {
|
||||||
|
// get system menu
|
||||||
|
HMENU systemMenu = User32Ex.INSTANCE.GetSystemMenu( hwnd, false );
|
||||||
|
|
||||||
|
// update system menu
|
||||||
|
int style = User32.INSTANCE.GetWindowLong( hwnd, GWL_STYLE );
|
||||||
|
boolean isMaximized = User32Ex.INSTANCE.IsZoomed( hwnd );
|
||||||
|
setMenuItemState( systemMenu, SC_RESTORE, isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_MOVE, !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_SIZE, (style & WS_THICKFRAME) != 0 && !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_MINIMIZE, (style & WS_MINIMIZEBOX) != 0 );
|
||||||
|
setMenuItemState( systemMenu, SC_MAXIMIZE, (style & WS_MAXIMIZEBOX) != 0 && !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_CLOSE, true );
|
||||||
|
|
||||||
|
// make "Close" item the default to be consistent with the system menu shown
|
||||||
|
// when pressing Alt+Space
|
||||||
|
User32Ex.INSTANCE.SetMenuDefaultItem( systemMenu, SC_CLOSE, 0 );
|
||||||
|
|
||||||
|
// show system menu
|
||||||
|
int ret = User32Ex.INSTANCE.TrackPopupMenu( systemMenu, TPM_RETURNCMD,
|
||||||
|
x, y, 0, hwnd, null ).intValue();
|
||||||
|
if( ret != 0 )
|
||||||
|
User32Ex.INSTANCE.PostMessage( hwnd, WM_SYSCOMMAND, new WPARAM( ret ), null );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setMenuItemState( HMENU systemMenu, int item, boolean enabled ) {
|
||||||
|
MENUITEMINFO mii = new MENUITEMINFO();
|
||||||
|
mii.cbSize = new UINT( mii.size() );
|
||||||
|
mii.fMask = new UINT( MIIM_STATE );
|
||||||
|
mii.fType = new UINT( MFT_STRING );
|
||||||
|
mii.fState = new UINT( enabled ? MF_ENABLED : MF_DISABLED );
|
||||||
|
User32Ex.INSTANCE.SetMenuItemInfo( systemMenu, item, false, mii );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- interface User32Ex -------------------------------------------------
|
||||||
|
|
||||||
|
private interface User32Ex
|
||||||
|
extends User32
|
||||||
|
{
|
||||||
|
User32Ex INSTANCE = Native.load( "user32", User32Ex.class, W32APIOptions.DEFAULT_OPTIONS );
|
||||||
|
|
||||||
|
LONG_PTR SetWindowLongPtr( HWND hWnd, int nIndex, WindowProc wndProc );
|
||||||
|
LONG_PTR SetWindowLongPtr( HWND hWnd, int nIndex, LONG_PTR wndProc );
|
||||||
|
LONG_PTR SetWindowLong( HWND hWnd, int nIndex, WindowProc wndProc );
|
||||||
|
LONG_PTR SetWindowLong( HWND hWnd, int nIndex, LONG_PTR wndProc );
|
||||||
|
LRESULT CallWindowProc( LONG_PTR lpPrevWndFunc, HWND hWnd, int uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
|
||||||
|
int GetDpiForWindow( HWND hwnd );
|
||||||
|
int GetSystemMetricsForDpi( int nIndex, int dpi );
|
||||||
|
|
||||||
|
boolean IsZoomed( HWND hWnd );
|
||||||
|
HANDLE GetProp( HWND hWnd, String lpString );
|
||||||
|
|
||||||
|
HMENU GetSystemMenu( HWND hWnd, boolean bRevert );
|
||||||
|
boolean SetMenuItemInfo( HMENU hmenu, int item, boolean fByPositon, MENUITEMINFO lpmii );
|
||||||
|
boolean SetMenuDefaultItem( HMENU hMenu, int uItem, int fByPos );
|
||||||
|
BOOL TrackPopupMenu( HMENU hMenu, int uFlags, int x, int y, int nReserved, HWND hWnd, RECT prcRect );
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class NCCALCSIZE_PARAMS --------------------------------------------
|
||||||
|
|
||||||
|
@FieldOrder( { "rgrc" } )
|
||||||
|
public static class NCCALCSIZE_PARAMS
|
||||||
|
extends Structure
|
||||||
|
{
|
||||||
|
// real structure contains 3 rectangles, but only first one is needed here
|
||||||
|
public RECT[] rgrc = new RECT[1];
|
||||||
|
// public WINDOWPOS lppos;
|
||||||
|
|
||||||
|
public NCCALCSIZE_PARAMS( Pointer pointer ) {
|
||||||
|
super( pointer );
|
||||||
|
read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class MENUITEMINFO -------------------------------------------------
|
||||||
|
|
||||||
|
@FieldOrder( { "cbSize", "fMask", "fType", "fState", "wID", "hSubMenu",
|
||||||
|
"hbmpChecked", "hbmpUnchecked", "dwItemData", "dwTypeData", "cch", "hbmpItem" } )
|
||||||
|
public static class MENUITEMINFO
|
||||||
|
extends Structure
|
||||||
|
{
|
||||||
|
public UINT cbSize;
|
||||||
|
public UINT fMask;
|
||||||
|
public UINT fType;
|
||||||
|
public UINT fState;
|
||||||
|
public UINT wID;
|
||||||
|
public HMENU hSubMenu;
|
||||||
|
public HBITMAP hbmpChecked;
|
||||||
|
public HBITMAP hbmpUnchecked;
|
||||||
|
public ULONG_PTR dwItemData;
|
||||||
|
public LPWSTR dwTypeData;
|
||||||
|
public UINT cch;
|
||||||
|
public HBITMAP hbmpItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
flatlaf-natives/flatlaf-natives-windows/README.md
Normal file
17
flatlaf-natives/flatlaf-natives-windows/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FlatLaf Windows 10 Native Library
|
||||||
|
=================================
|
||||||
|
|
||||||
|
This sub-project contains the source code for the FlatLaf Windows 10 native
|
||||||
|
library (DLL).
|
||||||
|
|
||||||
|
The native library can be built only on Windows and requires a C++ compiler.
|
||||||
|
Tested only with Microsoft Visual C++ 2019 (comes with Visual Studio 2019).
|
||||||
|
|
||||||
|
To be able to build FlatLaf on any platform, and without C++ compiler, the
|
||||||
|
pre-built DLL is checked into Git at
|
||||||
|
[flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/](https://github.com/JFormDesigner/FlatLaf/tree/main/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives).
|
||||||
|
|
||||||
|
The DLL was built on a GitHub server with the help of GitHub Actions. See:
|
||||||
|
[Native Libraries](https://github.com/JFormDesigner/FlatLaf/actions/workflows/natives.yml)
|
||||||
|
workflow. Then the produced Artifacts ZIP was downloaded and the DLL checked
|
||||||
|
into Git.
|
||||||
99
flatlaf-natives/flatlaf-natives-windows/build.gradle.kts
Normal file
99
flatlaf-natives/flatlaf-natives-windows/build.gradle.kts
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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 {
|
||||||
|
id( "dev.nokee.jni-library" ) version "0.4.0"
|
||||||
|
id( "dev.nokee.cpp-language" ) version "0.4.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
library {
|
||||||
|
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64 ) )
|
||||||
|
|
||||||
|
variants.configureEach {
|
||||||
|
sharedLibrary {
|
||||||
|
compileTasks.configureEach {
|
||||||
|
onlyIf { isBuildable }
|
||||||
|
|
||||||
|
// depend on :flatlaf-core:compileJava because it generates the JNI headers
|
||||||
|
dependsOn( ":flatlaf-core:compileJava" )
|
||||||
|
|
||||||
|
doFirst {
|
||||||
|
println( "Used Tool Chain:" )
|
||||||
|
println( " - ${toolChain.get()}" )
|
||||||
|
println( "Available Tool Chains:" )
|
||||||
|
toolChains.forEach {
|
||||||
|
println( " - $it" )
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy needed JNI headers
|
||||||
|
copy {
|
||||||
|
from( project( ":flatlaf-core" ).buildDir.resolve( "generated/jni-headers" ) )
|
||||||
|
into( "src/main/headers" )
|
||||||
|
include(
|
||||||
|
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h",
|
||||||
|
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
|
||||||
|
)
|
||||||
|
filter<org.apache.tools.ant.filters.FixCrLfFilter>(
|
||||||
|
"eol" to org.apache.tools.ant.filters.FixCrLfFilter.CrLf.newInstance( "lf" )
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compilerArgs.addAll( toolChain.map {
|
||||||
|
when( it ) {
|
||||||
|
is Gcc, is Clang -> listOf( "-O2" )
|
||||||
|
is VisualCpp -> listOf( "/O2", "/Zl", "/GS-" )
|
||||||
|
else -> emptyList()
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
}
|
||||||
|
|
||||||
|
linkTask.configure {
|
||||||
|
onlyIf { isBuildable }
|
||||||
|
|
||||||
|
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
||||||
|
val is64Bit = targetMachine.architecture.is64Bit
|
||||||
|
val libraryName = if( is64Bit ) "flatlaf-windows-x86_64.dll" else "flatlaf-windows-x86.dll"
|
||||||
|
val jawt = if( is64Bit ) "lib/jawt-x86_64" else "lib/jawt-x86"
|
||||||
|
|
||||||
|
outputs.file( "$nativesDir/$libraryName" )
|
||||||
|
|
||||||
|
linkerArgs.addAll( toolChain.map {
|
||||||
|
when( it ) {
|
||||||
|
is Gcc, is Clang -> listOf( "-l${jawt}", "-lUser32", "-lshell32", "-lAdvAPI32", "-lKernel32" )
|
||||||
|
is VisualCpp -> listOf( "${jawt}.lib", "User32.lib", "shell32.lib", "AdvAPI32.lib", "Kernel32.lib", "/NODEFAULTLIB" )
|
||||||
|
else -> emptyList()
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
// copy shared library to flatlaf-core resources
|
||||||
|
copy {
|
||||||
|
from( linkedFile )
|
||||||
|
into( nativesDir )
|
||||||
|
rename( "flatlaf-natives-windows.dll", libraryName )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( taskName in listOf( "jarX86", "jarX86-64" ) ) {
|
||||||
|
tasks.named( taskName ) {
|
||||||
|
onlyIf { false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
flatlaf-natives/flatlaf-natives-windows/lib/README.md
Normal file
6
flatlaf-natives/flatlaf-natives-windows/lib/README.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Contains libraries used to compile FlatLaf Windows 10 native libraries (DLLs).
|
||||||
|
|
||||||
|
- `jawt-x86.lib` is `<jdk>/lib/jawt.lib` from AdoptOpenJDK jdk8u282-b08 32-bit,
|
||||||
|
which is required to build 32-bit DLL
|
||||||
|
- `jawt-x86_64.lib` is `<jdk>/lib/jawt.lib` from AdoptOpenJDK jdk8u282-b08
|
||||||
|
64-bit, which is required to build 64-bit DLL
|
||||||
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86.lib
Normal file
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86.lib
Normal file
Binary file not shown.
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86_64.lib
Normal file
BIN
flatlaf-natives/flatlaf-natives-windows/lib/jawt-x86_64.lib
Normal file
Binary file not shown.
@@ -0,0 +1,409 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// avoid inlining of printf()
|
||||||
|
#define _NO_CRT_STDIO_INLINE
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <windowsx.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#include <jawt.h>
|
||||||
|
#include <jawt_md.h>
|
||||||
|
#include "FlatWndProc.h"
|
||||||
|
#include "com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---- JNI methods ------------------------------------------------------------
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_00024WndProc_installImpl
|
||||||
|
( JNIEnv *env, jobject obj, jobject window )
|
||||||
|
{
|
||||||
|
return reinterpret_cast<jlong>( FlatWndProc::install( env, obj, window ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_00024WndProc_uninstallImpl
|
||||||
|
( JNIEnv* env, jobject obj, jlong hwnd )
|
||||||
|
{
|
||||||
|
FlatWndProc::uninstall( env, obj, reinterpret_cast<HWND>( hwnd ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
//---- class FlatWndProc fields -----------------------------------------------
|
||||||
|
|
||||||
|
int FlatWndProc::initialized = 0;
|
||||||
|
jmethodID FlatWndProc::onNcHitTestMID;
|
||||||
|
jmethodID FlatWndProc::isFullscreenMID;
|
||||||
|
jmethodID FlatWndProc::fireStateChangedLaterOnceMID;
|
||||||
|
|
||||||
|
HWNDMap* FlatWndProc::hwndMap;
|
||||||
|
|
||||||
|
//---- class FlatWndProc methods ----------------------------------------------
|
||||||
|
|
||||||
|
FlatWndProc::FlatWndProc() {
|
||||||
|
jvm = NULL;
|
||||||
|
env = NULL;
|
||||||
|
obj = NULL;
|
||||||
|
hwnd = NULL;
|
||||||
|
defaultWndProc = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
HWND FlatWndProc::install( JNIEnv *env, jobject obj, jobject window ) {
|
||||||
|
initIDs( env, obj );
|
||||||
|
|
||||||
|
if( initialized < 0 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// create HWND map
|
||||||
|
if( hwndMap == NULL )
|
||||||
|
hwndMap = new HWNDMap();
|
||||||
|
|
||||||
|
// get window handle
|
||||||
|
HWND hwnd = getWindowHandle( env, window );
|
||||||
|
if( hwnd == NULL || hwndMap->get( hwnd ) != NULL )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
FlatWndProc* fwp = new FlatWndProc();
|
||||||
|
env->GetJavaVM( &fwp->jvm );
|
||||||
|
fwp->obj = env->NewGlobalRef( obj );
|
||||||
|
fwp->hwnd = hwnd;
|
||||||
|
hwndMap->put( hwnd, fwp );
|
||||||
|
|
||||||
|
// replace window procedure
|
||||||
|
fwp->defaultWndProc = reinterpret_cast<WNDPROC>(
|
||||||
|
::SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR) FlatWndProc::StaticWindowProc ) );
|
||||||
|
|
||||||
|
// remove the OS window title bar
|
||||||
|
fwp->updateFrame();
|
||||||
|
|
||||||
|
return hwnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlatWndProc::uninstall( JNIEnv *env, jobject obj, HWND hwnd ) {
|
||||||
|
if( hwnd == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
FlatWndProc* fwp = (FlatWndProc*) hwndMap->get( hwnd );
|
||||||
|
if( fwp == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
hwndMap->remove( hwnd );
|
||||||
|
|
||||||
|
// restore original window procedure
|
||||||
|
::SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR) fwp->defaultWndProc );
|
||||||
|
|
||||||
|
// show the OS window title bar
|
||||||
|
fwp->updateFrame();
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
env->DeleteGlobalRef( fwp->obj );
|
||||||
|
delete fwp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlatWndProc::initIDs( JNIEnv *env, jobject obj ) {
|
||||||
|
if( initialized )
|
||||||
|
return;
|
||||||
|
|
||||||
|
initialized = -1;
|
||||||
|
|
||||||
|
jclass cls = env->GetObjectClass( obj );
|
||||||
|
onNcHitTestMID = env->GetMethodID( cls, "onNcHitTest", "(IIZ)I" );
|
||||||
|
isFullscreenMID = env->GetMethodID( cls, "isFullscreen", "()Z" );
|
||||||
|
fireStateChangedLaterOnceMID = env->GetMethodID( cls, "fireStateChangedLaterOnce", "()V" );
|
||||||
|
|
||||||
|
// check whether all IDs were found
|
||||||
|
if( onNcHitTestMID != NULL &&
|
||||||
|
isFullscreenMID != NULL &&
|
||||||
|
fireStateChangedLaterOnceMID != NULL )
|
||||||
|
initialized = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlatWndProc::updateFrame() {
|
||||||
|
// this sends WM_NCCALCSIZE and removes/shows the window title bar
|
||||||
|
::SetWindowPos( hwnd, hwnd, 0, 0, 0, 0,
|
||||||
|
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER );
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT CALLBACK FlatWndProc::StaticWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
FlatWndProc* fwp = (FlatWndProc*) hwndMap->get( hwnd );
|
||||||
|
return fwp->WindowProc( hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: This method is invoked on the AWT-Windows thread (not the AWT-EventQueue thread).
|
||||||
|
*/
|
||||||
|
LRESULT CALLBACK FlatWndProc::WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
switch( uMsg ) {
|
||||||
|
case WM_NCCALCSIZE:
|
||||||
|
return WmNcCalcSize( hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
case WM_NCHITTEST:
|
||||||
|
return WmNcHitTest( hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
case WM_NCRBUTTONUP:
|
||||||
|
if( wParam == HTCAPTION || wParam == HTSYSMENU )
|
||||||
|
openSystemMenu( hwnd, GET_X_LPARAM( lParam ), GET_Y_LPARAM( lParam ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DWMCOLORIZATIONCOLORCHANGED:
|
||||||
|
fireStateChangedLaterOnce();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
return WmDestroy( hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
return ::CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Handle WM_DESTROY
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-destroy
|
||||||
|
*/
|
||||||
|
LRESULT FlatWndProc::WmDestroy( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
// restore original window procedure
|
||||||
|
::SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR) defaultWndProc );
|
||||||
|
|
||||||
|
WNDPROC defaultWndProc2 = defaultWndProc;
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
getEnv()->DeleteGlobalRef( obj );
|
||||||
|
hwndMap->remove( hwnd );
|
||||||
|
delete this;
|
||||||
|
|
||||||
|
// call original AWT window procedure because it may fire window closed event in AwtWindow::WmDestroy()
|
||||||
|
return ::CallWindowProc( defaultWndProc2, hwnd, uMsg, wParam, lParam );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle WM_NCCALCSIZE
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-nccalcsize
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_OnNcCalcSize() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
LRESULT FlatWndProc::WmNcCalcSize( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
if( wParam != TRUE )
|
||||||
|
return ::CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
NCCALCSIZE_PARAMS* params = reinterpret_cast<NCCALCSIZE_PARAMS*>( lParam );
|
||||||
|
|
||||||
|
// store the original top before the default window proc applies the default frame
|
||||||
|
int originalTop = params->rgrc[0].top;
|
||||||
|
|
||||||
|
// apply the default frame
|
||||||
|
LRESULT lResult = ::CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
if( lResult != 0 )
|
||||||
|
return lResult;
|
||||||
|
|
||||||
|
// re-apply the original top from before the size of the default frame was applied
|
||||||
|
params->rgrc[0].top = originalTop;
|
||||||
|
|
||||||
|
bool isMaximized = ::IsZoomed( hwnd );
|
||||||
|
if( isMaximized && !isFullscreen() ) {
|
||||||
|
// When a window is maximized, its size is actually a little bit more
|
||||||
|
// than the monitor's work area. The window is positioned and sized in
|
||||||
|
// such a way that the resize handles are outside of the monitor and
|
||||||
|
// then the window is clipped to the monitor so that the resize handle
|
||||||
|
// do not appear because you don't need them (because you can't resize
|
||||||
|
// a window when it's maximized unless you restore it).
|
||||||
|
params->rgrc[0].top += getResizeHandleHeight();
|
||||||
|
|
||||||
|
// check whether taskbar is in the autohide state
|
||||||
|
APPBARDATA autohide{ 0 };
|
||||||
|
autohide.cbSize = sizeof( autohide );
|
||||||
|
UINT state = (UINT) ::SHAppBarMessage( ABM_GETSTATE, &autohide );
|
||||||
|
if( (state & ABS_AUTOHIDE) != 0 ) {
|
||||||
|
// get monitor info
|
||||||
|
// (using MONITOR_DEFAULTTONEAREST finds right monitor when restoring from minimized)
|
||||||
|
HMONITOR hMonitor = ::MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST );
|
||||||
|
MONITORINFO monitorInfo{ 0 };
|
||||||
|
::GetMonitorInfo( hMonitor, &monitorInfo );
|
||||||
|
|
||||||
|
// If there's a taskbar on any side of the monitor, reduce our size
|
||||||
|
// a little bit on that edge.
|
||||||
|
if( hasAutohideTaskbar( ABE_TOP, monitorInfo.rcMonitor ) )
|
||||||
|
params->rgrc[0].top++;
|
||||||
|
if( hasAutohideTaskbar( ABE_BOTTOM, monitorInfo.rcMonitor ) )
|
||||||
|
params->rgrc[0].bottom--;
|
||||||
|
if( hasAutohideTaskbar( ABE_LEFT, monitorInfo.rcMonitor ) )
|
||||||
|
params->rgrc[0].left++;
|
||||||
|
if( hasAutohideTaskbar( ABE_RIGHT, monitorInfo.rcMonitor ) )
|
||||||
|
params->rgrc[0].right--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle WM_NCHITTEST
|
||||||
|
*
|
||||||
|
* https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_OnNcHitTest() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
LRESULT FlatWndProc::WmNcHitTest( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam ) {
|
||||||
|
// this will handle the left, right and bottom parts of the frame because we didn't change them
|
||||||
|
LRESULT lResult = ::CallWindowProc( defaultWndProc, hwnd, uMsg, wParam, lParam );
|
||||||
|
if( lResult != HTCLIENT )
|
||||||
|
return lResult;
|
||||||
|
|
||||||
|
// get window rectangle needed to convert mouse x/y from screen to window coordinates
|
||||||
|
RECT rcWindow;
|
||||||
|
::GetWindowRect( hwnd, &rcWindow );
|
||||||
|
|
||||||
|
// get mouse x/y in window coordinates
|
||||||
|
int x = GET_X_LPARAM( lParam ) - rcWindow.left;
|
||||||
|
int y = GET_Y_LPARAM( lParam ) - rcWindow.top;
|
||||||
|
|
||||||
|
int resizeBorderHeight = getResizeHandleHeight();
|
||||||
|
bool isOnResizeBorder = (y < resizeBorderHeight) &&
|
||||||
|
(::GetWindowLong( hwnd, GWL_STYLE ) & WS_THICKFRAME) != 0;
|
||||||
|
|
||||||
|
return onNcHitTest( x, y, isOnResizeBorder );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the height of the little space at the top of the window used to
|
||||||
|
* resize the window.
|
||||||
|
*
|
||||||
|
* See also NonClientIslandWindow::_GetResizeHandleHeight() here:
|
||||||
|
* https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
|
||||||
|
*/
|
||||||
|
int FlatWndProc::getResizeHandleHeight() {
|
||||||
|
int dpi = ::GetDpiForWindow( hwnd );
|
||||||
|
|
||||||
|
// there isn't a SM_CYPADDEDBORDER for the Y axis
|
||||||
|
return ::GetSystemMetricsForDpi( SM_CXPADDEDBORDER, dpi )
|
||||||
|
+ ::GetSystemMetricsForDpi( SM_CYSIZEFRAME, dpi );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether there is an autohide taskbar on the given edge.
|
||||||
|
*/
|
||||||
|
bool FlatWndProc::hasAutohideTaskbar( UINT edge, RECT rcMonitor ) {
|
||||||
|
APPBARDATA data{ 0 };
|
||||||
|
data.cbSize = sizeof( data );
|
||||||
|
data.uEdge = edge;
|
||||||
|
data.rc = rcMonitor;
|
||||||
|
HWND hTaskbar = (HWND) ::SHAppBarMessage( ABM_GETAUTOHIDEBAREX, &data );
|
||||||
|
return hTaskbar != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL FlatWndProc::isFullscreen() {
|
||||||
|
JNIEnv* env = getEnv();
|
||||||
|
if( env == NULL )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return env->CallBooleanMethod( obj, isFullscreenMID );
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlatWndProc::onNcHitTest( int x, int y, boolean isOnResizeBorder ) {
|
||||||
|
JNIEnv* env = getEnv();
|
||||||
|
if( env == NULL )
|
||||||
|
return isOnResizeBorder ? HTTOP : HTCLIENT;
|
||||||
|
|
||||||
|
return env->CallIntMethod( obj, onNcHitTestMID, (jint) x, (jint) y, (jboolean) isOnResizeBorder );
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlatWndProc::fireStateChangedLaterOnce() {
|
||||||
|
JNIEnv* env = getEnv();
|
||||||
|
if( env == NULL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
env->CallVoidMethod( obj, fireStateChangedLaterOnceMID );
|
||||||
|
}
|
||||||
|
|
||||||
|
// similar to JNU_GetEnv() in jni_util.c
|
||||||
|
JNIEnv* FlatWndProc::getEnv() {
|
||||||
|
if( env != NULL )
|
||||||
|
return env;
|
||||||
|
|
||||||
|
jvm->GetEnv( (void **) &env, JNI_VERSION_1_2 );
|
||||||
|
return env;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the window's system menu.
|
||||||
|
* The system menu is the menu that opens when the user presses Alt+Space or
|
||||||
|
* right clicks on the title bar
|
||||||
|
*/
|
||||||
|
void FlatWndProc::openSystemMenu( HWND hwnd, int x, int y ) {
|
||||||
|
// get system menu
|
||||||
|
HMENU systemMenu = ::GetSystemMenu( hwnd, false );
|
||||||
|
|
||||||
|
// update system menu
|
||||||
|
LONG style = ::GetWindowLong( hwnd, GWL_STYLE );
|
||||||
|
bool isMaximized = ::IsZoomed( hwnd );
|
||||||
|
setMenuItemState( systemMenu, SC_RESTORE, isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_MOVE, !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_SIZE, (style & WS_THICKFRAME) != 0 && !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_MINIMIZE, (style & WS_MINIMIZEBOX) != 0 );
|
||||||
|
setMenuItemState( systemMenu, SC_MAXIMIZE, (style & WS_MAXIMIZEBOX) != 0 && !isMaximized );
|
||||||
|
setMenuItemState( systemMenu, SC_CLOSE, true );
|
||||||
|
|
||||||
|
// make "Close" item the default to be consistent with the system menu shown
|
||||||
|
// when pressing Alt+Space
|
||||||
|
::SetMenuDefaultItem( systemMenu, SC_CLOSE, 0 );
|
||||||
|
|
||||||
|
// show system menu
|
||||||
|
int ret = ::TrackPopupMenu( systemMenu, TPM_RETURNCMD, x, y, 0, hwnd, nullptr );
|
||||||
|
if( ret != 0 )
|
||||||
|
::PostMessage( hwnd, WM_SYSCOMMAND, ret, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlatWndProc::setMenuItemState( HMENU systemMenu, int item, bool enabled ) {
|
||||||
|
MENUITEMINFO mii{ 0 };
|
||||||
|
mii.cbSize = sizeof( mii );
|
||||||
|
mii.fMask = MIIM_STATE;
|
||||||
|
mii.fType = MFT_STRING;
|
||||||
|
mii.fState = enabled ? MF_ENABLED : MF_DISABLED;
|
||||||
|
::SetMenuItemInfo( systemMenu, item, FALSE, &mii );
|
||||||
|
}
|
||||||
|
|
||||||
|
HWND FlatWndProc::getWindowHandle( JNIEnv* env, jobject window ) {
|
||||||
|
JAWT awt;
|
||||||
|
awt.version = JAWT_VERSION_1_4;
|
||||||
|
if( !JAWT_GetAWT( env, &awt ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
jawt_DrawingSurface* ds = awt.GetDrawingSurface( env, window );
|
||||||
|
if( ds == NULL )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
jint lock = ds->Lock( ds );
|
||||||
|
if( (lock & JAWT_LOCK_ERROR) != 0 ) {
|
||||||
|
awt.FreeDrawingSurface( ds );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
JAWT_DrawingSurfaceInfo* dsi = ds->GetDrawingSurfaceInfo( ds );
|
||||||
|
JAWT_Win32DrawingSurfaceInfo* wdsi = (JAWT_Win32DrawingSurfaceInfo*) dsi->platformInfo;
|
||||||
|
|
||||||
|
HWND hwnd = wdsi->hwnd;
|
||||||
|
|
||||||
|
ds->FreeDrawingSurfaceInfo( dsi );
|
||||||
|
ds->Unlock( ds );
|
||||||
|
awt.FreeDrawingSurface( ds );
|
||||||
|
|
||||||
|
return hwnd;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include "HWNDMap.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
class FlatWndProc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static HWND install( JNIEnv *env, jobject obj, jobject window );
|
||||||
|
static void uninstall( JNIEnv *env, jobject obj, HWND hwnd );
|
||||||
|
|
||||||
|
private:
|
||||||
|
static int initialized;
|
||||||
|
static jmethodID onNcHitTestMID;
|
||||||
|
static jmethodID isFullscreenMID;
|
||||||
|
static jmethodID fireStateChangedLaterOnceMID;
|
||||||
|
|
||||||
|
static HWNDMap* hwndMap;
|
||||||
|
|
||||||
|
JavaVM* jvm;
|
||||||
|
JNIEnv* env; // attached to AWT-Windows/Win32 thread
|
||||||
|
jobject obj;
|
||||||
|
HWND hwnd;
|
||||||
|
WNDPROC defaultWndProc;
|
||||||
|
|
||||||
|
FlatWndProc();
|
||||||
|
static void initIDs( JNIEnv *env, jobject obj );
|
||||||
|
void updateFrame();
|
||||||
|
|
||||||
|
static LRESULT CALLBACK StaticWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
LRESULT WmDestroy( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
LRESULT WmNcCalcSize( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
LRESULT WmNcHitTest( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam );
|
||||||
|
|
||||||
|
int getResizeHandleHeight();
|
||||||
|
bool hasAutohideTaskbar( UINT edge, RECT rcMonitor );
|
||||||
|
BOOL isFullscreen();
|
||||||
|
int onNcHitTest( int x, int y, boolean isOnResizeBorder );
|
||||||
|
void fireStateChangedLaterOnce();
|
||||||
|
JNIEnv* getEnv();
|
||||||
|
|
||||||
|
void openSystemMenu( HWND hwnd, int x, int y );
|
||||||
|
void setMenuItemState( HMENU systemMenu, int item, bool enabled );
|
||||||
|
|
||||||
|
static HWND getWindowHandle( JNIEnv* env, jobject window );
|
||||||
|
};
|
||||||
153
flatlaf-natives/flatlaf-natives-windows/src/main/cpp/HWNDMap.cpp
Normal file
153
flatlaf-natives/flatlaf-natives-windows/src/main/cpp/HWNDMap.cpp
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// avoid inlining of printf()
|
||||||
|
#define _NO_CRT_STDIO_INLINE
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "HWNDMap.h"
|
||||||
|
|
||||||
|
#define DEFAULT_CAPACITY 20
|
||||||
|
#define INCREASE_CAPACITY 10
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
|
||||||
|
class LOCK {
|
||||||
|
LPCRITICAL_SECTION lpCriticalSection;
|
||||||
|
|
||||||
|
public:
|
||||||
|
LOCK( LPCRITICAL_SECTION lpCriticalSection ) {
|
||||||
|
this->lpCriticalSection = lpCriticalSection;
|
||||||
|
::EnterCriticalSection( lpCriticalSection );
|
||||||
|
}
|
||||||
|
~LOCK() {
|
||||||
|
::LeaveCriticalSection( lpCriticalSection );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
HWNDMap::HWNDMap() {
|
||||||
|
size = 0;
|
||||||
|
capacity = DEFAULT_CAPACITY;
|
||||||
|
table = new Entry[capacity];
|
||||||
|
|
||||||
|
::InitializeCriticalSection( &criticalSection );
|
||||||
|
|
||||||
|
// dump( "<init>" );
|
||||||
|
}
|
||||||
|
|
||||||
|
LPVOID HWNDMap::get( HWND key ) {
|
||||||
|
LOCK lock( &criticalSection );
|
||||||
|
|
||||||
|
int index = binarySearch( key );
|
||||||
|
return (index >= 0) ? table[index].value : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HWNDMap::put( HWND key, LPVOID value ) {
|
||||||
|
LOCK lock( &criticalSection );
|
||||||
|
|
||||||
|
int index = binarySearch( key );
|
||||||
|
// printf( "put %p %p = %d --\n", key, value, index );
|
||||||
|
if( index >= 0 ) {
|
||||||
|
// key already in map --> replace
|
||||||
|
table[index].value = value;
|
||||||
|
} else {
|
||||||
|
// insert new key
|
||||||
|
ensureCapacity( size + 1 );
|
||||||
|
|
||||||
|
// make roor for new entry
|
||||||
|
index = -(index + 1);
|
||||||
|
for( int i = size - 1; i >= index; i-- )
|
||||||
|
table[i + 1] = table[i];
|
||||||
|
size++;
|
||||||
|
|
||||||
|
// insert entry
|
||||||
|
table[index].key = key;
|
||||||
|
table[index].value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dump( "put" );
|
||||||
|
}
|
||||||
|
|
||||||
|
void HWNDMap::remove( HWND key ) {
|
||||||
|
LOCK lock( &criticalSection );
|
||||||
|
|
||||||
|
// search for key
|
||||||
|
int index = binarySearch( key );
|
||||||
|
// printf( "remove %p = %d --\n", key, index );
|
||||||
|
if( index < 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// remove entry
|
||||||
|
for( int i = index + 1; i < size; i++ )
|
||||||
|
table[i - 1] = table[i];
|
||||||
|
size--;
|
||||||
|
|
||||||
|
// dump( "remove" );
|
||||||
|
}
|
||||||
|
|
||||||
|
int HWNDMap::binarySearch( HWND key ) {
|
||||||
|
int low = 0;
|
||||||
|
int high = size - 1;
|
||||||
|
|
||||||
|
while( low <= high ) {
|
||||||
|
int mid = (low + high) >> 1;
|
||||||
|
|
||||||
|
HWND midKey = table[mid].key;
|
||||||
|
int cmp = midKey - key;
|
||||||
|
if( cmp < 0 )
|
||||||
|
low = mid + 1;
|
||||||
|
else if( cmp > 0 )
|
||||||
|
high = mid - 1;
|
||||||
|
else
|
||||||
|
return mid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -(low + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HWNDMap::ensureCapacity( int minCapacity ) {
|
||||||
|
if( minCapacity <= capacity )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// allocate new table
|
||||||
|
int newCapacity = minCapacity + INCREASE_CAPACITY;
|
||||||
|
Entry* newTable = new Entry[newCapacity];
|
||||||
|
|
||||||
|
// copy old table to new table
|
||||||
|
for( int i = 0; i < capacity; i++ )
|
||||||
|
newTable[i] = table[i];
|
||||||
|
|
||||||
|
// delete old table
|
||||||
|
delete table;
|
||||||
|
|
||||||
|
table = newTable;
|
||||||
|
capacity = newCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void HWNDMap::dump( char* msg ) {
|
||||||
|
printf( "---- %s -----------------------\n", msg );
|
||||||
|
printf( "size %d\n", size );
|
||||||
|
printf( "capacity %d\n", capacity );
|
||||||
|
printf( "table %p\n", table );
|
||||||
|
|
||||||
|
for( int i = 0; i < capacity; i++ )
|
||||||
|
printf( " %d: %p - %p %s\n", i, table[i].key, table[i].value, i >= size ? "UNUSED" : "" );
|
||||||
|
}
|
||||||
|
*/
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple map that uses a sorted array to store key/value pairs.
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct Entry
|
||||||
|
{
|
||||||
|
HWND key;
|
||||||
|
LPVOID value;
|
||||||
|
};
|
||||||
|
|
||||||
|
class HWNDMap
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
int size; // used entries in table
|
||||||
|
int capacity; // total size of table
|
||||||
|
Entry* table;
|
||||||
|
|
||||||
|
// used to synchronize to make it thread safe
|
||||||
|
CRITICAL_SECTION criticalSection;
|
||||||
|
|
||||||
|
public:
|
||||||
|
HWNDMap();
|
||||||
|
|
||||||
|
LPVOID get( HWND key );
|
||||||
|
void put( HWND key, LPVOID value );
|
||||||
|
void remove( HWND key );
|
||||||
|
|
||||||
|
private:
|
||||||
|
int binarySearch( HWND key );
|
||||||
|
void ensureCapacity( int newCapacity );
|
||||||
|
|
||||||
|
// void dump( char* msg );
|
||||||
|
};
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winreg.h>
|
||||||
|
#include <winerror.h>
|
||||||
|
#include <jni.h>
|
||||||
|
#include "com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---- JNI methods ------------------------------------------------------------
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jint JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_registryGetIntValue
|
||||||
|
( JNIEnv* env, jclass cls, jstring key, jstring valueName, jint defaultValue )
|
||||||
|
{
|
||||||
|
const char* skey = env->GetStringUTFChars( key, NULL );
|
||||||
|
const char* svalueName = env->GetStringUTFChars( valueName, NULL );
|
||||||
|
|
||||||
|
DWORD data = 0;
|
||||||
|
DWORD cbData = sizeof( data );
|
||||||
|
int rc = ::RegGetValueA( HKEY_CURRENT_USER, skey, svalueName, RRF_RT_DWORD, NULL, &data, &cbData );
|
||||||
|
|
||||||
|
env->ReleaseStringUTFChars( key, skey );
|
||||||
|
env->ReleaseStringUTFChars( valueName, svalueName );
|
||||||
|
|
||||||
|
return (rc == ERROR_SUCCESS) ? data : defaultValue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// avoid inlining of printf()
|
||||||
|
#define _NO_CRT_STDIO_INLINE
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methods that replace C-runtime methods and allow linking/running without C-runtime.
|
||||||
|
*
|
||||||
|
* WARNING: Constructors/destructors of static objects are not invoked!
|
||||||
|
*
|
||||||
|
* https://documentation.help/Far-Manager/msdnmag-issues-01-01-hood-default.aspx.html
|
||||||
|
* www.catch22.net/tuts/win32/reducing-executable-size#the-c-runtime-and-default-libraries
|
||||||
|
* https://www.mvps.org/user32/nocrt.html
|
||||||
|
*
|
||||||
|
* see also LIBCTINY on "Downloads" page here: http://www.wheaty.net/
|
||||||
|
* or https://github.com/leepa/libctiny
|
||||||
|
*
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
BOOL WINAPI _DllMainCRTStartup( HINSTANCE instance, DWORD reason, LPVOID reserved ) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* __cdecl operator new( size_t cb ) {
|
||||||
|
return ::HeapAlloc( ::GetProcessHeap(), HEAP_ZERO_MEMORY, cb );
|
||||||
|
}
|
||||||
|
|
||||||
|
void* __cdecl operator new[]( size_t cb ) {
|
||||||
|
return ::HeapAlloc( ::GetProcessHeap(), HEAP_ZERO_MEMORY, cb );
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cdecl operator delete( void* pv, size_t cb ) {
|
||||||
|
if( pv != NULL )
|
||||||
|
::HeapFree( ::GetProcessHeap(), 0, pv );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
extern "C"
|
||||||
|
int __cdecl printf( const char* format, ... ) {
|
||||||
|
char szBuff[1024];
|
||||||
|
int retValue;
|
||||||
|
DWORD cbWritten;
|
||||||
|
va_list argptr;
|
||||||
|
|
||||||
|
va_start( argptr, format );
|
||||||
|
retValue = wvsprintfA( szBuff, format, argptr );
|
||||||
|
va_end( argptr );
|
||||||
|
|
||||||
|
WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ), szBuff, retValue, &cbWritten, NULL );
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
*/
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
|
#include <jni.h>
|
||||||
|
/* Header for class com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder */
|
||||||
|
|
||||||
|
#ifndef _Included_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder
|
||||||
|
#define _Included_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Class: com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder
|
||||||
|
* Method: registryGetIntValue
|
||||||
|
* Signature: (Ljava/lang/String;Ljava/lang/String;I)I
|
||||||
|
*/
|
||||||
|
JNIEXPORT jint JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_registryGetIntValue
|
||||||
|
(JNIEnv *, jclass, jstring, jstring, jint);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||||
|
#include <jni.h>
|
||||||
|
/* Header for class com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc */
|
||||||
|
|
||||||
|
#ifndef _Included_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc
|
||||||
|
#define _Included_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
#undef com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTCLIENT
|
||||||
|
#define com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTCLIENT 1L
|
||||||
|
#undef com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTCAPTION
|
||||||
|
#define com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTCAPTION 2L
|
||||||
|
#undef com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTSYSMENU
|
||||||
|
#define com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTSYSMENU 3L
|
||||||
|
#undef com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTTOP
|
||||||
|
#define com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc_HTTOP 12L
|
||||||
|
/*
|
||||||
|
* Class: com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc
|
||||||
|
* Method: installImpl
|
||||||
|
* Signature: (Ljava/awt/Window;)J
|
||||||
|
*/
|
||||||
|
JNIEXPORT jlong JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_00024WndProc_installImpl
|
||||||
|
(JNIEnv *, jobject, jobject);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc
|
||||||
|
* Method: uninstallImpl
|
||||||
|
* Signature: (J)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_00024WndProc_uninstallImpl
|
||||||
|
(JNIEnv *, jobject, jlong);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
@@ -38,3 +38,8 @@ build script:
|
|||||||
Otherwise download `flatlaf-swingx-<version>.jar` here:
|
Otherwise download `flatlaf-swingx-<version>.jar` here:
|
||||||
|
|
||||||
[](https://maven-badges.herokuapp.com/maven-central/com.formdev/flatlaf-swingx)
|
[](https://maven-badges.herokuapp.com/maven-central/com.formdev/flatlaf-swingx)
|
||||||
|
|
||||||
|
|
||||||
|
SwingX library `swingx-all-<version>.jar` is also required:
|
||||||
|
|
||||||
|
[](https://maven-badges.herokuapp.com/maven-central/org.swinglabs.swingx/swingx-all)
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation( project( ":flatlaf-core" ) )
|
implementation( project( ":flatlaf-core" ) )
|
||||||
implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" )
|
|
||||||
|
// use compileOnly() because there are various SwingX libraries available on Maven Central
|
||||||
|
compileOnly( "org.swinglabs.swingx:swingx-all:1.6.5-1" )
|
||||||
}
|
}
|
||||||
|
|
||||||
flatlafModuleInfo {
|
flatlafModuleInfo {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.awt.Shape;
|
|||||||
import javax.swing.SwingConstants;
|
import javax.swing.SwingConstants;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import com.formdev.flatlaf.icons.FlatAbstractIcon;
|
import com.formdev.flatlaf.icons.FlatAbstractIcon;
|
||||||
import com.formdev.flatlaf.ui.FlatArrowButton;
|
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,14 +55,14 @@ public class FlatMonthDownIcon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintIcon( Component c, Graphics2D g ) {
|
protected void paintIcon( Component c, Graphics2D g ) {
|
||||||
int h = chevron ? 4 : 5;
|
int w = chevron ? 4 : 5;
|
||||||
int w = chevron ? 8 : 9;
|
int h = chevron ? 8 : 9;
|
||||||
int x = Math.round( (width - h) / 2f );
|
int x = Math.round( (width - w) / 2f );
|
||||||
int y = Math.round( (height - w) / 2f );
|
int y = Math.round( (height - h) / 2f );
|
||||||
|
|
||||||
g.setColor( c.isEnabled() ? arrowColor : disabledArrowColor );
|
g.setColor( c.isEnabled() ? arrowColor : disabledArrowColor );
|
||||||
g.translate( x, y );
|
g.translate( x, y );
|
||||||
Shape arrowShape = FlatArrowButton.createArrowShape( direction, chevron, w, h );
|
Shape arrowShape = FlatUIUtils.createArrowShape( direction, chevron, w, h );
|
||||||
if( chevron ) {
|
if( chevron ) {
|
||||||
// chevron arrow
|
// chevron arrow
|
||||||
g.setStroke( new BasicStroke( 1f ) );
|
g.setStroke( new BasicStroke( 1f ) );
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import javax.swing.plaf.ComponentUI;
|
|||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import org.jdesktop.swingx.JXTaskPane;
|
import org.jdesktop.swingx.JXTaskPane;
|
||||||
import org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI;
|
import org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI;
|
||||||
import com.formdev.flatlaf.ui.FlatArrowButton;
|
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
@@ -223,7 +222,7 @@ public class FlatTaskPaneUI
|
|||||||
|
|
||||||
// create arrow shape
|
// create arrow shape
|
||||||
int direction = group.isCollapsed() ? SwingConstants.SOUTH : SwingConstants.NORTH;
|
int direction = group.isCollapsed() ? SwingConstants.SOUTH : SwingConstants.NORTH;
|
||||||
Shape arrowShape = FlatArrowButton.createArrowShape( direction, true, cw, ch );
|
Shape arrowShape = FlatUIUtils.createArrowShape( direction, true, cw, ch );
|
||||||
|
|
||||||
// fix position of controls
|
// fix position of controls
|
||||||
x = group.getComponentOrientation().isLeftToRight() ? (group.getWidth() - width - y) : y;
|
x = group.getComponentOrientation().isLeftToRight() ? (group.getWidth() - width - y) : y;
|
||||||
|
|||||||
@@ -32,12 +32,13 @@ dependencies {
|
|||||||
implementation( project( ":flatlaf-jide-oss" ) )
|
implementation( project( ":flatlaf-jide-oss" ) )
|
||||||
implementation( project( ":flatlaf-intellij-themes" ) )
|
implementation( project( ":flatlaf-intellij-themes" ) )
|
||||||
implementation( project( ":flatlaf-demo" ) )
|
implementation( project( ":flatlaf-demo" ) )
|
||||||
|
// implementation( project( ":flatlaf-natives-jna" ) )
|
||||||
|
|
||||||
implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" )
|
implementation( "com.miglayout:miglayout-swing:5.3-SNAPSHOT" )
|
||||||
implementation( "com.jgoodies:jgoodies-forms:1.9.0" )
|
implementation( "com.jgoodies:jgoodies-forms:1.9.0" )
|
||||||
implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" )
|
implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" )
|
||||||
implementation( "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1" )
|
implementation( "org.swinglabs.swingx:swingx-beaninfo:1.6.5-1" )
|
||||||
implementation( "com.jidesoft:jide-oss:3.6.18" )
|
implementation( "com.formdev:jide-oss:3.7.11.1" )
|
||||||
implementation( "com.glazedlists:glazedlists:1.11.0" )
|
implementation( "com.glazedlists:glazedlists:1.11.0" )
|
||||||
implementation( "org.netbeans.api:org-openide-awt:RELEASE112" )
|
implementation( "org.netbeans.api:org-openide-awt:RELEASE112" )
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,28 @@
|
|||||||
- Name FlatLaf Dark
|
- Name FlatLaf Dark
|
||||||
+ Name FlatLaf Darcula
|
+ Name FlatLaf Darcula
|
||||||
|
|
||||||
|
#---- Button ----
|
||||||
|
|
||||||
- Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
- 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.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
||||||
|
|
||||||
- Button.innerFocusWidth 1
|
- Button.innerFocusWidth 1
|
||||||
+ Button.innerFocusWidth 0
|
+ Button.innerFocusWidth 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- CheckBox ----
|
||||||
|
|
||||||
- CheckBox.icon.focusedBackground #466d944d 30% javax.swing.plaf.ColorUIResource [UI]
|
- CheckBox.icon.focusedBackground #466d944d 30% javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ComboBox ----
|
||||||
|
|
||||||
- ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [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]
|
+ ComboBox.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Component ----
|
||||||
|
|
||||||
- Component.arrowType chevron
|
- Component.arrowType chevron
|
||||||
+ Component.arrowType triangle
|
+ Component.arrowType triangle
|
||||||
|
|
||||||
@@ -30,42 +41,74 @@
|
|||||||
- Component.innerOutlineWidth 1.0
|
- Component.innerOutlineWidth 1.0
|
||||||
+ Component.innerOutlineWidth 0
|
+ Component.innerOutlineWidth 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
- FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
- 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]
|
+ FormattedTextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- HelpButton ----
|
||||||
|
|
||||||
- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
||||||
+ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
+ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
||||||
|
|
||||||
- HelpButton.innerFocusWidth 1
|
- HelpButton.innerFocusWidth 1
|
||||||
+ HelpButton.innerFocusWidth 0
|
+ HelpButton.innerFocusWidth 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- JXDatePicker ----
|
||||||
|
|
||||||
- JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [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]
|
+ JXDatePicker.border [lazy] 3,3,3,3 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- PasswordField ----
|
||||||
|
|
||||||
- PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [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]
|
+ PasswordField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ProgressBar ----
|
||||||
|
|
||||||
- ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI]
|
- ProgressBar.foreground #4a88c7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
+ ProgressBar.foreground #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
+ ProgressBar.foreground #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
- ProgressBar.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
- ProgressBar.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
+ ProgressBar.selectionForeground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
+ ProgressBar.selectionForeground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- RadioButton ----
|
||||||
|
|
||||||
- RadioButton.icon.centerDiameter 8
|
- RadioButton.icon.centerDiameter 8
|
||||||
+ RadioButton.icon.centerDiameter 5
|
+ RadioButton.icon.centerDiameter 5
|
||||||
|
|
||||||
|
|
||||||
|
#---- ScrollPane ----
|
||||||
|
|
||||||
- ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [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]
|
+ ScrollPane.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Spinner ----
|
||||||
|
|
||||||
- Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [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]
|
+ Spinner.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Table ----
|
||||||
|
|
||||||
- Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [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]
|
+ Table.scrollPaneBorder [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextField ----
|
||||||
|
|
||||||
- TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [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]
|
+ TextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ToggleButton ----
|
||||||
|
|
||||||
- ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [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]
|
+ ToggleButton.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ Button.default.pressedBackground #3f6796 com.formdev.flatlaf.util.DerivedColo
|
|||||||
Button.defaultButtonFollowsFocus false
|
Button.defaultButtonFollowsFocus false
|
||||||
Button.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
Button.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledSelectedBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse)
|
Button.disabledSelectedBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse)
|
||||||
Button.disabledText #888888 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledText #888888 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI]
|
Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -441,11 +442,50 @@ JXTitledPanel.titleBackground #4c5052 javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JXTitledPanel.titleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
JXTitledPanel.titleForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
JideButton.background #4c5052 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideButton.borderColor #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.darkShadow #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.focusedBackground #4e5355 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1% autoInverse)
|
||||||
|
JideButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.highlight #656a6c com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
|
||||||
|
JideButton.light #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideButton.selectedAndFocusedBackground #565a5d com.formdev.flatlaf.util.DerivedColor [UI] lighten(4% autoInverse)
|
||||||
|
JideButton.selectedBackground #5d6265 com.formdev.flatlaf.util.DerivedColor [UI] lighten(7% autoInverse)
|
||||||
|
JideButton.shadow #5e6060 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.textIconGap [active] 4
|
||||||
|
JideButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
JideLabel.background #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.disabledForeground #888888 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabelUI com.formdev.flatlaf.jideoss.ui.FlatJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
#---- JidePopupMenu ----
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
JideSplitButton.background #4c5052 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideSplitButton.buttonArrowColor #9a9da1 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.buttonDisabledArrowColor #5a5d61 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideSplitButton.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.textIconGap [active] 4
|
||||||
|
JideSplitButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
#---- JideTabbedPane ----
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
JideTabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -1126,6 +1166,8 @@ TitlePane.buttonHoverBackground #484c4f com.formdev.flatlaf.util.DerivedColor
|
|||||||
TitlePane.buttonMaximizedHeight 22
|
TitlePane.buttonMaximizedHeight 22
|
||||||
TitlePane.buttonPressedBackground #616569 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse)
|
TitlePane.buttonPressedBackground #616569 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse)
|
||||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
|
TitlePane.centerTitle false
|
||||||
|
TitlePane.centerTitleIfMenuBarEmbedded true
|
||||||
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.closeHoverForeground #ffffff 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.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
|
||||||
@@ -1133,16 +1175,18 @@ TitlePane.closePressedBackground #e8112399 60% javax.swing.plaf.ColorUIResou
|
|||||||
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.embeddedForeground #959595 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.embeddedForeground #959595 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.foreground #bbbbbb 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.iconMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
||||||
TitlePane.inactiveBackground #303234 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.inactiveBackground #303234 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.inactiveForeground #888888 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.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||||
TitlePane.menuBarEmbedded true
|
TitlePane.menuBarEmbedded true
|
||||||
TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.menuBarTitleGap 20
|
||||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||||
TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
TitlePane.unifiedBackground false
|
||||||
|
TitlePane.useWindowDecorations true
|
||||||
|
|
||||||
|
|
||||||
#---- TitledBorder ----
|
#---- TitledBorder ----
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
- Name FlatLaf Light
|
- Name FlatLaf Light
|
||||||
+ Name FlatLaf IntelliJ
|
+ Name FlatLaf IntelliJ
|
||||||
|
|
||||||
|
#---- Button ----
|
||||||
|
|
||||||
- Button.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
- 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.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
||||||
|
|
||||||
@@ -40,15 +42,24 @@
|
|||||||
|
|
||||||
- Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
- Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- CheckBox ----
|
||||||
|
|
||||||
- CheckBox.icon.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
- CheckBox.icon.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
+ CheckBox.icon.style filled
|
+ CheckBox.icon.style filled
|
||||||
|
|
||||||
- CheckBox.icon[filled].selectedFocusedCheckmarkColor #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
- CheckBox.icon[filled].selectedFocusedCheckmarkColor #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ComboBox ----
|
||||||
|
|
||||||
- ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [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]
|
+ ComboBox.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Component ----
|
||||||
|
|
||||||
- Component.arrowType chevron
|
- Component.arrowType chevron
|
||||||
+ Component.arrowType triangle
|
+ Component.arrowType triangle
|
||||||
|
|
||||||
@@ -61,32 +72,58 @@
|
|||||||
- Component.innerOutlineWidth 1.0
|
- Component.innerOutlineWidth 1.0
|
||||||
+ Component.innerOutlineWidth 0
|
+ Component.innerOutlineWidth 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
- FormattedTextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
- 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]
|
+ FormattedTextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- HelpButton ----
|
||||||
|
|
||||||
- HelpButton.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
- HelpButton.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
- HelpButton.icon [lazy] 22,22 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
||||||
+ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
+ HelpButton.icon [lazy] 26,26 com.formdev.flatlaf.icons.FlatHelpButtonIcon [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JXDatePicker ----
|
||||||
|
|
||||||
- JXDatePicker.border [lazy] 1,1,1,1 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [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]
|
+ JXDatePicker.border [lazy] 3,3,3,3 false com.formdev.flatlaf.swingx.ui.FlatDatePickerBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- PasswordField ----
|
||||||
|
|
||||||
- PasswordField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [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]
|
+ PasswordField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ScrollPane ----
|
||||||
|
|
||||||
- ScrollPane.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [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]
|
+ ScrollPane.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Spinner ----
|
||||||
|
|
||||||
- Spinner.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [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]
|
+ Spinner.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatRoundBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Table ----
|
||||||
|
|
||||||
- Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [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]
|
+ Table.scrollPaneBorder [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextField ----
|
||||||
|
|
||||||
- TextField.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatTextBorder [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]
|
+ TextField.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatTextBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- ToggleButton ----
|
||||||
|
|
||||||
- ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [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]
|
+ ToggleButton.border [lazy] 3,3,3,3 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ Button.default.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColo
|
|||||||
Button.defaultButtonFollowsFocus false
|
Button.defaultButtonFollowsFocus false
|
||||||
Button.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
Button.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledSelectedBackground #dedede com.formdev.flatlaf.util.DerivedColor [UI] darken(13% autoInverse)
|
Button.disabledSelectedBackground #dedede com.formdev.flatlaf.util.DerivedColor [UI] darken(13% autoInverse)
|
||||||
Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -446,11 +447,50 @@ JXTitledPanel.titleBackground #dfdfdf javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JXTitledPanel.titleForeground #222222 javax.swing.plaf.ColorUIResource [UI]
|
JXTitledPanel.titleForeground #222222 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
JideButton.background #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideButton.borderColor #c4c4c4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.darkShadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.focusedBackground #e0e0e0 com.formdev.flatlaf.util.DerivedColor [UI] darken(12% autoInverse)
|
||||||
|
JideButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.highlight #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse)
|
||||||
|
JideButton.light #c4c4c4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideButton.selectedAndFocusedBackground #d9d9d9 com.formdev.flatlaf.util.DerivedColor [UI] darken(15% autoInverse)
|
||||||
|
JideButton.selectedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse)
|
||||||
|
JideButton.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.textIconGap [active] 4
|
||||||
|
JideButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
JideLabel.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabelUI com.formdev.flatlaf.jideoss.ui.FlatJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
#---- JidePopupMenu ----
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
JideSplitButton.background #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideSplitButton.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.buttonDisabledArrowColor #a6a6a6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideSplitButton.selectionForeground #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.textIconGap [active] 4
|
||||||
|
JideSplitButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
#---- JideTabbedPane ----
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
JideTabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.background #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -1131,6 +1171,8 @@ TitlePane.buttonHoverBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor
|
|||||||
TitlePane.buttonMaximizedHeight 22
|
TitlePane.buttonMaximizedHeight 22
|
||||||
TitlePane.buttonPressedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse)
|
TitlePane.buttonPressedBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse)
|
||||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
|
TitlePane.centerTitle false
|
||||||
|
TitlePane.centerTitleIfMenuBarEmbedded true
|
||||||
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.closeHoverForeground #ffffff 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.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
|
||||||
@@ -1138,16 +1180,18 @@ TitlePane.closePressedBackground #e8112399 60% javax.swing.plaf.ColorUIResou
|
|||||||
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.embeddedForeground #595959 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.embeddedForeground #595959 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.foreground #000000 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.iconMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
||||||
TitlePane.inactiveBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.inactiveBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.inactiveForeground #8c8c8c 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.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||||
TitlePane.menuBarEmbedded true
|
TitlePane.menuBarEmbedded true
|
||||||
TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.menuBarTitleGap 20
|
||||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||||
TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
TitlePane.unifiedBackground false
|
||||||
|
TitlePane.useWindowDecorations true
|
||||||
|
|
||||||
|
|
||||||
#---- TitledBorder ----
|
#---- TitledBorder ----
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ BusyLabelUI com.formdev.flatlaf.swingx.ui.FlatBusyLabelUI
|
|||||||
Button.arc 6
|
Button.arc 6
|
||||||
Button.background #ccffcc 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.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI]
|
||||||
|
Button.borderColor #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.borderWidth 1
|
Button.borderWidth 1
|
||||||
Button.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI]
|
Button.darkShadow #696969 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.default.borderWidth 1
|
Button.default.borderWidth 1
|
||||||
@@ -81,6 +82,7 @@ Button.default.startBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
|||||||
Button.defaultButtonFollowsFocus false
|
Button.defaultButtonFollowsFocus false
|
||||||
Button.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBackground #e0e0e0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledBorderColor #000088 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledBorderColor #000088 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
Button.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.disabledText #000088 javax.swing.plaf.ColorUIResource [UI]
|
Button.disabledText #000088 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.endBackground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
Button.endBackground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.endBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
Button.endBorderColor #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -98,6 +100,7 @@ Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [U
|
|||||||
Button.minimumWidth 72
|
Button.minimumWidth 72
|
||||||
Button.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI]
|
Button.pressedBackground #ffc800 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.rollover true
|
Button.rollover true
|
||||||
|
Button.selectedBackground #ffbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
Button.shadow #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.startBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
Button.startBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.startBorderColor #0000ff javax.swing.plaf.ColorUIResource [UI]
|
Button.startBorderColor #0000ff javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -106,6 +109,7 @@ Button.textShiftOffset 0
|
|||||||
Button.toolbar.hoverBackground #ffffff 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.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
Button.toolbar.pressedBackground #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
Button.toolbar.pressedBackground #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
Button.toolbar.selectedBackground #dddddd javax.swing.plaf.ColorUIResource [UI]
|
||||||
Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI]
|
Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
ButtonUI com.formdev.flatlaf.ui.FlatButtonUI
|
ButtonUI com.formdev.flatlaf.ui.FlatButtonUI
|
||||||
|
|
||||||
@@ -434,11 +438,50 @@ JXTitledPanel.titleBackground #ffff00 javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JXTitledPanel.titleForeground #ff00ff javax.swing.plaf.ColorUIResource [UI]
|
JXTitledPanel.titleForeground #ff00ff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
JideButton.background #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideButton.borderColor #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.darkShadow #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.focusedBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.highlight #ffbbbb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.light #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideButton.selectedAndFocusedBackground #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.selectedBackground #dddddd javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.shadow #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideButton.textIconGap [active] 4
|
||||||
|
JideButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
JideLabel.background #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.disabledForeground #000088 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabel.foreground #008800 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideLabelUI com.formdev.flatlaf.jideoss.ui.FlatJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
#---- JidePopupMenu ----
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
JidePopupMenuUI com.formdev.flatlaf.jideoss.ui.FlatJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
JideSplitButton.background #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMarginBorder [UI]
|
||||||
|
JideSplitButton.buttonArrowColor #666666 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.buttonDisabledArrowColor #ababab javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
JideSplitButton.selectionForeground #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
JideSplitButton.textIconGap [active] 4
|
||||||
|
JideSplitButtonUI com.formdev.flatlaf.jideoss.ui.FlatJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
#---- JideTabbedPane ----
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
JideTabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.background #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -1124,22 +1167,26 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
|
|||||||
TitlePane.background #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.background #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.buttonMaximizedHeight 22
|
TitlePane.buttonMaximizedHeight 22
|
||||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
|
TitlePane.centerTitle false
|
||||||
|
TitlePane.centerTitleIfMenuBarEmbedded true
|
||||||
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closeHoverBackground #e81123 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.closeHoverForeground #ffffff 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.closeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowCloseIcon [UI]
|
||||||
TitlePane.closePressedBackground #e8112399 60% javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closePressedBackground #e8112399 60% javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.closePressedForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.foreground #0000ff 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.iconMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
TitlePane.iconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
|
||||||
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
TitlePane.iconifyIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowIconifyIcon [UI]
|
||||||
TitlePane.inactiveBackground #008800 javax.swing.plaf.ColorUIResource [UI]
|
TitlePane.inactiveBackground #008800 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TitlePane.inactiveForeground #ffffff 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.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||||
TitlePane.menuBarEmbedded true
|
TitlePane.menuBarEmbedded true
|
||||||
TitlePane.menuBarMargins 0,8,0,22 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.menuBarTitleGap 20
|
||||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||||
TitlePane.titleMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
|
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
TitlePane.unifiedBackground false
|
||||||
|
TitlePane.useWindowDecorations true
|
||||||
|
|
||||||
|
|
||||||
#---- TitledBorder ----
|
#---- TitledBorder ----
|
||||||
|
|||||||
@@ -0,0 +1,269 @@
|
|||||||
|
#---- ButtonPanel ----
|
||||||
|
|
||||||
|
+ ButtonPanel.buttonGap 6
|
||||||
|
+ ButtonPanel.groupGap 6
|
||||||
|
+ ButtonPanel.minButtonWidth 75
|
||||||
|
+ ButtonPanel.oppositeOrder H
|
||||||
|
+ ButtonPanel.order ACO
|
||||||
|
|
||||||
|
|
||||||
|
#---- Content ----
|
||||||
|
|
||||||
|
+ Content.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Cursor ----
|
||||||
|
|
||||||
|
+ Cursor.delete 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.drag 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragText 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragTextStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.east 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.float 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.horizontal 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.hsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveEast 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveWest 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.north 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.percentage 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.south 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.tab 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vertical 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.west 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
|
||||||
|
|
||||||
|
#---- FolderChooser ----
|
||||||
|
|
||||||
|
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
|
- FormattedTextField.font [lazy] SansSerif plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ FormattedTextField.font SansSerif plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Gripper ----
|
||||||
|
|
||||||
|
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Gripper.painter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ Gripper.size 8
|
||||||
|
+ GripperUI com.jidesoft.plaf.vsnet.VsnetGripperUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- HeaderBox ----
|
||||||
|
|
||||||
|
+ HeaderBox.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ HeaderBoxUI com.jidesoft.plaf.basic.BasicHeaderBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Icon ----
|
||||||
|
|
||||||
|
+ Icon.floating true
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideButton.borderColor [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.darkShadow [active] #696969 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.focusedBackground [active] #cfeafe javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideButton.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideButton.selectedAndFocusedBackground [active] #88caff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.selectedBackground [active] #acdafe javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.shadow [active] #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.textIconGap 4
|
||||||
|
+ JideButton.textShiftOffset 0
|
||||||
|
+ JideButtonUI com.jidesoft.plaf.basic.BasicJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideComboBox ----
|
||||||
|
|
||||||
|
+ JideComboBoxUI com.jidesoft.plaf.basic.BasicJideComboBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
+ JideLabel.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideLabel.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideLabel.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideLabelUI com.jidesoft.plaf.basic.BasicJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
|
+ JidePopupMenuUI com.jidesoft.plaf.windows.WindowsJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopup ----
|
||||||
|
|
||||||
|
+ JidePopupUI com.jidesoft.plaf.basic.BasicJidePopupUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideScrollPane ----
|
||||||
|
|
||||||
|
+ JideScrollPane.border [active] 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideSplitButton.borderPainted false
|
||||||
|
+ JideSplitButton.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitButton.textIconGap 4
|
||||||
|
+ JideSplitButtonUI com.jidesoft.plaf.basic.BasicJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPane ----
|
||||||
|
|
||||||
|
+ JideSplitPane.dividerSize 4
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPaneDivider ----
|
||||||
|
|
||||||
|
+ JideSplitPaneDivider.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.background [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideTabbedPane.buttonMargin 5
|
||||||
|
+ JideTabbedPane.buttonSize 18
|
||||||
|
+ JideTabbedPane.closeButtonAlignment 11
|
||||||
|
+ JideTabbedPane.closeButtonLeftMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMarginHorizonal 3
|
||||||
|
+ JideTabbedPane.closeButtonMarginSize 6
|
||||||
|
+ JideTabbedPane.closeButtonMarginVertical 3
|
||||||
|
+ JideTabbedPane.closeButtonRightMargin 2
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginHorizontal 0
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginVertical 0
|
||||||
|
+ JideTabbedPane.compressedStyleIconMargin 12
|
||||||
|
+ JideTabbedPane.compressedStyleNoIconRectSize 24
|
||||||
|
+ JideTabbedPane.contentBorderInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.darkShadow [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultResizeMode 1
|
||||||
|
+ JideTabbedPane.defaultTabBorderShadowColor #736d63 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultTabColorTheme 3
|
||||||
|
+ JideTabbedPane.defaultTabShape 2
|
||||||
|
+ JideTabbedPane.fitStyleBoundSize 8
|
||||||
|
+ JideTabbedPane.fitStyleFirstTabMargin 4
|
||||||
|
+ JideTabbedPane.fitStyleIconMinWidth 24
|
||||||
|
+ JideTabbedPane.fitStyleTextMinWidth 16
|
||||||
|
+ JideTabbedPane.fixedStyleRectSize 60
|
||||||
|
+ JideTabbedPane.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.gripLeftMargin 4
|
||||||
|
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.iconMargin 5
|
||||||
|
+ JideTabbedPane.ignoreContentBorderInsetsIfNoTabs false
|
||||||
|
+ JideTabbedPane.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.noIconMargin 2
|
||||||
|
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabFont Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.shadow [active] #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.showCloseButtonOnTab false
|
||||||
|
+ JideTabbedPane.showIconOnTab true
|
||||||
|
+ JideTabbedPane.tabAreaBackground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundDk [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundLt [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaInsets 2,4,0,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabInsets 1,4,1,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabListBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabRectPadding 2
|
||||||
|
+ JideTabbedPane.tabRunOverlay 2
|
||||||
|
+ JideTabbedPane.textIconGap 4
|
||||||
|
+ JideTabbedPane.textMarginVertical 4
|
||||||
|
+ JideTabbedPane.textPadding 6
|
||||||
|
+ JideTabbedPane.unselectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPaneUI com.jidesoft.plaf.vsnet.VsnetJideTabbedPaneUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Label ----
|
||||||
|
|
||||||
|
- Label.font [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Label.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- MeterProgressBar ----
|
||||||
|
|
||||||
|
+ MeterProgressBar.background #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellBackground #008000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellLength 2
|
||||||
|
+ MeterProgressBar.cellSpacing 2
|
||||||
|
+ MeterProgressBar.foreground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- RangeSlider ----
|
||||||
|
|
||||||
|
+ RangeSliderUI com.jidesoft.plaf.windows.WindowsRangeSliderUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Resizable ----
|
||||||
|
|
||||||
|
+ Resizable.resizeBorder [active] 4,4,4,4 true com.jidesoft.plaf.vsnet.ResizeFrameBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Spinner ----
|
||||||
|
|
||||||
|
- Spinner.font [lazy] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Spinner.font SansSerif plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- StyledLabel ----
|
||||||
|
|
||||||
|
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextArea ----
|
||||||
|
|
||||||
|
- TextArea.font [lazy] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ TextArea.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextField ----
|
||||||
|
|
||||||
|
- TextField.font [lazy] SansSerif plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ TextField.font SansSerif plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Theme ----
|
||||||
|
|
||||||
|
+ Theme.highContrast [active] false
|
||||||
|
+ Theme.painter [unknown type] java.util.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
#---- ToolBar ----
|
||||||
|
|
||||||
|
- ToolBar.font [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ ToolBar.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- TristateCheckBox ----
|
||||||
|
|
||||||
|
+ TristateCheckBox.icon 13,13 com.jidesoft.plaf.windows.WindowsIconFactory$CheckBoxIcon [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- jidesoft ----
|
||||||
|
|
||||||
|
+ jidesoft.extensionInstalled true
|
||||||
|
+ jidesoft.extensionStyle 0
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.focusInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.focusInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
DOWN downPressed
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released DOWN downReleased
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ctrl KP_UP requestFocus
|
||||||
|
ctrl PAGE_DOWN navigatePageDown
|
||||||
|
ctrl PAGE_UP navigatePageUp
|
||||||
|
ctrl UP requestFocus
|
||||||
|
+ JideTabbedPane.focusInputMap [lazy] 10 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
|
||||||
|
UP navigateUp
|
||||||
182
flatlaf-testing/dumps/uidefaults/JIDE-FlatDarkLaf_1.8.0_202.txt
Normal file
182
flatlaf-testing/dumps/uidefaults/JIDE-FlatDarkLaf_1.8.0_202.txt
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
#---- ButtonPanel ----
|
||||||
|
|
||||||
|
+ ButtonPanel.buttonGap 6
|
||||||
|
+ ButtonPanel.groupGap 6
|
||||||
|
+ ButtonPanel.minButtonWidth 75
|
||||||
|
+ ButtonPanel.oppositeOrder H
|
||||||
|
+ ButtonPanel.order ACO
|
||||||
|
|
||||||
|
|
||||||
|
#---- Content ----
|
||||||
|
|
||||||
|
+ Content.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Cursor ----
|
||||||
|
|
||||||
|
+ Cursor.delete 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.drag 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragText 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragTextStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.east 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.float 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.horizontal 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.hsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveEast 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveWest 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.north 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.percentage 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.south 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.tab 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vertical 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.west 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
|
||||||
|
|
||||||
|
#---- FolderChooser ----
|
||||||
|
|
||||||
|
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Gripper ----
|
||||||
|
|
||||||
|
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Gripper.painter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ Gripper.size 8
|
||||||
|
+ GripperUI com.jidesoft.plaf.vsnet.VsnetGripperUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- HeaderBox ----
|
||||||
|
|
||||||
|
+ HeaderBox.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ HeaderBoxUI com.jidesoft.plaf.basic.BasicHeaderBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Icon ----
|
||||||
|
|
||||||
|
+ Icon.floating false
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.font [active] $defaultFont [UI]
|
||||||
|
+ JideButton.textShiftOffset 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideComboBox ----
|
||||||
|
|
||||||
|
+ JideComboBoxUI com.jidesoft.plaf.basic.BasicJideComboBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
+ JideLabel.font [active] $defaultFont [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopup ----
|
||||||
|
|
||||||
|
+ JidePopupUI com.jidesoft.plaf.basic.BasicJidePopupUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideScrollPane ----
|
||||||
|
|
||||||
|
+ JideScrollPane.border [active] 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.borderPainted false
|
||||||
|
+ JideSplitButton.font [active] $defaultFont [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPane ----
|
||||||
|
|
||||||
|
+ JideSplitPane.dividerSize 4
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPaneDivider ----
|
||||||
|
|
||||||
|
+ JideSplitPaneDivider.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideTabbedPane.buttonMargin 5
|
||||||
|
+ JideTabbedPane.buttonSize 18
|
||||||
|
+ JideTabbedPane.closeButtonAlignment 11
|
||||||
|
+ JideTabbedPane.closeButtonLeftMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMarginHorizonal 3
|
||||||
|
+ JideTabbedPane.closeButtonMarginSize 6
|
||||||
|
+ JideTabbedPane.closeButtonMarginVertical 3
|
||||||
|
+ JideTabbedPane.closeButtonRightMargin 2
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginHorizontal 0
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginVertical 0
|
||||||
|
+ JideTabbedPane.compressedStyleIconMargin 12
|
||||||
|
+ JideTabbedPane.compressedStyleNoIconRectSize 24
|
||||||
|
+ JideTabbedPane.darkShadow [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultResizeMode 1
|
||||||
|
+ JideTabbedPane.defaultTabBorderShadowColor #736d63 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultTabColorTheme 3
|
||||||
|
+ JideTabbedPane.defaultTabShape 2
|
||||||
|
+ JideTabbedPane.fitStyleBoundSize 8
|
||||||
|
+ JideTabbedPane.fitStyleFirstTabMargin 4
|
||||||
|
+ JideTabbedPane.fitStyleIconMinWidth 24
|
||||||
|
+ JideTabbedPane.fitStyleTextMinWidth 16
|
||||||
|
+ JideTabbedPane.fixedStyleRectSize 60
|
||||||
|
+ JideTabbedPane.font [active] $defaultFont [UI]
|
||||||
|
+ JideTabbedPane.gripLeftMargin 4
|
||||||
|
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.iconMargin 5
|
||||||
|
+ JideTabbedPane.ignoreContentBorderInsetsIfNoTabs false
|
||||||
|
+ JideTabbedPane.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.noIconMargin 2
|
||||||
|
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabFont [active] $defaultFont [UI]
|
||||||
|
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.showCloseButtonOnTab false
|
||||||
|
+ JideTabbedPane.showIconOnTab true
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundDk [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundLt [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabListBackground #45494a javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabRectPadding 2
|
||||||
|
+ JideTabbedPane.textIconGap 4
|
||||||
|
+ JideTabbedPane.textMarginVertical 4
|
||||||
|
+ JideTabbedPane.textPadding 6
|
||||||
|
+ JideTabbedPane.unselectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- MeterProgressBar ----
|
||||||
|
|
||||||
|
+ MeterProgressBar.background #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellBackground #008000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellLength 2
|
||||||
|
+ MeterProgressBar.cellSpacing 2
|
||||||
|
+ MeterProgressBar.foreground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- StyledLabel ----
|
||||||
|
|
||||||
|
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Theme ----
|
||||||
|
|
||||||
|
+ Theme.highContrast [active] false
|
||||||
|
+ Theme.painter [unknown type] java.util.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
#---- jidesoft ----
|
||||||
|
|
||||||
|
+ jidesoft.extensionInstalled true
|
||||||
|
+ jidesoft.extensionStyle 0
|
||||||
182
flatlaf-testing/dumps/uidefaults/JIDE-FlatLightLaf_1.8.0_202.txt
Normal file
182
flatlaf-testing/dumps/uidefaults/JIDE-FlatLightLaf_1.8.0_202.txt
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
#---- ButtonPanel ----
|
||||||
|
|
||||||
|
+ ButtonPanel.buttonGap 6
|
||||||
|
+ ButtonPanel.groupGap 6
|
||||||
|
+ ButtonPanel.minButtonWidth 75
|
||||||
|
+ ButtonPanel.oppositeOrder H
|
||||||
|
+ ButtonPanel.order ACO
|
||||||
|
|
||||||
|
|
||||||
|
#---- Content ----
|
||||||
|
|
||||||
|
+ Content.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Cursor ----
|
||||||
|
|
||||||
|
+ Cursor.delete 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.drag 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragText 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragTextStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.east 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.float 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.horizontal 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.hsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveEast 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveWest 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.north 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.percentage 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.south 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.tab 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vertical 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.west 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
|
||||||
|
|
||||||
|
#---- FolderChooser ----
|
||||||
|
|
||||||
|
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Gripper ----
|
||||||
|
|
||||||
|
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Gripper.painter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ Gripper.size 8
|
||||||
|
+ GripperUI com.jidesoft.plaf.vsnet.VsnetGripperUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- HeaderBox ----
|
||||||
|
|
||||||
|
+ HeaderBox.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ HeaderBoxUI com.jidesoft.plaf.basic.BasicHeaderBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Icon ----
|
||||||
|
|
||||||
|
+ Icon.floating false
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.font [active] $defaultFont [UI]
|
||||||
|
+ JideButton.textShiftOffset 0
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideComboBox ----
|
||||||
|
|
||||||
|
+ JideComboBoxUI com.jidesoft.plaf.basic.BasicJideComboBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
+ JideLabel.font [active] $defaultFont [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopup ----
|
||||||
|
|
||||||
|
+ JidePopupUI com.jidesoft.plaf.basic.BasicJidePopupUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideScrollPane ----
|
||||||
|
|
||||||
|
+ JideScrollPane.border [active] 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.borderPainted false
|
||||||
|
+ JideSplitButton.font [active] $defaultFont [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPane ----
|
||||||
|
|
||||||
|
+ JideSplitPane.dividerSize 4
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPaneDivider ----
|
||||||
|
|
||||||
|
+ JideSplitPaneDivider.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideTabbedPane.buttonMargin 5
|
||||||
|
+ JideTabbedPane.buttonSize 18
|
||||||
|
+ JideTabbedPane.closeButtonAlignment 11
|
||||||
|
+ JideTabbedPane.closeButtonLeftMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMarginHorizonal 3
|
||||||
|
+ JideTabbedPane.closeButtonMarginSize 6
|
||||||
|
+ JideTabbedPane.closeButtonMarginVertical 3
|
||||||
|
+ JideTabbedPane.closeButtonRightMargin 2
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginHorizontal 0
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginVertical 0
|
||||||
|
+ JideTabbedPane.compressedStyleIconMargin 12
|
||||||
|
+ JideTabbedPane.compressedStyleNoIconRectSize 24
|
||||||
|
+ JideTabbedPane.darkShadow [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultResizeMode 1
|
||||||
|
+ JideTabbedPane.defaultTabBorderShadowColor #736d63 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultTabColorTheme 3
|
||||||
|
+ JideTabbedPane.defaultTabShape 2
|
||||||
|
+ JideTabbedPane.fitStyleBoundSize 8
|
||||||
|
+ JideTabbedPane.fitStyleFirstTabMargin 4
|
||||||
|
+ JideTabbedPane.fitStyleIconMinWidth 24
|
||||||
|
+ JideTabbedPane.fitStyleTextMinWidth 16
|
||||||
|
+ JideTabbedPane.fixedStyleRectSize 60
|
||||||
|
+ JideTabbedPane.font [active] $defaultFont [UI]
|
||||||
|
+ JideTabbedPane.gripLeftMargin 4
|
||||||
|
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetWindowsUtils$9 [UI]
|
||||||
|
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.iconMargin 5
|
||||||
|
+ JideTabbedPane.ignoreContentBorderInsetsIfNoTabs false
|
||||||
|
+ JideTabbedPane.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.noIconMargin 2
|
||||||
|
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabFont [active] $defaultFont [UI]
|
||||||
|
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.showCloseButtonOnTab false
|
||||||
|
+ JideTabbedPane.showIconOnTab true
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundDk [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundLt [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabListBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabRectPadding 2
|
||||||
|
+ JideTabbedPane.textIconGap 4
|
||||||
|
+ JideTabbedPane.textMarginVertical 4
|
||||||
|
+ JideTabbedPane.textPadding 6
|
||||||
|
+ JideTabbedPane.unselectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- MeterProgressBar ----
|
||||||
|
|
||||||
|
+ MeterProgressBar.background #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellBackground #008000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellLength 2
|
||||||
|
+ MeterProgressBar.cellSpacing 2
|
||||||
|
+ MeterProgressBar.foreground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- StyledLabel ----
|
||||||
|
|
||||||
|
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Theme ----
|
||||||
|
|
||||||
|
+ Theme.highContrast [active] false
|
||||||
|
+ Theme.painter [unknown type] java.util.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
#---- jidesoft ----
|
||||||
|
|
||||||
|
+ jidesoft.extensionInstalled true
|
||||||
|
+ jidesoft.extensionStyle 0
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.focusInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.focusInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
DOWN downPressed
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released DOWN downReleased
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ctrl KP_UP requestFocus
|
||||||
|
ctrl PAGE_DOWN navigatePageDown
|
||||||
|
ctrl PAGE_UP navigatePageUp
|
||||||
|
ctrl UP requestFocus
|
||||||
|
+ JideTabbedPane.focusInputMap [lazy] 10 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
|
||||||
|
UP navigateUp
|
||||||
@@ -0,0 +1,245 @@
|
|||||||
|
#---- ButtonPanel ----
|
||||||
|
|
||||||
|
+ ButtonPanel.buttonGap 5
|
||||||
|
+ ButtonPanel.groupGap 5
|
||||||
|
+ ButtonPanel.minButtonWidth 57
|
||||||
|
+ ButtonPanel.oppositeOrder H
|
||||||
|
+ ButtonPanel.order ACO
|
||||||
|
|
||||||
|
|
||||||
|
#---- Cursor ----
|
||||||
|
|
||||||
|
+ Cursor.delete 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.drag 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragText 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragTextStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.east 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.float 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.horizontal 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.hsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveEast 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveWest 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.north 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.percentage 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.south 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.tab 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vertical 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.west 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
|
||||||
|
|
||||||
|
#---- FolderChooser ----
|
||||||
|
|
||||||
|
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
|
- FormattedTextField.font [active] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ FormattedTextField.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Gripper ----
|
||||||
|
|
||||||
|
+ Gripper.foreground #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Gripper.painter [unknown type] com.jidesoft.plaf.vsnet.VsnetMetalUtils$1 [UI]
|
||||||
|
+ Gripper.size 8
|
||||||
|
+ GripperUI com.jidesoft.plaf.vsnet.VsnetGripperUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- HeaderBox ----
|
||||||
|
|
||||||
|
+ HeaderBox.background #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ HeaderBoxUI com.jidesoft.plaf.basic.BasicHeaderBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Icon ----
|
||||||
|
|
||||||
|
+ Icon.floating false
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.background #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideButton.borderColor #000000 java.awt.Color
|
||||||
|
+ JideButton.darkShadow #7a8a99 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.focusedBackground #f3f7fa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.font Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideButton.foreground #333333 sun.swing.PrintColorUIResource [UI]
|
||||||
|
+ JideButton.highlight #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.light #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideButton.selectedAndFocusedBackground #e2ebf4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.selectedBackground #eaf1f7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.shadow #b8cfe5 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.textIconGap 4
|
||||||
|
+ JideButton.textShiftOffset 0
|
||||||
|
+ JideButtonUI com.jidesoft.plaf.basic.BasicJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideComboBox ----
|
||||||
|
|
||||||
|
+ JideComboBoxUI com.jidesoft.plaf.basic.BasicJideComboBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
+ JideLabel.background #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideLabel.font Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideLabel.foreground #333333 sun.swing.PrintColorUIResource [UI]
|
||||||
|
+ JideLabelUI com.jidesoft.plaf.basic.BasicJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
|
+ JidePopupMenuUI com.jidesoft.plaf.basic.BasicJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopup ----
|
||||||
|
|
||||||
|
+ JidePopupUI com.jidesoft.plaf.basic.BasicJidePopupUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideScrollPane ----
|
||||||
|
|
||||||
|
+ JideScrollPane.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideSplitButton.borderPainted false
|
||||||
|
+ JideSplitButton.font Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideSplitButton.selectionBackground #a3b8cc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitButton.textIconGap 4
|
||||||
|
+ JideSplitButtonUI com.jidesoft.plaf.metal.MetalJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPane ----
|
||||||
|
|
||||||
|
+ JideSplitPane.dividerSize 3
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPaneDivider ----
|
||||||
|
|
||||||
|
+ JideSplitPaneDivider.background #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetMetalUtils$1 [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.background #f4f8fb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideTabbedPane.buttonMargin 5
|
||||||
|
+ JideTabbedPane.buttonSize 18
|
||||||
|
+ JideTabbedPane.closeButtonAlignment 11
|
||||||
|
+ JideTabbedPane.closeButtonLeftMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMarginHorizonal 3
|
||||||
|
+ JideTabbedPane.closeButtonMarginSize 6
|
||||||
|
+ JideTabbedPane.closeButtonMarginVertical 3
|
||||||
|
+ JideTabbedPane.closeButtonRightMargin 2
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginHorizontal 0
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginVertical 0
|
||||||
|
+ JideTabbedPane.compressedStyleIconMargin 12
|
||||||
|
+ JideTabbedPane.compressedStyleNoIconRectSize 24
|
||||||
|
+ JideTabbedPane.contentBorderInsets 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.darkShadow #333333 sun.swing.PrintColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultResizeMode 1
|
||||||
|
+ JideTabbedPane.defaultTabBorderShadowColor #736d63 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultTabColorTheme 3
|
||||||
|
+ JideTabbedPane.defaultTabShape 2
|
||||||
|
+ JideTabbedPane.fitStyleBoundSize 8
|
||||||
|
+ JideTabbedPane.fitStyleFirstTabMargin 4
|
||||||
|
+ JideTabbedPane.fitStyleIconMinWidth 24
|
||||||
|
+ JideTabbedPane.fitStyleTextMinWidth 16
|
||||||
|
+ JideTabbedPane.fixedStyleRectSize 60
|
||||||
|
+ JideTabbedPane.font Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.foreground #333333 sun.swing.PrintColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.gripLeftMargin 4
|
||||||
|
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.vsnet.VsnetMetalUtils$1 [UI]
|
||||||
|
+ JideTabbedPane.highlight #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.iconMargin 5
|
||||||
|
+ JideTabbedPane.ignoreContentBorderInsetsIfNoTabs false
|
||||||
|
+ JideTabbedPane.light #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.noIconMargin 2
|
||||||
|
+ JideTabbedPane.selectedTabBackground #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabFont Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabTextForeground #7a8a99 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.shadow #b8cfe5 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.showCloseButtonOnTab false
|
||||||
|
+ JideTabbedPane.showIconOnTab true
|
||||||
|
+ JideTabbedPane.tabAreaBackground #f4f8fb javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundDk #eeeeee javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundLt #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaInsets 2,4,0,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabInsets 1,4,1,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabListBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabRectPadding 2
|
||||||
|
+ JideTabbedPane.tabRunOverlay 2
|
||||||
|
+ JideTabbedPane.textIconGap 4
|
||||||
|
+ JideTabbedPane.textMarginVertical 4
|
||||||
|
+ JideTabbedPane.textPadding 6
|
||||||
|
+ JideTabbedPane.unselectedTabTextForeground #7a8a99 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPaneUI com.jidesoft.plaf.vsnet.VsnetJideTabbedPaneUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- MenuBar ----
|
||||||
|
|
||||||
|
- MenuBar.border [lazy] 0,0,2,0 false javax.swing.plaf.metal.MetalBorders$MenuBarBorder [UI]
|
||||||
|
+ MenuBar.border 1,0,1,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- MeterProgressBar ----
|
||||||
|
|
||||||
|
+ MeterProgressBar.background #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellBackground #008000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellLength 2
|
||||||
|
+ MeterProgressBar.cellSpacing 2
|
||||||
|
+ MeterProgressBar.foreground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- RangeSlider ----
|
||||||
|
|
||||||
|
+ RangeSliderUI com.jidesoft.plaf.metal.MetalRangeSliderUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Resizable ----
|
||||||
|
|
||||||
|
+ Resizable.resizeBorder 4,4,4,4 true com.jidesoft.plaf.vsnet.ResizeFrameBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Spinner ----
|
||||||
|
|
||||||
|
- Spinner.font [active] Dialog bold 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Spinner.font Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- StyledLabel ----
|
||||||
|
|
||||||
|
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Theme ----
|
||||||
|
|
||||||
|
+ Theme.painter [unknown type] java.util.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
#---- TristateCheckBox ----
|
||||||
|
|
||||||
|
+ TristateCheckBox.icon 13,13 com.jidesoft.plaf.metal.MetalIconFactory$CheckBoxIcon [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- jidesoft ----
|
||||||
|
|
||||||
|
+ jidesoft.extensionInstalled true
|
||||||
|
+ jidesoft.extensionStyle 0
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.focusInputMap [lazy] 2 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
SPACE pressed
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.focusInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
DOWN downPressed
|
||||||
|
SPACE pressed
|
||||||
|
released DOWN downReleased
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ctrl KP_UP requestFocus
|
||||||
|
ctrl PAGE_DOWN navigatePageDown
|
||||||
|
ctrl PAGE_UP navigatePageUp
|
||||||
|
ctrl UP requestFocus
|
||||||
|
+ JideTabbedPane.focusInputMap [lazy] 10 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
|
||||||
|
UP navigateUp
|
||||||
@@ -0,0 +1,410 @@
|
|||||||
|
#---- ButtonPanel ----
|
||||||
|
|
||||||
|
+ ButtonPanel.buttonGap 6
|
||||||
|
+ ButtonPanel.groupGap 6
|
||||||
|
+ ButtonPanel.minButtonWidth 75
|
||||||
|
+ ButtonPanel.oppositeOrder H
|
||||||
|
+ ButtonPanel.order ACO
|
||||||
|
|
||||||
|
|
||||||
|
#---- CheckBoxMenuItem ----
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.checkIcon [active] 22,22 com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon [UI]
|
||||||
|
+ CheckBoxMenuItem.checkIcon 20,20 com.jidesoft.icons.MenuCheckIcon [UI]
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.font [active] Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.margin [active] 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.margin 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|
||||||
|
+ CheckBoxMenuItem.mouseHoverBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.mouseHoverBorder 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.selectionBackground [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.selectionBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- CheckBoxMenuItem.selectionForeground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ CheckBoxMenuItem.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
+ CheckBoxMenuItem.textIconGap 8
|
||||||
|
|
||||||
|
- CheckBoxMenuItemUI com.sun.java.swing.plaf.windows.WindowsCheckBoxMenuItemUI
|
||||||
|
+ CheckBoxMenuItemUI com.jidesoft.plaf.vsnet.VsnetCheckBoxMenuItemUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Content ----
|
||||||
|
|
||||||
|
+ Content.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Cursor ----
|
||||||
|
|
||||||
|
+ Cursor.delete 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.drag 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragText 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.dragTextStop 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.east 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.float 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.horizontal 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.hsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveEast 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.moveWest 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.north 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.percentage 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.south 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.tab 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vertical 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.vsplit 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
+ Cursor.west 32,32 javax.swing.ImageIcon (java.awt.image.BufferedImage)
|
||||||
|
|
||||||
|
|
||||||
|
#---- FolderChooser ----
|
||||||
|
|
||||||
|
+ FolderChooserUI com.jidesoft.plaf.basic.BasicFolderChooserUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- FormattedTextField ----
|
||||||
|
|
||||||
|
- FormattedTextField.font [active] Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ FormattedTextField.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Gripper ----
|
||||||
|
|
||||||
|
+ Gripper.foreground [active] #b2b2b2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Gripper.painter [unknown type] com.jidesoft.plaf.office2003.Office2003WindowsUtils$1 [UI]
|
||||||
|
+ Gripper.size 8
|
||||||
|
+ GripperUI com.jidesoft.plaf.vsnet.VsnetGripperUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- HeaderBox ----
|
||||||
|
|
||||||
|
+ HeaderBox.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ HeaderBoxUI com.jidesoft.plaf.basic.BasicHeaderBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Icon ----
|
||||||
|
|
||||||
|
+ Icon.floating false
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideButton.borderColor [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.darkShadow [active] #696969 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.focusedBackground [active] #cfeafe javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideButton.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideButton.selectedAndFocusedBackground [active] #88caff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.selectedBackground [active] #acdafe javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.shadow [active] #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideButton.textIconGap 4
|
||||||
|
+ JideButton.textShiftOffset 0
|
||||||
|
+ JideButtonUI com.jidesoft.plaf.basic.BasicJideButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideComboBox ----
|
||||||
|
|
||||||
|
+ JideComboBoxUI com.jidesoft.plaf.basic.BasicJideComboBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideLabel ----
|
||||||
|
|
||||||
|
+ JideLabel.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideLabel.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideLabel.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideLabelUI com.jidesoft.plaf.basic.BasicJideLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopupMenu ----
|
||||||
|
|
||||||
|
+ JidePopupMenuUI com.jidesoft.plaf.windows.WindowsJidePopupMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JidePopup ----
|
||||||
|
|
||||||
|
+ JidePopupUI com.jidesoft.plaf.basic.BasicJidePopupUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideScrollPane ----
|
||||||
|
|
||||||
|
+ JideScrollPane.border line: #828790 javax.swing.plaf.ColorUIResource [UI] 1 false 1,1,1,1 true com.sun.java.swing.plaf.windows.XPStyle$XPFillBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.border 0,0,0,0 false javax.swing.plaf.basic.BasicBorders$MarginBorder [UI]
|
||||||
|
+ JideSplitButton.borderPainted false
|
||||||
|
+ JideSplitButton.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideSplitButton.margin 3,3,3,7 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideSplitButton.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitButton.textIconGap 4
|
||||||
|
+ JideSplitButtonUI com.jidesoft.plaf.basic.BasicJideSplitButtonUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPane ----
|
||||||
|
|
||||||
|
+ JideSplitPane.dividerSize 4
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitPaneDivider ----
|
||||||
|
|
||||||
|
+ JideSplitPaneDivider.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideSplitPaneDivider.gripperPainter [unknown type] com.jidesoft.plaf.office2003.Office2003WindowsUtils$1 [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.alwaysShowLineBorder false
|
||||||
|
+ JideTabbedPane.background [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.border 0,0,0,0 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ JideTabbedPane.buttonMargin 5
|
||||||
|
+ JideTabbedPane.buttonSize 18
|
||||||
|
+ JideTabbedPane.closeButtonAlignment 11
|
||||||
|
+ JideTabbedPane.closeButtonLeftMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMargin 2
|
||||||
|
+ JideTabbedPane.closeButtonMarginHorizonal 3
|
||||||
|
+ JideTabbedPane.closeButtonMarginSize 6
|
||||||
|
+ JideTabbedPane.closeButtonMarginVertical 3
|
||||||
|
+ JideTabbedPane.closeButtonRightMargin 2
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginHorizontal 0
|
||||||
|
+ JideTabbedPane.compressedStyleCloseButtonMarginVertical 0
|
||||||
|
+ JideTabbedPane.compressedStyleIconMargin 12
|
||||||
|
+ JideTabbedPane.compressedStyleNoIconRectSize 24
|
||||||
|
+ JideTabbedPane.contentBorderInsets 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.darkShadow [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultResizeMode 1
|
||||||
|
+ JideTabbedPane.defaultTabBorderShadowColor #736d63 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.defaultTabColorTheme 2
|
||||||
|
+ JideTabbedPane.defaultTabShape 4
|
||||||
|
+ JideTabbedPane.fitStyleBoundSize 8
|
||||||
|
+ JideTabbedPane.fitStyleFirstTabMargin 4
|
||||||
|
+ JideTabbedPane.fitStyleIconMinWidth 24
|
||||||
|
+ JideTabbedPane.fitStyleTextMinWidth 16
|
||||||
|
+ JideTabbedPane.fixedStyleRectSize 60
|
||||||
|
+ JideTabbedPane.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.foreground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.gripLeftMargin 4
|
||||||
|
+ JideTabbedPane.gripperPainter [unknown type] com.jidesoft.plaf.office2003.Office2003WindowsUtils$1 [UI]
|
||||||
|
+ JideTabbedPane.highlight [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.iconMargin 5
|
||||||
|
+ JideTabbedPane.ignoreContentBorderInsetsIfNoTabs false
|
||||||
|
+ JideTabbedPane.light [active] #e3e3e3 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.noIconMargin 2
|
||||||
|
+ JideTabbedPane.selectedTabBackground [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundDk #ffc73c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabBackgroundLt #e68b2c javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabFont Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ JideTabbedPane.selectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.shadow [active] #a0a0a0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.showCloseButtonOnTab false
|
||||||
|
+ JideTabbedPane.showFocusIndicator true
|
||||||
|
+ JideTabbedPane.showIconOnTab true
|
||||||
|
+ JideTabbedPane.tabAreaBackground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundDk [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaBackgroundLt [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabAreaInsets 2,4,0,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabInsets 1,4,1,4 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabListBackground #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPane.tabRectPadding 2
|
||||||
|
+ JideTabbedPane.tabRunOverlay 2
|
||||||
|
+ JideTabbedPane.textIconGap 4
|
||||||
|
+ JideTabbedPane.textMarginVertical 4
|
||||||
|
+ JideTabbedPane.textPadding 6
|
||||||
|
+ JideTabbedPane.unselectedTabTextForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ JideTabbedPaneUI com.jidesoft.plaf.office2003.Office2003JideTabbedPaneUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Menu ----
|
||||||
|
|
||||||
|
- Menu.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Menu.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- Menu.checkIcon [active] 22,22 com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon [UI]
|
||||||
|
+ Menu.checkIcon 20,20 com.jidesoft.icons.MenuCheckIcon [UI]
|
||||||
|
|
||||||
|
- Menu.font [active] Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Menu.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- Menu.margin [active] 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ Menu.margin 2,7,3,7 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|
||||||
|
+ Menu.mouseHoverBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Menu.mouseHoverBorder 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
- Menu.selectionBackground [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Menu.selectionBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- Menu.selectionForeground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ Menu.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- Menu.submenuPopupOffsetX -4
|
||||||
|
+ Menu.submenuPopupOffsetX 1
|
||||||
|
|
||||||
|
- Menu.submenuPopupOffsetY -3
|
||||||
|
+ Menu.submenuPopupOffsetY 0
|
||||||
|
|
||||||
|
+ Menu.textIconGap 2
|
||||||
|
|
||||||
|
|
||||||
|
#---- MenuBar ----
|
||||||
|
|
||||||
|
- MenuBar.border [lazy] 0,0,2,0 false javax.swing.plaf.basic.BasicBorders$MenuBarBorder [UI]
|
||||||
|
+ MenuBar.border 1,2,1,2 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- MenuItem ----
|
||||||
|
|
||||||
|
+ MenuItem.accelEndGap 18
|
||||||
|
|
||||||
|
- MenuItem.acceleratorFont [active] Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ MenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- MenuItem.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MenuItem.background [active] #fcfcfc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- MenuItem.checkIcon [active] 22,22 com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon [UI]
|
||||||
|
+ MenuItem.checkIcon 20,20 com.jidesoft.icons.MenuCheckIcon [UI]
|
||||||
|
|
||||||
|
- MenuItem.font [active] Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ MenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- MenuItem.margin [active] 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ MenuItem.margin 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|
||||||
|
- MenuItem.selectionBackground [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MenuItem.selectionBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
+ MenuItem.selectionBorderColor [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- MenuItem.selectionForeground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MenuItem.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
+ MenuItem.shadowColor [active] #fafafa javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MenuItem.shadowWidth 24
|
||||||
|
+ MenuItem.textIconGap 8
|
||||||
|
|
||||||
|
- MenuItemUI com.sun.java.swing.plaf.windows.WindowsMenuItemUI
|
||||||
|
+ MenuItemUI com.jidesoft.plaf.vsnet.VsnetMenuItemUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Menu ----
|
||||||
|
|
||||||
|
- MenuUI com.sun.java.swing.plaf.windows.WindowsMenuUI
|
||||||
|
+ MenuUI com.jidesoft.plaf.vsnet.VsnetMenuUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- MeterProgressBar ----
|
||||||
|
|
||||||
|
+ MeterProgressBar.background #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.border 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellBackground #008000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellForeground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBar.cellLength 2
|
||||||
|
+ MeterProgressBar.cellSpacing 2
|
||||||
|
+ MeterProgressBar.foreground #00ff00 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ MeterProgressBarUI com.jidesoft.plaf.basic.MeterProgressBarUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- PopupMenu ----
|
||||||
|
|
||||||
|
- PopupMenu.background [active] #f0f0f0 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ PopupMenu.background [active] #fcfcfc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- PopupMenu.border [active] javax.swing.plaf.BorderUIResource$CompoundBorderUIResource [UI]
|
||||||
|
line: #a0a0a0 javax.swing.plaf.ColorUIResource [UI] 1 false 1,1,1,1 true com.sun.java.swing.plaf.windows.XPStyle$XPFillBorder [UI]
|
||||||
|
2,2,2,2 false javax.swing.border.EmptyBorder
|
||||||
|
+ PopupMenu.border [active] 2,2,2,2 false javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- PopupMenuSeparator ----
|
||||||
|
|
||||||
|
+ PopupMenuSeparator.background [active] #fcfcfc javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ PopupMenuSeparator.foreground [active] #e4e4e4 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- PopupMenuSeparatorUI com.sun.java.swing.plaf.windows.WindowsPopupMenuSeparatorUI
|
||||||
|
+ PopupMenuSeparatorUI com.jidesoft.plaf.vsnet.VsnetPopupMenuSeparatorUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- RadioButtonMenuItem ----
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.acceleratorFont [lazy] Dialog plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.acceleratorFont Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.checkIcon [active] 22,22 com.sun.java.swing.plaf.windows.WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon [UI]
|
||||||
|
+ RadioButtonMenuItem.checkIcon 20,20 com.jidesoft.icons.MenuCheckIcon [UI]
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.font [active] Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.font Segoe UI plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.margin [active] 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.margin 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
|
|
||||||
|
+ RadioButtonMenuItem.mouseHoverBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.mouseHoverBorder 1,1,1,1 true javax.swing.plaf.BorderUIResource [UI]
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.selectionBackground [active] #0078d7 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.selectionBackground [active] #f6f6f6 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
- RadioButtonMenuItem.selectionForeground [active] #ffffff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
+ RadioButtonMenuItem.selectionForeground [active] #000000 javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|
||||||
|
+ RadioButtonMenuItem.textIconGap 8
|
||||||
|
|
||||||
|
- RadioButtonMenuItemUI com.sun.java.swing.plaf.windows.WindowsRadioButtonMenuItemUI
|
||||||
|
+ RadioButtonMenuItemUI com.jidesoft.plaf.vsnet.VsnetRadioButtonMenuItemUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- RangeSlider ----
|
||||||
|
|
||||||
|
+ RangeSliderUI com.jidesoft.plaf.windows.WindowsRangeSliderUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- Resizable ----
|
||||||
|
|
||||||
|
+ Resizable.resizeBorder [active] 4,4,4,4 true com.jidesoft.plaf.vsnet.ResizeFrameBorder [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Spinner ----
|
||||||
|
|
||||||
|
- Spinner.font [active] Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ Spinner.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- StyledLabel ----
|
||||||
|
|
||||||
|
+ StyledLabelUI com.jidesoft.plaf.basic.BasicStyledLabelUI
|
||||||
|
|
||||||
|
|
||||||
|
#---- TextArea ----
|
||||||
|
|
||||||
|
- TextArea.font [active] Monospaced plain 13 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
+ TextArea.font Tahoma plain 11 javax.swing.plaf.FontUIResource [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- Theme ----
|
||||||
|
|
||||||
|
+ Theme.highContrast [active] false
|
||||||
|
+ Theme.painter [unknown type] java.util.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
#---- TristateCheckBox ----
|
||||||
|
|
||||||
|
+ TristateCheckBox.icon 13,13 com.jidesoft.plaf.windows.WindowsIconFactory$CheckBoxIcon [UI]
|
||||||
|
|
||||||
|
|
||||||
|
#---- jidesoft ----
|
||||||
|
|
||||||
|
+ jidesoft.extensionInstalled true
|
||||||
|
+ jidesoft.extensionStyle 3
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#---- JideButton ----
|
||||||
|
|
||||||
|
+ JideButton.focusInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideSplitButton ----
|
||||||
|
|
||||||
|
+ JideSplitButton.focusInputMap [lazy] 6 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
DOWN downPressed
|
||||||
|
ENTER pressed
|
||||||
|
SPACE pressed
|
||||||
|
released DOWN downReleased
|
||||||
|
released ENTER released
|
||||||
|
released SPACE released
|
||||||
|
|
||||||
|
|
||||||
|
#---- JideTabbedPane ----
|
||||||
|
|
||||||
|
+ JideTabbedPane.ancestorInputMap [lazy] 4 javax.swing.plaf.InputMapUIResource [UI]
|
||||||
|
ctrl KP_UP requestFocus
|
||||||
|
ctrl PAGE_DOWN navigatePageDown
|
||||||
|
ctrl PAGE_UP navigatePageUp
|
||||||
|
ctrl UP requestFocus
|
||||||
|
+ JideTabbedPane.focusInputMap [lazy] 10 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
|
||||||
|
UP navigateUp
|
||||||
@@ -151,22 +151,18 @@ public class FlatComponentsTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void outlineChanged() {
|
private void outlineChanged() {
|
||||||
FlatTestFrame frame = (FlatTestFrame) SwingUtilities.getAncestorOfClass( FlatTestFrame.class, this );
|
|
||||||
if( frame == null )
|
|
||||||
return;
|
|
||||||
|
|
||||||
Object outline = errorOutlineRadioButton.isSelected() ? "error"
|
Object outline = errorOutlineRadioButton.isSelected() ? "error"
|
||||||
: warningOutlineRadioButton.isSelected() ? "warning"
|
: warningOutlineRadioButton.isSelected() ? "warning"
|
||||||
: magentaOutlineRadioButton.isSelected() ? Color.magenta
|
: magentaOutlineRadioButton.isSelected() ? Color.magenta
|
||||||
: magentaCyanOutlineRadioButton.isSelected() ? new Color[] { Color.magenta, Color.cyan }
|
: magentaCyanOutlineRadioButton.isSelected() ? new Color[] { Color.magenta, Color.cyan }
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
frame.updateComponentsRecur( this, (c, type) -> {
|
FlatTestFrame.updateComponentsRecur( this, (c, type) -> {
|
||||||
if( c instanceof JComponent )
|
if( c instanceof JComponent )
|
||||||
((JComponent)c).putClientProperty( FlatClientProperties.OUTLINE, outline );
|
((JComponent)c).putClientProperty( FlatClientProperties.OUTLINE, outline );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
frame.repaint();
|
repaint();
|
||||||
textField1.requestFocusInWindow();
|
textField1.requestFocusInWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user