Browse Source

Update license headers, theme changes, misc. tweaks

tags/2.1
Skylar 4 years ago
parent
commit
aa60a6528b
57 changed files with 0 additions and 16461 deletions
  1. 0
    60
      LICENSE
  2. 0
    20
      README.md
  3. 0
    76
      build.xml
  4. 0
    66
      lib/nblibraries.properties
  5. 0
    1424
      nbproject/build-impl.xml
  6. 0
    11
      nbproject/genfiles.properties
  7. 0
    152
      nbproject/project.properties
  8. 0
    19
      nbproject/project.xml
  9. 0
    66
      src/net/apocalypselabs/symat/BadInputException.java
  10. 0
    114
      src/net/apocalypselabs/symat/CodeCompleter.java
  11. 0
    481
      src/net/apocalypselabs/symat/CodeExport.java
  12. 0
    307
      src/net/apocalypselabs/symat/CodeRunner.java
  13. 0
    76
      src/net/apocalypselabs/symat/Debug.java
  14. 0
    1047
      src/net/apocalypselabs/symat/Editor.java
  15. 0
    149
      src/net/apocalypselabs/symat/FileUtils.java
  16. 0
    138
      src/net/apocalypselabs/symat/FontOptions.java
  17. 0
    1300
      src/net/apocalypselabs/symat/Functions.java
  18. 0
    320
      src/net/apocalypselabs/symat/Globals.java
  19. 0
    542
      src/net/apocalypselabs/symat/Graph.java
  20. 0
    304
      src/net/apocalypselabs/symat/Help.java
  21. 0
    310
      src/net/apocalypselabs/symat/InstallPlugin.java
  22. 0
    548
      src/net/apocalypselabs/symat/Interpreter.java
  23. 0
    122
      src/net/apocalypselabs/symat/KeyValListItem.java
  24. 0
    430
      src/net/apocalypselabs/symat/License.java
  25. 0
    4
      src/net/apocalypselabs/symat/Main.form
  26. 0
    1125
      src/net/apocalypselabs/symat/Main.java
  27. 0
    3
      src/net/apocalypselabs/symat/Notepad.form
  28. 0
    219
      src/net/apocalypselabs/symat/Notepad.java
  29. 0
    467
      src/net/apocalypselabs/symat/PackagePlugin.java
  30. 0
    561
      src/net/apocalypselabs/symat/Pads.java
  31. 0
    127
      src/net/apocalypselabs/symat/PrefStorage.java
  32. 0
    305
      src/net/apocalypselabs/symat/Settings.form
  33. 0
    370
      src/net/apocalypselabs/symat/Settings.java
  34. 0
    282
      src/net/apocalypselabs/symat/SharePad.java
  35. 0
    85
      src/net/apocalypselabs/symat/SingleInstanceClient.java
  36. 0
    106
      src/net/apocalypselabs/symat/SingleInstanceServer.java
  37. 0
    322
      src/net/apocalypselabs/symat/SplashScreen.java
  38. 0
    45
      src/net/apocalypselabs/symat/SyncLogin.java
  39. 0
    367
      src/net/apocalypselabs/symat/Tasks.java
  40. 0
    480
      src/net/apocalypselabs/symat/TasksExport.java
  41. 0
    139
      src/net/apocalypselabs/symat/Theme.java
  42. 0
    222
      src/net/apocalypselabs/symat/Update.java
  43. 0
    416
      src/net/apocalypselabs/symat/WebBrowser.java
  44. 0
    198
      src/net/apocalypselabs/symat/components/Task.java
  45. 0
    6
      src/net/apocalypselabs/symat/components/TaskList.java
  46. 0
    190
      src/net/apocalypselabs/symat/components/TaskMenu.java
  47. 0
    132
      src/net/apocalypselabs/symat/components/TextBox.java
  48. 0
    34
      src/net/apocalypselabs/symat/functions.js
  49. 0
    1722
      src/net/apocalypselabs/symat/help/licenses.html
  50. 0
    19
      src/net/apocalypselabs/symat/help/pads.html
  51. 0
    139
      src/net/apocalypselabs/symat/plugin/LoadPlugin.java
  52. 0
    6
      src/net/apocalypselabs/symat/plugin/Plugin.java
  53. 0
    28
      src/net/apocalypselabs/symat/pretty.css
  54. 0
    84
      src/net/apocalypselabs/symat/resources/homepage.html
  55. 0
    86
      src/net/apocalypselabs/symat/sync/BackgroundSync.java
  56. 0
    45
      src/net/apocalypselabs/symat/sync/Start.java
  57. 0
    45
      src/net/apocalypselabs/symat/sync/UserLogin.java

+ 0
- 60
LICENSE View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
==============================
Code License
==============================
@@ -56,63 +55,4 @@ you permission, that decision is considered final and binding.

This software contains third-party components. These components may fall under
a different license and have a different copyright holder than the above.
=======
==============================
Code License
==============================

Copyright (c) 2015, Netsyms Technologies
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

4. You adhere to the Media License detailed below. If you do not, this license
is automatically revoked and you must purge all copies of the software you
possess, in source or binary form.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


==============================
Media License
==============================

All images and other graphical files (the "graphics") included with this
software are copyright (c) 2015 Netsyms Technologies. You may not distribute
the graphics or any program, source code repository, or other digital storage
media containing them without written permission from Netsyms Technologies.
This ban on distribution only applies to publicly available systems.
A password-protected network file share, USB drive, or other storage scheme that
cannot be easily accessed by the public is generally allowed. If in doubt,
contact Netsyms Technologies. If Netsyms Technologies allows or denies
you permission, that decision is considered final and binding.

==============================
Other Licenses
==============================

This software contains third-party components. These components may fall under
a different license and have a different copyright holder than the above.
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43
Consult their license information or the Manual system for more information.

+ 0
- 20
README.md View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
SyMAT
=====

@@ -16,23 +15,4 @@ http://symatapp.com/

Report a Bug
------
=======
SyMAT
=====

SyMAT is a computer science and math system written in Java.

This repository is extremely bleeding-edge, and we won't help you compile it.
We test new features before committing, but there are bugs.
If you want a stable release, download the latest one from our website.

Get SyMAT
------

To get SyMAT for your platform, go to:
http://symatapp.com/

Report a Bug
------
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43
To report bugs, go to: https://github.com/Netsyms/SyMAT/issues

+ 0
- 76
build.xml View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, Netsyms Technologies
@@ -120,78 +119,3 @@ of the license remains in full effect.

-->
</project>
=======
<?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="SyMAT" default="default" basedir=".">
<description>Builds, tests, and runs the project 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="SyMAT-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.

-->
</project>
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 66
lib/nblibraries.properties View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
#
# Copyright (c) 2015, Netsyms Technologies
# All rights reserved.
@@ -88,68 +87,3 @@ libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
=======
#
# Copyright (c) 2015, Netsyms Technologies
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
libs.absolutelayout.classpath=\
${base}/absolutelayout/AbsoluteLayout.jar
libs.absolutelayout.displayName=Absolute Layout
#
# Netsyms Technologies
# Open Source License
#
# Source code can be used for any purpose, as long as:
# - Compiled binaries are rebranded and trademarks are not
# visible by the end user at any time, except to give
# credit to Netsyms Technologies, such as by showing
# "Based on <product> by Netsyms Technologies" or a
# similar notice;
# - You do not use the code for evil;
# - Rebranded compiled applications have significant
# differences in functionality;
# - and you provide your modified source code for download,
# under the terms of the GNU LGPL v3 or a comparable
# license.
#
# Compiled binaries cannot be redistributed or mirrored,
# unless:
# - You have written permission from Netsyms Technologies;
# - Downloads are not available from Netsyms Technologies,
# not even behind a paywall or other blocking mechanism;
# - or you have received a multi-computer license, in which
# case you should take measures to prevent unauthorized
# downloads, such as preventing download access from the
# Internet.
#
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

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


+ 0
- 11
nbproject/genfiles.properties View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
build.xml.data.CRC32=70b2413f
build.xml.script.CRC32=cfce77fe
build.xml.stylesheet.CRC32=8064a381@1.75.2.48
@@ -7,13 +6,3 @@ build.xml.stylesheet.CRC32=8064a381@1.75.2.48
nbproject/build-impl.xml.data.CRC32=70b2413f
nbproject/build-impl.xml.script.CRC32=e6773cad
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
=======
build.xml.data.CRC32=70b2413f
build.xml.script.CRC32=cfce77fe
build.xml.stylesheet.CRC32=8064a381@1.75.2.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=70b2413f
nbproject/build-impl.xml.script.CRC32=e6773cad
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 152
nbproject/project.properties View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
@@ -148,154 +147,3 @@ run.test.classpath=\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=${file.reference.SyMAT-src}
=======
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.desc=Math and Programming for People
application.homepage=https://symatapp.com/
application.splash=C:\\Users\\Skylar\\Documents\\Apocalypse Labs\\appmedia\\SyMAT\\splashscreen.png
application.title=SyMAT
application.vendor=Netsyms Technologies
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.autocomplete-2.5.4.jar=lib/autocomplete-2.5.4.jar
file.reference.beautyeye_lnf.jar=lib/beautyeye_lnf.jar
file.reference.commons-codec-1.9.jar=lib/commons-codec-1.9.jar
file.reference.commons-logging-1.2.jar=lib/commons-logging-1.2.jar
file.reference.flamingo-6.3.jar=lib/flamingo-6.3.jar
file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
file.reference.httpclient-4.5.jar=lib/httpclient-4.5.jar
file.reference.httpclient-cache-4.5.jar=lib/httpclient-cache-4.5.jar
file.reference.httpclient-win-4.5.jar=lib/httpclient-win-4.5.jar
file.reference.httpcore-4.4.1.jar=lib/httpcore-4.4.1.jar
file.reference.httpmime-4.5.jar=lib/httpmime-4.5.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.jmathplot.jar=lib/jmathplot.jar
file.reference.jna-4.1.0.jar=lib/jna-4.1.0.jar
file.reference.jna-platform-4.1.0.jar=lib/jna-platform-4.1.0.jar
file.reference.js-engine.jar=lib/js-engine.jar
file.reference.js.jar=lib/js.jar
file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
file.reference.jython-standalone-2.7.0.jar=lib/jython-standalone-2.7.0.jar
file.reference.log4j-1.2.11.jar=lib/log4j-1.2.11.jar
file.reference.rsyntaxtextarea-2.5.6.jar=lib/rsyntaxtextarea-2.5.6.jar
file.reference.seaglasslookandfeel-0.2.jar=lib/seaglasslookandfeel-0.2.jar
file.reference.SyMAT-src=src
file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar
file.reference.trident-6.3.jar=lib/trident-6.3.jar
file.reference.ujmp-complete-0.2.5.jar=lib\\ujmp-complete-0.2.5.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.autocomplete-2.5.4.jar}:\
${file.reference.beautyeye_lnf.jar}:\
${file.reference.flamingo-6.3.jar}:\
${file.reference.htmlcleaner-2.10.jar}:\
${file.reference.iText-4.2.0-com.itextpdf.jar}:\
${file.reference.jmathplot.jar}:\
${file.reference.js-engine.jar}:\
${file.reference.js.jar}:\
${file.reference.json-simple-1.1.1.jar}:\
${file.reference.log4j-1.2.11.jar}:\
${file.reference.rsyntaxtextarea-2.5.6.jar}:\
${file.reference.seaglasslookandfeel-0.2.jar}:\
${file.reference.symja-2014-11-01.jar}:\
${file.reference.trident-6.3.jar}:\
${file.reference.JavaPrettify-1.2.1.jar}:\
${file.reference.ujmp-complete-0.2.5.jar}:\
${file.reference.commons-codec-1.9.jar}:\
${file.reference.commons-logging-1.2.jar}:\
${file.reference.httpclient-4.5.jar}:\
${file.reference.httpclient-cache-4.5.jar}:\
${file.reference.httpclient-win-4.5.jar}:\
${file.reference.httpcore-4.4.1.jar}:\
${file.reference.httpmime-4.5.jar}:\
${file.reference.jna-4.1.0.jar}:\
${file.reference.jna-platform-4.1.0.jar}:\
${file.reference.jython-standalone-2.7.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.8
javac.target=1.8
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.reference.flamingo-6.3.jar=lib/flamingo-6.3-javadoc.jar
javadoc.reference.ujmp-complete-0.2.5.jar=lib\\ujmp-complete-0.2.5-javadoc.zip!/0.2.5/ujmp-core/apidocs/
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=SyMAT Code Docs
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.Main
# 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
platform.active=default_platform
project.license=aplabs-oss_1
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=${file.reference.SyMAT-src}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 19
nbproject/project.xml View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
@@ -15,21 +14,3 @@
</libraries>
</configuration>
</project>
=======
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>SyMAT</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots/>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>.\lib\nblibraries.properties</definitions>
</libraries>
</configuration>
</project>
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 66
src/net/apocalypselabs/symat/BadInputException.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -72,68 +71,3 @@ public class BadInputException extends Exception {
super(msg);
}
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

/**
*
* Bad input exception. Useful for throwing errors in user code.
*
* @author Skylar
*/
public class BadInputException extends Exception {

public BadInputException() {
super();
}

public BadInputException(String msg) {
super(msg);
}
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 114
src/net/apocalypselabs/symat/CodeCompleter.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -120,116 +119,3 @@ public class CodeCompleter {
}

}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.fife.ui.autocomplete.BasicCompletion;
import org.fife.ui.autocomplete.CompletionProvider;
import org.fife.ui.autocomplete.DefaultCompletionProvider;
import org.fife.ui.autocomplete.VariableCompletion;

/**
*
* @author Skylar
*/
public class CodeCompleter {

private final CompletionProvider provider;
private final String lang;

/**
*
* @param language Either js or py.
*/
public CodeCompleter(String language) {
lang = language;
provider = makeCompletions();
}

public CompletionProvider getProvider() {
return provider;
}

private CompletionProvider makeCompletions() {
DefaultCompletionProvider provider = new DefaultCompletionProvider();
try {
String[] files = {"functions", "constants"};
for (String fileid : files) {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeCompleter.class.getResourceAsStream("resources/" + (fileid.equals(files[0]) ? "" : lang) + fileid + ".txt")));
String line;
while ((line = reader.readLine()) != null) {
switch (fileid) {
case "functions":
String[] args = line.split("\\|");
if (args.length == 2) {
provider.addCompletion(new BasicCompletion(provider, args[0], args[1]));
} else if (args.length == 3) {
provider.addCompletion(new BasicCompletion(provider, args[0], args[1], args[2]));
} else {
provider.addCompletion(new BasicCompletion(provider, args[0]));
}
break;
case "constants":
provider.addCompletion(new VariableCompletion(provider, line, "double"));
break;
}
}
}
} catch (IOException ex) {
Debug.printerr(ex.getMessage());
}
return provider;
}

}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 481
src/net/apocalypselabs/symat/CodeExport.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -487,483 +486,3 @@ public class CodeExport extends javax.swing.JInternalFrame {
private javax.swing.JTextField titleBox;
// End of variables declaration//GEN-END:variables
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.html.simpleparser.HTMLWorker;
import com.itextpdf.text.html.simpleparser.StyleSheet;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.StringReader;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import org.htmlcleaner.CleanerProperties;
import org.htmlcleaner.HtmlCleaner;
import org.htmlcleaner.SimpleHtmlSerializer;
import org.htmlcleaner.TagNode;
import prettify.PrettifyParser;
import syntaxhighlight.ParseResult;

/**
*
* @author Skylar
*/
public class CodeExport extends javax.swing.JInternalFrame {

private String codeLang = "js";
private String html;
private final String origCode;
private String outputTxt = "";

/**
* Creates new form CodeExport
*
* @param code The code.
*/
public CodeExport(String code) {
origCode = code;
initComponents();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
html = genHtml(code);
}
});
html = genHtml(code);
previewPane.setText(html);
previewPane.setCaretPosition(0);
}

/**
* Create CodeExport window with a set language for syntax highlighting.
*
* @param code The code.
* @param lang Options are "js" or "python".
*/
public CodeExport(String code, String lang) {
this(code);
codeLang = lang;
}

public CodeExport(String code, String lang, String out) {
this(code, lang);
outputTxt = out;
}

private String genHtml(String code) {
String css = "";
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeExport.class
.getResourceAsStream("pretty.css")));
String line;
try {
while ((line = reader.readLine()) != null) {
css += line;
}
} catch (IOException ex) {
Logger.getLogger(CodeExport.class.getName()).log(Level.SEVERE, null, ex);
}
html = "<!DOCTYPE html>"
+ "<html><head>"
+ "<meta charset=\"utf-8\">"
+ "<title></title>"
+ "<style type=\"text/css\"><!--" + css + "--></style>"
+ "</head>"
+ "<body>"
+ "<h1>" + titleBox.getText() + "</h1>";
if (!authBox.getText().equals("")) {
html += "<h2>Author: " + authBox.getText() + "</h2>";
}
if (!dateBox.getText().equals("")) {
html += "<h3>Date: " + dateBox.getText() + "</h3>";
}
if (!headerBox.getText().equals("")) {
html += "<p class=\"header\">" + headerBox.getText() + "</p>";
}
if (outputPlaceBox.getSelectedIndex() == 1) {
html += getOutput();
}
PrettifyParser parser = new PrettifyParser();
List<ParseResult> parseResults = parser.parse(codeLang, code);
html += PrettifyToHtml.toHtml(code, parseResults);
if (outputPlaceBox.getSelectedIndex() == 0) {
html += getOutput();
}
html += "</body></html>";
html = html.replace("\t", "<span class=\"tab\">&nbsp;&nbsp;&nbsp;&nbsp;</span>");
html = html.replace("\n", "<br>");
HtmlCleaner cleaner = new HtmlCleaner();
CleanerProperties props = cleaner.getProperties();
TagNode node = cleaner.clean(html);
html = new SimpleHtmlSerializer(props).getAsString(node);
html = html.replace("&apos;", "'");
html = html.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "");
Debug.println(html);
return html;
}

private String getOutput() {
return "<p><b>Output:</b></p><pre class=\"plaintxt\">"
+ outputTxt.replace("<", "&lt;").
replace("&", "&amp;").
replace(">", "&gt;").
replace("\"", "''")
+ "\n\n</pre>";
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jScrollPane1 = new javax.swing.JScrollPane();
previewPane = new javax.swing.JTextPane();
jPanel1 = new javax.swing.JPanel();
titleBox = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
authBox = new javax.swing.JTextField();
dateBox = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
headerBox = new javax.swing.JTextArea();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
exHtml = new javax.swing.JButton();
exPdf = new javax.swing.JButton();
outputPlaceBox = new javax.swing.JComboBox();
jLabel5 = new javax.swing.JLabel();

setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("Export Code");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/export.png"))); // NOI18N

previewPane.setEditable(false);
previewPane.setContentType("text/html"); // NOI18N
jScrollPane1.setViewportView(previewPane);

titleBox.setText("SyMAT Project");

jLabel1.setText("Title:");

jLabel2.setText("Author:");

authBox.setText(PrefStorage.getSetting("author", ""));

jLabel3.setText("Date:");

headerBox.setColumns(20);
headerBox.setLineWrap(true);
headerBox.setRows(2);
headerBox.setTabSize(4);
headerBox.setWrapStyleWord(true);
jScrollPane2.setViewportView(headerBox);

jLabel4.setText("Header:");

jButton1.setText("Update Preview");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Export to:"));

exHtml.setText("HTML");
exHtml.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exHtmlActionPerformed(evt);
}
});

exPdf.setText("PDF");
exPdf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exPdfActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(exPdf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(exHtml, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(exHtml)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(exPdf)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

outputPlaceBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Below code", "Above code", "No" }));
outputPlaceBox.setSelectedIndex(2);

jLabel5.setText("Include output:");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(outputPlaceBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(titleBox, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(authBox)
.addComponent(dateBox))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1))
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(titleBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1)
.addComponent(jLabel4)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane2)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(authBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(dateBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(outputPlaceBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, 0))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 10, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 273, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);

pack();
}// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
html = genHtml(origCode);
previewPane.setText(html);
previewPane.setCaretPosition(0);
}//GEN-LAST:event_jButton1ActionPerformed

private void exHtmlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exHtmlActionPerformed
doSave("html");
}//GEN-LAST:event_exHtmlActionPerformed

private void exPdfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exPdfActionPerformed
doSave("pdf");
}//GEN-LAST:event_exPdfActionPerformed

private void doSave(String format) {
html = genHtml(origCode);
JFileChooser fc = new JFileChooser();
FileFilter filter;
switch (format) {
case "pdf":
filter = new FileNameExtensionFilter("Portable Document Format (PDF)", "pdf");
break;
default:
filter = new FileNameExtensionFilter("Web Document (HTML)", "html");
}
fc.setFileFilter(filter);
fc.addChoosableFileFilter(filter);
int r = fc.showSaveDialog(this);
if (r == JFileChooser.APPROVE_OPTION) {
String file = FileUtils.getFileWithExtension(fc).getAbsolutePath();
switch (format) {
case "html":
saveFile(html, file);
break;
case "pdf":
savePdfFile(html, file);
break;
}
}
}

private void savePdfFile(String html, String path) {
try {
String k = html;
try (OutputStream file = new FileOutputStream(new File(path))) {
Document document = new Document();
PdfWriter.getInstance(document, file);
document.open();
HTMLWorker htmlWorker = new HTMLWorker(document);
StyleSheet styles = new StyleSheet();
styles.loadStyle("com", "color", "green");
styles.loadStyle("kwd", "color", "blue");
styles.loadStyle("pln", "color", "black");
styles.loadStyle("lit", "color", "#0099cc");
styles.loadStyle("pun", "color", "black");
styles.loadStyle("pun", "font-weight", "bold");
htmlWorker.setStyleSheet(styles);
htmlWorker.parse(new StringReader(k));
document.close();
savedMsg();
}
} catch (IOException | DocumentException e) {
JOptionPane.showInternalMessageDialog(this, "Error saving: " + e.getMessage());
}
}

private void saveFile(String content, String path) {
try {
PrintStream out = new PrintStream(new FileOutputStream(path));
out.print(content);
savedMsg();
} catch (Exception ex) {
JOptionPane.showInternalMessageDialog(this, "Error saving: " + ex.getMessage());
}
}

private void savedMsg() {
JOptionPane.showInternalMessageDialog(this, "Export complete!");
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField authBox;
private javax.swing.JTextField dateBox;
private javax.swing.JButton exHtml;
private javax.swing.JButton exPdf;
private javax.swing.JTextArea headerBox;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JComboBox outputPlaceBox;
private javax.swing.JTextPane previewPane;
private javax.swing.JTextField titleBox;
// End of variables declaration//GEN-END:variables
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 307
src/net/apocalypselabs/symat/CodeRunner.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -313,309 +312,3 @@ public class CodeRunner {
return text;
}
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.swing.JOptionPane;

/**
*
* @author Skylar
*/
public class CodeRunner {

private ScriptEngine se;
private StringWriter sw = new StringWriter();
private PrintWriter pw = new PrintWriter(sw);
private String modules = "";
private String moduleterm = "";

// If we need to wrap code around input to make everything nice.
private boolean wrapRequired = false;
// What codez are we speaking?
private String scriptLang = "";

public CodeRunner() {
this("javascript");
}

public CodeRunner(int lang) {
this(lang == 0 ? "js" : "py");
}

public CodeRunner(String lang) {
scriptLang = lang;
switch (lang) {
case "javascript":
case "js":
case "rhino":
scriptLang = "javascript";
se = new ScriptEngineManager().getEngineByName("rhino");
wrapRequired = true;
try {
// Add custom functions.
se.eval("importClass(net.apocalypselabs.symat.Functions);"
+ "SyMAT_Functions = new net.apocalypselabs.symat.Functions();"
+ "SyMAT_Functions.setLang('js');\n"
+ getFunctions("js")
+ loadToolkits());
// Allow engine access from scripts.
se.put("engine", se);
attachWriters();
} catch (Exception ex) {
initError(ex);
}
break;
case "python":
case "jython":
case "py":
scriptLang = "python";
se = new ScriptEngineManager().getEngineByName("python");
try {
se.eval("from math import *\n"
+ "from net.apocalypselabs.symat import Functions\n"
+ "_=Functions()\n"
+ "_.setLang('py')\n\n"
+ getFunctions("py")
+ loadToolkits());
// Allow engine access from scripts.
se.put("engine", se);
attachWriters();
} catch (Exception ex) {
initError(ex);
}
break;
default:
throw new UnsupportedOperationException("Script language " + lang + " not supported.");
}
}

public static List<InputStream> loadResources(final String name,
final ClassLoader classLoader) throws IOException {
final List<InputStream> list = new ArrayList<InputStream>();
final Enumeration<URL> systemResources
= (classLoader == null ? ClassLoader.getSystemClassLoader() : classLoader)
.getResources(name);
while (systemResources.hasMoreElements()) {
list.add(systemResources.nextElement().openStream());
}
return list;
}

private String loadToolkits() {
String out = "";
try {
List<InputStream> il = loadResources("meta.txt", null);
InputStream[] ii = new InputStream[il.size()];
for (InputStream i : il.toArray(ii)) {
BufferedReader br = new BufferedReader(new InputStreamReader(i));
while (br.ready()) {
String l = br.readLine();
if (l.contains("=")) {
String classname = l.split("=")[0];
String varname = l.split("=")[1];
if (scriptLang.equals("javascript")) {
out += "importClass(" + classname + ");"
+ varname + " = new " + classname + "();";
} else {
out += "from "
+ classname.substring(0, classname.lastIndexOf("."))
+ " import " + classname.substring(classname.lastIndexOf(".") + 1) + "\n"
+ varname + " = " + classname.substring(classname.lastIndexOf(".") + 1) + "()\n";
}
}
}
}
} catch (Exception ex) {

}
Debug.println(out);
return out;
}

@Deprecated
public CodeRunner(String lang, boolean shell) {
this(lang);
}

private void attachWriters() {
se.getContext().setWriter(pw);
se.getContext().setErrorWriter(pw);
Debug.println("Attached writers.");
}

/**
* Inits the Python engine on application start.
*
* @param fakeInit Set it to true.
*/
public CodeRunner(boolean fakeInit) {
if (fakeInit) {
se = new ScriptEngineManager().getEngineByName("python");
}
}

public StringWriter getStringWriter() {
return sw;
}

public PrintWriter getPrintWriter() {
return pw;
}

public String getBufferDump() {
String dump = sw.toString();
sw.getBuffer().setLength(0);
return dump;
}

private void initError(Exception ex) {
JOptionPane.showMessageDialog(null, "Error: "
+ "Could not properly initialize " + scriptLang + " scripting engine."
+ "\n\nSome functions may not work.\n\n"
+ "(" + ex.getMessage() + ")");
}

/**
* Parse a String of code.
*
* @param eval A String of code to evaluate.
* @return the result.
*/
public Object evalString(String eval) {
try {
Object res = se.eval(wrapMath(eval));
if (res == null) {
res = "";
}
String result = res + sw.getBuffer().toString().trim();
sw.getBuffer().setLength(0);
return result;
} catch (ScriptException ex) {
return formatEx(ex);
}
}

/**
* Parse code and use the default output writers.
*
* @param eval A String of code to evaluate.
*/
public void evalCode(String eval) {
try {
Object res = se.eval(wrapMath(eval));
if (res == null) {
res = "";
}
} catch (ScriptException ex) {
sw.append(formatEx(ex));
}
}

private String formatEx(ScriptException ex) {
String err = ex.getMessage();
//err = err.replace("sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: ", "");
//err = err.replace("<Unknown source>", "file");
//err = err.replace("sun.org.mozilla.javascript.internal.EvaluatorException: ", "");
return "Error: " + err;
}

/**
* Allows use of Math.blah() as just blah(). Also gives access to SyMAT Java
* functions.
*
* @param eval input string
* @return wrapped input
*/
private String wrapMath(String eval) {
if (wrapRequired) {
String with = "with(SyMAT_Functions){with(Math){" + eval + "}}";
Debug.println(with);
return with;
}
return eval;
}

public void setVar(String var, Object val) {
se.put(var, val);
}

public Object getVar(String var) {
return se.get(var);
}

private String getFunctions(String lang) {
String text = "";
try {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
CodeRunner.class
.getResourceAsStream("functions." + lang)));
String line;
while ((line = reader.readLine()) != null) {
text += line + "\n";
}
} catch (Exception e) {
}
return text;
}
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 76
src/net/apocalypselabs/symat/Debug.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -118,78 +117,3 @@ public class Debug {
}
}
}
=======
/*
* This class is public domain because it is standalone and
* is potentially useful to other projects.
*
* If this cannot be placed in the public domain, it is licensed under
* the Creative Commons Zero license.
*
* Feel free to use it however you wish!
*/
package net.apocalypselabs.symat;

/**
* This class handles debug logging, so it's easy to disable.
*
* @author Skylar
*/
public class Debug {

// If output should be on or off
public static boolean debug = true;

/**
* Turn debug output on and off.
*
* @param b
*/
public static void setDebug(boolean b) {
debug = b;
}

/**
* Check if debug output is enabled.
*
* @return true if it is.
*/
public static boolean getDebug() {
return debug;
}

/**
* Call System.out.println(data) if debug output enabled.
*
* @param data Data to print.
*/
public static void println(Object data) {
if (debug) {
System.out.println(data);
}
}

/**
* Call System.err.println(data) if debug output enabled.
*
* @param data Data to print.
*/
public static void printerr(Object data) {
if (debug) {
System.err.println(data);
}
}

/**
* Call e.printStackTrace() if debug output enabled.
*
* @param e an Exception.
*/
@SuppressWarnings(value = {"CallToPrintStackTrace"})
public static void stacktrace(Exception e) {
if (debug) {
e.printStackTrace();
}
}
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 1047
src/net/apocalypselabs/symat/Editor.java
File diff suppressed because it is too large
View File


+ 0
- 149
src/net/apocalypselabs/symat/FileUtils.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -155,151 +154,3 @@ public class FileUtils {
return out;
}
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Scanner;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;

/**
* File Utilities.
*
* @author Skylar
*/
public class FileUtils {

/**
* Read a UTF-8 text file.
*
* @param path Where is the file?
* @return The file contents.
* @throws IOException
*/
public static String readFile(String path)
throws IOException {
byte[] encoded = Files.readAllBytes(Paths.get(path));
return new String(encoded, StandardCharsets.UTF_8);
}

/**
* Returns the selected file from a JFileChooser, including the extension
* from the file filter.
*
* Credit to http://stackoverflow.com/users/964243/boann
*
* @param c The JFileChooser to extract from.
* @return duh.
*/
public static File getFileWithExtension(JFileChooser c) {
File file = c.getSelectedFile();
if (c.getFileFilter() instanceof FileNameExtensionFilter) {
String[] exts = ((FileNameExtensionFilter) c.getFileFilter()).getExtensions();
String nameLower = file.getName().toLowerCase();
for (String ext : exts) { // check if it already has a valid extension
if (nameLower.endsWith('.' + ext.toLowerCase())) {
return file; // if yes, return as-is
}
}
// if not, append the first extension from the selected filter
file = new File(file.toString() + '.' + exts[0]);
}
return file;
}

public static void saveFile(String content, String path, boolean addToRecent)
throws IOException {
try (PrintStream out = new PrintStream(new FileOutputStream(path))) {
out.print(content);
}
if (addToRecent) {
Main.addRecentFile((new File(path)).getAbsolutePath());
}
}

/**
* Get an MD5 hash.
*
* http://stackoverflow.com/a/6565597/2534036
*
* @param md5 the text to hash.
* @return
*/
public static String MD5(String md5) {
try {
java.security.MessageDigest md
= java.security.MessageDigest.getInstance("MD5");
byte[] array = md.digest(md5.getBytes());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < array.length; ++i) {
sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1, 3));
}
return sb.toString();
} catch (java.security.NoSuchAlgorithmException e) {
}
return null;
}

public static String getUrl(String url) throws MalformedURLException, IOException {
String out;
try (Scanner sc = new Scanner(new URL(url).openStream(), "UTF-8")) {
out = sc.useDelimiter("\\A").next();
}
return out;
}
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 138
src/net/apocalypselabs/symat/FontOptions.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -144,140 +143,3 @@ public class FontOptions extends javax.swing.JPanel {
private javax.swing.JSpinner jSpinner1;
// End of variables declaration//GEN-END:variables
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

/**
*
* @author Skylar
*/
public class FontOptions extends javax.swing.JPanel {

private boolean modified = false;

/**
* Creates new form FontOptions
*/
public FontOptions() {
initComponents();
}

public FontOptions(int size) {
this();
jSpinner1.setValue(size);
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

jSpinner1 = new javax.swing.JSpinner();
jLabel1 = new javax.swing.JLabel();

setMinimumSize(new java.awt.Dimension(110, 50));
setPreferredSize(new java.awt.Dimension(110, 50));

jSpinner1.setValue(12);
jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
jSpinner1StateChanged(evt);
}
});

jLabel1.setText("pt");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addContainerGap(19, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents

private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged
if ((int) jSpinner1.getValue() <= 0) {
jSpinner1.setValue(1);
} else if ((int) jSpinner1.getValue() > 64) {
jSpinner1.setValue(64);
}
modified = true;
}//GEN-LAST:event_jSpinner1StateChanged

public int getResult() {
return (int) jSpinner1.getValue();
}

public boolean isModified() {
return modified;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JSpinner jSpinner1;
// End of variables declaration//GEN-END:variables
}
>>>>>>> c1bd78b886a57d8f285747c749491ece75862a43

+ 0
- 1300
src/net/apocalypselabs/symat/Functions.java
File diff suppressed because it is too large
View File


+ 0
- 320
src/net/apocalypselabs/symat/Globals.java View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
/*
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
@@ -326,322 +325,3 @@ public class Globals extends javax.swing.JInternalFrame {
private javax.swing.JTextArea valBox;
// End of variables declaration//GEN-END:variables
}
=======
/*
* CODE LICENSE =====================
* Copyright (c) 2015, Netsyms Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 4. You adhere to the Media License detailed below. If you do not, this license
* is automatically revoked and you must purge all copies of the software you
* possess, in source or binary form.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MEDIA LICENSE ====================
* All images and other graphical files (the "graphics") included with this
* software are copyright (c) 2015 Netsyms Technologies. You may not distribute
* the graphics or any program, source code repository, or other digital storage
* media containing them without written permission from Netsyms Technologies.
* This ban on distribution only applies to publicly available systems.
* A password-protected network file share, USB drive, or other storage scheme that
* cannot be easily accessed by the public is generally allowed. If in doubt,
* contact Netsyms Technologies. If Netsyms Technologies allows or denies
* you permission, that decision is considered final and binding.
*/
package net.apocalypselabs.symat;

import java.util.Arrays;
import javax.swing.JOptionPane;

/**
*
* @author Skylar
*/
public class Globals extends javax.swing.JInternalFrame {

/**
* Creates new form Globals
*/
public Globals() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

addBtn = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
keyList = new javax.swing.JList();
remBtn = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
valBox = new javax.swing.JTextArea();
refreshBtn = new javax.swing.JButton();
saveBtn = new javax.swing.JButton();

setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("Global Variables");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/globals.png"))); // NOI18N
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});

addBtn.setText("Add");
addBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addBtnActionPerformed(evt);
}
});

jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Variables"));

keyList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
keyList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
keyListValueChanged(evt);
}
});
jScrollPane1.setViewportView(keyList);

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE))
);

remBtn.setText("Remove");
remBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
remBtnActionPerformed(evt);
}
});

jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Value"));

valBox.setColumns(1);
valBox.setRows(1);
valBox.setTabSize(4);
jScrollPane2.setViewportView(valBox);

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
.addContainerGap())
);