-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
458 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>project</artifactId> | ||
<groupId>com.manorrock.sphynx</groupId> | ||
<version>23.1.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>com.manorrock.sphynx</groupId> | ||
<artifactId>desktop</artifactId> | ||
<version>23.1.0-SNAPSHOT</version> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-controls</artifactId> | ||
<version>21</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-fxml</artifactId> | ||
<version>21</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<release>11</release> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.openjfx</groupId> | ||
<artifactId>javafx-maven-plugin</artifactId> | ||
<version>0.0.4</version> | ||
<configuration> | ||
<mainClass>com.manorrock.sphynx.desktop.App</mainClass> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<!-- Default configuration for running --> | ||
<!-- Usage: mvn clean javafx:run --> | ||
<id>default-cli</id> | ||
</execution> | ||
<execution> | ||
<!-- Configuration for manual attach debugging --> | ||
<!-- Usage: mvn clean javafx:run@debug --> | ||
<id>debug</id> | ||
<configuration> | ||
<options> | ||
<option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000</option> | ||
</options> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<!-- Configuration for automatic IDE debugging --> | ||
<id>ide-debug</id> | ||
<configuration> | ||
<options> | ||
<option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option> | ||
</options> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<!-- Configuration for automatic IDE profiling --> | ||
<id>ide-profile</id> | ||
<configuration> | ||
<options> | ||
<option>${profiler.jvmargs.arg1}</option> | ||
<option>${profiler.jvmargs.arg2}</option> | ||
<option>${profiler.jvmargs.arg3}</option> | ||
<option>${profiler.jvmargs.arg4}</option> | ||
<option>${profiler.jvmargs.arg5}</option> | ||
</options> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
desktop/src/main/java/com/manorrock/sphynx/desktop/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.manorrock.sphynx.desktop; | ||
|
||
import javafx.application.Application; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.Parent; | ||
import javafx.scene.Scene; | ||
import javafx.stage.Stage; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* JavaFX App | ||
*/ | ||
public class App extends Application { | ||
|
||
private static Scene scene; | ||
|
||
@Override | ||
public void start(Stage stage) throws IOException { | ||
scene = new Scene(loadFXML("primary"), 640, 480); | ||
stage.setScene(scene); | ||
stage.show(); | ||
} | ||
|
||
static void setRoot(String fxml) throws IOException { | ||
scene.setRoot(loadFXML(fxml)); | ||
} | ||
|
||
private static Parent loadFXML(String fxml) throws IOException { | ||
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); | ||
return fxmlLoader.load(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
launch(); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
desktop/src/main/java/com/manorrock/sphynx/desktop/PrimaryController.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,12 @@ | ||
package com.manorrock.sphynx.desktop; | ||
|
||
import java.io.IOException; | ||
import javafx.fxml.FXML; | ||
|
||
public class PrimaryController { | ||
|
||
@FXML | ||
private void switchToSecondary() throws IOException { | ||
App.setRoot("secondary"); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
desktop/src/main/java/com/manorrock/sphynx/desktop/SecondaryController.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,12 @@ | ||
package com.manorrock.sphynx.desktop; | ||
|
||
import java.io.IOException; | ||
import javafx.fxml.FXML; | ||
|
||
public class SecondaryController { | ||
|
||
@FXML | ||
private void switchToPrimary() throws IOException { | ||
App.setRoot("primary"); | ||
} | ||
} |
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,7 @@ | ||
module com.manorrock.sphynx.desktop { | ||
requires javafx.controls; | ||
requires javafx.fxml; | ||
|
||
opens com.manorrock.sphynx.desktop to javafx.fxml; | ||
exports com.manorrock.sphynx.desktop; | ||
} |
16 changes: 16 additions & 0 deletions
16
desktop/src/main/resources/com/manorrock/sphynx/desktop/primary.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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.VBox?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.geometry.Insets?> | ||
|
||
<VBox alignment="CENTER" spacing="20.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.manorrock.sphynx.desktop.PrimaryController"> | ||
<children> | ||
<Label text="Primary View" /> | ||
<Button fx:id="primaryButton" text="Switch to Secondary View" onAction="#switchToSecondary"/> | ||
</children> | ||
<padding> | ||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> | ||
</padding> | ||
</VBox> |
16 changes: 16 additions & 0 deletions
16
desktop/src/main/resources/com/manorrock/sphynx/desktop/secondary.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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.VBox?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.geometry.Insets?> | ||
|
||
<VBox alignment="CENTER" spacing="20.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.manorrock.sphynx.desktop.SecondaryController"> | ||
<children> | ||
<Label text="Secondary View" /> | ||
<Button fx:id="secondaryButton" text="Switch to Primary View" onAction="#switchToPrimary" /> | ||
</children> | ||
<padding> | ||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> | ||
</padding> | ||
</VBox> |
Oops, something went wrong.