Reformating of code to google style.

#story[955]
This commit is contained in:
William Muir
2017-05-17 00:34:36 +12:00
parent 2d5a7a8a49
commit afd97d6e05
@@ -35,6 +35,7 @@ import java.util.*;
* Created by ptg19 on 29/03/17. * Created by ptg19 on 29/03/17.
*/ */
public class RaceViewController extends Thread implements ImportantAnnotationDelegate { public class RaceViewController extends Thread implements ImportantAnnotationDelegate {
@FXML @FXML
private VBox positionVbox; private VBox positionVbox;
@FXML @FXML
@@ -90,6 +91,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
/** /**
* The important annotations have been changed, update this view * The important annotations have been changed, update this view
*
* @param importantAnnotationsState The current state of the selected annotations * @param importantAnnotationsState The current state of the selected annotations
*/ */
public void importantAnnotationsChanged(ImportantAnnotationsState importantAnnotationsState) { public void importantAnnotationsChanged(ImportantAnnotationsState importantAnnotationsState) {
@@ -106,11 +108,13 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
Stage stage = new Stage(); Stage stage = new Stage();
// Set controller // Set controller
ImportantAnnotationController controller = new ImportantAnnotationController(this, stage); ImportantAnnotationController controller = new ImportantAnnotationController(this,
stage);
fxmlLoader.setController(controller); fxmlLoader.setController(controller);
// Load FXML and set CSS // Load FXML and set CSS
fxmlLoader.setLocation(getClass().getResource("/views/importantAnnotationSelectView.fxml")); fxmlLoader
.setLocation(getClass().getResource("/views/importantAnnotationSelectView.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 469, 248); Scene scene = new Scene(fxmlLoader.load(), 469, 248);
scene.getStylesheets().add(getClass().getResource("/css/master.css").toString()); scene.getStylesheets().add(getClass().getResource("/css/master.css").toString());
stage.initStyle(StageStyle.UNDECORATED); stage.initStyle(StageStyle.UNDECORATED);
@@ -136,9 +140,15 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
annotationSlider.setLabelFormatter(new StringConverter<Double>() { annotationSlider.setLabelFormatter(new StringConverter<Double>() {
@Override @Override
public String toString(Double n) { public String toString(Double n) {
if (n == 0) return "None"; if (n == 0) {
if (n == 1) return "Important"; return "None";
if (n == 2) return "All"; }
if (n == 1) {
return "Important";
}
if (n == 2) {
return "All";
}
return "All"; return "All";
} }
@@ -218,13 +228,15 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
* in the boat selection combo box * in the boat selection combo box
*/ */
private void updateBoatSelectionComboBox() { private void updateBoatSelectionComboBox() {
ObservableList<Yacht> observableBoats = FXCollections.observableArrayList(StreamParser.getBoatsPos().values()); ObservableList<Yacht> observableBoats = FXCollections
.observableArrayList(StreamParser.getBoatsPos().values());
boatSelectionComboBox.setItems(observableBoats); boatSelectionComboBox.setItems(observableBoats);
} }
/** /**
* Updates the order of the boats as from the StreamParser and sets them in the boat order section * Updates the order of the boats as from the StreamParser and sets them in the boat order
* section
*/ */
private void updateOrder() { private void updateOrder() {
positionVbox.getChildren().clear(); positionVbox.getChildren().clear();
@@ -332,34 +344,31 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
/** /**
* Display the important annotations for a specific BoatGroup * Display the important annotations for a specific BoatGroup
*
* @param bg The boat group to set the annotations for * @param bg The boat group to set the annotations for
*/ */
private void setBoatGroupImportantAnnotations(BoatGroup bg) { private void setBoatGroupImportantAnnotations(BoatGroup bg) {
if (importantAnnotations.getAnnotationState(Annotation.NAME)) { if (importantAnnotations.getAnnotationState(Annotation.NAME)) {
bg.setTeamNameObjectVisible(true); bg.setTeamNameObjectVisible(true);
} } else {
else{
bg.setTeamNameObjectVisible(false); bg.setTeamNameObjectVisible(false);
} }
if (importantAnnotations.getAnnotationState(Annotation.SPEED)) { if (importantAnnotations.getAnnotationState(Annotation.SPEED)) {
bg.setVelocityObjectVisible(true); bg.setVelocityObjectVisible(true);
} } else {
else{
bg.setVelocityObjectVisible(false); bg.setVelocityObjectVisible(false);
} }
if (importantAnnotations.getAnnotationState(Annotation.TRACK)) { if (importantAnnotations.getAnnotationState(Annotation.TRACK)) {
bg.setLineGroupVisible(true); bg.setLineGroupVisible(true);
} } else {
else{
bg.setLineGroupVisible(false); bg.setLineGroupVisible(false);
} }
if (importantAnnotations.getAnnotationState(Annotation.WAKE)) { if (importantAnnotations.getAnnotationState(Annotation.WAKE)) {
bg.setWakeVisible(true); bg.setWakeVisible(true);
} } else {
else{
bg.setWakeVisible(false); bg.setWakeVisible(false);
} }
} }
@@ -405,6 +414,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
/** /**
* Sets all the annotations of the selected boat to be visible and all others to be hidden * Sets all the annotations of the selected boat to be visible and all others to be hidden
*
* @param yacht The yacht for which we want to view all annotations * @param yacht The yacht for which we want to view all annotations
*/ */
private void setSelectedBoat(Yacht yacht) { private void setSelectedBoat(Yacht yacht) {