Start of JavaFX overhaul...

This commit is contained in:
Brendan Robert 2015-02-02 00:52:31 -06:00
parent 0f60a59df7
commit 34addf37f8
4 changed files with 64 additions and 12 deletions

View File

@ -12,7 +12,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath target/jace-2.0-SNAPSHOT.jar jace.Emulator</exec.args>
<exec.args>-classpath %classpath jace.JaceApplication</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
@ -26,7 +26,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath target/jace-2.0-SNAPSHOT.jar jace.Emulator</exec.args>
<exec.args>-classpath %classpath jace.JaceApplication</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
@ -41,7 +41,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath target/jace-2.0-SNAPSHOT.jar jace.Emulator</exec.args>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath jace.JaceApplication</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>

46
pom.xml
View File

@ -22,6 +22,29 @@
<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
outlawEditor
<mainClass>jace.JaceApplication</mainClass>
<!-- only required if signing the jar file -->
<keyStoreAlias>example-user</keyStoreAlias>
<keyStorePassword>example-password</keyStorePassword>
<allPermissions>true</allPermissions>
<bundleType>ALL</bundleType>
</configuration>
<executions>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
@ -39,8 +62,9 @@
</configuration>
</execution>
</executions>
</plugin>
<plugin>
</plugin>-->
<!-- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
@ -79,7 +103,7 @@
</configuration>
</execution>
</executions>
</plugin>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -105,4 +129,20 @@
</plugins>
</build>
<dependencies>
<!-- <dependency>
<groupId>com.oracle</groupId>
<artifactId>javafx</artifactId>
<version>2</version>
<systemPath>${java.home}/lib/jfxrt.jar</systemPath>
<scope>system</scope>
</dependency>-->
<dependency>
<groupId>javafx-packager</groupId>
<artifactId>javafx-packager</artifactId>
<version>1.7</version>
<systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>
</project>

View File

@ -6,10 +6,12 @@
package jace;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
/**
@ -17,15 +19,25 @@ import javafx.stage.Stage;
* @author blurry
*/
public class JaceApplication extends Application {
Stage primaryStage;
JaceUIController controller;
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("fxml/JaceUI.fxml"));
primaryStage = stage;
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/JaceUI.fxml"));
fxmlLoader.setResources(null);
try {
AnchorPane node = (AnchorPane) fxmlLoader.load();
controller = fxmlLoader.getController();
Scene s = new Scene(node);
primaryStage.setScene(s);
} catch (IOException exception) {
throw new RuntimeException(exception);
}
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
primaryStage.show();
}
/**

View File

@ -6,7 +6,7 @@
package jace;
import java.awt.Canvas;
import javafx.scene.canvas.Canvas;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;