merged Dev in

Fixed concurrency exception

#story[1276] #pair[zyt10, ajm412]
This commit is contained in:
Zhi You Tan
2017-09-28 16:40:50 +13:00
parent 6fafb02a8f
commit f7fd5494ef
2 changed files with 16 additions and 24 deletions
@@ -7,39 +7,33 @@ import java.util.ArrayList;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
import javafx.animation.Timeline;
import javafx.animation.RotateTransition;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.SubScene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Line;
import javafx.scene.shape.Polyline;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.util.Duration;
import seng302.model.ClientYacht;
import seng302.model.RaceState;
import seng302.model.mark.CompoundMark;
import seng302.model.stream.xml.parser.RaceXMLData;
import seng302.model.token.TokenType;
import seng302.utilities.Sounds;
import seng302.visualiser.GameView3D;
import seng302.visualiser.controllers.annotations.ImportantAnnotationController;
import seng302.visualiser.controllers.annotations.ImportantAnnotationDelegate;
import seng302.visualiser.controllers.annotations.ImportantAnnotationsState;
import seng302.visualiser.controllers.cells.WindCell;
import seng302.visualiser.MiniMap;
import seng302.visualiser.controllers.cells.WindCell;
import seng302.visualiser.controllers.dialogs.FinishDialogController;
import seng302.visualiser.fxObjects.ChatHistory;
@@ -1,7 +1,7 @@
package seng302.visualiser.controllers.cells;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
import javafx.application.Platform;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ReadOnlyDoubleWrapper;
import javafx.fxml.FXML;
@@ -60,9 +60,9 @@ public class WindCell {
for (DoubleProperty o : Arrays.asList(playerYacht.getHeadingProperty(), windDirection)) {
o.addListener((obs, oldValue, newValue) -> {
Platform.runLater(() -> {
if (isChaseCam) {
camera.getTransforms().clear();
try {
for (Transform t : chaseCam.getTransforms()) {
if (t instanceof Rotate) {
camera.getTransforms().add(t);
@@ -71,9 +71,6 @@ public class WindCell {
this.camera.getTransforms().addAll(
new Translate(-55, -60, 0)
);
} catch (ConcurrentModificationException cme) {
}
}
windArrowModel.getAssets().getTransforms().clear();
@@ -82,6 +79,7 @@ public class WindCell {
new Point3D(0, 0, 1))
);
});
});
}
}