diff --git a/src/main/java/sarsoo/fmframework/fx/ScrobbleChartTab.java b/src/main/java/sarsoo/fmframework/fx/ScrobbleChartTab.java new file mode 100644 index 0000000..21102d6 --- /dev/null +++ b/src/main/java/sarsoo/fmframework/fx/ScrobbleChartTab.java @@ -0,0 +1,39 @@ +package sarsoo.fmframework.fx; + +import java.io.IOException; + +import javafx.scene.control.*; +import javafx.scene.layout.*; +import sarsoo.fmframework.fx.controller.AlbumPaneController; +import sarsoo.fmframework.fx.controller.ScrobbleChartPaneController; +import sarsoo.fmframework.music.Album; + + +import javafx.fxml.FXMLLoader; + +public class ScrobbleChartTab extends Tab { + + public ScrobbleChartTab() throws IOException { + + setText("scrobbles"); + + FXMLLoader loader = new FXMLLoader(getClass().getResource("ui/ScrobbleChartPane.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); + + ScrobbleChartPaneController control = (ScrobbleChartPaneController) loader.getController(); + + //control.populate(); + + + + } + +} diff --git a/src/main/java/sarsoo/fmframework/fx/controller/ControllerMain.java b/src/main/java/sarsoo/fmframework/fx/controller/ControllerMain.java index 34db76c..8fa5daf 100644 --- a/src/main/java/sarsoo/fmframework/fx/controller/ControllerMain.java +++ b/src/main/java/sarsoo/fmframework/fx/controller/ControllerMain.java @@ -27,6 +27,7 @@ import sarsoo.fmframework.fx.FMObjListTab; import sarsoo.fmframework.fx.FmFramework; import sarsoo.fmframework.fx.GenrePieChartTitledPane; import sarsoo.fmframework.fx.PieChartTitledPane; +import sarsoo.fmframework.fx.ScrobbleChartTab; import sarsoo.fmframework.fx.TrackTab; import sarsoo.fmframework.music.Album; import sarsoo.fmframework.music.Artist; @@ -605,6 +606,17 @@ public class ControllerMain { protected void handleOpenConsole(ActionEvent event) { addTab(new ConsoleTab()); } + + @FXML + protected void handleScrobbleChart(ActionEvent event) { + try { + addTab(new ScrobbleChartTab()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } @FXML protected void handleListEdit(ActionEvent event) { diff --git a/src/main/java/sarsoo/fmframework/fx/controller/ScrobbleChartPaneController.java b/src/main/java/sarsoo/fmframework/fx/controller/ScrobbleChartPaneController.java new file mode 100644 index 0000000..e10ba0d --- /dev/null +++ b/src/main/java/sarsoo/fmframework/fx/controller/ScrobbleChartPaneController.java @@ -0,0 +1,61 @@ +package sarsoo.fmframework.fx.controller; + +import java.io.IOException; +import java.text.NumberFormat; +import java.util.Locale; + +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import sarsoo.fmframework.fm.FmNetwork; +import sarsoo.fmframework.fx.ArtistTab; +import sarsoo.fmframework.fx.FmFramework; +import sarsoo.fmframework.music.Album; +import sarsoo.fmframework.music.Wiki; +import sarsoo.fmframework.net.Key; +import sarsoo.fmframework.net.Network; +import sarsoo.fmframework.util.Maths; +import sarsoo.fmframework.util.Reference; +import javafx.scene.chart.LineChart; +import javafx.scene.control.*; +import javafx.scene.layout.BorderPane; + +public class ScrobbleChartPaneController { + + @FXML + private ToolBar toolBar; + + @FXML + private Button buttonRefresh; + + @FXML + private ChoiceBox dropDownTimeRange; + + @FXML + private LineChart lineChartScrobbles; + + @FXML + private BorderPane chartBorderPane; + + @FXML + public void initialize() { + + + } + + @FXML + protected void handleRefresh(ActionEvent event) { + refresh(); + } + + + public void populate(Album album) { + + + } + + + public void refresh() { + + } + +} diff --git a/src/main/resources/sarsoo/fmframework/fx/ui/ScrobbleChartPane.fxml b/src/main/resources/sarsoo/fmframework/fx/ui/ScrobbleChartPane.fxml new file mode 100644 index 0000000..acd6cdc --- /dev/null +++ b/src/main/resources/sarsoo/fmframework/fx/ui/ScrobbleChartPane.fxml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + +