diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index b4b04697..e195327d 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -1,3 +1,27 @@
+#
+# MIT License
+#
+# Copyright (c) 2020 Jannis Weis
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
name: Documentation
on:
push:
diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml
index 405a2b30..206abee4 100644
--- a/.github/workflows/gradle-wrapper-validation.yml
+++ b/.github/workflows/gradle-wrapper-validation.yml
@@ -1,3 +1,27 @@
+#
+# MIT License
+#
+# Copyright (c) 2020 Jannis Weis
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
name: "Validate Gradle Wrapper"
on: [push, pull_request]
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 6e33f17d..3b73fc1b 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -1,3 +1,27 @@
+#
+# MIT License
+#
+# Copyright (c) 2020 Jannis Weis
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
name: CI
on:
@@ -12,29 +36,29 @@ jobs:
name: Windows (Java 11)
runs-on: windows-latest
steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 10
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Build
- run: ./gradlew build
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 10
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Build
+ run: ./gradlew build
linux:
name: Linux (Java 8)
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 10
- - name: Set up JDK 8
- uses: actions/setup-java@v1
- with:
- java-version: 8
- - name: Build
- run: ./gradlew build
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 10
+ - name: Set up JDK 8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 8
+ - name: Build
+ run: ./gradlew build
macos:
name: macOS (Java 11)
diff --git a/.github/workflows/libs.yml b/.github/workflows/libs.yml
index 132c3cdc..caead39f 100644
--- a/.github/workflows/libs.yml
+++ b/.github/workflows/libs.yml
@@ -1,17 +1,41 @@
+#
+# MIT License
+#
+# Copyright (c) 2020 Jannis Weis
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
name: Build Native Libraries
on:
push:
paths:
- - '**.cpp'
- - '**.mm'
+ - '**.cpp'
+ - '**.mm'
pull_request:
paths:
- - '**.cpp'
- - '**.mm'
+ - '**.cpp'
+ - '**.mm'
release:
types:
- - published
+ - published
schedule:
- cron: '0 0 1 * *'
jobs:
@@ -19,41 +43,41 @@ jobs:
name: Windows (Java 11)
runs-on: windows-latest
steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 10
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Build
- run: ./gradlew :darklaf-windows:build
- - name: Upload x86 artifact
- uses: actions/upload-artifact@v1
- with:
- name: darklaf-windows_x86.dll
- path: windows/build/lib/main/release/x86/darklaf-windows.dll
- - name: Upload x86-64 artifact
- uses: actions/upload-artifact@v1
- with:
- name: darklaf-windows_x86-64.dll
- path: windows/build/lib/main/release/x86-64/darklaf-windows.dll
-
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 10
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Build
+ run: ./gradlew :darklaf-windows:build
+ - name: Upload x86 artifact
+ uses: actions/upload-artifact@v1
+ with:
+ name: darklaf-windows_x86.dll
+ path: windows/build/lib/main/release/x86/darklaf-windows.dll
+ - name: Upload x86-64 artifact
+ uses: actions/upload-artifact@v1
+ with:
+ name: darklaf-windows_x86-64.dll
+ path: windows/build/lib/main/release/x86-64/darklaf-windows.dll
+
macOS:
name: macOS (Java 11)
runs-on: macos-latest
steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 10
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Build
- run: ./gradlew :darklaf-macos:build
- - name: Upload artifact
- uses: actions/upload-artifact@v1
- with:
- name: libdarklaf-macos.dylib
- path: macos/build/lib/main/release/stripped/libdarklaf-macos.dylib
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 10
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Build
+ run: ./gradlew :darklaf-macos:build
+ - name: Upload artifact
+ uses: actions/upload-artifact@v1
+ with:
+ name: libdarklaf-macos.dylib
+ path: macos/build/lib/main/release/stripped/libdarklaf-macos.dylib
diff --git a/README.md b/README.md
index 30b67f38..440d63b5 100644
--- a/README.md
+++ b/README.md
@@ -123,4 +123,3 @@ Here is a list of things that currently are not finished or need refinement. Thi
# License
This project is licensed under the [MIT license](https://github.com/weisJ/darklaf/blob/master/LICENSE).
-
diff --git a/build.gradle.kts b/build.gradle.kts
index 5a390187..2fcc4b9d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,3 +1,5 @@
+import com.github.autostyle.generic.DefaultCopyrightStyle
+import com.github.autostyle.gradle.BaseFormatExtension
import com.github.vlsi.gradle.crlf.CrLfSpec
import com.github.vlsi.gradle.crlf.LineEndings
import com.github.vlsi.gradle.properties.dsl.props
@@ -5,6 +7,7 @@ import com.github.vlsi.gradle.publishing.dsl.simplifyXml
import com.github.vlsi.gradle.publishing.dsl.versionFromResolution
plugins {
+ id("com.github.autostyle")
id("com.github.vlsi.crlf")
id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.stage-vote-release")
@@ -13,6 +16,7 @@ plugins {
val skipJavadoc by props()
val enableMavenLocal by props()
val enableGradleMetadata by props()
+val skipAutostyle by props()
val String.v: String get() = rootProject.extra["$this.version"] as String
@@ -40,6 +44,18 @@ releaseParams {
}
}
+fun BaseFormatExtension.license() {
+ licenseHeader(File("${project.rootDir}/LICENSE").readText()) {
+ filter {
+ exclude("**/org/pbjar/jxlayer/*")
+ }
+ copyrightStyle("bat", DefaultCopyrightStyle.REM)
+ copyrightStyle("cmd", DefaultCopyrightStyle.REM)
+ }
+ trimTrailingWhitespace()
+ endWithNewline()
+}
+
allprojects {
group = "com.github.weisj"
version = buildVersion
@@ -51,6 +67,34 @@ allprojects {
mavenCentral()
}
+ if (!skipAutostyle) {
+ apply(plugin = "com.github.autostyle")
+ autostyle {
+ kotlinGradle {
+ ktlint()
+ }
+ format("configs") {
+ filter {
+ include("**/*.sh", "**/*.bsh", "**/*.cmd", "**/*.bat")
+ include("**/*.properties", "**/*.yml")
+ include("**/*.xsd", "**/*.xsl", "**/*.xml")
+ // Autostyle does not support gitignore yet https://github.com/autostyle/autostyle/issues/13
+ exclude("out/**")
+ if (project == rootProject) {
+ exclude("gradlew*")
+ } else {
+ exclude("bin/**")
+ }
+ }
+ license()
+ }
+ format("markdown") {
+ filter.include("**/*.md")
+ endWithNewline()
+ }
+ }
+ }
+
tasks.withType().configureEach {
// Ensure builds are reproducible
isPreserveFileTimestamps = false
@@ -107,6 +151,19 @@ allprojects {
}
}
+ if (!skipAutostyle) {
+ autostyle {
+ java {
+ importOrder("java", "javax", "org", "com")
+ removeUnusedImports()
+ license()
+ eclipse {
+ configFile("${project.rootDir}/darklaf_java.eclipseformat.xml")
+ }
+ }
+ }
+ }
+
apply(plugin = "maven-publish")
val generatePomFile by props()
@@ -173,7 +230,7 @@ allprojects {
configure {
if (project.path.startsWith(":darklaf-dependencies-bom") ||
- project.path == ":") {
+ project.path == ":") {
// We don't it to Central for now
return@configure
}
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
index 32319e6a..41f27e30 100644
--- a/core/build.gradle.kts
+++ b/core/build.gradle.kts
@@ -1,6 +1,3 @@
-import com.github.vlsi.gradle.crlf.CrLfSpec
-import com.github.vlsi.gradle.crlf.LineEndings
-
plugins {
`java-library`
id("com.github.johnrengelman.shadow")
@@ -23,18 +20,6 @@ dependencies {
testImplementation("org.swinglabs:swingx")
}
-tasks.jar {
- CrLfSpec(LineEndings.LF).run {
- into("META-INF") {
- filteringCharset = "UTF-8"
- textFrom("licenses/NOTICE.txt")
- textFrom("licenses/DARCULA_LICENSE.txt")
- textFrom("licenses/PBJAR_LICENSE.txt")
- textFrom("licenses/INTELLIJ_LICENSE.txt")
- }
- }
-}
-
val makeDocumentation by tasks.registering(JavaExec::class) {
group = "Development"
description = "Builds the documentation"
@@ -66,10 +51,13 @@ tasks.shadowJar {
abstract class DemoTask : JavaExec() {
init {
- setMain("UIDemo")
+ main = "UIDemo"
}
- @Option(option = "class", description = "Specifies the main class to run (e.g. UIDemo, ui.table.TableDemo, ui.button.ButtonDemo, ...)")
+ @Option(
+ option = "class",
+ description = "Specifies the main class to run (e.g. UIDemo, ui.table.TableDemo, ui.button.ButtonDemo, ...)"
+ )
override fun setMain(mainClassName: String?) = super.setMain(mainClassName)
}
@@ -86,6 +74,7 @@ val runDemo by tasks.registering(DemoTask::class) {
val value = System.getProperty(name) ?: default
value?.let { systemProperty(name, it) }
}
+
val props = System.getProperties()
@Suppress("UNCHECKED_CAST")
for (e in props.propertyNames() as `java.util`.Enumeration) {
diff --git a/core/gradle.properties b/core/gradle.properties
index a2556c5a..8074f847 100644
--- a/core/gradle.properties
+++ b/core/gradle.properties
@@ -1 +1,25 @@
-generatePomFile = true
+#
+# MIT License
+#
+# Copyright (c) 2020 Jannis Weis
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+#
+generatePomFile = true
diff --git a/core/pom.xml b/core/pom.xml
index 8ac2bd53..3a061e5a 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,81 +1,106 @@
-
- 4.0.0
- com.github.weisj
- darklaf-core
- 1.4.3.1
- Darklaf core
- A themeable Look and Feel for java swing
- https://github.com/weisJ/darklaf
-
- com.github.weisj
- https://github.com/weisj
-
-
-
- MIT
- https://github.com/weisJ/darklaf/blob/master/LICENSE
- repo
-
-
-
-
- Jannis Weis
-
-
-
- scm:git:git://github.com/weisJ/darklaf.git
- scm:git:ssh://git@github.com:weisj/darklaf.git
+
+
+ 4.0.0
+ com.github.weisj
+ darklaf-core
+ 1.4.3.1
+ Darklaf core
+ A themeable Look and Feel for java swinghttps://github.com/weisJ/darklaf
-
-
- GitHub
- https://github.com/weisJ/darklaf/issues
-
-
-
-
- com.github.weisj
- darklaf-native-utils
- 1.4.3.1
- runtime
-
-
- com.github.weisj
- darklaf-utils
- 1.4.3.1
- runtime
-
-
- com.github.weisj
- darklaf-decorations-base
- 1.4.3.1
- runtime
-
-
- com.github.weisj
- darklaf-windows
- 1.4.3.1
- runtime
-
-
- com.github.weisj
- darklaf-macos
- 1.4.3.1
- runtime
-
-
- com.github.weisj
- darklaf-property-loader
- 1.4.3.1
- runtime
-
-
- org.swinglabs
- jxlayer
- 3.0.4
- runtime
-
-
+
+ com.github.weisj
+ https://github.com/weisj
+
+
+
+ MIT
+ https://github.com/weisJ/darklaf/blob/master/LICENSE
+ repo
+
+
+
+
+ Jannis Weis
+
+
+
+ scm:git:git://github.com/weisJ/darklaf.git
+ scm:git:ssh://git@github.com:weisj/darklaf.git
+ https://github.com/weisJ/darklaf
+
+
+ GitHub
+ https://github.com/weisJ/darklaf/issues
+
+
+
+
+ com.github.weisj
+ darklaf-native-utils
+ 1.4.3.1
+ runtime
+
+
+ com.github.weisj
+ darklaf-utils
+ 1.4.3.1
+ runtime
+
+
+ com.github.weisj
+ darklaf-decorations-base
+ 1.4.3.1
+ runtime
+
+
+ com.github.weisj
+ darklaf-windows
+ 1.4.3.1
+ runtime
+
+
+ com.github.weisj
+ darklaf-macos
+ 1.4.3.1
+ runtime
+
+
+ com.github.weisj
+ darklaf-property-loader
+ 1.4.3.1
+ runtime
+
+
+ org.swinglabs
+ jxlayer
+ 3.0.4
+ runtime
+
+
diff --git a/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java b/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java
index c5900ddb..ff4e062d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java
+++ b/core/src/main/java/com/github/weisj/darklaf/DarkLaf.java
@@ -20,9 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicLookAndFeel;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+
import com.github.weisj.darklaf.platform.DecorationsHandler;
import com.github.weisj.darklaf.task.*;
import com.github.weisj.darklaf.theme.Theme;
@@ -30,12 +38,6 @@ import com.github.weisj.darklaf.ui.DarkPopupFactory;
import com.github.weisj.darklaf.ui.popupmenu.DarkPopupMenuUI;
import com.github.weisj.darklaf.util.SystemInfo;
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicLookAndFeel;
-import javax.swing.plaf.metal.MetalLookAndFeel;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
/**
* @author Jannis Weis
*/
@@ -48,13 +50,13 @@ public class DarkLaf extends BasicLookAndFeel {
* All tasks for initializing the ui defaults in order of execution.
*/
private static final DefaultsInitTask[] INIT_TASKS = new DefaultsInitTask[]{
- new ThemeDefaultsInitTask(),
- new InputDefaultsInitTask(),
- new IdeaDefaultsInitTask(),
- new FontDefaultsInitTask(),
- new UtilityDefaultsInitTask(),
- new SystemDefaultsInitTask(),
- new PlatformDefaultsInitTask()
+ new ThemeDefaultsInitTask(),
+ new InputDefaultsInitTask(),
+ new IdeaDefaultsInitTask(),
+ new FontDefaultsInitTask(),
+ new UtilityDefaultsInitTask(),
+ new SystemDefaultsInitTask(),
+ new PlatformDefaultsInitTask()
};
/*
* The base look and feel. This may vary to handle different platform support.
@@ -143,13 +145,11 @@ public class DarkLaf extends BasicLookAndFeel {
return "Darklaf";
}
-
@Override
public String getID() {
return getName();
}
-
@Override
public String getDescription() {
return "Dark Look and feel based on Darcula-LAF";
diff --git a/core/src/main/java/com/github/weisj/darklaf/DarkLafInfo.java b/core/src/main/java/com/github/weisj/darklaf/DarkLafInfo.java
index 0cf79e91..f9e57818 100644
--- a/core/src/main/java/com/github/weisj/darklaf/DarkLafInfo.java
+++ b/core/src/main/java/com/github/weisj/darklaf/DarkLafInfo.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf;
diff --git a/core/src/main/java/com/github/weisj/darklaf/LafManager.java b/core/src/main/java/com/github/weisj/darklaf/LafManager.java
index 616320d6..42201dbd 100644
--- a/core/src/main/java/com/github/weisj/darklaf/LafManager.java
+++ b/core/src/main/java/com/github/weisj/darklaf/LafManager.java
@@ -20,9 +20,21 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf;
+import java.awt.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.platform.DecorationsHandler;
import com.github.weisj.darklaf.platform.ThemePreferencesHandler;
import com.github.weisj.darklaf.task.DefaultsAdjustmentTask;
@@ -33,16 +45,6 @@ import com.github.weisj.darklaf.theme.info.DefaultThemeProvider;
import com.github.weisj.darklaf.theme.info.PreferredThemeStyle;
import com.github.weisj.darklaf.theme.info.ThemeProvider;
-import javax.swing.*;
-import java.awt.*;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.LogManager;
-import java.util.logging.Logger;
-
/**
* Manager for the Look and Feel.
*
@@ -78,8 +80,7 @@ public final class LafManager {
LogManager.getLogManager().reset();
} else {
try (InputStream inputStream = DarkLaf.class.getClassLoader()
- .getResourceAsStream(
- "com/github/weisj/darklaf/log/logging.properties")) {
+ .getResourceAsStream("com/github/weisj/darklaf/log/logging.properties")) {
if (inputStream != null) {
Logger.getGlobal().fine("Loading logging configuration.");
LogManager.getLogManager().readConfiguration(inputStream);
@@ -143,9 +144,9 @@ public final class LafManager {
* if preferences have changed.
*
* @param listener the listener to add.
- * @see ThemePreferenceListener
- * @see #enabledPreferenceChangeReporting(boolean)
- * @see #isPreferenceChangeReportingEnabled()
+ * @see ThemePreferenceListener
+ * @see #enabledPreferenceChangeReporting(boolean)
+ * @see #isPreferenceChangeReportingEnabled()
*/
public static void addThemePreferenceChangeListener(final ThemePreferenceListener listener) {
ThemePreferencesHandler.getSharedInstance().addThemePreferenceChangeListener(listener);
@@ -155,9 +156,9 @@ public final class LafManager {
* Removes a {@link ThemePreferenceListener}.
*
* @param listener the listener to add.
- * @see ThemePreferenceListener
- * @see #enabledPreferenceChangeReporting(boolean)
- * @see #isPreferenceChangeReportingEnabled()
+ * @see ThemePreferenceListener
+ * @see #enabledPreferenceChangeReporting(boolean)
+ * @see #isPreferenceChangeReportingEnabled()
*/
public static void removeThemePreferenceChangeListener(final ThemePreferenceListener listener) {
ThemePreferencesHandler.getSharedInstance().removeThemePreferenceChangeListener(listener);
@@ -168,8 +169,8 @@ public final class LafManager {
* to determine these values.
*
* @return the preferred theme style.
- * @see #isPreferenceChangeReportingEnabled()
- * @see #enabledPreferenceChangeReporting(boolean)
+ * @see #isPreferenceChangeReportingEnabled()
+ * @see #enabledPreferenceChangeReporting(boolean)
*/
public static PreferredThemeStyle getPreferredThemeStyle() {
return ThemePreferencesHandler.getSharedInstance().getPreferredThemeStyle();
@@ -180,7 +181,7 @@ public final class LafManager {
* preferred theme style.
*
* @return the theme provider.
- * @see PreferredThemeStyle
+ * @see PreferredThemeStyle
*/
public static ThemeProvider getThemeProvider() {
if (themeProvider == null) themeProvider = createDefaultThemeProvider();
@@ -192,7 +193,7 @@ public final class LafManager {
* preferred theme style.
*
* @param themeProvider the theme provider.
- * @see PreferredThemeStyle
+ * @see PreferredThemeStyle
*/
public static void setThemeProvider(final ThemeProvider themeProvider) {
LafManager.themeProvider = themeProvider;
@@ -208,8 +209,8 @@ public final class LafManager {
/**
* Get the associated theme for the given preferred style.
*
- * @param style the preferred theme style.
- * @return the associated Theme or best match if there is none associated.
+ * @param style the preferred theme style.
+ * @return the associated Theme or best match if there is none associated.
*/
public static Theme themeForPreferredStyle(final PreferredThemeStyle style) {
return getThemeProvider().getTheme(style);
@@ -310,7 +311,6 @@ public final class LafManager {
setTheme(themeForPreferredStyle(preferredThemeStyle));
}
-
/**
* Sets the current theme and installs the LaF. If the LaF is already installed the theme is switched. This behaves
* exactly like {@link #setTheme(Theme)} followed by {@link #install()}
@@ -334,7 +334,7 @@ public final class LafManager {
* Overload for {@link #installTheme(Theme)}.
*
* @param theme the theme to install.
- * @see #installTheme(Theme) installTheme().
+ * @see #installTheme(Theme) installTheme().
*/
public static void install(final Theme theme) {
installTheme(theme);
@@ -350,9 +350,9 @@ public final class LafManager {
UIManager.setLookAndFeel(DarkLaf.class.getCanonicalName());
updateLaf();
} catch (final ClassNotFoundException
- | InstantiationException
- | IllegalAccessException
- | UnsupportedLookAndFeelException e) {
+ | InstantiationException
+ | IllegalAccessException
+ | UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModel.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModel.java
index 9e211193..06a33b2f 100644
--- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModel.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.color;
-import javax.swing.*;
import java.awt.*;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
@@ -34,7 +36,6 @@ public abstract class DarkColorModel {
private final String prefix;
private final String[] labels;
-
public DarkColorModel(final String name, final String... labels) {
this.prefix = "ColorChooser." + name;
this.labels = labels;
diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelCMYK.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelCMYK.java
index 7b1bdc53..ac02f47b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelCMYK.java
+++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelCMYK.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.color;
@@ -74,7 +75,6 @@ public class DarkColorModelCMYK extends DarkColorModel {
return RGBtoCMYK(color.getRed(), color.getGreen(), color.getBlue());
}
-
private static int[] RGBtoCMYK(final int r, final int g, final int b) {
double max = DarkColorModelHSL.max(r / 255.0, g / 255.0, b / 255.0);
if (max > 0.0f) {
@@ -96,12 +96,10 @@ public class DarkColorModelCMYK extends DarkColorModel {
return new Color(rgb[0], rgb[1], rgb[2]);
}
-
private static int[] CMYKtoRGB(final double c, final double m, final double y, final double k) {
rgb[0] = (int) Math.round(255 * (1 - c) * (1 - k));
rgb[1] = (int) Math.round(255 * (1 - m) * (1 - k));
rgb[2] = (int) Math.round(255 * (1 - y) * (1 - k));
return rgb;
}
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSB.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSB.java
index 1a8085b8..fe57fed7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSB.java
+++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSB.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.color;
diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java
index d4400bdf..c291d892 100644
--- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java
+++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.color;
@@ -87,13 +88,13 @@ public class DarkColorModelHSL extends DarkColorModel {
double saturation = (max - min);
if (saturation > 0.0f) {
saturation /= (summa > 1.0f)
- ? 2.0f - summa
- : summa;
+ ? 2.0f - summa
+ : summa;
}
return new double[]{
- getHue(r / 255.0, g / 255.0, b / 255.0, max, min),
- saturation,
- summa / 2.0
+ getHue(r / 255.0, g / 255.0, b / 255.0, max, min),
+ saturation,
+ summa / 2.0
};
}
@@ -115,7 +116,6 @@ public class DarkColorModelHSL extends DarkColorModel {
return Math.min(min, blue);
}
-
private static double getHue(final double red, final double green, final double blue,
final double max, final double min) {
double hue = max - min;
@@ -127,7 +127,7 @@ public class DarkColorModelHSL extends DarkColorModel {
}
} else if (max == green) {
hue = 2.0f + (blue - red) / hue;
- } else /*max == blue*/ {
+ } else /* max == blue */ {
hue = 4.0f + (red - green) / hue;
}
hue /= 6.0f;
@@ -143,7 +143,8 @@ public class DarkColorModelHSL extends DarkColorModel {
private static int[] HSLtoRGB(final double h, final double saturation, final double lightness) {
double hue = h;
- while (hue < 0) hue += 1;
+ while (hue < 0)
+ hue += 1;
hue = hue - Math.floor(hue);
if (saturation > 0.0f) {
hue = (hue < 1.0f) ? hue * 6.0f : 0.0f;
diff --git a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelRGB.java b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelRGB.java
index 1adff6e2..970303c8 100644
--- a/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelRGB.java
+++ b/core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelRGB.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.color;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ArrowButton.java b/core/src/main/java/com/github/weisj/darklaf/components/ArrowButton.java
index 43f158eb..d8e74dc7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ArrowButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ArrowButton.java
@@ -20,26 +20,25 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.icons.UIAwareIcon;
-import com.github.weisj.darklaf.ui.button.DarkButtonUI;
+import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.DimensionUIResource;
import javax.swing.plaf.basic.BasicArrowButton;
-import java.awt.*;
+
+import com.github.weisj.darklaf.icons.UIAwareIcon;
+import com.github.weisj.darklaf.ui.button.DarkButtonUI;
/**
* @author Jannis Weis
*/
public final class ArrowButton implements SwingConstants {
-
- private ArrowButton() {
- }
-
+ private ArrowButton() {}
public static JButton createUpDownArrow(final JComponent parent, final int orientation,
final boolean center) {
@@ -47,25 +46,23 @@ public final class ArrowButton implements SwingConstants {
new Insets(0, 0, 0, 0));
}
-
public static JButton createUpDownArrow(final JComponent parent, final int orientation,
final boolean center, final boolean applyInsetsOnSize,
final Insets insets) {
UIAwareIcon icon;
switch (orientation) {
- case NORTH:
+ case NORTH :
icon = (UIAwareIcon) UIManager.getIcon("ArrowButton.up.icon");
break;
- case SOUTH:
+ case SOUTH :
icon = (UIAwareIcon) UIManager.getIcon("ArrowButton.down.icon");
break;
- default:
+ default :
throw new IllegalStateException("Invalid button orientation: " + orientation);
}
return createUpDownArrow(parent, icon, icon.getDual(), orientation, center, applyInsetsOnSize, insets);
}
-
public static JButton createUpDownArrow(final JComponent parent,
final Icon activeIcon, final Icon inactiveIcon,
final int orientation, final boolean center,
@@ -105,13 +102,11 @@ public final class ArrowButton implements SwingConstants {
getIcon().paintIcon(this, g, x, y);
}
-
@Override
public Insets getInsets() {
return getInsets(new Insets(0, 0, 0, 0));
}
-
@Override
public Insets getInsets(final Insets i) {
i.left = insets.left;
@@ -121,7 +116,6 @@ public final class ArrowButton implements SwingConstants {
return i;
}
-
@Override
public boolean isOpaque() {
return false;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabComponent.java b/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabComponent.java
index 69ce28c7..943cc55e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabComponent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabComponent.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.ui.button.DarkButtonUI;
-import com.github.weisj.darklaf.ui.tabbedpane.DarkTabbedPaneUI;
+import java.awt.*;
+import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
-import java.awt.event.*;
+
+import com.github.weisj.darklaf.ui.button.DarkButtonUI;
+import com.github.weisj.darklaf.ui.tabbedpane.DarkTabbedPaneUI;
/**
* @author Jannis Weis
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabbedPane.java b/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabbedPane.java
index 948f6f4f..df01674d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabbedPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ClosableTabbedPane.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import javax.swing.*;
import java.awt.*;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
@@ -86,12 +88,12 @@ public class ClosableTabbedPane extends JTabbedPane {
private void notifyTabListeners(final TabEvent event) {
TabListener[] listeners = listenerList.getListeners(TabListener.class);
switch (event.getID()) {
- case TabEvent.TAB_CLOSED:
+ case TabEvent.TAB_CLOSED :
for (TabListener l : listeners) {
l.tabClosed(event);
}
break;
- case TabEvent.TAB_OPENED:
+ case TabEvent.TAB_OPENED :
for (TabListener l : listeners) {
l.tabOpened(event);
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ColorPipetteBase.java b/core/src/main/java/com/github/weisj/darklaf/components/ColorPipetteBase.java
index a7dab824..0eea15db 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ColorPipetteBase.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ColorPipetteBase.java
@@ -20,23 +20,23 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
-
package com.github.weisj.darklaf.components;
+import java.awt.*;
+import java.awt.event.AWTEventListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicRootPaneUI;
import com.github.weisj.darklaf.ui.colorchooser.ColorListener;
import com.github.weisj.darklaf.ui.colorchooser.ColorPipette;
import com.github.weisj.darklaf.ui.rootpane.DarkRootPaneUI;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicRootPaneUI;
-import java.awt.*;
-import java.awt.event.AWTEventListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener {
protected final JComponent parent;
protected final Robot robot;
@@ -55,7 +55,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
robot = createRobot();
}
-
private static Robot createRobot() {
try {
return new Robot();
@@ -80,7 +79,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
return robot.getPixelColor(location.x, location.y);
}
-
protected Color getInitialColor() {
return initialColor;
}
@@ -91,7 +89,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
setColor(initialColor);
}
-
@Override
public Color getColor() {
return currentColor;
@@ -106,8 +103,8 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
Window picker = getOrCreatePickerWindow();
Toolkit.getDefaultToolkit().addAWTEventListener(this,
AWTEvent.MOUSE_MOTION_EVENT_MASK
- | AWTEvent.MOUSE_EVENT_MASK
- | AWTEvent.KEY_EVENT_MASK);
+ | AWTEvent.MOUSE_EVENT_MASK
+ | AWTEvent.KEY_EVENT_MASK);
updateLocation();
picker.setVisible(true);
return picker;
@@ -138,7 +135,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
Toolkit.getDefaultToolkit().removeAWTEventListener(this);
}
-
protected Window getOrCreatePickerWindow() {
if (pickerWindow == null) {
Window owner = SwingUtilities.getWindowAncestor(parent);
@@ -152,7 +148,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
return pickerWindow;
}
-
protected Point updateLocation() {
PointerInfo pointerInfo = MouseInfo.getPointerInfo();
if (pointerInfo == null) return null;
@@ -169,7 +164,6 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
return new PickerWindow();
}
-
protected Window getPickerWindow() {
return pickerWindow;
}
@@ -183,23 +177,23 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
public void eventDispatched(final AWTEvent event) {
if (pickerWindow == null || !pickerWindow.isVisible()) return;
switch (event.getID()) {
- case MouseEvent.MOUSE_PRESSED:
+ case MouseEvent.MOUSE_PRESSED :
((MouseEvent) event).consume();
pickAndClose();
break;
- case MouseEvent.MOUSE_CLICKED:
+ case MouseEvent.MOUSE_CLICKED :
((MouseEvent) event).consume();
break;
- case KeyEvent.KEY_PRESSED:
+ case KeyEvent.KEY_PRESSED :
downKeyCode = ((KeyEvent) event).getKeyCode();
switch (downKeyCode) {
- case KeyEvent.VK_ESCAPE:
+ case KeyEvent.VK_ESCAPE :
cancelPipette();
break;
- case KeyEvent.VK_ENTER:
+ case KeyEvent.VK_ENTER :
pickAndClose();
break;
- default:
+ default :
break;
}
if (!keyDown) {
@@ -207,14 +201,14 @@ public abstract class ColorPipetteBase implements ColorPipette, AWTEventListener
updatePipette(true);
}
break;
- case KeyEvent.KEY_RELEASED:
+ case KeyEvent.KEY_RELEASED :
keyDown = false;
Window picker = getPickerWindow();
if (picker != null) {
picker.repaint();
}
break;
- default:
+ default :
break;
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ColoredRadioButton.java b/core/src/main/java/com/github/weisj/darklaf/components/ColoredRadioButton.java
index a6b8e402..3218cd71 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ColoredRadioButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ColoredRadioButton.java
@@ -20,9 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
+import java.awt.*;
+import java.util.Properties;
+
+import javax.swing.*;
+import javax.swing.plaf.ButtonUI;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.PropertyLoader;
@@ -32,11 +39,6 @@ import com.github.weisj.darklaf.task.AccentColorAdjustmentTask;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.ui.togglebutton.radiobutton.DarkRadioButtonUI;
-import javax.swing.*;
-import javax.swing.plaf.ButtonUI;
-import java.awt.*;
-import java.util.Properties;
-
public class ColoredRadioButton extends JRadioButton {
public static final Color DEFAULT_FILLED = new Color(0);
@@ -73,35 +75,35 @@ public class ColoredRadioButton extends JRadioButton {
protected static class ColoredRadioButtonUI extends DarkRadioButtonUI {
private static final String[] PROPERTIES = {
- "Icons.RadioButton.activeFillColor",
- "Icons.RadioButton.activeBorderColor",
- "Icons.RadioButtonDisabled.inactiveFillColor",
- "Icons.RadioButtonDisabled.inactiveBorderColor",
- "Icons.RadioButtonFocused.activeFillColor",
- "Icons.RadioButtonFocused.focusBorderColor",
- "Icons.RadioButtonFocused.glowFocus",
- "Icons.RadioButtonFocused.glowOpacity",
- "Icons.RadioButtonSelected.selectedFillColor",
- "Icons.RadioButtonSelected.selectedBorderColor",
- "Icons.RadioButtonSelected.selectionSelectedColor",
- "Icons.RadioButtonSelectedDisabled.inactiveFillColor",
- "Icons.RadioButtonSelectedDisabled.inactiveBorderColor",
- "Icons.RadioButtonSelectedDisabled.selectionDisabledColor",
- "Icons.RadioButtonSelectedFocused.selectedFillColor",
- "Icons.RadioButtonSelectedFocused.focusSelectedBorderColor",
- "Icons.RadioButtonSelectedFocused.selectionFocusSelectedColor",
- "Icons.RadioButtonSelectedFocused.glowFocus",
- "Icons.RadioButtonSelectedFocused.glowOpacity"
+ "Icons.RadioButton.activeFillColor",
+ "Icons.RadioButton.activeBorderColor",
+ "Icons.RadioButtonDisabled.inactiveFillColor",
+ "Icons.RadioButtonDisabled.inactiveBorderColor",
+ "Icons.RadioButtonFocused.activeFillColor",
+ "Icons.RadioButtonFocused.focusBorderColor",
+ "Icons.RadioButtonFocused.glowFocus",
+ "Icons.RadioButtonFocused.glowOpacity",
+ "Icons.RadioButtonSelected.selectedFillColor",
+ "Icons.RadioButtonSelected.selectedBorderColor",
+ "Icons.RadioButtonSelected.selectionSelectedColor",
+ "Icons.RadioButtonSelectedDisabled.inactiveFillColor",
+ "Icons.RadioButtonSelectedDisabled.inactiveBorderColor",
+ "Icons.RadioButtonSelectedDisabled.selectionDisabledColor",
+ "Icons.RadioButtonSelectedFocused.selectedFillColor",
+ "Icons.RadioButtonSelectedFocused.focusSelectedBorderColor",
+ "Icons.RadioButtonSelectedFocused.selectionFocusSelectedColor",
+ "Icons.RadioButtonSelectedFocused.glowFocus",
+ "Icons.RadioButtonSelectedFocused.glowOpacity"
};
private static final String[] COLOR_PROPERTIES = {
- "Icons.RadioButton.activeFillColor",
- "Icons.RadioButton.activeBorderColor",
- "Icons.RadioButtonFocused.activeFillColor",
- "Icons.RadioButtonFocused.focusBorderColor",
- "Icons.RadioButtonSelected.selectedFillColor",
- "Icons.RadioButtonSelected.selectedBorderColor",
- "Icons.RadioButtonSelectedFocused.selectedFillColor",
- "Icons.RadioButtonSelectedFocused.focusSelectedBorderColor"
+ "Icons.RadioButton.activeFillColor",
+ "Icons.RadioButton.activeBorderColor",
+ "Icons.RadioButtonFocused.activeFillColor",
+ "Icons.RadioButtonFocused.focusBorderColor",
+ "Icons.RadioButtonSelected.selectedFillColor",
+ "Icons.RadioButtonSelected.selectedBorderColor",
+ "Icons.RadioButtonSelectedFocused.selectedFillColor",
+ "Icons.RadioButtonSelectedFocused.focusSelectedBorderColor"
};
private Properties propertyMap;
@@ -129,12 +131,11 @@ public class ColoredRadioButton extends JRadioButton {
theme.loadDefaults(props, defaults);
Color c = color == DEFAULT_FILLED ? (Color) props.get("widgetFillDefault") : color;
adjustment.applyColors(LafManager.getTheme(), props, c, null);
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, "radioButton", "properties/ui/"),
- props, defaults);
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, "radioButton", "properties/icons/"),
- props, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, "radioButton", "properties/ui/"),
+ props, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, "radioButton",
+ "properties/icons/"),
+ props, defaults);
propertyMap = new Properties();
for (String prop : PROPERTIES) {
propertyMap.put(prop, props.get(prop));
@@ -144,12 +145,12 @@ public class ColoredRadioButton extends JRadioButton {
}
stateIcon = new StateIcon(new Icon[]{
- load(loader, "control/radio.svg"),
- load(loader, "control/radioDisabled.svg"),
- load(loader, "control/radioFocused.svg"),
- load(loader, "control/radioSelected.svg"),
- load(loader, "control/radioSelectedDisabled.svg"),
- load(loader, "control/radioSelectedFocused.svg")
+ load(loader, "control/radio.svg"),
+ load(loader, "control/radioDisabled.svg"),
+ load(loader, "control/radioFocused.svg"),
+ load(loader, "control/radioSelected.svg"),
+ load(loader, "control/radioSelectedDisabled.svg"),
+ load(loader, "control/radioSelectedFocused.svg")
});
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/DefaultButton.java b/core/src/main/java/com/github/weisj/darklaf/components/DefaultButton.java
index f07195b7..c62d00e0 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/DefaultButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/DefaultButton.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/DefaultColorPipette.java b/core/src/main/java/com/github/weisj/darklaf/components/DefaultColorPipette.java
index 52ff66c9..213bdd99 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/DefaultColorPipette.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/DefaultColorPipette.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.ui.colorchooser.ColorListener;
-import com.github.weisj.darklaf.util.GraphicsContext;
-import com.github.weisj.darklaf.util.GraphicsUtil;
-import com.github.weisj.darklaf.util.TimerUtil;
-
-import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Ellipse2D;
import java.awt.image.BufferedImage;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.ui.colorchooser.ColorListener;
+import com.github.weisj.darklaf.util.GraphicsContext;
+import com.github.weisj.darklaf.util.GraphicsUtil;
+import com.github.weisj.darklaf.util.TimerUtil;
+
public class DefaultColorPipette extends ColorPipetteBase {
private static final int SIZE = 36;
private static final int DIALOG_SIZE = 50;
@@ -196,7 +198,7 @@ public class DefaultColorPipette extends ColorPipetteBase {
GraphicsUtil.setupStrokePainting(g2);
Graphics2D g = (Graphics2D) g2;
- //Draw region to be recognised as inside the window.
+ // Draw region to be recognised as inside the window.
g.setColor(Color.WHITE);
GraphicsContext config = GraphicsUtil.paintWithAlpha(g, 0.005f);
Point p = MouseInfo.getPointerInfo().getLocation();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/Disposable.java b/core/src/main/java/com/github/weisj/darklaf/components/Disposable.java
index 9ebdb1f4..52586152 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/Disposable.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/Disposable.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/JXPopupMenu.java b/core/src/main/java/com/github/weisj/darklaf/components/JXPopupMenu.java
index cf0c1692..88d8598c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/JXPopupMenu.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/JXPopupMenu.java
@@ -20,16 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.util.DarkUIUtil;
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.*;
+
import org.jdesktop.jxlayer.JXLayer;
import org.pbjar.jxlayer.plaf.ext.TransformUI;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.geom.AffineTransform;
+import com.github.weisj.darklaf.util.DarkUIUtil;
/**
* Popup menu that is aware of {@link org.pbjar.jxlayer.plaf.ext.TransformUI}.
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/OverlayScrollPane.java b/core/src/main/java/com/github/weisj/darklaf/components/OverlayScrollPane.java
index 1ecbf14a..d02efb7b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/OverlayScrollPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/OverlayScrollPane.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.ui.scrollpane.ScrollLayoutManagerDelegate;
+import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ScrollPaneUI;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.scrollpane.ScrollLayoutManagerDelegate;
/**
* Scroll pane that displays its content beneath the scrollbar.
@@ -54,7 +56,7 @@ public class OverlayScrollPane extends JLayeredPane {
* scrolling in underway or the mouse is over the scrollbar position.
*
* @param view the component to display in the scrollable viewport
- * @see JScrollPane#setViewportView
+ * @see JScrollPane#setViewportView
*/
public OverlayScrollPane(final JComponent view) {
this(view, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
@@ -64,7 +66,8 @@ public class OverlayScrollPane extends JLayeredPane {
* Creates a JScrollIndicator that displays the view component in a viewport whose view position can be controlled
* with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed, For example, if
* vsbPolicy is JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED then the vertical scrollbar only appears if the view
- * doesn't fit vertically. The available policy settings are listed at {@link JScrollPane#setVerticalScrollBarPolicy(int)}
+ * doesn't fit vertically. The available policy settings are listed at
+ * {@link JScrollPane#setVerticalScrollBarPolicy(int)}
* and {@link JScrollPane#setHorizontalScrollBarPolicy}.
*
* @param view the view of the component.
@@ -89,7 +92,6 @@ public class OverlayScrollPane extends JLayeredPane {
*
* @return the scrollPane
*/
-
public JScrollPane getScrollPane() {
return scrollPane;
}
@@ -111,7 +113,6 @@ public class OverlayScrollPane extends JLayeredPane {
controlPanel.showHorizontalScrollBar(policy != JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
}
-
public JScrollBar getVerticalScrollBar() {
return scrollPane.verticalScrollBar;
}
@@ -121,7 +122,6 @@ public class OverlayScrollPane extends JLayeredPane {
return scrollPane.getPreferredSize();
}
-
public JScrollBar getHorizontalScrollBar() {
return scrollPane.horizontalScrollBar;
}
@@ -148,7 +148,6 @@ public class OverlayScrollPane extends JLayeredPane {
private JScrollBar verticalScrollBar;
private JScrollBar horizontalScrollBar;
-
protected OScrollPane(final JComponent view, final int vsbPolicy, final int hsbPolicy) {
super(view, vsbPolicy, hsbPolicy);
}
@@ -294,12 +293,9 @@ public class OverlayScrollPane extends JLayeredPane {
&& scrollPane.verticalScrollBar.getBounds().contains(x, y);
}
-
@Override
public boolean isOpaque() {
return false;
}
}
-
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/ScrollPopupMenu.java b/core/src/main/java/com/github/weisj/darklaf/components/ScrollPopupMenu.java
index 12a1cb17..2e1f3910 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/ScrollPopupMenu.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/ScrollPopupMenu.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.ui.popupmenu.PopupMenuContainer;
-import com.github.weisj.darklaf.util.PropertyKey;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.popupmenu.PopupMenuContainer;
+import com.github.weisj.darklaf.util.PropertyKey;
/**
* @author Jannis Weis
@@ -84,7 +86,6 @@ public class ScrollPopupMenu extends JPopupMenu {
posY = y;
}
-
@Override
public void setVisible(final boolean b) {
if (b == isVisible()) {
@@ -126,8 +127,7 @@ public class ScrollPopupMenu extends JPopupMenu {
}
@Override
- public void pack() {
- }
+ public void pack() {}
private boolean isPopupMenu() {
Component invoker = getInvoker();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/SelectableTreeNode.java b/core/src/main/java/com/github/weisj/darklaf/components/SelectableTreeNode.java
index 3d17e27b..c17bdc1b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/SelectableTreeNode.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/SelectableTreeNode.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/TabEvent.java b/core/src/main/java/com/github/weisj/darklaf/components/TabEvent.java
index 79c98b7d..9a4d0960 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/TabEvent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/TabEvent.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/TabListener.java b/core/src/main/java/com/github/weisj/darklaf/components/TabListener.java
index 86ee479e..6a77c62a 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/TabListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/TabListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/TabPropertyChangeEvent.java b/core/src/main/java/com/github/weisj/darklaf/components/TabPropertyChangeEvent.java
index e388e925..7acfba38 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/TabPropertyChangeEvent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/TabPropertyChangeEvent.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/VolumeSlider.java b/core/src/main/java/com/github/weisj/darklaf/components/VolumeSlider.java
index 18d30332..48814aac 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/VolumeSlider.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/VolumeSlider.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components;
-import com.github.weisj.darklaf.ui.slider.DarkSliderUI;
-
import javax.swing.*;
+import com.github.weisj.darklaf.ui.slider.DarkSliderUI;
+
public class VolumeSlider extends JSlider {
private boolean showVolumeIcon;
@@ -38,79 +39,75 @@ public class VolumeSlider extends JSlider {
this(HORIZONTAL, 0, 100, 50);
}
-
/**
* Creates a slider using the specified orientation with the range {@code 0} to {@code 100} and an initial value of
* {@code 50}. The orientation can be either SwingConstants.VERTICAL or
* SwingConstants.HORIZONTAL.
*
- * @param orientation the orientation of the slider
+ * @param orientation the orientation of the slider
* @throws IllegalArgumentException if orientation is not one of {@code VERTICAL}, {@code HORIZONTAL}
- * @see #setOrientation
+ * @see #setOrientation
*/
public VolumeSlider(final int orientation) {
this(orientation, 0, 100, 50);
}
-
/**
* Creates a horizontal slider using the specified min and max with an initial value equal to the average of the min
* plus max.
*
* The BoundedRangeModel that holds the slider's data handles any issues that may arise from improperly
- * setting the minimum and maximum values on the slider. See the {@code BoundedRangeModel} documentation for
+ * setting the minimum and maximum values on the slider. See the {@code BoundedRangeModel} documentation for
* details.
*
* @param min the minimum value of the slider
* @param max the maximum value of the slider
- * @see BoundedRangeModel
- * @see #setMinimum
- * @see #setMaximum
+ * @see BoundedRangeModel
+ * @see #setMinimum
+ * @see #setMaximum
*/
public VolumeSlider(final int min, final int max) {
this(HORIZONTAL, min, max, (min + max) / 2);
}
-
/**
* Creates a horizontal slider using the specified min, max and value.
*
* The BoundedRangeModel that holds the slider's data handles any issues that may arise from improperly
- * setting the minimum, initial, and maximum values on the slider. See the {@code BoundedRangeModel} documentation
+ * setting the minimum, initial, and maximum values on the slider. See the {@code BoundedRangeModel} documentation
* for details.
*
* @param min the minimum value of the slider
* @param max the maximum value of the slider
* @param value the initial value of the slider
- * @see BoundedRangeModel
- * @see #setMinimum
- * @see #setMaximum
- * @see #setValue
+ * @see BoundedRangeModel
+ * @see #setMinimum
+ * @see #setMaximum
+ * @see #setValue
*/
public VolumeSlider(final int min, final int max, final int value) {
this(HORIZONTAL, min, max, value);
}
-
/**
* Creates a slider with the specified orientation and the specified minimum, maximum, and initial values. The
* orientation can be either SwingConstants.VERTICAL or
* SwingConstants.HORIZONTAL.
*
* The BoundedRangeModel that holds the slider's data handles any issues that may arise from improperly
- * setting the minimum, initial, and maximum values on the slider. See the {@code BoundedRangeModel} documentation
+ * setting the minimum, initial, and maximum values on the slider. See the {@code BoundedRangeModel} documentation
* for details.
*
- * @param orientation the orientation of the slider
- * @param min the minimum value of the slider
- * @param max the maximum value of the slider
- * @param value the initial value of the slider
+ * @param orientation the orientation of the slider
+ * @param min the minimum value of the slider
+ * @param max the maximum value of the slider
+ * @param value the initial value of the slider
* @throws IllegalArgumentException if orientation is not one of {@code VERTICAL}, {@code HORIZONTAL}
- * @see BoundedRangeModel
- * @see #setOrientation
- * @see #setMinimum
- * @see #setMaximum
- * @see #setValue
+ * @see BoundedRangeModel
+ * @see #setOrientation
+ * @see #setMinimum
+ * @see #setMaximum
+ * @see #setValue
*/
public VolumeSlider(final int orientation, final int min, final int max, final int value) {
super(orientation, min, max, value);
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/alignment/AlignmentStrategy.java b/core/src/main/java/com/github/weisj/darklaf/components/alignment/AlignmentStrategy.java
index f2d145f5..9504ce0f 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/alignment/AlignmentStrategy.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/alignment/AlignmentStrategy.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.alignment;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/BubbleBorder.java b/core/src/main/java/com/github/weisj/darklaf/components/border/BubbleBorder.java
index dd8d37db..a45d6f3e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/border/BubbleBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/border/BubbleBorder.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.border;
-import com.github.weisj.darklaf.util.Alignment;
-import com.github.weisj.darklaf.util.GraphicsContext;
-import com.github.weisj.darklaf.util.GraphicsUtil;
-
-import javax.swing.border.AbstractBorder;
-import javax.swing.plaf.InsetsUIResource;
import java.awt.*;
import java.awt.geom.Area;
import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D;
+import javax.swing.border.AbstractBorder;
+import javax.swing.plaf.InsetsUIResource;
+
+import com.github.weisj.darklaf.util.Alignment;
+import com.github.weisj.darklaf.util.GraphicsContext;
+import com.github.weisj.darklaf.util.GraphicsUtil;
+
/**
* @author Jannis Weis
*/
@@ -89,10 +91,9 @@ public class BubbleBorder extends AbstractBorder {
/**
* Set the border colour.
*
- * @param color border colour
- * @return this
+ * @param color border colour
+ * @return this
*/
-
public BubbleBorder setColor(final Color color) {
this.color = color;
return this;
@@ -110,15 +111,14 @@ public class BubbleBorder extends AbstractBorder {
/**
* Set the with of the pointer base.
*
- * @param pointerWidth the width of the pointer base.
- * @return this
+ * @param pointerWidth the width of the pointer base.
+ * @return this
*/
public BubbleBorder setPointerWidth(final int pointerWidth) {
this.pointerWidth = pointerWidth;
return this;
}
-
/**
* Get the border thickness.
*
@@ -131,10 +131,9 @@ public class BubbleBorder extends AbstractBorder {
/**
* Set the border thickness.
*
- * @param n new thickness
- * @return this
+ * @param n new thickness
+ * @return this
*/
-
public BubbleBorder setThickness(final int n) {
thickness = Math.max(n, 0);
return setPointerSize(pointerSize);
@@ -152,10 +151,9 @@ public class BubbleBorder extends AbstractBorder {
/**
* Set the pointer size Clips at 0.
*
- * @param size size of pointer.
- * @return this
+ * @param size size of pointer.
+ * @return this
*/
-
public BubbleBorder setPointerSize(final int size) {
pointerSize = Math.max(size, 0);
float left = thickness;
@@ -164,23 +162,23 @@ public class BubbleBorder extends AbstractBorder {
float top = thickness;
switch (pointerSide) {
- case NORTH:
- case NORTH_WEST:
- case NORTH_EAST:
+ case NORTH :
+ case NORTH_WEST :
+ case NORTH_EAST :
top += pointerSize;
break;
- case SOUTH:
- case SOUTH_WEST:
- case SOUTH_EAST:
+ case SOUTH :
+ case SOUTH_WEST :
+ case SOUTH_EAST :
bottom += pointerSize;
break;
- case WEST:
+ case WEST :
left += pointerSize;
break;
- case EAST:
+ case EAST :
right += pointerSize;
break;
- default:
+ default :
break;
}
insets.set((int) top, (int) left, (int) bottom, (int) right);
@@ -199,10 +197,9 @@ public class BubbleBorder extends AbstractBorder {
/**
* Set the corner radius.
*
- * @param radius radius of corner.
- * @return this
+ * @param radius radius of corner.
+ * @return this
*/
-
public BubbleBorder setRadius(final int radius) {
this.radius = radius;
return setPointerSize(pointerSize);
@@ -222,10 +219,9 @@ public class BubbleBorder extends AbstractBorder {
* Alignment#NORTH_EAST} and {@link Alignment#NORTH_WEST} as well as {@link Alignment#SOUTH}, {@link
* Alignment#SOUTH_EAST} and {@link Alignment#SOUTH_WEST} {@link Alignment#CENTER} results in no pointer.
*
- * @param side direction in which the pointer should point.
- * @return this.
+ * @param side direction in which the pointer should point.
+ * @return this.
*/
-
public BubbleBorder setPointerSide(final Alignment side) {
this.pointerSide = side;
setPointerSize(pointerSize);
@@ -236,27 +232,26 @@ public class BubbleBorder extends AbstractBorder {
return (float) calculatePointerPad(w, h, Alignment.NORTH_WEST);
}
-
private double calculatePointerPad(final float width, final float height, final Alignment side) {
double pointerPad;
switch (side) {
- case WEST:
- case EAST:
+ case WEST :
+ case EAST :
pointerPad = radius + (height - insets.top - insets.bottom - 2 * radius) / 2.0;
break;
- case NORTH_WEST:
- case SOUTH_WEST:
+ case NORTH_WEST :
+ case SOUTH_WEST :
pointerPad = radius + insets.left + pointerWidth;
break;
- case NORTH_EAST:
- case SOUTH_EAST:
+ case NORTH_EAST :
+ case SOUTH_EAST :
pointerPad = width - radius - insets.right - pointerWidth;
break;
- case SOUTH:
- case NORTH:
+ case SOUTH :
+ case NORTH :
pointerPad = radius + (0.5 * (width - insets.left - insets.right - 2 * radius));
break;
- default:
+ default :
pointerPad = 0;
break;
}
@@ -270,13 +265,11 @@ public class BubbleBorder extends AbstractBorder {
paintBorder(g, area);
}
-
@Override
public Insets getBorderInsets(final Component c) {
return new InsetsUIResource(insets.top, insets.left, insets.bottom, insets.right);
}
-
@Override
public Insets getBorderInsets(final Component c, final Insets insets) {
return getBorderInsets(c);
@@ -294,15 +287,15 @@ public class BubbleBorder extends AbstractBorder {
if (pointerSide != Alignment.CENTER) {
double pointerPad = calculatePointerPad(w, h, pointerSide);
switch (pointerSide) {
- case SOUTH_EAST:
- case NORTH_EAST:
+ case SOUTH_EAST :
+ case NORTH_EAST :
if (inner) pointerPad += adj;
break;
- case NORTH_WEST:
- case SOUTH_WEST:
+ case NORTH_WEST :
+ case SOUTH_WEST :
if (inner) pointerPad -= adj;
break;
- default:
+ default :
break;
}
Path2D pointer = creatPointerShape(pointerPad, pSize, pWidth, bubble);
@@ -326,14 +319,12 @@ public class BubbleBorder extends AbstractBorder {
config.restore();
}
-
public RoundRectangle2D.Float calculateBubbleRect(final float x, final float y,
final float width, final float height) {
return new RoundRectangle2D.Float(x + insets.left, y + insets.top, width - insets.left - insets.right,
height - insets.top - insets.bottom, radius, radius);
}
-
private Path2D creatPointerShape(final double pointerPad, final double pSize, final double pWidth,
final RoundRectangle2D.Float bubble) {
final double w = pWidth / 2.0;
@@ -341,31 +332,31 @@ public class BubbleBorder extends AbstractBorder {
double x = bubble.x;
double y = bubble.y;
switch (pointerSide) {
- case WEST:
- pointer.moveTo(x, y + pointerPad - w); //Top
+ case WEST :
+ pointer.moveTo(x, y + pointerPad - w); // Top
pointer.lineTo(x - pSize, y + pointerPad);
pointer.lineTo(x, y + pointerPad + w);// bottom
break;
- case EAST:
+ case EAST :
pointer.moveTo(x + bubble.width, y + pointerPad - w);// top
pointer.lineTo(x + bubble.width + pSize, y + pointerPad);
pointer.lineTo(x + bubble.width, y + pointerPad + w);// bottom
break;
- case NORTH:
- case NORTH_WEST:
- case NORTH_EAST:
+ case NORTH :
+ case NORTH_WEST :
+ case NORTH_EAST :
pointer.moveTo(x + pointerPad - w, y);// left
pointer.lineTo(x + pointerPad, y - pSize);
pointer.lineTo(x + pointerPad + w, y);// right
break;
- case SOUTH:
- case SOUTH_WEST:
- case SOUTH_EAST:
+ case SOUTH :
+ case SOUTH_WEST :
+ case SOUTH_EAST :
pointer.moveTo(x + pointerPad - w, y + bubble.height);// left
pointer.lineTo(x + pointerPad, y + bubble.height + pSize);
pointer.lineTo(x + pointerPad + w, y + bubble.height);// right
break;
- default:
+ default :
break;
}
pointer.closePath();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java
index fdd01a88..9005fa49 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.border;
-import javax.swing.border.Border;
import java.awt.*;
+import javax.swing.border.Border;
+
public final class DarkBorders {
private static DarkLineBorder sharedBorderEmpty;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkLineBorder.java b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkLineBorder.java
index 681c9d29..851bae0d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/border/DarkLineBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/border/DarkLineBorder.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.border;
+import java.awt.*;
+import java.util.function.Function;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.Theme;
-import javax.swing.*;
-import java.awt.*;
-import java.util.function.Function;
-
public class DarkLineBorder extends MutableLineBorder {
private final String key;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/DropShadowBorder.java b/core/src/main/java/com/github/weisj/darklaf/components/border/DropShadowBorder.java
index 2c06f1de..442dd3f5 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/border/DropShadowBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/border/DropShadowBorder.java
@@ -20,13 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.border;
-
-import com.github.weisj.darklaf.util.ImageUtil;
-
-import javax.swing.border.Border;
import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
@@ -37,17 +34,24 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
+import javax.swing.border.Border;
+
+import com.github.weisj.darklaf.util.ImageUtil;
+
/**
* Implements a DropShadow for components. In general, the DropShadowBorder will work with any rectangular components
* that do not have a default border installed as part of the look and feel, or otherwise. For example, DropShadowBorder
* works wonderfully with JPanel, but horribly with JComboBox.
*
* Note: {@code DropShadowBorder} should usually be added to non-opaque components, otherwise the background is likely
- * to bleed through.
- *
Note: Since generating drop shadows is relatively expensive operation,
+ * to bleed through.
+ *
+ *
+ * Note: Since generating drop shadows is relatively expensive operation,
* {@code DropShadowBorder} keeps internal static cache that allows sharing same border for multiple re-rendering and
* between different instances of the class. Since this cache is shared at class level and never reset, it might bleed
- * your app memory in case you tend to create many different borders rapidly.
+ * your app memory in case you tend to create many different borders rapidly.
+ *
*
* @author rbair Adaptions made by
* @author Jannis Weis
@@ -63,18 +67,15 @@ public class DropShadowBorder implements Border, Serializable {
private boolean showBottomShadow;
private boolean showRightShadow;
-
public DropShadowBorder() {
this(Color.BLACK, 5);
}
-
public DropShadowBorder(final Color shadowColor, final int shadowSize) {
this(shadowColor, shadowSize, .5f, 12, false, true,
true, true);
}
-
public DropShadowBorder(final Color shadowColor, final int shadowSize,
final float shadowOpacity, final int cornerSize, final boolean showTopShadow,
final boolean showLeftShadow, final boolean showBottomShadow,
@@ -89,7 +90,6 @@ public class DropShadowBorder implements Border, Serializable {
setShowRightShadow(showRightShadow);
}
-
@Override
public void paintBorder(final Component c, final Graphics graphics,
final int x, final int y, final int width, final int height) {
@@ -102,14 +102,14 @@ public class DropShadowBorder implements Border, Serializable {
Graphics2D g2 = (Graphics2D) graphics.create();
try {
- //The location and size of the shadows depends on which shadows are being
- //drawn. For instance, if the left & bottom shadows are being drawn, then
- //the left shadow extends all the way down to the corner, a corner is drawn,
- //and then the bottom shadow begins at the corner. If, however, only the
- //bottom shadow is drawn, then the bottom-left corner is drawn to the
- //right of the corner, and the bottom shadow is somewhat shorter than before.
+ // The location and size of the shadows depends on which shadows are being
+ // drawn. For instance, if the left & bottom shadows are being drawn, then
+ // the left shadow extends all the way down to the corner, a corner is drawn,
+ // and then the bottom shadow begins at the corner. If, however, only the
+ // bottom shadow is drawn, then the bottom-left corner is drawn to the
+ // right of the corner, and the bottom shadow is somewhat shorter than before.
- int shadowOffset = 2; //the distance between the shadow and the edge
+ int shadowOffset = 2; // the distance between the shadow and the edge
Point topLeftShadowPoint = null;
if (showLeftShadow || showTopShadow) {
@@ -166,9 +166,8 @@ public class DropShadowBorder implements Border, Serializable {
if (showLeftShadow) {
assert topLeftShadowPoint != null && bottomLeftShadowPoint != null;
- Rectangle leftShadowRect =
- new Rectangle(x, topLeftShadowPoint.y + shadowSize, shadowSize,
- bottomLeftShadowPoint.y - topLeftShadowPoint.y - shadowSize);
+ Rectangle leftShadowRect = new Rectangle(x, topLeftShadowPoint.y + shadowSize, shadowSize,
+ bottomLeftShadowPoint.y - topLeftShadowPoint.y - shadowSize);
g2.drawImage(images[Position.LEFT.ordinal()],
leftShadowRect.x, leftShadowRect.y,
leftShadowRect.width, leftShadowRect.height, null);
@@ -176,10 +175,11 @@ public class DropShadowBorder implements Border, Serializable {
if (showBottomShadow) {
assert bottomLeftShadowPoint != null && bottomRightShadowPoint != null;
- Rectangle bottomShadowRect =
- new Rectangle(bottomLeftShadowPoint.x + shadowSize, y + height - shadowSize,
- bottomRightShadowPoint.x - bottomLeftShadowPoint.x - shadowSize,
- shadowSize);
+ Rectangle bottomShadowRect = new Rectangle(bottomLeftShadowPoint.x + shadowSize,
+ y + height - shadowSize,
+ bottomRightShadowPoint.x - bottomLeftShadowPoint.x
+ - shadowSize,
+ shadowSize);
g2.drawImage(images[Position.BOTTOM.ordinal()],
bottomShadowRect.x, bottomShadowRect.y,
bottomShadowRect.width, bottomShadowRect.height, null);
@@ -187,9 +187,10 @@ public class DropShadowBorder implements Border, Serializable {
if (showRightShadow) {
assert topRightShadowPoint != null && bottomRightShadowPoint != null;
- Rectangle rightShadowRect =
- new Rectangle(x + width - shadowSize, topRightShadowPoint.y + shadowSize, shadowSize,
- bottomRightShadowPoint.y - topRightShadowPoint.y - shadowSize);
+ Rectangle rightShadowRect = new Rectangle(x + width - shadowSize, topRightShadowPoint.y + shadowSize,
+ shadowSize,
+ bottomRightShadowPoint.y - topRightShadowPoint.y
+ - shadowSize);
g2.drawImage(images[Position.RIGHT.ordinal()],
rightShadowRect.x, rightShadowRect.y,
rightShadowRect.width, rightShadowRect.height, null);
@@ -197,9 +198,9 @@ public class DropShadowBorder implements Border, Serializable {
if (showTopShadow) {
assert topLeftShadowPoint != null && topRightShadowPoint != null;
- Rectangle topShadowRect =
- new Rectangle(topLeftShadowPoint.x + shadowSize, y,
- topRightShadowPoint.x - topLeftShadowPoint.x - shadowSize, shadowSize);
+ Rectangle topShadowRect = new Rectangle(topLeftShadowPoint.x + shadowSize, y,
+ topRightShadowPoint.x - topLeftShadowPoint.x - shadowSize,
+ shadowSize);
g2.drawImage(images[Position.TOP.ordinal()],
topShadowRect.x, topShadowRect.y,
topShadowRect.width, topShadowRect.height, null);
@@ -231,25 +232,25 @@ public class DropShadowBorder implements Border, Serializable {
@SuppressWarnings("SuspiciousNameCombination")
private BufferedImage[] getImages(final Graphics2D g2) {
- //first, check to see if an image for this size has already been rendered
- //if so, use the cache. Else, draw and save
+ // first, check to see if an image for this size has already been rendered
+ // if so, use the cache. Else, draw and save
BufferedImage[] images = CACHE.get(getBorderHash(shadowSize, shadowOpacity, shadowColor));
if (images == null) {
images = new BufferedImage[Position.count()];
/*
* To draw a drop shadow, I have to:
- * 1) Create a rounded rectangle
- * 2) Create a BufferedImage to draw the rounded rect in
- * 3) Translate the graphics for the image, so that the rectangle
- * is centered in the drawn space. The border around the rectangle
- * needs to be shadowWidth wide, so that there is space for the
- * shadow to be drawn.
- * 4) Draw the rounded rect as shadowColor, with an opacity of shadowOpacity
- * 5) Create the BLUR_KERNEL
- * 6) Blur the image
- * 7) copy off the corners, sides, etc into images to be used for
- * drawing the Border
+ * 1) Create a rounded rectangle
+ * 2) Create a BufferedImage to draw the rounded rect in
+ * 3) Translate the graphics for the image, so that the rectangle
+ * is centered in the drawn space. The border around the rectangle
+ * needs to be shadowWidth wide, so that there is space for the
+ * shadow to be drawn.
+ * 4) Draw the rounded rect as shadowColor, with an opacity of shadowOpacity
+ * 5) Create the BLUR_KERNEL
+ * 6) Blur the image
+ * 7) copy off the corners, sides, etc into images to be used for
+ * drawing the Border
*/
int rectWidth = cornerSize + 1;
RoundRectangle2D rect = new RoundRectangle2D.Double(0, 0, rectWidth, rectWidth, cornerSize, cornerSize);
@@ -328,10 +329,9 @@ public class DropShadowBorder implements Border, Serializable {
}
/**
- * Returns a new BufferedImage that represents a subregion of the given BufferedImage. (Note that this method does
+ * Returns a new BufferedImage that represents a subregion of the given BufferedImage. (Note that this method does
* not use BufferedImage.getSubimage(), which will defeat image acceleration strategies on later JDKs.)
*/
-
private BufferedImage getSubImage(final BufferedImage img, final int x, final int y, final int w, final int h) {
BufferedImage ret = ImageUtil.createCompatibleTranslucentImage(w, h);
Graphics2D g2 = ret.createGraphics();
@@ -437,12 +437,17 @@ public class DropShadowBorder implements Border, Serializable {
}
private enum Position {
- TOP, TOP_LEFT, LEFT, BOTTOM_LEFT,
- BOTTOM, BOTTOM_RIGHT, RIGHT, TOP_RIGHT;
+ TOP,
+ TOP_LEFT,
+ LEFT,
+ BOTTOM_LEFT,
+ BOTTOM,
+ BOTTOM_RIGHT,
+ RIGHT,
+ TOP_RIGHT;
static int count() {
return 8;
}
}
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/border/MutableLineBorder.java b/core/src/main/java/com/github/weisj/darklaf/components/border/MutableLineBorder.java
index 774fd463..325f0a93 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/border/MutableLineBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/border/MutableLineBorder.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.border;
-import javax.swing.border.AbstractBorder;
import java.awt.*;
+import javax.swing.border.AbstractBorder;
+
/**
* @author Jannis Weis
*/
@@ -41,8 +43,7 @@ public class MutableLineBorder extends AbstractBorder {
this(insets.top, insets.left, insets.bottom, insets.right, color);
}
- public MutableLineBorder(
- final int top, final int left, final int bottom, final int right, final Color color) {
+ public MutableLineBorder(final int top, final int left, final int bottom, final int right, final Color color) {
this.top = top;
this.left = left;
this.bottom = bottom;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java b/core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java
index fc0ecb14..9e365f91 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java
@@ -20,9 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.color;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Consumer;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.components.tooltip.ToolTipContext;
import com.github.weisj.darklaf.ui.DarkPopupFactory;
import com.github.weisj.darklaf.ui.tooltip.DarkTooltipBorder;
@@ -30,12 +38,6 @@ import com.github.weisj.darklaf.ui.tooltip.DarkTooltipUI;
import com.github.weisj.darklaf.util.Alignment;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.function.Consumer;
-
public class PopupColorChooser extends JToolTip {
protected DarkTooltipBorder border;
@@ -128,17 +130,17 @@ public class PopupColorChooser extends JToolTip {
protected ToolTipContext createToolTipContext() {
return new ToolTipContext()
- .setAlignment(Alignment.CENTER)
- .setCenterAlignment(Alignment.SOUTH)
- .setUseBestFit(true)
- .setToolTipInsets(new Insets(2, 2, 2, 2))
- .setFallBackPositionProvider(c -> {
- Window window = DarkUIUtil.getWindow(c.getTarget());
- Dimension size = c.getToolTip().getPreferredSize();
- Rectangle bounds = window.getBounds();
- return new Point(bounds.x + (bounds.width - size.width) / 2,
- bounds.y + (bounds.height - size.height) / 2);
- });
+ .setAlignment(Alignment.CENTER)
+ .setCenterAlignment(Alignment.SOUTH)
+ .setUseBestFit(true)
+ .setToolTipInsets(new Insets(2, 2, 2, 2))
+ .setFallBackPositionProvider(c -> {
+ Window window = DarkUIUtil.getWindow(c.getTarget());
+ Dimension size = c.getToolTip().getPreferredSize();
+ Rectangle bounds = window.getBounds();
+ return new Point(bounds.x + (bounds.width - size.width) / 2,
+ bounds.y + (bounds.height - size.height) / 2);
+ });
}
@Override
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/color/QuickColorChooser.java b/core/src/main/java/com/github/weisj/darklaf/components/color/QuickColorChooser.java
index 99053ad6..10140e22 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/color/QuickColorChooser.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/color/QuickColorChooser.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.color;
-import com.github.weisj.darklaf.decorators.MouseClickListener;
-import com.github.weisj.darklaf.icons.EmptyIcon;
-import com.github.weisj.darklaf.icons.SolidColorIcon;
-
-import javax.swing.*;
import java.awt.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.decorators.MouseClickListener;
+import com.github.weisj.darklaf.icons.EmptyIcon;
+import com.github.weisj.darklaf.icons.SolidColorIcon;
+
public class QuickColorChooser extends JPanel {
private final SolidColorIcon icon;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java b/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java
index 2a91652f..33356109 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java
@@ -20,9 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.color;
+import java.awt.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.color.DarkColorModel;
import com.github.weisj.darklaf.color.DarkColorModelHSB;
import com.github.weisj.darklaf.color.DarkColorModelHSL;
@@ -40,12 +48,6 @@ import com.github.weisj.darklaf.ui.text.DarkTextUI;
import com.github.weisj.darklaf.util.ColorUtil;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-import java.awt.*;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-
public class SmallColorChooser extends JPanel {
private static final DarkColorModel[] COLOR_MODELS = new DarkColorModel[]{DarkColorModelRGB.getInstance(),
@@ -106,13 +108,13 @@ public class SmallColorChooser extends JPanel {
hexField.getDocument().addDocumentListener((UpdateDocumentListener) () -> {
try {
String hexStr = String.format("%1$-" + 8 + "s",
- hexField.getText()).replaceAll(" ", "F");
+ hexField.getText())
+ .replaceAll(" ", "F");
int[] rgb = new int[]{Integer.valueOf(hexStr.substring(0, 2), 16),
Integer.valueOf(hexStr.substring(2, 4), 16),
Integer.valueOf(hexStr.substring(4, 6), 16)};
setColor(hexField, DarkColorModelRGB.getInstance(), rgb);
- } catch (NumberFormatException | IndexOutOfBoundsException ignore) {
- }
+ } catch (NumberFormatException | IndexOutOfBoundsException ignore) {}
});
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java
index 596c779a..7a581dac 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.ui.tabframe.TabFrameTransferHandler;
-import com.github.weisj.darklaf.util.Alignment;
-
-import javax.swing.*;
-import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
+import javax.swing.*;
+import javax.swing.plaf.ComponentUI;
+
+import com.github.weisj.darklaf.ui.tabframe.TabFrameTransferHandler;
+import com.github.weisj.darklaf.util.Alignment;
+
/**
* Frame that supports popup components.
*
@@ -71,9 +73,9 @@ public class JTabFrame extends JComponent {
add(content.getComponent());
int count = Alignment.values().length;
- //noinspection unchecked
+ // noinspection unchecked
tabLists = (ArrayList[]) new ArrayList[count];
- //noinspection unchecked
+ // noinspection unchecked
popupLists = (ArrayList[]) new ArrayList[count];
for (int i = 0; i < count; i++) {
tabLists[i] = new ArrayList<>();
@@ -175,8 +177,8 @@ public class JTabFrame extends JComponent {
/**
* Get the number of tabs at the given alignment position.
*
- * @param a the alignment position.
- * @return number of tabs.
+ * @param a the alignment position.
+ * @return number of tabs.
*/
public int getTabCountAt(final Alignment a) {
return tabsForAlignment(a).size();
@@ -328,7 +330,7 @@ public class JTabFrame extends JComponent {
tabComp.setOrientation(a);
getTabContainer(a).add(tabComp.getComponent());
List tabs = tabsForAlignment(a);
- //Adjust indices for tabs.
+ // Adjust indices for tabs.
Iterator iterator = tabs.listIterator(index);
while (iterator.hasNext()) {
TabFrameTab tab = iterator.next();
@@ -346,8 +348,8 @@ public class JTabFrame extends JComponent {
/**
* Get a list of components at the given alignment position.
*
- * @param a the alignment position.
- * @return list of components at position.
+ * @param a the alignment position.
+ * @return list of components at position.
*/
public List compsForAlignment(final Alignment a) {
return popupLists[a.ordinal()];
@@ -356,27 +358,26 @@ public class JTabFrame extends JComponent {
/**
* Get the tab container for the given alignment position.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @return the tab container.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @return the tab container.
*/
-
public JComponent getTabContainer(final Alignment a) {
switch (a) {
- case NORTH:
- case NORTH_EAST:
+ case NORTH :
+ case NORTH_EAST :
return getTopTabContainer();
- case SOUTH:
- case SOUTH_WEST:
+ case SOUTH :
+ case SOUTH_WEST :
return getBottomTabContainer();
- case EAST:
- case SOUTH_EAST:
+ case EAST :
+ case SOUTH_EAST :
return getRightTabContainer();
- case WEST:
- case NORTH_WEST:
+ case WEST :
+ case NORTH_WEST :
return getLeftTabContainer();
- case CENTER:
+ case CENTER :
throw new IllegalArgumentException("invalid alignment: " + a);
- default:
+ default :
throw new IllegalArgumentException();
}
}
@@ -384,8 +385,8 @@ public class JTabFrame extends JComponent {
/**
* Get a list of tab components at the given alignment position.
*
- * @param a the alignment position.
- * @return list of tab components at position.
+ * @param a the alignment position.
+ * @return list of tab components at position.
*/
public List tabsForAlignment(final Alignment a) {
return tabLists[a.ordinal()];
@@ -462,9 +463,9 @@ public class JTabFrame extends JComponent {
/**
* Get the tab component at the given position.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @return the tab component.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @return the tab component.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public TabFrameTab getTabComponentAt(final Alignment a, final int index) {
@@ -486,9 +487,9 @@ public class JTabFrame extends JComponent {
/**
* Get the component at the given position.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index. {@link TabFramePosition#getIndex()} ()}
- * @return the popup component specified by {@link TabFramePopup#getContentPane()}.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index. {@link TabFramePosition#getIndex()} ()}
+ * @return the popup component specified by {@link TabFramePopup#getContentPane()}.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public Component getComponentAt(final Alignment a, final int index) {
@@ -511,8 +512,8 @@ public class JTabFrame extends JComponent {
/**
* Gets the position of the given component or null if it isn't currently added.
*
- * @param c the component to find.
- * @return the position in the tabFrame.{@link TabFramePosition}
+ * @param c the component to find.
+ * @return the position in the tabFrame.{@link TabFramePosition}
*/
public TabFramePosition findComponent(final Component c) {
for (Alignment a : Alignment.values()) {
@@ -529,8 +530,8 @@ public class JTabFrame extends JComponent {
/**
* Close a popup.
*
- * @param a the alignment position of the popup.{@link TabFramePosition#getAlignment()}
- * @param index the index of the tab.{@link TabFramePosition#getIndex()}
+ * @param a the alignment position of the popup.{@link TabFramePosition#getAlignment()}
+ * @param index the index of the tab.{@link TabFramePosition#getIndex()}
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public void closeTab(final Alignment a, final int index) {
@@ -540,9 +541,9 @@ public class JTabFrame extends JComponent {
/**
* Toggles the visibility of a tab.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @param enabled true if visible.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @param enabled true if visible.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public void toggleTab(final Alignment a, final int index, final boolean enabled) {
@@ -565,9 +566,9 @@ public class JTabFrame extends JComponent {
* Enable or disable a tab. A disabled tab cannot be opened. Enabling a tab does not open it. Disabling a tab closes
* it. After the tab has been disabled enabling it won't restore the open state,
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @param enabled true if enabled.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @param enabled true if enabled.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public void setTabEnabled(final Alignment a, final int index, final boolean enabled) {
@@ -610,8 +611,8 @@ public class JTabFrame extends JComponent {
/**
* Get the popup component at the given position that is currently active.
*
- * @param a the alignment position. {@link TabFramePosition#getAlignment()}
- * @return the popup component specified by {@link TabFramePopup#getComponent()}.
+ * @param a the alignment position. {@link TabFramePosition#getAlignment()}
+ * @return the popup component specified by {@link TabFramePopup#getComponent()}.
*/
public Component getPopupComponentAt(final Alignment a) {
List tabs = compsForAlignment(a);
@@ -756,7 +757,7 @@ public class JTabFrame extends JComponent {
*/
private void removeTabComp(final Alignment a, final int index) {
List tabs = tabsForAlignment(a);
- //Adjust indices for tabs.
+ // Adjust indices for tabs.
Iterator iterator = tabs.listIterator(index);
while (iterator.hasNext()) {
TabFrameTab tab = iterator.next();
@@ -769,9 +770,9 @@ public class JTabFrame extends JComponent {
/**
* Get the popup component at the given position.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @return the popup component specified by {@link TabFramePopup#getComponent()}.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @return the popup component specified by {@link TabFramePopup#getComponent()}.
*/
public Component getPopupComponentAt(final Alignment a, final int index) {
List tabs = compsForAlignment(a);
@@ -781,8 +782,8 @@ public class JTabFrame extends JComponent {
/**
* Get the component at the given position.
*
- * @param a the alignment position. {@link TabFramePosition#getAlignment()}
- * @return the component specified by {@link TabFramePopup#getContentPane()}.
+ * @param a the alignment position. {@link TabFramePosition#getAlignment()}
+ * @return the component specified by {@link TabFramePopup#getContentPane()}.
*/
public Component getComponentAt(final Alignment a) {
List tabs = compsForAlignment(a);
@@ -792,9 +793,9 @@ public class JTabFrame extends JComponent {
/**
* Get the custom tab component at the given position.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @return the user tab component or null if none is installed.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @return the user tab component or null if none is installed.
*/
public Component getUserTabComponentAt(final Alignment a, final int index) {
TabFrameTab tab = getTabComponentAt(a, index);
@@ -844,28 +845,31 @@ public class JTabFrame extends JComponent {
* Get the position of the alignment peer. That being the other position that occupies the same tab container given
* by {@link #getTabContainer(Alignment)}.
*
- * NORTH = NORTH_EAST
- *
- * EAST = SOUTH_EAST
- *
- * SOUTH = SOUTH_WEST
- *
- * WEST = NORTH_WEST
+ * NORTH = NORTH_EAST
+ *
+ *
+ * EAST = SOUTH_EAST
+ *
+ *
+ * SOUTH = SOUTH_WEST
+ *
+ *
+ * WEST = NORTH_WEST
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @return the peer position.{@link TabFramePosition#getAlignment()}
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @return the peer position.{@link TabFramePosition#getAlignment()}
*/
public Alignment getPeer(final Alignment a) {
switch (a) {
- case NORTH:
- case SOUTH:
- case WEST:
- case EAST:
+ case NORTH :
+ case SOUTH :
+ case WEST :
+ case EAST :
return a.clockwise();
- case NORTH_EAST:
- case NORTH_WEST:
- case SOUTH_EAST:
- case SOUTH_WEST:
+ case NORTH_EAST :
+ case NORTH_WEST :
+ case SOUTH_EAST :
+ case SOUTH_WEST :
return a.anticlockwise();
}
return a;
@@ -906,9 +910,9 @@ public class JTabFrame extends JComponent {
/**
* Returns whether the given tab is selected.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @param index the index.{@link TabFramePosition#getIndex()}
- * @return true if selected.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @param index the index.{@link TabFramePosition#getIndex()}
+ * @return true if selected.
*/
public boolean isSelected(final Alignment a, final int index) {
if (a == null) return false;
@@ -918,8 +922,8 @@ public class JTabFrame extends JComponent {
/**
* Get the index that is currently selected at the given location or -1 if none is selected.
*
- * @param a the alignment position.{@link TabFramePosition#getAlignment()}
- * @return the current selected index at the alignment position.
+ * @param a the alignment position.{@link TabFramePosition#getAlignment()}
+ * @return the current selected index at the alignment position.
*/
public int getSelectedIndex(final Alignment a) {
return selectedIndices[a.ordinal()];
@@ -986,7 +990,6 @@ public class JTabFrame extends JComponent {
private Alignment a;
private int index;
-
public TabFramePosition(final Alignment a, final int index) {
this.a = a;
this.index = index;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java
index d2b37fa2..a54f1e1d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
+import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.PanelUI;
-import java.awt.*;
+
+import com.github.weisj.darklaf.util.Alignment;
/**
* Popup Component for {@link JTabFrame}.
*
* @author Jannis Weis
- * @since 2019
+ * @since 2019
*/
public class PanelPopup extends JPanel implements TabFramePopup {
private Component content;
@@ -150,7 +152,6 @@ public class PanelPopup extends JPanel implements TabFramePopup {
}
}
-
private boolean isOpen() {
return open;
}
@@ -176,7 +177,8 @@ public class PanelPopup extends JPanel implements TabFramePopup {
public void setAlignment(final Alignment alignment) {
if (alignment == null || this.alignment == Alignment.CENTER) {
throw new IllegalArgumentException("Illegal alignment: " + (alignment != null
- ? alignment.toString() : "null"));
+ ? alignment.toString()
+ : "null"));
}
Alignment old = this.alignment;
this.alignment = alignment;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PopupContainer.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PopupContainer.java
index b882ce34..b806f3e0 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PopupContainer.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/PopupContainer.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.border.Border;
-import java.awt.*;
/**
* Holder component.
@@ -59,7 +61,6 @@ public class PopupContainer extends JPanel {
super.setBorder(null);
}
-
@Override
public Border getBorder() {
return null;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabArea.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabArea.java
index c5cb1ba4..56331747 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabArea.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabArea.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import javax.swing.*;
import java.awt.*;
+import javax.swing.*;
+
public final class TabArea extends JPanel {
public TabArea() {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContent.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContent.java
index c4aa1239..253314c3 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContent.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
-
import java.awt.*;
+import com.github.weisj.darklaf.util.Alignment;
+
public interface TabFrameContent {
/**
@@ -54,8 +55,8 @@ public interface TabFrameContent {
/**
* Returns whether the given popup is enabled.
*
- * @param a the alignment of the popup.
- * @return true if enabled.
+ * @param a the alignment of the popup.
+ * @return true if enabled.
*/
boolean isEnabled(Alignment a);
@@ -84,8 +85,8 @@ public interface TabFrameContent {
/**
* Get the popup container at the given location.
*
- * @param alignment the alignment position.
- * @return the popup container.
+ * @param alignment the alignment position.
+ * @return the popup container.
*/
PopupContainer getContainer(Alignment alignment);
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContentPane.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContentPane.java
index bef7b62c..63c07f17 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContentPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContentPane.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.decorators.AncestorAdapter;
-import com.github.weisj.darklaf.util.Alignment;
+import java.awt.*;
+import java.util.function.BiConsumer;
import javax.swing.*;
import javax.swing.event.AncestorEvent;
-import java.awt.*;
-import java.util.function.BiConsumer;
+
+import com.github.weisj.darklaf.decorators.AncestorAdapter;
+import com.github.weisj.darklaf.util.Alignment;
/**
* Content pane for {@link JTabFrame}.
@@ -88,7 +90,6 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
bottomSplitter.setLeftComponent(bottomLeftPanel);
bottomSplitter.setRightComponent(bottomRightPanel);
-
topSplit = createSplitPane("topSplit");
bottomSplit = createSplitPane("bottomSplit");
topSplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
@@ -187,63 +188,55 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
public void setEnabled(final Alignment a, final boolean enabled, final boolean force) {
if (enabled == isEnabled(a) && !force) return;
switch (a) {
- case NORTH:
- changeStatus(
- enabled, Alignment.NORTH_EAST,
- topSplit, topSplitter,
- new LayoutProportions(VERTICAL_PROP_TOP, 1.0, 0.0, 0.0),
- new LayoutWeights(0.0, 0.0, 0.0, 1.0));
+ case NORTH :
+ changeStatus(enabled, Alignment.NORTH_EAST,
+ topSplit, topSplitter,
+ new LayoutProportions(VERTICAL_PROP_TOP, 1.0, 0.0, 0.0),
+ new LayoutWeights(0.0, 0.0, 0.0, 1.0));
break;
- case NORTH_EAST:
- changeStatus(
- enabled, Alignment.NORTH,
- topSplit, topSplitter,
- new LayoutProportions(VERTICAL_PROP_TOP, 0.0, 0.0, 1.0),
- new LayoutWeights(0.0, 0.0, 1.0, 0.0));
+ case NORTH_EAST :
+ changeStatus(enabled, Alignment.NORTH,
+ topSplit, topSplitter,
+ new LayoutProportions(VERTICAL_PROP_TOP, 0.0, 0.0, 1.0),
+ new LayoutWeights(0.0, 0.0, 1.0, 0.0));
break;
- case EAST:
- changeStatus(
- enabled, Alignment.SOUTH_EAST,
- rightSplit, rightSplitter,
- new LayoutProportions(HORIZONTAL_PROP_RIGHT, 1.0, 1.0, 0.0),
- new LayoutWeights(1.0, 1.0, 0.0, 1.0));
+ case EAST :
+ changeStatus(enabled, Alignment.SOUTH_EAST,
+ rightSplit, rightSplitter,
+ new LayoutProportions(HORIZONTAL_PROP_RIGHT, 1.0, 1.0, 0.0),
+ new LayoutWeights(1.0, 1.0, 0.0, 1.0));
break;
- case SOUTH_EAST:
- changeStatus(
- enabled, Alignment.EAST,
- rightSplit, rightSplitter,
- new LayoutProportions(HORIZONTAL_PROP_RIGHT, 0.0, 1.0, 1.0),
- new LayoutWeights(1.0, 1.0, 1.0, 0.0));
+ case SOUTH_EAST :
+ changeStatus(enabled, Alignment.EAST,
+ rightSplit, rightSplitter,
+ new LayoutProportions(HORIZONTAL_PROP_RIGHT, 0.0, 1.0, 1.0),
+ new LayoutWeights(1.0, 1.0, 1.0, 0.0));
break;
- case NORTH_WEST:
- changeStatus(
- enabled, Alignment.WEST,
- leftSplit, leftSplitter,
- new LayoutProportions(VERTICAL_PROP_TOP, 1.0, 0.0, 0.0),
- new LayoutWeights(0.0, 0.0, 0.0, 1.0));
+ case NORTH_WEST :
+ changeStatus(enabled, Alignment.WEST,
+ leftSplit, leftSplitter,
+ new LayoutProportions(VERTICAL_PROP_TOP, 1.0, 0.0, 0.0),
+ new LayoutWeights(0.0, 0.0, 0.0, 1.0));
break;
- case WEST:
- changeStatus(
- enabled, Alignment.NORTH_WEST,
- leftSplit, leftSplitter,
- new LayoutProportions(VERTICAL_PROP_TOP, 0.0, 0.0, 1.0),
- new LayoutWeights(0.0, 0.0, 1.0, 0.0));
+ case WEST :
+ changeStatus(enabled, Alignment.NORTH_WEST,
+ leftSplit, leftSplitter,
+ new LayoutProportions(VERTICAL_PROP_TOP, 0.0, 0.0, 1.0),
+ new LayoutWeights(0.0, 0.0, 1.0, 0.0));
break;
- case SOUTH_WEST:
- changeStatus(
- enabled, Alignment.SOUTH,
- bottomSplit, bottomSplitter,
- new LayoutProportions(VERTICAL_PROP_BOTTOM, 1.0, 1.0, 0.0),
- new LayoutWeights(1.0, 1.0, 0.0, 1.0));
+ case SOUTH_WEST :
+ changeStatus(enabled, Alignment.SOUTH,
+ bottomSplit, bottomSplitter,
+ new LayoutProportions(VERTICAL_PROP_BOTTOM, 1.0, 1.0, 0.0),
+ new LayoutWeights(1.0, 1.0, 0.0, 1.0));
break;
- case SOUTH:
- changeStatus(
- enabled, Alignment.SOUTH_WEST,
- bottomSplit, bottomSplitter,
- new LayoutProportions(VERTICAL_PROP_BOTTOM, 0.0, 1.0, 1.0),
- new LayoutWeights(1.0, 1.0, 1.0, 0.0));
+ case SOUTH :
+ changeStatus(enabled, Alignment.SOUTH_WEST,
+ bottomSplit, bottomSplitter,
+ new LayoutProportions(VERTICAL_PROP_BOTTOM, 0.0, 1.0, 1.0),
+ new LayoutWeights(1.0, 1.0, 1.0, 0.0));
break;
- case CENTER:
+ case CENTER :
break;
}
setEnabledFlag(a, enabled);
@@ -320,8 +313,8 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
/**
* Returns whether the corresponding panel is currently enabled/visible.
*
- * @param a the position of the panel.
- * @return true if enabled.
+ * @param a the position of the panel.
+ * @return true if enabled.
*/
public boolean isEnabled(final Alignment a) {
if (a == Alignment.CENTER) {
@@ -333,31 +326,31 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
public void setComponentAt(final Alignment a, final Component c) {
switch (a) {
- case NORTH:
+ case NORTH :
((PopupContainer) topSplitter.getLeftComponent()).setPopup(c);
break;
- case NORTH_EAST:
+ case NORTH_EAST :
((PopupContainer) topSplitter.getRightComponent()).setPopup(c);
break;
- case EAST:
+ case EAST :
((PopupContainer) rightSplitter.getTopComponent()).setPopup(c);
break;
- case SOUTH_EAST:
+ case SOUTH_EAST :
((PopupContainer) rightSplitter.getBottomComponent()).setPopup(c);
break;
- case SOUTH:
+ case SOUTH :
((PopupContainer) bottomSplitter.getRightComponent()).setPopup(c);
break;
- case SOUTH_WEST:
+ case SOUTH_WEST :
((PopupContainer) bottomSplitter.getLeftComponent()).setPopup(c);
break;
- case WEST:
+ case WEST :
((PopupContainer) leftSplitter.getBottomComponent()).setPopup(c);
break;
- case NORTH_WEST:
+ case NORTH_WEST :
((PopupContainer) leftSplitter.getTopComponent()).setPopup(c);
break;
- case CENTER:
+ case CENTER :
break;
}
}
@@ -381,31 +374,31 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
public PopupContainer getContainer(final Alignment alignment) {
PopupContainer popupComponent;
switch (alignment) {
- case NORTH:
+ case NORTH :
popupComponent = ((PopupContainer) topSplitter.getLeftComponent());
break;
- case NORTH_EAST:
+ case NORTH_EAST :
popupComponent = ((PopupContainer) topSplitter.getRightComponent());
break;
- case EAST:
+ case EAST :
popupComponent = ((PopupContainer) rightSplitter.getTopComponent());
break;
- case SOUTH_EAST:
+ case SOUTH_EAST :
popupComponent = ((PopupContainer) rightSplitter.getBottomComponent());
break;
- case SOUTH:
+ case SOUTH :
popupComponent = ((PopupContainer) bottomSplitter.getRightComponent());
break;
- case SOUTH_WEST:
+ case SOUTH_WEST :
popupComponent = ((PopupContainer) bottomSplitter.getLeftComponent());
break;
- case WEST:
+ case WEST :
popupComponent = ((PopupContainer) leftSplitter.getBottomComponent());
break;
- case NORTH_WEST:
+ case NORTH_WEST :
popupComponent = ((PopupContainer) leftSplitter.getTopComponent());
break;
- default:
+ default :
throw new IllegalArgumentException("CENTER is not supported");
}
return popupComponent;
@@ -414,8 +407,8 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
/**
* Get the popup component at the position.
*
- * @param a the position.
- * @return the popup component at position.
+ * @param a the position.
+ * @return the popup component at position.
*/
public Component getPopupComponent(final Alignment a) {
return getContainer(a).getPopup();
@@ -427,7 +420,6 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
protected final double splitDisable;
protected final double splitterDisable;
-
public LayoutProportions(final double splitRestore, final double splitterPeerDisable,
final double splitDisable, final double splitterDisable) {
this.splitRestore = splitRestore;
@@ -443,7 +435,6 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
protected final double splitDisable;
protected final double splitterPeerDisable;
-
public LayoutWeights(final double splitEnable, final double splitterDisable,
final double splitDisable, final double splitterPeerDisable) {
this.splitEnable = splitEnable;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopup.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopup.java
index 255f8258..f0fe5d9f 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopup.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopup.java
@@ -20,13 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.util.Alignment;
public interface TabFramePopup {
String KEY_VISIBLE_TAB = "visibleTab";
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopupUI.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopupUI.java
index 6fdb73c6..5a963544 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopupUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopupUI.java
@@ -20,8 +20,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-public interface TabFramePopupUI {
-}
+public interface TabFramePopupUI {}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java
index 01be5780..7b8ccef4 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
-
import java.awt.*;
+import com.github.weisj.darklaf.util.Alignment;
+
public interface TabFrameTab {
String KEY_SELECTED = "selected";
String KEY_CONTENT = "content";
@@ -125,5 +126,4 @@ public interface TabFrameTab {
* @param tabFrame the TabFrame.
*/
void setTabFrame(JTabFrame tabFrame);
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabContainer.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabContainer.java
index ab56d269..5b296dda 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabContainer.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabContainer.java
@@ -20,13 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.util.Alignment;
public class TabFrameTabContainer extends JPanel implements TabFrameTab {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java
index 6fecf225..af29bdf5 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
+import java.awt.*;
+import java.util.Objects;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.icons.EmptyIcon;
import com.github.weisj.darklaf.ui.tabframe.DarkTabFrameTabLabelUI;
import com.github.weisj.darklaf.util.Alignment;
-import javax.swing.*;
-import java.awt.*;
-import java.util.Objects;
-
/**
* Tab Component for {@link JTabFrame}.
*
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabbedPopupUI.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabbedPopupUI.java
index 0956560d..9ae4c86e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabbedPopupUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabbedPopupUI.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameUI.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameUI.java
index be1b828b..02ff6a5a 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameUI.java
@@ -20,13 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.util.Alignment;
+import java.awt.*;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
+
+import com.github.weisj.darklaf.util.Alignment;
public abstract class TabFrameUI extends ComponentUI {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabbedPopup.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabbedPopup.java
index 2966cb84..31bad4df 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabbedPopup.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabbedPopup.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import javax.swing.*;
-import javax.swing.plaf.PanelUI;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import javax.swing.*;
+import javax.swing.plaf.PanelUI;
+
/**
* Tabbed Popup Component for {@link JTabFrame}.
*
@@ -125,7 +127,7 @@ public class TabbedPopup extends PanelPopup {
* Gets the currently selected component from the TabbedPane.
*
* @return the selected component.
- * @see #getTabbedPane()
+ * @see #getTabbedPane()
*/
public Component getContentPane() {
return tabbedPane.getSelectedComponent();
@@ -150,7 +152,7 @@ public class TabbedPopup extends PanelPopup {
* TabbedPane.
*
* @return a collection of components.
- * @see #getTabbedPane()
+ * @see #getTabbedPane()
*/
public Collection getContentPanes() {
int size = getTabbedPane().getTabCount();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java
index 90ef7cee..062411c4 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java
@@ -20,15 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tabframe;
-import com.github.weisj.darklaf.ui.splitpane.DarkSplitPaneUI;
+import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.splitpane.DarkSplitPaneUI;
public class ToggleSplitPane extends JSplitPane {
@@ -49,7 +51,6 @@ public class ToggleSplitPane extends JSplitPane {
putClientProperty(DarkSplitPaneUI.KEY_STYLE, DarkSplitPaneUI.STYLE_INVISIBLE);
}
-
public boolean isResizable() {
return resizable;
}
@@ -148,7 +149,6 @@ public class ToggleSplitPane extends JSplitPane {
}
}
-
@Override
public void setDividerLocation(final int location) {
if (isInLayout) return;
@@ -165,7 +165,6 @@ public class ToggleSplitPane extends JSplitPane {
isInLayout = false;
}
-
@Override
public int getMaximumDividerLocation() {
int max = getOrientation() == HORIZONTAL_SPLIT ? getWidth() : getHeight();
@@ -176,8 +175,7 @@ public class ToggleSplitPane extends JSplitPane {
public int getMinimumDividerLocation() {
Component comp = getRightComponent();
return comp == null ? 0 : getOrientation() == HORIZONTAL_SPLIT
- ? comp.getMinimumSize().width
- : comp.getMinimumSize().height;
+ ? comp.getMinimumSize().width
+ : comp.getMinimumSize().height;
}
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/IconListener.java b/core/src/main/java/com/github/weisj/darklaf/components/text/IconListener.java
index 3859ee07..d7e8ea70 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/IconListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/IconListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/IndexListener.java b/core/src/main/java/com/github/weisj/darklaf/components/text/IndexListener.java
index 633628df..85680def 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/IndexListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/IndexListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java b/core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java
index 1307cc46..0902d99b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.Highlighter;
import javax.swing.text.JTextComponent;
-import java.awt.*;
public class LineHighlighter implements Highlighter.HighlightPainter, ChangeListener {
private JTextComponent component;
@@ -49,9 +51,9 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
}
/*
- * You can reset the line color at any time
+ * You can reset the line color at any time
*
- * @param color the color of the background line
+ * @param color the color of the background line
*/
public void setColor(final Color color) {
this.color = color;
@@ -82,11 +84,11 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
}
/*
- * Caret position has changed, remove the highlight
+ * Caret position has changed, remove the highlight
*/
private void resetHighlight() {
- // Use invokeLater to make sure updates to the Document are completed,
- // otherwise Undo processing causes the modelToView method to loop.
+ // Use invokeLater to make sure updates to the Document are completed,
+ // otherwise Undo processing causes the modelToView method to loop.
if (component == null) return;
SwingUtilities.invokeLater(() -> {
try {
@@ -96,7 +98,7 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
if (view == null) return;
Rectangle currentView = view.getBounds();
- // Remove the highlighting from the previously highlighted line
+ // Remove the highlighting from the previously highlighted line
if (lastView != null && lastView.y != currentView.y) {
if (lastView.isEmpty()) {
component.repaint();
@@ -105,8 +107,7 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
}
lastView = currentView;
}
- } catch (BadLocationException ignored) {
- }
+ } catch (BadLocationException ignored) {}
});
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.java b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.java
index 585e7df5..aba791f2 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
/**
* JTextPane that keeps the original width of text.
*
* @author Jannis Weis
- * @since 2018
+ * @since 2018
*/
public class NonWrappingEditorPane extends JEditorPane {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.java b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.java
index 7b58cce8..8ba92177 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
/**
* JTextPane that keeps the original width of text.
*
* @author Jannis Weis
- * @since 2018
+ * @since 2018
*/
public class NonWrappingTextArea extends JTextArea {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.java b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.java
index da3fb1d0..d8785e11 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
/**
* JTextPane that keeps the original width of text.
*
* @author Jannis Weis
- * @since 2018
+ * @since 2018
*/
public class NonWrappingTextPane extends JTextPane {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/NumberedTextComponent.java b/core/src/main/java/com/github/weisj/darklaf/components/text/NumberedTextComponent.java
index 3ae7cc3a..89350a32 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/NumberedTextComponent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/NumberedTextComponent.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
-import com.github.weisj.darklaf.components.OverlayScrollPane;
+import java.awt.*;
import javax.swing.*;
import javax.swing.text.JTextComponent;
-import java.awt.*;
+
+import com.github.weisj.darklaf.components.OverlayScrollPane;
public class NumberedTextComponent extends JPanel {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/NumberingPane.java b/core/src/main/java/com/github/weisj/darklaf/components/text/NumberingPane.java
index 5c73ee81..a531d2cd 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/NumberingPane.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/NumberingPane.java
@@ -20,15 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
-import com.github.weisj.darklaf.util.StringUtil;
+import java.util.*;
+import java.util.stream.Collectors;
import javax.swing.*;
import javax.swing.text.*;
-import java.util.*;
-import java.util.stream.Collectors;
+
+import com.github.weisj.darklaf.util.StringUtil;
public class NumberingPane extends JComponent {
@@ -88,7 +90,7 @@ public class NumberingPane extends JComponent {
}
public Position addIconAtLine(final int lineIndex, final Icon icon, final boolean atTextStart)
- throws BadLocationException {
+ throws BadLocationException {
int offset = textComponent.getDocument().getDefaultRootElement().getElement(lineIndex).getStartOffset();
if (atTextStart) {
Document doc = textComponent.getDocument();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchEvent.java b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchEvent.java
index 1e5c56fe..e341a5e7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchEvent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchEvent.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchListener.java b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchListener.java
index 1165ec33..fc40e7a3 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextField.java b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextField.java
index b3149acc..f113a047 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextField.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextField.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
@@ -31,7 +32,7 @@ public class SearchTextField extends JTextField {
public static final int SEARCH = 0;
/**
- * Constructs a new TextField. A default model is created, the initial string is null,
+ * Constructs a new TextField. A default model is created, the initial string is null,
* and the number of columns is set to 0.
*/
public SearchTextField() {
@@ -43,12 +44,15 @@ public class SearchTextField extends JTextField {
* This is the constructor through which the other constructors feed. If the document is null, a
* default model is created.
*
- * @param doc the text storage to use; if this is null, a default will be provided by calling the
- * createDefaultModel method
- * @param text the initial string to display, or null
- * @param columns the number of columns to use to calculate the preferred width >= 0; if columns is
- * set to zero, the preferred width will be whatever naturally results from the component
- * implementation
+ * @param doc the text storage to use; if this is null, a default will be
+ * provided by calling the
+ * createDefaultModel method
+ * @param text the initial string to display, or null
+ * @param columns the number of columns to use to calculate the preferred width >= 0; if
+ * columns is
+ * set to zero, the preferred width will be whatever naturally results from the
+ * component
+ * implementation
* @throws IllegalArgumentException if columns < 0
*/
public SearchTextField(final Document doc, final String text, final int columns) {
@@ -88,7 +92,7 @@ public class SearchTextField extends JTextField {
}
/**
- * Constructs a new TextField initialized with the specified text and columns. A default model is
+ * Constructs a new TextField initialized with the specified text and columns. A default model is
* created.
*
* @param text the text to be displayed, or null
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java
index b5a3b70e..8430c589 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
-import javax.swing.text.Document;
import java.util.List;
+import javax.swing.text.Document;
+
/**
* {@link SearchTextField} that has a popup that displays the search history. A search entry is added
*
@@ -36,7 +38,7 @@ public class SearchTextFieldWithHistory extends SearchTextField {
protected final TextFieldHistoryPopup history;
/**
- * Constructs a new TextField. A default model is created, the initial string is null,
+ * Constructs a new TextField. A default model is created, the initial string is null,
* and the number of columns is set to 0.
*/
public SearchTextFieldWithHistory() {
@@ -48,12 +50,15 @@ public class SearchTextFieldWithHistory extends SearchTextField {
* This is the constructor through which the other constructors feed. If the document is null, a
* default model is created.
*
- * @param doc the text storage to use; if this is null, a default will be provided by calling the
- * createDefaultModel method
- * @param text the initial string to display, or null
- * @param columns the number of columns to use to calculate the preferred width >= 0; if columns is
- * set to zero, the preferred width will be whatever naturally results from the component
- * implementation
+ * @param doc the text storage to use; if this is null, a default will be
+ * provided by calling the
+ * createDefaultModel method
+ * @param text the initial string to display, or null
+ * @param columns the number of columns to use to calculate the preferred width >= 0; if
+ * columns is
+ * set to zero, the preferred width will be whatever naturally results from the
+ * component
+ * implementation
* @throws IllegalArgumentException if columns < 0
*/
public SearchTextFieldWithHistory(final Document doc, final String text, final int columns) {
@@ -85,7 +90,7 @@ public class SearchTextFieldWithHistory extends SearchTextField {
}
/**
- * Constructs a new TextField initialized with the specified text and columns. A default model is
+ * Constructs a new TextField initialized with the specified text and columns. A default model is
* created.
*
* @param text the text to be displayed, or null
@@ -99,8 +104,8 @@ public class SearchTextFieldWithHistory extends SearchTextField {
/**
* Set the maximum height of the popup. If the size is larger than the specified maximum height the content will be
* wrapped inside a scroll pane.
- *
- *
Note: A value of less than or equal to 0 indicates that the height should not be limited.
+ *
+ * Note: A value of less than or equal to 0 indicates that the height should not be limited.
*
* @param maximumHeight the max height to use.
*/
@@ -128,9 +133,9 @@ public class SearchTextFieldWithHistory extends SearchTextField {
* Add entry to the history. If the size is greater than the capacity the oldest entry will be deleted.
*
* @param entry the entry to add.
- * @see #getLength() getLength
- * @see #setCapacity(int) setCapacity
- * @see #getCapacity() getCapacity
+ * @see #getLength() getLength
+ * @see #setCapacity(int) setCapacity
+ * @see #getCapacity() getCapacity
*/
public void addEntry(final String entry) {
history.addEntry(entry);
@@ -140,7 +145,7 @@ public class SearchTextFieldWithHistory extends SearchTextField {
* Get the capacity of the history.
*
* @return the capacity.
- * @see #setCapacity(int) setCapacity()
+ * @see #setCapacity(int) setCapacity()
*/
public int getCapacity() {
return history.getCapacity();
@@ -149,7 +154,7 @@ public class SearchTextFieldWithHistory extends SearchTextField {
/**
* Set the capacity of the history. If the size grows larger than the capacity the oldest entry will be deleted.
*
- * @param capacity the capacity.
+ * @param capacity the capacity.
* @throws IllegalArgumentException if capacity is negative
*/
public void setCapacity(final int capacity) throws IllegalArgumentException {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/text/TextFieldHistoryPopup.java b/core/src/main/java/com/github/weisj/darklaf/components/text/TextFieldHistoryPopup.java
index 9d4258ce..b3bb13d6 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/text/TextFieldHistoryPopup.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/text/TextFieldHistoryPopup.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.text;
+import java.awt.*;
+import java.util.*;
+import java.util.List;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.components.ScrollPopupMenu;
import com.github.weisj.darklaf.decorators.PlainAction;
import com.github.weisj.darklaf.util.StringUtil;
-import javax.swing.*;
-import java.awt.*;
-import java.util.List;
-import java.util.*;
-
/**
* @author Jannis Weis
*/
@@ -73,7 +75,7 @@ public class TextFieldHistoryPopup extends ScrollPopupMenu implements SearchList
* Get the capacity of the history.
*
* @return the capacity.
- * @see #setCapacity(int) setCapacity()
+ * @see #setCapacity(int) setCapacity()
*/
public int getCapacity() {
return capacity;
@@ -82,7 +84,7 @@ public class TextFieldHistoryPopup extends ScrollPopupMenu implements SearchList
/**
* Set the capacity of the history. If the size grows larger than the capacity the oldest entry will be deleted.
*
- * @param capacity the capacity.
+ * @param capacity the capacity.
* @throws IllegalArgumentException if capacity is negative
*/
public void setCapacity(final int capacity) throws IllegalArgumentException {
@@ -111,9 +113,9 @@ public class TextFieldHistoryPopup extends ScrollPopupMenu implements SearchList
* Add entry to the history. If the size is greater than the capacity the oldest entry will be deleted.
*
* @param entry the entry to add.
- * @see #getLength() getLength
- * @see #setCapacity(int) setCapacity
- * @see #getCapacity() getCapacity
+ * @see #getLength() getLength
+ * @see #setCapacity(int) setCapacity
+ * @see #getCapacity() getCapacity
*/
public void addEntry(final String entry) {
history.remove(entry);
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipAware.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipAware.java
index d4da93d6..73efb206 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipAware.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipAware.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tooltip;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java
index 348b2ecf..ae2989ef 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java
@@ -20,17 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tooltip;
-import com.github.weisj.darklaf.components.alignment.AlignmentStrategy;
-import com.github.weisj.darklaf.ui.tooltip.DarkTooltipBorder;
-import com.github.weisj.darklaf.ui.tooltip.DarkTooltipUI;
-import com.github.weisj.darklaf.util.Alignment;
-import com.github.weisj.darklaf.util.DarkUIUtil;
-
-import javax.swing.*;
-import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -38,6 +31,15 @@ import java.awt.event.MouseListener;
import java.awt.geom.Area;
import java.util.function.Function;
+import javax.swing.*;
+import javax.swing.border.Border;
+
+import com.github.weisj.darklaf.components.alignment.AlignmentStrategy;
+import com.github.weisj.darklaf.ui.tooltip.DarkTooltipBorder;
+import com.github.weisj.darklaf.ui.tooltip.DarkTooltipUI;
+import com.github.weisj.darklaf.util.Alignment;
+import com.github.weisj.darklaf.util.DarkUIUtil;
+
public class ToolTipContext {
private static ToolTipContext defaultContext;
@@ -108,7 +110,6 @@ public class ToolTipContext {
this(null, null, null, null, true, null);
}
-
/**
* Create a new tooltip context to ease the creation of custom tooltips.
*
@@ -146,9 +147,9 @@ public class ToolTipContext {
/**
* Set the style of the tooltip.
*
- * @param style the tooltip style.
- * @return this
- * @see ToolTipStyle ToolTipStyle
+ * @param style the tooltip style.
+ * @return this
+ * @see ToolTipStyle ToolTipStyle
*/
public ToolTipContext setToolTipStyle(final ToolTipStyle style) {
this.style = style;
@@ -164,8 +165,8 @@ public class ToolTipContext {
*
* Default is false.
*
- * @param updatePosition true if it should be recalculated.
- * @return this
+ * @param updatePosition true if it should be recalculated.
+ * @return this
*/
public ToolTipContext setUpdatePosition(final boolean updatePosition) {
return this;
@@ -177,7 +178,6 @@ public class ToolTipContext {
* @param target the component which the tooltip belongs to.
* @param alignment {@link #setAlignment(Alignment)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment) {
this(target, alignment, null, null, true, null);
}
@@ -187,10 +187,10 @@ public class ToolTipContext {
* not {@link Alignment#CENTER}. Default is true
*
*
- * @param alignInside true if the tooltip should be aligned inside.
- * @return this.
- * @see #setAlignment(Alignment)
- * @see #setToolTipRectSupplier(Function)
+ * @param alignInside true if the tooltip should be aligned inside.
+ * @return this.
+ * @see #setAlignment(Alignment)
+ * @see #setToolTipRectSupplier(Function)
*/
public ToolTipContext setAlignInside(final boolean alignInside) {
this.alignInside = alignInside;
@@ -210,9 +210,9 @@ public class ToolTipContext {
* additionally supply an alignment using {@link #setCenterAlignment(Alignment)}. The tooltip will either be aligned
* outside of the rectangle or inside depending on {@link #setAlignInside(boolean)}.
*
- * @param alignment the alignment.
- * @return this.
- * @see #setToolTipRectSupplier(Function)
+ * @param alignment the alignment.
+ * @return this.
+ * @see #setToolTipRectSupplier(Function)
*/
public ToolTipContext setAlignment(final Alignment alignment) {
this.alignment = alignment;
@@ -228,8 +228,8 @@ public class ToolTipContext {
*
* Default is {@link Alignment#NORTH}.
*
- * @param centerAlignment the center alignment.
- * @return this
+ * @param centerAlignment the center alignment.
+ * @return this
*/
public ToolTipContext setCenterAlignment(final Alignment centerAlignment) {
this.centerAlignment = centerAlignment;
@@ -242,12 +242,12 @@ public class ToolTipContext {
/**
* Set the alignment strategy which determines how the current mouse position is considered when calculating the
* tooltip location.
+ *
+ * Default will be {@link AlignmentStrategy#COMPONENT_BOTH}.
*
- *
Default will be {@link AlignmentStrategy#COMPONENT_BOTH}.
- *
- * @param alignmentStrategy the alignment strategy.
- * @return this
- * @see AlignmentStrategy
+ * @param alignmentStrategy the alignment strategy.
+ * @return this
+ * @see AlignmentStrategy
*/
public ToolTipContext setAlignmentStrategy(final AlignmentStrategy alignmentStrategy) {
this.alignmentStrategy = alignmentStrategy;
@@ -264,7 +264,6 @@ public class ToolTipContext {
* @param alignment {@link #setAlignment(Alignment)}
* @param centerAlignment {@link #setCenterAlignment(Alignment)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment, final Alignment centerAlignment) {
this(target, alignment, centerAlignment, null, true, null);
}
@@ -276,7 +275,6 @@ public class ToolTipContext {
* @param alignment {@link #setAlignment(Alignment)}
* @param alignInside {@link #setAlignInside(boolean)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment, final boolean alignInside) {
this(target, alignment, null, null, alignInside, null);
}
@@ -289,7 +287,6 @@ public class ToolTipContext {
* @param centerAlignment {@link #setCenterAlignment(Alignment)}
* @param alignInside {@link #setAlignInside(boolean)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment, final Alignment centerAlignment,
final boolean alignInside) {
this(target, alignment, centerAlignment, null, alignInside, null);
@@ -302,7 +299,6 @@ public class ToolTipContext {
* @param alignment {@link #setAlignment(Alignment)}
* @param alignmentStrategy {@link #setAlignmentStrategy(AlignmentStrategy)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment,
final AlignmentStrategy alignmentStrategy) {
this(target, alignment, null, alignmentStrategy, true, null);
@@ -316,7 +312,6 @@ public class ToolTipContext {
* @param centerAlignment {@link #setCenterAlignment(Alignment)}
* @param alignmentStrategy {@link #setAlignmentStrategy(AlignmentStrategy)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment, final Alignment centerAlignment,
final AlignmentStrategy alignmentStrategy) {
this(target, alignment, centerAlignment, alignmentStrategy, true, null);
@@ -330,7 +325,6 @@ public class ToolTipContext {
* @param alignmentStrategy {@link #setAlignmentStrategy(AlignmentStrategy)}
* @param alignInside {@link #setAlignInside(boolean)}
*/
-
public ToolTipContext(final JComponent target, final Alignment alignment, final AlignmentStrategy alignmentStrategy,
final boolean alignInside) {
this(target, alignment, null, alignmentStrategy, alignInside, null);
@@ -341,8 +335,8 @@ public class ToolTipContext {
*
* Default is false.
*
- * @param hideOnExit true if tooltip should hide.
- * @return this.
+ * @param hideOnExit true if tooltip should hide.
+ * @return this.
*/
public ToolTipContext setHideOnExit(final boolean hideOnExit) {
this.hideOnExit = hideOnExit;
@@ -362,8 +356,8 @@ public class ToolTipContext {
*
* Default will be the component bounding rectangle.
*
- * @param toolTipRectSupplier rectangle supplier method.
- * @return this
+ * @param toolTipRectSupplier rectangle supplier method.
+ * @return this
*/
public ToolTipContext setToolTipRectSupplier(final Function toolTipRectSupplier) {
this.toolTipRectSupplier = toolTipRectSupplier;
@@ -377,8 +371,8 @@ public class ToolTipContext {
if (toolTip != null) {
toolTip.putClientProperty(DarkTooltipUI.KEY_POINTER_LOCATION,
alignment == Alignment.CENTER
- ? centerAlignment.opposite()
- : alignInside ? alignment : alignment.opposite());
+ ? centerAlignment.opposite()
+ : alignInside ? alignment : alignment.opposite());
toolTip.putClientProperty(DarkTooltipUI.KEY_INSETS, insets);
toolTip.putClientProperty(DarkTooltipUI.KEY_STYLE, style);
toolTip.doLayout();
@@ -391,8 +385,8 @@ public class ToolTipContext {
*
* Defaults to
*
- * @param insideRect the area to check.
- * @return this.
+ * @param insideRect the area to check.
+ * @return this.
*/
public ToolTipContext setInsideArea(final Area insideRect) {
this.hotSpotArea = insideRect;
@@ -405,8 +399,8 @@ public class ToolTipContext {
*
* Default is false.
*
- * @param applyInsetsToRect true if they should be applied.
- * @return this.
+ * @param applyInsetsToRect true if they should be applied.
+ * @return this.
*/
public ToolTipContext setApplyComponentInsetsToRect(final boolean applyInsetsToRect) {
this.applyInsetsToRect = applyInsetsToRect;
@@ -414,9 +408,9 @@ public class ToolTipContext {
}
/**
- * @param insideRect the rectangle to check.
- * @return this
- * @see #setInsideArea(Area)
+ * @param insideRect the rectangle to check.
+ * @return this
+ * @see #setInsideArea(Area)
*/
public ToolTipContext setInsideArea(final Rectangle insideRect) {
this.hotSpotArea = new Area(insideRect);
@@ -426,8 +420,8 @@ public class ToolTipContext {
/**
* Sets insets for the tooltip.
*
- * @param insets the insets to set.
- * @return this.
+ * @param insets the insets to set.
+ * @return this.
*/
public ToolTipContext setToolTipInsets(final Insets insets) {
this.insets = insets;
@@ -443,8 +437,8 @@ public class ToolTipContext {
* Sets whether the border should be ignored when aligning outside. If true the tooltip is aligned w.r.t. to the
* content rect and not the component bounds.
*
- * @param ignoreBorder true if border insets should be ignored.
- * @return this.
+ * @param ignoreBorder true if border insets should be ignored.
+ * @return this.
*/
public ToolTipContext setIgnoreBorder(final boolean ignoreBorder) {
this.ignoreBorder = ignoreBorder;
@@ -454,8 +448,8 @@ public class ToolTipContext {
/**
* Sets whether the tooltip should try its best to fit inside the window/screen.
*
- * @param bestFit true if best fit adjustments should be made.
- * @return this.
+ * @param bestFit true if best fit adjustments should be made.
+ * @return this.
*/
public ToolTipContext setUseBestFit(final boolean bestFit) {
this.bestFit = bestFit;
@@ -465,10 +459,10 @@ public class ToolTipContext {
/**
* Calculates the tooltip location.
*
- * @param mp the mouse position in the target component coordinate space.
- * @param mouseEvent the mouse event.
- * @return the tooltip location.
- * @see JComponent#getToolTipLocation(MouseEvent)
+ * @param mp the mouse position in the target component coordinate space.
+ * @param mouseEvent the mouse event.
+ * @return the tooltip location.
+ * @see JComponent#getToolTipLocation(MouseEvent)
*/
public Point getToolTipLocation(final Point mp, final MouseEvent mouseEvent) {
if (target == null) return null;
@@ -529,7 +523,7 @@ public class ToolTipContext {
* Get the tooltip.
*
* @return the tooltip.
- * @see JComponent#createToolTip()
+ * @see JComponent#createToolTip()
*/
public JToolTip getToolTip() {
if (toolTip == null) {
@@ -551,7 +545,6 @@ public class ToolTipContext {
return dim;
}
-
private Point alignCenter(final Dimension dim, final Rectangle rect) {
rect.x += rect.width / 2;
rect.y += rect.height / 2;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipStyle.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipStyle.java
index 1228c509..4f6c53c7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipStyle.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipStyle.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tooltip;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareButton.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareButton.java
index 87fd021d..e9d287a1 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareButton.java
@@ -20,14 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tooltip;
+import javax.swing.*;
+
import com.github.weisj.darklaf.ui.tooltip.DarkTooltipUI;
import com.github.weisj.darklaf.util.Alignment;
-import javax.swing.*;
-
public class TooltipAwareButton extends JButton implements ToolTipAware {
private ToolTipContext context;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareToggleButton.java b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareToggleButton.java
index f81c7909..21b9b9b5 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareToggleButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareToggleButton.java
@@ -20,14 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tooltip;
+import javax.swing.*;
+
import com.github.weisj.darklaf.ui.tooltip.DarkTooltipUI;
import com.github.weisj.darklaf.util.Alignment;
-import javax.swing.*;
-
public class TooltipAwareToggleButton extends JToggleButton implements ToolTipAware {
private ToolTipContext context;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateButtonModel.java b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateButtonModel.java
index d84a2a12..05610dc2 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateButtonModel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateButtonModel.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tristate;
-import javax.swing.*;
import java.awt.event.ItemEvent;
+import javax.swing.*;
+
public class TristateButtonModel extends JToggleButton.ToggleButtonModel {
private TristateState state = TristateState.DESELECTED;
@@ -80,7 +82,7 @@ public class TristateButtonModel extends JToggleButton.ToggleButtonModel {
displayState();
fireStateChanged();
int indeterminate = 3;
- //noinspection MagicConstant
+ // noinspection MagicConstant
fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, indeterminate));
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBox.java b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBox.java
index bd873093..b234590c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBox.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBox.java
@@ -20,19 +20,21 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tristate;
-import com.github.weisj.darklaf.DarkLaf;
-
-import javax.swing.*;
-import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.*;
+import javax.swing.event.ChangeListener;
+
+import com.github.weisj.darklaf.DarkLaf;
+
public class TristateCheckBox extends JCheckBox {
private final ChangeListener enableListener = e -> TristateCheckBox.this.setFocusable(getModel().isEnabled());
@@ -74,7 +76,6 @@ public class TristateCheckBox extends JCheckBox {
return (TristateButtonModel) super.getModel();
}
-
public String getUIClassID() {
if (UIManager.getLookAndFeel() instanceof DarkLaf) {
return "TristateCheckBoxUI";
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBoxMenuItem.java b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBoxMenuItem.java
index 99d50237..f94ba1ae 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBoxMenuItem.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBoxMenuItem.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tristate;
-import com.github.weisj.darklaf.DarkLaf;
-
-import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.DarkLaf;
+
public class TristateCheckBoxMenuItem extends JCheckBoxMenuItem {
/**
@@ -63,7 +65,7 @@ public class TristateCheckBoxMenuItem extends JCheckBoxMenuItem {
* Creates a menu item whose properties are taken from the Action supplied.
*
* @param a the action of the {@code JCheckBoxMenuItem}
- * @since 1.3
+ * @since 1.3
*/
public TristateCheckBoxMenuItem(final Action a) {
this();
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateState.java b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateState.java
index c763e396..5c60e39e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateState.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateState.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.tristate;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/Insets2D.java b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/Insets2D.java
index d8a5bba6..36ff85ee 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/Insets2D.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/Insets2D.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.uiresource;
@@ -38,7 +39,6 @@ public final class Insets2D implements Cloneable {
* @param bottom the inset from the bottom.
* @param right the inset from the right.
*/
-
public Insets2D(final double top, final double left, final double bottom, final double right) {
this.top = top;
this.left = left;
@@ -53,7 +53,7 @@ public final class Insets2D implements Cloneable {
* @param left the inset from the left.
* @param bottom the inset from the bottom.
* @param right the inset from the right.
- * @since 1.5
+ * @since 1.5
*/
public void set(final double top, final double left, final double bottom, final double right) {
this.top = top;
@@ -62,7 +62,6 @@ public final class Insets2D implements Cloneable {
this.right = right;
}
-
@Override
public int hashCode() {
double sum1 = left + bottom;
@@ -73,7 +72,6 @@ public final class Insets2D implements Cloneable {
return (int) (sum3 * (sum3 + 1) / 2 + val2);
}
-
@Override
public boolean equals(final Object obj) {
if (obj instanceof Insets2D) {
@@ -84,16 +82,12 @@ public final class Insets2D implements Cloneable {
return false;
}
-
@Override
public Insets2D clone() {
return new Insets2D(top, left, bottom, right);
}
-
public String toString() {
return getClass().getName() + "[top=" + top + ",left=" + left + ",bottom=" + bottom + ",right=" + right + "]";
}
-
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JButtonUIResource.java b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JButtonUIResource.java
index 0a579538..7471eec2 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JButtonUIResource.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JButtonUIResource.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.uiresource;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JLabelUIResource.java b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JLabelUIResource.java
index 81573007..8930884b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JLabelUIResource.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JLabelUIResource.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.uiresource;
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JPanelUIResource.java b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JPanelUIResource.java
index e9999cac..c1984e32 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JPanelUIResource.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/JPanelUIResource.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.uiresource;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.plaf.UIResource;
-import java.awt.*;
public class JPanelUIResource extends JPanel implements UIResource {
diff --git a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/UIResourceWrapper.java b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/UIResourceWrapper.java
index f7ee7fdc..497ef555 100644
--- a/core/src/main/java/com/github/weisj/darklaf/components/uiresource/UIResourceWrapper.java
+++ b/core/src/main/java/com/github/weisj/darklaf/components/uiresource/UIResourceWrapper.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.components.uiresource;
-import javax.swing.border.Border;
import java.awt.*;
+import javax.swing.border.Border;
+
public class UIResourceWrapper extends JPanelUIResource {
public UIResourceWrapper(final Component component) {
@@ -41,8 +43,7 @@ public class UIResourceWrapper extends JPanelUIResource {
}
@Override
- public void setOpaque(final boolean isOpaque) {
- }
+ public void setOpaque(final boolean isOpaque) {}
@Override
public boolean isOpaque() {
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/AncestorAdapter.java b/core/src/main/java/com/github/weisj/darklaf/decorators/AncestorAdapter.java
index 2b04c6c9..5eb514c1 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/AncestorAdapter.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/AncestorAdapter.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -28,14 +29,11 @@ import javax.swing.event.AncestorListener;
public class AncestorAdapter implements AncestorListener {
@Override
- public void ancestorAdded(final AncestorEvent event) {
- }
+ public void ancestorAdded(final AncestorEvent event) {}
@Override
- public void ancestorRemoved(final AncestorEvent event) {
- }
+ public void ancestorRemoved(final AncestorEvent event) {}
@Override
- public void ancestorMoved(final AncestorEvent event) {
- }
+ public void ancestorMoved(final AncestorEvent event) {}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/CellRenderer.java b/core/src/main/java/com/github/weisj/darklaf/decorators/CellRenderer.java
index 65004567..c713de80 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/CellRenderer.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/CellRenderer.java
@@ -20,8 +20,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
-public interface CellRenderer {
-}
+public interface CellRenderer {}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/ComponentResizeListener.java b/core/src/main/java/com/github/weisj/darklaf/decorators/ComponentResizeListener.java
index 7b2e32d8..e43cf183 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/ComponentResizeListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/ComponentResizeListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -30,21 +31,18 @@ import java.awt.event.ComponentListener;
* Wrapper interface for resize listener.
*
* @author Jannis Weis
- * @since 2019
+ * @since 2019
*/
public interface ComponentResizeListener extends ComponentListener {
@Override
void componentResized(ComponentEvent e);
@Override
- default void componentMoved(final ComponentEvent e) {
- }
+ default void componentMoved(final ComponentEvent e) {}
@Override
- default void componentShown(final ComponentEvent e) {
- }
+ default void componentShown(final ComponentEvent e) {}
@Override
- default void componentHidden(final ComponentEvent e) {
- }
+ default void componentHidden(final ComponentEvent e) {}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/HoverListener.java b/core/src/main/java/com/github/weisj/darklaf/decorators/HoverListener.java
index 5fc076ef..1294ffcb 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/HoverListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/HoverListener.java
@@ -20,13 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
-import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
@@ -36,7 +38,6 @@ public class HoverListener implements MouseListener {
private boolean hover = false;
private boolean scheduled = false;
-
public HoverListener(final JComponent component) {
this.component = component;
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/LayoutManagerDelegate.java b/core/src/main/java/com/github/weisj/darklaf/decorators/LayoutManagerDelegate.java
index 5f41b6b3..343f0b85 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/LayoutManagerDelegate.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/LayoutManagerDelegate.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -28,7 +29,6 @@ import java.awt.*;
public class LayoutManagerDelegate implements LayoutManager {
private final LayoutManager delegate;
-
public LayoutManagerDelegate(final LayoutManager delegate) {
if (delegate == null) {
throw new IllegalArgumentException("Delegate is null");
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseClickListener.java b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseClickListener.java
index 676f062f..553323b7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseClickListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseClickListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -33,18 +34,14 @@ public interface MouseClickListener extends MouseListener {
void mouseClicked(MouseEvent e);
@Override
- default void mousePressed(final MouseEvent e) {
- }
+ default void mousePressed(final MouseEvent e) {}
@Override
- default void mouseReleased(final MouseEvent e) {
- }
+ default void mouseReleased(final MouseEvent e) {}
@Override
- default void mouseEntered(final MouseEvent e) {
- }
+ default void mouseEntered(final MouseEvent e) {}
@Override
- default void mouseExited(final MouseEvent e) {
- }
+ default void mouseExited(final MouseEvent e) {}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseInputDelegate.java b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseInputDelegate.java
index 5acc7d93..0aaaac87 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseInputDelegate.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseInputDelegate.java
@@ -20,15 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
-import javax.swing.event.MouseInputListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
+import javax.swing.event.MouseInputListener;
+
public class MouseInputDelegate implements MouseInputListener {
protected MouseListener mouseDelegate;
@@ -62,16 +64,14 @@ public class MouseInputDelegate implements MouseInputListener {
public void setMotionDelegate(final MouseMotionListener motionDelegate) {
this.motionDelegate = motionDelegate;
if (motionDelegate == null) {
- this.motionDelegate = new MouseAdapter() {
- };
+ this.motionDelegate = new MouseAdapter() {};
}
}
public void setMouseDelegate(final MouseListener delegate) {
this.mouseDelegate = delegate;
if (delegate == null) {
- this.mouseDelegate = new MouseAdapter() {
- };
+ this.mouseDelegate = new MouseAdapter() {};
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseMovementListener.java b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseMovementListener.java
index 8c185806..c52658a3 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseMovementListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseMovementListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -29,8 +30,7 @@ import java.awt.event.MouseMotionListener;
public interface MouseMovementListener extends MouseMotionListener {
@Override
- default void mouseDragged(final MouseEvent e) {
- }
+ default void mouseDragged(final MouseEvent e) {}
@Override
void mouseMoved(MouseEvent e);
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseResponder.java b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseResponder.java
index bec06845..c7f28992 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/MouseResponder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/MouseResponder.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
@@ -31,7 +32,6 @@ public class MouseResponder implements MouseListener {
private final Consumer consumer;
-
public MouseResponder(final Consumer consumer) {
this.consumer = consumer;
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/PlainAction.java b/core/src/main/java/com/github/weisj/darklaf/decorators/PlainAction.java
index 77d0cdb7..1d96cbf8 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/PlainAction.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/PlainAction.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
-import javax.swing.*;
import java.awt.event.ActionEvent;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/PopupMenuAdapter.java b/core/src/main/java/com/github/weisj/darklaf/decorators/PopupMenuAdapter.java
index e9cba58b..a613f45e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/PopupMenuAdapter.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/PopupMenuAdapter.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
diff --git a/core/src/main/java/com/github/weisj/darklaf/decorators/UpdateDocumentListener.java b/core/src/main/java/com/github/weisj/darklaf/decorators/UpdateDocumentListener.java
index a7179a66..5cf12aea 100644
--- a/core/src/main/java/com/github/weisj/darklaf/decorators/UpdateDocumentListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/decorators/UpdateDocumentListener.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.decorators;
diff --git a/core/src/main/java/com/github/weisj/darklaf/log/LogFormatter.java b/core/src/main/java/com/github/weisj/darklaf/log/LogFormatter.java
index 4694e9a3..b25ff535 100644
--- a/core/src/main/java/com/github/weisj/darklaf/log/LogFormatter.java
+++ b/core/src/main/java/com/github/weisj/darklaf/log/LogFormatter.java
@@ -20,17 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.log;
-import com.github.weisj.darklaf.util.StringUtil;
-
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
+import com.github.weisj.darklaf.util.StringUtil;
+
/**
* @author Jannis Weis
*/
@@ -98,7 +99,6 @@ public class LogFormatter extends Formatter {
return builder.toString();
}
-
private String calculateDateString(final long milliseconds) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(milliseconds);
diff --git a/core/src/main/java/com/github/weisj/darklaf/platform/DecorationsHandler.java b/core/src/main/java/com/github/weisj/darklaf/platform/DecorationsHandler.java
index 1f17bf0c..1929d8d8 100644
--- a/core/src/main/java/com/github/weisj/darklaf/platform/DecorationsHandler.java
+++ b/core/src/main/java/com/github/weisj/darklaf/platform/DecorationsHandler.java
@@ -20,9 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.platform;
+import java.awt.*;
+import java.util.Properties;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.platform.decorations.CustomTitlePane;
@@ -32,10 +38,6 @@ import com.github.weisj.darklaf.platform.windows.WindowsDecorationsProvider;
import com.github.weisj.darklaf.util.PropertyValue;
import com.github.weisj.darklaf.util.SystemInfo;
-import javax.swing.*;
-import java.awt.*;
-import java.util.Properties;
-
public class DecorationsHandler {
public static final String DECORATIONS_FLAG = DarkLaf.SYSTEM_PROPERTY_PREFIX + "decorations";
@@ -54,19 +56,19 @@ public class DecorationsHandler {
protected DecorationsHandler() {
try {
- //Extend for different platforms.
+ // Extend for different platforms.
boolean enableDecorations = isNativeDecorationsEnabled();
if (SystemInfo.isWindows10 && enableDecorations) {
- //Decorations are in the Windows10 visuals. Disable for older version.
+ // Decorations are in the Windows10 visuals. Disable for older version.
decorationsProvider = new WindowsDecorationsProvider();
} else if (SystemInfo.isMacOSYosemite && enableDecorations) {
- //Compiled binary needs at least macOS 10.10 (Yosemite).
+ // Compiled binary needs at least macOS 10.10 (Yosemite).
decorationsProvider = new MacOSDecorationsProvider();
} else {
decorationsProvider = new DefaultDecorationsProvider();
}
} catch (Throwable e) {
- //If decorations modules are not available disable them.
+ // If decorations modules are not available disable them.
decorationsProvider = new DefaultDecorationsProvider();
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/platform/DefaultDecorationsProvider.java b/core/src/main/java/com/github/weisj/darklaf/platform/DefaultDecorationsProvider.java
index f9dc4297..3b7f74b9 100644
--- a/core/src/main/java/com/github/weisj/darklaf/platform/DefaultDecorationsProvider.java
+++ b/core/src/main/java/com/github/weisj/darklaf/platform/DefaultDecorationsProvider.java
@@ -20,27 +20,27 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.platform;
-import com.github.weisj.darklaf.platform.decorations.CustomTitlePane;
-import com.github.weisj.darklaf.platform.decorations.DecorationsProvider;
-
-import javax.swing.*;
import java.awt.*;
import java.util.Properties;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.platform.decorations.CustomTitlePane;
+import com.github.weisj.darklaf.platform.decorations.DecorationsProvider;
+
public class DefaultDecorationsProvider implements DecorationsProvider {
@Override
public CustomTitlePane createTitlePane(final JRootPane rootPane, final int decorationStyle, final Window window) {
return new CustomTitlePane() {
@Override
- public void install() {
- }
+ public void install() {}
@Override
- public void uninstall() {
- }
+ public void uninstall() {}
@Override
public Insets getWindowSizeAdjustment() {
@@ -55,10 +55,8 @@ public class DefaultDecorationsProvider implements DecorationsProvider {
}
@Override
- public void initialize() {
- }
+ public void initialize() {}
@Override
- public void loadDecorationProperties(final Properties properties, final UIDefaults currentDefaults) {
- }
+ public void loadDecorationProperties(final Properties properties, final UIDefaults currentDefaults) {}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/platform/DefaultThemePreferenceProvider.java b/core/src/main/java/com/github/weisj/darklaf/platform/DefaultThemePreferenceProvider.java
index ea8c9c2e..27d669c5 100644
--- a/core/src/main/java/com/github/weisj/darklaf/platform/DefaultThemePreferenceProvider.java
+++ b/core/src/main/java/com/github/weisj/darklaf/platform/DefaultThemePreferenceProvider.java
@@ -20,16 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.platform;
+import java.util.function.Consumer;
+
import com.github.weisj.darklaf.theme.info.ColorToneRule;
import com.github.weisj.darklaf.theme.info.ContrastRule;
import com.github.weisj.darklaf.theme.info.PreferredThemeStyle;
import com.github.weisj.darklaf.theme.info.ThemePreferenceProvider;
-import java.util.function.Consumer;
-
public class DefaultThemePreferenceProvider implements ThemePreferenceProvider {
@Override
public PreferredThemeStyle getPreference() {
@@ -37,16 +38,13 @@ public class DefaultThemePreferenceProvider implements ThemePreferenceProvider {
}
@Override
- public void initialize() {
- }
+ public void initialize() {}
@Override
- public void setCallback(final Consumer callback) {
- }
+ public void setCallback(final Consumer callback) {}
@Override
- public void setReporting(final boolean reporting) {
- }
+ public void setReporting(final boolean reporting) {}
@Override
public boolean isReporting() {
diff --git a/core/src/main/java/com/github/weisj/darklaf/platform/ThemePreferencesHandler.java b/core/src/main/java/com/github/weisj/darklaf/platform/ThemePreferencesHandler.java
index 3f1b85b6..5d2258f6 100644
--- a/core/src/main/java/com/github/weisj/darklaf/platform/ThemePreferencesHandler.java
+++ b/core/src/main/java/com/github/weisj/darklaf/platform/ThemePreferencesHandler.java
@@ -20,9 +20,12 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.platform;
+import javax.swing.*;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.platform.macos.MacOSThemePreferenceProvider;
import com.github.weisj.darklaf.platform.windows.WindowsThemePreferenceProvider;
@@ -34,8 +37,6 @@ import com.github.weisj.darklaf.theme.info.ThemePreferenceProvider;
import com.github.weisj.darklaf.util.PropertyValue;
import com.github.weisj.darklaf.util.SystemInfo;
-import javax.swing.*;
-
public class ThemePreferencesHandler {
public static final String PREFERENCE_REPORTING_FLAG = DarkLaf.SYSTEM_PROPERTY_PREFIX + "enableNativePreferences";
@@ -44,7 +45,6 @@ public class ThemePreferencesHandler {
private final ThemePreferenceChangeSupport changeSupport = new ThemePreferenceChangeSupport();
private ThemePreferenceProvider preferenceProvider;
-
public static ThemePreferencesHandler getSharedInstance() {
if (sharedInstance == null) setSharedInstance(new ThemePreferencesHandler());
return sharedInstance;
@@ -118,7 +118,6 @@ public class ThemePreferencesHandler {
return preferenceProvider.supportsNativeTheme();
}
-
public PreferredThemeStyle getPreferredThemeStyle() {
return preferenceProvider.getPreference();
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettings.java b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettings.java
index 6e795cac..6a639b76 100644
--- a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettings.java
+++ b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettings.java
@@ -20,9 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.settings;
+import java.awt.*;
+import java.awt.event.WindowEvent;
+import java.util.ResourceBundle;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.components.DefaultButton;
import com.github.weisj.darklaf.theme.Theme;
@@ -33,11 +40,6 @@ import com.github.weisj.darklaf.theme.info.FontSizeRule;
import com.github.weisj.darklaf.util.DarkUIUtil;
import com.github.weisj.darklaf.util.ImageUtil;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.WindowEvent;
-import java.util.ResourceBundle;
-
public class ThemeSettings implements ThemePreferenceListener {
private static ThemeSettings instance;
@@ -54,7 +56,7 @@ public class ThemeSettings implements ThemePreferenceListener {
/**
* Show the settings as a dialog.
*
- * @param parent the parent component.
+ * @param parent the parent component.
* @throws IllegalStateException If {@link #getSettingsPanel()} is already in use.
*/
public static void showSettingsDialog(final Component parent) {
@@ -64,8 +66,8 @@ public class ThemeSettings implements ThemePreferenceListener {
/**
* Show the settings as a dialog.
*
- * @param parent the parent component.
- * @param modalityType the modality type.
+ * @param parent the parent component.
+ * @param modalityType the modality type.
* @throws IllegalStateException If {@link #getSettingsPanel()} is already in use.
*/
public static void showSettingsDialog(final Component parent, final Dialog.ModalityType modalityType) {
@@ -96,8 +98,8 @@ public class ThemeSettings implements ThemePreferenceListener {
/**
* Show the settings as a dialog.
*
- * @param parent the parent component.
- * @param modal the modality type.
+ * @param parent the parent component.
+ * @param modal the modality type.
* @throws IllegalStateException If {@link #getSettingsPanel()} is already in use.
*/
public void showDialog(final Component parent, final Dialog.ModalityType modal) {
@@ -128,11 +130,11 @@ public class ThemeSettings implements ThemePreferenceListener {
* Returns whether the option to follow the system settings is enabled.
*
* @return true if enabled.
- * @see #isSystemPreferencesEnabled() (boolean)
- * @see #isThemeFollowsSystem()
- * @see #isAccentColorFollowsSystem()
- * @see #isSelectionColorFollowsSystem()
- * @see #isFontSizeFollowsSystem()
+ * @see #isSystemPreferencesEnabled() (boolean)
+ * @see #isThemeFollowsSystem()
+ * @see #isAccentColorFollowsSystem()
+ * @see #isSelectionColorFollowsSystem()
+ * @see #isFontSizeFollowsSystem()
*/
public boolean isSystemPreferencesEnabled() {
return settingsPanel.isSystemPreferencesEnabled();
@@ -142,7 +144,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Returns whether the accent color follows the system settings.
*
* @return true if accent color follows system settings.
- * @see #setAccentColorFollowsSystem(boolean)
+ * @see #setAccentColorFollowsSystem(boolean)
*/
public boolean isAccentColorFollowsSystem() {
return settingsPanel.isAccentColorFollowsSystem();
@@ -152,7 +154,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Returns whether the font size follows the system settings.
*
* @return true if font size follows system settings.
- * @see #setFontSizeFollowsSystem(boolean)
+ * @see #setFontSizeFollowsSystem(boolean)
*/
public boolean isFontSizeFollowsSystem() {
return settingsPanel.isFontSizeFollowsSystem();
@@ -162,7 +164,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Returns whether the selection color follows the system settings.
*
* @return true if selection color follows system settings.
- * @see #setSelectionColorFollowsSystem(boolean)
+ * @see #setSelectionColorFollowsSystem(boolean)
*/
public boolean isSelectionColorFollowsSystem() {
return settingsPanel.isSelectionColorFollowsSystem();
@@ -172,19 +174,18 @@ public class ThemeSettings implements ThemePreferenceListener {
* Returns whether the theme follows the system settings.
*
* @return true if theme follows system settings.
- * @see #setThemeFollowsSystem(boolean)
+ * @see #setThemeFollowsSystem(boolean)
*/
public boolean isThemeFollowsSystem() {
return settingsPanel.isThemeFollowsSystem();
}
-
/**
* Get the currently selected accent color rule. This is not the same as the rule of {@link LafManager#getTheme()}
* as the current settings might not have been applied.
*
* @return the current selected accent color rule.
- * @see #setAccentColorRule(AccentColorRule)
+ * @see #setAccentColorRule(AccentColorRule)
*/
public AccentColorRule getAccentColorRule() {
return settingsPanel.getAccentColorRule();
@@ -195,7 +196,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* the current settings might not have been applied.
*
* @return the current selected font size rule.
- * @see #setFontSizeRule(FontSizeRule)
+ * @see #setFontSizeRule(FontSizeRule)
*/
public FontSizeRule getFontSizeRule() {
return settingsPanel.getFontSizeRule();
@@ -206,7 +207,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* might not have been applied.
*
* @return the current selected theme.
- * @see #setTheme(Theme)
+ * @see #setTheme(Theme)
*/
public Theme getTheme() {
return settingsPanel.getTheme();
@@ -216,10 +217,10 @@ public class ThemeSettings implements ThemePreferenceListener {
* Enables the option to follow system preferences.
*
* @param enabled true if enabled.
- * @see #setAccentColorFollowsSystem(boolean)
- * @see #setSelectionColorFollowsSystem(boolean)
- * @see #setFontSizeFollowsSystem(boolean)
- * @see #setThemeFollowsSystem(boolean)
+ * @see #setAccentColorFollowsSystem(boolean)
+ * @see #setSelectionColorFollowsSystem(boolean)
+ * @see #setFontSizeFollowsSystem(boolean)
+ * @see #setThemeFollowsSystem(boolean)
*/
public void setEnabledSystemPreferences(final boolean enabled) {
settingsPanel.setEnabledSystemPreferences(enabled);
@@ -230,7 +231,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* #isSelectionColorFollowsSystem()} is true.
*
* @param accentColorFollowsSystem true if accent color should follow system.
- * @see #isAccentColorFollowsSystem()
+ * @see #isAccentColorFollowsSystem()
*/
public void setAccentColorFollowsSystem(final boolean accentColorFollowsSystem) {
settingsPanel.setAccentColorFollowsSystem(accentColorFollowsSystem);
@@ -241,7 +242,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* #isSelectionColorFollowsSystem()} is true.
*
* @param fontSizeFollowsSystem true if font size should follow system.
- * @see #isFontSizeFollowsSystem()
+ * @see #isFontSizeFollowsSystem()
*/
public void setFontSizeFollowsSystem(final boolean fontSizeFollowsSystem) {
settingsPanel.setFontSizeFollowsSystem(fontSizeFollowsSystem);
@@ -252,7 +253,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* #isSelectionColorFollowsSystem()} is true.
*
* @param selectionColorFollowsSystem true if selection color should follow system.
- * @see #isSelectionColorFollowsSystem()
+ * @see #isSelectionColorFollowsSystem()
*/
public void setSelectionColorFollowsSystem(final boolean selectionColorFollowsSystem) {
settingsPanel.setSelectionColorFollowsSystem(selectionColorFollowsSystem);
@@ -263,7 +264,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* #isSelectionColorFollowsSystem()} is true.
*
* @param themeFollowsSystem true if theme should follow system.
- * @see #isThemeFollowsSystem()
+ * @see #isThemeFollowsSystem()
*/
public void setThemeFollowsSystem(final boolean themeFollowsSystem) {
settingsPanel.setThemeFollowsSystem(themeFollowsSystem);
@@ -273,7 +274,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Sets the font accent color rule. The theme is not updated until {@link #apply()} is called.
*
* @param accentColorRule the accent color rule
- * @see #getAccentColorRule()
+ * @see #getAccentColorRule()
*/
public void setAccentColorRule(final AccentColorRule accentColorRule) {
settingsPanel.setAccentColorRule(accentColorRule);
@@ -283,7 +284,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Sets the font size rule. The theme is not updated until {@link #apply()} is called.
*
* @param fontSizeRule the font size rule.
- * @see #getFontSizeRule()
+ * @see #getFontSizeRule()
*/
public void setFontSizeRule(final FontSizeRule fontSizeRule) {
settingsPanel.setFontSizeRule(fontSizeRule);
@@ -293,7 +294,7 @@ public class ThemeSettings implements ThemePreferenceListener {
* Sets the theme. The theme is not updated until {@link #apply()} is called.
*
* @param theme the theme.
- * @see #getTheme()
+ * @see #getTheme()
*/
public void setTheme(final Theme theme) {
settingsPanel.setTheme(theme);
diff --git a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java
index f8819ad9..8f86cac3 100644
--- a/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/settings/ThemeSettingsPanel.java
@@ -20,9 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.settings;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.util.*;
+
+import javax.swing.*;
+import javax.swing.plaf.SliderUI;
+
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.components.ColoredRadioButton;
import com.github.weisj.darklaf.components.color.QuickColorChooser;
@@ -41,13 +50,6 @@ import com.github.weisj.darklaf.ui.slider.DarkSliderUI;
import com.github.weisj.darklaf.ui.tooltip.ToolTipConstants;
import com.github.weisj.darklaf.util.Alignment;
-import javax.swing.*;
-import javax.swing.plaf.SliderUI;
-import java.awt.*;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.util.*;
-
public class ThemeSettingsPanel extends JPanel {
private final ResourceBundle resourceBundle;
@@ -115,10 +117,10 @@ public class ThemeSettingsPanel extends JPanel {
fontSizeFollowsSystem.setEnabled(enabled);
if (enabledSystemPreferences.isSelected()) {
themeFollowsSystem.setSelected(themeFollowsSystem.isSelected() && themeFollowsSystem.isEnabled());
- accentColorFollowsSystem.setSelected(
- accentColorFollowsSystem.isSelected() && accentColorFollowsSystem.isEnabled());
- selectionColorFollowsSystem.setSelected(
- selectionColorFollowsSystem.isSelected() && selectionColorFollowsSystem.isEnabled());
+ accentColorFollowsSystem.setSelected(accentColorFollowsSystem.isSelected()
+ && accentColorFollowsSystem.isEnabled());
+ selectionColorFollowsSystem.setSelected(selectionColorFollowsSystem.isSelected()
+ && selectionColorFollowsSystem.isEnabled());
fontSizeFollowsSystem.setSelected(fontSizeFollowsSystem.isSelected() && fontSizeFollowsSystem.isEnabled());
}
if (!skipPreferences) {
@@ -216,9 +218,9 @@ public class ThemeSettingsPanel extends JPanel {
private Component createGeneralSettings() {
JLabel themeLabel = new JLabel(resourceBundle.getString("label_theme"));
- themeComboBox = new JComboBox(LafManager.getThemeComboBoxModel()) {{
- setSelectedItem(LafManager.getTheme());
- }};
+ themeComboBox = new JComboBox(LafManager.getThemeComboBoxModel());
+ themeComboBox.setSelectedItem(LafManager.getTheme());
+
themeComboBox.putClientProperty(ComboBoxConstants.KEY_DO_NOT_UPDATE_WHEN_SCROLLED, true);
themeComboBox.addItemListener(e -> update(false));
themeLabel.setLabelFor(themeComboBox);
@@ -335,8 +337,8 @@ public class ThemeSettingsPanel extends JPanel {
protected Theme getTheme(final PreferredThemeStyle preferredThemeStyle) {
return isThemeFollowsSystem()
- ? LafManager.themeForPreferredStyle(preferredThemeStyle)
- : (Theme) themeComboBox.getSelectedItem();
+ ? LafManager.themeForPreferredStyle(preferredThemeStyle)
+ : (Theme) themeComboBox.getSelectedItem();
}
public FontSizeRule getFontSizeRule() {
@@ -347,8 +349,8 @@ public class ThemeSettingsPanel extends JPanel {
protected FontSizeRule getFontSizeRule(final Theme theme, final PreferredThemeStyle preferredThemeStyle) {
if (theme == null) return FontSizeRule.getDefault();
return isFontSizeFollowsSystem()
- ? preferredThemeStyle.getFontSizeRule()
- : FontSizeRule.relativeAdjustment(fontSlider.getValue());
+ ? preferredThemeStyle.getFontSizeRule()
+ : FontSizeRule.relativeAdjustment(fontSlider.getValue());
}
public AccentColorRule getAccentColorRule() {
@@ -365,16 +367,16 @@ public class ThemeSettingsPanel extends JPanel {
protected Color getAccentColor(final Theme theme, final boolean useThemeColor) {
return theme.supportsCustomAccentColor()
- ? useThemeColor ? theme.getAccentColorRule().getAccentColor()
- : getSelectedColor(bgAccent)
- : null;
+ ? useThemeColor ? theme.getAccentColorRule().getAccentColor()
+ : getSelectedColor(bgAccent)
+ : null;
}
protected Color getSelectionColor(final Theme theme, final boolean useThemeColor) {
return theme.supportsCustomSelectionColor()
- ? useThemeColor ? theme.getAccentColorRule().getSelectionColor()
- : getSelectedColor(bgSelection)
- : null;
+ ? useThemeColor ? theme.getAccentColorRule().getSelectionColor()
+ : getSelectedColor(bgSelection)
+ : null;
}
public void setEnabledSystemPreferences(final boolean enabled) {
@@ -458,19 +460,19 @@ public class ThemeSettingsPanel extends JPanel {
}
};
ToolTipContext context = new ToolTipContext()
- .setAlignment(Alignment.CENTER)
- .setCenterAlignment(Alignment.NORTH)
- .setUseBestFit(true)
- .setToolTipRectSupplier(e -> {
- SliderUI ui = fontSlider.getUI();
- if (ui instanceof DarkSliderUI) {
- Rectangle r = ((DarkSliderUI) ui).getThumbRect();
- r.x -= 1;
- return r;
- }
- return new Rectangle(0, 0, fontSlider.getWidth(),
- fontSlider.getHeight());
- });
+ .setAlignment(Alignment.CENTER)
+ .setCenterAlignment(Alignment.NORTH)
+ .setUseBestFit(true)
+ .setToolTipRectSupplier(e -> {
+ SliderUI ui = fontSlider.getUI();
+ if (ui instanceof DarkSliderUI) {
+ Rectangle r = ((DarkSliderUI) ui).getThumbRect();
+ r.x -= 1;
+ return r;
+ }
+ return new Rectangle(0, 0, fontSlider.getWidth(),
+ fontSlider.getHeight());
+ });
fontSlider.putClientProperty(DarkSliderUI.KEY_INSTANT_SCROLL, true);
fontSlider.putClientProperty(ToolTipConstants.KEY_CONTEXT, context);
fontSlider.putClientProperty(ToolTipConstants.KEY_STYLE, ToolTipConstants.VARIANT_BALLOON);
@@ -627,8 +629,8 @@ public class ThemeSettingsPanel extends JPanel {
verticalComponentGroup.addComponent(field, p, p, p);
}
for (int i = 0; i < left.length; i++) {
- verticalGroup.addGroup(layout.createParallelGroup(
- GroupLayout.Alignment.CENTER).addComponent(left[i]).addComponent(right[i], p, p, p));
+ verticalGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
+ .addComponent(left[i]).addComponent(right[i], p, p, p));
}
return panel;
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/settings/ThemedColor.java b/core/src/main/java/com/github/weisj/darklaf/settings/ThemedColor.java
index 5224805c..be25b3e4 100644
--- a/core/src/main/java/com/github/weisj/darklaf/settings/ThemedColor.java
+++ b/core/src/main/java/com/github/weisj/darklaf/settings/ThemedColor.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.settings;
+import java.awt.*;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.util.ColorWrapper;
-import javax.swing.*;
-import java.awt.*;
-
public class ThemedColor extends ColorWrapper {
protected Theme currentTheme;
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/AccentColorAdjustmentTask.java b/core/src/main/java/com/github/weisj/darklaf/task/AccentColorAdjustmentTask.java
index 5bee8dd1..9178137d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/AccentColorAdjustmentTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/AccentColorAdjustmentTask.java
@@ -20,22 +20,24 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import java.awt.*;
+import java.util.List;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import javax.swing.*;
+import javax.swing.plaf.ColorUIResource;
+
import com.github.weisj.darklaf.PropertyLoader;
import com.github.weisj.darklaf.color.DarkColorModelHSB;
import com.github.weisj.darklaf.icons.IconLoader;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.util.Pair;
-import javax.swing.*;
-import javax.swing.plaf.ColorUIResource;
-import java.awt.*;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Logger;
-
public class AccentColorAdjustmentTask implements DefaultsAdjustmentTask {
private static final Logger LOGGER = Logger.getLogger(AccentColorAdjustmentTask.class.getName());
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/DefaultsAdjustmentTask.java b/core/src/main/java/com/github/weisj/darklaf/task/DefaultsAdjustmentTask.java
index e19e42db..bbb406c7 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/DefaultsAdjustmentTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/DefaultsAdjustmentTask.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.theme.Theme;
-
import java.util.Properties;
+import com.github.weisj.darklaf.theme.Theme;
+
public interface DefaultsAdjustmentTask {
/**
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/DefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/DefaultsInitTask.java
index 8887a840..ecbf9360 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/DefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/DefaultsInitTask.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.theme.Theme;
-
import javax.swing.*;
+import com.github.weisj.darklaf.theme.Theme;
+
public interface DefaultsInitTask {
/**
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/FontDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/FontDefaultsInitTask.java
index 53704e77..2490d40b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/FontDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/FontDefaultsInitTask.java
@@ -20,18 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.DarkLaf;
-import com.github.weisj.darklaf.PropertyLoader;
-import com.github.weisj.darklaf.theme.Theme;
-import com.github.weisj.darklaf.theme.info.FontSizeRule;
-import com.github.weisj.darklaf.util.SystemInfo;
-
-import javax.swing.*;
-import javax.swing.plaf.FontUIResource;
-import javax.swing.plaf.UIResource;
import java.awt.*;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
@@ -40,6 +32,16 @@ import java.util.Map;
import java.util.Properties;
import java.util.logging.Logger;
+import javax.swing.*;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.plaf.UIResource;
+
+import com.github.weisj.darklaf.DarkLaf;
+import com.github.weisj.darklaf.PropertyLoader;
+import com.github.weisj.darklaf.theme.Theme;
+import com.github.weisj.darklaf.theme.info.FontSizeRule;
+import com.github.weisj.darklaf.util.SystemInfo;
+
public class FontDefaultsInitTask implements DefaultsInitTask {
private static final Logger LOGGER = Logger.getLogger(FontDefaultsInitTask.class.getName());
@@ -47,10 +49,10 @@ public class FontDefaultsInitTask implements DefaultsInitTask {
private static final String FONT_SIZE_DEFAULTS_NAME = "font_sizes";
private static final String FONT_DEFAULTS_NAME = "font";
- private static final Map ENABLE_KERNING
- = Collections.singletonMap(TextAttribute.KERNING, TextAttribute.KERNING_ON);
- private static final Map DISABLE_KERNING
- = Collections.singletonMap(TextAttribute.KERNING, null);
+ private static final Map ENABLE_KERNING = Collections.singletonMap(TextAttribute.KERNING,
+ TextAttribute.KERNING_ON);
+ private static final Map DISABLE_KERNING = Collections.singletonMap(TextAttribute.KERNING,
+ null);
private static final String MAC_OS_CATALINA_FONT_NAME = ".AppleSystemUIFont";
private static final String MAC_OS_FONT_NAME = ".SF NS Text";
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/FontMapper.java b/core/src/main/java/com/github/weisj/darklaf/task/FontMapper.java
index 9d8fab0e..84289831 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/FontMapper.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/FontMapper.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import javax.swing.*;
import java.awt.*;
+import javax.swing.*;
+
public interface FontMapper {
Font map(final Font font, final UIDefaults defaults);
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java
index f040d945..64d9bd0b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.theme.Theme;
-
import javax.swing.*;
+import com.github.weisj.darklaf.theme.Theme;
+
public class IdeaDefaultsInitTask implements DefaultsInitTask {
@Override
public void run(final Theme currentTheme, final UIDefaults defaults) {
@@ -35,60 +36,82 @@ public class IdeaDefaultsInitTask implements DefaultsInitTask {
@SuppressWarnings({"HardCodedStringLiteral"})
private void initIdeaDefaults(final UIDefaults defaults) {
- defaults.put("Table.ancestorInputMap", new UIDefaults.LazyInputMap(
- new Object[]{
- "ctrl C", "copy",
- "meta C", "copy",
- "ctrl V", "paste",
- "meta V", "paste",
- "ctrl X", "cut",
- "meta X", "cut",
- "COPY", "copy",
- "PASTE", "paste",
- "CUT", "cut",
- "control INSERT", "copy",
- "shift INSERT", "paste",
- "shift DELETE", "cut",
- "RIGHT", "selectNextColumn",
- "KP_RIGHT", "selectNextColumn",
- "LEFT", "selectPreviousColumn",
- "KP_LEFT", "selectPreviousColumn",
- "DOWN", "selectNextRow",
- "KP_DOWN", "selectNextRow",
- "UP", "selectPreviousRow",
- "KP_UP", "selectPreviousRow",
- "shift RIGHT", "selectNextColumnExtendSelection",
- "shift KP_RIGHT", "selectNextColumnExtendSelection",
- "shift LEFT", "selectPreviousColumnExtendSelection",
- "shift KP_LEFT", "selectPreviousColumnExtendSelection",
- "shift DOWN", "selectNextRowExtendSelection",
- "shift KP_DOWN", "selectNextRowExtendSelection",
- "shift UP", "selectPreviousRowExtendSelection",
- "shift KP_UP", "selectPreviousRowExtendSelection",
- "PAGE_UP", "scrollUpChangeSelection",
- "PAGE_DOWN", "scrollDownChangeSelection",
- "HOME", "selectFirstColumn",
- "END", "selectLastColumn",
- "shift PAGE_UP", "scrollUpExtendSelection",
- "shift PAGE_DOWN", "scrollDownExtendSelection",
- "shift HOME", "selectFirstColumnExtendSelection",
- "shift END", "selectLastColumnExtendSelection",
- "ctrl PAGE_UP", "scrollLeftChangeSelection",
- "ctrl PAGE_DOWN", "scrollRightChangeSelection",
- "ctrl HOME", "selectFirstRow",
- "ctrl END", "selectLastRow",
- "ctrl shift PAGE_UP", "scrollRightExtendSelection",
- "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
- "ctrl shift HOME", "selectFirstRowExtendSelection",
- "ctrl shift END", "selectLastRowExtendSelection",
- "TAB", "selectNextColumnCell",
- "shift TAB", "selectPreviousColumnCell",
- "ENTER", "selectNextRowCell",
- "shift ENTER", "selectPreviousRowCell",
- "ctrl A", "selectAll",
- "meta A", "selectAll",
- "ESCAPE", "cancel",
- "F2", "startEditing"
- }));
+ defaults.put("Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{
+ "ctrl C", "copy",
+ "meta C", "copy",
+ "ctrl V", "paste",
+ "meta V", "paste",
+ "ctrl X", "cut",
+ "meta X", "cut",
+ "COPY", "copy",
+ "PASTE", "paste",
+ "CUT", "cut",
+ "control INSERT", "copy",
+ "shift INSERT", "paste",
+ "shift DELETE", "cut",
+ "RIGHT", "selectNextColumn",
+ "KP_RIGHT", "selectNextColumn",
+ "LEFT", "selectPreviousColumn",
+ "KP_LEFT",
+ "selectPreviousColumn",
+ "DOWN", "selectNextRow",
+ "KP_DOWN", "selectNextRow",
+ "UP", "selectPreviousRow",
+ "KP_UP", "selectPreviousRow",
+ "shift RIGHT",
+ "selectNextColumnExtendSelection",
+ "shift KP_RIGHT",
+ "selectNextColumnExtendSelection",
+ "shift LEFT",
+ "selectPreviousColumnExtendSelection",
+ "shift KP_LEFT",
+ "selectPreviousColumnExtendSelection",
+ "shift DOWN",
+ "selectNextRowExtendSelection",
+ "shift KP_DOWN",
+ "selectNextRowExtendSelection",
+ "shift UP",
+ "selectPreviousRowExtendSelection",
+ "shift KP_UP",
+ "selectPreviousRowExtendSelection",
+ "PAGE_UP",
+ "scrollUpChangeSelection",
+ "PAGE_DOWN",
+ "scrollDownChangeSelection",
+ "HOME", "selectFirstColumn",
+ "END", "selectLastColumn",
+ "shift PAGE_UP",
+ "scrollUpExtendSelection",
+ "shift PAGE_DOWN",
+ "scrollDownExtendSelection",
+ "shift HOME",
+ "selectFirstColumnExtendSelection",
+ "shift END",
+ "selectLastColumnExtendSelection",
+ "ctrl PAGE_UP",
+ "scrollLeftChangeSelection",
+ "ctrl PAGE_DOWN",
+ "scrollRightChangeSelection",
+ "ctrl HOME", "selectFirstRow",
+ "ctrl END", "selectLastRow",
+ "ctrl shift PAGE_UP",
+ "scrollRightExtendSelection",
+ "ctrl shift PAGE_DOWN",
+ "scrollLeftExtendSelection",
+ "ctrl shift HOME",
+ "selectFirstRowExtendSelection",
+ "ctrl shift END",
+ "selectLastRowExtendSelection",
+ "TAB", "selectNextColumnCell",
+ "shift TAB",
+ "selectPreviousColumnCell",
+ "ENTER", "selectNextRowCell",
+ "shift ENTER",
+ "selectPreviousRowCell",
+ "ctrl A", "selectAll",
+ "meta A", "selectAll",
+ "ESCAPE", "cancel",
+ "F2", "startEditing"
+ }));
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/InputDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/InputDefaultsInitTask.java
index d11fed04..6fa69a62 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/InputDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/InputDefaultsInitTask.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.theme.Theme;
-import com.github.weisj.darklaf.util.SystemInfo;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
import javax.swing.*;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.text.DefaultEditorKit;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
+
+import com.github.weisj.darklaf.theme.Theme;
+import com.github.weisj.darklaf.util.SystemInfo;
public class InputDefaultsInitTask implements DefaultsInitTask {
@@ -44,7 +46,7 @@ public class InputDefaultsInitTask implements DefaultsInitTask {
// Make ENTER work in JTrees
final InputMap treeInputMap = (InputMap) defaults.get("Tree.focusInputMap");
if (treeInputMap != null) {
- // it's really possible. For example, GTK+ doesn't have such a map.
+ // it's really possible. For example, GTK+ doesn't have such a map.
treeInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "toggle");
}
// Cut/Copy/Paste in JTextAreas
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/PlatformDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/PlatformDefaultsInitTask.java
index 8d29498b..f9ec81ee 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/PlatformDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/PlatformDefaultsInitTask.java
@@ -20,16 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import javax.swing.*;
+
import com.github.weisj.darklaf.platform.DecorationsHandler;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.ui.popupmenu.DarkPopupMenuUI;
import com.github.weisj.darklaf.util.SystemInfo;
-import javax.swing.*;
-
public class PlatformDefaultsInitTask implements DefaultsInitTask {
@Override
public void run(final Theme currentTheme, final UIDefaults defaults) {
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/PropertyFontMapper.java b/core/src/main/java/com/github/weisj/darklaf/task/PropertyFontMapper.java
index 15ffd8bd..e5d99005 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/PropertyFontMapper.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/PropertyFontMapper.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
-import com.github.weisj.darklaf.LafManager;
-import com.github.weisj.darklaf.theme.Theme;
-
-import javax.swing.*;
import java.awt.*;
import java.util.logging.Logger;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.LafManager;
+import com.github.weisj.darklaf.theme.Theme;
+
public class PropertyFontMapper implements FontMapper {
private static final Logger LOGGER = Logger.getLogger(PropertyFontMapper.class.getName());
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/SystemDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/SystemDefaultsInitTask.java
index e798fd55..39626364 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/SystemDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/SystemDefaultsInitTask.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import java.util.Properties;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.PropertyLoader;
import com.github.weisj.darklaf.theme.Theme;
-import javax.swing.*;
-import java.util.Properties;
-
public class SystemDefaultsInitTask implements DefaultsInitTask {
private static final String OVERWRITES_PATH = "properties/";
@@ -43,8 +45,8 @@ public class SystemDefaultsInitTask implements DefaultsInitTask {
private void loadSystemOverwrites(final UIDefaults defaults) {
Properties overwrites = PropertyLoader.loadProperties(DarkLaf.class, OVERWRITES_NAME, OVERWRITES_PATH);
overwrites.values().removeIf(v -> System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + v.toString()) == null);
- overwrites.entrySet().forEach(
- e -> e.setValue(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX + e.getValue().toString())));
+ overwrites.entrySet().forEach(e -> e.setValue(System.getProperty(DarkLaf.SYSTEM_PROPERTY_PREFIX
+ + e.getValue().toString())));
PropertyLoader.putProperties(overwrites, defaults);
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/ThemeDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/ThemeDefaultsInitTask.java
index e3ce840b..43fb60a6 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/ThemeDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/ThemeDefaultsInitTask.java
@@ -20,33 +20,40 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import java.util.HashMap;
+import java.util.Properties;
+
+import javax.swing.*;
+import javax.swing.text.html.HTMLEditorKit;
+
import com.github.weisj.darklaf.DarkLaf;
import com.github.weisj.darklaf.PropertyLoader;
import com.github.weisj.darklaf.platform.DecorationsHandler;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.util.SystemInfo;
-import javax.swing.*;
-import javax.swing.text.html.HTMLEditorKit;
-import java.util.HashMap;
-import java.util.Properties;
-
public class ThemeDefaultsInitTask implements DefaultsInitTask {
private static final String GLOBAL_PREFIX = "global.";
private static final String MAC_OS_MENU_BAR_KEY = "apple.laf.useScreenMenuBar";
private static final String[] UI_PROPERTIES = new String[]{
- "borders", "button", "checkBox", "colorChooser", "comboBox", "fileChooser", "tristate",
- "internalFrame", "label", "list", "menu", "menuBar", "menuItem", "numberingPane", "optionPane", "panel",
- "popupMenu", "progressBar", "radioButton", "rootPane", "scrollBar", "scrollPane", "separator",
- "slider", "spinner", "splitPane", "statusBar", "tabbedPane", "tabFrame", "table", "taskPane", "text",
- "toggleButton", "toolBar", "toolTip", "tree", "misc"
+ "borders", "button", "checkBox", "colorChooser",
+ "comboBox", "fileChooser", "tristate",
+ "internalFrame", "label", "list", "menu", "menuBar",
+ "menuItem", "numberingPane", "optionPane", "panel",
+ "popupMenu", "progressBar", "radioButton", "rootPane",
+ "scrollBar", "scrollPane", "separator",
+ "slider", "spinner", "splitPane", "statusBar",
+ "tabbedPane", "tabFrame", "table", "taskPane", "text",
+ "toggleButton", "toolBar", "toolTip", "tree", "misc"
};
private static final String[] ICON_PROPERTIES = new String[]{
- "checkBox", "radioButton", "dialog", "files", "frame", "indicator", "menu", "misc", "navigation"
+ "checkBox", "radioButton", "dialog", "files", "frame",
+ "indicator", "menu", "misc", "navigation"
};
private final DefaultsAdjustmentTask userPreferenceAdjustment = new UserPreferenceAdjustmentTask();
private final DefaultsAdjustmentTask accentColorAdjustment = new AccentColorAdjustmentTask();
@@ -84,8 +91,8 @@ public class ThemeDefaultsInitTask implements DefaultsInitTask {
}
private void initGlobals(final Theme currentTheme, final UIDefaults defaults, final Properties uiProps) {
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, "globals", "properties/"), uiProps, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, "globals", "properties/"), uiProps,
+ defaults);
currentTheme.customizeGlobals(uiProps, defaults);
installGlobals(uiProps, defaults);
@@ -98,20 +105,19 @@ public class ThemeDefaultsInitTask implements DefaultsInitTask {
globalSettings.put(((String) key).substring(GLOBAL_PREFIX.length()), uiProps.get(key));
}
}
- PropertyLoader.replaceProperties(
- defaults,
- e -> e.getKey() instanceof String && ((String) e.getKey()).contains("."),
- e -> {
- final String s = (String) e.getKey();
- final String globalKey = s.substring(s.lastIndexOf('.') + 1);
- return globalSettings.get(globalKey);
- });
+ PropertyLoader.replaceProperties(defaults,
+ e -> e.getKey() instanceof String && ((String) e.getKey()).contains("."),
+ e -> {
+ final String s = (String) e.getKey();
+ final String globalKey = s.substring(s.lastIndexOf('.') + 1);
+ return globalSettings.get(globalKey);
+ });
}
private void initUIProperties(final Theme currentTheme, final UIDefaults defaults, final Properties uiProps) {
for (String property : UI_PROPERTIES) {
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, property, "properties/ui/"), uiProps, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, property, "properties/ui/"),
+ uiProps, defaults);
}
currentTheme.customizeUIProperties(uiProps, defaults);
}
@@ -119,15 +125,15 @@ public class ThemeDefaultsInitTask implements DefaultsInitTask {
private void initIconTheme(final Theme currentTheme, final UIDefaults defaults, final Properties uiProps) {
currentTheme.loadIconTheme(uiProps, defaults);
for (String property : ICON_PROPERTIES) {
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, property, "properties/icons/"), uiProps, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, property, "properties/icons/"),
+ uiProps, defaults);
}
currentTheme.customizeIconTheme(uiProps, defaults);
}
private void initPlatformProperties(final Theme currentTheme, final UIDefaults defaults, final Properties uiProps) {
- PropertyLoader.putProperties(
- PropertyLoader.loadProperties(DarkLaf.class, getOsName(), "properties/platform/"), uiProps, defaults);
+ PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, getOsName(), "properties/platform/"),
+ uiProps, defaults);
currentTheme.customizePlatformProperties(uiProps, defaults);
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/UserPreferenceAdjustmentTask.java b/core/src/main/java/com/github/weisj/darklaf/task/UserPreferenceAdjustmentTask.java
index fff394bf..c9bfe825 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/UserPreferenceAdjustmentTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/UserPreferenceAdjustmentTask.java
@@ -20,14 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import java.util.Properties;
+
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.Theme;
-import java.util.Properties;
-
public class UserPreferenceAdjustmentTask implements DefaultsAdjustmentTask {
@Override
diff --git a/core/src/main/java/com/github/weisj/darklaf/task/UtilityDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/UtilityDefaultsInitTask.java
index c6686e9f..3ab40c9d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/task/UtilityDefaultsInitTask.java
+++ b/core/src/main/java/com/github/weisj/darklaf/task/UtilityDefaultsInitTask.java
@@ -20,16 +20,17 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.task;
+import javax.swing.*;
+
import com.github.weisj.darklaf.icons.AwareIconStyle;
import com.github.weisj.darklaf.icons.IconLoader;
import com.github.weisj.darklaf.theme.Theme;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-
public class UtilityDefaultsInitTask implements DefaultsInitTask {
@Override
public void run(final Theme currentTheme, final UIDefaults defaults) {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/BasicTransferable.java b/core/src/main/java/com/github/weisj/darklaf/ui/BasicTransferable.java
index 8155b088..0b4e604c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/BasicTransferable.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/BasicTransferable.java
@@ -20,11 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui;
-
-import javax.swing.plaf.UIResource;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
@@ -34,10 +33,12 @@ import java.io.StringBufferInputStream;
import java.io.StringReader;
import java.util.logging.Logger;
+import javax.swing.plaf.UIResource;
+
/**
* A transferable implementation for the default data transfer of some Swing components.
*
- * @author Timothy Prinzing
+ * @author Timothy Prinzing
* @version 1.10 11/17/05
*/
public class BasicTransferable implements Transferable, UIResource {
@@ -75,9 +76,8 @@ public class BasicTransferable implements Transferable, UIResource {
this.htmlData = htmlData;
}
-
/**
- * Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be
+ * Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be
* ordered according to preference for providing the data (from most richly descriptive to least descriptive).
*
* @return an array of data flavors in which this data can be transferred.
@@ -115,8 +115,8 @@ public class BasicTransferable implements Transferable, UIResource {
/**
* Returns whether the specified data flavor is supported for this object.
*
- * @param flavor the requested flavor for the data
- * @return boolean indicating whether the data flavor is supported.
+ * @param flavor the requested flavor for the data
+ * @return boolean indicating whether the data flavor is supported.
*/
public boolean isDataFlavorSupported(final DataFlavor flavor) {
DataFlavor[] flavors = getTransferDataFlavors();
@@ -129,12 +129,12 @@ public class BasicTransferable implements Transferable, UIResource {
}
/**
- * Returns an object which represents the data to be transferred. The class of the object returned is defined by
+ * Returns an object which represents the data to be transferred. The class of the object returned is defined by
* the representation class of the flavor.
*
- * @param flavor the requested flavor for the data
+ * @param flavor the requested flavor for the data
* @throws UnsupportedFlavorException if the requested data flavor is not supported.
- * @see DataFlavor#getRepresentationClass
+ * @see DataFlavor#getRepresentationClass
*/
public Object getTransferData(final DataFlavor flavor) throws UnsupportedFlavorException {
if (isRicherFlavor(flavor)) {
@@ -184,7 +184,7 @@ public class BasicTransferable implements Transferable, UIResource {
}
/**
- * Some subclasses will have flavors that are more descriptive than HTML or plain text. If this method returns a
+ * Some subclasses will have flavors that are more descriptive than HTML or plain text. If this method returns a
* non-null value, it will be placed at the start of the array of supported flavors.
*
* @return the supported data flavours as array.
@@ -202,8 +202,8 @@ public class BasicTransferable implements Transferable, UIResource {
/**
* Returns whether or not the specified data flavor is an HTML flavor that is supported.
*
- * @param flavor the requested flavor for the data
- * @return boolean indicating whether or not the data flavor is supported
+ * @param flavor the requested flavor for the data
+ * @return boolean indicating whether or not the data flavor is supported
*/
protected boolean isHTMLFlavor(final DataFlavor flavor) {
DataFlavor[] flavors = htmlFlavors;
@@ -216,7 +216,7 @@ public class BasicTransferable implements Transferable, UIResource {
}
/**
- * Should the HTML flavors be offered? If so, the method getHTMLData should be implemented to provide something
+ * Should the HTML flavors be offered? If so, the method getHTMLData should be implemented to provide something
* reasonable.
*
* @return true if html is supported.
@@ -239,8 +239,8 @@ public class BasicTransferable implements Transferable, UIResource {
/**
* Returns whether or not the specified data flavor is an plain flavor that is supported.
*
- * @param flavor the requested flavor for the data
- * @return boolean indicating whether or not the data flavor is supported
+ * @param flavor the requested flavor for the data
+ * @return boolean indicating whether or not the data flavor is supported
*/
protected boolean isPlainFlavor(final DataFlavor flavor) {
DataFlavor[] flavors = plainFlavors;
@@ -253,7 +253,7 @@ public class BasicTransferable implements Transferable, UIResource {
}
/**
- * Should the plain text flavors be offered? If so, the method getPlainData should be implemented to provide
+ * Should the plain text flavors be offered? If so, the method getPlainData should be implemented to provide
* something reasonable.
*
* @return true if plain text is supported.
@@ -276,8 +276,8 @@ public class BasicTransferable implements Transferable, UIResource {
/**
* Returns whether or not the specified data flavor is a String flavor that is supported.
*
- * @param flavor the requested flavor for the data
- * @return boolean indicating whether or not the data flavor is supported
+ * @param flavor the requested flavor for the data
+ * @return boolean indicating whether or not the data flavor is supported
*/
protected boolean isStringFlavor(final DataFlavor flavor) {
DataFlavor[] flavors = stringFlavors;
@@ -288,6 +288,4 @@ public class BasicTransferable implements Transferable, UIResource {
}
return false;
}
-
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java b/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java
index ad46e233..ec641665 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui;
+import java.awt.*;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.platform.DecorationsHandler;
import com.github.weisj.darklaf.ui.popupmenu.DarkPopupMenuUI;
import com.github.weisj.darklaf.ui.rootpane.DarkRootPaneUI;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-import java.awt.*;
-
public class DarkPopupFactory extends PopupFactory {
public static final String KEY_NO_DECORATION = "JPopupFactory.noDecorations";
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/DragRecognitionSupport.java b/core/src/main/java/com/github/weisj/darklaf/ui/DragRecognitionSupport.java
index 80e2a7c9..77eca12a 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/DragRecognitionSupport.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/DragRecognitionSupport.java
@@ -20,34 +20,36 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui;
-import org.jdesktop.swingx.SwingXUtilities;
-
-import javax.swing.*;
import java.awt.dnd.DragSource;
import java.awt.event.MouseEvent;
-//import sun.awt.dnd.SunDragSourceContextPeer;
-//import sun.awt.AppContext;
+
+import javax.swing.*;
+
+import org.jdesktop.swingx.SwingXUtilities;
+// import sun.awt.dnd.SunDragSourceContextPeer;
+// import sun.awt.AppContext;
/**
* Drag gesture recognition support for classes that have a
* TransferHandler. The gesture for a drag in this class is a mouse
* press followed by movement by DragSource.getDragThreshold() pixels. An instance of this class is
* maintained per AppContext, and the public static methods call into the appropriate instance.
- *
- *
This is a c and p of core (package private) needed for BasicXListUI. It differs from core in that references to
+ *
+ * This is a c and p of core (package private) needed for BasicXListUI. It differs from core in that references to
* sun
* packages have been replaced.
*
- *
a static method of SunDragSourceContextPeer has been copied into SwingXUtilities
- * and is used here
- *
the shared instance of this class is maintained in the UIManager instead of
- * per appContext.
+ *
a static method of SunDragSourceContextPeer has been copied into SwingXUtilities
+ * and is used here
+ *
the shared instance of this class is maintained in the UIManager instead of
+ * per appContext.
*
*
- * @author Shannon Hickey
+ * @author Shannon Hickey
* @version 1.2 11/17/05
*/
public class DragRecognitionSupport {
@@ -58,8 +60,8 @@ public class DragRecognitionSupport {
/**
* Returns whether or not the event is potentially part of a drag sequence.
*
- * @param me the MouseEvent.
- * @return true if mouse is pressed.
+ * @param me the MouseEvent.
+ * @return true if mouse is pressed.
*/
public static boolean mousePressed(final MouseEvent me) {
return getDragRecognitionSupport().mousePressedImpl(me);
@@ -71,8 +73,7 @@ public class DragRecognitionSupport {
private boolean mousePressedImpl(final MouseEvent me) {
component = (JComponent) me.getSource();
- if (mapDragOperationFromModifiers(me, component.getTransferHandler())
- != TransferHandler.NONE) {
+ if (mapDragOperationFromModifiers(me, component.getTransferHandler()) != TransferHandler.NONE) {
motionThreshold = DragSource.getDragThreshold();
dndArmedEvent = me;
@@ -87,17 +88,16 @@ public class DragRecognitionSupport {
* Returns the DragRecognitionSupport for the caller's AppContext.
*/
private static DragRecognitionSupport getDragRecognitionSupport() {
-// DragRecognitionSupport support =
-// (DragRecognitionSupport)AppContext.getAppContext().
-// get(DragRecognitionSupport.class);
-//
-// if (support == null) {
-// support = new DragRecognitionSupport();
-// AppContext.getAppContext().put(DragRecognitionSupport.class, support);
-// }
-
- DragRecognitionSupport support = (DragRecognitionSupport)
- UIManager.get("sharedInstance.dragRecognitionSupport");
+ // DragRecognitionSupport support =
+ // (DragRecognitionSupport)AppContext.getAppContext().
+ // get(DragRecognitionSupport.class);
+ //
+ // if (support == null) {
+ // support = new DragRecognitionSupport();
+ // AppContext.getAppContext().put(DragRecognitionSupport.class, support);
+ // }
+
+ DragRecognitionSupport support = (DragRecognitionSupport) UIManager.get("sharedInstance.dragRecognitionSupport");
if (support == null) {
support = new DragRecognitionSupport();
UIManager.put("sharedInstance.dragRecognitionSupport", support);
@@ -112,9 +112,8 @@ public class DragRecognitionSupport {
return TransferHandler.NONE;
}
// PENDING JW: c'p from SunDragSourceContextPeer
- return SwingXUtilities.
- convertModifiersToDropAction(me.getModifiersEx(),
- th.getSourceActions(component));
+ return SwingXUtilities.convertModifiersToDropAction(me.getModifiersEx(),
+ th.getSourceActions(component));
}
private void clearState() {
@@ -126,12 +125,11 @@ public class DragRecognitionSupport {
* If a dnd recognition has been going on, return the MouseEvent that started the recognition. Otherwise, return
* null.
*
- * @param me the MouseEvent.
- * @return true if mouse has been released.
+ * @param me the MouseEvent.
+ * @return true if mouse has been released.
*/
public static MouseEvent mouseReleased(final MouseEvent me) {
- return getDragRecognitionSupport().
- mouseReleasedImpl(me);
+ return getDragRecognitionSupport().mouseReleasedImpl(me);
}
/**
@@ -157,9 +155,9 @@ public class DragRecognitionSupport {
/**
* Returns whether or not a drag gesture recognition is ongoing.
*
- * @param me the me
- * @param bd the bd
- * @return the boolean
+ * @param me the me
+ * @param bd the bd
+ * @return the boolean
*/
public static boolean mouseDragged(final MouseEvent me, final BeforeDrag bd) {
return getDragRecognitionSupport().mouseDraggedImpl(me, bd);
@@ -202,7 +200,5 @@ public class DragRecognitionSupport {
* This interface allows us to pass in a handler to mouseDragged, so that we can be notified immediately before a
* drag begins.
*/
- public interface BeforeDrag {
- void dragStarting(MouseEvent me);
- }
+ public interface BeforeDrag { void dragStarting(MouseEvent me); }
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/AbstractButtonLayoutDelegate.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/AbstractButtonLayoutDelegate.java
index 52a85059..52e5ef0c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/button/AbstractButtonLayoutDelegate.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/AbstractButtonLayoutDelegate.java
@@ -20,13 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.button;
-import com.github.weisj.darklaf.util.PropertyKey;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.util.PropertyKey;
public class AbstractButtonLayoutDelegate extends AbstractButton {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java
index 83c1200a..5c7b64df 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.button;
+import java.awt.*;
+
import javax.swing.*;
import javax.swing.plaf.UIResource;
-import java.awt.*;
public interface ButtonConstants {
String KEY_VARIANT = "JButton.variant";
@@ -77,8 +79,8 @@ public interface ButtonConstants {
if (isBorderlessRectangular(c)) return true;
if (c instanceof JButton) {
JButton b = (JButton) c;
- return doConvertToBorderless((AbstractButton) c) || VARIANT_BORDERLESS.equals(
- b.getClientProperty(KEY_VARIANT));
+ return doConvertToBorderless((AbstractButton) c)
+ || VARIANT_BORDERLESS.equals(b.getClientProperty(KEY_VARIANT));
}
return false;
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java
index bd0d59d6..2a3d6fe1 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.button;
-import com.github.weisj.darklaf.util.AlignmentExt;
-import com.github.weisj.darklaf.util.DarkUIUtil;
-import com.github.weisj.darklaf.util.GraphicsContext;
+import java.awt.*;
+import java.awt.geom.Area;
+import java.awt.geom.RoundRectangle2D;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.InsetsUIResource;
import javax.swing.plaf.UIResource;
-import java.awt.*;
-import java.awt.geom.Area;
-import java.awt.geom.RoundRectangle2D;
+
+import com.github.weisj.darklaf.util.AlignmentExt;
+import com.github.weisj.darklaf.util.DarkUIUtil;
+import com.github.weisj.darklaf.util.GraphicsContext;
/**
* @author Konstantin Bulenkov
@@ -278,8 +280,8 @@ public class DarkButtonBorder implements Border, UIResource {
boolean square = ButtonConstants.isSquare(c);
Insets pad = ButtonConstants.isThin(c) ? square ? squareThinInsets
: thinInsets
- : square ? squareInsets
- : insets;
+ : square ? squareInsets
+ : insets;
return maskInsets(new InsetsUIResource(pad.top, pad.left, pad.bottom, pad.right), c, shadow);
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java
index 84bfd65f..fe5529f1 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.button;
-import com.github.weisj.darklaf.util.PropertyKey;
-
-import javax.swing.*;
-import javax.swing.plaf.basic.BasicButtonListener;
import java.awt.event.FocusEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicButtonListener;
+
+import com.github.weisj.darklaf.util.PropertyKey;
+
public class DarkButtonListener extends BasicButtonListener {
private final DarkButtonUI ui;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
index 0d800c03..c9981011 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.button;
@@ -406,8 +407,8 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewRect, iconRect, textRect,
b.getText() == null || ButtonConstants.isIconOnly(b)
- ? 0
- : b.getIconTextGap());
+ ? 0
+ : b.getIconTextGap());
}
@Override
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellEditorToggleButton.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellEditorToggleButton.java
index 02a91bcc..d4cacc56 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellEditorToggleButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellEditorToggleButton.java
@@ -20,12 +20,11 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.cell;
/**
* @author Jannis Weis
*/
-public interface CellEditorToggleButton {
- void setHasFocus(final boolean hasFocus);
-}
+public interface CellEditorToggleButton { void setHasFocus(final boolean hasFocus); }
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java
index 6bbeb5ef..c930327b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java
@@ -20,16 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.cell;
-import com.github.weisj.darklaf.ui.list.DarkListUI;
-import com.github.weisj.darklaf.ui.table.DarkTableCellEditor;
-import com.github.weisj.darklaf.util.DarkUIUtil;
+import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ListUI;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.list.DarkListUI;
+import com.github.weisj.darklaf.ui.table.DarkTableCellEditor;
+import com.github.weisj.darklaf.util.DarkUIUtil;
public class CellUtil {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellBorder.java
index 40a01b78..b2fbf890 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellBorder.java
@@ -20,6 +20,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.cell;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java
index 71133548..e2436c9d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/DarkCellRendererToggleButton.java
@@ -20,9 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.cell;
+import java.awt.*;
+
+import javax.swing.*;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.tree.TreeCellRenderer;
+
import com.github.weisj.darklaf.components.SelectableTreeNode;
import com.github.weisj.darklaf.decorators.CellRenderer;
import com.github.weisj.darklaf.ui.table.DarkTableCellFocusBorder;
@@ -31,22 +38,16 @@ import com.github.weisj.darklaf.ui.togglebutton.ToggleButtonConstants;
import com.github.weisj.darklaf.ui.tree.DarkTreeCellRenderer;
import com.github.weisj.darklaf.util.DarkUIUtil;
-import javax.swing.*;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.tree.TreeCellRenderer;
-import java.awt.*;
-
/**
* @author vincencopalazzo
* @author atarw
* @author Jannis Weis
*/
public class DarkCellRendererToggleButton
- implements TableCellRenderer, TreeCellRenderer, SwingConstants {
+ implements TableCellRenderer, TreeCellRenderer, SwingConstants {
private final T toggleButton;
-
public DarkCellRendererToggleButton(final T toggleButton) {
this.toggleButton = toggleButton;
}
@@ -148,5 +149,4 @@ public class DarkCellRendererToggleButton text.select(0, 0));
}
-
private boolean isValid(final int length) {
return (0 <= length) && (length <= getLength());
}
@@ -179,7 +179,6 @@ public final class ColorValueFormatter extends JFormattedTextField.AbstractForma
return hex ? getHexLength() : String.valueOf(model.getMaximum(fieldIndex)).length();
}
-
private int getHexLength() {
return transparencyEnabled ? 8 : 6;
}
@@ -219,8 +218,8 @@ public final class ColorValueFormatter extends JFormattedTextField.AbstractForma
int b = Integer.valueOf(hexStr.substring(4, 6), 16);
checkRange(b, 0, 255);
int alpha = hexStr.length() >= 8
- ? Integer.valueOf(hexStr.substring(6, 8), 16)
- : 255;
+ ? Integer.valueOf(hexStr.substring(6, 8), 16)
+ : 255;
checkRange(alpha, 0, 255);
return new Color(r, g, b, alpha);
} else {
@@ -243,7 +242,6 @@ public final class ColorValueFormatter extends JFormattedTextField.AbstractForma
}
}
-
@Override
public String valueToString(final Object object) throws ParseException {
if (object instanceof Integer && !hex) {
@@ -263,7 +261,6 @@ public final class ColorValueFormatter extends JFormattedTextField.AbstractForma
throw new ParseException("illegal object", 0);
}
-
@Override
protected DocumentFilter getDocumentFilter() {
return this.filter;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorWheelPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorWheelPanel.java
index 54e08eb9..047af5ef 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorWheelPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/ColorWheelPanel.java
@@ -20,14 +20,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
-
package com.github.weisj.darklaf.ui.colorchooser;
-import com.github.weisj.darklaf.color.DarkColorModel;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.color.DarkColorModel;
/**
* @author pegov
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java
index 535cc889..80fa054b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserPanel.java
@@ -20,10 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
-
package com.github.weisj.darklaf.ui.colorchooser;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+
+import javax.swing.*;
+import javax.swing.colorchooser.AbstractColorChooserPanel;
+import javax.swing.colorchooser.ColorSelectionModel;
+import javax.swing.event.AncestorEvent;
+
import com.github.weisj.darklaf.color.DarkColorModel;
import com.github.weisj.darklaf.components.DefaultColorPipette;
import com.github.weisj.darklaf.decorators.AncestorAdapter;
@@ -31,13 +39,6 @@ import com.github.weisj.darklaf.decorators.UpdateDocumentListener;
import com.github.weisj.darklaf.ui.button.DarkButtonUI;
import com.github.weisj.darklaf.util.ColorUtil;
-import javax.swing.*;
-import javax.swing.colorchooser.AbstractColorChooserPanel;
-import javax.swing.colorchooser.ColorSelectionModel;
-import javax.swing.event.AncestorEvent;
-import java.awt.*;
-import java.awt.event.KeyEvent;
-
/**
* @author pegov
* @author Konstantin Bulenkov
@@ -126,14 +127,12 @@ public class DarkColorChooserPanel extends AbstractColorChooserPanel implements
try {
String hexStr = String.format("%1$-" + 8 + "s", textHex.getText()).replaceAll(" ", "F");
int alpha = isColorTransparencySelectionEnabled()
- ? Integer.valueOf(hexStr.substring(6, 8), 16) : 255;
- return new Color(
- Integer.valueOf(hexStr.substring(0, 2), 16),
- Integer.valueOf(hexStr.substring(2, 4), 16),
- Integer.valueOf(hexStr.substring(4, 6), 16),
- alpha);
- } catch (NumberFormatException | IndexOutOfBoundsException ignore) {
- }
+ ? Integer.valueOf(hexStr.substring(6, 8), 16) : 255;
+ return new Color(Integer.valueOf(hexStr.substring(0, 2), 16),
+ Integer.valueOf(hexStr.substring(2, 4), 16),
+ Integer.valueOf(hexStr.substring(4, 6), 16),
+ alpha);
+ } catch (NumberFormatException | IndexOutOfBoundsException ignore) {}
return null;
}
@@ -275,7 +274,6 @@ public class DarkColorChooserPanel extends AbstractColorChooserPanel implements
return (DarkColorModel) formatBox.getSelectedItem();
}
-
private JComponent buildTopPanel(final boolean enablePipette) {
final JPanel result = new JPanel(new BorderLayout());
@@ -289,7 +287,6 @@ public class DarkColorChooserPanel extends AbstractColorChooserPanel implements
previewPanel.add(previewComponent, BorderLayout.CENTER);
result.add(previewPanel, BorderLayout.NORTH);
-
final JPanel valuePanel = new JPanel();
valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.X_AXIS));
valuePanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
@@ -370,8 +367,7 @@ public class DarkColorChooserPanel extends AbstractColorChooserPanel implements
}
@Override
- public void updateChooser() {
- }
+ public void updateChooser() {}
@Override
public String getDisplayName() {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java
index da432301..297326a4 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkColorChooserUI.java
@@ -20,15 +20,12 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
-import com.github.weisj.darklaf.color.DarkColorModelCMYK;
-import com.github.weisj.darklaf.color.DarkColorModelHSB;
-import com.github.weisj.darklaf.color.DarkColorModelHSL;
-import com.github.weisj.darklaf.color.DarkColorModelRGB;
-import com.github.weisj.darklaf.decorators.AncestorAdapter;
-import com.github.weisj.darklaf.util.PropertyKey;
+import java.awt.*;
+import java.beans.PropertyChangeListener;
import javax.swing.*;
import javax.swing.colorchooser.AbstractColorChooserPanel;
@@ -36,8 +33,13 @@ import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicColorChooserUI;
-import java.awt.*;
-import java.beans.PropertyChangeListener;
+
+import com.github.weisj.darklaf.color.DarkColorModelCMYK;
+import com.github.weisj.darklaf.color.DarkColorModelHSB;
+import com.github.weisj.darklaf.color.DarkColorModelHSL;
+import com.github.weisj.darklaf.color.DarkColorModelRGB;
+import com.github.weisj.darklaf.decorators.AncestorAdapter;
+import com.github.weisj.darklaf.util.PropertyKey;
/**
* @author Jannis Weis
@@ -73,7 +75,6 @@ public class DarkColorChooserUI extends BasicColorChooserUI {
}
};
-
public static ComponentUI createUI(final JComponent c) {
return new DarkColorChooserUI();
}
@@ -81,12 +82,12 @@ public class DarkColorChooserUI extends BasicColorChooserUI {
@Override
protected AbstractColorChooserPanel[] createDefaultChoosers() {
return new AbstractColorChooserPanel[]{
- new DarkColorChooserPanel(DarkColorModelRGB.getInstance(),
- DarkColorModelHSB.getInstance(),
- DarkColorModelHSL.getInstance(),
- DarkColorModelCMYK.getInstance()),
- new DarkSwatchesChooserPanel(),
- };
+ new DarkColorChooserPanel(DarkColorModelRGB.getInstance(),
+ DarkColorModelHSB.getInstance(),
+ DarkColorModelHSL.getInstance(),
+ DarkColorModelCMYK.getInstance()),
+ new DarkSwatchesChooserPanel(),
+ };
}
@Override
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkPreviewPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkPreviewPanel.java
index c133543f..1cb36f1c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkPreviewPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkPreviewPanel.java
@@ -20,15 +20,18 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
-import com.github.weisj.darklaf.util.GraphicsContext;
-import com.github.weisj.darklaf.util.GraphicsUtil;
-import sun.swing.SwingUtilities2;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import sun.swing.SwingUtilities2;
+
+import com.github.weisj.darklaf.util.GraphicsContext;
+import com.github.weisj.darklaf.util.GraphicsUtil;
/**
* @author Jannis Weis
@@ -40,7 +43,6 @@ public class DarkPreviewPanel extends JPanel {
private static final int INNER_GAP = 4;
private static final int SWATCH_WIDTH = 75;
-
private static final int TEXT_GAP = 5;
private String sampleText;
@@ -118,7 +120,6 @@ public class DarkPreviewPanel extends JPanel {
SQUARE_SIZE - (INNER_GAP * 2));
g.translate(-(SQUARE_SIZE + SQUARE_GAP), -(SQUARE_SIZE + SQUARE_GAP));
-
g.translate((SQUARE_SIZE + SQUARE_GAP) * 2, 0);
g.setColor(Color.white);
g.fillRect(offsetX, 0, SQUARE_SIZE, SQUARE_SIZE);
@@ -169,7 +170,6 @@ public class DarkPreviewPanel extends JPanel {
SwingUtilities2.drawString(host, g, getSampleText(), textXOffset + (TEXT_GAP / 2),
height + ascent + TEXT_GAP + 2);
-
g.setColor(Color.white);
g.fillRect(textXOffset, (height + TEXT_GAP) * 2, width + (TEXT_GAP), height + 2);
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkSwatchesChooserPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkSwatchesChooserPanel.java
index fc30bf2d..7a38ba54 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkSwatchesChooserPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/DarkSwatchesChooserPanel.java
@@ -20,25 +20,26 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
+import java.awt.*;
+import java.awt.event.*;
+import java.io.Serializable;
+
import javax.accessibility.AccessibleContext;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.colorchooser.AbstractColorChooserPanel;
import javax.swing.colorchooser.ColorSelectionModel;
-import java.awt.*;
-import java.awt.event.*;
-import java.io.Serializable;
/**
* @author Jannis Weis
*/
public class DarkSwatchesChooserPanel extends AbstractColorChooserPanel {
-
private SwatchPanel swatchPanel;
private RecentSwatchPanel recentSwatchPanel;
private ColorPreviewComponent previewPanel;
@@ -144,7 +145,7 @@ public class DarkSwatchesChooserPanel extends AbstractColorChooserPanel {
recentSwatchListener = null;
recentSwatchKeyListener = null;
- removeAll(); // strip out all the sub-components
+ removeAll(); // strip out all the sub-components
}
protected void setSelectedColor(final Color color) {
@@ -196,5 +197,4 @@ public class DarkSwatchesChooserPanel extends AbstractColorChooserPanel {
}
}
}
-
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/MainSwatchPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/MainSwatchPanel.java
index 72fcf53a..6832a4fd 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/MainSwatchPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/MainSwatchPanel.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
-import javax.swing.*;
import java.awt.*;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
@@ -47,459 +49,458 @@ class MainSwatchPanel extends SwatchPanel {
}
}
-
private int[] initRawValues() {
return new int[]{
- 0, 0, 0,
- 31, 0, 0,
- 31, 6, 0,
- 31, 12, 0,
- 31, 18, 0,
- 31, 24, 0,
- 31, 31, 0,
- 24, 31, 0,
- 18, 31, 0,
- 12, 31, 0,
- 6, 31, 0,
- 0, 31, 0,
- 0, 31, 6,
- 0, 31, 12,
- 0, 31, 18,
- 0, 31, 24,
- 0, 31, 31,
- 0, 24, 31,
- 0, 18, 31,
- 0, 12, 31,
- 0, 6, 31,
- 0, 0, 31,
- 6, 0, 31,
- 12, 0, 31,
- 18, 0, 31,
- 24, 0, 31,
- 31, 0, 31,
- 31, 0, 24,
- 31, 0, 18,
- 31, 0, 12,
- 18, 18, 18,
- 61, 0, 0,
- 61, 12, 0,
- 61, 24, 0,
- 61, 37, 0,
- 61, 49, 0,
- 61, 61, 0,
- 49, 61, 0,
- 37, 61, 0,
- 24, 61, 0,
- 12, 61, 0,
- 0, 61, 0,
- 0, 61, 12,
- 0, 61, 24,
- 0, 61, 37,
- 0, 61, 49,
- 0, 61, 61,
- 0, 49, 61,
- 0, 37, 61,
- 0, 24, 61,
- 0, 12, 61,
- 0, 0, 61,
- 11, 0, 61,
- 24, 0, 61,
- 37, 0, 61,
- 49, 0, 61,
- 61, 0, 61,
- 61, 0, 49,
- 61, 0, 37,
- 61, 0, 24,
- 36, 36, 36,
- 92, 0, 0,
- 92, 18, 0,
- 92, 37, 0,
- 92, 55, 0,
- 92, 73, 0,
- 92, 92, 0,
- 73, 92, 0,
- 55, 92, 0,
- 37, 92, 0,
- 18, 92, 0,
- 0, 92, 0,
- 0, 92, 18,
- 0, 92, 37,
- 0, 92, 55,
- 0, 92, 73,
- 0, 92, 92,
- 0, 73, 92,
- 0, 55, 92,
- 0, 37, 92,
- 0, 18, 92,
- 0, 0, 92,
- 17, 0, 92,
- 37, 0, 92,
- 55, 0, 92,
- 73, 0, 92,
- 92, 0, 92,
- 92, 0, 73,
- 92, 0, 55,
- 92, 0, 37,
- 54, 54, 54,
- 128, 0, 0,
- 128, 26, 0,
- 128, 51, 0,
- 128, 77, 0,
- 128, 102, 0,
- 128, 128, 0,
- 102, 128, 0,
- 77, 128, 0,
- 51, 128, 0,
- 26, 128, 0,
- 0, 128, 0,
- 0, 128, 25,
- 0, 128, 51,
- 0, 128, 77,
- 0, 128, 102,
- 0, 128, 128,
- 0, 102, 128,
- 0, 77, 128,
- 0, 51, 128,
- 0, 26, 128,
- 0, 0, 128,
- 23, 0, 128,
- 51, 0, 128,
- 77, 0, 128,
- 102, 0, 128,
- 128, 0, 128,
- 128, 0, 102,
- 128, 0, 76,
- 128, 0, 51,
- 72, 72, 72,
- 158, 0, 0,
- 158, 32, 0,
- 158, 63, 0,
- 158, 95, 0,
- 158, 126, 0,
- 158, 158, 0,
- 126, 158, 0,
- 95, 158, 0,
- 63, 158, 0,
- 32, 158, 0,
- 0, 158, 0,
- 0, 158, 32,
- 0, 158, 63,
- 0, 158, 95,
- 0, 158, 126,
- 0, 158, 158,
- 0, 126, 158,
- 0, 95, 158,
- 0, 63, 158,
- 0, 32, 158,
- 0, 0, 158,
- 29, 0, 158,
- 63, 0, 158,
- 95, 0, 158,
- 126, 0, 158,
- 158, 0, 158,
- 158, 0, 126,
- 158, 0, 95,
- 158, 0, 63,
- 91, 91, 91,
- 189, 0, 0,
- 189, 38, 0,
- 189, 75, 0,
- 189, 113, 0,
- 189, 151, 0,
- 189, 189, 0,
- 151, 189, 0,
- 113, 189, 0,
- 75, 189, 0,
- 38, 189, 0,
- 0, 189, 0,
- 0, 189, 38,
- 0, 189, 75,
- 0, 189, 113,
- 0, 189, 151,
- 0, 189, 189,
- 0, 151, 189,
- 0, 113, 189,
- 0, 75, 189,
- 0, 38, 189,
- 0, 0, 189,
- 35, 0, 189,
- 75, 0, 189,
- 113, 0, 189,
- 151, 0, 189,
- 189, 0, 189,
- 189, 0, 151,
- 189, 0, 113,
- 189, 0, 75,
- 109, 109, 109,
- 219, 0, 0,
- 219, 44, 0,
- 219, 88, 0,
- 219, 132, 0,
- 219, 175, 0,
- 219, 219, 0,
- 175, 219, 0,
- 132, 219, 0,
- 88, 219, 0,
- 44, 219, 0,
- 0, 219, 0,
- 0, 219, 44,
- 0, 219, 88,
- 0, 219, 132,
- 0, 219, 175,
- 0, 219, 219,
- 0, 175, 219,
- 0, 132, 219,
- 0, 88, 219,
- 0, 44, 219,
- 0, 0, 219,
- 40, 0, 219,
- 88, 0, 219,
- 132, 0, 219,
- 175, 0, 219,
- 219, 0, 219,
- 219, 0, 175,
- 219, 0, 132,
- 219, 0, 88,
- 127, 127, 127,
- 255, 0, 0,
- 255, 51, 0,
- 255, 102, 0,
- 255, 153, 0,
- 255, 204, 0,
- 255, 255, 0,
- 204, 255, 0,
- 153, 255, 0,
- 102, 255, 0,
- 51, 255, 0,
- 0, 255, 0,
- 0, 255, 51,
- 0, 255, 102,
- 0, 255, 153,
- 0, 255, 204,
- 0, 255, 255,
- 0, 204, 255,
- 0, 153, 255,
- 0, 102, 255,
- 0, 51, 255,
- 0, 0, 255,
- 47, 0, 255,
- 102, 0, 255,
- 153, 0, 255,
- 204, 0, 255,
- 255, 0, 255,
- 255, 0, 204,
- 255, 0, 153,
- 255, 0, 102,
- 145, 145, 145,
- 255, 31, 31,
- 255, 75, 31,
- 255, 120, 31,
- 255, 165, 31,
- 255, 210, 31,
- 255, 255, 31,
- 210, 255, 31,
- 165, 255, 31,
- 120, 255, 31,
- 75, 255, 31,
- 31, 255, 31,
- 31, 255, 75,
- 31, 255, 120,
- 31, 255, 165,
- 31, 255, 210,
- 31, 255, 255,
- 31, 210, 255,
- 31, 165, 255,
- 31, 120, 255,
- 31, 75, 255,
- 31, 31, 255,
- 72, 31, 255,
- 120, 31, 255,
- 165, 31, 255,
- 210, 31, 255,
- 255, 31, 255,
- 255, 31, 210,
- 255, 31, 165,
- 255, 31, 120,
- 163, 163, 163,
- 255, 61, 61,
- 255, 100, 61,
- 255, 139, 61,
- 255, 177, 61,
- 255, 216, 61,
- 255, 255, 61,
- 216, 255, 61,
- 177, 255, 61,
- 139, 255, 61,
- 100, 255, 61,
- 61, 255, 61,
- 61, 255, 100,
- 61, 255, 139,
- 61, 255, 177,
- 61, 255, 216,
- 61, 255, 255,
- 61, 216, 255,
- 61, 177, 255,
- 61, 139, 255,
- 61, 100, 255,
- 61, 61, 255,
- 97, 61, 255,
- 139, 61, 255,
- 177, 61, 255,
- 216, 61, 255,
- 255, 61, 255,
- 255, 61, 216,
- 255, 61, 177,
- 255, 61, 139,
- 182, 182, 182,
- 255, 92, 92,
- 255, 124, 92,
- 255, 157, 92,
- 255, 190, 92,
- 255, 222, 92,
- 255, 255, 92,
- 222, 255, 92,
- 190, 255, 92,
- 157, 255, 92,
- 124, 255, 92,
- 92, 255, 92,
- 92, 255, 124,
- 92, 255, 157,
- 92, 255, 190,
- 92, 255, 222,
- 92, 255, 255,
- 92, 222, 255,
- 92, 190, 255,
- 92, 157, 255,
- 92, 124, 255,
- 92, 92, 255,
- 122, 92, 255,
- 157, 92, 255,
- 190, 92, 255,
- 222, 92, 255,
- 255, 92, 255,
- 255, 92, 222,
- 255, 92, 190,
- 255, 92, 157,
- 200, 200, 200,
- 255, 128, 128,
- 255, 153, 128,
- 255, 179, 128,
- 255, 204, 128,
- 255, 230, 128,
- 255, 255, 128,
- 229, 255, 128,
- 204, 255, 128,
- 179, 255, 128,
- 153, 255, 128,
- 128, 255, 128,
- 128, 255, 153,
- 128, 255, 179,
- 128, 255, 204,
- 128, 255, 229,
- 128, 255, 255,
- 128, 229, 255,
- 128, 204, 255,
- 128, 179, 255,
- 128, 153, 255,
- 128, 128, 255,
- 151, 128, 255,
- 178, 128, 255,
- 204, 128, 255,
- 230, 128, 255,
- 255, 128, 255,
- 255, 128, 229,
- 255, 128, 204,
- 255, 128, 179,
- 218, 218, 218,
- 255, 158, 158,
- 255, 177, 158,
- 255, 197, 158,
- 255, 216, 158,
- 255, 236, 158,
- 255, 255, 158,
- 236, 255, 158,
- 216, 255, 158,
- 197, 255, 158,
- 177, 255, 158,
- 158, 255, 158,
- 158, 255, 177,
- 158, 255, 197,
- 158, 255, 216,
- 158, 255, 236,
- 158, 255, 255,
- 158, 236, 255,
- 158, 216, 255,
- 158, 197, 255,
- 158, 177, 255,
- 158, 158, 255,
- 176, 158, 255,
- 197, 158, 255,
- 216, 158, 255,
- 236, 158, 255,
- 255, 158, 255,
- 255, 158, 236,
- 255, 158, 216,
- 255, 158, 197,
- 236, 236, 236,
- 255, 189, 189,
- 255, 202, 189,
- 255, 215, 189,
- 255, 228, 189,
- 255, 242, 189,
- 255, 255, 189,
- 242, 255, 189,
- 228, 255, 189,
- 215, 255, 189,
- 202, 255, 189,
- 189, 255, 189,
- 189, 255, 202,
- 189, 255, 215,
- 189, 255, 228,
- 189, 255, 242,
- 189, 255, 255,
- 189, 242, 255,
- 189, 228, 255,
- 189, 215, 255,
- 189, 202, 255,
- 189, 189, 255,
- 201, 189, 255,
- 215, 189, 255,
- 228, 189, 255,
- 242, 189, 255,
- 255, 189, 255,
- 255, 189, 242,
- 255, 189, 228,
- 255, 189, 215,
- 255, 255, 255,
- 255, 219, 219,
- 255, 226, 219,
- 255, 234, 219,
- 255, 241, 219,
- 255, 248, 219,
- 255, 255, 219,
- 248, 255, 219,
- 241, 255, 219,
- 234, 255, 219,
- 226, 255, 219,
- 219, 255, 219,
- 219, 255, 226,
- 219, 255, 234,
- 219, 255, 241,
- 219, 255, 248,
- 219, 255, 255,
- 219, 248, 255,
- 219, 241, 255,
- 219, 234, 255,
- 219, 226, 255,
- 219, 219, 255,
- 226, 219, 255,
- 234, 219, 255,
- 241, 219, 255,
- 248, 219, 255,
- 255, 219, 255,
- 255, 219, 248,
- 255, 219, 241,
- 255, 219, 234,
- };
+ 0, 0, 0,
+ 31, 0, 0,
+ 31, 6, 0,
+ 31, 12, 0,
+ 31, 18, 0,
+ 31, 24, 0,
+ 31, 31, 0,
+ 24, 31, 0,
+ 18, 31, 0,
+ 12, 31, 0,
+ 6, 31, 0,
+ 0, 31, 0,
+ 0, 31, 6,
+ 0, 31, 12,
+ 0, 31, 18,
+ 0, 31, 24,
+ 0, 31, 31,
+ 0, 24, 31,
+ 0, 18, 31,
+ 0, 12, 31,
+ 0, 6, 31,
+ 0, 0, 31,
+ 6, 0, 31,
+ 12, 0, 31,
+ 18, 0, 31,
+ 24, 0, 31,
+ 31, 0, 31,
+ 31, 0, 24,
+ 31, 0, 18,
+ 31, 0, 12,
+ 18, 18, 18,
+ 61, 0, 0,
+ 61, 12, 0,
+ 61, 24, 0,
+ 61, 37, 0,
+ 61, 49, 0,
+ 61, 61, 0,
+ 49, 61, 0,
+ 37, 61, 0,
+ 24, 61, 0,
+ 12, 61, 0,
+ 0, 61, 0,
+ 0, 61, 12,
+ 0, 61, 24,
+ 0, 61, 37,
+ 0, 61, 49,
+ 0, 61, 61,
+ 0, 49, 61,
+ 0, 37, 61,
+ 0, 24, 61,
+ 0, 12, 61,
+ 0, 0, 61,
+ 11, 0, 61,
+ 24, 0, 61,
+ 37, 0, 61,
+ 49, 0, 61,
+ 61, 0, 61,
+ 61, 0, 49,
+ 61, 0, 37,
+ 61, 0, 24,
+ 36, 36, 36,
+ 92, 0, 0,
+ 92, 18, 0,
+ 92, 37, 0,
+ 92, 55, 0,
+ 92, 73, 0,
+ 92, 92, 0,
+ 73, 92, 0,
+ 55, 92, 0,
+ 37, 92, 0,
+ 18, 92, 0,
+ 0, 92, 0,
+ 0, 92, 18,
+ 0, 92, 37,
+ 0, 92, 55,
+ 0, 92, 73,
+ 0, 92, 92,
+ 0, 73, 92,
+ 0, 55, 92,
+ 0, 37, 92,
+ 0, 18, 92,
+ 0, 0, 92,
+ 17, 0, 92,
+ 37, 0, 92,
+ 55, 0, 92,
+ 73, 0, 92,
+ 92, 0, 92,
+ 92, 0, 73,
+ 92, 0, 55,
+ 92, 0, 37,
+ 54, 54, 54,
+ 128, 0, 0,
+ 128, 26, 0,
+ 128, 51, 0,
+ 128, 77, 0,
+ 128, 102, 0,
+ 128, 128, 0,
+ 102, 128, 0,
+ 77, 128, 0,
+ 51, 128, 0,
+ 26, 128, 0,
+ 0, 128, 0,
+ 0, 128, 25,
+ 0, 128, 51,
+ 0, 128, 77,
+ 0, 128, 102,
+ 0, 128, 128,
+ 0, 102, 128,
+ 0, 77, 128,
+ 0, 51, 128,
+ 0, 26, 128,
+ 0, 0, 128,
+ 23, 0, 128,
+ 51, 0, 128,
+ 77, 0, 128,
+ 102, 0, 128,
+ 128, 0, 128,
+ 128, 0, 102,
+ 128, 0, 76,
+ 128, 0, 51,
+ 72, 72, 72,
+ 158, 0, 0,
+ 158, 32, 0,
+ 158, 63, 0,
+ 158, 95, 0,
+ 158, 126, 0,
+ 158, 158, 0,
+ 126, 158, 0,
+ 95, 158, 0,
+ 63, 158, 0,
+ 32, 158, 0,
+ 0, 158, 0,
+ 0, 158, 32,
+ 0, 158, 63,
+ 0, 158, 95,
+ 0, 158, 126,
+ 0, 158, 158,
+ 0, 126, 158,
+ 0, 95, 158,
+ 0, 63, 158,
+ 0, 32, 158,
+ 0, 0, 158,
+ 29, 0, 158,
+ 63, 0, 158,
+ 95, 0, 158,
+ 126, 0, 158,
+ 158, 0, 158,
+ 158, 0, 126,
+ 158, 0, 95,
+ 158, 0, 63,
+ 91, 91, 91,
+ 189, 0, 0,
+ 189, 38, 0,
+ 189, 75, 0,
+ 189, 113, 0,
+ 189, 151, 0,
+ 189, 189, 0,
+ 151, 189, 0,
+ 113, 189, 0,
+ 75, 189, 0,
+ 38, 189, 0,
+ 0, 189, 0,
+ 0, 189, 38,
+ 0, 189, 75,
+ 0, 189, 113,
+ 0, 189, 151,
+ 0, 189, 189,
+ 0, 151, 189,
+ 0, 113, 189,
+ 0, 75, 189,
+ 0, 38, 189,
+ 0, 0, 189,
+ 35, 0, 189,
+ 75, 0, 189,
+ 113, 0, 189,
+ 151, 0, 189,
+ 189, 0, 189,
+ 189, 0, 151,
+ 189, 0, 113,
+ 189, 0, 75,
+ 109, 109, 109,
+ 219, 0, 0,
+ 219, 44, 0,
+ 219, 88, 0,
+ 219, 132, 0,
+ 219, 175, 0,
+ 219, 219, 0,
+ 175, 219, 0,
+ 132, 219, 0,
+ 88, 219, 0,
+ 44, 219, 0,
+ 0, 219, 0,
+ 0, 219, 44,
+ 0, 219, 88,
+ 0, 219, 132,
+ 0, 219, 175,
+ 0, 219, 219,
+ 0, 175, 219,
+ 0, 132, 219,
+ 0, 88, 219,
+ 0, 44, 219,
+ 0, 0, 219,
+ 40, 0, 219,
+ 88, 0, 219,
+ 132, 0, 219,
+ 175, 0, 219,
+ 219, 0, 219,
+ 219, 0, 175,
+ 219, 0, 132,
+ 219, 0, 88,
+ 127, 127, 127,
+ 255, 0, 0,
+ 255, 51, 0,
+ 255, 102, 0,
+ 255, 153, 0,
+ 255, 204, 0,
+ 255, 255, 0,
+ 204, 255, 0,
+ 153, 255, 0,
+ 102, 255, 0,
+ 51, 255, 0,
+ 0, 255, 0,
+ 0, 255, 51,
+ 0, 255, 102,
+ 0, 255, 153,
+ 0, 255, 204,
+ 0, 255, 255,
+ 0, 204, 255,
+ 0, 153, 255,
+ 0, 102, 255,
+ 0, 51, 255,
+ 0, 0, 255,
+ 47, 0, 255,
+ 102, 0, 255,
+ 153, 0, 255,
+ 204, 0, 255,
+ 255, 0, 255,
+ 255, 0, 204,
+ 255, 0, 153,
+ 255, 0, 102,
+ 145, 145, 145,
+ 255, 31, 31,
+ 255, 75, 31,
+ 255, 120, 31,
+ 255, 165, 31,
+ 255, 210, 31,
+ 255, 255, 31,
+ 210, 255, 31,
+ 165, 255, 31,
+ 120, 255, 31,
+ 75, 255, 31,
+ 31, 255, 31,
+ 31, 255, 75,
+ 31, 255, 120,
+ 31, 255, 165,
+ 31, 255, 210,
+ 31, 255, 255,
+ 31, 210, 255,
+ 31, 165, 255,
+ 31, 120, 255,
+ 31, 75, 255,
+ 31, 31, 255,
+ 72, 31, 255,
+ 120, 31, 255,
+ 165, 31, 255,
+ 210, 31, 255,
+ 255, 31, 255,
+ 255, 31, 210,
+ 255, 31, 165,
+ 255, 31, 120,
+ 163, 163, 163,
+ 255, 61, 61,
+ 255, 100, 61,
+ 255, 139, 61,
+ 255, 177, 61,
+ 255, 216, 61,
+ 255, 255, 61,
+ 216, 255, 61,
+ 177, 255, 61,
+ 139, 255, 61,
+ 100, 255, 61,
+ 61, 255, 61,
+ 61, 255, 100,
+ 61, 255, 139,
+ 61, 255, 177,
+ 61, 255, 216,
+ 61, 255, 255,
+ 61, 216, 255,
+ 61, 177, 255,
+ 61, 139, 255,
+ 61, 100, 255,
+ 61, 61, 255,
+ 97, 61, 255,
+ 139, 61, 255,
+ 177, 61, 255,
+ 216, 61, 255,
+ 255, 61, 255,
+ 255, 61, 216,
+ 255, 61, 177,
+ 255, 61, 139,
+ 182, 182, 182,
+ 255, 92, 92,
+ 255, 124, 92,
+ 255, 157, 92,
+ 255, 190, 92,
+ 255, 222, 92,
+ 255, 255, 92,
+ 222, 255, 92,
+ 190, 255, 92,
+ 157, 255, 92,
+ 124, 255, 92,
+ 92, 255, 92,
+ 92, 255, 124,
+ 92, 255, 157,
+ 92, 255, 190,
+ 92, 255, 222,
+ 92, 255, 255,
+ 92, 222, 255,
+ 92, 190, 255,
+ 92, 157, 255,
+ 92, 124, 255,
+ 92, 92, 255,
+ 122, 92, 255,
+ 157, 92, 255,
+ 190, 92, 255,
+ 222, 92, 255,
+ 255, 92, 255,
+ 255, 92, 222,
+ 255, 92, 190,
+ 255, 92, 157,
+ 200, 200, 200,
+ 255, 128, 128,
+ 255, 153, 128,
+ 255, 179, 128,
+ 255, 204, 128,
+ 255, 230, 128,
+ 255, 255, 128,
+ 229, 255, 128,
+ 204, 255, 128,
+ 179, 255, 128,
+ 153, 255, 128,
+ 128, 255, 128,
+ 128, 255, 153,
+ 128, 255, 179,
+ 128, 255, 204,
+ 128, 255, 229,
+ 128, 255, 255,
+ 128, 229, 255,
+ 128, 204, 255,
+ 128, 179, 255,
+ 128, 153, 255,
+ 128, 128, 255,
+ 151, 128, 255,
+ 178, 128, 255,
+ 204, 128, 255,
+ 230, 128, 255,
+ 255, 128, 255,
+ 255, 128, 229,
+ 255, 128, 204,
+ 255, 128, 179,
+ 218, 218, 218,
+ 255, 158, 158,
+ 255, 177, 158,
+ 255, 197, 158,
+ 255, 216, 158,
+ 255, 236, 158,
+ 255, 255, 158,
+ 236, 255, 158,
+ 216, 255, 158,
+ 197, 255, 158,
+ 177, 255, 158,
+ 158, 255, 158,
+ 158, 255, 177,
+ 158, 255, 197,
+ 158, 255, 216,
+ 158, 255, 236,
+ 158, 255, 255,
+ 158, 236, 255,
+ 158, 216, 255,
+ 158, 197, 255,
+ 158, 177, 255,
+ 158, 158, 255,
+ 176, 158, 255,
+ 197, 158, 255,
+ 216, 158, 255,
+ 236, 158, 255,
+ 255, 158, 255,
+ 255, 158, 236,
+ 255, 158, 216,
+ 255, 158, 197,
+ 236, 236, 236,
+ 255, 189, 189,
+ 255, 202, 189,
+ 255, 215, 189,
+ 255, 228, 189,
+ 255, 242, 189,
+ 255, 255, 189,
+ 242, 255, 189,
+ 228, 255, 189,
+ 215, 255, 189,
+ 202, 255, 189,
+ 189, 255, 189,
+ 189, 255, 202,
+ 189, 255, 215,
+ 189, 255, 228,
+ 189, 255, 242,
+ 189, 255, 255,
+ 189, 242, 255,
+ 189, 228, 255,
+ 189, 215, 255,
+ 189, 202, 255,
+ 189, 189, 255,
+ 201, 189, 255,
+ 215, 189, 255,
+ 228, 189, 255,
+ 242, 189, 255,
+ 255, 189, 255,
+ 255, 189, 242,
+ 255, 189, 228,
+ 255, 189, 215,
+ 255, 255, 255,
+ 255, 219, 219,
+ 255, 226, 219,
+ 255, 234, 219,
+ 255, 241, 219,
+ 255, 248, 219,
+ 255, 255, 219,
+ 248, 255, 219,
+ 241, 255, 219,
+ 234, 255, 219,
+ 226, 255, 219,
+ 219, 255, 219,
+ 219, 255, 226,
+ 219, 255, 234,
+ 219, 255, 241,
+ 219, 255, 248,
+ 219, 255, 255,
+ 219, 248, 255,
+ 219, 241, 255,
+ 219, 234, 255,
+ 219, 226, 255,
+ 219, 219, 255,
+ 226, 219, 255,
+ 234, 219, 255,
+ 241, 219, 255,
+ 248, 219, 255,
+ 255, 219, 255,
+ 255, 219, 248,
+ 255, 219, 241,
+ 255, 219, 234,
+ };
}
}
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/RecentSwatchPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/RecentSwatchPanel.java
index eb8d4fb2..2253af8e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/RecentSwatchPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/RecentSwatchPanel.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
-import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.Objects;
+import javax.swing.*;
+
/**
* @author Jannis Weis
*/
@@ -40,7 +42,6 @@ class RecentSwatchPanel extends SwatchPanel {
gap = new Dimension(1, 1);
}
-
protected void initColors() {
defaultRecentColor = UIManager.getColor("ColorChooser.swatchesDefaultRecentColor");
int numColors = numSwatches.width * numSwatches.height;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java
index 9379c051..478fb72a 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SlideComponent.java
@@ -20,16 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
-
package com.github.weisj.darklaf.ui.colorchooser;
-import com.github.weisj.darklaf.components.tooltip.ToolTipContext;
-import com.github.weisj.darklaf.util.Alignment;
-import com.github.weisj.darklaf.util.ColorUtil;
-import com.github.weisj.darklaf.util.DarkUIUtil;
-
-import javax.swing.*;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
@@ -39,6 +33,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.components.tooltip.ToolTipContext;
+import com.github.weisj.darklaf.util.Alignment;
+import com.github.weisj.darklaf.util.ColorUtil;
+import com.github.weisj.darklaf.util.DarkUIUtil;
+
/**
* @author Alexey Pegov
* @author Konstantin Bulenkov
@@ -88,7 +89,6 @@ class SlideComponent extends JComponent implements ColorListener {
}
});
-
addMouseWheelListener(event -> {
int units = event.getUnitsToScroll();
if (units == 0) return;
@@ -160,8 +160,8 @@ class SlideComponent extends JComponent implements ColorListener {
public void setValue(final int value) {
if (value < Unit.LEVEL.getMin() || value > Unit.LEVEL.getMax()) {
- throw new IllegalArgumentException(
- "Value " + value + " not in range [" + Unit.LEVEL.getMin() + "," + Unit.LEVEL.getMax() + "]");
+ throw new IllegalArgumentException("Value " + value + " not in range [" + Unit.LEVEL.getMin() + ","
+ + Unit.LEVEL.getMax() + "]");
}
pointerValue = valueToPointerValue(value);
this.value = value;
@@ -306,7 +306,6 @@ class SlideComponent extends JComponent implements ColorListener {
}
};
-
protected final float max;
protected final float min;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SwatchPanel.java b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SwatchPanel.java
index 256a2563..3539ef5d 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SwatchPanel.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/colorchooser/SwatchPanel.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.colorchooser;
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
import com.github.weisj.darklaf.components.tooltip.ToolTipContext;
import com.github.weisj.darklaf.util.Alignment;
import com.github.weisj.darklaf.util.DarkUIUtil;
import com.github.weisj.darklaf.util.GraphicsUtil;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
-
/**
* @author Jannis Weis
*/
@@ -42,9 +44,9 @@ abstract class SwatchPanel extends JPanel {
protected Dimension numSwatches;
protected Dimension gap;
private final ToolTipContext toolTipContext = new ToolTipContext(this)
- .setAlignment(Alignment.CENTER)
- .setToolTipRectSupplier(this::getSwatchBounds)
- .setHideOnExit(true);
+ .setAlignment(Alignment.CENTER)
+ .setToolTipRectSupplier(this::getSwatchBounds)
+ .setHideOnExit(true);
private int selRow;
private int selCol;
@@ -69,19 +71,19 @@ abstract class SwatchPanel extends JPanel {
public void keyPressed(final KeyEvent e) {
int typed = e.getKeyCode();
switch (typed) {
- case KeyEvent.VK_UP:
+ case KeyEvent.VK_UP :
if (selRow > 0) {
selRow--;
repaint();
}
break;
- case KeyEvent.VK_DOWN:
+ case KeyEvent.VK_DOWN :
if (selRow < numSwatches.height - 1) {
selRow++;
repaint();
}
break;
- case KeyEvent.VK_LEFT:
+ case KeyEvent.VK_LEFT :
if (selCol > 0 && SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
selCol--;
repaint();
@@ -91,7 +93,7 @@ abstract class SwatchPanel extends JPanel {
repaint();
}
break;
- case KeyEvent.VK_RIGHT:
+ case KeyEvent.VK_RIGHT :
if (selCol < numSwatches.width - 1
&& SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
selCol++;
@@ -101,12 +103,12 @@ abstract class SwatchPanel extends JPanel {
repaint();
}
break;
- case KeyEvent.VK_HOME:
+ case KeyEvent.VK_HOME :
selCol = 0;
selRow = 0;
repaint();
break;
- case KeyEvent.VK_END:
+ case KeyEvent.VK_END :
selCol = numSwatches.width - 1;
selRow = numSwatches.height - 1;
repaint();
@@ -126,14 +128,12 @@ abstract class SwatchPanel extends JPanel {
}
- protected void initColors() {
- }
+ protected void initColors() {}
public Color getSelectedColor() {
return getColorForCell(selCol, selRow);
}
-
private Color getColorForCell(final int column, final int row) {
int index = (row * numSwatches.width) + column;
if (index >= colors.length) return null;
@@ -165,7 +165,6 @@ abstract class SwatchPanel extends JPanel {
}
}
-
private int getYForRow(final int row) {
return row * (swatchSize.height + gap.height);
}
@@ -216,7 +215,6 @@ abstract class SwatchPanel extends JPanel {
return new Point(column, row);
}
-
protected Rectangle getSwatchBounds(final MouseEvent e) {
Point p = getCoordinatesForLocation(e.getX(), e.getY());
int x = getXForColumn(p.x);
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboBoxConstants.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboBoxConstants.java
index 967d55cb..7650de97 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboBoxConstants.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboBoxConstants.java
@@ -20,14 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import com.github.weisj.darklaf.ui.table.DarkTableUI;
-import com.github.weisj.darklaf.ui.tree.DarkTreeUI;
+import java.awt.*;
import javax.swing.*;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.table.DarkTableUI;
+import com.github.weisj.darklaf.ui.tree.DarkTreeUI;
public interface ComboBoxConstants {
String KEY_IS_TREE_EDITOR = DarkTreeUI.KEY_IS_TREE_EDITOR;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboIcon.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboIcon.java
index e98ba9f8..1828ba03 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboIcon.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/ComboIcon.java
@@ -20,12 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import javax.swing.*;
import java.awt.*;
+import javax.swing.*;
+
public class ComboIcon implements Icon {
private final JComboBox> box;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java
index f3c6dae8..161d838e 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxBorder.java
@@ -20,18 +20,20 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import com.github.weisj.darklaf.ui.cell.CellUtil;
-import com.github.weisj.darklaf.util.DarkUIUtil;
-import com.github.weisj.darklaf.util.GraphicsContext;
+import java.awt.*;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.InsetsUIResource;
import javax.swing.plaf.UIResource;
-import java.awt.*;
+
+import com.github.weisj.darklaf.ui.cell.CellUtil;
+import com.github.weisj.darklaf.util.DarkUIUtil;
+import com.github.weisj.darklaf.util.GraphicsContext;
public class DarkComboBoxBorder implements Border, UIResource {
@@ -123,7 +125,8 @@ public class DarkComboBoxBorder implements Border, UIResource {
public Insets getBorderInsets(final Component c) {
if (ComboBoxConstants.isTreeOrTableCellEditor(c)) {
return CellUtil.adjustEditorInsets(new InsetsUIResource(cellPadding.top, cellPadding.left,
- cellPadding.bottom, cellPadding.right), c);
+ cellPadding.bottom, cellPadding.right),
+ c);
}
if (c.getComponentOrientation().isLeftToRight()) {
return new InsetsUIResource(boxPadding.top, boxPadding.left, boxPadding.bottom, borderSize);
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxListener.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxListener.java
index 7bf83744..a676eccd 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxListener.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxListener.java
@@ -20,17 +20,19 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import com.github.weisj.darklaf.util.PropertyKey;
-
-import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import javax.swing.*;
+
+import com.github.weisj.darklaf.util.PropertyKey;
+
public class DarkComboBoxListener extends MouseAdapter implements PropertyChangeListener, ComboBoxConstants {
protected final JComboBox> comboBox;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
index 14d91568..4e1bb3f9 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
@@ -20,21 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import com.github.weisj.darklaf.components.ArrowButton;
-import com.github.weisj.darklaf.decorators.LayoutManagerDelegate;
-import com.github.weisj.darklaf.ui.list.DarkListCellRenderer;
-import com.github.weisj.darklaf.util.DarkUIUtil;
-import com.github.weisj.darklaf.util.PropertyKey;
-
-import javax.swing.*;
-import javax.swing.border.Border;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.UIResource;
-import javax.swing.plaf.basic.BasicComboBoxUI;
-import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
@@ -43,6 +32,19 @@ import java.awt.event.KeyEvent;
import java.awt.geom.Area;
import java.awt.geom.RoundRectangle2D;
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.plaf.basic.BasicComboBoxUI;
+import javax.swing.plaf.basic.ComboPopup;
+
+import com.github.weisj.darklaf.components.ArrowButton;
+import com.github.weisj.darklaf.decorators.LayoutManagerDelegate;
+import com.github.weisj.darklaf.ui.list.DarkListCellRenderer;
+import com.github.weisj.darklaf.util.DarkUIUtil;
+import com.github.weisj.darklaf.util.PropertyKey;
+
/**
* @author Konstantin Bulenkov
* @author Jannis Weis
@@ -303,9 +305,9 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements ComboBoxConstants
// calculate the width and height of the button
int buttonHeight = size.height;
int buttonWidth = squareButton
- ? buttonHeight
- : arrowButton.getPreferredSize().width
- + arrowButton.getInsets().left + arrowButton.getInsets().right;
+ ? buttonHeight
+ : arrowButton.getPreferredSize().width
+ + arrowButton.getInsets().left + arrowButton.getInsets().right;
// adjust the size based on the button width
size.height += insets.top + insets.bottom;
size.width += insets.left + insets.right + buttonWidth;
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java
index e08da47b..6f3f1dd9 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboPopup.java
@@ -20,20 +20,22 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.combobox;
-import com.github.weisj.darklaf.components.OverlayScrollPane;
-import com.github.weisj.darklaf.ui.scrollpane.DarkScrollBarUI;
-
-import javax.swing.*;
-import javax.swing.border.Border;
-import javax.swing.plaf.basic.BasicComboPopup;
import java.awt.*;
import java.awt.event.AdjustmentListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.plaf.basic.BasicComboPopup;
+
+import com.github.weisj.darklaf.components.OverlayScrollPane;
+import com.github.weisj.darklaf.ui.scrollpane.DarkScrollBarUI;
+
/**
* @author Jannis Weis
*/
@@ -67,7 +69,6 @@ public class DarkComboPopup extends BasicComboPopup {
this.borderSize = borderSize;
}
-
@Override
protected void firePopupMenuWillBecomeVisible() {
if (list.getModel().getSize() != 0) {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserListViewBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserListViewBorder.java
index cc0625f7..716d5e1b 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserListViewBorder.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserListViewBorder.java
@@ -20,13 +20,14 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.filechooser;
-import com.github.weisj.darklaf.components.border.MutableLineBorder;
-
import javax.swing.*;
+import com.github.weisj.darklaf.components.border.MutableLineBorder;
+
public class DarkFileChooserListViewBorder extends MutableLineBorder.UIResource {
public DarkFileChooserListViewBorder() {
super(1, 1, 1, 1, null);
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java
index 383e0d0e..e2cc506c 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java
@@ -20,15 +20,16 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.filechooser;
-import com.github.weisj.darklaf.components.tooltip.TooltipAwareButton;
-import com.github.weisj.darklaf.components.tooltip.TooltipAwareToggleButton;
-import com.github.weisj.darklaf.ui.button.DarkButtonUI;
-import com.github.weisj.darklaf.ui.combobox.ComboBoxConstants;
-import com.github.weisj.darklaf.util.AlignmentExt;
-import sun.swing.FilePane;
+import java.awt.*;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
import javax.accessibility.AccessibleContext;
import javax.swing.*;
@@ -38,12 +39,14 @@ import javax.swing.event.ListDataListener;
import javax.swing.filechooser.FileSystemView;
import javax.swing.filechooser.FileView;
import javax.swing.plaf.ComponentUI;
-import java.awt.*;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
+
+import sun.swing.FilePane;
+
+import com.github.weisj.darklaf.components.tooltip.TooltipAwareButton;
+import com.github.weisj.darklaf.components.tooltip.TooltipAwareToggleButton;
+import com.github.weisj.darklaf.ui.button.DarkButtonUI;
+import com.github.weisj.darklaf.ui.combobox.ComboBoxConstants;
+import com.github.weisj.darklaf.util.AlignmentExt;
public class DarkFileChooserUI extends DarkFileChooserUIBridge {
@@ -130,11 +133,11 @@ public class DarkFileChooserUI extends DarkFileChooserUIBridge {
if (KEY_VIEW_TYPE.equals(e.getPropertyName())) {
int viewType = filePane.getViewType();
switch (viewType) {
- case FilePane.VIEWTYPE_LIST:
+ case FilePane.VIEWTYPE_LIST :
listViewButton.setSelected(true);
break;
- case FilePane.VIEWTYPE_DETAILS:
+ case FilePane.VIEWTYPE_DETAILS :
detailsViewButton.setSelected(true);
break;
}
@@ -162,15 +165,13 @@ public class DarkFileChooserUI extends DarkFileChooserUIBridge {
fileNameTextField = new FileTextField();
fileNamePanel.add(fileNameTextField);
fileNameLabel.setLabelFor(fileNameTextField);
- fileNameTextField.addFocusListener(
- new FocusAdapter() {
- public void focusGained(final FocusEvent e) {
- if (!getFileChooser().isMultiSelectionEnabled()) {
- filePane.clearSelection();
- }
+ fileNameTextField.addFocusListener(new FocusAdapter() {
+ public void focusGained(final FocusEvent e) {
+ if (!getFileChooser().isMultiSelectionEnabled()) {
+ filePane.clearSelection();
}
}
- );
+ });
if (fileChooser.isMultiSelectionEnabled()) {
setFileName(fileNameString(fileChooser.getSelectedFiles()));
} else {
diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java
index 764fa23e..30849f46 100644
--- a/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java
+++ b/core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUIBridge.java
@@ -20,23 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
+ *
*/
package com.github.weisj.darklaf.ui.filechooser;
-import com.github.weisj.darklaf.util.PropertyKey;
-import sun.awt.shell.ShellFolder;
-import sun.swing.FilePane;
-
-import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.filechooser.FileFilter;
-import javax.swing.filechooser.FileSystemView;
-import javax.swing.plaf.ActionMapUIResource;
-import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.basic.BasicDirectoryModel;
-import javax.swing.plaf.basic.BasicFileChooserUI;
-import javax.swing.plaf.metal.MetalFileChooserUI;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
@@ -51,6 +38,21 @@ import java.util.Locale;
import java.util.Objects;
import java.util.Vector;
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileSystemView;
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicDirectoryModel;
+import javax.swing.plaf.basic.BasicFileChooserUI;
+import javax.swing.plaf.metal.MetalFileChooserUI;
+
+import sun.awt.shell.ShellFolder;
+import sun.swing.FilePane;
+
+import com.github.weisj.darklaf.util.PropertyKey;
/**
* Metal L&F implementation of a FileChooser.
@@ -124,8 +126,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Constructs a new instance of {@code MetalFileChooserUI}.
*
- * @param c a component
- * @return a new instance of {@code MetalFileChooserUI}
+ * @param c a component
+ * @return a new instance of {@code MetalFileChooserUI}
*/
public static ComponentUI createUI(final JComponent c) {
return new MetalFileChooserUI((JFileChooser) c);
@@ -219,46 +221,46 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
return e -> {
String s = e.getPropertyName();
switch (s) {
- case JFileChooser.SELECTED_FILE_CHANGED_PROPERTY:
+ case JFileChooser.SELECTED_FILE_CHANGED_PROPERTY :
doSelectedFileChanged(e);
break;
- case JFileChooser.SELECTED_FILES_CHANGED_PROPERTY:
+ case JFileChooser.SELECTED_FILES_CHANGED_PROPERTY :
doSelectedFilesChanged(e);
break;
- case JFileChooser.DIRECTORY_CHANGED_PROPERTY:
- case "FileChooser.useShellFolder":
+ case JFileChooser.DIRECTORY_CHANGED_PROPERTY :
+ case "FileChooser.useShellFolder" :
doDirectoryChanged(e);
break;
- case JFileChooser.FILE_FILTER_CHANGED_PROPERTY:
+ case JFileChooser.FILE_FILTER_CHANGED_PROPERTY :
doFilterChanged(e);
break;
- case JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY:
+ case JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY :
doFileSelectionModeChanged(e);
break;
- case JFileChooser.ACCESSORY_CHANGED_PROPERTY:
+ case JFileChooser.ACCESSORY_CHANGED_PROPERTY :
doAccessoryChanged(e);
break;
- case JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY:
- case JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY:
+ case JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY :
+ case JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY :
doApproveButtonTextChanged(e);
break;
- case JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY:
+ case JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY :
doDialogTypeChanged(e);
break;
- case JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY:
+ case JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY :
doApproveButtonMnemonicChanged(e);
break;
- case JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY:
+ case JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY :
doControlButtonsChanged(e);
break;
- case PropertyKey.COMPONENT_ORIENTATION:
+ case PropertyKey.COMPONENT_ORIENTATION :
ComponentOrientation o = (ComponentOrientation) e.getNewValue();
JFileChooser cc = (JFileChooser) e.getSource();
if (o != e.getOldValue()) {
cc.applyComponentOrientation(o);
}
break;
- case PropertyKey.ANCESTOR:
+ case PropertyKey.ANCESTOR :
if (e.getOldValue() == null && e.getNewValue() != null) {
// Ancestor was added, set initial focus
fileNameTextField.selectAll();
@@ -405,7 +407,6 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
}
/* The following methods are used by the PropertyChange Listener */
-
/**
* Sets the directory name.
*
@@ -430,8 +431,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Creates a selection listener for the list of files and directories.
*
- * @param fc a JFileChooser
- * @return a ListSelectionListener
+ * @param fc a JFileChooser
+ * @return a ListSelectionListener
*/
public ListSelectionListener createListSelectionListener(final JFileChooser fc) {
return super.createListSelectionListener(fc);
@@ -442,7 +443,7 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
* selection event.
*
* @param directorySelected if a directory is currently selected.
- * @since 1.4
+ * @since 1.4
*/
protected void setDirectorySelected(final boolean directorySelected) {
super.setDirectorySelected(directorySelected);
@@ -483,8 +484,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Constructs a new instance of {@code DataModel} for {@code DirectoryComboBox}.
*
- * @param fc a {@code JFileChooser}
- * @return a new instance of {@code DataModel} for {@code DirectoryComboBox}
+ * @param fc a {@code JFileChooser}
+ * @return a new instance of {@code DataModel} for {@code DirectoryComboBox}
*/
protected DirectoryComboBoxModel createDirectoryComboBoxModel(final JFileChooser fc) {
return new DirectoryComboBoxModel();
@@ -493,8 +494,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Constructs a new instance of {@code DirectoryComboBoxRenderer}.
*
- * @param fc a {@code JFileChooser}
- * @return a new instance of {@code DirectoryComboBoxRenderer}
+ * @param fc a {@code JFileChooser}
+ * @return a new instance of {@code DirectoryComboBoxRenderer}
*/
protected DefaultListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) {
return new DirectoryComboBoxRenderer();
@@ -600,8 +601,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Constructs a details view.
*
- * @param fc a {@code JFileChooser}
- * @return the list
+ * @param fc a {@code JFileChooser}
+ * @return the list
*/
protected JPanel createList(final JFileChooser fc) {
return filePane.createList();
@@ -610,8 +611,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Constructs a details view.
*
- * @param fc a {@code JFileChooser}
- * @return the details view
+ * @param fc a {@code JFileChooser}
+ * @return the details view
*/
protected JPanel createDetailsView(final JFileChooser fc) {
return filePane.createDetailsView();
@@ -623,8 +624,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
* The preferred size is at least as large, in both height and width, as the preferred size recommended by the file
* chooser's layout manager.
*
- * @param c a JFileChooser
- * @return a Dimension specifying the preferred width and height of the file chooser
+ * @param c a JFileChooser
+ * @return a Dimension specifying the preferred width and height of the file chooser
*/
@Override
public Dimension getPreferredSize(final JComponent c) {
@@ -641,8 +642,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Returns the minimum size of the JFileChooser.
*
- * @param c a JFileChooser
- * @return a Dimension specifying the minimum width and height of the file chooser
+ * @param c a JFileChooser
+ * @return a Dimension specifying the minimum width and height of the file chooser
*/
@Override
public Dimension getMinimumSize(final JComponent c) {
@@ -652,8 +653,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Returns the maximum size of the JFileChooser.
*
- * @param c a JFileChooser
- * @return a Dimension specifying the maximum width and height of the file chooser
+ * @param c a JFileChooser
+ * @return a Dimension specifying the maximum width and height of the file chooser
*/
@Override
public Dimension getMaximumSize(final JComponent c) {
@@ -702,11 +703,9 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
protected final int hGap = 5;
protected int topMargin = 17;
- public void addLayoutComponent(final String string, final Component comp) {
- }
+ public void addLayoutComponent(final String string, final Component comp) {}
- public void removeLayoutComponent(final Component c) {
- }
+ public void removeLayoutComponent(final Component c) {}
public Dimension preferredLayoutSize(final Container c) {
return minimumLayoutSize(c);
@@ -826,8 +825,7 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
*
* @param list an instance of {@code JList}
*/
- public SingleClickListener(final JList> list) {
- }
+ public SingleClickListener(final JList> list) {}
}
/**
@@ -836,14 +834,13 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
* @deprecated As of JDK version 9. Obsolete class.
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
- protected static class FileRenderer extends DefaultListCellRenderer {
- }
+ protected static class FileRenderer extends DefaultListCellRenderer {}
//
// Renderer for DirectoryComboBox
//
@SuppressWarnings("serial")
- // Superclass is not serializable across versions
+ // Superclass is not serializable across versions
class DirectoryComboBoxRenderer extends DefaultListCellRenderer {
final IndentIcon ii = new IndentIcon();
@@ -887,7 +884,6 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
public int getIconHeight() {
return icon.getIconHeight();
}
-
}
/**
@@ -930,8 +926,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
directories.clear();
File[] baseFolders = (useShellFolder)
- ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
- : fsv.getRoots();
+ ? (File[]) ShellFolder.get("fileChooserComboBoxFolders")
+ : fsv.getRoots();
directories.addAll(Arrays.asList(baseFolders));
// Get the canonical (full) path. This has the side
@@ -994,8 +990,8 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
/**
* Returns the depth of {@code i}-th file.
*
- * @param i an index
- * @return the depth of {@code i}-th file
+ * @param i an index
+ * @return the depth of {@code i}-th file
*/
public int getDepth(final int i) {
return (depths != null && i >= 0 && i < depths.length) ? depths[i] : 0;
@@ -1014,12 +1010,9 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
fireContentsChanged(this, -1, -1);
}
-
public Object getSelectedItem() {
return selectedDirectory;
}
-
-
}
/**
@@ -1027,7 +1020,7 @@ public abstract class DarkFileChooserUIBridge extends BasicFileChooserUI {
*/
@SuppressWarnings("serial") // Same-version serialization only
protected class FilterComboBoxModel extends AbstractListModel