Skip to content
Snippets Groups Projects
Commit 46aa23f2 authored by Eilert Tunheim's avatar Eilert Tunheim
Browse files

Updated the linechart class and added separate button for input parameters in GUI

parent 91315e47
No related branches found
No related tags found
No related merge requests found
......@@ -7,25 +7,25 @@ import javafx.scene.chart.XYChart;
public class LineChartFunctionality {
LineChart<String, Number> lineChart;
XYChart.Series<String, Number> series;
CategoryAxis xAxis;
NumberAxis yAxis;
private LineChart<String, Number> lineChart;
private XYChart.Series<String, Number> series;
private final CategoryAxis xAxis;
private final NumberAxis yAxis;
public LineChartFunctionality(){
xAxis = new CategoryAxis();
yAxis = new NumberAxis();
series = new XYChart.Series<String, Number>();
lineChart = new LineChart<>(xAxis,yAxis);
lineChart.getData().add(series);
xAxis.setLabel("Date");
yAxis.setLabel("Kwh");
lineChart.setTitle("Drying Processes");
this.xAxis = new CategoryAxis();
this.yAxis = new NumberAxis();
this.series = new XYChart.Series<String, Number>();
this.lineChart = new LineChart<>(xAxis,yAxis);
this.lineChart.getData().add(series);
this.xAxis.setLabel("Date");
this.yAxis.setLabel("Kwh");
this.lineChart.setTitle("Drying Processes");
}
public LineChart<String, Number> getLineChart() {
return lineChart;
return this.lineChart;
}
public void setLineChart(LineChart<String, Number> lineChart) {
......@@ -33,11 +33,12 @@ public class LineChartFunctionality {
}
public XYChart.Series<String, Number> getSeries() {
return series;
return this.series;
}
public void setSeries(XYChart.Series<String, Number> series) {
this.series = series;
this.lineChart.getData().add(series);
}
}
......@@ -171,9 +171,13 @@ public class Main extends Application {
moistureGoalText.setId("sideBarLabelText");
moistureGoalText.setPromptText("12%");
Button finish = new Button("Finish");
finish.setId("sideBarButtonFinish");
finish.setOnAction(e -> InputPopUpWindow.display());
Button inputParametersButton = new Button("Input Parameters");
inputParametersButton.setId("sideBarButtonInputParameters");
inputParametersButton.setOnAction(e -> InputPopUpWindow.display());
Button finishButton = new Button("Finish");
finishButton.setId("sideBarButtonFinish");
// Creating the circular progressbar
......@@ -217,7 +221,8 @@ public class Main extends Application {
sideBarVBox.getChildren().addAll(ringProgressIndicator, treeSpeciesLabel, treeSpeciesText, dimensionsLabel, dimensionsText, sawsetLabel, sawsetText, moistureGoalLabel, moistureGoalText, finish);
sideBarVBox.getChildren().addAll(ringProgressIndicator, treeSpeciesLabel, treeSpeciesText, dimensionsLabel, dimensionsText,
sawsetLabel, sawsetText, moistureGoalLabel, moistureGoalText, inputParametersButton, finishButton);
VBox.setVgrow(sideBarVBox, Priority.ALWAYS);
......
......@@ -17,6 +17,10 @@
-fx-alignment: center;
}
/*
Sidebar styling
*/
#sideBar {
-fx-pref-width: 250;
}
......@@ -39,11 +43,21 @@
-fx-font-family: Arial;
}
#sideBarButtonFinish {
#sideBarButtonInputParameters {
-fx-translate-x: 5;
-fx-translate-y: 20;
-fx-pref-width: infinity;
-fx-pref-height: 25;
-fx-font-size: 16;
-fx-font-weight: 200;
-fx-font-family: Arial;
}
#sideBarButtonFinish {
-fx-translate-x: 5;
-fx-translate-y: 50;
-fx-pref-width: infinity;
-fx-pref-height: 25;
-fx-font-size: 20;
-fx-font-family: Arial;
-fx-background-color: rgba(104, 229, 59, 1);
......
File added
File added
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment