diff --git a/base/src/main/java/atlantafx/base/controls/BehaviorSkinBase.java b/base/src/main/java/atlantafx/base/controls/BehaviorSkinBase.java index fc8e473..cd75b7e 100755 --- a/base/src/main/java/atlantafx/base/controls/BehaviorSkinBase.java +++ b/base/src/main/java/atlantafx/base/controls/BehaviorSkinBase.java @@ -1,12 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.base.controls; +import java.util.function.Consumer; import javafx.beans.value.ObservableValue; import javafx.scene.control.Control; import javafx.scene.control.SkinBase; -import java.util.function.Consumer; - public abstract class BehaviorSkinBase> extends SkinBase { protected B behavior; diff --git a/base/src/main/java/atlantafx/base/controls/Breadcrumbs.java b/base/src/main/java/atlantafx/base/controls/Breadcrumbs.java index 8047775..1ef729a 100755 --- a/base/src/main/java/atlantafx/base/controls/Breadcrumbs.java +++ b/base/src/main/java/atlantafx/base/controls/Breadcrumbs.java @@ -28,17 +28,25 @@ */ package atlantafx.base.controls; -import javafx.beans.property.*; +import java.util.UUID; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.ObjectPropertyBase; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleObjectProperty; import javafx.event.Event; import javafx.event.EventHandler; import javafx.event.EventType; import javafx.scene.Node; -import javafx.scene.control.*; +import javafx.scene.control.ButtonBase; +import javafx.scene.control.Control; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.Label; +import javafx.scene.control.Skin; +import javafx.scene.control.TreeItem; import javafx.scene.layout.Region; import javafx.util.Callback; -import java.util.UUID; - /** * Represents a bread crumb bar. This control is useful to visualize and navigate * a hierarchical path structure, such as file systems. diff --git a/base/src/main/java/atlantafx/base/controls/BreadcrumbsSkin.java b/base/src/main/java/atlantafx/base/controls/BreadcrumbsSkin.java index 63c67e4..bdf3bab 100755 --- a/base/src/main/java/atlantafx/base/controls/BreadcrumbsSkin.java +++ b/base/src/main/java/atlantafx/base/controls/BreadcrumbsSkin.java @@ -29,6 +29,9 @@ package atlantafx.base.controls; import atlantafx.base.controls.Breadcrumbs.BreadCrumbItem; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import javafx.css.PseudoClass; import javafx.event.Event; import javafx.event.EventHandler; @@ -37,10 +40,6 @@ import javafx.scene.control.ButtonBase; import javafx.scene.control.SkinBase; import javafx.scene.control.TreeItem.TreeModificationEvent; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - public class BreadcrumbsSkin extends SkinBase> { protected static final PseudoClass FIRST = PseudoClass.getPseudoClass("first"); diff --git a/base/src/main/java/atlantafx/base/controls/InlineDatePicker.java b/base/src/main/java/atlantafx/base/controls/InlineDatePicker.java index 62d7c87..a702c9e 100755 --- a/base/src/main/java/atlantafx/base/controls/InlineDatePicker.java +++ b/base/src/main/java/atlantafx/base/controls/InlineDatePicker.java @@ -26,6 +26,15 @@ */ package atlantafx.base.controls; +import java.time.DateTimeException; +import java.time.LocalDate; +import java.time.chrono.Chronology; +import java.time.chrono.IsoChronology; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; @@ -42,16 +51,6 @@ import javafx.scene.control.DateCell; import javafx.scene.control.Skin; import javafx.util.Callback; -import java.time.DateTimeException; -import java.time.LocalDate; -import java.time.chrono.Chronology; -import java.time.chrono.IsoChronology; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; - /** * The DatePicker control allows the user to select a date. The calendar is based on either * the standard ISO-8601 chronology or any of the other chronology classes defined in the diff --git a/base/src/main/java/atlantafx/base/controls/InlineDatePickerBehavior.java b/base/src/main/java/atlantafx/base/controls/InlineDatePickerBehavior.java index 4bc6749..90c8043 100755 --- a/base/src/main/java/atlantafx/base/controls/InlineDatePickerBehavior.java +++ b/base/src/main/java/atlantafx/base/controls/InlineDatePickerBehavior.java @@ -1,17 +1,16 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.base.controls; -import javafx.scene.input.KeyEvent; -import javafx.scene.input.MouseEvent; - -import java.time.LocalDate; -import java.time.ZoneId; - import static atlantafx.base.util.PlatformUtils.isMac; import static java.time.temporal.ChronoUnit.MONTHS; import static java.time.temporal.ChronoUnit.YEARS; import static javafx.scene.input.KeyCode.ESCAPE; +import java.time.LocalDate; +import java.time.ZoneId; +import javafx.scene.input.KeyEvent; +import javafx.scene.input.MouseEvent; + public class InlineDatePickerBehavior extends BehaviorBase { public InlineDatePickerBehavior(InlineDatePicker control, InlineDatePickerSkin skin) { diff --git a/base/src/main/java/atlantafx/base/controls/InlineDatePickerSkin.java b/base/src/main/java/atlantafx/base/controls/InlineDatePickerSkin.java index 2ad6526..721fb28 100755 --- a/base/src/main/java/atlantafx/base/controls/InlineDatePickerSkin.java +++ b/base/src/main/java/atlantafx/base/controls/InlineDatePickerSkin.java @@ -26,21 +26,14 @@ */ package atlantafx.base.controls; -import javafx.beans.binding.Bindings; -import javafx.beans.binding.ObjectBinding; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.event.ActionEvent; -import javafx.event.EventHandler; -import javafx.scene.Node; -import javafx.scene.Scene; -import javafx.scene.control.Button; -import javafx.scene.control.DateCell; -import javafx.scene.control.Label; -import javafx.scene.input.MouseButton; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.*; -import javafx.util.Callback; +import static atlantafx.base.controls.InlineDatePicker.isValidDate; +import static java.time.temporal.ChronoField.DAY_OF_WEEK; +import static java.time.temporal.ChronoField.MONTH_OF_YEAR; +import static java.time.temporal.ChronoUnit.DAYS; +import static java.time.temporal.ChronoUnit.MONTHS; +import static java.time.temporal.ChronoUnit.WEEKS; +import static java.time.temporal.ChronoUnit.YEARS; +import static javafx.scene.layout.Region.USE_PREF_SIZE; import java.time.DateTimeException; import java.time.LocalDate; @@ -57,12 +50,27 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Objects; - -import static atlantafx.base.controls.InlineDatePicker.isValidDate; -import static java.time.temporal.ChronoField.DAY_OF_WEEK; -import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static java.time.temporal.ChronoUnit.*; -import static javafx.scene.layout.Region.USE_PREF_SIZE; +import javafx.beans.binding.Bindings; +import javafx.beans.binding.ObjectBinding; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Node; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.DateCell; +import javafx.scene.control.Label; +import javafx.scene.input.MouseButton; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.ColumnConstraints; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.util.Callback; public class InlineDatePickerSkin extends BehaviorSkinBase { diff --git a/base/src/main/java/atlantafx/base/controls/Popover.java b/base/src/main/java/atlantafx/base/controls/Popover.java index 5cbdf5d..ab79bb3 100755 --- a/base/src/main/java/atlantafx/base/controls/Popover.java +++ b/base/src/main/java/atlantafx/base/controls/Popover.java @@ -28,11 +28,24 @@ */ package atlantafx.base.controls; +import static java.util.Objects.requireNonNull; +import static javafx.scene.input.MouseEvent.MOUSE_CLICKED; + +import java.util.Objects; +import java.util.Timer; +import java.util.TimerTask; import javafx.animation.FadeTransition; import javafx.application.Platform; import javafx.beans.InvalidationListener; import javafx.beans.WeakInvalidationListener; -import javafx.beans.property.*; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.DoubleProperty; +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleDoubleProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; import javafx.beans.value.ChangeListener; import javafx.beans.value.WeakChangeListener; import javafx.event.EventHandler; @@ -48,13 +61,6 @@ import javafx.stage.Window; import javafx.stage.WindowEvent; import javafx.util.Duration; -import java.util.Objects; -import java.util.Timer; -import java.util.TimerTask; - -import static java.util.Objects.requireNonNull; -import static javafx.scene.input.MouseEvent.MOUSE_CLICKED; - /** * The Popover control provides detailed information about an owning node in a * popup window. The popup window has a very lightweight appearance (no default diff --git a/base/src/main/java/atlantafx/base/controls/PopoverSkin.java b/base/src/main/java/atlantafx/base/controls/PopoverSkin.java index 6dbb82f..13e783a 100755 --- a/base/src/main/java/atlantafx/base/controls/PopoverSkin.java +++ b/base/src/main/java/atlantafx/base/controls/PopoverSkin.java @@ -28,6 +28,14 @@ */ package atlantafx.base.controls; +import static atlantafx.base.controls.Popover.ArrowLocation; +import static java.lang.Double.MAX_VALUE; +import static javafx.geometry.Pos.TOP_RIGHT; +import static javafx.scene.control.ContentDisplay.GRAPHIC_ONLY; +import static javafx.scene.paint.Color.YELLOW; + +import java.util.ArrayList; +import java.util.List; import javafx.beans.InvalidationListener; import javafx.beans.binding.Bindings; import javafx.beans.property.DoubleProperty; @@ -42,18 +50,17 @@ import javafx.scene.control.Skin; import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; import javafx.scene.layout.StackPane; -import javafx.scene.shape.*; +import javafx.scene.shape.Circle; +import javafx.scene.shape.HLineTo; +import javafx.scene.shape.Line; +import javafx.scene.shape.LineTo; +import javafx.scene.shape.MoveTo; +import javafx.scene.shape.Path; +import javafx.scene.shape.PathElement; +import javafx.scene.shape.QuadCurveTo; +import javafx.scene.shape.VLineTo; import javafx.stage.Window; -import java.util.ArrayList; -import java.util.List; - -import static atlantafx.base.controls.Popover.ArrowLocation; -import static java.lang.Double.MAX_VALUE; -import static javafx.geometry.Pos.TOP_RIGHT; -import static javafx.scene.control.ContentDisplay.GRAPHIC_ONLY; -import static javafx.scene.paint.Color.YELLOW; - public class PopoverSkin implements Skin { private static final String DETACHED_STYLE_CLASS = "detached"; diff --git a/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java b/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java index 61fcb7c..10d2564 100755 --- a/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java +++ b/base/src/main/java/atlantafx/base/controls/RingProgressIndicatorSkin.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.base.controls; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import javafx.animation.Animation; import javafx.animation.Interpolator; import javafx.animation.RotateTransition; @@ -21,10 +24,6 @@ import javafx.scene.shape.Arc; import javafx.scene.shape.Circle; import javafx.util.Duration; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - public class RingProgressIndicatorSkin extends SkinBase { protected static final double DEFAULT_ANIMATION_TIME = 3; diff --git a/base/src/main/java/atlantafx/base/controls/ToggleSwitchSkin.java b/base/src/main/java/atlantafx/base/controls/ToggleSwitchSkin.java index 0cef734..ff58633 100755 --- a/base/src/main/java/atlantafx/base/controls/ToggleSwitchSkin.java +++ b/base/src/main/java/atlantafx/base/controls/ToggleSwitchSkin.java @@ -28,6 +28,9 @@ */ package atlantafx.base.controls; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import javafx.animation.Animation; import javafx.animation.TranslateTransition; import javafx.beans.property.DoubleProperty; @@ -43,10 +46,6 @@ import javafx.scene.control.SkinBase; import javafx.scene.layout.StackPane; import javafx.util.Duration; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - public class ToggleSwitchSkin extends SkinBase { protected final StackPane thumb; diff --git a/base/src/main/java/atlantafx/base/util/DoubleStringConverter.java b/base/src/main/java/atlantafx/base/util/DoubleStringConverter.java index fa979eb..8c7c0fa 100644 --- a/base/src/main/java/atlantafx/base/util/DoubleStringConverter.java +++ b/base/src/main/java/atlantafx/base/util/DoubleStringConverter.java @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.base.util; +import java.text.DecimalFormat; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.event.EventHandler; @@ -10,8 +11,6 @@ import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.util.StringConverter; -import java.text.DecimalFormat; - /** * Converts between user-edited strings and {@link Double} values. * Accepts an optional {@link Runnable} that resets the editor on {@link NumberFormatException}, diff --git a/base/src/main/java/atlantafx/base/util/PasswordTextFormatter.java b/base/src/main/java/atlantafx/base/util/PasswordTextFormatter.java index dabe223..98fbc4f 100644 --- a/base/src/main/java/atlantafx/base/util/PasswordTextFormatter.java +++ b/base/src/main/java/atlantafx/base/util/PasswordTextFormatter.java @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.base.util; +import java.util.function.UnaryOperator; import javafx.application.Platform; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ReadOnlyStringProperty; @@ -10,8 +11,6 @@ import javafx.scene.control.TextField; import javafx.scene.control.TextFormatter; import javafx.util.StringConverter; -import java.util.function.UnaryOperator; - /** * An alternative for the {@link javafx.scene.control.PasswordField}. * The formatter (un)masks text field content based on boolean property. diff --git a/base/src/test/java/atlantafx/base/util/PasswordTextFormatterTest.java b/base/src/test/java/atlantafx/base/util/PasswordTextFormatterTest.java index 17b2f93..5c43cb0 100644 --- a/base/src/test/java/atlantafx/base/util/PasswordTextFormatterTest.java +++ b/base/src/test/java/atlantafx/base/util/PasswordTextFormatterTest.java @@ -1,13 +1,13 @@ package atlantafx.base.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import javafx.application.Platform; import javafx.scene.control.TextField; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; - public class PasswordTextFormatterTest { @BeforeAll diff --git a/sampler/icons/icon-rounded.svg b/sampler/icons/icon-rounded.svg index ca674d5..53d68a1 100644 --- a/sampler/icons/icon-rounded.svg +++ b/sampler/icons/icon-rounded.svg @@ -2,18 +2,18 @@ + width="105mm" + height="105mm" + viewBox="0 0 105 105" + version="1.1" + id="svg5" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + sodipodi:docname="icon-rounded.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" +> + width="105mm" + height="105mm" + viewBox="0 0 105 105" + version="1.1" + id="svg5" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + sodipodi:docname="square.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" +> + width="105mm" + height="105mm" + viewBox="0 0 105 105" + version="1.1" + id="svg5" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + sodipodi:docname="logo.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" +> PRINT_SOURCE = System.out::println; diff --git a/sampler/src/main/java/atlantafx/sampler/fake/domain/Book.java b/sampler/src/main/java/atlantafx/sampler/fake/domain/Book.java index 477a785..28b11f5 100644 --- a/sampler/src/main/java/atlantafx/sampler/fake/domain/Book.java +++ b/sampler/src/main/java/atlantafx/sampler/fake/domain/Book.java @@ -1,13 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.fake.domain; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import net.datafaker.Faker; - import java.util.Objects; import java.util.UUID; import java.util.function.Function; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import net.datafaker.Faker; public final class Book { diff --git a/sampler/src/main/java/atlantafx/sampler/fake/domain/Product.java b/sampler/src/main/java/atlantafx/sampler/fake/domain/Product.java index ac07ff7..d7f02ee 100644 --- a/sampler/src/main/java/atlantafx/sampler/fake/domain/Product.java +++ b/sampler/src/main/java/atlantafx/sampler/fake/domain/Product.java @@ -1,13 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.fake.domain; +import java.util.Objects; +import java.util.function.Function; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import net.datafaker.Faker; -import java.util.Objects; -import java.util.function.Function; - public final class Product { private static final int MAX_STOCK_SIZE = 999; diff --git a/sampler/src/main/java/atlantafx/sampler/layout/HeaderBar.java b/sampler/src/main/java/atlantafx/sampler/layout/HeaderBar.java index aad361b..6a3ad4d 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/HeaderBar.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/HeaderBar.java @@ -1,12 +1,20 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.layout; +import static atlantafx.base.theme.Styles.TEXT_SMALL; +import static atlantafx.base.theme.Styles.TITLE_3; +import static atlantafx.base.theme.Styles.TITLE_4; +import static atlantafx.sampler.Launcher.IS_DEV_MODE; +import static atlantafx.sampler.layout.MainLayer.SIDEBAR_WIDTH; + import atlantafx.base.controls.CustomTextField; import atlantafx.base.controls.Spacer; import atlantafx.sampler.Resources; import atlantafx.sampler.event.BrowseEvent; import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.HotkeyEvent; +import java.net.URI; +import java.util.function.Consumer; import javafx.beans.binding.Bindings; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -25,13 +33,6 @@ import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2MZ; import org.kordamp.ikonli.material2.Material2OutlinedMZ; -import java.net.URI; -import java.util.function.Consumer; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.Launcher.IS_DEV_MODE; -import static atlantafx.sampler.layout.MainLayer.SIDEBAR_WIDTH; - class HeaderBar extends HBox { private static final int HEADER_HEIGHT = 50; diff --git a/sampler/src/main/java/atlantafx/sampler/layout/MainLayer.java b/sampler/src/main/java/atlantafx/sampler/layout/MainLayer.java index d8f3910..2e6f742 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/MainLayer.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/MainLayer.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.layout; +import static atlantafx.base.controls.Popover.ArrowLocation.TOP_CENTER; +import static javafx.scene.layout.Priority.ALWAYS; + import atlantafx.base.controls.Popover; import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.ThemeEvent; @@ -10,6 +13,8 @@ import atlantafx.sampler.page.Page; import atlantafx.sampler.page.QuickConfigMenu; import atlantafx.sampler.page.components.OverviewPage; import atlantafx.sampler.theme.ThemeManager; +import java.io.IOException; +import java.util.Objects; import javafx.animation.FadeTransition; import javafx.application.Platform; import javafx.scene.Node; @@ -19,12 +24,6 @@ import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.util.Duration; -import java.io.IOException; -import java.util.Objects; - -import static atlantafx.base.controls.Popover.ArrowLocation.TOP_CENTER; -import static javafx.scene.layout.Priority.ALWAYS; - class MainLayer extends BorderPane { static final int SIDEBAR_WIDTH = 220; diff --git a/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java b/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java index 83ca1a1..1ebed79 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java @@ -1,14 +1,20 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.layout; -import atlantafx.sampler.page.Page; -import javafx.beans.property.*; - -import java.util.Objects; - import static atlantafx.sampler.layout.MainModel.SubLayer.PAGE; import static atlantafx.sampler.layout.MainModel.SubLayer.SOURCE_CODE; +import atlantafx.sampler.page.Page; +import java.util.Objects; +import javafx.beans.property.ReadOnlyBooleanProperty; +import javafx.beans.property.ReadOnlyBooleanWrapper; +import javafx.beans.property.ReadOnlyObjectProperty; +import javafx.beans.property.ReadOnlyObjectWrapper; +import javafx.beans.property.ReadOnlyStringProperty; +import javafx.beans.property.ReadOnlyStringWrapper; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; + public class MainModel { public enum SubLayer { diff --git a/sampler/src/main/java/atlantafx/sampler/layout/Overlay.java b/sampler/src/main/java/atlantafx/sampler/layout/Overlay.java index d1f2aeb..27d587e 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/Overlay.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/Overlay.java @@ -4,6 +4,8 @@ package atlantafx.sampler.layout; import atlantafx.sampler.util.Animations; import atlantafx.sampler.util.Containers; import atlantafx.sampler.util.NodeUtils; +import java.util.Objects; +import java.util.function.Consumer; import javafx.animation.Timeline; import javafx.beans.property.ReadOnlyBooleanProperty; import javafx.beans.property.ReadOnlyBooleanWrapper; @@ -21,9 +23,6 @@ import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.util.Duration; -import java.util.Objects; -import java.util.function.Consumer; - public class Overlay extends StackPane { public static final String STYLE_CLASS = "overlay"; diff --git a/sampler/src/main/java/atlantafx/sampler/layout/Sidebar.java b/sampler/src/main/java/atlantafx/sampler/layout/Sidebar.java index 210f3c3..2ec6601 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/Sidebar.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/Sidebar.java @@ -1,10 +1,49 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.layout; +import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; +import static javafx.scene.layout.Priority.ALWAYS; + import atlantafx.base.controls.Spacer; import atlantafx.base.theme.Styles; import atlantafx.sampler.page.Page; -import atlantafx.sampler.page.components.*; +import atlantafx.sampler.page.components.AccordionPage; +import atlantafx.sampler.page.components.BreadcrumbsPage; +import atlantafx.sampler.page.components.ButtonPage; +import atlantafx.sampler.page.components.ChartPage; +import atlantafx.sampler.page.components.CheckBoxPage; +import atlantafx.sampler.page.components.ColorPickerPage; +import atlantafx.sampler.page.components.ComboBoxPage; +import atlantafx.sampler.page.components.CustomTextFieldPage; +import atlantafx.sampler.page.components.DatePickerPage; +import atlantafx.sampler.page.components.DialogPage; +import atlantafx.sampler.page.components.HTMLEditorPage; +import atlantafx.sampler.page.components.InputGroupPage; +import atlantafx.sampler.page.components.LabelPage; +import atlantafx.sampler.page.components.ListPage; +import atlantafx.sampler.page.components.MenuButtonPage; +import atlantafx.sampler.page.components.MenuPage; +import atlantafx.sampler.page.components.OverviewPage; +import atlantafx.sampler.page.components.PaginationPage; +import atlantafx.sampler.page.components.PopoverPage; +import atlantafx.sampler.page.components.ProgressPage; +import atlantafx.sampler.page.components.RadioButtonPage; +import atlantafx.sampler.page.components.ScrollPanePage; +import atlantafx.sampler.page.components.SeparatorPage; +import atlantafx.sampler.page.components.SliderPage; +import atlantafx.sampler.page.components.SpinnerPage; +import atlantafx.sampler.page.components.SplitPanePage; +import atlantafx.sampler.page.components.TabPanePage; +import atlantafx.sampler.page.components.TablePage; +import atlantafx.sampler.page.components.TextAreaPage; +import atlantafx.sampler.page.components.TextFieldPage; +import atlantafx.sampler.page.components.TitledPanePage; +import atlantafx.sampler.page.components.ToggleButtonPage; +import atlantafx.sampler.page.components.ToggleSwitchPage; +import atlantafx.sampler.page.components.ToolBarPage; +import atlantafx.sampler.page.components.TooltipPage; +import atlantafx.sampler.page.components.TreePage; +import atlantafx.sampler.page.components.TreeTablePage; import atlantafx.sampler.page.general.IconsPage; import atlantafx.sampler.page.general.ThemePage; import atlantafx.sampler.page.general.TypographyPage; @@ -12,6 +51,14 @@ import atlantafx.sampler.page.showcase.filemanager.FileManagerPage; import atlantafx.sampler.page.showcase.musicplayer.MusicPlayerPage; import atlantafx.sampler.page.showcase.widget.WidgetCollectionPage; import atlantafx.sampler.util.Containers; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; import javafx.beans.binding.Bindings; import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; @@ -27,12 +74,6 @@ import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; -import java.util.*; -import java.util.function.Predicate; - -import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; -import static javafx.scene.layout.Priority.ALWAYS; - @SuppressWarnings("UnnecessaryLambda") class Sidebar extends StackPane { diff --git a/sampler/src/main/java/atlantafx/sampler/page/AbstractPage.java b/sampler/src/main/java/atlantafx/sampler/page/AbstractPage.java index 66bae16..d6ed988 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/AbstractPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/AbstractPage.java @@ -1,21 +1,24 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page; -import atlantafx.sampler.layout.Overlay; -import javafx.scene.Node; -import javafx.scene.control.ScrollPane; -import javafx.scene.layout.*; -import net.datafaker.Faker; -import org.kordamp.ikonli.feather.Feather; +import static atlantafx.sampler.util.Containers.setScrollConstraints; +import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; +import atlantafx.sampler.layout.Overlay; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.function.Supplier; import java.util.stream.Stream; - -import static atlantafx.sampler.util.Containers.setScrollConstraints; -import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; +import javafx.scene.Node; +import javafx.scene.control.ScrollPane; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.Priority; +import javafx.scene.layout.StackPane; +import net.datafaker.Faker; +import org.kordamp.ikonli.feather.Feather; public abstract class AbstractPage extends BorderPane implements Page { diff --git a/sampler/src/main/java/atlantafx/sampler/page/CodeViewer.java b/sampler/src/main/java/atlantafx/sampler/page/CodeViewer.java index 03d85b8..1620736 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/CodeViewer.java +++ b/sampler/src/main/java/atlantafx/sampler/page/CodeViewer.java @@ -1,19 +1,18 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page; +import static java.nio.charset.StandardCharsets.UTF_8; + import atlantafx.sampler.Resources; import atlantafx.sampler.theme.HighlightJSTheme; import atlantafx.sampler.util.Containers; +import java.io.IOException; +import java.io.InputStream; import javafx.geometry.Insets; import javafx.scene.layout.AnchorPane; import javafx.scene.paint.Color; import javafx.scene.web.WebView; -import java.io.IOException; -import java.io.InputStream; - -import static java.nio.charset.StandardCharsets.UTF_8; - public class CodeViewer extends AnchorPane { private static final String HLJS_LIB = "assets/highlightjs/highlight.min.js"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/OverlayDialog.java b/sampler/src/main/java/atlantafx/sampler/page/OverlayDialog.java index 64f2d05..2f55930 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/OverlayDialog.java +++ b/sampler/src/main/java/atlantafx/sampler/page/OverlayDialog.java @@ -1,8 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.TITLE_4; + import atlantafx.base.controls.Spacer; import atlantafx.sampler.util.Containers; +import java.util.Objects; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.Label; @@ -13,10 +19,6 @@ import javafx.scene.layout.VBox; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.util.Objects; - -import static atlantafx.base.theme.Styles.*; - public abstract class OverlayDialog extends VBox { protected static final int CONTENT_CHILD_INDEX = 1; diff --git a/sampler/src/main/java/atlantafx/sampler/page/QuickConfigMenu.java b/sampler/src/main/java/atlantafx/sampler/page/QuickConfigMenu.java index 9ad8b24..6b36a6d 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/QuickConfigMenu.java +++ b/sampler/src/main/java/atlantafx/sampler/page/QuickConfigMenu.java @@ -1,9 +1,23 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.TEXT_CAPTION; +import static atlantafx.sampler.theme.ThemeManager.DEFAULT_ZOOM; +import static atlantafx.sampler.theme.ThemeManager.SUPPORTED_ZOOM; +import static javafx.geometry.Pos.CENTER_LEFT; +import static org.kordamp.ikonli.material2.Material2AL.ARROW_BACK; +import static org.kordamp.ikonli.material2.Material2AL.ARROW_FORWARD; + import atlantafx.base.controls.Spacer; import atlantafx.sampler.page.general.AccentColorSelector; import atlantafx.sampler.theme.ThemeManager; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.function.Consumer; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.IntegerProperty; @@ -23,18 +37,6 @@ import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.function.Consumer; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.theme.ThemeManager.DEFAULT_ZOOM; -import static atlantafx.sampler.theme.ThemeManager.SUPPORTED_ZOOM; -import static javafx.geometry.Pos.CENTER_LEFT; -import static org.kordamp.ikonli.material2.Material2AL.ARROW_BACK; -import static org.kordamp.ikonli.material2.Material2AL.ARROW_FORWARD; - // This should really be refactored to more generic control someday. // - the whole component to PopoverMenu, that reuses JavaFX MenuItem API // - font size switcher to flat SpinnerMenuItem diff --git a/sampler/src/main/java/atlantafx/sampler/page/SampleBlock.java b/sampler/src/main/java/atlantafx/sampler/page/SampleBlock.java index 44e5b45..4f6d72b 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/SampleBlock.java +++ b/sampler/src/main/java/atlantafx/sampler/page/SampleBlock.java @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page; +import java.util.Objects; +import java.util.Random; import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.control.Label; @@ -12,9 +14,6 @@ import javafx.scene.text.TextFlow; import net.datafaker.Faker; import org.kordamp.ikonli.feather.Feather; -import java.util.Objects; -import java.util.Random; - public class SampleBlock extends VBox { public static final int BLOCK_HGAP = 20; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java index 13b73e1..29aee26 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; + import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.Resources; @@ -22,10 +26,6 @@ import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; -import static atlantafx.base.theme.Styles.DENSE; -import static atlantafx.base.theme.Styles.toggleStyleClass; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; - public class AccordionPage extends AbstractPage { public static final String NAME = "Accordion"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ButtonPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ButtonPage.java index af837ad..813a01e 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ButtonPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ButtonPage.java @@ -1,6 +1,18 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.BUTTON_OUTLINED; +import static atlantafx.base.theme.Styles.DANGER; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.LARGE; +import static atlantafx.base.theme.Styles.ROUNDED; +import static atlantafx.base.theme.Styles.SMALL; +import static atlantafx.base.theme.Styles.SUCCESS; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; @@ -15,9 +27,6 @@ import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; - public class ButtonPage extends AbstractPage { public static final String NAME = "Button"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ChartPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ChartPage.java index 2d91d0e..e13f8c8 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ChartPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ChartPage.java @@ -5,17 +5,6 @@ import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import javafx.geometry.Pos; -import javafx.scene.chart.*; -import javafx.scene.control.ComboBox; -import javafx.scene.control.Label; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.HBox; -import javafx.scene.layout.VBox; -import javafx.util.StringConverter; - import java.time.Month; import java.time.format.TextStyle; import java.util.Arrays; @@ -23,6 +12,27 @@ import java.util.Locale; import java.util.Objects; import java.util.Optional; import java.util.stream.IntStream; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.geometry.Pos; +import javafx.scene.chart.AreaChart; +import javafx.scene.chart.BarChart; +import javafx.scene.chart.BubbleChart; +import javafx.scene.chart.CategoryAxis; +import javafx.scene.chart.Chart; +import javafx.scene.chart.LineChart; +import javafx.scene.chart.NumberAxis; +import javafx.scene.chart.PieChart; +import javafx.scene.chart.ScatterChart; +import javafx.scene.chart.StackedAreaChart; +import javafx.scene.chart.StackedBarChart; +import javafx.scene.chart.XYChart; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.util.StringConverter; public class ChartPage extends AbstractPage { diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ColorPickerPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ColorPickerPage.java index e7552d6..cc2c1ec 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ColorPickerPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ColorPickerPage.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.ToggleSwitch; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; @@ -13,9 +16,6 @@ import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class ColorPickerPage extends AbstractPage { public static final String NAME = "ColorPicker"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ComboBoxPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ComboBoxPage.java index 756144a..71e72b9 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ComboBoxPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ComboBoxPage.java @@ -1,9 +1,19 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.STATE_DANGER; +import static atlantafx.base.theme.Styles.STATE_SUCCESS; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static atlantafx.sampler.util.Containers.H_GROW_NEVER; +import static javafx.collections.FXCollections.observableArrayList; + import atlantafx.base.theme.Tweaks; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.IntStream; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.geometry.HPos; @@ -16,17 +26,6 @@ import javafx.scene.layout.VBox; import org.kordamp.ikonli.Ikon; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.STATE_DANGER; -import static atlantafx.base.theme.Styles.STATE_SUCCESS; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static atlantafx.sampler.util.Containers.H_GROW_NEVER; -import static javafx.collections.FXCollections.observableArrayList; - public class ComboBoxPage extends AbstractPage { public static final String NAME = "ComboBox"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/CustomTextFieldPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/CustomTextFieldPage.java index 9480f96..84a0c3d 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/CustomTextFieldPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/CustomTextFieldPage.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.STATE_DANGER; +import static atlantafx.base.theme.Styles.STATE_SUCCESS; + import atlantafx.base.controls.CustomTextField; import atlantafx.base.util.PasswordTextFormatter; import atlantafx.sampler.page.AbstractPage; @@ -10,9 +13,6 @@ import javafx.scene.layout.FlowPane; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.STATE_DANGER; -import static atlantafx.base.theme.Styles.STATE_SUCCESS; - public class CustomTextFieldPage extends AbstractPage { public static final String NAME = "CustomTextField"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java index 794fcf5..34a9a2f 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/DatePickerPage.java @@ -1,6 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static javafx.scene.layout.GridPane.REMAINING; + import atlantafx.base.controls.InlineDatePicker; import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; @@ -8,6 +13,12 @@ import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.CSSFragment; +import java.time.LocalDate; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.chrono.HijrahChronology; +import java.time.format.DateTimeFormatter; +import java.util.Objects; import javafx.animation.Animation; import javafx.animation.KeyFrame; import javafx.animation.Timeline; @@ -21,25 +32,17 @@ import javafx.scene.control.Button; import javafx.scene.control.DateCell; import javafx.scene.control.DatePicker; import javafx.scene.control.Label; -import javafx.scene.layout.*; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; import javafx.util.Callback; import javafx.util.Duration; import javafx.util.StringConverter; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.time.LocalDate; -import java.time.LocalTime; -import java.time.ZoneId; -import java.time.chrono.HijrahChronology; -import java.time.format.DateTimeFormatter; -import java.util.Objects; - -import static atlantafx.base.theme.Styles.BUTTON_ICON; -import static atlantafx.base.theme.Styles.FLAT; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static javafx.scene.layout.GridPane.REMAINING; - public class DatePickerPage extends AbstractPage { public static final String NAME = "DatePicker"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/DialogPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/DialogPage.java index 420405b..7d69dce 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/DialogPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/DialogPage.java @@ -1,27 +1,37 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; -import atlantafx.base.controls.ToggleSwitch; -import atlantafx.sampler.page.AbstractPage; -import atlantafx.sampler.page.SampleBlock; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.geometry.Orientation; -import javafx.geometry.Pos; -import javafx.scene.control.*; -import javafx.scene.layout.*; -import javafx.stage.StageStyle; -import org.kordamp.ikonli.feather.Feather; -import org.kordamp.ikonli.javafx.FontIcon; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; - import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; import static javafx.scene.control.Alert.AlertType; import static javafx.scene.control.ButtonBar.ButtonData; +import atlantafx.base.controls.ToggleSwitch; +import atlantafx.sampler.page.AbstractPage; +import atlantafx.sampler.page.SampleBlock; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.geometry.Orientation; +import javafx.geometry.Pos; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.ButtonType; +import javafx.scene.control.ChoiceDialog; +import javafx.scene.control.Label; +import javafx.scene.control.Separator; +import javafx.scene.control.TextArea; +import javafx.scene.control.TextInputDialog; +import javafx.scene.layout.FlowPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.stage.StageStyle; +import org.kordamp.ikonli.feather.Feather; +import org.kordamp.ikonli.javafx.FontIcon; + public class DialogPage extends AbstractPage { public static final String NAME = "Dialog"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/HTMLEditorPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/HTMLEditorPage.java index 46629bf..e79d7d3 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/HTMLEditorPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/HTMLEditorPage.java @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Theme; import atlantafx.sampler.event.DefaultEventBus; @@ -16,8 +18,6 @@ import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.scene.web.HTMLEditor; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class HTMLEditorPage extends AbstractPage { private static final PseudoClass USE_LOCAL_URL = PseudoClass.getPseudoClass("use-local-url"); diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/InputGroupPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/InputGroupPage.java index d4ec3ff..55b1bc4 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/components/InputGroupPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/InputGroupPage.java @@ -1,22 +1,28 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; import javafx.geometry.Pos; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.MenuButton; +import javafx.scene.control.MenuItem; +import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.BUTTON_ICON; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class InputGroupPage extends AbstractPage { public static final String NAME = "Input Group"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/LabelPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/LabelPage.java index 719e50f..a5983be 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/LabelPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/LabelPage.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; @@ -10,9 +13,6 @@ import javafx.scene.layout.VBox; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class LabelPage extends AbstractPage { public static final String NAME = "Label"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ListPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ListPage.java index c1d0d7f..5da2c5f 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ListPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ListPage.java @@ -1,14 +1,33 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BORDERED; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.STRIPED; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.fake.domain.Book; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.stream.Collectors; import javafx.geometry.Pos; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.Label; +import javafx.scene.control.ListCell; +import javafx.scene.control.ListView; import javafx.scene.control.cell.CheckBoxListCell; import javafx.scene.control.cell.ChoiceBoxListCell; import javafx.scene.control.cell.ComboBoxListCell; @@ -21,17 +40,6 @@ import javafx.util.StringConverter; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class ListPage extends AbstractPage { public static final String NAME = "ListView"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/MenuButtonPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/MenuButtonPage.java index 0899e8f..430dc77 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/components/MenuButtonPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/MenuButtonPage.java @@ -1,10 +1,20 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.BUTTON_OUTLINED; +import static atlantafx.base.theme.Styles.DANGER; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.SUCCESS; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.theme.Tweaks; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; +import java.util.stream.IntStream; import javafx.geometry.Side; import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; @@ -16,12 +26,6 @@ import javafx.scene.layout.VBox; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class MenuButtonPage extends AbstractPage { public static final String NAME = "MenuButton"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/MenuPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/MenuPage.java index b3eda4f..bf7b628 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/MenuPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/MenuPage.java @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static javafx.scene.input.KeyCombination.CONTROL_DOWN; + import atlantafx.base.theme.Styles; import atlantafx.sampler.fake.SampleMenuBar; import atlantafx.sampler.page.AbstractPage; @@ -16,8 +18,6 @@ import javafx.scene.input.KeyCodeCombination; import javafx.scene.layout.VBox; import org.kordamp.ikonli.feather.Feather; -import static javafx.scene.input.KeyCombination.CONTROL_DOWN; - public class MenuPage extends AbstractPage { public static final String NAME = "Menu"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java index 9098f0a..62065ab 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/OverviewPage.java @@ -1,13 +1,44 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.BUTTON_OUTLINED; +import static atlantafx.base.theme.Styles.DANGER; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.LEFT_PILL; +import static atlantafx.base.theme.Styles.RIGHT_PILL; +import static atlantafx.base.theme.Styles.SUCCESS; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.ProgressSliderSkin; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Tweaks; import atlantafx.base.util.IntegerStringConverter; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; -import javafx.scene.control.*; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.stream.IntStream; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ChoiceBox; +import javafx.scene.control.ColorPicker; +import javafx.scene.control.ComboBox; +import javafx.scene.control.DatePicker; +import javafx.scene.control.MenuButton; +import javafx.scene.control.MenuItem; +import javafx.scene.control.PasswordField; +import javafx.scene.control.RadioButton; +import javafx.scene.control.Slider; +import javafx.scene.control.Spinner; +import javafx.scene.control.SplitMenuButton; +import javafx.scene.control.TextArea; +import javafx.scene.control.TextField; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; @@ -16,14 +47,6 @@ import javafx.scene.shape.Circle; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class OverviewPage extends AbstractPage { public static final String NAME = "Overview"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/PaginationPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/PaginationPage.java index 144c509..2ebd3c2 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/PaginationPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/PaginationPage.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; @@ -14,9 +17,6 @@ import javafx.scene.layout.BorderPane; import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class PaginationPage extends AbstractPage { public static final String NAME = "Pagination"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java index 5a67086..553fa35 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/PopoverPage.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.InlineDatePicker; import atlantafx.base.controls.Popover; import atlantafx.base.controls.Popover.ArrowLocation; @@ -8,6 +11,8 @@ import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.CSSFragment; +import java.time.LocalDate; +import java.time.ZoneId; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; @@ -21,12 +26,6 @@ import javafx.scene.text.TextFlow; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.time.LocalDate; -import java.time.ZoneId; - -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class PopoverPage extends AbstractPage { public static final String NAME = "Popover"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ProgressPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ProgressPage.java index 79d251f..9009dea 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ProgressPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ProgressPage.java @@ -1,6 +1,15 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.LARGE; +import static atlantafx.base.theme.Styles.MEDIUM; +import static atlantafx.base.theme.Styles.SMALL; +import static atlantafx.base.theme.Styles.TITLE_4; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.RingProgressIndicator; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; @@ -12,17 +21,24 @@ import javafx.css.PseudoClass; import javafx.geometry.HPos; import javafx.geometry.Pos; import javafx.geometry.VPos; -import javafx.scene.control.*; -import javafx.scene.layout.*; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ProgressBar; +import javafx.scene.control.ProgressIndicator; +import javafx.scene.control.ToggleButton; +import javafx.scene.layout.ColumnConstraints; +import javafx.scene.layout.FlowPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.RowConstraints; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.util.StringConverter; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - // #javafx-bug Indeterminate (animated) progress bar and also progress indicator // are very resource expensive. It consumes a single CPU core and a lot of memory. public class ProgressPage extends AbstractPage { diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/RadioButtonPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/RadioButtonPage.java index 9117fe2..49ea629 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/RadioButtonPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/RadioButtonPage.java @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; @@ -9,8 +11,6 @@ import javafx.scene.control.ToggleGroup; import javafx.scene.layout.FlowPane; import javafx.scene.layout.VBox; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class RadioButtonPage extends AbstractPage { public static final String NAME = "RadioButton"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ScrollPanePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ScrollPanePage.java index 0d727fe..358a44e 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ScrollPanePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ScrollPanePage.java @@ -5,7 +5,11 @@ import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; import javafx.scene.control.ScrollPane; -import javafx.scene.layout.*; +import javafx.scene.layout.FlowPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; public class ScrollPanePage extends AbstractPage { diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/SeparatorPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/SeparatorPage.java index 5873d51..425a7cb 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/SeparatorPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/SeparatorPage.java @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static javafx.geometry.Orientation.HORIZONTAL; +import static javafx.geometry.Orientation.VERTICAL; +import static javafx.geometry.Pos.CENTER; + import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; @@ -8,11 +12,11 @@ import atlantafx.sampler.page.SampleBlock; import javafx.geometry.Orientation; import javafx.scene.control.Label; import javafx.scene.control.Separator; -import javafx.scene.layout.*; - -import static javafx.geometry.Orientation.HORIZONTAL; -import static javafx.geometry.Orientation.VERTICAL; -import static javafx.geometry.Pos.CENTER; +import javafx.scene.layout.FlowPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; public final class SeparatorPage extends AbstractPage { diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/SliderPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/SliderPage.java index c434a63..970a9b7 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/SliderPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/SliderPage.java @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static javafx.geometry.Orientation.VERTICAL; + import atlantafx.base.controls.ProgressSliderSkin; import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; @@ -11,8 +13,6 @@ import javafx.scene.layout.FlowPane; import javafx.scene.layout.GridPane; import javafx.scene.layout.Pane; -import static javafx.geometry.Orientation.VERTICAL; - public class SliderPage extends AbstractPage { public static final String NAME = "Slider"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TabPanePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TabPanePage.java index c532dd5..d9fc589 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TabPanePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TabPanePage.java @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static javafx.scene.control.TabPane.TabClosingPolicy.ALL_TABS; +import static javafx.scene.control.TabPane.TabClosingPolicy.UNAVAILABLE; + import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Styles; @@ -10,15 +17,21 @@ import javafx.application.Platform; import javafx.collections.ListChangeListener; import javafx.geometry.Pos; import javafx.geometry.Side; -import javafx.scene.control.*; -import javafx.scene.layout.*; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.Tab; +import javafx.scene.control.TabPane; +import javafx.scene.control.TitledPane; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.*; -import static javafx.scene.control.TabPane.TabClosingPolicy.ALL_TABS; -import static javafx.scene.control.TabPane.TabClosingPolicy.UNAVAILABLE; - public class TabPanePage extends AbstractPage { public static final String NAME = "TabPane"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java index 38a60d5..3a1a776 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TablePage.java @@ -1,6 +1,17 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BORDERED; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.STRIPED; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.base.theme.Tweaks.ALIGN_CENTER; +import static atlantafx.base.theme.Tweaks.ALIGN_LEFT; +import static atlantafx.base.theme.Tweaks.ALIGN_RIGHT; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static javafx.collections.FXCollections.observableArrayList; + import atlantafx.base.controls.CaptionMenuItem; import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; @@ -8,14 +19,33 @@ import atlantafx.base.theme.Tweaks; import atlantafx.sampler.fake.domain.Product; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.List; +import java.util.Objects; +import java.util.stream.IntStream; import javafx.beans.binding.Bindings; import javafx.beans.binding.StringBinding; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; import javafx.geometry.Pos; -import javafx.scene.control.*; -import javafx.scene.control.cell.*; +import javafx.scene.control.CheckMenuItem; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.MenuButton; +import javafx.scene.control.RadioMenuItem; +import javafx.scene.control.SelectionMode; +import javafx.scene.control.SeparatorMenuItem; +import javafx.scene.control.TableCell; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.cell.CheckBoxTableCell; +import javafx.scene.control.cell.ChoiceBoxTableCell; +import javafx.scene.control.cell.ComboBoxTableCell; +import javafx.scene.control.cell.ProgressBarTableCell; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.control.cell.TextFieldTableCell; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; @@ -24,16 +54,6 @@ import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.javafx.FontIconTableCell; -import java.util.List; -import java.util.Objects; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.base.theme.Tweaks.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static javafx.collections.FXCollections.observableArrayList; - public class TablePage extends AbstractPage { public static final String NAME = "TableView"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TextAreaPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TextAreaPage.java index 4ccaa50..ef6c56c 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TextAreaPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TextAreaPage.java @@ -1,17 +1,16 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; -import atlantafx.sampler.page.AbstractPage; -import atlantafx.sampler.page.SampleBlock; -import javafx.scene.control.TextArea; -import javafx.scene.layout.FlowPane; - -import java.util.stream.Collectors; -import java.util.stream.Stream; - import static atlantafx.base.theme.Styles.STATE_DANGER; import static atlantafx.base.theme.Styles.STATE_SUCCESS; +import atlantafx.sampler.page.AbstractPage; +import atlantafx.sampler.page.SampleBlock; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javafx.scene.control.TextArea; +import javafx.scene.layout.FlowPane; + public class TextAreaPage extends AbstractPage { public static final String NAME = "TextArea"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TextFieldPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TextFieldPage.java index 1d1a9fc..06fdbc1 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TextFieldPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TextFieldPage.java @@ -1,6 +1,13 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.LARGE; +import static atlantafx.base.theme.Styles.ROUNDED; +import static atlantafx.base.theme.Styles.SMALL; +import static atlantafx.base.theme.Styles.STATE_DANGER; +import static atlantafx.base.theme.Styles.STATE_SUCCESS; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; import javafx.geometry.Pos; @@ -9,9 +16,6 @@ import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; - public class TextFieldPage extends AbstractPage { public static final String NAME = "TextField"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TitledPanePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TitledPanePage.java index f485c0c..3cb0f4a 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TitledPanePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TitledPanePage.java @@ -1,6 +1,15 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.ELEVATED_2; +import static atlantafx.base.theme.Styles.INTERACTIVE; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static javafx.geometry.HPos.RIGHT; +import static javafx.scene.layout.Priority.NEVER; + import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Tweaks; @@ -11,16 +20,15 @@ import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.Slider; import javafx.scene.control.TitledPane; -import javafx.scene.layout.*; +import javafx.scene.layout.ColumnConstraints; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static javafx.geometry.HPos.RIGHT; -import static javafx.scene.layout.Priority.NEVER; - public class TitledPanePage extends AbstractPage { public static final String NAME = "TitledPane"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ToggleButtonPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ToggleButtonPage.java index 45254ce..dbd3e8b 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ToggleButtonPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ToggleButtonPage.java @@ -1,6 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.CENTER_PILL; +import static atlantafx.base.theme.Styles.LEFT_PILL; +import static atlantafx.base.theme.Styles.RIGHT_PILL; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.util.Controls.toggleButton; +import static javafx.scene.layout.GridPane.REMAINING; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; @@ -12,11 +20,6 @@ import javafx.scene.layout.HBox; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.util.Controls.toggleButton; -import static javafx.scene.layout.GridPane.REMAINING; - public class ToggleButtonPage extends AbstractPage { public static final String NAME = "ToggleButton"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/ToolBarPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/ToolBarPage.java index 2c5cec1..4ec46eb 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/ToolBarPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/ToolBarPage.java @@ -1,33 +1,57 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.BOTTOM; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.CENTER_PILL; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.LEFT; +import static atlantafx.base.theme.Styles.LEFT_PILL; +import static atlantafx.base.theme.Styles.RIGHT; +import static atlantafx.base.theme.Styles.RIGHT_PILL; +import static atlantafx.base.theme.Styles.TOP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static atlantafx.sampler.util.Controls.button; +import static atlantafx.sampler.util.Controls.iconButton; +import static atlantafx.sampler.util.Controls.toggleButton; +import static javafx.geometry.Orientation.HORIZONTAL; +import static javafx.geometry.Orientation.VERTICAL; + import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Styles; import atlantafx.sampler.fake.SampleMenuBar; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.ArrayList; +import java.util.stream.IntStream; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.geometry.Orientation; import javafx.geometry.Pos; import javafx.geometry.Side; import javafx.scene.Node; -import javafx.scene.control.*; -import javafx.scene.layout.*; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.MenuBar; +import javafx.scene.control.MenuButton; +import javafx.scene.control.MenuItem; +import javafx.scene.control.Separator; +import javafx.scene.control.TitledPane; +import javafx.scene.control.ToolBar; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; import javafx.scene.text.Font; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.ArrayList; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static atlantafx.sampler.util.Controls.*; -import static javafx.geometry.Orientation.HORIZONTAL; -import static javafx.geometry.Orientation.VERTICAL; - public class ToolBarPage extends AbstractPage { public static final String NAME = "ToolBar"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TooltipPage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TooltipPage.java index 91a4bb6..42fdad4 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TooltipPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TooltipPage.java @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static javafx.geometry.Orientation.VERTICAL; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.SampleBlock; @@ -14,10 +18,6 @@ import javafx.scene.layout.VBox; import javafx.stage.PopupWindow.AnchorLocation; import javafx.util.Duration; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static javafx.geometry.Orientation.VERTICAL; - public class TooltipPage extends AbstractPage { public static final String NAME = "Tooltip"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TreePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TreePage.java index 6710879..ac91cd0 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TreePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TreePage.java @@ -1,13 +1,27 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Supplier; import javafx.geometry.Pos; -import javafx.scene.control.*; +import javafx.scene.control.CheckBoxTreeItem; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.control.TreeItem; +import javafx.scene.control.TreeView; import javafx.scene.control.cell.CheckBoxTreeCell; import javafx.scene.control.cell.ChoiceBoxTreeCell; import javafx.scene.control.cell.ComboBoxTreeCell; @@ -20,17 +34,6 @@ import javafx.util.StringConverter; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Supplier; - -import static atlantafx.base.theme.Styles.DENSE; -import static atlantafx.base.theme.Styles.toggleStyleClass; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class TreePage extends AbstractPage { public static final String NAME = "TreeView"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java index 862e800..5108431 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TreeTablePage.java @@ -1,6 +1,16 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.components; +import static atlantafx.base.theme.Styles.BORDERED; +import static atlantafx.base.theme.Styles.DENSE; +import static atlantafx.base.theme.Styles.STRIPED; +import static atlantafx.base.theme.Styles.toggleStyleClass; +import static atlantafx.base.theme.Tweaks.ALIGN_CENTER; +import static atlantafx.base.theme.Tweaks.ALIGN_LEFT; +import static atlantafx.base.theme.Tweaks.ALIGN_RIGHT; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.controls.CaptionMenuItem; import atlantafx.base.controls.Spacer; import atlantafx.base.controls.ToggleSwitch; @@ -8,10 +18,26 @@ import atlantafx.base.theme.Tweaks; import atlantafx.sampler.fake.domain.Product; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; +import java.util.List; +import java.util.Objects; +import java.util.stream.IntStream; import javafx.beans.property.SimpleStringProperty; import javafx.geometry.Pos; -import javafx.scene.control.*; -import javafx.scene.control.cell.*; +import javafx.scene.control.CheckMenuItem; +import javafx.scene.control.MenuButton; +import javafx.scene.control.RadioMenuItem; +import javafx.scene.control.SelectionMode; +import javafx.scene.control.SeparatorMenuItem; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.TreeItem; +import javafx.scene.control.TreeTableColumn; +import javafx.scene.control.TreeTableView; +import javafx.scene.control.cell.CheckBoxTreeTableCell; +import javafx.scene.control.cell.ChoiceBoxTreeTableCell; +import javafx.scene.control.cell.ComboBoxTreeTableCell; +import javafx.scene.control.cell.TextFieldTreeTableCell; +import javafx.scene.control.cell.TreeItemPropertyValueFactory; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; @@ -19,15 +45,6 @@ import javafx.util.Callback; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.List; -import java.util.Objects; -import java.util.stream.IntStream; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.base.theme.Tweaks.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class TreeTablePage extends AbstractPage { public static final String NAME = "TreeTableView"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/AccentColorSelector.java b/sampler/src/main/java/atlantafx/sampler/page/general/AccentColorSelector.java index f15803e..2fd3191 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/AccentColorSelector.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/AccentColorSelector.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.FLAT; + import atlantafx.sampler.theme.AccentColor; import atlantafx.sampler.theme.ThemeManager; import atlantafx.sampler.util.JColorUtils; @@ -11,9 +14,6 @@ import javafx.scene.layout.Region; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import static atlantafx.base.theme.Styles.BUTTON_ICON; -import static atlantafx.base.theme.Styles.FLAT; - public class AccentColorSelector extends HBox { public AccentColorSelector() { diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ColorPalette.java b/sampler/src/main/java/atlantafx/sampler/page/general/ColorPalette.java index fb04864..771c71e 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ColorPalette.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ColorPalette.java @@ -1,7 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.sampler.util.Controls.hyperlink; + import atlantafx.base.theme.Styles; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.function.Consumer; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.beans.property.ReadOnlyObjectProperty; @@ -16,14 +23,6 @@ import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.util.Duration; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.function.Consumer; - -import static atlantafx.sampler.util.Controls.hyperlink; - class ColorPalette extends VBox { private final List blocks = new ArrayList<>(); diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ColorPaletteBlock.java b/sampler/src/main/java/atlantafx/sampler/page/general/ColorPaletteBlock.java index 6acba90..905a785 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ColorPaletteBlock.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ColorPaletteBlock.java @@ -1,10 +1,18 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.base.theme.Styles.TITLE_3; +import static atlantafx.sampler.page.general.ContrastChecker.LUMINANCE_THRESHOLD; +import static atlantafx.sampler.page.general.ContrastChecker.PASSED; +import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; +import static atlantafx.sampler.util.ContrastLevel.getContrastRatioOpacityAware; +import static atlantafx.sampler.util.JColorUtils.flattenColor; + import atlantafx.base.theme.Styles; import atlantafx.sampler.util.Containers; import atlantafx.sampler.util.ContrastLevel; import atlantafx.sampler.util.NodeUtils; +import java.util.function.Consumer; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.geometry.Insets; import javafx.scene.control.Label; @@ -15,15 +23,6 @@ import javafx.scene.text.Text; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.util.function.Consumer; - -import static atlantafx.base.theme.Styles.TITLE_3; -import static atlantafx.sampler.page.general.ContrastChecker.LUMINANCE_THRESHOLD; -import static atlantafx.sampler.page.general.ContrastChecker.PASSED; -import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; -import static atlantafx.sampler.util.ContrastLevel.getContrastRatioOpacityAware; -import static atlantafx.sampler.util.JColorUtils.flattenColor; - class ColorPaletteBlock extends VBox { private final String fgColorName; diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ColorScale.java b/sampler/src/main/java/atlantafx/sampler/page/general/ColorScale.java index 5a04619..6f18179 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ColorScale.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ColorScale.java @@ -2,6 +2,8 @@ package atlantafx.sampler.page.general; import atlantafx.base.theme.Styles; +import java.util.Arrays; +import java.util.List; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.beans.property.ReadOnlyObjectWrapper; @@ -15,9 +17,6 @@ import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.util.Duration; -import java.util.Arrays; -import java.util.List; - class ColorScale extends VBox { private final ReadOnlyObjectWrapper bgBaseColor = new ReadOnlyObjectWrapper<>(Color.WHITE); diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ColorScaleBlock.java b/sampler/src/main/java/atlantafx/sampler/page/general/ColorScaleBlock.java index ec1ffa3..f9301af 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ColorScaleBlock.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ColorScaleBlock.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; +import static atlantafx.sampler.util.JColorUtils.flattenColor; + import atlantafx.sampler.util.JColorUtils; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.geometry.Pos; @@ -8,9 +11,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; -import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; -import static atlantafx.sampler.util.JColorUtils.flattenColor; - class ColorScaleBlock extends VBox { private static final double BLOCK_WIDTH = 250; diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ContrastChecker.java b/sampler/src/main/java/atlantafx/sampler/page/general/ContrastChecker.java index d3d4d97..da68f08 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ContrastChecker.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ContrastChecker.java @@ -1,6 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.sampler.page.general.ColorPaletteBlock.validateColorName; +import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; +import static atlantafx.sampler.util.ContrastLevel.getContrastRatioOpacityAware; +import static atlantafx.sampler.util.JColorUtils.flattenColor; +import static atlantafx.sampler.util.JColorUtils.toHexWithAlpha; + import atlantafx.base.controls.CustomTextField; import atlantafx.base.controls.Spacer; import atlantafx.base.theme.Styles; @@ -9,6 +15,8 @@ import atlantafx.sampler.util.ContrastLevel; import atlantafx.sampler.util.JColor; import atlantafx.sampler.util.JColorUtils; import atlantafx.sampler.util.PlatformUtils; +import java.util.Map; +import java.util.Objects; import javafx.beans.binding.Bindings; import javafx.beans.binding.DoubleBinding; import javafx.beans.property.ReadOnlyObjectProperty; @@ -19,7 +27,12 @@ import javafx.collections.ObservableList; import javafx.css.PseudoClass; import javafx.geometry.Insets; import javafx.geometry.Pos; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.ContentDisplay; +import javafx.scene.control.ContextMenu; +import javafx.scene.control.Label; +import javafx.scene.control.MenuItem; +import javafx.scene.control.Slider; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; @@ -28,15 +41,6 @@ import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.util.Map; -import java.util.Objects; - -import static atlantafx.sampler.page.general.ColorPaletteBlock.validateColorName; -import static atlantafx.sampler.util.ContrastLevel.getColorLuminance; -import static atlantafx.sampler.util.ContrastLevel.getContrastRatioOpacityAware; -import static atlantafx.sampler.util.JColorUtils.flattenColor; -import static atlantafx.sampler.util.JColorUtils.toHexWithAlpha; - // Inspired by the https://colourcontrast.cc/ class ContrastChecker extends GridPane { diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/IconBrowser.java b/sampler/src/main/java/atlantafx/sampler/page/general/IconBrowser.java index 3572b70..1779a27 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/IconBrowser.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/IconBrowser.java @@ -1,18 +1,21 @@ package atlantafx.sampler.page.general; -import atlantafx.base.theme.Tweaks; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.scene.control.*; -import org.kordamp.ikonli.Ikon; -import org.kordamp.ikonli.javafx.FontIcon; +import static atlantafx.base.theme.Styles.TEXT_SMALL; +import atlantafx.base.theme.Tweaks; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Locale; - -import static atlantafx.base.theme.Styles.TEXT_SMALL; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.scene.control.ContentDisplay; +import javafx.scene.control.Label; +import javafx.scene.control.TableCell; +import javafx.scene.control.TableColumn; +import javafx.scene.control.TableView; +import org.kordamp.ikonli.Ikon; +import org.kordamp.ikonli.javafx.FontIcon; public class IconBrowser extends TableView> { diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/IconsPage.java b/sampler/src/main/java/atlantafx/sampler/page/general/IconsPage.java index 056a89c..9544e35 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/IconsPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/IconsPage.java @@ -1,11 +1,18 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static atlantafx.sampler.util.Controls.hyperlink; + import atlantafx.base.controls.CustomTextField; import atlantafx.base.theme.Styles; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.CSSFragment; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.layout.HBox; @@ -20,14 +27,6 @@ import org.kordamp.ikonli.material2.Material2AL; import org.kordamp.ikonli.material2.Material2MZ; import org.kordamp.ikonli.material2.Material2OutlinedAL; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; - -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static atlantafx.sampler.util.Controls.hyperlink; - public class IconsPage extends AbstractPage { public static final String NAME = "Icons"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java b/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java index e16dcb0..dac301a 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java @@ -1,6 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.sampler.event.ThemeEvent.EventType.COLOR_CHANGE; +import static atlantafx.sampler.event.ThemeEvent.EventType.THEME_ADD; +import static atlantafx.sampler.event.ThemeEvent.EventType.THEME_CHANGE; +import static atlantafx.sampler.event.ThemeEvent.EventType.THEME_REMOVE; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static atlantafx.sampler.util.Controls.hyperlink; + import atlantafx.base.theme.Styles; import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.ThemeEvent; @@ -8,6 +16,9 @@ import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.Page; import atlantafx.sampler.theme.SamplerTheme; import atlantafx.sampler.theme.ThemeManager; +import java.net.URI; +import java.util.Objects; +import java.util.function.Consumer; import javafx.geometry.HPos; import javafx.scene.control.Button; import javafx.scene.control.ChoiceBox; @@ -22,15 +33,6 @@ import javafx.util.StringConverter; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2OutlinedMZ; -import java.net.URI; -import java.util.Objects; -import java.util.function.Consumer; - -import static atlantafx.sampler.event.ThemeEvent.EventType.*; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static atlantafx.sampler.util.Controls.hyperlink; - @SuppressWarnings("UnnecessaryLambda") public class ThemePage extends AbstractPage { diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManager.java b/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManager.java index 8c50523..cb4134b 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManager.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManager.java @@ -1,11 +1,25 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.DANGER; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.TEXT_SMALL; +import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; +import static javafx.scene.layout.Priority.ALWAYS; + import atlantafx.base.controls.Spacer; import atlantafx.sampler.theme.SamplerTheme; import atlantafx.sampler.theme.ThemeManager; import atlantafx.sampler.theme.ThemeRepository; import atlantafx.sampler.util.Containers; +import java.io.File; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.function.Consumer; import javafx.concurrent.Task; import javafx.css.PseudoClass; import javafx.geometry.Pos; @@ -19,17 +33,6 @@ import javafx.scene.text.Text; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2OutlinedAL; -import java.io.File; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.function.Consumer; - -import static atlantafx.base.theme.Styles.*; -import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; -import static javafx.scene.layout.Priority.ALWAYS; - @SuppressWarnings("UnnecessaryLambda") class ThemeRepoManager extends VBox { diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManagerDialog.java b/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManagerDialog.java index 047faea..e5b92ed 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManagerDialog.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ThemeRepoManagerDialog.java @@ -3,6 +3,7 @@ package atlantafx.sampler.page.general; import atlantafx.base.theme.Styles; import atlantafx.sampler.page.OverlayDialog; +import java.io.File; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.stage.FileChooser; @@ -10,8 +11,6 @@ import javafx.stage.FileChooser.ExtensionFilter; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2MZ; -import java.io.File; - class ThemeRepoManagerDialog extends OverlayDialog { private final ThemeRepoManager repoManager = new ThemeRepoManager(); diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java b/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java index af3f782..45a511d 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/TypographyPage.java @@ -1,11 +1,41 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.general; +import static atlantafx.base.theme.Styles.ACCENT; +import static atlantafx.base.theme.Styles.DANGER; +import static atlantafx.base.theme.Styles.SUCCESS; +import static atlantafx.base.theme.Styles.TEXT; +import static atlantafx.base.theme.Styles.TEXT_BOLD; +import static atlantafx.base.theme.Styles.TEXT_BOLDER; +import static atlantafx.base.theme.Styles.TEXT_CAPTION; +import static atlantafx.base.theme.Styles.TEXT_ITALIC; +import static atlantafx.base.theme.Styles.TEXT_LIGHTER; +import static atlantafx.base.theme.Styles.TEXT_MUTED; +import static atlantafx.base.theme.Styles.TEXT_NORMAL; +import static atlantafx.base.theme.Styles.TEXT_OBLIQUE; +import static atlantafx.base.theme.Styles.TEXT_SMALL; +import static atlantafx.base.theme.Styles.TEXT_STRIKETHROUGH; +import static atlantafx.base.theme.Styles.TEXT_SUBTLE; +import static atlantafx.base.theme.Styles.TEXT_UNDERLINED; +import static atlantafx.base.theme.Styles.TITLE_1; +import static atlantafx.base.theme.Styles.TITLE_2; +import static atlantafx.base.theme.Styles.TITLE_3; +import static atlantafx.base.theme.Styles.TITLE_4; +import static atlantafx.base.theme.Styles.WARNING; +import static atlantafx.sampler.event.ThemeEvent.EventType.FONT_CHANGE; +import static atlantafx.sampler.event.ThemeEvent.EventType.THEME_CHANGE; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; +import static atlantafx.sampler.theme.ThemeManager.DEFAULT_FONT_FAMILY_NAME; +import static atlantafx.sampler.theme.ThemeManager.SUPPORTED_FONT_SIZE; + import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.ThemeEvent; import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.ThemeManager; +import java.util.Map; +import java.util.stream.Collectors; import javafx.animation.KeyFrame; import javafx.animation.Timeline; import javafx.collections.FXCollections; @@ -16,23 +46,16 @@ import javafx.scene.control.ComboBox; import javafx.scene.control.Hyperlink; import javafx.scene.control.Label; import javafx.scene.control.Spinner; -import javafx.scene.layout.*; +import javafx.scene.layout.FlowPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.util.Duration; -import java.util.Map; -import java.util.stream.Collectors; - -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.event.ThemeEvent.EventType.FONT_CHANGE; -import static atlantafx.sampler.event.ThemeEvent.EventType.THEME_CHANGE; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; -import static atlantafx.sampler.theme.ThemeManager.DEFAULT_FONT_FAMILY_NAME; -import static atlantafx.sampler.theme.ThemeManager.SUPPORTED_FONT_SIZE; - public class TypographyPage extends AbstractPage { public static final String NAME = "Typography"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/ShowcasePage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/ShowcasePage.java index f9f02c6..950d75e 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/ShowcasePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/ShowcasePage.java @@ -1,5 +1,7 @@ package atlantafx.sampler.page.showcase; +import static atlantafx.base.theme.Styles.ACCENT; + import atlantafx.sampler.page.AbstractPage; import atlantafx.sampler.util.NodeUtils; import javafx.css.PseudoClass; @@ -16,8 +18,6 @@ import javafx.stage.StageStyle; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.theme.Styles.ACCENT; - public abstract class ShowcasePage extends AbstractPage { protected static final PseudoClass SHOWCASE_MODE = PseudoClass.getPseudoClass("showcase-mode"); diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Bookmark.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Bookmark.java index c720285..9cde81f 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Bookmark.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Bookmark.java @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; +import java.nio.file.Path; import org.kordamp.ikonli.Ikon; -import java.nio.file.Path; - record Bookmark(String title, Path path, Ikon icon) { } diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/BookmarkList.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/BookmarkList.java index 02ed72b..caf1ca1 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/BookmarkList.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/BookmarkList.java @@ -1,5 +1,9 @@ package atlantafx.sampler.page.showcase.filemanager; +import static atlantafx.sampler.page.showcase.filemanager.Model.USER_HOME; + +import java.nio.file.Files; +import java.nio.file.Path; import javafx.scene.control.Alert; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; @@ -7,11 +11,6 @@ import javafx.scene.input.MouseEvent; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.nio.file.Files; -import java.nio.file.Path; - -import static atlantafx.sampler.page.showcase.filemanager.Model.USER_HOME; - final class BookmarkList extends ListView { public BookmarkList(Model model) { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/DirectoryView.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/DirectoryView.java index 7ceabae..9233e84 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/DirectoryView.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/DirectoryView.java @@ -1,10 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; -import javafx.scene.layout.Pane; - import java.nio.file.Path; import java.util.function.Consumer; +import javafx.scene.layout.Pane; interface DirectoryView { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileIconRepository.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileIconRepository.java index ec60af9..eaa5cb5 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileIconRepository.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileIconRepository.java @@ -2,12 +2,11 @@ package atlantafx.sampler.page.showcase.filemanager; import atlantafx.sampler.Resources; -import javafx.scene.image.Image; - import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import javafx.scene.image.Image; final class FileIconRepository { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileList.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileList.java index 8318001..96ad0d2 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileList.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileList.java @@ -1,6 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; +import static atlantafx.sampler.page.showcase.filemanager.Utils.isFileHidden; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Comparator; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javafx.beans.binding.Bindings; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; @@ -10,15 +18,6 @@ import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; import javafx.scene.control.TableView; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Comparator; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static atlantafx.sampler.page.showcase.filemanager.Utils.isFileHidden; - final class FileList { static final Comparator FILE_TYPE_COMPARATOR = diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileManagerPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileManagerPage.java index 6e5cbeb..03e90d3 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileManagerPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/FileManagerPage.java @@ -1,16 +1,38 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; +import static atlantafx.base.theme.Styles.BUTTON_ICON; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.sampler.page.showcase.filemanager.FileList.PREDICATE_ANY; +import static atlantafx.sampler.page.showcase.filemanager.FileList.PREDICATE_NOT_HIDDEN; +import static atlantafx.sampler.page.showcase.filemanager.Utils.openFile; +import static atlantafx.sampler.util.Controls.hyperlink; +import static atlantafx.sampler.util.Controls.iconButton; + import atlantafx.base.controls.Breadcrumbs; import atlantafx.base.controls.Breadcrumbs.BreadCrumbItem; import atlantafx.base.controls.Spacer; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.page.showcase.ShowcasePage; import atlantafx.sampler.util.Containers; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; -import javafx.scene.control.*; +import javafx.scene.control.Button; +import javafx.scene.control.ButtonBase; +import javafx.scene.control.CheckMenuItem; +import javafx.scene.control.Label; +import javafx.scene.control.MenuButton; +import javafx.scene.control.MenuItem; +import javafx.scene.control.SplitPane; +import javafx.scene.control.ToolBar; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; @@ -21,22 +43,6 @@ import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; import org.kordamp.ikonli.material2.Material2MZ; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -import static atlantafx.base.theme.Styles.BUTTON_ICON; -import static atlantafx.base.theme.Styles.FLAT; -import static atlantafx.sampler.page.showcase.filemanager.FileList.PREDICATE_ANY; -import static atlantafx.sampler.page.showcase.filemanager.FileList.PREDICATE_NOT_HIDDEN; -import static atlantafx.sampler.page.showcase.filemanager.Utils.openFile; -import static atlantafx.sampler.util.Controls.hyperlink; -import static atlantafx.sampler.util.Controls.iconButton; - public class FileManagerPage extends ShowcasePage { public static final String NAME = "File Manager"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Model.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Model.java index be7d614..13cd036 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Model.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Model.java @@ -1,12 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; -import javafx.beans.property.ReadOnlyObjectProperty; -import javafx.beans.property.ReadOnlyObjectWrapper; - import java.nio.file.Path; import java.nio.file.Paths; import java.util.Objects; +import javafx.beans.property.ReadOnlyObjectProperty; +import javafx.beans.property.ReadOnlyObjectWrapper; final class Model { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/NavigationHistory.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/NavigationHistory.java index 9fa09aa..99f0b7c 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/NavigationHistory.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/NavigationHistory.java @@ -1,16 +1,15 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; -import javafx.beans.binding.Bindings; -import javafx.beans.binding.BooleanBinding; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.SimpleIntegerProperty; - import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.Optional; +import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanBinding; +import javafx.beans.property.IntegerProperty; +import javafx.beans.property.SimpleIntegerProperty; final class NavigationHistory { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/RightClickMenu.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/RightClickMenu.java index 88e24eb..1659de9 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/RightClickMenu.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/RightClickMenu.java @@ -1,14 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; +import static javafx.scene.input.KeyCombination.CONTROL_DOWN; + import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; -import static javafx.scene.input.KeyCombination.CONTROL_DOWN; - final class RightClickMenu extends ContextMenu { public RightClickMenu() { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/TableDirectoryView.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/TableDirectoryView.java index f357d0d..5e15408 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/TableDirectoryView.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/TableDirectoryView.java @@ -1,10 +1,24 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; +import static atlantafx.sampler.page.showcase.filemanager.Utils.fileMTime; +import static atlantafx.sampler.page.showcase.filemanager.Utils.fileSize; +import static atlantafx.sampler.page.showcase.filemanager.Utils.isFileHidden; +import static atlantafx.sampler.util.HumanReadableFormat.byteCount; +import static java.nio.file.LinkOption.NOFOLLOW_LINKS; +import static javafx.scene.control.TableColumn.SortType.ASCENDING; + import atlantafx.base.theme.Styles; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.util.Containers; import atlantafx.sampler.util.HumanReadableFormat; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.FileTime; +import java.time.ZoneId; +import java.util.Comparator; +import java.util.function.Consumer; +import java.util.stream.Stream; import javafx.beans.property.SimpleLongProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; @@ -18,19 +32,6 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.Pane; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.FileTime; -import java.time.ZoneId; -import java.util.Comparator; -import java.util.function.Consumer; -import java.util.stream.Stream; - -import static atlantafx.sampler.page.showcase.filemanager.Utils.*; -import static atlantafx.sampler.util.HumanReadableFormat.byteCount; -import static java.nio.file.LinkOption.NOFOLLOW_LINKS; -import static javafx.scene.control.TableColumn.SortType.ASCENDING; - final class TableDirectoryView extends AnchorPane implements DirectoryView { private static final PseudoClass HIDDEN = PseudoClass.getPseudoClass("hidden"); diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Utils.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Utils.java index eb2ce66..cbc1d4a 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Utils.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/filemanager/Utils.java @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.filemanager; -import java.awt.*; +import java.awt.Desktop; import java.io.IOException; import java.nio.file.Files; import java.nio.file.LinkOption; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/ColorThief.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/ColorThief.java index 5cfcf1c..02ad42a 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/ColorThief.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/ColorThief.java @@ -9,13 +9,17 @@ */ package atlantafx.sampler.page.showcase.musicplayer; -import java.awt.image.BufferedImage; -import java.awt.image.DataBufferByte; -import java.util.*; - import static java.awt.image.BufferedImage.TYPE_3BYTE_BGR; import static java.awt.image.BufferedImage.TYPE_4BYTE_ABGR; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferByte; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + @SuppressWarnings({"unused", "NarrowingCompoundAssignment"}) final class ColorThief { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MediaFile.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MediaFile.java index 73a8508..7d3cab2 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MediaFile.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MediaFile.java @@ -1,18 +1,19 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; -import atlantafx.sampler.Resources; -import javafx.scene.image.Image; -import javafx.scene.media.Media; -import javafx.scene.media.MediaPlayer; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_ALBUM; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_ARTIST; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_TITLE; +import static atlantafx.sampler.page.showcase.musicplayer.Utils.copyImage; +import atlantafx.sampler.Resources; import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; - -import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.*; -import static atlantafx.sampler.page.showcase.musicplayer.Utils.copyImage; +import javafx.scene.image.Image; +import javafx.scene.media.Media; +import javafx.scene.media.MediaPlayer; @SuppressWarnings("StringOperationCanBeSimplified") record MediaFile(File file) { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/Model.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/Model.java index 89079f8..ca9e31e 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/Model.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/Model.java @@ -1,14 +1,16 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; +import java.util.Objects; import javafx.beans.binding.Bindings; -import javafx.beans.property.*; +import javafx.beans.property.ReadOnlyBooleanProperty; +import javafx.beans.property.ReadOnlyBooleanWrapper; +import javafx.beans.property.ReadOnlyObjectProperty; +import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.paint.Color; -import java.util.Objects; - final class Model { private final ObservableList playlist = FXCollections.observableArrayList(); diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MusicPlayerPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MusicPlayerPage.java index eee3e4a..a508def 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MusicPlayerPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/MusicPlayerPage.java @@ -1,7 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; +import static atlantafx.sampler.util.Controls.hyperlink; + import atlantafx.sampler.page.showcase.ShowcasePage; +import java.net.URI; +import java.util.Objects; +import java.util.Set; import javafx.collections.ListChangeListener; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -9,12 +14,6 @@ import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.text.Text; -import java.net.URI; -import java.util.Objects; -import java.util.Set; - -import static atlantafx.sampler.util.Controls.hyperlink; - public class MusicPlayerPage extends ShowcasePage { public static final String NAME = "Music Player"; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerPane.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerPane.java index 97553c8..f2545d3 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerPane.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerPane.java @@ -1,6 +1,30 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; +import static atlantafx.base.controls.Popover.ArrowLocation; +import static atlantafx.base.theme.Styles.BUTTON_CIRCLE; +import static atlantafx.base.theme.Styles.SMALL; +import static atlantafx.base.theme.Styles.TEXT_SMALL; +import static atlantafx.base.theme.Styles.TITLE_3; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_ALBUM; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_ARTIST; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_IMAGE; +import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_TITLE; +import static atlantafx.sampler.page.showcase.musicplayer.Utils.formatDuration; +import static atlantafx.sampler.page.showcase.musicplayer.Utils.getDominantColor; +import static java.lang.Double.MAX_VALUE; +import static javafx.geometry.Orientation.VERTICAL; +import static javafx.geometry.Pos.CENTER; +import static org.kordamp.ikonli.material2.Material2AL.CLEAR_ALL; +import static org.kordamp.ikonli.material2.Material2AL.EQUALS; +import static org.kordamp.ikonli.material2.Material2MZ.PAUSE; +import static org.kordamp.ikonli.material2.Material2MZ.PLAY_ARROW; +import static org.kordamp.ikonli.material2.Material2MZ.SHUFFLE; +import static org.kordamp.ikonli.material2.Material2MZ.VOLUME_OFF; +import static org.kordamp.ikonli.material2.Material2MZ.VOLUME_UP; +import static org.kordamp.ikonli.material2.Material2OutlinedAL.FAST_FORWARD; +import static org.kordamp.ikonli.material2.Material2OutlinedAL.FAST_REWIND; + import atlantafx.base.controls.Popover; import atlantafx.base.controls.ProgressSliderSkin; import atlantafx.base.controls.Spacer; @@ -24,20 +48,6 @@ import javafx.scene.shape.Rectangle; import javafx.util.Duration; import org.kordamp.ikonli.javafx.FontIcon; -import static atlantafx.base.controls.Popover.ArrowLocation; -import static atlantafx.base.theme.Styles.*; -import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.*; -import static atlantafx.sampler.page.showcase.musicplayer.Utils.formatDuration; -import static atlantafx.sampler.page.showcase.musicplayer.Utils.getDominantColor; -import static java.lang.Double.MAX_VALUE; -import static javafx.geometry.Orientation.VERTICAL; -import static javafx.geometry.Pos.CENTER; -import static org.kordamp.ikonli.material2.Material2AL.CLEAR_ALL; -import static org.kordamp.ikonli.material2.Material2AL.EQUALS; -import static org.kordamp.ikonli.material2.Material2MZ.*; -import static org.kordamp.ikonli.material2.Material2OutlinedAL.FAST_FORWARD; -import static org.kordamp.ikonli.material2.Material2OutlinedAL.FAST_REWIND; - final class PlayerPane extends VBox { private static final int PANEL_MAX_WIDTH = 220; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerScreen.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerScreen.java index 9dc47d4..be3b793 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerScreen.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlayerScreen.java @@ -1,12 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; -import javafx.scene.control.SplitPane; -import javafx.scene.paint.Color; +import static atlantafx.sampler.util.JColorUtils.toHexWithAlpha; import java.util.Objects; - -import static atlantafx.sampler.util.JColorUtils.toHexWithAlpha; +import javafx.scene.control.SplitPane; +import javafx.scene.paint.Color; final class PlayerScreen extends SplitPane { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlaylistPane.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlaylistPane.java index 5c6d603..5dacbee 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlaylistPane.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/PlaylistPane.java @@ -1,26 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; -import atlantafx.base.controls.Spacer; -import atlantafx.base.theme.Tweaks; -import javafx.application.Platform; -import javafx.collections.ListChangeListener; -import javafx.concurrent.Task; -import javafx.css.PseudoClass; -import javafx.geometry.Insets; -import javafx.scene.control.*; -import javafx.scene.layout.HBox; -import javafx.scene.layout.VBox; -import javafx.scene.paint.ImagePattern; -import javafx.scene.shape.Rectangle; -import javafx.stage.FileChooser; -import org.kordamp.ikonli.javafx.FontIcon; - -import java.io.File; -import java.util.List; -import java.util.Objects; - -import static atlantafx.base.theme.Styles.*; +import static atlantafx.base.theme.Styles.FLAT; +import static atlantafx.base.theme.Styles.SMALL; +import static atlantafx.base.theme.Styles.TEXT_CAPTION; +import static atlantafx.base.theme.Styles.TEXT_SMALL; import static atlantafx.sampler.page.showcase.musicplayer.MediaFile.Metadata.NO_IMAGE_ALT; import static atlantafx.sampler.page.showcase.musicplayer.MusicPlayerPage.SUPPORTED_MEDIA_TYPES; import static java.lang.Double.MAX_VALUE; @@ -30,6 +14,28 @@ import static javafx.stage.FileChooser.ExtensionFilter; import static org.kordamp.ikonli.material2.Material2AL.ADD; import static org.kordamp.ikonli.material2.Material2MZ.PLAYLIST_PLAY; +import atlantafx.base.controls.Spacer; +import atlantafx.base.theme.Tweaks; +import java.io.File; +import java.util.List; +import java.util.Objects; +import javafx.application.Platform; +import javafx.collections.ListChangeListener; +import javafx.concurrent.Task; +import javafx.css.PseudoClass; +import javafx.geometry.Insets; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ListCell; +import javafx.scene.control.ListView; +import javafx.scene.control.ProgressBar; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.scene.paint.ImagePattern; +import javafx.scene.shape.Rectangle; +import javafx.stage.FileChooser; +import org.kordamp.ikonli.javafx.FontIcon; + final class PlaylistPane extends VBox { private final Model model; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/StartScreen.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/StartScreen.java index 478d3ae..ed92b8c 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/StartScreen.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/musicplayer/StartScreen.java @@ -1,7 +1,14 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.musicplayer; +import static atlantafx.sampler.page.showcase.musicplayer.MusicPlayerPage.SUPPORTED_MEDIA_TYPES; + import atlantafx.base.theme.Styles; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Stream; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; @@ -16,14 +23,6 @@ import javafx.stage.FileChooser.ExtensionFilter; import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Stream; - -import static atlantafx.sampler.page.showcase.musicplayer.MusicPlayerPage.SUPPORTED_MEDIA_TYPES; - final class StartScreen extends BorderPane { private final Model model; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/CardSample.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/CardSample.java index e83f090..9e197b5 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/CardSample.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/CardSample.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.widget; +import static atlantafx.sampler.page.Page.PAGE_HGAP; +import static atlantafx.sampler.page.Page.PAGE_VGAP; + import atlantafx.base.theme.Styles; import atlantafx.sampler.Resources; import atlantafx.sampler.theme.CSSFragment; @@ -21,9 +24,6 @@ import net.datafaker.Faker; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import static atlantafx.sampler.page.Page.PAGE_HGAP; -import static atlantafx.sampler.page.Page.PAGE_VGAP; - public class CardSample extends HBox { private static final Faker FAKER = new Faker(); diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Message.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Message.java index a3b4c43..a526a96 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Message.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Message.java @@ -2,6 +2,8 @@ package atlantafx.sampler.page.showcase.widget; import atlantafx.base.theme.Styles; +import java.util.Objects; +import java.util.function.Consumer; import javafx.animation.FadeTransition; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -14,9 +16,6 @@ import javafx.util.Duration; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import java.util.Objects; -import java.util.function.Consumer; - public class Message extends StackPane { private static final int ANIMATION_DURATION = 500; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/MessageSample.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/MessageSample.java index fefc05b..27596dd 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/MessageSample.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/MessageSample.java @@ -3,13 +3,12 @@ package atlantafx.sampler.page.showcase.widget; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.CSSFragment; +import java.util.function.Consumer; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; -import java.util.function.Consumer; - public class MessageSample extends SampleBlock { public MessageSample() { diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Stepper.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Stepper.java index 6da7488..2fc7ea2 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Stepper.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Stepper.java @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.widget; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.BooleanProperty; @@ -19,11 +23,6 @@ import javafx.scene.layout.Priority; import org.kordamp.ikonli.Ikon; import org.kordamp.ikonli.javafx.FontIcon; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - public class Stepper extends HBox { public static final String CSS = """ diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Tag.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Tag.java index 60eae0f..b785398 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Tag.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/Tag.java @@ -1,12 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.widget; +import static javafx.scene.control.ContentDisplay.RIGHT; + import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.layout.Pane; -import static javafx.scene.control.ContentDisplay.RIGHT; - public class Tag extends Button { public static final String CSS = """ diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/TagSample.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/TagSample.java index a531aec..46bcd05 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/TagSample.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/TagSample.java @@ -1,6 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.page.showcase.widget; +import static atlantafx.sampler.page.Page.PAGE_HGAP; +import static atlantafx.sampler.page.Page.PAGE_VGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; +import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; + import atlantafx.base.theme.Styles; import atlantafx.sampler.page.SampleBlock; import atlantafx.sampler.theme.CSSFragment; @@ -11,11 +16,6 @@ import org.kordamp.ikonli.feather.Feather; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.material2.Material2AL; -import static atlantafx.sampler.page.Page.PAGE_HGAP; -import static atlantafx.sampler.page.Page.PAGE_VGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_HGAP; -import static atlantafx.sampler.page.SampleBlock.BLOCK_VGAP; - public class TagSample extends GridPane { private static final int PREF_WIDTH = 300; diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java index ea5dd30..cf21fa9 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/widget/WidgetCollectionPage.java @@ -4,6 +4,7 @@ package atlantafx.sampler.page.showcase.widget; import atlantafx.base.theme.Styles; import atlantafx.base.theme.Tweaks; import atlantafx.sampler.page.Page; +import java.util.function.Supplier; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Parent; @@ -13,8 +14,6 @@ import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; -import java.util.function.Supplier; - // JavaFX Skin API is very complex and almost undocumented. In many cases it's much simpler // to create a small widget that just do the job than wasting hours to debug control behaviour. // Consider this as a cookbook of those widgets. diff --git a/sampler/src/main/java/atlantafx/sampler/theme/CSSFragment.java b/sampler/src/main/java/atlantafx/sampler/theme/CSSFragment.java index bf3fe93..40a9484 100644 --- a/sampler/src/main/java/atlantafx/sampler/theme/CSSFragment.java +++ b/sampler/src/main/java/atlantafx/sampler/theme/CSSFragment.java @@ -1,12 +1,11 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.theme; -import javafx.scene.layout.Region; +import static java.nio.charset.StandardCharsets.UTF_8; import java.util.Base64; import java.util.Objects; - -import static java.nio.charset.StandardCharsets.UTF_8; +import javafx.scene.layout.Region; public final class CSSFragment { diff --git a/sampler/src/main/java/atlantafx/sampler/theme/SamplerTheme.java b/sampler/src/main/java/atlantafx/sampler/theme/SamplerTheme.java index 562d4f8..23e1443 100644 --- a/sampler/src/main/java/atlantafx/sampler/theme/SamplerTheme.java +++ b/sampler/src/main/java/atlantafx/sampler/theme/SamplerTheme.java @@ -1,28 +1,34 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.theme; +import static atlantafx.sampler.Launcher.IS_DEV_MODE; +import static atlantafx.sampler.Resources.resolve; +import static atlantafx.sampler.theme.ThemeManager.APP_STYLESHEETS; +import static atlantafx.sampler.theme.ThemeManager.DUMMY_STYLESHEET; +import static atlantafx.sampler.theme.ThemeManager.PROJECT_THEMES; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.nio.file.LinkOption.NOFOLLOW_LINKS; + import atlantafx.base.theme.Theme; import atlantafx.sampler.FileResource; import atlantafx.sampler.Launcher; import atlantafx.sampler.Resources; import fr.brouillard.oss.cssfx.CSSFX; -import javafx.application.Application; -import javafx.scene.Scene; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.attribute.FileTime; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; - -import static atlantafx.sampler.Launcher.IS_DEV_MODE; -import static atlantafx.sampler.Resources.resolve; -import static atlantafx.sampler.theme.ThemeManager.*; -import static java.nio.charset.StandardCharsets.UTF_8; -import static java.nio.file.LinkOption.NOFOLLOW_LINKS; +import javafx.application.Application; +import javafx.scene.Scene; /** * The {@link Theme} decorator to work around some JavaFX CSS limitations. diff --git a/sampler/src/main/java/atlantafx/sampler/theme/ThemeManager.java b/sampler/src/main/java/atlantafx/sampler/theme/ThemeManager.java index 2c55d99..0d917a7 100644 --- a/sampler/src/main/java/atlantafx/sampler/theme/ThemeManager.java +++ b/sampler/src/main/java/atlantafx/sampler/theme/ThemeManager.java @@ -1,25 +1,35 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.theme; -import atlantafx.base.theme.*; +import static atlantafx.sampler.Resources.getResource; +import static java.nio.charset.StandardCharsets.UTF_8; + +import atlantafx.base.theme.NordDark; +import atlantafx.base.theme.NordLight; +import atlantafx.base.theme.PrimerDark; +import atlantafx.base.theme.PrimerLight; +import atlantafx.base.theme.Theme; import atlantafx.sampler.Resources; import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.EventBus; import atlantafx.sampler.event.ThemeEvent; import atlantafx.sampler.event.ThemeEvent.EventType; import atlantafx.sampler.util.JColor; +import java.util.Base64; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.IntStream; import javafx.application.Application; import javafx.css.PseudoClass; import javafx.scene.Scene; import javafx.scene.paint.Color; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import static atlantafx.sampler.Resources.getResource; -import static java.nio.charset.StandardCharsets.UTF_8; - public final class ThemeManager { static final String DUMMY_STYLESHEET = getResource("assets/styles/empty.css").toString(); diff --git a/sampler/src/main/java/atlantafx/sampler/theme/ThemeRepository.java b/sampler/src/main/java/atlantafx/sampler/theme/ThemeRepository.java index 9747a47..fdbc89f 100644 --- a/sampler/src/main/java/atlantafx/sampler/theme/ThemeRepository.java +++ b/sampler/src/main/java/atlantafx/sampler/theme/ThemeRepository.java @@ -1,23 +1,30 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.theme; -import atlantafx.base.theme.*; +import static java.nio.file.LinkOption.NOFOLLOW_LINKS; + +import atlantafx.base.theme.NordDark; +import atlantafx.base.theme.NordLight; +import atlantafx.base.theme.PrimerDark; +import atlantafx.base.theme.PrimerLight; +import atlantafx.base.theme.Theme; import atlantafx.sampler.Resources; import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.ThemeEvent; import atlantafx.sampler.event.ThemeEvent.EventType; - import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Objects; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; import java.util.stream.Collectors; -import static java.nio.file.LinkOption.NOFOLLOW_LINKS; - public final class ThemeRepository { private static final Comparator THEME_COMPARATOR = Comparator.comparing(SamplerTheme::getName); diff --git a/sampler/src/main/java/atlantafx/sampler/util/Containers.java b/sampler/src/main/java/atlantafx/sampler/util/Containers.java index 73ce1ac..4d98543 100755 --- a/sampler/src/main/java/atlantafx/sampler/util/Containers.java +++ b/sampler/src/main/java/atlantafx/sampler/util/Containers.java @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.util; +import static javafx.scene.layout.Region.USE_COMPUTED_SIZE; +import static javafx.scene.layout.Region.USE_PREF_SIZE; + import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.control.ScrollPane; @@ -9,9 +12,6 @@ import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; -import static javafx.scene.layout.Region.USE_COMPUTED_SIZE; -import static javafx.scene.layout.Region.USE_PREF_SIZE; - public final class Containers { public static final ColumnConstraints H_GROW_NEVER = columnConstraints(Priority.NEVER); diff --git a/sampler/src/main/java/atlantafx/sampler/util/ContrastLevel.java b/sampler/src/main/java/atlantafx/sampler/util/ContrastLevel.java index a985a7f..cf14429 100644 --- a/sampler/src/main/java/atlantafx/sampler/util/ContrastLevel.java +++ b/sampler/src/main/java/atlantafx/sampler/util/ContrastLevel.java @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.util; -import javafx.scene.paint.Color; +import static atlantafx.sampler.util.JColorUtils.flattenColor; import java.util.Arrays; - -import static atlantafx.sampler.util.JColorUtils.flattenColor; +import javafx.scene.paint.Color; /** * The WCAG contrast measures the difference in brightness (luminance) between two colours. diff --git a/sampler/src/main/java/atlantafx/sampler/util/Controls.java b/sampler/src/main/java/atlantafx/sampler/util/Controls.java index b0e4cc1..99779ae 100644 --- a/sampler/src/main/java/atlantafx/sampler/util/Controls.java +++ b/sampler/src/main/java/atlantafx/sampler/util/Controls.java @@ -1,17 +1,20 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.util; +import static atlantafx.base.theme.Styles.BUTTON_ICON; + import atlantafx.sampler.event.BrowseEvent; import atlantafx.sampler.event.DefaultEventBus; -import javafx.scene.control.*; +import java.net.URI; +import javafx.scene.control.Button; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.MenuItem; +import javafx.scene.control.ToggleButton; +import javafx.scene.control.ToggleGroup; import javafx.scene.input.KeyCombination; import org.kordamp.ikonli.Ikon; import org.kordamp.ikonli.javafx.FontIcon; -import java.net.URI; - -import static atlantafx.base.theme.Styles.BUTTON_ICON; - public final class Controls { public static Button iconButton(Ikon icon, boolean disable) { diff --git a/sampler/src/main/java/atlantafx/sampler/util/JColorUtils.java b/sampler/src/main/java/atlantafx/sampler/util/JColorUtils.java index 47b40a2..b67ef23 100644 --- a/sampler/src/main/java/atlantafx/sampler/util/JColorUtils.java +++ b/sampler/src/main/java/atlantafx/sampler/util/JColorUtils.java @@ -24,9 +24,8 @@ */ package atlantafx.sampler.util; -import javafx.scene.paint.Color; - import java.util.regex.Pattern; +import javafx.scene.paint.Color; /** * Color utilities with support for hex, RGB, arithmetic RGB, HSL, and integer colors. diff --git a/sampler/src/main/java/atlantafx/sampler/util/NodeUtils.java b/sampler/src/main/java/atlantafx/sampler/util/NodeUtils.java index 96258a4..4c6bd83 100644 --- a/sampler/src/main/java/atlantafx/sampler/util/NodeUtils.java +++ b/sampler/src/main/java/atlantafx/sampler/util/NodeUtils.java @@ -1,13 +1,12 @@ /* SPDX-License-Identifier: MIT */ package atlantafx.sampler.util; +import java.util.List; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; -import java.util.List; - public final class NodeUtils { public static void toggleVisibility(Node node, boolean on) {