Commit 1306a43a authored by Magnus Schjølberg's avatar Magnus Schjølberg
Browse files

Minor fixes

parent 036b0ac6
package selfcheckout; package selfcheckout;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -27,22 +26,22 @@ public class SelfCheckoutController { ...@@ -27,22 +26,22 @@ public class SelfCheckoutController {
private List<Item> selectableItemsList; private List<Item> selectableItemsList;
@FXML @FXML
public Button login, adminMode, deleteItem, backButton, checkout, scanReceipt; private Button login, adminMode, deleteItem, backButton, checkout, scanReceipt;
@FXML @FXML
public TextArea checkoutText; private TextArea checkoutText;
@FXML @FXML
public TextField phoneNumber; private TextField phoneNumber;
@FXML @FXML
public GridPane itemGrid; private GridPane itemGrid;
@FXML @FXML
public ListView<String> scannedItemsList; private ListView<String> scannedItemsList;
@FXML @FXML
public void initialize() { private void initialize() {
initializeSelectableItemsList(); initializeSelectableItemsList();
selfCheckout = initializeSelfCheckout(); selfCheckout = initializeSelfCheckout();
updateCartDisplay(); updateCartDisplay();
...@@ -54,7 +53,7 @@ public class SelfCheckoutController { ...@@ -54,7 +53,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleLogin() { private void handleLogin() {
try { try {
selfCheckout.registerPhoneNumber(phoneNumber.getText()); selfCheckout.registerPhoneNumber(phoneNumber.getText());
updateCartDisplay(); updateCartDisplay();
...@@ -66,7 +65,7 @@ public class SelfCheckoutController { ...@@ -66,7 +65,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleCheckout() { private void handleCheckout() {
TextInputDialog dialog = new TextInputDialog(); TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("Write receipt"); dialog.setTitle("Write receipt");
dialog.setHeaderText("Gi et navn til kvitteringen slik at du kan hente den frem igjen senere"); dialog.setHeaderText("Gi et navn til kvitteringen slik at du kan hente den frem igjen senere");
...@@ -99,7 +98,7 @@ public class SelfCheckoutController { ...@@ -99,7 +98,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleAdminActivation() { private void handleAdminActivation() {
TextInputDialog dialog = new TextInputDialog(); TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("Admin login"); dialog.setTitle("Admin login");
dialog.setHeaderText("Skriv inn admin-passord for denne enheten for å fortsette"); dialog.setHeaderText("Skriv inn admin-passord for denne enheten for å fortsette");
...@@ -123,7 +122,7 @@ public class SelfCheckoutController { ...@@ -123,7 +122,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleAdminDeactivation() { private void handleAdminDeactivation() {
selfCheckout.deactivateAdminMode(); selfCheckout.deactivateAdminMode();
adminMode.visibleProperty().set(true); adminMode.visibleProperty().set(true);
backButton.visibleProperty().set(false); backButton.visibleProperty().set(false);
...@@ -133,7 +132,7 @@ public class SelfCheckoutController { ...@@ -133,7 +132,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleScanReceipt() { private void handleScanReceipt() {
TextInputDialog dialog = new TextInputDialog(); TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("Read receipt"); dialog.setTitle("Read receipt");
dialog.setHeaderText("Skriv inn navn på kvitteringen du vil scanne inn"); dialog.setHeaderText("Skriv inn navn på kvitteringen du vil scanne inn");
...@@ -162,7 +161,7 @@ public class SelfCheckoutController { ...@@ -162,7 +161,7 @@ public class SelfCheckoutController {
} }
@FXML @FXML
public void handleItemDeletion() { private void handleItemDeletion() {
int selectedIndex = scannedItemsList.getSelectionModel().getSelectedIndex(); int selectedIndex = scannedItemsList.getSelectionModel().getSelectedIndex();
if (selectedIndex != -1) { if (selectedIndex != -1) {
selfCheckout.removeFromCart(selectedIndex); selfCheckout.removeFromCart(selectedIndex);
......
...@@ -5,8 +5,6 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -5,8 +5,6 @@ import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import snakebird.Tile;
public class TileTest { public class TileTest {
private Tile tile; private Tile tile;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment