From b834072a1d45f39bf6211982de50822d4d624700 Mon Sep 17 00:00:00 2001 From: mkpaz Date: Sat, 27 May 2023 21:33:16 +0400 Subject: [PATCH] Refactor assets/resources --- .../java/atlantafx/sampler/layout/MainModel.java | 2 +- .../sampler/page/components/AccordionPage.java | 2 +- .../atlantafx/sampler/page/components/TilePage.java | 4 +--- .../{components => general}/AnimationsPage.java | 6 +++--- .../sampler/page/general/SceneBuilderDialog.java | 8 ++++---- .../atlantafx/sampler/page/general/ThemePage.java | 2 +- .../sampler/page/showcase/BlueprintsPage.java | 2 +- .../sampler/page/showcase/OverviewPage.java | 2 +- .../{assets => }/fxml/blueprints/button-list.fxml | 2 +- .../{assets => }/fxml/blueprints/calendar.fxml | 0 .../fxml/blueprints/checklist-proposal.fxml | 6 +++--- .../fxml/blueprints/dimensions-table.fxml | 0 .../sampler/{assets => }/fxml/blueprints/index.fxml | 0 .../fxml/blueprints/message-editor.fxml | 0 .../{assets => }/fxml/blueprints/music-player.fxml | 8 ++++---- .../{assets => }/fxml/blueprints/share-project.fxml | 8 ++++---- .../sampler/{assets => }/fxml/overview.fxml | 0 .../album_covers}/accept_blind-rage.png | Bin .../album_covers}/opeth_blackwater-park.png | Bin .../album_covers}/rainbow_rising.png | Bin .../album_covers}/soen_lotus.png | Bin .../resources => images/avatars}/avatar1.png | Bin .../resources => images/avatars}/avatar2.png | Bin .../resources => images/avatars}/avatar3.png | Bin .../resources => images/avatars}/avatar4.png | Bin .../resources => images/avatars}/avatar5.png | Bin .../resources => images/avatars}/avatar6.png | Bin .../sampler/images/{ => fun}/20_min_adventure.jpg | Bin .../sampler/images/{ => fun}/saitama-bg.png | Bin .../atlantafx/sampler/images/{ => fun}/saitama.png | Bin .../images/{ => scene-builder}/color-palette.png | Bin .../{ => scene-builder}/scene-builder-in-action.jpg | Bin .../{ => scene-builder}/scene-builder-themes.png | Bin .../images/{ => scene-builder}/scene-builder.png | Bin .../images/{ => scene-builder}/scene-builder_32.png | Bin 35 files changed, 25 insertions(+), 27 deletions(-) rename sampler/src/main/java/atlantafx/sampler/page/{components => general}/AnimationsPage.java (98%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/button-list.fxml (97%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/calendar.fxml (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/checklist-proposal.fxml (93%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/dimensions-table.fxml (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/index.fxml (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/message-editor.fxml (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/music-player.fxml (97%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/blueprints/share-project.fxml (92%) rename sampler/src/main/resources/atlantafx/sampler/{assets => }/fxml/overview.fxml (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/album_covers}/accept_blind-rage.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/album_covers}/opeth_blackwater-park.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/album_covers}/rainbow_rising.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/album_covers}/soen_lotus.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar1.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar2.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar3.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar4.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar5.png (100%) rename sampler/src/main/resources/atlantafx/sampler/{assets/fxml/blueprints/resources => images/avatars}/avatar6.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => fun}/20_min_adventure.jpg (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => fun}/saitama-bg.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => fun}/saitama.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => scene-builder}/color-palette.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => scene-builder}/scene-builder-in-action.jpg (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => scene-builder}/scene-builder-themes.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => scene-builder}/scene-builder.png (100%) rename sampler/src/main/resources/atlantafx/sampler/images/{ => scene-builder}/scene-builder_32.png (100%) diff --git a/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java b/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java index 4af7f16..e463ba8 100644 --- a/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java +++ b/sampler/src/main/java/atlantafx/sampler/layout/MainModel.java @@ -9,7 +9,7 @@ import atlantafx.sampler.event.DefaultEventBus; import atlantafx.sampler.event.NavEvent; import atlantafx.sampler.page.Page; import atlantafx.sampler.page.components.AccordionPage; -import atlantafx.sampler.page.components.AnimationsPage; +import atlantafx.sampler.page.general.AnimationsPage; import atlantafx.sampler.page.components.BreadcrumbsPage; import atlantafx.sampler.page.components.ButtonPage; import atlantafx.sampler.page.components.CalendarPage; 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 2674527..2697d7f 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/AccordionPage.java @@ -166,7 +166,7 @@ public final class AccordionPage extends OutlinePage { disabledBlock.setDisable(true); var imageBlock = new TitledPane("_Image", new VBox(10, - new ImageView(new Image(Resources.getResourceAsStream("images/20_min_adventure.jpg"))), + new ImageView(new Image(Resources.getResourceAsStream("images/fun/20_min_adventure.jpg"))), new TextFlow(new Text(FAKER.rickAndMorty().quote())) )); imageBlock.animatedProperty().bind(animatedProperty); diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/TilePage.java b/sampler/src/main/java/atlantafx/sampler/page/components/TilePage.java index f372773..f578858 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/TilePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/components/TilePage.java @@ -103,9 +103,7 @@ public class TilePage extends OutlinePage { ); var img = new ImageView(new Image( - Resources.getResourceAsStream( - "assets/fxml/blueprints/resources/avatar1.png" - ) + Resources.getResourceAsStream("images/avatars/avatar1.png") )); img.setFitWidth(64); img.setFitHeight(64); diff --git a/sampler/src/main/java/atlantafx/sampler/page/components/AnimationsPage.java b/sampler/src/main/java/atlantafx/sampler/page/general/AnimationsPage.java similarity index 98% rename from sampler/src/main/java/atlantafx/sampler/page/components/AnimationsPage.java rename to sampler/src/main/java/atlantafx/sampler/page/general/AnimationsPage.java index 842411a..0dafb8e 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/components/AnimationsPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/AnimationsPage.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT */ -package atlantafx.sampler.page.components; +package atlantafx.sampler.page.general; import static javafx.scene.control.ScrollPane.ScrollBarPolicy.AS_NEEDED; import static javafx.scene.control.ScrollPane.ScrollBarPolicy.NEVER; @@ -36,10 +36,10 @@ public final class AnimationsPage extends StackPane implements Page { private static final int OUTLINE_WIDTH = 250; private static final Duration DURATION = Duration.millis(2000); private static final ImageView ANIMATED_NODE = new ImageView(new Image( - Resources.getResourceAsStream("images/saitama.png") + Resources.getResourceAsStream("images/fun/saitama.png") )); private static final ImageView ANIMATED_BG = new ImageView(new Image( - Resources.getResourceAsStream("images/saitama-bg.png") + Resources.getResourceAsStream("images/fun/saitama-bg.png") )); @Override diff --git a/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java b/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java index 9b0294a..327e581 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/SceneBuilderDialog.java @@ -153,7 +153,7 @@ class SceneBuilderDialog extends ModalDialog { private Pane createStartScreen() { var previewImg = new ImageView(new Image( - Resources.getResourceAsStream("images/scene-builder-in-action.jpg") + Resources.getResourceAsStream("images/scene-builder/scene-builder-in-action.jpg") )); previewImg.setFitWidth(280); previewImg.setFitHeight(190); @@ -257,7 +257,7 @@ class SceneBuilderDialog extends ModalDialog { private Pane createThemeScreen() { var icon = new ImageView(new Image( - Resources.getResourceAsStream("images/color-palette.png") + Resources.getResourceAsStream("images/scene-builder/color-palette.png") )); icon.setFitWidth(64); icon.setFitHeight(64); @@ -323,14 +323,14 @@ class SceneBuilderDialog extends ModalDialog { private Pane createExecScreen() { var menuImg = new ImageView(new Image( - Resources.getResourceAsStream("images/scene-builder-themes.png") + Resources.getResourceAsStream("images/scene-builder/scene-builder-themes.png") )); menuImg.setFitWidth(280); menuImg.setFitHeight(210); menuImg.setCursor(Cursor.HAND); var test = new ImageView(new Image( - Resources.getResourceAsStream("images/scene-builder-themes.png") + Resources.getResourceAsStream("images/scene-builder/scene-builder-themes.png") )); test.setPickOnBounds(true); 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 3635e8f..6796959 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/general/ThemePage.java @@ -46,7 +46,7 @@ public final class ThemePage extends OutlinePage { private static final ThemeManager TM = ThemeManager.getInstance(); private static final String DEFAULT_FONT_ID = "Default"; private static final Image SCENE_BUILDER_ICON = new Image( - Resources.getResourceAsStream("images/scene-builder_32.png") + Resources.getResourceAsStream("images/scene-builder/scene-builder_32.png") ); @Override diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/BlueprintsPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/BlueprintsPage.java index 834ead6..8a90ae3 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/BlueprintsPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/BlueprintsPage.java @@ -37,7 +37,7 @@ public final class BlueprintsPage extends ScrollPane implements Page { wrapper.setAlignment(Pos.TOP_CENTER); var loader = new FXMLLoader( - Resources.getResource("assets/fxml/blueprints/index.fxml").toURL() + Resources.getResource("fxml/blueprints/index.fxml").toURL() ); Parent fxmlContent = loader.load(); ((Pane) fxmlContent).setMaxWidth(Page.MAX_WIDTH); diff --git a/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java b/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java index 787cfaa..8f5d3ae 100755 --- a/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java +++ b/sampler/src/main/java/atlantafx/sampler/page/showcase/OverviewPage.java @@ -39,7 +39,7 @@ public final class OverviewPage extends ScrollPane implements Page { wrapper.getStyleClass().add(Styles.BG_DEFAULT); var loader = new FXMLLoader( - Resources.getResource("assets/fxml/overview.fxml").toURL() + Resources.getResource("fxml/overview.fxml").toURL() ); Parent fxmlContent = loader.load(); ((Pane) fxmlContent).setMaxWidth(Page.MAX_WIDTH); diff --git a/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/button-list.fxml b/sampler/src/main/resources/atlantafx/sampler/fxml/blueprints/button-list.fxml similarity index 97% rename from sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/button-list.fxml rename to sampler/src/main/resources/atlantafx/sampler/fxml/blueprints/button-list.fxml index b0ab0d8..196ca8c 100644 --- a/sampler/src/main/resources/atlantafx/sampler/assets/fxml/blueprints/button-list.fxml +++ b/sampler/src/main/resources/atlantafx/sampler/fxml/blueprints/button-list.fxml @@ -5,7 +5,7 @@ - +