Map now only shows annotations when in full screen
#story[1295]
This commit is contained in:
@@ -767,6 +767,8 @@ public class RaceViewController extends Controller {
|
|||||||
raceCanvas.widthProperty().bind(canvasBase.widthProperty());
|
raceCanvas.widthProperty().bind(canvasBase.widthProperty());
|
||||||
raceCanvas.heightProperty().bind(canvasBase.heightProperty());
|
raceCanvas.heightProperty().bind(canvasBase.heightProperty());
|
||||||
|
|
||||||
|
raceCanvas.setFullScreen(true);
|
||||||
|
|
||||||
canvasBase1.getChildren().remove(raceCanvas);
|
canvasBase1.getChildren().remove(raceCanvas);
|
||||||
canvasBase.getChildren().add(1, raceCanvas);
|
canvasBase.getChildren().add(1, raceCanvas);
|
||||||
|
|
||||||
@@ -774,6 +776,8 @@ public class RaceViewController extends Controller {
|
|||||||
raceCanvas.widthProperty().bind(canvasBase1.widthProperty());
|
raceCanvas.widthProperty().bind(canvasBase1.widthProperty());
|
||||||
raceCanvas.heightProperty().bind(canvasBase1.heightProperty());
|
raceCanvas.heightProperty().bind(canvasBase1.heightProperty());
|
||||||
|
|
||||||
|
raceCanvas.setFullScreen(false);
|
||||||
|
|
||||||
canvasBase.getChildren().remove(raceCanvas);
|
canvasBase.getChildren().remove(raceCanvas);
|
||||||
canvasBase1.getChildren().add(0, raceCanvas);
|
canvasBase1.getChildren().add(0, raceCanvas);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,15 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
private VisualiserRaceState raceState;
|
private VisualiserRaceState raceState;
|
||||||
|
|
||||||
|
|
||||||
private boolean annoName = true;
|
private boolean annoName = false;
|
||||||
private boolean annoAbbrev = true;
|
private boolean annoAbbrev = true;
|
||||||
private boolean annoSpeed = true;
|
private boolean annoSpeed = false;
|
||||||
private boolean annoPath = true;
|
private boolean annoPath = true;
|
||||||
private boolean annoEstTime = true;
|
private boolean annoEstTime = false;
|
||||||
private boolean annoTimeSinceLastMark = true;
|
private boolean annoTimeSinceLastMark = false;
|
||||||
private boolean annoGuideLine = false;
|
private boolean annoGuideLine = true;
|
||||||
|
|
||||||
|
private boolean isFullScreen = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -293,7 +295,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
|
|
||||||
List<VisualiserBoat> boats = new ArrayList<>(raceState.getBoats());
|
List<VisualiserBoat> boats = new ArrayList<>(raceState.getBoats());
|
||||||
//Sort to ensure we draw boats in consistent order.
|
//Sort to ensure we draw boats in consistent order.
|
||||||
boats.sort(Comparator.comparingInt(Boat::getSourceID));
|
// boats.sort(Comparator.comparingInt(Boat::getSourceID));
|
||||||
|
|
||||||
//Current draw order:
|
//Current draw order:
|
||||||
// track points
|
// track points
|
||||||
@@ -302,29 +304,29 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
// text
|
// text
|
||||||
|
|
||||||
//Track points.
|
//Track points.
|
||||||
|
if (isFullScreen){
|
||||||
for (VisualiserBoat boat : boats) {
|
for (VisualiserBoat boat : boats) {
|
||||||
drawTrack(boat);
|
drawTrack(boat);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Wake.
|
|
||||||
for (VisualiserBoat boat : boats) {
|
|
||||||
//Only draw wake if they are currently racing.
|
|
||||||
if (boat.getStatus() == BoatStatusEnum.RACING) {
|
|
||||||
drawWake(boat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Boat.
|
|
||||||
for (VisualiserBoat boat : boats) {
|
|
||||||
drawBoat(boat);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Text.
|
//Text.
|
||||||
for (VisualiserBoat boat : boats) {
|
for (VisualiserBoat boat : boats) {
|
||||||
drawBoatText(boat);
|
drawBoatText(boat);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Wake.
|
||||||
|
// for (VisualiserBoat boat : boats) {
|
||||||
|
// //Only draw wake if they are currently racing.
|
||||||
|
// if (boat.getStatus() == BoatStatusEnum.RACING) {
|
||||||
|
// drawWake(boat);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//Boat.
|
||||||
|
for (VisualiserBoat boat : boats) {
|
||||||
|
drawBoat(boat);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -364,9 +366,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
gc.fillPolygon(x, y, x.length);
|
gc.fillPolygon(x, y, x.length);
|
||||||
gc.restore();
|
gc.restore();
|
||||||
|
|
||||||
if (boat.getSourceID() == ThisBoat.getInstance().getSourceID()) {
|
// if (boat.getSourceID() == ThisBoat.getInstance().getSourceID()) {
|
||||||
drawSails(boat);
|
// drawSails(boat);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -645,19 +647,23 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
//Race boundary.
|
//Race boundary.
|
||||||
drawBoundary();
|
drawBoundary();
|
||||||
|
|
||||||
//Guiding Line
|
//rounding lines
|
||||||
if (annoGuideLine){
|
if (isFullScreen){
|
||||||
|
drawRoundingLines();
|
||||||
drawRaceLine();
|
drawRaceLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Guiding Line
|
||||||
|
// if (annoGuideLine){
|
||||||
|
// drawRaceLine();
|
||||||
|
// }
|
||||||
|
|
||||||
//Boats.
|
//Boats.
|
||||||
drawBoats();
|
drawBoats();
|
||||||
|
|
||||||
//Marks.
|
//Marks.
|
||||||
drawMarks();
|
drawMarks();
|
||||||
|
|
||||||
//TEMP
|
|
||||||
drawRoundingLines();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,7 +758,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
gc.save();
|
gc.save();
|
||||||
|
|
||||||
gc.setLineWidth(2);
|
gc.setLineWidth(2);
|
||||||
gc.setStroke(Color.MEDIUMAQUAMARINE);
|
gc.setStroke(getLineColor(legs.get(index)));
|
||||||
|
|
||||||
|
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(startPath.getX(), startPath.getY());
|
gc.moveTo(startPath.getX(), startPath.getY());
|
||||||
@@ -772,7 +779,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
gc.save();
|
gc.save();
|
||||||
|
|
||||||
gc.setLineWidth(2);
|
gc.setLineWidth(2);
|
||||||
gc.setStroke(Color.MEDIUMAQUAMARINE);
|
gc.setStroke(getLineColor(legs.get(index)));
|
||||||
|
|
||||||
gc.beginPath();
|
gc.beginPath();
|
||||||
gc.moveTo(startPath.getX(), startPath.getY());
|
gc.moveTo(startPath.getX(), startPath.getY());
|
||||||
@@ -788,6 +795,21 @@ 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Color.MEDIUMAQUAMARINE;
|
||||||
|
}
|
||||||
|
|
||||||
private void drawArrowHead(GPSCoordinate start, GPSCoordinate end){
|
private void drawArrowHead(GPSCoordinate start, GPSCoordinate end){
|
||||||
|
|
||||||
GraphCoordinate lineStart = this.map.convertGPS(start);
|
GraphCoordinate lineStart = this.map.convertGPS(start);
|
||||||
@@ -862,6 +884,11 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFullScreen() {
|
||||||
|
return isFullScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullScreen(boolean fullScreen) {
|
||||||
|
isFullScreen = fullScreen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,23 +85,23 @@
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
</children>
|
</children>
|
||||||
</Pane>
|
</Pane>
|
||||||
<Label fx:id="timer" maxHeight="20.0" text="0:0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
<Label fx:id="timer" maxHeight="20.0" text="0:0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="15.0" />
|
<Font name="System Bold" size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
|
<padding>
|
||||||
|
<Insets top="20.0" />
|
||||||
|
</padding>
|
||||||
</Label>
|
</Label>
|
||||||
<Label fx:id="FPS" text="FPS: 0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
|
<Label fx:id="FPS" text="FPS: 0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="15.0" />
|
<Font name="System Bold" size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Label fx:id="timeZone" text="Label" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
<Label fx:id="timeZone" text="Label" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="15.0" />
|
<Font name="System Bold" size="15.0" />
|
||||||
</font>
|
</font>
|
||||||
<padding>
|
|
||||||
<Insets bottom="20.0" />
|
|
||||||
</padding>
|
|
||||||
</Label>
|
</Label>
|
||||||
<StackPane fx:id="arrowPane" alignment="TOP_RIGHT" mouseTransparent="true" prefHeight="150.0" prefWidth="150.0" snapToPixel="false" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<StackPane fx:id="arrowPane" alignment="TOP_RIGHT" mouseTransparent="true" prefHeight="150.0" prefWidth="150.0" snapToPixel="false" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</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" />
|
<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">
|
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0">
|
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0">
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
Reference in New Issue
Block a user