further jfx restructuring and refactoring

This commit is contained in:
aj 2019-05-01 15:50:41 +01:00
parent e66893e54c
commit 6defe67767
7 changed files with 13 additions and 16 deletions

View File

@ -5,7 +5,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.stage.Stage; import javafx.stage.Stage;
import sarsoo.fmframework.fx.controller.ControllerMain; import sarsoo.fmframework.fx.controller.RootController;
import sarsoo.fmframework.util.Reference; import sarsoo.fmframework.util.Reference;
public class FmFramework extends Application { public class FmFramework extends Application {
@ -13,14 +13,14 @@ public class FmFramework extends Application {
private static Stage stage; private static Stage stage;
private Scene rootScene; private Scene rootScene;
private static ControllerMain control; private static RootController control;
@Override @Override
public void start(Stage stage) throws Exception { public void start(Stage stage) throws Exception {
FmFramework.stage = stage; FmFramework.stage = stage;
Reference.setUserName("sarsoo"); Reference.setUserName("sarsoo");
FXMLLoader loader = new FXMLLoader(getClass().getResource("ui/main.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("ui/RootPane.fxml"));
// Parent root = FXMLLoader.load(getClass().getResource("ui/main.fxml")); // Parent root = FXMLLoader.load(getClass().getResource("ui/main.fxml"));
Parent root = (Parent)loader.load(); Parent root = (Parent)loader.load();
@ -31,7 +31,7 @@ public class FmFramework extends Application {
// scene.getStylesheets().add("styles/style.css"); // scene.getStylesheets().add("styles/style.css");
control = (ControllerMain)loader.getController(); control = (RootController)loader.getController();
// (new Thread(new TagCaller())).start(); // (new Thread(new TagCaller())).start();
stage.setMinHeight(800); stage.setMinHeight(800);
stage.setMinWidth(960); stage.setMinWidth(960);
@ -50,7 +50,7 @@ public class FmFramework extends Application {
// //
// } // }
public static ControllerMain getController() { public static RootController getController() {
return control; return control;
} }

View File

@ -1,4 +1,4 @@
package sarsoo.fmframework.fx; package sarsoo.fmframework.fx.chart;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -6,8 +6,6 @@ import java.util.ArrayList;
import javafx.scene.chart.PieChart; import javafx.scene.chart.PieChart;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import sarsoo.fmframework.fx.chart.GenrePieChart;
import sarsoo.fmframework.fx.chart.GenreTotalPieChart;
public class GenrePieChartTitledPane extends TitledPane { public class GenrePieChartTitledPane extends TitledPane {

View File

@ -1,4 +1,4 @@
package sarsoo.fmframework.fx; package sarsoo.fmframework.fx.chart;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -6,7 +6,6 @@ import java.util.ArrayList;
import javafx.scene.chart.PieChart; import javafx.scene.chart.PieChart;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import sarsoo.fmframework.fx.chart.GenreTotalPieChart;
public class PieChartTitledPane extends TitledPane { public class PieChartTitledPane extends TitledPane {

View File

@ -19,6 +19,8 @@ import javafx.stage.FileChooser;
import sarsoo.fmframework.file.ListPersister; import sarsoo.fmframework.file.ListPersister;
import sarsoo.fmframework.fm.FmUserNetwork; import sarsoo.fmframework.fm.FmUserNetwork;
import sarsoo.fmframework.fx.TextAreaConsole; import sarsoo.fmframework.fx.TextAreaConsole;
import sarsoo.fmframework.fx.chart.GenrePieChartTitledPane;
import sarsoo.fmframework.fx.chart.PieChartTitledPane;
import sarsoo.fmframework.fx.tab.AlbumTab; import sarsoo.fmframework.fx.tab.AlbumTab;
import sarsoo.fmframework.fx.tab.ArtistTab; import sarsoo.fmframework.fx.tab.ArtistTab;
import sarsoo.fmframework.fx.tab.ConsoleTab; import sarsoo.fmframework.fx.tab.ConsoleTab;
@ -27,8 +29,6 @@ import sarsoo.fmframework.fx.tab.FMObjListTab;
import sarsoo.fmframework.fx.tab.ScrobbleChartTab; import sarsoo.fmframework.fx.tab.ScrobbleChartTab;
import sarsoo.fmframework.fx.tab.TrackTab; import sarsoo.fmframework.fx.tab.TrackTab;
import sarsoo.fmframework.fx.FmFramework; import sarsoo.fmframework.fx.FmFramework;
import sarsoo.fmframework.fx.GenrePieChartTitledPane;
import sarsoo.fmframework.fx.PieChartTitledPane;
import sarsoo.fmframework.music.Album; import sarsoo.fmframework.music.Album;
import sarsoo.fmframework.music.Artist; import sarsoo.fmframework.music.Artist;
import sarsoo.fmframework.music.Tag; import sarsoo.fmframework.music.Tag;
@ -48,7 +48,7 @@ import javafx.application.Platform;
import org.json.*; import org.json.*;
public class ControllerMain { public class RootController {
@FXML @FXML
public void initialize() { public void initialize() {

View File

@ -13,7 +13,7 @@ public class FMObjListEditTab extends Tab {
setText("List"); setText("List");
FXMLLoader loader = new FXMLLoader(getClass().getResource("../ui/FMObjListPaneEdit.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("../ui/FMObjListEditPane.fxml"));
AnchorPane pane = (AnchorPane) loader.load(); AnchorPane pane = (AnchorPane) loader.load();
@ -40,7 +40,7 @@ public class FMObjListEditTab extends Tab {
setText("list"); setText("list");
} }
FXMLLoader loader = new FXMLLoader(getClass().getResource("../ui/FMObjListPaneEdit.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("../ui/FMObjListEditPane.fxml"));
AnchorPane pane = (AnchorPane) loader.load(); AnchorPane pane = (AnchorPane) loader.load();

View File

@ -6,7 +6,7 @@
<?import java.lang.*?> <?import java.lang.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<BorderPane fx:id="borderPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleKeyShortcut" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.ControllerMain"> <BorderPane fx:id="borderPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleKeyShortcut" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sarsoo.fmframework.fx.controller.RootController">
<top> <top>
<MenuBar fx:id="menuBar" BorderPane.alignment="CENTER"> <MenuBar fx:id="menuBar" BorderPane.alignment="CENTER">
<menus> <menus>