From f1f85ada8785663d43745ce3a401e8420e887a0b Mon Sep 17 00:00:00 2001 From: aj Date: Sat, 4 May 2019 00:22:04 +0100 Subject: [PATCH] hiding split pane by default --- .../fx/controller/AlbumPaneController.java | 12 +++++++++++- .../fx/controller/ArtistPaneController.java | 10 ++++++++++ .../fx/controller/TrackPaneController.java | 10 ++++++++++ .../sarsoo/fmframework/fx/ui/AlbumPane.fxml | 4 ++-- .../sarsoo/fmframework/fx/ui/ArtistPane.fxml | 4 ++-- .../sarsoo/fmframework/fx/ui/TrackPane.fxml | 4 ++-- 6 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/main/java/sarsoo/fmframework/fx/controller/AlbumPaneController.java b/src/main/java/sarsoo/fmframework/fx/controller/AlbumPaneController.java index b811924..c3dc2e8 100644 --- a/src/main/java/sarsoo/fmframework/fx/controller/AlbumPaneController.java +++ b/src/main/java/sarsoo/fmframework/fx/controller/AlbumPaneController.java @@ -16,6 +16,8 @@ import sarsoo.fmframework.net.Network; import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Reference; import javafx.scene.control.*; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.BorderPane; public class AlbumPaneController { @@ -39,7 +41,13 @@ public class AlbumPaneController { @FXML private TextArea textAreaWiki; - + + @FXML + private BorderPane albumBorderPane; + + @FXML + private AnchorPane infoAnchorPane; + @FXML public void initialize() { @@ -79,6 +87,8 @@ public class AlbumPaneController { if(wiki != null) { textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate()); + }else { + albumBorderPane.setCenter(infoAnchorPane); } } diff --git a/src/main/java/sarsoo/fmframework/fx/controller/ArtistPaneController.java b/src/main/java/sarsoo/fmframework/fx/controller/ArtistPaneController.java index 7a90e93..4216d5e 100644 --- a/src/main/java/sarsoo/fmframework/fx/controller/ArtistPaneController.java +++ b/src/main/java/sarsoo/fmframework/fx/controller/ArtistPaneController.java @@ -13,6 +13,8 @@ import sarsoo.fmframework.net.Network; import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Reference; import javafx.scene.control.*; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.BorderPane; public class ArtistPaneController { @@ -33,6 +35,12 @@ public class ArtistPaneController { @FXML private TextArea textAreaWiki; + + @FXML + private BorderPane artistBorderPane; + + @FXML + private AnchorPane infoAnchorPane; @FXML public void initialize() { @@ -72,6 +80,8 @@ public class ArtistPaneController { if(wiki != null) { textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate()); + }else { + artistBorderPane.setCenter(infoAnchorPane); } } diff --git a/src/main/java/sarsoo/fmframework/fx/controller/TrackPaneController.java b/src/main/java/sarsoo/fmframework/fx/controller/TrackPaneController.java index 182f1c0..174d4b9 100644 --- a/src/main/java/sarsoo/fmframework/fx/controller/TrackPaneController.java +++ b/src/main/java/sarsoo/fmframework/fx/controller/TrackPaneController.java @@ -17,6 +17,8 @@ import sarsoo.fmframework.net.Network; import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Reference; import javafx.scene.control.*; +import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.BorderPane; public class TrackPaneController { @@ -46,6 +48,12 @@ public class TrackPaneController { @FXML private Button buttonViewAlbum; + + @FXML + private BorderPane trackBorderPane; + + @FXML + private AnchorPane infoAnchorPane; @FXML public void initialize() { @@ -89,6 +97,8 @@ public class TrackPaneController { if (wiki != null) { textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate()); + }else { + trackBorderPane.setCenter(infoAnchorPane); } if (track.getAlbum() == null) { diff --git a/src/main/resources/sarsoo/fmframework/fx/ui/AlbumPane.fxml b/src/main/resources/sarsoo/fmframework/fx/ui/AlbumPane.fxml index 0abbcc7..f8ac1ca 100644 --- a/src/main/resources/sarsoo/fmframework/fx/ui/AlbumPane.fxml +++ b/src/main/resources/sarsoo/fmframework/fx/ui/AlbumPane.fxml @@ -11,9 +11,9 @@
- + - + diff --git a/src/main/resources/sarsoo/fmframework/fx/ui/ArtistPane.fxml b/src/main/resources/sarsoo/fmframework/fx/ui/ArtistPane.fxml index 298aee3..b076e9b 100644 --- a/src/main/resources/sarsoo/fmframework/fx/ui/ArtistPane.fxml +++ b/src/main/resources/sarsoo/fmframework/fx/ui/ArtistPane.fxml @@ -9,11 +9,11 @@ - +
- + diff --git a/src/main/resources/sarsoo/fmframework/fx/ui/TrackPane.fxml b/src/main/resources/sarsoo/fmframework/fx/ui/TrackPane.fxml index b01abe4..ce3e35b 100644 --- a/src/main/resources/sarsoo/fmframework/fx/ui/TrackPane.fxml +++ b/src/main/resources/sarsoo/fmframework/fx/ui/TrackPane.fxml @@ -9,11 +9,11 @@ - +
- +