|
@@ -7,6 +7,7 @@ import javafx.scene.Scene;
|
|
|
import javafx.scene.chart.PieChart;
|
|
|
import javafx.scene.control.Label;
|
|
|
import javafx.scene.layout.AnchorPane;
|
|
|
+import javafx.scene.layout.HBox;
|
|
|
import javafx.scene.paint.Color;
|
|
|
import javafx.scene.text.Font;
|
|
|
import javafx.scene.text.Text;
|
|
@@ -40,7 +41,7 @@ public class GenreStatisticsController extends Controller {
|
|
|
genrePie.setTitle("Genre Statistics");
|
|
|
|
|
|
|
|
|
- String textValue = new String();
|
|
|
+ String textValue = "";
|
|
|
|
|
|
for (PieChart.Data sector :
|
|
|
list) {
|
|
@@ -56,13 +57,22 @@ public class GenreStatisticsController extends Controller {
|
|
|
}
|
|
|
|
|
|
Text text = new Text(textValue);
|
|
|
- statsTextBox.getChildren().add(text);
|
|
|
-
|
|
|
+ text.setFont(new Font(16));
|
|
|
|
|
|
text.setFill(Color.rgb(159,159,159));
|
|
|
- text.setFont(new Font(16));
|
|
|
|
|
|
|
|
|
+ new Scene (new Group(text));
|
|
|
+
|
|
|
+ double height = text.getLayoutBounds().getHeight();
|
|
|
+ double width = text.getLayoutBounds().getWidth();
|
|
|
+
|
|
|
+ statsTextBox.getChildren().add((Text)text);
|
|
|
+
|
|
|
+ statsTextBox.setMinWidth(width);
|
|
|
+ statsTextBox.setMinHeight(height);
|
|
|
+ ((HBox) statsTextBox.getParent()).setMinHeight(height);
|
|
|
+ ((HBox) statsTextBox.getParent()).setMaxHeight(height);
|
|
|
}
|
|
|
|
|
|
public void openStudio(Object caller) {
|
|
@@ -81,7 +91,7 @@ public class GenreStatisticsController extends Controller {
|
|
|
genrePie.setData(list);
|
|
|
genrePie.setTitle("Studio Statistics");
|
|
|
|
|
|
- String textValue = new String();
|
|
|
+ String textValue = "";
|
|
|
|
|
|
for (PieChart.Data sector :
|
|
|
list) {
|
|
@@ -93,12 +103,24 @@ public class GenreStatisticsController extends Controller {
|
|
|
}
|
|
|
else
|
|
|
countPrefix = "Film";
|
|
|
+
|
|
|
textValue = textValue.concat(sector.getName() + ": " + (int)sector.getPieValue() + " " + countPrefix);
|
|
|
}
|
|
|
|
|
|
Text text = new Text(textValue);
|
|
|
text.setFill(Color.rgb(159,159,159));
|
|
|
text.setFont(new Font(16));
|
|
|
+
|
|
|
+ new Scene (new Group(text));
|
|
|
+
|
|
|
+ double height = text.getLayoutBounds().getHeight();
|
|
|
+ double width = text.getLayoutBounds().getWidth();
|
|
|
+
|
|
|
statsTextBox.getChildren().add((Text)text);
|
|
|
+
|
|
|
+ statsTextBox.setMinWidth(width);
|
|
|
+ statsTextBox.setMinHeight(height);
|
|
|
+ ((HBox) statsTextBox.getParent()).setMinHeight(height);
|
|
|
+ ((HBox) statsTextBox.getParent()).setMaxHeight(height);
|
|
|
}
|
|
|
}
|