Browse Source

Initial commit

master
skylarmt 7 years ago
commit
f117c32bb6
  1. BIN
      SyMAT-0.3.exe
  2. BIN
      SyMAT-0.5.1.exe
  3. BIN
      SyMAT-0.5.exe
  4. 99
      build.xml
  5. 42
      launch4j.cfg.xml
  6. 128
      launch4j.log
  7. BIN
      lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
  8. BIN
      lib/JavaPrettify-1.2.1.jar
  9. BIN
      lib/htmlcleaner-2.10.jar
  10. BIN
      lib/iText-4.2.0-com.itextpdf.jar
  11. BIN
      lib/js-engine.jar
  12. BIN
      lib/js.jar
  13. BIN
      lib/log4j-1.2.11.jar
  14. 4
      lib/nblibraries.properties
  15. BIN
      lib/symja-2014-11-01.jar
  16. 3
      manifest.mf
  17. 1439
      nbproject/build-impl.xml
  18. 953
      nbproject/build-native.xml
  19. 8
      nbproject/genfiles.properties
  20. 108
      nbproject/project.properties
  21. 21
      nbproject/project.xml
  22. 263
      src/net/apocalypselabs/symat/CodeEditor.form
  23. 415
      src/net/apocalypselabs/symat/CodeEditor.java
  24. 246
      src/net/apocalypselabs/symat/CodeExport.form
  25. 373
      src/net/apocalypselabs/symat/CodeExport.java
  26. 105
      src/net/apocalypselabs/symat/CodeRunner.java
  27. 145
      src/net/apocalypselabs/symat/Functions.java
  28. 180
      src/net/apocalypselabs/symat/Graph.form
  29. 456
      src/net/apocalypselabs/symat/Graph.java
  30. 110
      src/net/apocalypselabs/symat/Help.form
  31. 141
      src/net/apocalypselabs/symat/Help.java
  32. 125
      src/net/apocalypselabs/symat/Interpreter.form
  33. 187
      src/net/apocalypselabs/symat/Interpreter.java
  34. 169
      src/net/apocalypselabs/symat/MainGUI.form
  35. 261
      src/net/apocalypselabs/symat/MainGUI.java
  36. 42
      src/net/apocalypselabs/symat/PrefStorage.java
  37. 96
      src/net/apocalypselabs/symat/PrettifyToHtml.java
  38. 435
      src/net/apocalypselabs/symat/TextLineNumber.java
  39. 137
      src/net/apocalypselabs/symat/Update.form
  40. 162
      src/net/apocalypselabs/symat/Update.java
  41. BIN
      src/net/apocalypselabs/symat/editor.png
  42. 0
      src/net/apocalypselabs/symat/functions.js
  43. BIN
      src/net/apocalypselabs/symat/graph.png
  44. BIN
      src/net/apocalypselabs/symat/help.png
  45. 12
      src/net/apocalypselabs/symat/help/basics.html
  46. 30
      src/net/apocalypselabs/symat/help/commands.html
  47. 12
      src/net/apocalypselabs/symat/help/editor.html
  48. 14
      src/net/apocalypselabs/symat/help/graphing.html
  49. 898
      src/net/apocalypselabs/symat/help/licenses.html
  50. 12
      src/net/apocalypselabs/symat/help/welcome.html
  51. BIN
      src/net/apocalypselabs/symat/icon.png
  52. BIN
      src/net/apocalypselabs/symat/icons/editor.png
  53. BIN
      src/net/apocalypselabs/symat/icons/graph.png
  54. BIN
      src/net/apocalypselabs/symat/icons/help.png
  55. BIN
      src/net/apocalypselabs/symat/icons/shell.png
  56. BIN
      src/net/apocalypselabs/symat/icons/update.png
  57. BIN
      src/net/apocalypselabs/symat/menugradient.png
  58. 23
      src/net/apocalypselabs/symat/pretty.css
  59. BIN
      src/net/apocalypselabs/symat/shell.png

BIN
SyMAT-0.3.exe

BIN
SyMAT-0.5.1.exe

BIN
SyMAT-0.5.exe

99
build.xml

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="MeetLeeb" default="default" basedir=".">
<description>Builds, tests, and runs SyMAT.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="MeetLeeb-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
<target name="-unjar-and-copy-lib-jars">
<unjar dest="${build.classes.dir}">
<fileset dir="dist/lib">
<include name="**/*.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/**"/>
<exclude name="/*"/>
</patternset>
</unjar>
</target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-unjar-and-copy-lib-jars" name="fat-jar">
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<jar destfile="${dist.jar}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<echo>To run this application from the command line without Ant, try (HAXX):</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target depends="clean,fat-jar" name="clean-and-fat-jar"/>
</project>

42
launch4j.cfg.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\dist\SyMAT.jar</jar>
<outfile>C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.5.1.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>C:\Users\Skylar\SparkleShare\aplabs\appmedia\SyMAT\icon.ico</icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion>1.7.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
<splash>
<file>C:\Users\Skylar\SparkleShare\aplabs\appmedia\SyMAT\splash0.5.bmp</file>
<waitForWindow>true</waitForWindow>
<timeout>60</timeout>
<timeoutErr>true</timeoutErr>
</splash>
<versionInfo>
<fileVersion>0.5.1.0</fileVersion>
<txtFileVersion>Version 0.5</txtFileVersion>
<fileDescription>SyMAT</fileDescription>
<copyright>2014 Apocalypse Laboratories</copyright>
<productVersion>0.5.1.0</productVersion>
<txtProductVersion>Version 0.5</txtProductVersion>
<productName>SyMAT</productName>
<companyName>Apocalypse Laboratories</companyName>
<internalName>SyMAT</internalName>
<originalFilename>SyMAT-0.5.exe</originalFilename>
</versionInfo>
</launch4jConfig>

128
launch4j.log

@ -0,0 +1,128 @@
Version: 3.4
CmdLine: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe --l4j-debug
WOW64: yes
Working dir: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\.
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_40
Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
Match: 1.7.0_40
64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7.0_40
Ignore: 1.7.0_40
Runtime used: 1.7.0_40 (64-bit)
Add classpath: lib\log4j-1.2.11.jar
Add classpath: lib\symja-2014-11-01.jar
Launcher: C:\Program Files\Java\jre7\bin\javaw.exe
Launcher args: -classpath "C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe;lib\log4j-1.2.11.jar;lib\symja-2014-11-01.jar" net.apocalypselabs.symat.MainGUI
Args length: 154/32768 chars
Exit code: 259
Version: 3.4
CmdLine: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe --l4j-debug
WOW64: yes
Working dir: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\.
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_40
Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
Match: 1.7.0_40
64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7.0_40
Ignore: 1.7.0_40
Runtime used: 1.7.0_40 (64-bit)
Add classpath: lib\log4j-1.2.11.jar
Add classpath: lib\symja-2014-11-01.jar
Launcher: C:\Program Files\Java\jre7\bin\javaw.exe
Launcher args: -classpath "C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe;lib\log4j-1.2.11.jar;lib\symja-2014-11-01.jar" net.apocalypselabs.symat.MainGUI
Args length: 154/32768 chars
Exit code: 259
Version: 3.4
CmdLine: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe --l4j-debug
WOW64: yes
Working dir: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\.
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_40
Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
Match: 1.7.0_40
64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7.0_40
Ignore: 1.7.0_40
Runtime used: 1.7.0_40 (64-bit)
Add classpath: lib\log4j-1.2.11.jar
Add classpath: lib\symja-2014-11-01.jar
Launcher: C:\Program Files\Java\jre7\bin\javaw.exe
Launcher args: -classpath "C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe;lib\log4j-1.2.11.jar;lib\symja-2014-11-01.jar" net.apocalypselabs.symat.MainGUI
Args length: 154/32768 chars
Exit code: 259
Version: 3.4
CmdLine: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe --l4j-debug
WOW64: yes
Working dir: C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\.
64-bit search: SOFTWARE\JavaSoft\Java Runtime Environment...
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_40
Check launcher: C:\Program Files\Java\jre7\bin\javaw.exe (OK)
Match: 1.7.0_40
64-bit search: SOFTWARE\JavaSoft\Java Development Kit...
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6
Ignore: 1.6
Check: SOFTWARE\JavaSoft\Java Development Kit\1.6.0_45
Ignore: 1.6.0_45
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7
Ignore: 1.7
Check: SOFTWARE\JavaSoft\Java Development Kit\1.7.0_40
Ignore: 1.7.0_40
Runtime used: 1.7.0_40 (64-bit)
Add classpath: lib\log4j-1.2.11.jar
Add classpath: lib\symja-2014-11-01.jar
Launcher: C:\Program Files\Java\jre7\bin\javaw.exe
Launcher args: -classpath "C:\Users\Skylar\Documents\NetBeansProjects\SyMAT\SyMAT-0.3.exe;lib\log4j-1.2.11.jar;lib\symja-2014-11-01.jar" net.apocalypselabs.symat.MainGUI
Args length: 154/32768 chars
Exit code: 259

BIN
lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar

BIN
lib/JavaPrettify-1.2.1.jar

BIN
lib/htmlcleaner-2.10.jar

BIN
lib/iText-4.2.0-com.itextpdf.jar

BIN
lib/js-engine.jar

BIN
lib/js.jar

BIN
lib/log4j-1.2.11.jar

4
lib/nblibraries.properties

@ -0,0 +1,4 @@
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0

BIN
lib/symja-2014-11-01.jar

3
manifest.mf

@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

1439
nbproject/build-impl.xml
File diff suppressed because it is too large
View File

953
nbproject/build-native.xml

@ -0,0 +1,953 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM TEMPLATE - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
-->
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2013 Oracle and/or its affiliates. All rights reserved.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2013 Sun Microsystems, Inc.
-->
<project name="Build Native Packages" default="build-native" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"
xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Native Packager Ant calls based on SE support in JavaFX packager</description>
<!-- Check system and JDK version -->
<target name="-check-operating-system">
<condition property="running.on.mac">
<os family="mac"/>
</condition>
<condition property="running.on.unix">
<os family="unix"/>
</condition>
<condition property="running.on.windows">
<os family="windows"/>
</condition>
<echo message="running.on.mac = ${running.on.mac}" level="verbose"/>
<echo message="running.on.unix = ${running.on.unix}" level="verbose"/>
<echo message="running.on.windows = ${running.on.windows}" level="verbose"/>
</target>
<!-- Check availability of JavaFX SDK deployment support (ant-javafx.jar) -->
<target name="-check-endorsed-javafx-ant-classpath">
<condition property="endorsed-javafx-ant-classpath-available">
<and>
<isset property="endorsed.javafx.ant.classpath"/>
<not>
<equals arg1="${endorsed.javafx.ant.classpath}" arg2=""/>
</not>
</and>
</condition>
<echo message="endorsed-javafx-ant-classpath-available = ${endorsed-javafx-ant-classpath-available}" level="verbose"/>
</target>
<target name="-check-property-javafx.sdk">
<echo message="javafx.sdk = ${javafx.sdk}" level="verbose"/>
<condition property="javafx.sdk.defined">
<and>
<isset property="javafx.sdk"/>
<not><contains string="${javafx.sdk}" substring="$${platform" casesensitive="false"/></not>
</and>
</condition>
<condition property="javafx.sdk.missing+default">
<and>
<equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/>
<not><isset property="javafx.sdk.defined"/></not>
</and>
</condition>
<condition property="javafx.sdk.missing-default">
<and>
<not><equals arg1="${platform.active}" arg2="Default_JavaFX_Platform" trim="true"/></not>
<not><isset property="javafx.sdk.defined"/></not>
</and>
</condition>
<echo message="javafx.sdk.defined = ${javafx.sdk.defined}" level="verbose"/>
<echo message="javafx.sdk.missing+default = ${javafx.sdk.missing+default}" level="verbose"/>
<echo message="javafx.sdk.missing-default = ${javafx.sdk.missing-default}" level="verbose"/>
</target>
<target name="-check-ant-javafx-in-fxsdk-lib" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
<condition property="do.set.ant-javafx.in.fxsdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-fxsdk-lib" depends="-check-ant-javafx-in-fxsdk-lib" if="do.set.ant-javafx.in.fxsdk.lib">
<property name="ant-javafx.jar.location" value="${javafx.sdk}${file.separator}lib${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-fxsdk-tools" depends="-check-property-javafx.sdk" if="javafx.sdk.defined">
<condition property="do.set.ant-javafx.in.fxsdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-fxsdk-tools" depends="-set-ant-javafx-in-fxsdk-lib,-check-ant-javafx-in-fxsdk-tools" if="do.set.ant-javafx.in.fxsdk.tools">
<property name="ant-javafx.jar.location" value="${javafx.sdk}${file.separator}tools${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-platform-home-lib" if="platform.home">
<condition property="do.set.ant-javafx.in.platform.home.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-platform-home-lib" depends="-set-ant-javafx-in-fxsdk-tools,-check-ant-javafx-in-platform-home-lib" if="do.set.ant-javafx.in.platform.home.lib">
<property name="ant-javafx.jar.location" value="${platform.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-platform-home-tools" if="platform.home">
<condition property="do.set.ant-javafx.in.platform.home.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-platform-home-tools" depends="-set-ant-javafx-in-platform-home-lib,-check-ant-javafx-in-platform-home-tools" if="do.set.ant-javafx.in.platform.home.tools">
<property name="ant-javafx.jar.location" value="${platform.home}${file.separator}tools${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-probjdk-lib" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.probjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-probjdk-lib" depends="-set-ant-javafx-in-platform-home-tools,-check-ant-javafx-in-probjdk-lib" if="do.set.ant-javafx.in.probjdk.lib">
<property name="ant-javafx.jar.location" value="${java.home}${file.separator}..${file.separator}lib${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-probjdk-tools" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.probjdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-probjdk-tools" depends="-set-ant-javafx-in-probjdk-lib,-check-ant-javafx-in-probjdk-tools" if="do.set.ant-javafx.in.probjdk.tools">
<property name="ant-javafx.jar.location" value="${java.home}${file.separator}..${file.separator}tools${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-macjdk-lib" unless="ant-javafx.jar.location">
<condition property="do.set.ant-javafx.in.macjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-macjdk-lib" depends="-set-ant-javafx-in-probjdk-tools,-check-ant-javafx-in-macjdk-lib" if="do.set.ant-javafx.in.macjdk.lib">
<property name="ant-javafx.jar.location" value="${java.home}${file.separator}lib${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-envjdk-lib" unless="ant-javafx.jar.location">
<property environment="env"/>
<condition property="do.set.ant-javafx.in.envjdk.lib">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-envjdk-lib" depends="-set-ant-javafx-in-macjdk-lib,-check-ant-javafx-in-envjdk-lib" if="do.set.ant-javafx.in.envjdk.lib">
<property name="ant-javafx.jar.location" value="${env.JAVA_HOME}${file.separator}lib${file.separator}ant-javafx.jar"/>
</target>
<target name="-check-ant-javafx-in-envjdk-tools" unless="ant-javafx.jar.location">
<property environment="env"/>
<condition property="do.set.ant-javafx.in.envjdk.tools">
<and>
<not><isset property="ant-javafx.jar.location"/></not>
<available file="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
</and>
</condition>
</target>
<target name="-set-ant-javafx-in-envjdk-tools" depends="-set-ant-javafx-in-envjdk-lib,-check-ant-javafx-in-envjdk-tools" if="do.set.ant-javafx.in.envjdk.tools">
<property name="ant-javafx.jar.location" value="${env.JAVA_HOME}${file.separator}tools${file.separator}ant-javafx.jar"/>
</target>
<target name="-pre-check-ant-javafx-version" depends="-set-ant-javafx-in-envjdk-tools" unless="ant-javafx-version-already-checked-in-jfximpl">
<condition property="do.check.ant-javafx.version">
<and>
<isset property="ant-javafx.jar.location"/>
<not><isset property="ant-javafx-version-already-checked-in-jfximpl"/></not>
</and>
</condition>
</target>
<target name="-set-endorsed-javafx-ant-classpath" depends="-check-endorsed-javafx-ant-classpath,-pre-check-ant-javafx-version" if="endorsed-javafx-ant-classpath-available">
<property name="javafx.ant.classpath" value="${endorsed.javafx.ant.classpath}:${ant-javafx.jar.location}"/>
</target>
<target name="-set-javafx-ant-classpath" depends="-check-endorsed-javafx-ant-classpath,-pre-check-ant-javafx-version" unless="endorsed-javafx-ant-classpath-available">
<property name="javafx.ant.classpath" value="${ant-javafx.jar.location}"/>
</target>
<target name="-check-ant-javafx-version" depends="-pre-check-ant-javafx-version,
-set-endorsed-javafx-ant-classpath,-set-javafx-ant-classpath" if="do.check.ant-javafx.version">
<echo message="ant-javafx.jar.location = ${ant-javafx.jar.location}" level="verbose"/>
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${javafx.ant.classpath}"/>
<condition property="have-fx-ant-init">
<typefound name="javafx:com.sun.javafx.tools.ant:init-ant"/>
</condition>
<property name="ant-javafx-version-already-checked-in-jfximpl" value="true"/>
<echo message="have-fx-ant-init = ${have-fx-ant-init}" level="verbose"/>
</target>
<target name="-check-jfx-sdk-version-old" depends="-check-ant-javafx-version" unless="have-fx-ant-init">
<property name="javafx.ant.version" value="1.0"/>
</target>
<target name="-check-jfx-sdk-version-new" depends="-check-ant-javafx-version" if="have-fx-ant-init">
<fx:init-ant/>
<condition property="have-fx-ant-api-1.1">
<!-- new features from JavaFX 2.0.2 are available in API version 1.1 or later -->
<matches pattern="1.[1-9]" string="${javafx.ant.version}"/>
</condition>
<condition property="have-fx-ant-api-1.2">
<!-- new features from JavaFX 2.2 are available in API version 1.2 or later -->
<matches pattern="1.[2-9]" string="${javafx.ant.version}"/>
</condition>
</target>
<target name="-check-jfx-sdk-version" depends="-check-jfx-sdk-version-old, -check-jfx-sdk-version-new" unless="jfx.sdk.version.checked">
<echo message="Detected JavaFX Ant API version ${javafx.ant.version}" level="info"/>
<echo message="have-fx-ant-api-1.1 = ${have-fx-ant-api-1.1}" level="verbose"/>
<echo message="have-fx-ant-api-1.2 = ${have-fx-ant-api-1.2}" level="verbose"/>
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<property name="jfx.sdk.version.checked" value="true"/>
</target>
<target name="-check-ant-jre-version" unless="ant-jre-version-checked-in-jfximpl">
<local name="version-output"/>
<exec executable="${java.home}${file.separator}bin${file.separator}java" outputproperty="version-output">
<arg value="-version"/>
</exec>
<echo message="version-output:${line.separator}${version-output}" level="verbose"/>
<condition property="have-ant-jre-pre7u6">
<or>
<contains string="${version-output}" substring="java version &quot;1.0"/>
<contains string="${version-output}" substring="java version &quot;1.1"/>
<contains string="${version-output}" substring="java version &quot;1.2"/>
<contains string="${version-output}" substring="java version &quot;1.3"/>
<contains string="${version-output}" substring="java version &quot;1.4"/>
<contains string="${version-output}" substring="java version &quot;1.5"/>
<contains string="${version-output}" substring="java version &quot;1.6"/>
<contains string="${version-output}" substring="java version &quot;1.7.0&quot;"/>
<contains string="${version-output}" substring="java version &quot;1.7.0_01"/>
<contains string="${version-output}" substring="java version &quot;1.7.0_02"/>
<contains string="${version-output}" substring="java version &quot;1.7.0_03"/>
<contains string="${version-output}" substring="java version &quot;1.7.0_04"/>
<contains string="${version-output}" substring="java version &quot;1.7.0_05"/>
</or>
</condition>
<property name="ant-jre-version-checked-in-jfximpl" value="true"/>
<echo message="have-ant-jre-pre7u6 = ${have-ant-jre-pre7u6}" level="verbose"/>
</target>
<!-- Native Packaging main target -->
<target name="build-native" depends="-set-do-build-native-package, -check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, -fx-jar-impl, -build-native-impl, -post-build-native-cleanup"/>
<target name="build-native-noscript">
<fail message="Java Application Native Packager requires JDK JavaScript support but has not found any."/>
</target>
<target name="-check-do-jar">
<condition property="do-jar-false">
<and>
<isset property="do.jar"/>
<equals arg1="${do.jar}" arg2="false"/>
</and>
</condition>
</target>
<target name="-set-do-build-native-package">
<property name="do.build.native.package" value="true"/>
<echo message="do.build.native.package = ${do.build.native.package}" level="verbose"/>
</target>
<target name="-check-ant-jre-supports-native-packaging" depends="-check-jfx-sdk-version, -check-ant-javafx-version, -check-ant-jre-version">
<fail message="Error:${line.separator}JavaFX native packager requires NetBeans to run on JDK 1.7u6 or later !" if="have-ant-jre-pre7u6"/>
</target>
<target name="-check-native-bundling-type" depends="-check-operating-system" if="do.build.native.package">
<condition property="need.Inno.presence">
<and>
<isset property="running.on.windows"/>
<isset property="native.bundling.type"/>
<or>
<equals arg1="${native.bundling.type}" arg2="all" casesensitive="false"/>
<equals arg1="${native.bundling.type}" arg2="installer" casesensitive="false"/>
<equals arg1="${native.bundling.type}" arg2="exe" casesensitive="false"/>
</or>
</and>
</condition>
<condition property="need.WiX.presence">
<and>
<isset property="running.on.windows"/>
<isset property="native.bundling.type"/>
<or>
<equals arg1="${native.bundling.type}" arg2="all" casesensitive="false"/>
<equals arg1="${native.bundling.type}" arg2="installer" casesensitive="false"/>
<equals arg1="${native.bundling.type}" arg2="msi" casesensitive="false"/>
</or>
</and>
</condition>
<condition property="need.dpkg.presence">
<and>
<isset property="running.on.unix"/>
<isset property="native.bundling.type"/>
<or>
<equals arg1="${native.bundling.type}" arg2="deb" casesensitive="false"/>
</or>
</and>
</condition>
<condition property="need.rpmbuild.presence">
<and>
<isset property="running.on.unix"/>
<isset property="native.bundling.type"/>
<or>
<equals arg1="${native.bundling.type}" arg2="rpm" casesensitive="false"/>
</or>
</and>
</condition>
<echo message="need.Inno.presence:${need.Inno.presence}" level="verbose"/>
<echo message="need.WiX.presence:${need.WiX.presence}" level="verbose"/>
<echo message="need.dpkg.presence:${need.dpkg.presence}" level="verbose"/>
<echo message="need.rpmbuild.presence:${need.rpmbuild.presence}" level="verbose"/>
</target>
<target name="-check-Inno-presence" depends="-check-native-bundling-type" if="need.Inno.presence">
<local name="exec-output"/>
<local name="exec-error"/>
<local name="exec-result"/>
<exec executable="iscc" outputproperty="exec-output" failifexecutionfails="false" errorproperty="exec-error" resultproperty="exec-result"/>
<echo message="exec-output:${exec-output}" level="verbose"/>
<echo message="exec-error:${exec-error}" level="verbose"/>
<echo message="exec-result:${exec-result}" level="verbose"/>
<condition property="missing.Inno">
<not><and>
<contains string="${exec-output}" substring="Inno Setup"/>
<not><contains string="${exec-output}" substring="Inno Setup 1"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 2"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 3"/></not>
<not><contains string="${exec-output}" substring="Inno Setup 4"/></not>
</and></not>
</condition>
</target>
<target name="-check-WiX-presence" depends="-check-native-bundling-type" if="need.WiX.presence">
<local name="exec-output"/>
<local name="exec-error"/>
<local name="exec-result"/>
<exec executable="candle" outputproperty="exec-output" failifexecutionfails="false" errorproperty="exec-error" resultproperty="exec-result">
<arg value="-?"/>
</exec>
<echo message="exec-output:${exec-output}" level="verbose"/>
<echo message="exec-error:${exec-error}" level="verbose"/>
<echo message="exec-result:${exec-result}" level="verbose"/>
<condition property="missing.WiX">
<not><and>
<contains string="${exec-output}" substring="Windows Installer Xml Compiler version"/>
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 1"/></not>
<not><contains string="${exec-output}" substring="Windows Installer Xml Compiler version 2"/></not>
</and></not>
</condition>
</target>
<target name="-check-dpkg-presence" depends="-check-native-bundling-type" if="need.dpkg.presence">
<local name="exec.which.dpkg.result"/>
<local name="exec.which.dpkg.output"/>
<exec executable="command" failifexecutionfails="false" failonerror="false" resultproperty="exec.which.dpkg.result" outputproperty="exec.which.dpkg.output">
<arg line="-v dpkg"/>
</exec>
<condition property="missing.dpkg">
<not><and>
<isset property="exec.which.dpkg.result"/>
<equals arg1="${exec.which.dpkg.result}" arg2="0"/>
<isset property="exec.which.dpkg.output"/>
<not><equals arg1="${exec.which.dpkg.output}" arg2=""/></not>
</and></not>
</condition>
</target>
<target name="-check-rpmbuild-presence" depends="-check-native-bundling-type" if="need.rpmbuild.presence">
<local name="exec.which.rpmbuild.result"/>
<local name="exec.which.rpmbuild.output"/>
<exec executable="command" failifexecutionfails="false" failonerror="false" resultproperty="exec.which.rpmbuild.result" outputproperty="exec.which.rpmbuild.output">
<arg line="-v rpmbuild"/>
</exec>
<condition property="missing.rpmbuild">
<not><and>
<isset property="exec.which.rpmbuild.result"/>
<equals arg1="${exec.which.rpmbuild.result}" arg2="0"/>
<isset property="exec.which.rpmbuild.output"/>
<not><equals arg1="${exec.which.rpmbuild.output}" arg2=""/></not>
</and></not>
</condition>
</target>
<target name="-check-native-packager-external-tools" depends="-check-Inno-presence, -check-WiX-presence, -check-dpkg-presence, -check-rpmbuild-presence">
<property name="missing.Inno.message" value="JavaFX native packager requires external Inno Setup 5+ tools installed and included on PATH to create EXE installer. See http://www.jrsoftware.org/"/>
<property name="missing.WiX.message" value="JavaFX native packager requires external WiX 3.0+ tools installed and included on PATH to create MSI installer. See http://wix.sourceforge.net/"/>
<property name="missing.dpkg.message" value="JavaFX native packager requires Debian Packager tools to create DEB package, but dpkg could not be found."/>
<property name="missing.rpmbuild.message" value="JavaFX native packager requires RPMBuild to create RPM package, but rpmbuild could not be found."/>
<condition property="missing.Inno.WiX">
<and>
<isset property="missing.Inno"/>
<isset property="missing.WiX"/>
</and>
</condition>
<fail message="Error:${line.separator}${missing.Inno.message}${line.separator}${missing.WiX.message}" if="missing.Inno.WiX"/>
<fail message="Error:${line.separator}${missing.Inno.message}" if="missing.Inno"/>
<fail message="Error:${line.separator}${missing.WiX.message}" if="missing.WiX"/>
<fail message="Error:${line.separator}${missing.dpkg.message}" if="missing.dpkg"/>
<fail message="Error:${line.separator}${missing.rpmbuild.message}" if="missing.rpmbuild"/>
</target>
<!-- Copy dependent libraries -->
<target name="-jfx-copylibs" depends="init,compile,-pre-pre-jar,-pre-jar,-jfx-copylibs-warning" unless="fallback.no.javascript">
<jfx-copylibs-js-impl/>
</target>
<target name="-jfx-copylibs-warning" if="fallback.no.javascript">
<echo message="Warning: Dependent Libraries copy (-jfx-copylibs) skipped in fallback build mode due to JDK missing JavaScript support."/>
</target>
<macrodef name="jfx-copylibs-js-impl">
<sequential>
<local name="run.classpath.without.build.classes.and.dist.dir"/>
<pathconvert property="run.classpath.without.build.classes.and.dist.dir">
<path path="${run.classpath}"/>
<map from="${basedir}${file.separator}${build.classes.dir}" to=""/>
<map from="${basedir}${file.separator}${dist.jar}" to=""/>
<scriptmapper language="javascript">
self.addMappedName(
(source.indexOf("jfxrt.jar") >= 0) ||
(source.indexOf("deploy.jar") >= 0) ||
(source.indexOf("javaws.jar") >= 0) ||
(source.indexOf("plugin.jar") >= 0)
? "" : source
);
</scriptmapper>
</pathconvert>
<!-- add possibly missing dependencies at distance 2 (build system logic thus provides transitive closure) -->
<local name="run.and.lib.classpath"/>
<echo message="JavaScript: -jfx-copylibs" level="verbose"/>
<script language="javascript">
<![CDATA[
function prefix(s, len) {
if(s == null || len <= 0 || s.length == 0) {
return new String("");
}
return new String(s.substr(0, len));
}
function defined(s) {
return (s != null) && (s != "null") && (s.length > 0);
}
var classPath = new String(project.getProperty("run.classpath.without.build.classes.and.dist.dir"));
if(defined(classPath)) {
var fileSeparator = new String(project.getProperty("file.separator"));
var pathConvert = project.createTask("pathconvert");
pathConvert.setProperty("run.and.lib.classpath");
var classPathCopy = pathConvert.createPath();
classPathCopy.setPath(classPath);
var pathArray;
if(classPath.indexOf(";") != -1) {
pathArray = classPath.split(";");
} else {
pathArray = classPath.split(":");
}
var added = new java.lang.StringBuilder();
for (var i = 0; i < pathArray.length; i++) {
var index = pathArray[i].lastIndexOf(fileSeparator);
if (index >= 0) {
var onePath = prefix(pathArray[i], index+1).concat("lib");
var oneDir = new java.io.File(onePath);
if(oneDir.exists()) {
var fs = project.createDataType( "fileset" );
fs.setDir( oneDir );
fs.setIncludes("*.jar");
var ds = fs.getDirectoryScanner(project);
var srcFiles = ds.getIncludedFiles();
for (var j = 0; j < srcFiles.length; j++) {
if(classPath.indexOf( srcFiles[j] ) == -1 && added.indexOf( srcFiles[j] ) == -1) {
var path = pathConvert.createPath();
path.setPath( onePath.concat(fileSeparator).concat(srcFiles[j]) );
added.append( srcFiles[j] );
}
}
}
}
}
pathConvert.perform();
}
]]>
</script>
<echo message="run.and.lib.classpath = ${run.and.lib.classpath}" level="verbose"/>
<property name="run.and.lib.classpath" value=""/> <!-- fallback -->
<delete dir="${dist.dir}${file.separator}lib" includeEmptyDirs="true" quiet="true"/>
<copy todir="${dist.dir}${file.separator}lib" flatten="true" preservelastmodified="true" overwrite="true">
<path>
<pathelement path="${run.and.lib.classpath}"/>
</path>
</copy>
</sequential>
</macrodef>
<!-- <fx:jar> replacing standard jar, because native packager up to JDK7u21 refuses to package standard jars -->
<target name="-fx-jar-impl" depends="-check-jfx-sdk-version, -check-ant-javafx-version, -check-ant-jre-version, clean, compile, -jfx-copylibs">
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<typedef name="fx_jar" classname="com.sun.javafx.tools.ant.FXJar" classpath="${javafx.ant.classpath}"/>
<echo message="Launching &lt;fx:jar&gt; task from ${ant-javafx.jar.location}" level="info"/>
<property name="deployment.dir" location="${dist.dir}"/>
<basename property="deployment.jar" file="${dist.jar}"/>
<property name="pp_jar_destfile" value="${deployment.dir}${file.separator}${deployment.jar}"/>
<property name="pp_jar_buildclasses" value="${basedir}${file.separator}${build.classes.dir}"/>
<property name="pp_jar_dir" value="${deployment.dir}"/>
<property name="pp_jar_fs2" value="lib${file.separator}*.jar"/>
<echo message="fx_jar: pp_jar_destfile = ${pp_jar_destfile}" level="verbose"/>
<echo message="fx_jar: pp_jar_buildclasses = ${pp_jar_buildclasses}" level="verbose"/>
<echo message="fx_jar: pp_jar_dir = ${pp_jar_dir}" level="verbose"/>
<echo message="fx_jar: pp_jar_fs2 = ${pp_jar_fs2}" level="verbose"/>
<echo message="JavaScript: fx-jar" level="verbose"/>
<script language="javascript">
<![CDATA[
function isTrue(prop) {
return prop != null &&
( prop.toLowerCase() == "true" || prop.toLowerCase() == "yes" || prop.toLowerCase() == "on" );
}
function prefix(s, len) {
if(s == null || len <= 0 || s.length == 0) {
return new String("");
}
return new String(s.substr(0, len));
}
function replaceSuffix(s, os, ns) {
return prefix(s, s.indexOf(os)).concat(ns);
}
function startsWith(s, prefix) {
return (s != null) && (s.indexOf(prefix) == 0);
}
function endsWith(s, suffix) {
var i = s.lastIndexOf(suffix);
return (i != -1) && (i == (s.length - suffix.length));
}
function defined(s) {
return (s != null) && (s != "null") && (s.length > 0);
}
function contains(array, prop) {
for (var i = 0; i < array.length; i++) {
var s1 = new String(array[i]);
var s2 = new String(prop);
if( s1.toLowerCase() == s2.toLowerCase() ) {
return true;
}
}
return false;
}
var S = new String(java.io.File.separator);
var JFXLAZY = "download.mode.lazy.jar";
var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
// get jars with lazy download mode property set
function getLazyJars() {
var jars = new Array();
var keys = project.getProperties().keys();
while(keys.hasMoreElements()) {
var pn = new String(keys.nextElement());
if(startsWith(pn, JFXLAZY)) {
var fname = new String(pn.substring(JFXLAZY.length+1));
jars.push(fname);
}
}
return jars.length > 0 ? jars : null;
}
// set download mode of dependent libraries
function setDownloadMode(fsEager, fsLazy, jars) {
for(var i = 0; i < jars.length; i++) {
fsEager.setExcludes("lib" + S + jars[i]);
fsLazy.setIncludes("lib" + S + jars[i]);
}
}
// fx:jar
var jar = project.createTask("fx_jar");
jar.setProject(project);
var destfile = new String(project.getProperty("pp_jar_destfile"));
jar.setDestfile(destfile);
// fx:application
var app = jar.createApplication();
app.setProject(project);
var title = new String(project.getProperty("application.title"));
var mainclass;
mainclass = new String(project.getProperty("main.class"));
if(isTrue(fx_ant_api_1_2)) {
app.setToolkit("swing");
}
app.setName(title);
app.setMainClass(mainclass);
var appversion = new String(project.getProperty("application.implementation.version"));
if(defined(appversion)) {
app.setVersion(appversion);
} else {
app.setVersion("1.0");
}
// fx:resources
var res = jar.createResources();
res.setProject(project);
var pdir = new String(project.getProperty("pp_jar_dir"));
var fn = res.createFileSet();
fn.setProject(project);
fn.setDir(new java.io.File(pdir));
var ia = new String(project.getProperty("deployment.jar"));
var ib = new String(project.getProperty("pp_jar_fs2"));
fn.setIncludes(ia);
fn.setIncludes(ib);
fn.setRequiredFor("startup");
var lazyjars = getLazyJars();
if(lazyjars != null) {
var fn2 = res.createFileSet();
fn2.setProject(project);
fn2.setDir(new java.io.File(pdir));
fn2.setRequiredFor("runtime");
setDownloadMode(fn,fn2,lazyjars);
}
// fileset to include classes
var fs = jar.createFileSet();
fs.setProject(project);
var buildcls = new String(project.getProperty("pp_jar_buildclasses"));
fs.setDir(new java.io.File(buildcls));
// manifest
var man = jar.createManifest();
var a1val = new String(project.getProperty("application.vendor"));
var a1 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
a1.setName("Implementation-Vendor");
a1.setValue(a1val);
man.addConfiguredAttribute(a1);
var a2val = new String(project.getProperty("application.title"));
var a2 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
a2.setName("Implementation-Title");
a2.setValue(a2val);
man.addConfiguredAttribute(a2);
if(defined(appversion)) {
var a3 = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
a3.setName("Implementation-Version");
a3.setValue(appversion);
man.addConfiguredAttribute(a3);
}
var profileAvailable = new String(project.getProperty("profile.available"));
if (defined(profileAvailable)) {
var profileAttribute = new org.apache.tools.ant.taskdefs.Manifest.Attribute();
profileAttribute.setName("Profile");
profileAttribute.setValue(new String(project.getProperty("javac.profile")));
man.addConfiguredAttribute(profileAttribute);
}
var splashScreenAvailable = new String(project.getProperty("splashscreen.available"));
if (defined(splashScreenAvailable)) {
project.setProperty("deploy.splash.image",new String(project.getProperty("application.splash")));
}
jar.perform();
]]>
</script>
</target>
<!-- Native Packaging main implementation -->
<target name="-build-native-impl" depends="-check-ant-jre-supports-native-packaging, -check-native-packager-external-tools, -fx-jar-impl">
<!--<property name="runtime.jre.home" value="${platform.home}"/>-->
<echo message="javafx.ant.classpath = ${javafx.ant.classpath}" level="verbose"/>
<typedef name="fx_deploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpath="${javafx.ant.classpath}"/>
<echo message="Launching &lt;fx:deploy&gt; task from ${ant-javafx.jar.location}" level="info"/>
<property name="deployment.dir" location="${dist.dir}"/>
<property name="pp_deploy_fs2" value="lib${file.separator}*.jar"/>
<basename property="deployment.jar" file="${dist.jar}"/>
<basename property="deployment.base" file="${deployment.jar}" suffix=".jar"/>
<echo message="deploy_deploy: pp_deploy_fs2 = ${pp_deploy_fs2}" level="verbose"/>
<echo message="deploy_deploy: deployment.dir = ${deployment.dir}" level="verbose"/>
<echo message="deploy_deploy: deployment.jar = ${deployment.jar}" level="verbose"/>
<echo message="deploy_deploy: deployment.base = ${deployment.base}" level="verbose"/>
<echo message="JavaScript: deploy-deploy" level="verbose"/>
<script language="javascript">
<![CDATA[
function isTrue(prop) {
return prop != null &&
(prop.toLowerCase()=="true" || prop.toLowerCase()=="yes" || prop.toLowerCase()=="on");
}
function prefix(s, len) {
if(s == null || len <= 0 || s.length == 0) {
return new String("");
}
return new String(s.substr(0, len));
}
function replaceSuffix(s, os, ns) {
return prefix(s, s.indexOf(os)).concat(ns);
}
function startsWith(s, prefix) {
return (s != null) && (s.indexOf(prefix) == 0);
}
function endsWith(s, suffix) {
var i = s.lastIndexOf(suffix);
return (i != -1) && (i == (s.length - suffix.length));
}
function defined(s) {
return (s != null) && (s != "null") && (s.length > 0);
}
function contains(array, prop) {
for (var i = 0; i < array.length; i++) {
var s1 = new String(array[i]);
var s2 = new String(prop);
if( s1.toLowerCase() == s2.toLowerCase() ) {
return true;
}
}
return false;
}
var S = java.io.File.separator;
var JFXLAZY = "download.mode.lazy.jar";
var fx_ant_api_1_1 = new String(project.getProperty("have-fx-ant-api-1.1"));
var fx_ant_api_1_2 = new String(project.getProperty("have-fx-ant-api-1.2"));
var have_jdk_pre7u14 = new String(project.getProperty("have-jdk-pre7u14"));
// get jars with lazy download mode property set
function getLazyJars() {
var jars = new Array();
var keys = project.getProperties().keys();
while(keys.hasMoreElements()) {
var pn = new String(keys.nextElement());
if(startsWith(pn, JFXLAZY)) {
var fname = pn.substring(JFXLAZY.length+1);
jars.push(fname);
}
}
return jars.length > 0 ? jars : null;
}
// set download mode of dependent libraries
function setDownloadMode(fsEager, fsLazy, jars) {
for(var i = 0; i < jars.length; i++) {
fsEager.setExcludes("lib" + S + jars[i]);
fsLazy.setIncludes("lib" + S + jars[i]);
}
}
// convert path to absolute if relative
function derelativizePath(path) {
var f = new java.io.File(path);
if(!f.exists()) {
f = new java.io.File(new String(project.getBaseDir()) + S + path);
}
if(f.exists()) {
try {
return f.getCanonicalPath();
} catch(err) {
return path;
}
}
return path;
}
// fx:deploy
var deploy = project.createTask("fx_deploy");
deploy.setProject(project);
var width = new String(project.getProperty("javafx.width"));
var height = new String(project.getProperty("javafx.height"));
var outdir = new String(project.getProperty("deployment.dir"));
var outfile = new String(project.getProperty("application.title"));
if(!defined(width)) width=new String("0");
if(!defined(height)) height=new String("0");
deploy.setWidth(width);
deploy.setHeight(height);
deploy.setOutdir(outdir);
deploy.setOutfile(outfile);
// native packaging (time consuming, thus applied in explicit build only)
var nativeEnabled = new String(project.getProperty("do.build.native.package"));
var nativeType = new String(project.getProperty("native.bundling.type"));
var projStateRun = new String(project.getProperty("project.state.running"));
var projStateDbg = new String(project.getProperty("project.state.debugging"));
var projStatePrf = new String(project.getProperty("project.state.profiling"));
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
if(!isTrue(projStateRun) && !isTrue(projStateDbg) && !isTrue(projStatePrf)) {
if(isTrue(fx_ant_api_1_2)) {
deploy.setNativeBundles(nativeType);
print("Note: To create native bundles the <fx:deploy> task may require external tools. See JavaFX 2.2+ documentation for details.");
print("");
print("Launching <fx:deploy> in native packager mode...");
} else {
print("Warning: Native packaging is not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK 7u6 or higher.");
}
}
}
// fx:application
var app = deploy.createApplication();
app.setProject(project);
var title = new String(project.getProperty("application.title"));
var mainclass;
mainclass = new String(project.getProperty("main.class"));
if(isTrue(fx_ant_api_1_2)) {
app.setToolkit("swing");
}
app.setName(title);
app.setMainClass(mainclass);
var appversion = new String(project.getProperty("application.implementation.version"));
if(defined(appversion)) {
app.setVersion(appversion);
} else {
app.setVersion("1.0");
}
// fx:resources
var res = deploy.createResources();
res.setProject(project);
var deploydir = new String(project.getProperty("deployment.dir"));
var fn = res.createFileSet();
fn.setProject(project);
fn.setDir(new java.io.File(deploydir));
var ia = new String(project.getProperty("deployment.jar"));
var ib = new String(project.getProperty("pp_deploy_fs2"));
fn.setIncludes(ia);
fn.setIncludes(ib);
fn.setRequiredFor("startup");
var lazyjars = getLazyJars();
if(lazyjars != null) {
var fn2 = res.createFileSet();
fn2.setProject(project);
fn2.setDir(new java.io.File(deploydir));
fn2.setRequiredFor("runtime");
setDownloadMode(fn,fn2,lazyjars);
}
// fx:info
var info = deploy.createInfo();
info.setProject(project);
var vendor = new String(project.getProperty("application.vendor"));
var description = new String(project.getProperty("application.desc"));
info.setTitle(title); // title known from before
info.setVendor(vendor);
info.setDescription(description);
var splash = new String(project.getProperty("deploy.splash.image"));
if(defined(splash)) {
if(isTrue(fx_ant_api_1_1)) {
var sicon = info.createSplash();
sicon.setHref(splash);
sicon.setMode("any");
print("Adding splash image reference: " + splash);
} else {
print("Warning: Splash Image not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
if(isTrue(nativeEnabled) && defined(nativeType) && nativeType != "none") {
var icon = new String(project.getProperty("deploy.icon.native"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_2) && !isTrue(have_jdk_pre7u14)) {
var dicon = derelativizePath(icon);
// create temporary icon copy renamed to application name (required by native packager)
var baseDir = new String(project.getProperty("basedir"));
var buildDir = new String(project.getProperty("build.dir"));
var deployBase = new String(project.getProperty("deployment.base"));
var copyTask = project.createTask("copy");
var source = new java.io.File(dicon);
var sourceName = new String(source.getName());
var lastDot = sourceName.lastIndexOf(".");
var sourceExt;
if(lastDot >=0) {
sourceExt = sourceName.substr(lastDot);
} else {
sourceExt = new String("");
}
var target = new java.io.File(baseDir.concat(S).concat(buildDir).concat(S).concat("icon").concat(S).concat(deployBase).concat(sourceExt));
copyTask.setFile(source);
copyTask.setTofile(target);
copyTask.setFlatten(true);
copyTask.setFailOnError(false);
copyTask.perform();
var tempicon;
if(target.exists()) {
try {
tempicon = target.getCanonicalPath();
} catch(err) {
tempicon = dicon;
}
} else {
tempicon = dicon;
}
var nicon = info.createIcon();
nicon.setHref(tempicon);
print("Source native icon reference: " + dicon);
print("Processed native icon reference: " + tempicon);
} else {
print("Warning: Native Package icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade to JDK7u14.");
}
}
} else {
var icon = new String(project.getProperty("deploy.icon.webstart"));
if(defined(icon)) {
if(isTrue(fx_ant_api_1_1)) {
var iicon = info.createIcon();
iicon.setHref(icon);
print("Adding WebStart icon reference: " + icon);
} else {
print("Warning: WebStart Icon not supported by this version of JavaFX SDK deployment Ant task. Please upgrade JavaFX to 2.0.2 or higher.");
}
}
}
deploy.perform();
]]>
</script>
</target>
<target name="-post-build-native-cleanup">
<delete file="${dist.dir}/${application.title}.html" quiet="true"/>
<delete file="${dist.dir}/${application.title}.jnlp" quiet="true"/>
<delete file="${dist.dir}/${application.title}_browser.jnlp" quiet="true"/>
</target>
</project>

8
nbproject/genfiles.properties

@ -0,0 +1,8 @@
build.xml.data.CRC32=df50d06e
build.xml.script.CRC32=43ba75c8
build.xml.stylesheet.CRC32=8064a381@1.75.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=5e7cbec2
nbproject/build-impl.xml.script.CRC32=fb76102b
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.1.48

108
nbproject/project.properties

@ -0,0 +1,108 @@
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.splash=C:\\Users\\Skylar\\SparkleShare\\aplabs\\appmedia\\SyMAT\\splash0.5.png
application.title=SyMAT
application.vendor=Apocalypse Laboratories
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
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
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# Files in build.classes.dir which should be excluded from distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/SyMAT.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
file.reference.iText-4.2.0-com.itextpdf.jar=lib/iText-4.2.0-com.itextpdf.jar
file.reference.JavaPrettify-1.2.1.jar=lib/JavaPrettify-1.2.1.jar
file.reference.js-engine.jar=lib/js-engine.jar
file.reference.js.jar=lib/js.jar
file.reference.log4j-1.2.11.jar=lib/log4j-1.2.11.jar
file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.log4j-1.2.11.jar}:\
${file.reference.symja-2014-11-01.jar}:\
${file.reference.JavaPrettify-1.2.1.jar}:\
${file.reference.iText-4.2.0-com.itextpdf.jar}:\
${file.reference.htmlcleaner-2.10.jar}:\
${file.reference.js-engine.jar}:\
${file.reference.js.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jnlp.codebase.type=no.codebase
jnlp.descriptor=application
jnlp.enabled=false
jnlp.mixed.code=default
jnlp.offline-allowed=false
jnlp.signed=false
jnlp.signing=
jnlp.signing.alias=
jnlp.signing.keystore=
main.class=net.apocalypselabs.symat.MainGUI
# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
manifest.custom.codebase=
# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
manifest.custom.permissions=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
native.bundling.enabled=true
platform.active=default_platform
project.license=lgpl21
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

21
nbproject/project.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
<extension file="build-native.xml" id="j2sedeploy"/>
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>SyMAT</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>.\lib\nblibraries.properties</definitions>
</libraries>
</configuration>
</project>

263
src/net/apocalypselabs/symat/CodeEditor.form

@ -0,0 +1,263 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JMenuItem" name="jMenuItem4">
<Properties>
<Property name="text" type="java.lang.String" value="jMenuItem4"/>
</Properties>
</Component>
<Container class="javax.swing.JMenuBar" name="jMenuBar2">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu3">
<Properties>
<Property name="text" type="java.lang.String" value="File"/>
</Properties>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu4">
<Properties>
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
</Menu>
</SubComponents>
</Container>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="File"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+O"/>
</Property>
<Property name="text" type="java.lang.String" value="Open..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+S"/>
</Property>
<Property name="text" type="java.lang.String" value="Save..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem3">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Shift+Ctrl+S"/>
</Property>
<Property name="text" type="java.lang.String" value="Save as..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem8">
<Properties>
<Property name="text" type="java.lang.String" value="Export..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem8ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu5">
<Properties>
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem6">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+W"/>
</Property>
<Property name="text" type="java.lang.String" value="Clear output"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem7">
<Properties>
<Property name="text" type="java.lang.String" value="Font size..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem7ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu2">
<Properties>
<Property name="text" type="java.lang.String" value="Run"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenu2ActionPerformed"/>
</Events>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem5">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="F5"/>
</Property>
<Property name="text" type="java.lang.String" value="Run code"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem5ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="closable" type="boolean" value="true"/>
<Property name="iconifiable" type="boolean" value="true"/>
<Property name="maximizable" type="boolean" value="true"/>
<Property name="resizable" type="boolean" value="true"/>
<Property name="title" type="java.lang.String" value="Editor"/>
<Property name="frameIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/net/apocalypselabs/symat/icons/editor.png"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSplitPane1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSplitPane1" alignment="0" pref="359" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
<Properties>
<Property name="dividerLocation" type="int" value="275"/>
<Property name="dividerSize" type="int" value="3"/>
<Property name="orientation" type="int" value="0"/>
<Property name="resizeWeight" type="double" value="0.7"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="scrollPane">
<Properties>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new JScrollPane(codeBox)"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="top"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane1" pref="524" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="72" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Output:"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="outputPane">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>

415
src/net/apocalypselabs/symat/CodeEditor.java

@ -0,0 +1,415 @@
/*
* Copyright (C) 2014 Apocalypse Laboratories.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package net.apocalypselabs.symat;
import java.awt.Font;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.text.AttributeSet;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
import javax.swing.text.TabSet;
import javax.swing.text.TabStop;
/**
*
* @author Skylar
*/
public class CodeEditor extends javax.swing.JInternalFrame {
private final JFileChooser fc = new JFileChooser();
private boolean isSaved = false;