Moved Balance to separate window
This commit is contained in:
@@ -8,25 +8,21 @@ import de.siphalor.was.content.product.Product;
|
||||
import de.siphalor.was.content.quest.Quest;
|
||||
import de.siphalor.was.content.resource.Resource;
|
||||
import de.siphalor.was.game.Balance;
|
||||
import de.siphalor.was.visual.jfx.*;
|
||||
import de.siphalor.was.visual.jfx.controller.BalanceController;
|
||||
import de.siphalor.was.visual.jfx.controller.MainController;
|
||||
import de.siphalor.was.visual.jfx.controller.QuestController;
|
||||
import de.siphalor.was.visual.jfx.util.JFXUtil;
|
||||
import de.siphalor.was.visual.jfx.util.StorageSlot;
|
||||
import javafx.animation.FadeTransition;
|
||||
import javafx.animation.Interpolator;
|
||||
import javafx.application.Application;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.chart.NumberAxis;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.layout.ColumnConstraints;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.RowConstraints;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.Duration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -41,10 +37,13 @@ public class JFXVisual extends Application implements Visual {
|
||||
|
||||
private static Scene mainScene;
|
||||
|
||||
private static MainController controller;
|
||||
private static MainController mainController;
|
||||
private static GridPane storageGrid;
|
||||
private static StorageSlot[][] storageSlots;
|
||||
|
||||
private static Stage balanceStage;
|
||||
private static BalanceController balanceController;
|
||||
|
||||
private static final Map<String, Image> CACHED_IMAGES = new HashMap<>();
|
||||
@NotNull
|
||||
public static Image getProductImage(@NotNull Product product, @NotNull ContentManager contentManager) {
|
||||
@@ -75,28 +74,19 @@ public class JFXVisual extends Application implements Visual {
|
||||
@Override
|
||||
public void onScheduleStop() {
|
||||
primaryStage.close();
|
||||
if (balanceStage != null)
|
||||
balanceStage.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBalanceChanged(int budget, Balance.Transaction transaction, int change, int totalIncome, int totalLoss) {
|
||||
I18n i18n = I18n.getInstance();
|
||||
|
||||
controller.budgetLabel.setText(i18n.format("game.budget", budget));
|
||||
JFXUtil.setStyleClass(controller.budgetLabel, "red", budget < 0);
|
||||
mainController.budgetLabel.setText(i18n.format("game.budget", budget));
|
||||
JFXUtil.setStyleClass(mainController.budgetLabel, "red", budget < 0);
|
||||
|
||||
controller.totalIncomeLabel.setText(i18n.format("game.balance.total-income", totalIncome));
|
||||
controller.totalLossLabel.setText(i18n.format("game.balance.total-loss", totalLoss));
|
||||
|
||||
controller.chartQueue.add(budget);
|
||||
|
||||
if (controller.chartTab.isSelected()) {
|
||||
controller.updateChart();
|
||||
}
|
||||
|
||||
if (transaction != Balance.Transaction.NOOP) {
|
||||
ObservableList<BalanceEntry> items = controller.balanceHistoryTable.getItems();
|
||||
items.add(new BalanceEntry(items.size(), change, i18n.getString(transaction.getTranslationKey())));
|
||||
controller.balanceHistoryTable.sort();
|
||||
if (balanceController != null) {
|
||||
balanceController.onBalanceChanged(budget, transaction, change, totalIncome, totalLoss);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,14 +94,14 @@ public class JFXVisual extends Application implements Visual {
|
||||
public void onQuestAdded(Quest newQuest, boolean canCreateMore) {
|
||||
addQuest(newQuest);
|
||||
|
||||
controller.nextQuestButton.setDisable(!canCreateMore);
|
||||
mainController.nextQuestButton.setDisable(!canCreateMore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuestRemoved(int index) {
|
||||
controller.questBox.getChildren().remove(index);
|
||||
mainController.questBox.getChildren().remove(index);
|
||||
|
||||
controller.nextQuestButton.setDisable(false);
|
||||
mainController.nextQuestButton.setDisable(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,21 +112,53 @@ public class JFXVisual extends Application implements Visual {
|
||||
primaryStage.setTitle(WhatAStorage.TITLE);
|
||||
|
||||
loader.setResources(I18n.getInstance());
|
||||
controller = new MainController(WhatAStorage.getInstance());
|
||||
loader.setController(controller);
|
||||
mainController = new MainController(WhatAStorage.getInstance());
|
||||
loader.setController(mainController);
|
||||
|
||||
Pane pane = loader.load(AssetsManager.getStream("jfx/game.fxml").get());
|
||||
mainScene = new Scene(pane);
|
||||
mainScene.getStylesheets().add("assets/jfx/main.css");
|
||||
|
||||
ObservableList<TableColumn<BalanceEntry, ?>> columns = controller.balanceHistoryTable.getColumns();
|
||||
columns.get(0).setCellValueFactory(new PropertyValueFactory<>("index"));
|
||||
columns.get(1).setCellValueFactory(new PropertyValueFactory<>("change"));
|
||||
columns.get(2).setCellValueFactory(new PropertyValueFactory<>("description"));
|
||||
|
||||
loadMainScene();
|
||||
//noinspection unchecked
|
||||
controller.budgetChart.getData().add((XYChart.Series<NumberAxis, NumberAxis>)(Object) controller.budgetChartSeries);
|
||||
|
||||
mainController.balanceButton.setOnAction(event -> {
|
||||
if (balanceStage != null && balanceStage.isShowing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
balanceStage = new Stage();
|
||||
FXMLLoader balanceLoader = new FXMLLoader();
|
||||
balanceLoader.setResources(I18n.getInstance());
|
||||
|
||||
try {
|
||||
balanceController = new BalanceController();
|
||||
balanceLoader.setController(balanceController);
|
||||
|
||||
Parent parent = balanceLoader.load(AssetsManager.getStream("jfx/balance.fxml").orElseThrow());
|
||||
|
||||
balanceController.init();
|
||||
|
||||
Scene balanceScene = new Scene(parent);
|
||||
balanceScene.getStylesheets().add("assets/jfx/main.css");
|
||||
|
||||
balanceStage.setOnCloseRequest(e -> {
|
||||
balanceStage = null;
|
||||
balanceController = null;
|
||||
});
|
||||
|
||||
balanceStage.setAlwaysOnTop(true);
|
||||
balanceStage.setScene(balanceScene);
|
||||
balanceStage.setTitle(I18n.getInstance().getString("game.balance"));
|
||||
balanceStage.show();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
primaryStage.setOnCloseRequest(event -> {
|
||||
if (balanceStage != null)
|
||||
balanceStage.hide();
|
||||
});
|
||||
|
||||
primaryStage.show();
|
||||
}
|
||||
@@ -147,9 +169,8 @@ public class JFXVisual extends Application implements Visual {
|
||||
prepareStorageGrid(3, 3, 3);
|
||||
|
||||
AssetsManager.getStream("textures/bin_closed.png").ifPresent(inputStream -> {
|
||||
controller.trash.setImage(new Image(inputStream));
|
||||
mainController.trash.setImage(new Image(inputStream));
|
||||
});
|
||||
controller.budgetChartSeries.setName(I18n.getInstance().getString("game.balance.chart.line"));
|
||||
|
||||
onBalanceChanged(0, Balance.Transaction.NOOP, 0, 0, 0);
|
||||
}
|
||||
@@ -167,7 +188,7 @@ public class JFXVisual extends Application implements Visual {
|
||||
transition.setByValue(1D);
|
||||
transition.setInterpolator(Interpolator.EASE_OUT);
|
||||
|
||||
controller.questBox.getChildren().add(parent);
|
||||
mainController.questBox.getChildren().add(parent);
|
||||
transition.play();
|
||||
|
||||
Product product = quest.getProduct();
|
||||
@@ -196,6 +217,11 @@ public class JFXVisual extends Application implements Visual {
|
||||
storageGrid = new GridPane();
|
||||
storageGrid.setId("storage-grid");
|
||||
storageGrid.setPadding(new Insets(5D));
|
||||
storageGrid.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
AnchorPane.setTopAnchor(storageGrid, 0D);
|
||||
AnchorPane.setRightAnchor(storageGrid, 0D);
|
||||
AnchorPane.setBottomAnchor(storageGrid, 0D);
|
||||
AnchorPane.setLeftAnchor(storageGrid, 0D);
|
||||
|
||||
ColumnConstraints columnConstraints = new ColumnConstraints();
|
||||
columnConstraints.setPercentWidth(100D / width);
|
||||
@@ -215,7 +241,7 @@ public class JFXVisual extends Application implements Visual {
|
||||
storageGrid.getColumnConstraints().add(columnConstraints);
|
||||
}
|
||||
|
||||
controller.storageTab.setContent(storageGrid);
|
||||
mainController.storagePane.getChildren().add(storageGrid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.component;
|
||||
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
@@ -0,0 +1,74 @@
|
||||
package de.siphalor.was.visual.jfx.controller;
|
||||
|
||||
import de.siphalor.was.WhatAStorage;
|
||||
import de.siphalor.was.content.lang.I18n;
|
||||
import de.siphalor.was.game.Balance;
|
||||
import de.siphalor.was.util.Pair;
|
||||
import de.siphalor.was.visual.jfx.util.BalanceEntry;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.chart.NumberAxis;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
|
||||
public class BalanceController {
|
||||
public Label totalIncomeLabel;
|
||||
public Label totalLossLabel;
|
||||
public TableView<BalanceEntry> balanceHistoryTable;
|
||||
public LineChart<NumberAxis, NumberAxis> budgetChart;
|
||||
public XYChart.Series<Integer, Integer> budgetChartSeries = new XYChart.Series<>();
|
||||
|
||||
public BalanceController() {
|
||||
budgetChartSeries.setName(I18n.getInstance().getString("game.balance.chart.line"));
|
||||
}
|
||||
|
||||
public void init() {
|
||||
Balance balance = WhatAStorage.getInstance().getBalance();
|
||||
|
||||
ObservableList<TableColumn<BalanceEntry, ?>> columns = balanceHistoryTable.getColumns();
|
||||
columns.get(0).setCellValueFactory(new PropertyValueFactory<>("index"));
|
||||
columns.get(1).setCellValueFactory(new PropertyValueFactory<>("change"));
|
||||
columns.get(2).setCellValueFactory(new PropertyValueFactory<>("description"));
|
||||
|
||||
//noinspection unchecked
|
||||
budgetChart.getData().add((XYChart.Series<NumberAxis, NumberAxis>)(Object) budgetChartSeries);
|
||||
ObservableList<XYChart.Data<Integer, Integer>> chartItems = budgetChartSeries.getData();
|
||||
chartItems.add(new XYChart.Data<>(0, 0));
|
||||
|
||||
ObservableList<BalanceEntry> tableItems = balanceHistoryTable.getItems();
|
||||
|
||||
I18n i18n = I18n.getInstance();
|
||||
|
||||
int i = 1;
|
||||
int budget = 0;
|
||||
|
||||
for (Pair<Balance.Transaction, Integer> entry : balance.getHistory()) {
|
||||
budget += entry.getSecond();
|
||||
|
||||
tableItems.add(new BalanceEntry(i, entry.getSecond(), i18n.getString(entry.getFirst().getTranslationKey())));
|
||||
|
||||
chartItems.add(new XYChart.Data<>(i, budget));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public void onBalanceChanged(int budget, Balance.Transaction transaction, int change, int totalIncome, int totalLoss) {
|
||||
I18n i18n = I18n.getInstance();
|
||||
|
||||
totalIncomeLabel.setText(i18n.format("game.balance.total-income", totalIncome));
|
||||
totalLossLabel.setText(i18n.format("game.balance.total-loss", totalLoss));
|
||||
|
||||
if (transaction != Balance.Transaction.NOOP) {
|
||||
ObservableList<BalanceEntry> items = balanceHistoryTable.getItems();
|
||||
items.add(new BalanceEntry(items.size(), change, i18n.getString(transaction.getTranslationKey())));
|
||||
balanceHistoryTable.sort();
|
||||
}
|
||||
|
||||
ObservableList<XYChart.Data<Integer, Integer>> data = budgetChartSeries.getData();
|
||||
|
||||
data.add(new XYChart.Data<>(data.size(), budget));
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,26 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.controller;
|
||||
|
||||
import de.siphalor.was.WhatAStorage;
|
||||
import de.siphalor.was.assets.AssetsManager;
|
||||
import javafx.collections.ObservableList;
|
||||
import de.siphalor.was.visual.jfx.util.DraggedProduct;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.chart.NumberAxis;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.DragEvent;
|
||||
import javafx.scene.input.TransferMode;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MainController {
|
||||
private final WhatAStorage was;
|
||||
|
||||
public Tab storageTab;
|
||||
public Tab chartTab;
|
||||
public Label budgetLabel;
|
||||
public Label totalIncomeLabel;
|
||||
public Label totalLossLabel;
|
||||
public TableView<BalanceEntry> balanceHistoryTable;
|
||||
public LineChart<NumberAxis, NumberAxis> budgetChart;
|
||||
public XYChart.Series<Integer, Integer> budgetChartSeries = new XYChart.Series<>();
|
||||
public Queue<Integer> chartQueue = new LinkedList<>();
|
||||
public Button balanceButton;
|
||||
|
||||
public Pane storagePane;
|
||||
|
||||
public ImageView trash;
|
||||
|
||||
@@ -98,21 +86,4 @@ public class MainController {
|
||||
}
|
||||
dragEvent.setDropCompleted(false);
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onChartTabSelected() {
|
||||
updateChart();
|
||||
}
|
||||
|
||||
public void updateChart() {
|
||||
if (!chartQueue.isEmpty()) {
|
||||
ObservableList<XYChart.Data<Integer, Integer>> data = budgetChartSeries.getData();
|
||||
|
||||
for (Integer integer : chartQueue) {
|
||||
data.add(new XYChart.Data<>(data.size(), integer));
|
||||
}
|
||||
|
||||
chartQueue.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.controller;
|
||||
|
||||
import de.siphalor.was.WhatAStorage;
|
||||
import de.siphalor.was.content.quest.Quest;
|
||||
import de.siphalor.was.visual.jfx.util.DraggedProduct;
|
||||
import de.siphalor.was.visual.jfx.util.JFXUtil;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.image.ImageView;
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.util;
|
||||
|
||||
public class BalanceEntry {
|
||||
public final int index;
|
||||
@@ -1,10 +1,10 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.util;
|
||||
|
||||
import javafx.scene.input.DataFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
interface DraggedProduct extends Serializable {
|
||||
public interface DraggedProduct extends Serializable {
|
||||
DataFormat FORMAT = new DataFormat("application/java-was-jfx-product-move");
|
||||
|
||||
class Quest implements DraggedProduct {
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.util;
|
||||
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.image.Image;
|
||||
@@ -1,7 +1,8 @@
|
||||
package de.siphalor.was.visual.jfx;
|
||||
package de.siphalor.was.visual.jfx.util;
|
||||
|
||||
import de.siphalor.was.WhatAStorage;
|
||||
import de.siphalor.was.content.lang.I18n;
|
||||
import de.siphalor.was.visual.jfx.component.ScalingImagePane;
|
||||
import javafx.geometry.HPos;
|
||||
import javafx.geometry.VPos;
|
||||
import javafx.scene.control.Label;
|
||||
68
src/main/resources/assets/jfx/balance.fxml
Normal file
68
src/main/resources/assets/jfx/balance.fxml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.chart.LineChart?>
|
||||
<?import javafx.scene.chart.NumberAxis?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<TabPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/9.0.1">
|
||||
<tabs>
|
||||
<Tab text="%game.balance.history">
|
||||
<content>
|
||||
<TableView fx:id="balanceHistoryTable" prefHeight="200.0" prefWidth="200.0">
|
||||
<columns>
|
||||
<TableColumn prefWidth="50.666626400416135" styleClass="align-right" text="%game.balance.history.index" />
|
||||
<TableColumn editable="false" maxWidth="500.0" prefWidth="100.0" styleClass="align-right" text="%game.balance.history.change" />
|
||||
<TableColumn maxWidth="1.7976931348623157E308" prefWidth="300.0" text="%game.balance.history.type" />
|
||||
</columns>
|
||||
<placeholder>
|
||||
<Label text="%game.balance.history.no-data" />
|
||||
</placeholder>
|
||||
</TableView>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab fx:id="chartTab" text="%game.balance.chart">
|
||||
<content>
|
||||
<VBox>
|
||||
<children>
|
||||
<HBox fillHeight="false" maxWidth="1.7976931348623157E308" styleClass="tab-info-bar">
|
||||
<children>
|
||||
<Label fx:id="totalIncomeLabel" styleClass="green" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="totalLossLabel" styleClass="red" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="20.0" right="20.0" top="5.0" />
|
||||
</padding>
|
||||
</HBox>
|
||||
<LineChart fx:id="budgetChart" verticalGridLinesVisible="false">
|
||||
<xAxis>
|
||||
<NumberAxis minorTickVisible="false" side="BOTTOM" tickLabelsVisible="false" tickMarkVisible="false" />
|
||||
</xAxis>
|
||||
<yAxis>
|
||||
<NumberAxis side="LEFT" />
|
||||
</yAxis>
|
||||
</LineChart>
|
||||
</children>
|
||||
</VBox>
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
</TabPane>
|
||||
@@ -1,22 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.chart.LineChart?>
|
||||
<?import javafx.scene.chart.NumberAxis?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.ToolBar?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
@@ -27,6 +20,7 @@
|
||||
<children>
|
||||
<ToolBar maxWidth="1.7976931348623157E308" prefHeight="40.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||
<items>
|
||||
<Button fx:id="balanceButton" mnemonicParsing="false" text="%game.balance" />
|
||||
<Label fx:id="budgetLabel" text="%game.budget">
|
||||
<font>
|
||||
<Font size="19.0" />
|
||||
@@ -40,7 +34,7 @@
|
||||
<Button alignment="CENTER" mnemonicParsing="false" onMouseClicked="#scheduleStop" styleClass="red" text="%game.quit" textFill="WHITE" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="7.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<SplitPane dividerPositions="0.3659147869674185" maxHeight="1.7976931348623157E308" VBox.vgrow="ALWAYS">
|
||||
<SplitPane dividerPositions="0.3140277777777778" maxHeight="1.7976931348623157E308" VBox.vgrow="ALWAYS">
|
||||
<items>
|
||||
<GridPane minWidth="250.0" styleClass="side-pane">
|
||||
<columnConstraints>
|
||||
@@ -89,61 +83,7 @@
|
||||
</Button>
|
||||
</children>
|
||||
</GridPane>
|
||||
<TabPane minWidth="450.0" tabClosingPolicy="UNAVAILABLE" tabMaxHeight="Infinity" tabMaxWidth="Infinity">
|
||||
<tabs>
|
||||
<Tab fx:id="storageTab" text="%game.storage" />
|
||||
<Tab text="%game.balance.history">
|
||||
<content>
|
||||
<TableView fx:id="balanceHistoryTable" prefHeight="200.0" prefWidth="200.0">
|
||||
<columns>
|
||||
<TableColumn prefWidth="50.666626400416135" styleClass="align-right" text="%game.balance.history.index" />
|
||||
<TableColumn editable="false" maxWidth="500.0" prefWidth="100.0" styleClass="align-right" text="%game.balance.history.change" />
|
||||
<TableColumn maxWidth="1.7976931348623157E308" prefWidth="300.0" text="%game.balance.history.type" />
|
||||
</columns>
|
||||
<placeholder>
|
||||
<Label text="%game.balance.history.no-data" />
|
||||
</placeholder>
|
||||
</TableView>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab fx:id="chartTab" onSelectionChanged="#onChartTabSelected" text="%game.balance.chart">
|
||||
<content>
|
||||
<VBox>
|
||||
<children>
|
||||
<HBox fillHeight="false" maxWidth="1.7976931348623157E308" styleClass="tab-info-bar">
|
||||
<children>
|
||||
<Label fx:id="totalIncomeLabel" styleClass="green" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
<HBox.margin>
|
||||
<Insets right="20.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="totalLossLabel" styleClass="red" text="Label">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="20.0" right="20.0" top="5.0" />
|
||||
</padding>
|
||||
</HBox>
|
||||
<LineChart fx:id="budgetChart" verticalGridLinesVisible="false">
|
||||
<xAxis>
|
||||
<NumberAxis minorTickVisible="false" side="BOTTOM" tickLabelsVisible="false" tickMarkVisible="false" />
|
||||
</xAxis>
|
||||
<yAxis>
|
||||
<NumberAxis side="LEFT" />
|
||||
</yAxis>
|
||||
</LineChart>
|
||||
</children>
|
||||
</VBox>
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
</TabPane>
|
||||
<AnchorPane fx:id="storagePane" />
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
|
||||
@@ -9,6 +9,7 @@ game.trash = Recycle Bin
|
||||
game.trash.hover = Destroy\n%d$
|
||||
game.storage = Storage
|
||||
game.storage.empty = Empty
|
||||
game.balance = Balance
|
||||
game.balance.history = Transactions
|
||||
game.balance.history.no-data = No transactions yet
|
||||
game.balance.history.index =
|
||||
|
||||
Reference in New Issue
Block a user