generated from marcin-chwedczuk/javafx-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marcin Chwedczuk
committed
Dec 31, 2021
1 parent
8775123
commit 10d4282
Showing
8 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
gui/src/main/java/pl/marcinchwedczuk/elfviewer/gui/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
gui/src/main/java/pl/marcinchwedczuk/elfviewer/gui/aboutdialog/AboutDialog.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Hyperlink?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.image.Image?> | ||
<?import javafx.scene.image.ImageView?> | ||
<?import javafx.scene.layout.AnchorPane?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.RowConstraints?> | ||
<?import javafx.scene.text.Font?> | ||
|
||
<GridPane fx:id="rootElement" hgap="4.0" vgap="4.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="pl.marcinchwedczuk.elfviewer.gui.aboutdialog.AboutDialog"> | ||
<rowConstraints> | ||
<RowConstraints minHeight="10.0" vgrow="ALWAYS" /> | ||
</rowConstraints> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" /> | ||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" /> | ||
</columnConstraints> | ||
<children> | ||
<ImageView fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.rowSpan="2147483647"> | ||
<image> | ||
<Image url="@about-panache.jpg" /> | ||
</image> | ||
</ImageView> | ||
<AnchorPane GridPane.columnIndex="1"> | ||
<children> | ||
<Button cancelButton="true" defaultButton="true" layoutX="163.0" layoutY="314.0" minWidth="100.0" mnemonicParsing="false" onAction="#guiClose" text="OK" /> | ||
<Label layoutX="3.0" layoutY="14.0" text="Elf Viewer"> | ||
<font> | ||
<Font name="System Bold" size="24.0" /> | ||
</font> | ||
</Label> | ||
<Label layoutX="3.0" layoutY="43.0" text="by Marcin "0xmarcin" Chwedczuk" /> | ||
<Label layoutX="3.0" layoutY="60.0" text="MIT License" /> | ||
<Hyperlink layoutX="166.0" layoutY="89.0" onAction="#linkIcons8" text="icons8.com" /> | ||
<Label layoutX="3.0" layoutY="92.0" text="This program uses icons from:" /> | ||
<Hyperlink layoutY="134.0" onAction="#linkSourceCode" text="Source Code (GitHub)" /> | ||
<Hyperlink layoutY="159.0" onAction="#linkBugReport" text="Report Bug (GitHub)" /> | ||
</children> | ||
<GridPane.margin> | ||
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" /> | ||
</GridPane.margin> | ||
</AnchorPane> | ||
</children> | ||
<padding> | ||
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0" /> | ||
</padding> | ||
</GridPane> |
60 changes: 60 additions & 0 deletions
60
gui/src/main/java/pl/marcinchwedczuk/elfviewer/gui/aboutdialog/AboutDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package pl.marcinchwedczuk.elfviewer.gui.aboutdialog; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.Scene; | ||
import javafx.scene.layout.GridPane; | ||
import javafx.stage.Modality; | ||
import javafx.stage.Stage; | ||
import javafx.stage.StageStyle; | ||
import javafx.stage.Window; | ||
import pl.marcinchwedczuk.elfviewer.gui.App; | ||
|
||
import java.io.IOException; | ||
|
||
public class AboutDialog { | ||
public static AboutDialog show(Window owner) { | ||
try { | ||
FXMLLoader loader = new FXMLLoader( | ||
AboutDialog.class.getResource("AboutDialog.fxml")); | ||
|
||
Stage childWindow = new Stage(); | ||
childWindow.initOwner(owner); | ||
childWindow.initModality(Modality.WINDOW_MODAL); | ||
childWindow.initStyle(StageStyle.UTILITY); | ||
childWindow.setTitle("About..."); | ||
childWindow.setScene(new Scene(loader.load())); | ||
childWindow.setResizable(false); | ||
childWindow.sizeToScene(); | ||
|
||
AboutDialog controller = loader.getController(); | ||
childWindow.show(); | ||
return controller; | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@FXML | ||
private GridPane rootElement; | ||
|
||
@FXML | ||
private void guiClose() { | ||
((Stage)rootElement.getScene().getWindow()).close(); | ||
} | ||
|
||
@FXML | ||
private void linkIcons8() { | ||
App.hostServices().showDocument("https://icons8.com/"); | ||
} | ||
|
||
@FXML | ||
private void linkSourceCode() { | ||
App.hostServices().showDocument("https://github.com/marcin-chwedczuk/elf-viewer"); | ||
} | ||
|
||
@FXML | ||
private void linkBugReport() { | ||
App.hostServices().showDocument("https://github.com/marcin-chwedczuk/elf-viewer/issues"); | ||
} | ||
} |
Binary file added
BIN
+247 Bytes
gui/src/main/java/pl/marcinchwedczuk/elfviewer/gui/aboutdialog/about-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+234 KB
gui/src/main/java/pl/marcinchwedczuk/elfviewer/gui/aboutdialog/about-panache.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters