Skip to content

Commit

Permalink
initial set up of TornadoFx
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Smart <derek@grindaga.com>
  • Loading branch information
mcred committed Feb 26, 2019
1 parent 2f3336b commit c5ab9d0
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 109 deletions.
219 changes: 111 additions & 108 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.grindaga</groupId>
<artifactId>crissaegrim</artifactId>
<name>Castlevania SOTN Save Editor</name>
<description>Castlevania: Symphony of the Night Save File Editor</description>
<version>0.0.1-SNAPSHOT</version>
<groupId>com.grindaga</groupId>
<artifactId>crissaegrim</artifactId>
<name>Castlevania SOTN Save Editor</name>
<description>Castlevania: Symphony of the Night Save File Editor</description>
<version>0.0.1-SNAPSHOT</version>

<properties>
<java.version>1.8</java.version>
<kotlin.version>1.3.21</kotlin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.class>com.grindaga.crissaegrim.Loader</main.class>
</properties>
<properties>
<java.version>1.8</java.version>
<kotlin.version>1.3.21</kotlin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.class>com.grindaga.crissaegrim.Crissaegrim</main.class>
</properties>

<licenses>
<license>
<name>Apache-2.0</name>
<url>https://opensource.org/licenses/Apache-2.0</url>
</license>
</licenses>
<licenses>
<license>
<name>Apache-2.0</name>
<url>https://opensource.org/licenses/Apache-2.0</url>
</license>
</licenses>

<developers>
<developer>
<id>mcred</id>
<name>Derek Smart</name>
<email>derek@grindaga.com</email>
</developer>
</developers>
<developers>
<developer>
<id>mcred</id>
<name>Derek Smart</name>
<email>derek@grindaga.com</email>
</developer>
</developers>

<repositories>
<repository>
<id>jcenter</id>
<url>http://jcenter.bintray.com/</url>
</repository>
</repositories>
<repositories>
<repository>
<id>jcenter</id>
<url>http://jcenter.bintray.com/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>0.9.6</version>
</dependency>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>0.9.6</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand All @@ -84,47 +84,50 @@
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<dependency>
<groupId>no.tornado</groupId>
<artifactId>tornadofx</artifactId>
<version>1.7.18</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
</configuration>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
</execution>
</executions>
</plugin>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
</configuration>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>${main.class}</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>

</project>
24 changes: 24 additions & 0 deletions src/main/kotlin/com/grindaga/crissaegrim/Crissaegrim.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.grindaga.crissaegrim

import tornadofx.*
import javafx.scene.text.FontWeight
import com.grindaga.crissaegrim.Views.*

class Crissaegrim : App(
HelloWorld::class,
Styles::class
)

class Styles : Stylesheet() {
init {
label {
fontSize = 20.px
fontWeight = FontWeight.BOLD
backgroundColor += c("#cecece")
}
}
}

fun main(args: Array<String>) {
launch<Crissaegrim>(args)
}
1 change: 0 additions & 1 deletion src/main/kotlin/com/grindaga/crissaegrim/Loader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ object Loader {
println("HP: ${stats.HP}")

/*
for ((key, location) in pointers) {
if (location.reverseBytes) {
val hexVal: ByteArray = slot.getReversedValueByRange(location.getRange())
Expand Down
21 changes: 21 additions & 0 deletions src/main/kotlin/com/grindaga/crissaegrim/Views/HelloWorld.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.grindaga.crissaegrim.Views

import javafx.beans.property.SimpleIntegerProperty
import javafx.scene.control.Label
import javafx.scene.layout.BorderPane
import tornadofx.*

class HelloWorld : View() {
override val root : BorderPane by fxml("/Views/HelloWorld.fxml")
val counter = SimpleIntegerProperty()
val counterInfo: Label by fxid()

init {
title = "Counter"
counterInfo.bind(counter)
}

fun increment() {
counter.value += 1
}
}
25 changes: 25 additions & 0 deletions src/main/resources/Views/HelloWorld.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<BorderPane xmlns="http://javafx.com/javafx/null" xmlns:fx="http://javafx.com/fxml/1">
<padding>
<Insets top="20" right="20" bottom="20" left="20"/>
</padding>

<center>
<VBox alignment="CENTER" spacing="10">
<Label fx:id="counterInfo">
<font>
<Font size="20"/>
</font>
</Label>
<Button text="Click to increment" onAction="#increment"/>
</VBox>
</center>
</BorderPane>

0 comments on commit c5ab9d0

Please sign in to comment.