Browse Source

Icons added, some Labels changed

Martin Herbers 6 years ago
parent
commit
93b24d9235

+ 10 - 10
src/model/Specifications.java

@@ -22,7 +22,7 @@ import java.util.List;
 public class Specifications {
 	public static List<String> getSqueezeSpecs() {
 		List<String> squeeze = Arrays.asList( 
-				"Name:Squeeze",
+				"Name:Pressure",
 				"Shape:[C;0;0;26][R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + (Settings.getSettings().getSizeScreen() + 4) + ";" + (Settings.getSettings().getSizeScreen() + 4) + "]",
 				"Contact:[R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + Settings.getSettings().getSizeScreen() + ";" + Settings.getSettings().getSizeScreen() + "]",
 				"ButtonTrue:The object got squeezed!",
@@ -33,7 +33,7 @@ public class Specifications {
 	
 	public static List<String> getWeightSpecs() {
 		List<String> weight = Arrays.asList( 
-				"Name:Weight " + (Settings.getSettings().getWeight()/10.0f) + "kg",
+				"Name:Load " + (Settings.getSettings().getWeight()/10.0f) + "kg",
 				"Shape:[R;0;0;20;61]",
 				"Contact:[C;0;1;" + Settings.getSettings().getSizeScreen() + "]",
 				"ButtonTrue:A weight of more than " + (Settings.getSettings().getWeight()/10.0f) + " Kg was applied!",
@@ -45,10 +45,10 @@ public class Specifications {
 			
 	public static List<String> getTemperatureMeltSpecs() {
 		List<String> temperatureMelt = Arrays.asList( 
-				"Name:Melt",
+				"Name:Rising Temperature",
 				"Shape:[R;0;0;20;42][R;0;-20;10;2]",
 				"Contact:[C;0;3;" + Settings.getSettings().getSizeScreen() + "]",
-				"ButtonTrue:The object was stored above 0°C!",
+				"ButtonTrue:The object was stored above 0�C!",
 				"ButtonFalse:The object was cooled the whole time."
 			);
 		
@@ -57,11 +57,11 @@ public class Specifications {
 	
 	public static List<String> getTemperatureFreezeSpecs() {
 		List<String> temperatureFreeze = Arrays.asList(
-				"Name:Freeze",
+				"Name:Falling Temperature",
 				"Shape:[R;0;0;20;43][C;10;-8;6]",
 				"Contact:[C;0;7;" + Settings.getSettings().getSizeScreen() + "]",
-				"ButtonTrue:The object was stored below 0°C!",
-				"ButtonFalse:The object was above 0°C the whole time."
+				"ButtonTrue:The object was stored below 0�C!",
+				"ButtonFalse:The object was above 0�C the whole time."
 				);
 		
 		return temperatureFreeze;
@@ -69,11 +69,11 @@ public class Specifications {
 
 	public static List<String> getAccelerationSpecs() {
 		List<String> acceleration = Arrays.asList( 
-				"Name:Acceleration " + Settings.getSettings().getAcceleration() + "m/s²",
+				"Name:Acceleration " + Settings.getSettings().getAcceleration() + "m/s�",
 				"Shape:[R;0;0;20;40][C;0;-10;6][C;0;10;6]",
 				"Contact:[C;0;10;" + Settings.getSettings().getSizeScreen() + "]",
-				"ButtonTrue:The object was accelerated with " + Settings.getSettings().getAcceleration() + "m/s²!",
-				"ButtonFalse:The object was accelerated with less than " + Settings.getSettings().getAcceleration() + "m/s²."
+				"ButtonTrue:The object was accelerated with " + Settings.getSettings().getAcceleration() + "m/s�!",
+				"ButtonFalse:The object was accelerated with less than " + Settings.getSettings().getAcceleration() + "m/s�."
 			 );
 	
 		return acceleration;	

BIN
src/pictures/flame.png


BIN
src/pictures/flip.png


BIN
src/pictures/snowflake.png


BIN
src/pictures/tilt.png


+ 59 - 37
src/ui/Main.java

@@ -62,7 +62,7 @@ public class Main extends Application {
     private Label weightLabel;
     private CheckBox tempCheckBox;
     private Label tempLabel;
-    private CheckBox rotationCheckBox;
+    private CheckBox tiltingCheckBox;
     private Label rotationLabel;
     private CheckBox pressureCheckBox;
     private Label pressureLabel;
@@ -171,18 +171,21 @@ public class Main extends Application {
 			event.consume();
 		});
 
+
+
+
         Node nodeRotation = root.lookup("#rotationPane");
         TitledPane paneRotation = (TitledPane) nodeRotation;
         BorderPane borderPaneRotation = new BorderPane();
-        rotationCheckBox = new CheckBox();
-        borderPaneRotation.setLeft(rotationCheckBox);
-		BorderPane.setAlignment(rotationCheckBox, Pos.CENTER_LEFT);
-        rotationLabel = new Label(" Rotation");
+        tiltingCheckBox = new CheckBox();
+        borderPaneRotation.setLeft(tiltingCheckBox);
+		BorderPane.setAlignment(tiltingCheckBox, Pos.CENTER_LEFT);
+        rotationLabel = new Label(" Tilting");
         rotationLabel.setOnMouseClicked(new EventHandler<MouseEvent>() {
 			@Override
 			public void handle(MouseEvent event) {
-				rotationCheckBox.setSelected(!rotationCheckBox.isSelected());
-				rotationClicked();
+				tiltingCheckBox.setSelected(!tiltingCheckBox.isSelected());
+				tiltingClicked();
 			}
 		});
 		Image imgRotationSymbol = new Image(getClass().getResource("/pictures/rotation.png").toString());
@@ -192,8 +195,8 @@ public class Main extends Application {
 		rotationLabel.setGraphic(imViewRotationSymbol);
         borderPaneRotation.setCenter(rotationLabel);
         paneRotation.setGraphic(borderPaneRotation);
-        rotationCheckBox.setOnAction(event -> {
-			rotationClicked();
+        tiltingCheckBox.setOnAction(event -> {
+			tiltingClicked();
 			event.consume();
 		});
 
@@ -300,17 +303,6 @@ public class Main extends Application {
 		Collections.swap(loadWorkingCollection, 2, 3);
 		loadHBox.getChildren().setAll(loadWorkingCollection);
 
-      /*  ((ScrollBar) root.lookup("#accelerationScrollBar")).valueProperty().addListener((observable, oldValue, newValue) -> {
-			double d = newValue.intValue();
-			Controller.getC().setAcceleration(d);
-			((Label) root.lookup("#accelerationLabel")).setText("Acceleration limit: " + d + " m/s²");
-		});
-
-        ((ScrollBar) root.lookup("#weightScrollBar")).valueProperty().addListener((observable, oldValue, newValue) -> {
-			int w = newValue.intValue();
-			Controller.getC().setWeight(w);
-			((Label) root.lookup("#weightLabel")).setText("Load limit: " + (w/10.0) + " Kg");
-		});*/
 
         ToggleGroup groupTemp = new ToggleGroup();
         ((RadioButton) root.lookup("#temperatureRadio1")).setToggleGroup(groupTemp);
@@ -480,15 +472,6 @@ public class Main extends Application {
 					Export.saveFilesTo(file);
 				}
 			});
-		/*	JFileChooser chooser = new JFileChooser();
-			chooser.setCurrentDirectory(new File("."));
-			chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-			chooser.setAcceptAllFileFilterUsed(false);
-			chooser.showOpenDialog(null);
-
-			if (chooser.getSelectedFile() != null) {
-				Export.saveFilesTo(chooser.getSelectedFile());
-			}*/
 		});
 
         Image image = new Image(getClass().getResource("/pictures/information-icon-6086.png").toString());
@@ -527,6 +510,34 @@ public class Main extends Application {
 		imageViewSettings.setFitHeight(20);
 		((Button)root.lookup("#settingsButton")).setGraphic(imageViewSettings);
 
+		Image imgSnowflake = new Image(getClass().getResource("/pictures/snowflake.png").toString());
+		ImageView snowflakeIV = new ImageView(imgSnowflake);
+		snowflakeIV.setFitWidth(20);
+		snowflakeIV.setFitHeight(20);
+		Label snowflakeLabel = (Label) root.lookup("#temperatureFallingLabel");
+		snowflakeLabel.setGraphic(snowflakeIV);
+
+		Image imgFlame = new Image(getClass().getResource("/pictures/flame.png").toString());
+		ImageView flameIV = new ImageView(imgFlame);
+		flameIV.setFitWidth(20);
+		flameIV.setFitHeight(20);
+		Label flameLabel = (Label) root.lookup("#temperatureRisingLabel");
+		flameLabel.setGraphic(flameIV);
+
+		Image imgTilt = new Image(getClass().getResource("/pictures/tilt.png").toString());
+		ImageView tiltIV = new ImageView(imgTilt);
+		tiltIV.setFitWidth(20);
+		tiltIV.setFitHeight(20);
+		Label tiltLabel = (Label) root.lookup("#tiltLabel");
+		tiltLabel.setGraphic(tiltIV);
+
+		Image imgFlip = new Image(getClass().getResource("/pictures/flip.png").toString());
+		ImageView flipIV = new ImageView(imgFlip);
+		flipIV.setFitWidth(20);
+		flipIV.setFitHeight(20);
+		Label flipLabel = (Label) root.lookup("#flipLabel");
+		flipLabel.setGraphic(flipIV);
+
 
         glassPane = new StackPane();
         glassPane.setStyle("-fx-background-color: rgba(0, 0, 0, 0.2);");
@@ -640,7 +651,7 @@ public class Main extends Application {
 		createObjectButton.setDisable(!disable);
 		disableWeight();
 		disableTemperature();
-		disableRotation();
+		disableTilting();
 		disablePressure();
 
 		root.lookup("#accelerationLabel").setDisable(!disable);
@@ -662,7 +673,7 @@ public class Main extends Application {
 		createObjectButton.setDisable(!disable);
 		disableAcceleration();
 		disableTemperature();
-		disableRotation();
+		disableTilting();
 		disablePressure();
 
 		root.lookup("#weightLabel").setDisable(!disable);
@@ -684,9 +695,12 @@ public class Main extends Application {
 		createObjectButton.setDisable(!disable);
 		disableWeight();
 		disableAcceleration();
-		disableRotation();
+		disableTilting();
 		disablePressure();
 
+		root.lookup("#temperatureRisingLabel").setDisable(!disable);
+		root.lookup("#temperatureFallingLabel").setDisable(!disable);
+
 		root.lookup("#temperatureRadio1").setDisable(!disable);
 		root.lookup("#temperatureRadio2").setDisable(!disable);
 
@@ -698,10 +712,12 @@ public class Main extends Application {
 		Controller.getC().temperature(false);
 		root.lookup("#temperatureRadio1").setDisable(true);
 		root.lookup("#temperatureRadio2").setDisable(true);
+		root.lookup("#temperatureRisingLabel").setDisable(true);
+		root.lookup("#temperatureFallingLabel").setDisable(true);
 	}
 
-	private void rotationClicked() {
-		boolean disable = rotationCheckBox.isSelected();
+	private void tiltingClicked() {
+		boolean disable = tiltingCheckBox.isSelected();
 
 		createObjectButton.setDisable(!disable);
 		disableWeight();
@@ -712,14 +728,20 @@ public class Main extends Application {
 		root.lookup("#rotationRadio1").setDisable(!disable);
 		root.lookup("#rotationRadio2").setDisable(!disable);
 
+		root.lookup("#tiltLabel").setDisable(!disable);
+		root.lookup("#flipLabel").setDisable(!disable);
+
 		Controller.getC().tilt(disable);
 	}
 
-	private void disableRotation() {
-		rotationCheckBox.setSelected(false);
+	private void disableTilting() {
+		tiltingCheckBox.setSelected(false);
 		Controller.getC().tilt(false);
 		root.lookup("#rotationRadio1").setDisable(true);
 		root.lookup("#rotationRadio2").setDisable(true);
+
+		root.lookup("#tiltLabel").setDisable(true);
+		root.lookup("#flipLabel").setDisable(true);
 	}
 
 	private void pressureClicked() {
@@ -728,7 +750,7 @@ public class Main extends Application {
 		createObjectButton.setDisable(!disable);
 		disableWeight();
 		disableTemperature();
-		disableRotation();
+		disableTilting();
 		disableAcceleration();
 
 		//root.lookup("#pressureContent").setDisable(!disable);

+ 8 - 4
src/ui/MainWindow.fxml

@@ -88,14 +88,16 @@
                      <children>
                         <HBox alignment="CENTER_LEFT">
                            <children>
-                              <RadioButton id="temperatureRadio1" fx:id="temperatureRadio1" disable="true" mnemonicParsing="false" prefHeight="27.0" prefWidth="413.0" selected="true" text="Check for rising temperature" />
+                              <RadioButton id="temperatureRadio1" fx:id="temperatureRadio1" disable="true" mnemonicParsing="false" prefHeight="27.0" prefWidth="0.0" selected="true" />
+                              <Label id="temperatureRisingLabel" fx:id="temperatureRisingLabel" disable="true" prefHeight="27.0" prefWidth="422.0" text="Check for rising temperature" />
                               <Region prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
                               <Button fx:id="meltInfo" mnemonicParsing="false" onAction="#openTemperatureUpInfo" />
                            </children>
                         </HBox>
                         <HBox alignment="CENTER_LEFT">
                            <children>
-                              <RadioButton id="temperatureRadio2" fx:id="temperatureRadio2" disable="true" mnemonicParsing="false" prefHeight="27.0" prefWidth="409.0" text="Check for falling temperature" />
+                              <RadioButton id="temperatureRadio2" fx:id="temperatureRadio2" disable="true" mnemonicParsing="false" prefHeight="27.0" prefWidth="15.0" />
+                              <Label id="temperatureFallingLabel" fx:id="temperatureFallingLabel" disable="true" prefHeight="27.0" prefWidth="1186.0" text="Check for falling temperature" />
                               <Region prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
                               <Button fx:id="freezeInfo" mnemonicParsing="false" onAction="#openTemperatureDownInfo" />
                            </children>
@@ -113,14 +115,16 @@
                      <children>
                         <HBox alignment="CENTER_LEFT">
                            <children>
-                              <RadioButton id="rotationRadio1" fx:id="rotationRadio1" disable="true" mnemonicParsing="false" selected="true" text="Rotate by 90°" />
+                              <RadioButton id="rotationRadio1" fx:id="rotationRadio1" disable="true" mnemonicParsing="false" selected="true" />
+                              <Label fx:id="tiltLabel" disable="true" prefHeight="27.0" prefWidth="298.0" text="Tilt (90°)" />
                               <Region prefWidth="0.0" HBox.hgrow="ALWAYS" />
                               <Button fx:id="tiltInfo" mnemonicParsing="false" onAction="#openTiltInfo" />
                            </children>
                         </HBox>
                         <HBox alignment="CENTER_LEFT">
                            <children>
-                              <RadioButton id="rotationRadio2" fx:id="rotationRadio2" disable="true" mnemonicParsing="false" text="Flip Over by 180°" />
+                              <RadioButton id="rotationRadio2" fx:id="rotationRadio2" disable="true" mnemonicParsing="false" />
+                              <Label fx:id="flipLabel" disable="true" prefHeight="27.0" prefWidth="425.0" text="Flip (180°)" />
                               <Region HBox.hgrow="ALWAYS" />
                               <Button fx:id="flipInfo" mnemonicParsing="false" onAction="#openFlipInfo" />
                            </children>