Map now only shows annotations when in full screen

#story[1295]
main
hba56 8 years ago
parent f3f60acac6
commit f7d866144a

@ -767,6 +767,8 @@ public class RaceViewController extends Controller {
raceCanvas.widthProperty().bind(canvasBase.widthProperty());
raceCanvas.heightProperty().bind(canvasBase.heightProperty());
raceCanvas.setFullScreen(true);
canvasBase1.getChildren().remove(raceCanvas);
canvasBase.getChildren().add(1, raceCanvas);
@ -774,6 +776,8 @@ public class RaceViewController extends Controller {
raceCanvas.widthProperty().bind(canvasBase1.widthProperty());
raceCanvas.heightProperty().bind(canvasBase1.heightProperty());
raceCanvas.setFullScreen(false);
canvasBase.getChildren().remove(raceCanvas);
canvasBase1.getChildren().add(0, raceCanvas);
}

@ -44,13 +44,15 @@ public class ResizableRaceCanvas extends ResizableCanvas {
private VisualiserRaceState raceState;
private boolean annoName = true;
private boolean annoName = false;
private boolean annoAbbrev = true;
private boolean annoSpeed = true;
private boolean annoSpeed = false;
private boolean annoPath = true;
private boolean annoEstTime = true;
private boolean annoTimeSinceLastMark = true;
private boolean annoGuideLine = false;
private boolean annoEstTime = false;
private boolean annoTimeSinceLastMark = 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());
//Sort to ensure we draw boats in consistent order.
boats.sort(Comparator.comparingInt(Boat::getSourceID));
// boats.sort(Comparator.comparingInt(Boat::getSourceID));
//Current draw order:
// track points
@ -302,29 +304,29 @@ public class ResizableRaceCanvas extends ResizableCanvas {
// text
//Track points.
for (VisualiserBoat boat : boats) {
drawTrack(boat);
}
if (isFullScreen){
for (VisualiserBoat boat : boats) {
drawTrack(boat);
}
//Wake.
for (VisualiserBoat boat : boats) {
//Only draw wake if they are currently racing.
if (boat.getStatus() == BoatStatusEnum.RACING) {
drawWake(boat);
//Text.
for (VisualiserBoat boat : boats) {
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);
}
//Text.
for (VisualiserBoat boat : boats) {
drawBoatText(boat);
}
}
/**
@ -364,9 +366,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
gc.fillPolygon(x, y, x.length);
gc.restore();
if (boat.getSourceID() == ThisBoat.getInstance().getSourceID()) {
drawSails(boat);
}
// if (boat.getSourceID() == ThisBoat.getInstance().getSourceID()) {
// drawSails(boat);
// }
}
/**
@ -645,19 +647,23 @@ public class ResizableRaceCanvas extends ResizableCanvas {
//Race boundary.
drawBoundary();
//Guiding Line
if (annoGuideLine){
//rounding lines
if (isFullScreen){
drawRoundingLines();
drawRaceLine();
}
//Guiding Line
// if (annoGuideLine){
// drawRaceLine();
// }
//Boats.
drawBoats();
//Marks.
drawMarks();
//TEMP
drawRoundingLines();
}
@ -752,7 +758,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
gc.save();
gc.setLineWidth(2);
gc.setStroke(Color.MEDIUMAQUAMARINE);
gc.setStroke(getLineColor(legs.get(index)));
gc.beginPath();
gc.moveTo(startPath.getX(), startPath.getY());
@ -772,7 +779,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
gc.save();
gc.setLineWidth(2);
gc.setStroke(Color.MEDIUMAQUAMARINE);
gc.setStroke(getLineColor(legs.get(index)));
gc.beginPath();
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){
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>
</children>
</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 name="System Bold" size="15.0" />
</font>
<padding>
<Insets top="20.0" />
</padding>
</Label>
<Label fx:id="FPS" text="FPS: 0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
<font>
<Font name="System Bold" size="15.0" />
</font>
</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 name="System Bold" size="15.0" />
</font>
<padding>
<Insets bottom="20.0" />
</padding>
</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">
<children>
@ -109,7 +109,7 @@
</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">
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
<children>
<AnchorPane maxHeight="200.0" maxWidth="200.0" prefHeight="200.0" prefWidth="216.0">
<children>

Loading…
Cancel
Save