Browse Source

Autostyle setup and initial formatting.

pull/139/head
weisj 5 years ago
parent
commit
63e55f0f71
  1. 24
      .github/workflows/documentation.yml
  2. 24
      .github/workflows/gradle-wrapper-validation.yml
  3. 24
      .github/workflows/gradle.yml
  4. 24
      .github/workflows/libs.yml
  5. 1
      README.md
  6. 57
      build.gradle.kts
  7. 23
      core/build.gradle.kts
  8. 24
      core/gradle.properties
  9. 27
      core/pom.xml
  10. 16
      core/src/main/java/com/github/weisj/darklaf/DarkLaf.java
  11. 1
      core/src/main/java/com/github/weisj/darklaf/DarkLafInfo.java
  12. 26
      core/src/main/java/com/github/weisj/darklaf/LafManager.java
  13. 5
      core/src/main/java/com/github/weisj/darklaf/color/DarkColorModel.java
  14. 4
      core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelCMYK.java
  15. 1
      core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSB.java
  16. 5
      core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelHSL.java
  17. 1
      core/src/main/java/com/github/weisj/darklaf/color/DarkColorModelRGB.java
  18. 18
      core/src/main/java/com/github/weisj/darklaf/components/ArrowButton.java
  19. 10
      core/src/main/java/com/github/weisj/darklaf/components/ClosableTabComponent.java
  20. 4
      core/src/main/java/com/github/weisj/darklaf/components/ClosableTabbedPane.java
  21. 22
      core/src/main/java/com/github/weisj/darklaf/components/ColorPipetteBase.java
  22. 19
      core/src/main/java/com/github/weisj/darklaf/components/ColoredRadioButton.java
  23. 1
      core/src/main/java/com/github/weisj/darklaf/components/DefaultButton.java
  24. 14
      core/src/main/java/com/github/weisj/darklaf/components/DefaultColorPipette.java
  25. 1
      core/src/main/java/com/github/weisj/darklaf/components/Disposable.java
  26. 11
      core/src/main/java/com/github/weisj/darklaf/components/JXPopupMenu.java
  27. 16
      core/src/main/java/com/github/weisj/darklaf/components/OverlayScrollPane.java
  28. 12
      core/src/main/java/com/github/weisj/darklaf/components/ScrollPopupMenu.java
  29. 1
      core/src/main/java/com/github/weisj/darklaf/components/SelectableTreeNode.java
  30. 1
      core/src/main/java/com/github/weisj/darklaf/components/TabEvent.java
  31. 1
      core/src/main/java/com/github/weisj/darklaf/components/TabListener.java
  32. 1
      core/src/main/java/com/github/weisj/darklaf/components/TabPropertyChangeEvent.java
  33. 9
      core/src/main/java/com/github/weisj/darklaf/components/VolumeSlider.java
  34. 1
      core/src/main/java/com/github/weisj/darklaf/components/alignment/AlignmentStrategy.java
  35. 25
      core/src/main/java/com/github/weisj/darklaf/components/border/BubbleBorder.java
  36. 4
      core/src/main/java/com/github/weisj/darklaf/components/border/DarkBorders.java
  37. 10
      core/src/main/java/com/github/weisj/darklaf/components/border/DarkLineBorder.java
  38. 57
      core/src/main/java/com/github/weisj/darklaf/components/border/DropShadowBorder.java
  39. 7
      core/src/main/java/com/github/weisj/darklaf/components/border/MutableLineBorder.java
  40. 14
      core/src/main/java/com/github/weisj/darklaf/components/color/PopupColorChooser.java
  41. 12
      core/src/main/java/com/github/weisj/darklaf/components/color/QuickColorChooser.java
  42. 20
      core/src/main/java/com/github/weisj/darklaf/components/color/SmallColorChooser.java
  43. 23
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java
  44. 10
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.java
  45. 5
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/PopupContainer.java
  46. 4
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabArea.java
  47. 5
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContent.java
  48. 37
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameContentPane.java
  49. 6
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopup.java
  50. 4
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFramePopupUI.java
  51. 6
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java
  52. 6
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabContainer.java
  53. 10
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java
  54. 1
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabbedPopupUI.java
  55. 6
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameUI.java
  56. 6
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabbedPopup.java
  57. 10
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/ToggleSplitPane.java
  58. 1
      core/src/main/java/com/github/weisj/darklaf/components/text/IconListener.java
  59. 1
      core/src/main/java/com/github/weisj/darklaf/components/text/IndexListener.java
  60. 7
      core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java
  61. 4
      core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.java
  62. 4
      core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.java
  63. 4
      core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.java
  64. 6
      core/src/main/java/com/github/weisj/darklaf/components/text/NumberedTextComponent.java
  65. 8
      core/src/main/java/com/github/weisj/darklaf/components/text/NumberingPane.java
  66. 1
      core/src/main/java/com/github/weisj/darklaf/components/text/SearchEvent.java
  67. 1
      core/src/main/java/com/github/weisj/darklaf/components/text/SearchListener.java
  68. 10
      core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextField.java
  69. 17
      core/src/main/java/com/github/weisj/darklaf/components/text/SearchTextFieldWithHistory.java
  70. 12
      core/src/main/java/com/github/weisj/darklaf/components/text/TextFieldHistoryPopup.java
  71. 1
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipAware.java
  72. 31
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipContext.java
  73. 1
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/ToolTipStyle.java
  74. 5
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareButton.java
  75. 5
      core/src/main/java/com/github/weisj/darklaf/components/tooltip/TooltipAwareToggleButton.java
  76. 4
      core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateButtonModel.java
  77. 11
      core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBox.java
  78. 8
      core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateCheckBoxMenuItem.java
  79. 1
      core/src/main/java/com/github/weisj/darklaf/components/tristate/TristateState.java
  80. 8
      core/src/main/java/com/github/weisj/darklaf/components/uiresource/Insets2D.java
  81. 1
      core/src/main/java/com/github/weisj/darklaf/components/uiresource/JButtonUIResource.java
  82. 1
      core/src/main/java/com/github/weisj/darklaf/components/uiresource/JLabelUIResource.java
  83. 4
      core/src/main/java/com/github/weisj/darklaf/components/uiresource/JPanelUIResource.java
  84. 7
      core/src/main/java/com/github/weisj/darklaf/components/uiresource/UIResourceWrapper.java
  85. 10
      core/src/main/java/com/github/weisj/darklaf/decorators/AncestorAdapter.java
  86. 4
      core/src/main/java/com/github/weisj/darklaf/decorators/CellRenderer.java
  87. 10
      core/src/main/java/com/github/weisj/darklaf/decorators/ComponentResizeListener.java
  88. 5
      core/src/main/java/com/github/weisj/darklaf/decorators/HoverListener.java
  89. 2
      core/src/main/java/com/github/weisj/darklaf/decorators/LayoutManagerDelegate.java
  90. 13
      core/src/main/java/com/github/weisj/darklaf/decorators/MouseClickListener.java
  91. 10
      core/src/main/java/com/github/weisj/darklaf/decorators/MouseInputDelegate.java
  92. 4
      core/src/main/java/com/github/weisj/darklaf/decorators/MouseMovementListener.java
  93. 2
      core/src/main/java/com/github/weisj/darklaf/decorators/MouseResponder.java
  94. 4
      core/src/main/java/com/github/weisj/darklaf/decorators/PlainAction.java
  95. 1
      core/src/main/java/com/github/weisj/darklaf/decorators/PopupMenuAdapter.java
  96. 1
      core/src/main/java/com/github/weisj/darklaf/decorators/UpdateDocumentListener.java
  97. 6
      core/src/main/java/com/github/weisj/darklaf/log/LogFormatter.java
  98. 10
      core/src/main/java/com/github/weisj/darklaf/platform/DecorationsHandler.java
  99. 22
      core/src/main/java/com/github/weisj/darklaf/platform/DefaultDecorationsProvider.java
  100. 14
      core/src/main/java/com/github/weisj/darklaf/platform/DefaultThemePreferenceProvider.java
  101. Some files were not shown because too many files have changed in this diff Show More

24
.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:

24
.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]

24
.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:

24
.github/workflows/libs.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: Build Native Libraries
on:

1
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).

57
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<AbstractArchiveTask>().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()

23
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<String>) {

24
core/gradle.properties

@ -1 +1,25 @@
#
# 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

27
core/pom.xml

@ -1,5 +1,30 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
<!--
~ 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.
~
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.weisj</groupId>

16
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
*/
@ -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";

1
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;

26
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);
@ -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()}

5
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;

4
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;
}
}

1
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;

5
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;
@ -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;
@ -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;

1
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;

18
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,7 +46,6 @@ 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) {
@ -65,7 +63,6 @@ public final class ArrowButton implements SwingConstants {
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;

10
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

4
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
*/

22
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;
@ -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;
}

19
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);
@ -129,11 +131,10 @@ 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/"),
PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, "radioButton", "properties/ui/"),
props, defaults);
PropertyLoader.putProperties(
PropertyLoader.loadProperties(DarkLaf.class, "radioButton", "properties/icons/"),
PropertyLoader.putProperties(PropertyLoader.loadProperties(DarkLaf.class, "radioButton",
"properties/icons/"),
props, defaults);
propertyMap = new Properties();
for (String prop : PROPERTIES) {

1
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;

14
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;

1
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;

11
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}.

16
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.
@ -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;
}
}
}

12
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();

1
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;

1
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;

1
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;

1
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;

9
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,7 +39,6 @@ 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 <code>SwingConstants.VERTICAL</code> or
@ -52,7 +52,6 @@ public class VolumeSlider extends JSlider {
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.
@ -71,7 +70,6 @@ public class VolumeSlider extends JSlider {
this(HORIZONTAL, min, max, (min + max) / 2);
}
/**
* Creates a horizontal slider using the specified min, max and value.
* <p>
@ -91,7 +89,6 @@ public class VolumeSlider extends JSlider {
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 <code>SwingConstants.VERTICAL</code> or

1
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;

25
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
*/
@ -92,7 +94,6 @@ public class BubbleBorder extends AbstractBorder {
* @param color border colour
* @return this
*/
public BubbleBorder setColor(final Color color) {
this.color = color;
return this;
@ -118,7 +119,6 @@ public class BubbleBorder extends AbstractBorder {
return this;
}
/**
* Get the border thickness.
*
@ -134,7 +134,6 @@ public class BubbleBorder extends AbstractBorder {
* @param n new thickness
* @return this
*/
public BubbleBorder setThickness(final int n) {
thickness = Math.max(n, 0);
return setPointerSize(pointerSize);
@ -155,7 +154,6 @@ public class BubbleBorder extends AbstractBorder {
* @param size size of pointer.
* @return this
*/
public BubbleBorder setPointerSize(final int size) {
pointerSize = Math.max(size, 0);
float left = thickness;
@ -202,7 +200,6 @@ public class BubbleBorder extends AbstractBorder {
* @param radius radius of corner.
* @return this
*/
public BubbleBorder setRadius(final int radius) {
this.radius = radius;
return setPointerSize(pointerSize);
@ -225,7 +222,6 @@ public class BubbleBorder extends AbstractBorder {
* @param side direction in which the pointer should point.
* @return this.
*/
public BubbleBorder setPointerSide(final Alignment side) {
this.pointerSide = side;
setPointerSize(pointerSize);
@ -236,7 +232,6 @@ 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) {
@ -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);
@ -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;

4
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;

10
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;

57
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.
* <p>
* Note: {@code DropShadowBorder} should usually be added to non-opaque components, otherwise the background is likely
* to bleed through.</p>
* <p>Note: Since generating drop shadows is relatively expensive operation,
* to bleed through.
* </p>
* <p>
* 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.</p>
* your app memory in case you tend to create many different borders rapidly.
* </p>
*
* @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) {
@ -166,8 +166,7 @@ public class DropShadowBorder implements Border, Serializable {
if (showLeftShadow) {
assert topLeftShadowPoint != null && bottomLeftShadowPoint != null;
Rectangle leftShadowRect =
new Rectangle(x, topLeftShadowPoint.y + shadowSize, 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,
@ -176,9 +175,10 @@ 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,
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,
@ -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);
@ -331,7 +332,6 @@ public class DropShadowBorder implements Border, Serializable {
* 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;
}
}
}

7
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;

14
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;

12
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;

20
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) {}
});
}

23
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.
*
@ -359,7 +361,6 @@ public class JTabFrame extends JComponent {
* @param a the alignment position.{@link TabFramePosition#getAlignment()}
* @return the tab container.
*/
public JComponent getTabContainer(final Alignment a) {
switch (a) {
case NORTH :
@ -845,11 +846,14 @@ public class JTabFrame extends JComponent {
* by {@link #getTabContainer(Alignment)}.
* <p>
* NORTH = NORTH_EAST
* </p><p>
* </p>
* <p>
* EAST = SOUTH_EAST
* </p><p>
* </p>
* <p>
* SOUTH = SOUTH_WEST
* </p><p>
* </p>
* <p>
* WEST = NORTH_WEST
*
* @param a the alignment position.{@link TabFramePosition#getAlignment()}
@ -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;

10
core/src/main/java/com/github/weisj/darklaf/components/tabframe/PanelPopup.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.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}.
@ -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;

5
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;

4
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() {

5
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 {
/**

37
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);
@ -188,57 +189,49 @@ public class TabFrameContentPane extends JPanel implements TabFrameContent {
if (enabled == isEnabled(a) && !force) return;
switch (a) {
case NORTH :
changeStatus(
enabled, Alignment.NORTH_EAST,
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,
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,
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,
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,
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,
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,
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,
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));
@ -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;

6
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";

4
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 {}

6
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);
}

6
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 {

10
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}.
*

1
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;

6
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 {

6
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}.
*

10
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();
@ -179,5 +178,4 @@ public class ToggleSplitPane extends JSplitPane {
? comp.getMinimumSize().width
: comp.getMinimumSize().height;
}
}

1
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;

1
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;

7
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;
@ -105,8 +107,7 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
}
lastView = currentView;
}
} catch (BadLocationException ignored) {
}
} catch (BadLocationException ignored) {}
});
}
}

4
core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingEditorPane.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 java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
/**
* JTextPane that keeps the original width of text.

4
core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextArea.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 java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
/**
* JTextPane that keeps the original width of text.

4
core/src/main/java/com/github/weisj/darklaf/components/text/NonWrappingTextPane.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 java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
/**
* JTextPane that keeps the original width of text.

6
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 {

8
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 {

1
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;

1
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;

10
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;
@ -43,11 +44,14 @@ public class SearchTextField extends JTextField {
* This is the constructor through which the other constructors feed. If the document is <code>null</code>, a
* default model is created.
*
* @param doc the text storage to use; if this is <code>null</code>, a default will be provided by calling the
* @param doc the text storage to use; if this is <code>null</code>, a default will be
* provided by calling the
* <code>createDefaultModel</code> method
* @param text the initial string to display, or <code>null</code>
* @param columns the number of columns to use to calculate the preferred width &gt;= 0; if <code>columns</code> is
* set to zero, the preferred width will be whatever naturally results from the component
* @param columns the number of columns to use to calculate the preferred width &gt;= 0; if
* <code>columns</code> is
* set to zero, the preferred width will be whatever naturally results from the
* component
* implementation
* @throws IllegalArgumentException if <code>columns</code> &lt; 0
*/

17
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
*
@ -48,11 +50,14 @@ public class SearchTextFieldWithHistory extends SearchTextField {
* This is the constructor through which the other constructors feed. If the document is <code>null</code>, a
* default model is created.
*
* @param doc the text storage to use; if this is <code>null</code>, a default will be provided by calling the
* @param doc the text storage to use; if this is <code>null</code>, a default will be
* provided by calling the
* <code>createDefaultModel</code> method
* @param text the initial string to display, or <code>null</code>
* @param columns the number of columns to use to calculate the preferred width &gt;= 0; if <code>columns</code> is
* set to zero, the preferred width will be whatever naturally results from the component
* @param columns the number of columns to use to calculate the preferred width &gt;= 0; if
* <code>columns</code> is
* set to zero, the preferred width will be whatever naturally results from the
* component
* implementation
* @throws IllegalArgumentException if <code>columns</code> &lt; 0
*/
@ -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.
*
* <p>Note: A value of less than or equal to 0 indicates that the height should not be limited.
* <p>
* 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.
*/

12
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
*/

1
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;

31
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.
*
@ -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);
}
@ -242,8 +242,8 @@ public class ToolTipContext {
/**
* Set the alignment strategy which determines how the current mouse position is considered when calculating the
* tooltip location.
*
* <p>Default will be {@link AlignmentStrategy#COMPONENT_BOTH}.
* <p>
* Default will be {@link AlignmentStrategy#COMPONENT_BOTH}.
*
* @param alignmentStrategy the alignment strategy.
* @return this
@ -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);
@ -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;

1
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;

5
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;

5
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;

4
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;

11
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";

8
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 {
/**

1
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;

8
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;
@ -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 + "]";
}
}

1
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;

1
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;

4
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 {

7
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() {

10
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) {}
}

4
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 {}

10
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;
@ -37,14 +38,11 @@ public interface ComponentResizeListener extends ComponentListener {
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) {}
}

5
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;
}

2
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");

13
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) {}
}

10
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() {};
}
}

4
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);

2
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<MouseEvent> consumer;
public MouseResponder(final Consumer<MouseEvent> consumer) {
this.consumer = consumer;
}

4
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
*/

1
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;

1
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;

6
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);

10
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";

22
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) {}
}

14
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<PreferredThemeStyle> callback) {
}
public void setCallback(final Consumer<PreferredThemeStyle> callback) {}
@Override
public void setReporting(final boolean reporting) {
}
public void setReporting(final boolean reporting) {}
@Override
public boolean isReporting() {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save