Merge branch 'master' into story1301-start

This commit is contained in:
Connor Taylor-Brown
2017-09-28 13:08:25 +13:00
16 changed files with 134 additions and 101 deletions
@@ -68,11 +68,11 @@ public class RaceClock {
/**
* Format string used for duration before it has started.
*/
private String durationBeforeStartFormat = "Starting in: %02d:%02d:%02d";
private String durationBeforeStartFormat = "%02d:%02d:%02d";
/**
* Format string used for duration once the race has started.
*/
private String durationAfterStartFormat = "Time: %02d:%02d:%02d";
private String durationAfterStartFormat = "%02d:%02d:%02d";
@@ -67,9 +67,9 @@ public class NextMarkController {
Shape3D arrow = Assets3D.loadX3d(arrowPath);
arrow.setScaleX(25);
arrow.setScaleX(15);
arrow.setScaleY(25);
arrow.setScaleZ(100);
arrow.setScaleZ(50);
arrow.setRotationAxis(new Point3D(1,0,0));
arrowStackPane3d.getChildren().add(arrow);
@@ -1,9 +1,7 @@
package visualiser.Controllers;
import com.interactivemesh.jfx.importer.stl.StlMeshImporter;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import eu.hansolo.medusa.*;
import eu.hansolo.medusa.events.UpdateEvent;
import javafx.animation.AnimationTimer;
import javafx.application.Platform;
import javafx.collections.FXCollections;
@@ -95,6 +93,7 @@ public class RaceViewController extends Controller {
private @FXML NextMarkController nextMarkController;
private @FXML GridPane canvasBase;
private @FXML GridPane canvasBase1;
private @FXML GridPane canvasBase2;
private @FXML SplitPane racePane;
private @FXML StackPane arrowPane;
private @FXML Pane nextMarkPane;
@@ -136,9 +135,9 @@ public class RaceViewController extends Controller {
deathPane.setVisible(false);
tutorialCheck();
initKeypressHandler();
initialiseRaceVisuals();
initialiseRaceCanvas();
healthLoop();
initialiseRaceVisuals();
}
/**
@@ -292,7 +291,7 @@ public class RaceViewController extends Controller {
//Create a gauge with a frame and background that utilizes a Medusa gauge
fGauge = FGaugeBuilder
.create()
.prefSize(200, 200)
.prefSize(190, 190)
.gauge(gauge)
.gaugeDesign(GaugeDesign.METAL)
.gaugeBackground(GaugeDesign.GaugeBackground.CARBON)
@@ -313,12 +312,11 @@ public class RaceViewController extends Controller {
initialiseHealthPane();
initialiseRaceClock();
initialiseSpeedometer();
initialiseRaceCanvas();
raceTimer(); // start the timer
nextMarkPane.toFront();
//nextMarkPane.toFront();
speedometerLoop();
new Sparkline(this.raceState, this.sparklineChart);
timeZone.setText(this.raceState.getRaceClock().getTimeZone());
arrowController.setWindProperty(this.raceState.windProperty());
}
@@ -1080,22 +1078,23 @@ public class RaceViewController extends Controller {
private void bigMap(){
if (mapToggle){
raceCanvas.widthProperty().bind(canvasBase.widthProperty());
raceCanvas.heightProperty().bind(canvasBase.heightProperty());
raceCanvas.widthProperty().bind(canvasBase2.widthProperty());
raceCanvas.heightProperty().bind(canvasBase2.heightProperty());
raceCanvas.setFullScreen(true);
raceCanvas.setOpacity(0.6);
canvasBase1.getChildren().remove(raceCanvas);
canvasBase.getChildren().add(1, raceCanvas);
canvasBase2.getChildren().add(0, raceCanvas);
}else{
raceCanvas.widthProperty().bind(canvasBase1.widthProperty());
raceCanvas.heightProperty().bind(canvasBase1.heightProperty());
raceCanvas.setFullScreen(false);
raceCanvas.setOpacity(1);
canvasBase.getChildren().remove(raceCanvas);
canvasBase2.getChildren().remove(raceCanvas);
canvasBase1.getChildren().add(0, raceCanvas);
}
mapToggle = !mapToggle;
@@ -25,7 +25,7 @@ public class WindCompass extends View3D {
};
public WindCompass(View3D view3D, Property<Wind> wind){
super();
super(false);
this.wind = wind;
this.view3D = view3D;
this.followView3D.start();
@@ -647,7 +647,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
//rounding lines
if (isFullScreen){
drawRoundingLines();
// drawRoundingLines();
drawRaceLine();
}
@@ -794,18 +794,11 @@ public class ResizableRaceCanvas extends ResizableCanvas {
}
private Color getLineColor(Leg leg) {
for (VisualiserBoat boat : raceState.getBoats()) {
if (boat.isClientBoat()) {
if (boat.getCurrentLeg() == leg) {
return Color.ORANGE;
} else {
return Color.MEDIUMAQUAMARINE;
}
}else{
return Color.MEDIUMAQUAMARINE;
}
if(ThisBoat.getInstance().getLegNumber() == leg.getLegNumber()){
return Color.ORANGE;
}else{
return Color.MEDIUMAQUAMARINE;
}
return Color.MEDIUMAQUAMARINE;
}
private void drawArrowHead(GPSCoordinate start, GPSCoordinate end){
@@ -35,6 +35,14 @@ public class ThisBoat {
}
}
public int getLegNumber(){
if(this.boat != null){
return this.boat.getCurrentLeg().getLegNumber();
}else{
return 0;
}
}
public void setBoat(VisualiserBoat boat) {
this.boat = boat;
}