@ -12,7 +12,6 @@ import shared.model.GPSCoordinate;
import shared.model.Mark ;
import shared.model.Mark ;
import shared.model.RaceClock ;
import shared.model.RaceClock ;
import java.time.Duration ;
import java.util.List ;
import java.util.List ;
/ * *
/ * *
@ -39,12 +38,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
* /
* /
private VisualiserRace visualiserRace ;
private VisualiserRace visualiserRace ;
/ * *
* The background of the race .
* We render the background whenever the race boundary changes , or the screen size changes .
* /
private Image background ;
private boolean annoName = true ;
private boolean annoName = true ;
private boolean annoAbbrev = true ;
private boolean annoAbbrev = true ;
@ -407,13 +400,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
this . map . setWidth ( ( int ) getWidth ( ) ) ;
this . map . setWidth ( ( int ) getWidth ( ) ) ;
this . map . setHeight ( ( int ) getHeight ( ) ) ;
this . map . setHeight ( ( int ) getHeight ( ) ) ;
//Redraw the boundary.
redrawBoundaryImage ( ) ;
//Draw the race.
//Draw the race.
drawRace ( ) ;
drawRace ( ) ;
}
}
@ -426,15 +415,13 @@ public class ResizableRaceCanvas extends ResizableCanvas {
/ * *
/ * *
* Draws the race boundary , and saves the image to { @link # background } .
* Draws the race boundary .
* You should call { @link # clear ( ) } before calling this .
* /
* /
private void re drawBoundaryImage ( ) {
private void drawBoundary( ) {
//Prepare to draw.
//Prepare to draw.
gc . setLineWidth ( 1 ) ;
gc . setLineWidth ( 1 ) ;
gc . setFill ( Color . AQUA ) ;
gc . setFill ( Color . AQUA ) ;
gc . drawImage ( new Image ( getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "images/WaterBackground.png" ) ) , 0 , 0 ) ;
//Calculate the screen coordinates of the boundary.
//Calculate the screen coordinates of the boundary.
@ -454,9 +441,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
//Draw the boundary.
//Draw the boundary.
gc . fillPolygon ( xpoints , ypoints , xpoints . length ) ;
gc . fillPolygon ( xpoints , ypoints , xpoints . length ) ;
//Render boundary to image.
this . background = snapshot ( null , null ) ;
}
}
/ * *
/ * *
@ -481,15 +465,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
}
}
/ * *
* Draws the race boundary image onto the canvas .
* See { @link # background } .
* /
private void drawBoundary ( ) {
gc . drawImage ( this . background , 0 , 0 ) ;
}