added scrobble tab

This commit is contained in:
aj 2019-05-17 14:09:49 +01:00
parent 49b1838e75
commit 43ea2868eb
4 changed files with 143 additions and 5 deletions

View File

@ -33,6 +33,7 @@ import sarsoo.fmframework.fx.tab.ConsoleTab;
import sarsoo.fmframework.fx.tab.FMObjListEditTab;
import sarsoo.fmframework.fx.tab.GenrePieChartTab;
import sarsoo.fmframework.fx.tab.ScrobbleChartTab;
import sarsoo.fmframework.fx.tab.ScrobbleTab;
import sarsoo.fmframework.fx.tab.TrackTab;
import sarsoo.fmframework.fx.tab.WebViewTab;
import sarsoo.fmframework.log.Log;
@ -423,11 +424,7 @@ public class RootController {
@FXML
protected void handleScrobble(ActionEvent event) throws IOException {
// Album album = sarsoo.fmframework.jframe.Getter.getAlbum();
// if (album != null) {
// Track track = sarsoo.fmframework.jframe.Getter.getTrack(album);
//
// }
addTab(new ScrobbleTab());
}
@FXML

View File

@ -0,0 +1,52 @@
package sarsoo.fmframework.fx.controller;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
public class ScrobblePaneController {
@FXML
private TextField textTrack;
@FXML
private TextField textAlbum;
@FXML
private TextField textArtist;
@FXML
private TextField textAlbumArtist;
@FXML
private Slider sliderHour;
@FXML
private Slider sliderMinute;
@FXML
private Slider sliderSecond;
@FXML
private Label labelStatus;
@FXML
private DatePicker datePicker;
@FXML
private Button buttonScrobble;
@FXML
public void initialize() {
}
@FXML
private void handleScrobble() {
}
}

View File

@ -0,0 +1,33 @@
package sarsoo.fmframework.fx.tab;
import java.io.IOException;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import sarsoo.fmframework.fx.controller.ScrobblePaneController;
import javafx.fxml.FXMLLoader;
public class ScrobbleTab extends Tab {
public ScrobbleTab() throws IOException {
setText("scrobble");
FXMLLoader loader = new FXMLLoader(getClass().getResource("../ui/ScrobblePane.fxml"));
AnchorPane pane = (AnchorPane) loader.load();
AnchorPane.setTopAnchor(pane, 0.0);
AnchorPane.setLeftAnchor(pane, 0.0);
AnchorPane.setRightAnchor(pane, 0.0);
AnchorPane.setBottomAnchor(pane, 0.0);
setContent(pane);
ScrobblePaneController control = (ScrobblePaneController) loader.getController();
//control.populate();
}
}

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>
<AnchorPane prefHeight="569.0" prefWidth="862.0" stylesheets="@../styles/mainPane.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.ScrobblePaneController">
<children>
<GridPane styleClass="backGround" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="25.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label alignment="CENTER" contentDisplay="CENTER" text="track:" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.valignment="CENTER" />
<Label alignment="CENTER" contentDisplay="CENTER" text="album:" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
<Label text="artist:" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="CENTER" />
<Label text="album artist:" GridPane.halignment="CENTER" GridPane.rowIndex="4" GridPane.valignment="CENTER" />
<DatePicker fx:id="datePicker" prefHeight="25.0" prefWidth="255.0" promptText="date" styleClass="backGround" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="5" GridPane.valignment="CENTER" />
<TextField fx:id="textAlbumArtist" prefHeight="25.0" prefWidth="134.0" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<TextField fx:id="textArtist" prefHeight="25.0" prefWidth="106.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="textAlbum" prefHeight="25.0" prefWidth="105.0" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="textTrack" prefHeight="25.0" prefWidth="163.0" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" />
<Label text="scrobble" GridPane.columnSpan="2147483647" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS">
<font>
<Font size="40.0" />
</font>
</Label>
<Label text="date:" GridPane.halignment="CENTER" GridPane.rowIndex="5" />
<Slider fx:id="sliderHour" majorTickUnit="2.0" max="23.0" minorTickCount="1" showTickLabels="true" showTickMarks="true" snapToTicks="true" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Slider fx:id="sliderMinute" majorTickUnit="10.0" max="59.0" minorTickCount="9" showTickLabels="true" showTickMarks="true" snapToTicks="true" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<Slider fx:id="sliderSecond" majorTickUnit="10.0" max="59.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" snapToTicks="true" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<Label text="hour:" GridPane.halignment="CENTER" GridPane.rowIndex="6" />
<Label text="minute:" GridPane.halignment="CENTER" GridPane.rowIndex="7" />
<Label text="second:" GridPane.halignment="CENTER" GridPane.rowIndex="8" />
<Button fx:id="buttonScrobble" mnemonicParsing="false" onAction="#handleScrobble" prefHeight="25.0" prefWidth="232.0" text="go" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="9" GridPane.valignment="CENTER" />
<Label fx:id="labelStatus" GridPane.halignment="CENTER" GridPane.rowIndex="9" />
</children>
</GridPane>
</children>
</AnchorPane>