fixed hiding wiki if null

This commit is contained in:
aj 2019-05-17 16:01:40 +01:00
parent 6328348b22
commit 8180f9c1da
6 changed files with 30 additions and 9 deletions

View File

@ -10,6 +10,7 @@ import sarsoo.fmframework.music.Wiki;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
public class AlbumPaneController { public class AlbumPaneController {
@ -37,6 +38,12 @@ public class AlbumPaneController {
@FXML @FXML
private AnchorPane infoAnchorPane; private AnchorPane infoAnchorPane;
@FXML
private AnchorPane anchorPane;
@FXML
private GridPane gridPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -72,7 +79,7 @@ public class AlbumPaneController {
textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate());
} else { } else {
// albumBorderPane.setCenter(infoAnchorPane); anchorPane.getChildren().set(0, gridPane);
} }
} }

View File

@ -10,6 +10,7 @@ import sarsoo.fmframework.music.Wiki;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
public class ArtistPaneController { public class ArtistPaneController {
@ -34,6 +35,12 @@ public class ArtistPaneController {
@FXML @FXML
private AnchorPane infoAnchorPane; private AnchorPane infoAnchorPane;
@FXML
private AnchorPane anchorPane;
@FXML
private GridPane gridPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -66,7 +73,7 @@ public class ArtistPaneController {
textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate());
} else { } else {
// artistBorderPane.setCenter(infoAnchorPane); anchorPane.getChildren().set(0, gridPane);
} }
} }

View File

@ -10,6 +10,7 @@ import sarsoo.fmframework.music.Wiki;
import sarsoo.fmframework.util.Maths; import sarsoo.fmframework.util.Maths;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
public class TrackPaneController { public class TrackPaneController {
@ -43,6 +44,12 @@ public class TrackPaneController {
@FXML @FXML
private AnchorPane infoAnchorPane; private AnchorPane infoAnchorPane;
@FXML
private AnchorPane anchorPane;
@FXML
private GridPane gridPane;
@FXML @FXML
public void initialize() { public void initialize() {
@ -84,7 +91,7 @@ public class TrackPaneController {
textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate()); textAreaWiki.setText(wiki.getContent() + "\n\n" + wiki.getDate());
} else { } else {
// trackBorderPane.setCenter(infoAnchorPane); anchorPane.getChildren().set(0, gridPane);
} }
if (track.getAlbum() == null) { if (track.getAlbum() == null) {

View File

@ -7,13 +7,13 @@
<?import javafx.scene.paint.*?> <?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.AlbumPaneController"> <AnchorPane fx:id="anchorPane" stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.AlbumPaneController">
<children> <children>
<SplitPane fx:id="splitPane" dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <SplitPane fx:id="splitPane" dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items> <items>
<AnchorPane fx:id="infoAnchorPane" 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 fx:id="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>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>

View File

@ -7,13 +7,13 @@
<?import javafx.scene.paint.*?> <?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.ArtistPaneController"> <AnchorPane fx:id="anchorPane" stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.ArtistPaneController">
<children> <children>
<SplitPane dividerPositions="0.6983967935871743" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <SplitPane dividerPositions="0.6983967935871743" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items> <items>
<AnchorPane fx:id="infoAnchorPane" 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 fx:id="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>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>

View File

@ -7,13 +7,13 @@
<?import javafx.scene.paint.*?> <?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<AnchorPane stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.TrackPaneController"> <AnchorPane fx:id="anchorPane" stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.info.TrackPaneController">
<children> <children>
<SplitPane dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <SplitPane dividerPositions="0.5" prefHeight="327.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items> <items>
<AnchorPane fx:id="infoAnchorPane" 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 fx:id="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>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>