Made the info tab into an overlay

#story[1195]
main
hba56 8 years ago
parent c17900a461
commit 88f1a393f2

@ -3,7 +3,6 @@ package visualiser.Controllers;
import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
import javafx.animation.AnimationTimer;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
@ -13,7 +12,6 @@ import javafx.scene.AmbientLight;
import javafx.scene.PointLight;
import javafx.scene.chart.LineChart;
import javafx.scene.control.*;
import javafx.scene.effect.Light;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
@ -22,7 +20,8 @@ import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.paint.Material;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.*;
import javafx.scene.shape.MeshView;
import javafx.scene.shape.Shape3D;
import javafx.scene.transform.Translate;
import javafx.util.Callback;
import network.Messages.Enums.RaceStatusEnum;
@ -33,11 +32,8 @@ import visualiser.app.App;
import visualiser.enums.TutorialState;
import visualiser.gameController.ControllerClient;
import visualiser.gameController.Keys.ControlKey;
import visualiser.layout.*;
import visualiser.model.*;
import visualiser.gameController.Keys.KeyFactory;
import visualiser.layout.Subject3D;
import visualiser.layout.View3D;
import visualiser.layout.*;
import visualiser.model.Sparkline;
import visualiser.model.VisualiserBoat;
import visualiser.model.VisualiserRaceEvent;
@ -82,7 +78,7 @@ public class RaceViewController extends Controller {
// note: it says it's not used but it is! do not remove :)
private @FXML ArrowController arrowController;
private @FXML GridPane canvasBase;
private @FXML AnchorPane newRacePane;
private @FXML SplitPane racePane;
private @FXML StackPane arrowPane;
private @FXML Label timer;
private @FXML Label FPS;
@ -96,6 +92,7 @@ public class RaceViewController extends Controller {
private @FXML LineChart<Number, Number> sparklineChart;
private @FXML Label tutorialText;
private @FXML AnchorPane infoWrapper;
private @FXML AnchorPane lineChartWrapper;
/**
* Displays a specified race.
@ -143,7 +140,7 @@ public class RaceViewController extends Controller {
private AnimationTimer arrowToNextMark;
private void initKeypressHandler() {
newRacePane.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
racePane.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
String codeString = event.getCode().toString();
// tab key
@ -353,7 +350,7 @@ public class RaceViewController extends Controller {
});
// Bind zooming to keypress (Z/X default)
newRacePane.addEventFilter(KeyEvent.KEY_PRESSED, e -> {
racePane.addEventFilter(KeyEvent.KEY_PRESSED, e -> {
ControlKey key = keyFactory.getKey(e.getCode().toString());
if(key != null) {
switch (key.toString()) {

@ -89,3 +89,15 @@
-fx-focus-color: transparent;
-fx-background-color: transparent;
}
#lineChartWrapper{
-fx-border-color: #02378c;
-fx-background-color: #4783e0;
-fx-border-width: 3;
}
#boatInfoTable{
-fx-border-color: #012256;
-fx-border-width: 3;
}

@ -91,3 +91,14 @@
-fx-focus-color: transparent;
-fx-background-color: transparent;
}
#lineChartWrapper{
-fx-border-color: #02378c;
-fx-background-color: #012256;
-fx-border-width: 3;
}
#boatInfoTable{
-fx-border-color: #012256;
-fx-border-width: 3;
}

@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.chart.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
@ -28,11 +22,11 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="newRacePane" prefHeight="431.0" prefWidth="610.0" visible="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.RaceViewController">
<children>
<SplitPane fx:id="racePane" prefHeight="431.0" prefWidth="610.0" visible="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.RaceViewController">
<items>
<StackPane fx:id="newPane" prefHeight="150.0" prefWidth="200.0">
<children>
<AnchorPane>
<AnchorPane focusTraversable="true">
<children>
<GridPane fx:id="canvasBase" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columnConstraints>
@ -111,20 +105,20 @@
<Label fx:id="tutorialText" alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" style="-fx-border-color: orange; -fx-border-radius: 5px; -fx-background-color: #ffffcc; -fx-text-fill: #3399ff; -fx-border-width: 3; -fx-border-insets: -3;" text="This is the tutorial text" visible="false" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="150.0" AnchorPane.topAnchor="100.0" />
</children>
</AnchorPane>
</children>
</StackPane>
<AnchorPane fx:id="infoWrapper" layoutX="450.0" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0" visible="false" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="20.0" GridPane.columnIndex="1">
<AnchorPane fx:id="infoWrapper" focusTraversable="true" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0">
<children>
<GridPane layoutX="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<GridPane layoutX="-2.0" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="40.0" AnchorPane.rightAnchor="40.0" AnchorPane.topAnchor="40.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="475.0" minWidth="475.0" prefWidth="475.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="369.0" minHeight="10.0" prefHeight="228.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="250.0" minHeight="10.0" prefHeight="163.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="330.0" minHeight="10.0" prefHeight="214.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="150.0" minHeight="10.0" prefHeight="135.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TableView fx:id="boatInfoTable" layoutX="-2.0" maxWidth="475.0" minWidth="475.0" prefWidth="475.0" AnchorPane.bottomAnchor="126.0" AnchorPane.leftAnchor="50.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="0.0" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<TableView fx:id="boatInfoTable" minWidth="475.0" prefHeight="214.0" prefWidth="475.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<columns>
<TableColumn fx:id="boatPlacingColumn" prefWidth="50.0" text="Place" />
<TableColumn fx:id="boatTeamColumn" prefWidth="200.0" text="Team" />
@ -132,7 +126,7 @@
<TableColumn fx:id="boatSpeedColumn" prefWidth="75.0" text="Speed" />
</columns>
</TableView>
<AnchorPane prefHeight="167.0" prefWidth="178.0" GridPane.rowIndex="1">
<AnchorPane fx:id="lineChartWrapper" prefHeight="167.0" prefWidth="178.0" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<children>
<LineChart fx:id="sparklineChart" layoutX="-211.0" layoutY="-186.0" mouseTransparent="true" prefHeight="167.0" prefWidth="178.0" titleSide="LEFT" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<xAxis>
@ -149,4 +143,6 @@
</children>
</AnchorPane>
</children>
</AnchorPane>
</StackPane>
</items>
</SplitPane>

Loading…
Cancel
Save