hiding split pane by default

This commit is contained in:
aj 2019-05-04 00:22:04 +01:00
parent 191b38524a
commit f1f85ada87
6 changed files with 37 additions and 7 deletions

View File

@ -16,6 +16,8 @@ import sarsoo.fmframework.net.Network;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import sarsoo.fmframework.util.Reference; import sarsoo.fmframework.util.Reference;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
public class AlbumPaneController { public class AlbumPaneController {
@ -39,7 +41,13 @@ public class AlbumPaneController {
@FXML @FXML
private TextArea textAreaWiki; private TextArea textAreaWiki;
@FXML
private BorderPane albumBorderPane;
@FXML
private AnchorPane infoAnchorPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -79,6 +87,8 @@ public class AlbumPaneController {
if(wiki != null) { if(wiki != null) {
textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate());
}else {
albumBorderPane.setCenter(infoAnchorPane);
} }
} }

View File

@ -13,6 +13,8 @@ import sarsoo.fmframework.net.Network;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import sarsoo.fmframework.util.Reference; import sarsoo.fmframework.util.Reference;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
public class ArtistPaneController { public class ArtistPaneController {
@ -33,6 +35,12 @@ public class ArtistPaneController {
@FXML @FXML
private TextArea textAreaWiki; private TextArea textAreaWiki;
@FXML
private BorderPane artistBorderPane;
@FXML
private AnchorPane infoAnchorPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -72,6 +80,8 @@ public class ArtistPaneController {
if(wiki != null) { if(wiki != null) {
textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent()+ "\n\n" + wiki.getDate());
}else {
artistBorderPane.setCenter(infoAnchorPane);
} }
} }

View File

@ -17,6 +17,8 @@ import sarsoo.fmframework.net.Network;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import sarsoo.fmframework.util.Reference; import sarsoo.fmframework.util.Reference;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
public class TrackPaneController { public class TrackPaneController {
@ -46,6 +48,12 @@ public class TrackPaneController {
@FXML @FXML
private Button buttonViewAlbum; private Button buttonViewAlbum;
@FXML
private BorderPane trackBorderPane;
@FXML
private AnchorPane infoAnchorPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -89,6 +97,8 @@ public class TrackPaneController {
if (wiki != null) { if (wiki != null) {
textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate());
}else {
trackBorderPane.setCenter(infoAnchorPane);
} }
if (track.getAlbum() == null) { if (track.getAlbum() == null) {

View File

@ -11,9 +11,9 @@
<children> <children>
<BorderPane fx:id="albumBorderPane" prefHeight="327.0" prefWidth="600.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <BorderPane fx:id="albumBorderPane" prefHeight="327.0" prefWidth="600.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<center> <center>
<SplitPane dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER"> <SplitPane fx:id="splitPane" dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER">
<items> <items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane fx:id="infoAnchorPane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children> <children>
<GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>

View File

@ -9,11 +9,11 @@
<AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.ArtistPaneController"> <AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.ArtistPaneController">
<children> <children>
<BorderPane fx:id="albumBorderPane" prefHeight="800.0" prefWidth="1000.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <BorderPane fx:id="artistBorderPane" prefHeight="800.0" prefWidth="1000.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<center> <center>
<SplitPane dividerPositions="0.6983967935871743" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER"> <SplitPane dividerPositions="0.6983967935871743" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER">
<items> <items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane fx:id="infoAnchorPane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children> <children>
<GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>

View File

@ -9,11 +9,11 @@
<AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.TrackPaneController"> <AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.TrackPaneController">
<children> <children>
<BorderPane fx:id="albumBorderPane" prefHeight="327.0" prefWidth="600.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <BorderPane fx:id="trackBorderPane" prefHeight="327.0" prefWidth="600.0" stylesheets="@../styles/ObjPane.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<center> <center>
<SplitPane dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER"> <SplitPane dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" BorderPane.alignment="CENTER">
<items> <items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane fx:id="infoAnchorPane" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children> <children>
<GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <GridPane prefHeight="325.0" prefWidth="296.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints> <columnConstraints>