diff --git a/doc/reports/checkstyle/20190401_checkstyle.png b/doc/reports/checkstyle/20190401_checkstyle.png new file mode 100644 index 0000000..93d3ed6 Binary files /dev/null and b/doc/reports/checkstyle/20190401_checkstyle.png differ diff --git a/src/Client/src/main/java/greenify/client/controller/CalculatorController.java b/src/Client/src/main/java/greenify/client/controller/CalculatorController.java index 02eb580..e860ec3 100644 --- a/src/Client/src/main/java/greenify/client/controller/CalculatorController.java +++ b/src/Client/src/main/java/greenify/client/controller/CalculatorController.java @@ -472,16 +472,16 @@ public class CalculatorController { servicesLabel.getText().replace("€ / month", "")); } Float footprint = userService.saveFootprint(userService.currentUser.getName()); - if(localProduceCheckbox.isSelected()) { + if (localProduceCheckbox.isSelected()) { controller.localProduce.setSelected(true); } - if(bikeCheckbox.isSelected()) { + if (bikeCheckbox.isSelected()) { controller.bike.setSelected(true); } - if(temperatureCheckbox.isSelected()) { + if (temperatureCheckbox.isSelected()) { controller.loweringTemp.setSelected(true); } - if(solarPanelsCheckbox.isSelected()) { + if (solarPanelsCheckbox.isSelected()) { controller.solarPanels.setSelected(true); } Window owner = saveButton.getScene().getWindow(); diff --git a/src/Client/src/main/java/greenify/client/controller/DashBoardController.java b/src/Client/src/main/java/greenify/client/controller/DashBoardController.java index 21622c3..19d8623 100644 --- a/src/Client/src/main/java/greenify/client/controller/DashBoardController.java +++ b/src/Client/src/main/java/greenify/client/controller/DashBoardController.java @@ -41,6 +41,21 @@ public class DashBoardController { public ObservableList friendLeaderData = FXCollections.observableArrayList(); public ObservableList globalLeaderData = FXCollections.observableArrayList(); + //these need to be public because they are used by the calculatorController + //suppressing the checkstyle warnings because the fields have to be public + @SuppressWarnings("CheckStyle") + @FXML + public CheckBox localProduce; + @SuppressWarnings("CheckStyle") + @FXML + public CheckBox loweringTemp; + @SuppressWarnings("CheckStyle") + @FXML + public CheckBox bike; + @SuppressWarnings("CheckStyle") + @FXML + public CheckBox solarPanels; + @Autowired UserService userService; @@ -145,21 +160,6 @@ public class DashBoardController { @FXML private Label snacks; - //these need to be public because they are used by the calculatorController - //suppressing the checkstyle warnings because the fields have to be public - @SuppressWarnings("CheckStyle") - @FXML - public CheckBox localProduce; - @SuppressWarnings("CheckStyle") - @FXML - public CheckBox loweringTemp; - @SuppressWarnings("CheckStyle") - @FXML - public CheckBox bike; - @SuppressWarnings("CheckStyle") - @FXML - public CheckBox solarPanels; - /** * Loads the the necessary things before anything else. */ diff --git a/src/Client/src/main/java/greenify/client/rest/UserService.java b/src/Client/src/main/java/greenify/client/rest/UserService.java index 9cdd50f..c512dda 100644 --- a/src/Client/src/main/java/greenify/client/rest/UserService.java +++ b/src/Client/src/main/java/greenify/client/rest/UserService.java @@ -1,6 +1,5 @@ package greenify.client.rest; -import com.sun.javafx.collections.MappingChange; import greenify.common.UserDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.client.RestTemplateBuilder; @@ -13,8 +12,6 @@ import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; -import java.awt.*; -import java.util.HashMap; import java.util.List; import java.util.Map;