test for a minimap
This commit is contained in:
@@ -34,10 +34,7 @@ import visualiser.gameController.ControllerClient;
|
||||
import visualiser.gameController.Keys.ControlKey;
|
||||
import visualiser.gameController.Keys.KeyFactory;
|
||||
import visualiser.layout.*;
|
||||
import visualiser.model.Sparkline;
|
||||
import visualiser.model.VisualiserBoat;
|
||||
import visualiser.model.VisualiserRaceEvent;
|
||||
import visualiser.model.VisualiserRaceState;
|
||||
import visualiser.model.*;
|
||||
import visualiser.utils.GPSConverter;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -65,6 +62,7 @@ public class RaceViewController extends Controller {
|
||||
private String keyToPress;
|
||||
private View3D view3D;
|
||||
private ObservableList<Subject3D> viewSubjects;
|
||||
private ResizableRaceCanvas raceCanvas;
|
||||
|
||||
/**
|
||||
* Arrow pointing to next mark in third person
|
||||
@@ -78,6 +76,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 GridPane canvasBase1;
|
||||
private @FXML SplitPane racePane;
|
||||
private @FXML StackPane arrowPane;
|
||||
private @FXML Label timer;
|
||||
@@ -111,6 +110,7 @@ public class RaceViewController extends Controller {
|
||||
tutorialCheck();
|
||||
initKeypressHandler();
|
||||
initialiseRaceVisuals();
|
||||
initialiseRaceCanvas();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -608,6 +608,8 @@ public class RaceViewController extends Controller {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
raceCanvas.drawRace();
|
||||
|
||||
boatInfoTable.sort();
|
||||
}
|
||||
|
||||
@@ -735,4 +737,25 @@ public class RaceViewController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises the map
|
||||
*/
|
||||
private void initialiseRaceCanvas() {
|
||||
|
||||
//Create canvas.
|
||||
raceCanvas = new ResizableRaceCanvas(raceState);
|
||||
|
||||
//Set properties.
|
||||
raceCanvas.setMouseTransparent(true);
|
||||
raceCanvas.widthProperty().bind(canvasBase1.widthProperty());
|
||||
raceCanvas.heightProperty().bind(canvasBase1.heightProperty());
|
||||
|
||||
//Draw it and show it.
|
||||
raceCanvas.draw();
|
||||
raceCanvas.setVisible(true);
|
||||
|
||||
//Add to scene.
|
||||
canvasBase1.getChildren().add(0, raceCanvas);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<?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?>
|
||||
@@ -22,7 +28,7 @@
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<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">
|
||||
<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" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.RaceViewController">
|
||||
<items>
|
||||
<StackPane fx:id="newPane" prefHeight="150.0" prefWidth="200.0">
|
||||
<children>
|
||||
@@ -103,6 +109,65 @@
|
||||
</children>
|
||||
</StackPane>
|
||||
<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" />
|
||||
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0">
|
||||
<children>
|
||||
<GridPane fx:id="canvasBase1" maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
<Pane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0" visible="false">
|
||||
<children>
|
||||
<Accordion>
|
||||
<panes>
|
||||
<TitledPane animated="false" prefHeight="395.0" prefWidth="222.0" text="Annotation Control">
|
||||
<content>
|
||||
<AnchorPane fx:id="annotationPane1" minHeight="0.0" minWidth="0.0">
|
||||
<children>
|
||||
<CheckBox fx:id="showName1" layoutY="39.0" mnemonicParsing="false" selected="true" text="Show Boat Name" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
<CheckBox fx:id="showAbbrev1" layoutY="61.0" mnemonicParsing="false" selected="true" text="Show Boat Abbreviation" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="25.0" />
|
||||
<CheckBox fx:id="showSpeed1" layoutY="90.0" mnemonicParsing="false" selected="true" text="Show Boat Speed" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="50.0" />
|
||||
<CheckBox fx:id="showBoatPath1" mnemonicParsing="false" selected="true" text="Show Boat Paths" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="75.0" />
|
||||
<CheckBox fx:id="showTime1" mnemonicParsing="false" selected="true" text="Show Boat Leg Time" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="100.0" />
|
||||
<CheckBox fx:id="showEstTime1" mnemonicParsing="false" selected="true" text="Show Est. Time to Next Mark" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="125.0" />
|
||||
<CheckBox fx:id="showGuideline1" mnemonicParsing="false" text="Show Guideline" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="150.0" />
|
||||
<Separator layoutX="19.6" layoutY="175.6" prefHeight="0.0" prefWidth="200.0" AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="175.0" />
|
||||
<Label text="Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="175.0" />
|
||||
<RadioButton fx:id="hideAnnoRBtn1" mnemonicParsing="false" text="Hidden" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="200.0">
|
||||
<toggleGroup>
|
||||
<ToggleGroup fx:id="annoToggleGroup1" />
|
||||
</toggleGroup>
|
||||
</RadioButton>
|
||||
<RadioButton fx:id="showAnnoRBtn1" mnemonicParsing="false" text="Visible" toggleGroup="$annoToggleGroup1" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="225.0" />
|
||||
<RadioButton fx:id="partialAnnoRBtn1" mnemonicParsing="false" text="Partial" toggleGroup="$annoToggleGroup1" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="250.0" />
|
||||
<RadioButton fx:id="importantAnnoRBtn1" mnemonicParsing="false" text="Important" toggleGroup="$annoToggleGroup1" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="275.0" />
|
||||
<Button fx:id="saveAnno1" layoutX="11.0" layoutY="126.0" mnemonicParsing="false" text="Save Important Annotations" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="300.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
<TitledPane animated="false" text="FPS Control">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<CheckBox fx:id="showFPS1" layoutX="-14.0" layoutY="13.0" mnemonicParsing="false" selected="true" text="Show FPS" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
</panes>
|
||||
</Accordion>
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="infoWrapper" focusTraversable="true" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="200.0" visible="false">
|
||||
|
||||
Reference in New Issue
Block a user