Commit f141c801 authored by Carl Gützkow's avatar Carl Gützkow
Browse files

fix: change image selection with image position

parent ebb29e76
Pipeline #183997 passed with stages
in 44 seconds
......@@ -40,17 +40,7 @@ public class App extends Application {
stage.setMaximized(true);
stage.setScene(new Scene(new AnchorPane()));
stage.getScene().getStylesheets().add("stylesheet.css");
try {
Path currentPath = Paths.get("").toAbsolutePath();
String imagePath = Paths.get(currentPath.toString(), "src","main","resources","icons", "wargames-logo.png").toString();
Image image = new Image(imagePath);
stage.getIcons().add(image);
} catch(IllegalArgumentException | NullPointerException e) {
e.printStackTrace();
new DialogBoxBuilder(ERROR).setMessage("Failed loading in image. \nError message: " + e.getMessage())
.build().show();
}
stage.getIcons().add(new Image("wargames-logo.png"));
if (changeScene("battle-armies.fxml"))
stage.show();
......
......@@ -102,15 +102,8 @@ public class BattleController implements Initializable {
"In the process " + simulation.getImportedLinesSkipped().size() + " units were corrupted.\n" +
"Expand the \"Show details\" button to see all corrupted lines."
)
.setListMessage(simulation.getImportedLinesSkipped());
try {
Path currentPath = Paths.get("").toAbsolutePath();
String imagePath = Paths.get(currentPath.toString(), "src","main","resources","icons", "corrupt-file.png").toString();
dialogBoxBuilder.setImage(imagePath);
} catch(IllegalArgumentException | NullPointerException e) {
new DialogBoxBuilder(ERROR).setMessage("Failed loading in image. \nError message: " + e.getMessage())
.build().show();
}
.setListMessage(simulation.getImportedLinesSkipped())
.setImage("corrupt-file.png");
}
dialogBoxBuilder.build().showAndWait();
......
......@@ -36,7 +36,7 @@
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
<Image url="@icons/folder.png" />
<Image url="@folder.png" />
</ImageView>
<Button alignment="CENTER" mnemonicParsing="false" onAction="#importArmyOne" text="Import army">
<HBox.margin>
......@@ -181,7 +181,7 @@
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
<Image url="@icons/folder.png" />
<Image url="@folder.png" />
</ImageView>
<Button alignment="CENTER" mnemonicParsing="false" onAction="#importArmyTwo" text="Import army">
<HBox.margin>
......
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