diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..9698178
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,53 @@
+
+ Builds, tests, and runs the project SC.
+
+
+
diff --git a/build/built-jar.properties b/build/built-jar.properties
new file mode 100644
index 0000000..f060131
--- /dev/null
+++ b/build/built-jar.properties
@@ -0,0 +1,4 @@
+#Fri, 03 May 2019 16:05:45 +0100
+
+
+E\:\\Documents\\Sprite\ Sheet\ Creator\\Sprite-Sheet-Creator=
diff --git a/build/classes/icon_32x32.png b/build/classes/icon_32x32.png
new file mode 100644
index 0000000..6750bef
Binary files /dev/null and b/build/classes/icon_32x32.png differ
diff --git a/build/classes/icon_64x64.png b/build/classes/icon_64x64.png
new file mode 100644
index 0000000..c11e77b
Binary files /dev/null and b/build/classes/icon_64x64.png differ
diff --git a/build/classes/sc/FXMLDocument.fxml b/build/classes/sc/FXMLDocument.fxml
new file mode 100644
index 0000000..d6fec6d
--- /dev/null
+++ b/build/classes/sc/FXMLDocument.fxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/classes/sc/FXMLDocumentController.class b/build/classes/sc/FXMLDocumentController.class
new file mode 100644
index 0000000..e8e38cf
Binary files /dev/null and b/build/classes/sc/FXMLDocumentController.class differ
diff --git a/build/classes/sc/FxDialogs.class b/build/classes/sc/FxDialogs.class
new file mode 100644
index 0000000..f837919
Binary files /dev/null and b/build/classes/sc/FxDialogs.class differ
diff --git a/build/classes/sc/SC.class b/build/classes/sc/SC.class
new file mode 100644
index 0000000..237417a
Binary files /dev/null and b/build/classes/sc/SC.class differ
diff --git a/build/classes/sc/stylesheet.css b/build/classes/sc/stylesheet.css
new file mode 100644
index 0000000..e48b687
--- /dev/null
+++ b/build/classes/sc/stylesheet.css
@@ -0,0 +1,3 @@
+.canvas{
+ -fx-background-color: antiquewhite, white ;
+}
diff --git a/dist/SC.html b/dist/SC.html
new file mode 100644
index 0000000..e715c95
--- /dev/null
+++ b/dist/SC.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+Test page for SC
+ Webstart: click to launch this app as webstart
+
+
+
+
diff --git a/dist/SC.jar b/dist/SC.jar
new file mode 100644
index 0000000..6bc1326
Binary files /dev/null and b/dist/SC.jar differ
diff --git a/dist/SC.jnlp b/dist/SC.jnlp
new file mode 100644
index 0000000..800bd85
--- /dev/null
+++ b/dist/SC.jnlp
@@ -0,0 +1,15 @@
+
+
+
+ SC
+ lukea
+ null
+
+
+
+
+
+
+
+
+
diff --git a/icon_32x32.png b/icon_32x32.png
new file mode 100644
index 0000000..6750bef
Binary files /dev/null and b/icon_32x32.png differ
diff --git a/manifest.mf b/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
new file mode 100644
index 0000000..289b837
--- /dev/null
+++ b/nbproject/build-impl.xml
@@ -0,0 +1,1778 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set src.res.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/configs/Run_as_WebStart.properties b/nbproject/configs/Run_as_WebStart.properties
new file mode 100644
index 0000000..670fff0
--- /dev/null
+++ b/nbproject/configs/Run_as_WebStart.properties
@@ -0,0 +1,2 @@
+# Do not modify this property in this configuration. It can be re-generated.
+$label=Run as WebStart
diff --git a/nbproject/configs/Run_in_Browser.properties b/nbproject/configs/Run_in_Browser.properties
new file mode 100644
index 0000000..f2a5a65
--- /dev/null
+++ b/nbproject/configs/Run_in_Browser.properties
@@ -0,0 +1,2 @@
+# Do not modify this property in this configuration. It can be re-generated.
+$label=Run in Browser
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
new file mode 100644
index 0000000..07b1565
--- /dev/null
+++ b/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=131d67bd
+build.xml.script.CRC32=c68d4bec
+build.xml.stylesheet.CRC32=f85dc8f2@1.90.1.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=e7e2769f
+nbproject/build-impl.xml.script.CRC32=3e13388d
+nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.90.1.48
diff --git a/nbproject/jfx-impl.xml b/nbproject/jfx-impl.xml
new file mode 100644
index 0000000..6aeb313
--- /dev/null
+++ b/nbproject/jfx-impl.xml
@@ -0,0 +1,4197 @@
+
+
+
+
+ JavaFX-specific Ant calls
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/private/configs/Run_as_WebStart.properties b/nbproject/private/configs/Run_as_WebStart.properties
new file mode 100644
index 0000000..86ae865
--- /dev/null
+++ b/nbproject/private/configs/Run_as_WebStart.properties
@@ -0,0 +1,2 @@
+# Do not modify this property in this configuration. It can be re-generated.
+javafx.run.as=webstart
diff --git a/nbproject/private/configs/Run_in_Browser.properties b/nbproject/private/configs/Run_in_Browser.properties
new file mode 100644
index 0000000..f4e8549
--- /dev/null
+++ b/nbproject/private/configs/Run_in_Browser.properties
@@ -0,0 +1,2 @@
+# Do not modify this property in this configuration. It can be re-generated.
+javafx.run.as=embedded
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100644
index 0000000..c8ede0d
--- /dev/null
+++ b/nbproject/private/private.properties
@@ -0,0 +1,13 @@
+auxiliary.org-netbeans-modules-projectapi.issue214819_5f_fx_5f_enabled=true
+compile.on.save=true
+do.depend=false
+do.jar=true
+do.jlink=false
+# No need to modify this property unless customizing JavaFX Ant task infrastructure
+endorsed.javafx.ant.classpath=.
+javac.debug=true
+javadoc.preview=true
+javafx.run.inbrowser=
+javafx.run.inbrowser.path=C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE
+jlink.strip=false
+user.properties.file=C:\\Users\\lukea\\AppData\\Roaming\\NetBeans\\10.0\\build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100644
index 0000000..b98ebf0
--- /dev/null
+++ b/nbproject/private/private.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ file:/E:/Documents/Raytracing/SC/src/sc/stylesheet.css
+ file:/E:/Documents/Raytracing/SC/src/sc/FxDialogs.java
+ file:/E:/Documents/Raytracing/SC/src/sc/SC.java
+ file:/E:/Documents/Raytracing/SC/src/sc/FXMLDocumentController.java
+
+
+
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 0000000..4d4509a
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,130 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=SC
+application.vendor=lukea
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+compile.on.save=true
+compile.on.save.unsupported.javafx=true
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.modulepath=\
+ ${run.modulepath}
+debug.test.classpath=\
+ ${run.test.classpath}
+debug.test.modulepath=\
+ ${run.test.modulepath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/SC.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
+jar.archive.disabled=true
+jar.compress=false
+javac.classpath=\
+ ${javafx.classpath.extension}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.external.vm=false
+javac.modulepath=
+javac.processormodulepath=
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.modulepath=\
+ ${javac.modulepath}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.html5=false
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+javafx.application.implementation.version=1.0
+javafx.binarycss=false
+javafx.classpath.extension=\
+ ${java.home}/lib/javaws.jar:\
+ ${java.home}/lib/deploy.jar:\
+ ${java.home}/lib/plugin.jar
+javafx.deploy.allowoffline=true
+# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
+javafx.deploy.backgroundupdate=false
+javafx.deploy.embedJNLP=true
+javafx.deploy.includeDT=true
+# Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
+javafx.disable.concurrent.runs=false
+# Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
+javafx.enable.concurrent.external.runs=false
+# This is a JavaFX project
+javafx.enabled=true
+javafx.fallback.class=com.javafx.main.NoJavaFXFallback
+# Main class for JavaFX
+javafx.main.class=sc.SC
+javafx.preloader.class=
+# This project does not use Preloader
+javafx.preloader.enabled=false
+javafx.preloader.jar.filename=
+javafx.preloader.jar.path=
+javafx.preloader.project.path=
+javafx.preloader.type=none
+# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
+javafx.rebase.libs=false
+javafx.run.height=600
+javafx.run.width=800
+jlink.launcher=false
+jlink.launcher.name=SC
+# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
+jnlp.enabled=false
+# Main class for Java launcher
+main.class=com.javafx.main.Main
+# For improved security specify narrower Codebase manifest attribute to prevent RIAs from being repurposed
+manifest.custom.codebase=*
+# Specify Permissions manifest attribute to override default (choices: sandbox, all-permissions)
+manifest.custom.permissions=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${dist.jar}:\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+run.modulepath=\
+ ${javac.modulepath}
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+run.test.modulepath=\
+ ${javac.test.modulepath}
+source.encoding=UTF-8
+src.dir=src
+src.res.dir=res
+test.src.dir=test
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644
index 0000000..e93e21c
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,26 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+
+
+
+
+
+
+
+
+
+
+ SC
+
+
+
+
+
+
+
+
+
+
diff --git a/res/icon.ico b/res/icon.ico
new file mode 100644
index 0000000..d080c23
Binary files /dev/null and b/res/icon.ico differ
diff --git a/res/icon_32x32.png b/res/icon_32x32.png
new file mode 100644
index 0000000..6750bef
Binary files /dev/null and b/res/icon_32x32.png differ
diff --git a/res/icon_64x64.png b/res/icon_64x64.png
new file mode 100644
index 0000000..c11e77b
Binary files /dev/null and b/res/icon_64x64.png differ
diff --git a/src/sc/FXMLDocument.fxml b/src/sc/FXMLDocument.fxml
new file mode 100644
index 0000000..d6fec6d
--- /dev/null
+++ b/src/sc/FXMLDocument.fxml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/sc/FXMLDocumentController.java b/src/sc/FXMLDocumentController.java
new file mode 100644
index 0000000..8626d46
--- /dev/null
+++ b/src/sc/FXMLDocumentController.java
@@ -0,0 +1,220 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package sc;
+
+import java.awt.image.RenderedImage;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.ResourceBundle;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.embed.swing.SwingFXUtils;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.Initializable;
+import javafx.scene.SnapshotParameters;
+import javafx.scene.canvas.Canvas;
+import javafx.scene.canvas.GraphicsContext;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.ButtonType;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.image.Image;
+import javafx.scene.image.WritableImage;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.paint.Color;
+import javafx.stage.FileChooser;
+import javafx.stage.StageStyle;
+import javax.imageio.ImageIO;
+
+/**
+ *
+ * @author lukea
+ */
+public class FXMLDocumentController implements Initializable {
+
+ private Label label;
+ ObservableList list = FXCollections.observableArrayList(16, 32, 64, 128, 256, 512);
+ @FXML
+ private ComboBox combobox;
+
+ ArrayList images = new ArrayList<>();
+ int resolution = 128;
+ @FXML
+ private AnchorPane pane;
+ @FXML
+ private Canvas displayCanvas;
+ @FXML
+ private Canvas hiddenCanvas;
+ @FXML
+ private Canvas workCanvas;
+ GraphicsContext workGC;
+ GraphicsContext displayGC;
+
+ @Override
+ public void initialize(URL url, ResourceBundle rb) {
+ // TODO
+ combobox.setItems(list);
+ combobox.setValue(resolution);
+
+ workGC = workCanvas.getGraphicsContext2D();
+ displayGC = displayCanvas.getGraphicsContext2D();
+ }
+
+ @FXML
+ private void addImage(ActionEvent event) {
+ FileChooser fc = new FileChooser();
+ fc.setTitle("Add Images");
+ fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(".jpg .png", "*.jpg", "*.png"));
+ displayGC.fillText("Loading...", 640 / 2 - 10, 640 / 2);
+ List selectedFiles = fc.showOpenMultipleDialog(null);
+
+ if (selectedFiles != null) {
+
+ for (File f : selectedFiles) {
+ if (images.size() == 100) {
+ FxDialogs.showCustomError("Only 100 images per sprite sheet.");
+ return;
+ }
+ Image i = new Image(f.toURI().toString());
+ images.add(i);
+ draw();
+ }
+ }
+ System.err.println(images.size());
+ draw();
+ }
+
+ private void draw() {
+ Image displayImage = createImage(128, true);
+ displayGC.drawImage(displayImage, 0, 0);
+ }
+
+ private Image createImage(int res, boolean display) {
+
+ int y = 0;
+ int x = 0;
+ int index = 0;
+ int numberOfCollumns = 10;
+
+ workCanvas.setVisible(true);
+
+ if (display) {
+ workGC.getCanvas().setWidth(640);
+ workGC.getCanvas().setHeight(640);
+ res = 640 / numberOfCollumns;
+ } else {
+ workGC.getCanvas().setWidth(res * numberOfCollumns);
+ workGC.getCanvas().setHeight(res * numberOfCollumns);
+ }
+
+ workGC.clearRect(0, 0, workCanvas.getWidth(), workCanvas.getHeight());
+ workGC.setFill(Color.TRANSPARENT);
+ if (!images.isEmpty()) {
+ for (int i = 0; i < images.size(); i++) {
+
+ if (index >= numberOfCollumns) {
+ y += 1;
+ x = 0;
+ index = 0;
+ }
+ workGC.drawImage(images.get(i), x * res, y * res, res, res);
+ x++;
+ index++;
+ }
+
+ for (int j = 0; j < (numberOfCollumns * numberOfCollumns) - images.size(); j++) {
+ if (index >= numberOfCollumns) {
+ y += 1;
+ x = 0;
+ index = 0;
+ }
+ if (y % 2 == 0) {
+ if (j % 2 == 0) {
+ workGC.setFill(Color.GREEN);
+ } else {
+ workGC.setFill(Color.PINK);
+ }
+ } else {
+ if (j % 2 == 0) {
+ workGC.setFill(Color.PINK);
+ } else {
+ workGC.setFill(Color.GREEN);
+ }
+ }
+
+ workGC.fillRect(res * x, res * y, res, res);
+ index++;
+ x++;
+
+ }
+
+ }
+ SnapshotParameters sp = new SnapshotParameters();
+ sp.setFill(Color.TRANSPARENT);
+ WritableImage writableImage = new WritableImage((int) workCanvas.getWidth(), (int) workCanvas.getHeight());
+ WritableImage newImage = workCanvas.snapshot(sp, writableImage);
+ workCanvas.setVisible(false);
+
+ return newImage;
+ }
+
+ @FXML
+ private void saveImage(ActionEvent event) {
+
+ FileChooser fileChooser = new FileChooser();
+
+ //Set extension filter
+ FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("png files (*.png)", "*.png");
+ fileChooser.getExtensionFilters().add(extFilter);
+
+ //Show save file dialog
+ File file = fileChooser.showSaveDialog(null);
+
+ if (file != null) {
+ try {
+ Image saveImage = createImage(resolution, false);
+ RenderedImage renderedImage = SwingFXUtils.fromFXImage(saveImage, null);
+ ImageIO.write(renderedImage, "png", file);
+ } catch (IOException ex) {
+ System.err.println("Can not save image");
+ }
+ }
+ draw();
+ }
+
+ @FXML
+ private void comboBoxEvent(ActionEvent event) {
+ resolution = combobox.getValue();
+ System.err.println(resolution);
+ draw();
+ }
+
+ @FXML
+ private void clearImages(ActionEvent event) {
+
+ Alert alert = new Alert(AlertType.CONFIRMATION);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Confirmation Dialog");
+ alert.setHeaderText("Clearing the current sprite sheet");
+ alert.setContentText("Are you sure?");
+
+ Optional result = alert.showAndWait();
+ if (result.get() == ButtonType.OK) {
+ images.clear();
+ draw();
+ } else {
+
+ }
+
+ }
+
+}
diff --git a/src/sc/FxDialogs.java b/src/sc/FxDialogs.java
new file mode 100644
index 0000000..33fc9c7
--- /dev/null
+++ b/src/sc/FxDialogs.java
@@ -0,0 +1,169 @@
+package sc;
+
+import javafx.scene.control.*;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextArea;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyEvent;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.Priority;
+import javafx.stage.StageStyle;
+
+import java.awt.*;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import javafx.scene.control.Alert.AlertType;
+
+public class FxDialogs {
+
+ public static void showInformation(String title, String message) {
+ Alert alert = new Alert(Alert.AlertType.INFORMATION);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Information");
+ alert.setHeaderText(title);
+ alert.setContentText(message);
+
+ alert.showAndWait();
+ }
+
+ public static void showWarning(String title, String message) {
+ Alert alert = new Alert(Alert.AlertType.WARNING);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Warning");
+ alert.setHeaderText(title);
+ alert.setContentText(message);
+
+ alert.showAndWait();
+ }
+
+ public static void showError(String title, String message) {
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Error");
+ alert.setHeaderText(title);
+ alert.setContentText(message);
+
+ alert.showAndWait();
+ }
+
+ public static void showException(String title, String message, Exception exception) {
+ Alert alert = new Alert(Alert.AlertType.ERROR);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Exception");
+ alert.setHeaderText(title);
+ alert.setContentText(message);
+
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ exception.printStackTrace(pw);
+ String exceptionText = sw.toString();
+
+ Label label = new Label("Details:");
+
+ TextArea textArea = new TextArea(exceptionText);
+ textArea.setEditable(false);
+ textArea.setWrapText(true);
+
+ textArea.setMaxWidth(Double.MAX_VALUE);
+ textArea.setMaxHeight(Double.MAX_VALUE);
+ GridPane.setVgrow(textArea, Priority.ALWAYS);
+ GridPane.setHgrow(textArea, Priority.ALWAYS);
+
+ GridPane expContent = new GridPane();
+ expContent.setMaxWidth(Double.MAX_VALUE);
+ expContent.add(label, 0, 0);
+ expContent.add(textArea, 0, 1);
+
+ alert.getDialogPane().setExpandableContent(expContent);
+
+ alert.showAndWait();
+ }
+
+ public static final String YES = "Yes";
+ public static final String NO = "No";
+ public static final String OK = "OK";
+ public static final String CANCEL = "Cancel";
+
+ public static String showConfirm(String title, String message, String... options) {
+ Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Choose an option");
+ alert.setHeaderText(title);
+ alert.setContentText(message);
+
+ //To make enter key press the actual focused button, not the first one. Just like pressing "space".
+ alert.getDialogPane().addEventFilter(KeyEvent.KEY_PRESSED, event -> {
+ if (event.getCode().equals(KeyCode.ENTER)) {
+ event.consume();
+ try {
+ Robot r = new Robot();
+ r.keyPress(java.awt.event.KeyEvent.VK_SPACE);
+ r.keyRelease(java.awt.event.KeyEvent.VK_SPACE);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ if (options == null || options.length == 0) {
+ options = new String[]{OK, CANCEL};
+ }
+
+ List buttons = new ArrayList<>();
+ for (String option : options) {
+ buttons.add(new ButtonType(option));
+ }
+
+ alert.getButtonTypes().setAll(buttons);
+
+ Optional result = alert.showAndWait();
+ if (!result.isPresent()) {
+ return CANCEL;
+ } else {
+ return result.get().getText();
+ }
+ }
+
+ public static String showTextInput(String title, String message, String defaultValue) {
+ TextInputDialog dialog = new TextInputDialog(defaultValue);
+ dialog.initStyle(StageStyle.UTILITY);
+ dialog.setTitle("Input");
+ dialog.setHeaderText(title);
+ dialog.setContentText(message);
+
+ Optional result = dialog.showAndWait();
+ if (result.isPresent()) {
+ return result.get();
+ } else {
+ return null;
+ }
+
+ }
+
+ //Custom error
+ public static void showCustomError(String message) {
+ Alert alert = new Alert(AlertType.ERROR);
+ alert.initStyle(StageStyle.UTILITY);
+ alert.setTitle("Information Dialog");
+ alert.setHeaderText(null);
+ alert.setContentText("Only 100 images per sprite sheet.");
+
+ alert.showAndWait();
+ }
+
+ /*
+ //HOW TO USE CLASS https://code.makery.ch/blog/javafx-dialogs-official/
+ FxDialogs.showInformation("Hi", "Good Morning y'all!");
+
+
+ if (FxDialogs.showConfirm("Choose one baby!", "Can i ask you a question?", FxDialogs.YES, FxDialogs.NO).equals(FxDialogs.YES)) {
+ FxDialogs.showWarning(null, "Pay attention to my next question!");
+ String answer = FxDialogs.showTextInput("Are you a pink elephant disguised as a flying pig?", "Tell me!", "No");
+ FxDialogs.showError(null, "You should not have said " + answer + "!");
+ FxDialogs.showException("Now i'm angry", "I'm going home...", new RuntimeException("Exception caused by angry dinossaurs"));
+}
+ */
+}
diff --git a/src/sc/SC.java b/src/sc/SC.java
new file mode 100644
index 0000000..5d22b03
--- /dev/null
+++ b/src/sc/SC.java
@@ -0,0 +1,44 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package sc;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author lukea
+ */
+public class SC extends Application {
+
+ @Override
+ public void start(Stage stage) throws Exception {
+
+ Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
+
+ Scene scene = new Scene(root);
+
+ stage.setScene(scene);
+
+
+ Image icon = new Image("file:icon_32x32.png");
+ stage.getIcons().add(icon);
+ stage.setTitle("Sprite Sheet Creator");
+ stage.show();
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+}
diff --git a/src/sc/stylesheet.css b/src/sc/stylesheet.css
new file mode 100644
index 0000000..e48b687
--- /dev/null
+++ b/src/sc/stylesheet.css
@@ -0,0 +1,3 @@
+.canvas{
+ -fx-background-color: antiquewhite, white ;
+}