Browse Source

Inital commit

master 1.0b
Skylar Ittner 6 years ago
commit
db88149138
  1. 1
      .gitignore
  2. 229
      LICENSE.txt
  3. 73
      build.xml
  4. BIN
      icon.png
  5. BIN
      lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
  6. BIN
      lib/absolutelayout/AbsoluteLayout.jar
  7. BIN
      lib/json-simple-1.1.1.jar
  8. 7
      lib/nblibraries.properties
  9. 3
      manifest.mf
  10. 1438
      nbproject/build-impl.xml
  11. 8
      nbproject/genfiles.properties
  12. 79
      nbproject/project.properties
  13. 18
      nbproject/project.xml
  14. BIN
      pub/PadViewer_windows_1_0.exe
  15. 1
      pub/md5sums
  16. 3
      pub/output.txt
  17. 32
      pub/updates.xml
  18. 449
      script.install4j
  19. BIN
      src/com/netsyms/symat/padview/128x128.png
  20. BIN
      src/com/netsyms/symat/padview/16x16.png
  21. BIN
      src/com/netsyms/symat/padview/24x24.png
  22. BIN
      src/com/netsyms/symat/padview/256x256.png
  23. BIN
      src/com/netsyms/symat/padview/32x32.png
  24. BIN
      src/com/netsyms/symat/padview/48x48.png
  25. BIN
      src/com/netsyms/symat/padview/512x512.png
  26. BIN
      src/com/netsyms/symat/padview/64x64.png
  27. BIN
      src/com/netsyms/symat/padview/96x96.png
  28. 171
      src/com/netsyms/symat/padview/Controls.form
  29. 278
      src/com/netsyms/symat/padview/Controls.java
  30. 89
      src/com/netsyms/symat/padview/Debug.java
  31. 123
      src/com/netsyms/symat/padview/FileUtils.java
  32. 58
      src/com/netsyms/symat/padview/GUI.form
  33. 141
      src/com/netsyms/symat/padview/GUI.java
  34. 227
      src/com/netsyms/symat/padview/PadUtils.java
  35. 83
      src/com/netsyms/symat/padview/PrefStorage.java
  36. 80
      src/com/netsyms/symat/padview/SplashScreen.form
  37. 107
      src/com/netsyms/symat/padview/SplashScreen.java
  38. 20
      src/com/netsyms/symat/padview/WebView.form
  39. 193
      src/com/netsyms/symat/padview/WebView.java
  40. BIN
      src/com/netsyms/symat/padview/splash.png
  41. 639
      src/org/etherpad_lite_client/EPLiteClient.java
  42. 259
      src/org/etherpad_lite_client/EPLiteConnection.java
  43. 7
      src/org/etherpad_lite_client/EPLiteException.java
  44. 47
      src/org/etherpad_lite_client/GETRequest.java
  45. 59
      src/org/etherpad_lite_client/POSTRequest.java
  46. 9
      src/org/etherpad_lite_client/Request.java

1
.gitignore

@ -0,0 +1 @@
/src/padkey

229
LICENSE.txt

@ -0,0 +1,229 @@
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:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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.
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.
This application also contains JSON.simple, under the Apache License:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

73
build.xml

@ -0,0 +1,73 @@
<?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_Pad_Viewer" default="default" basedir=".">
<description>Builds, tests, and runs the project SyMAT Pad Viewer.</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_Pad_Viewer-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>

BIN
icon.png

After

Width: 512  |  Height: 512  |  Size: 50 KiB

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

BIN
lib/absolutelayout/AbsoluteLayout.jar

BIN
lib/json-simple-1.1.1.jar

7
lib/nblibraries.properties

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

3
manifest.mf

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

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

8
nbproject/genfiles.properties

@ -0,0 +1,8 @@
build.xml.data.CRC32=f1252578
build.xml.script.CRC32=27e95213
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=f1252578
nbproject/build-impl.xml.script.CRC32=33b38239
nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48

79
nbproject/project.properties

@ -0,0 +1,79 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=SyMAT Pad Viewer
application.vendor=Skylar
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_Pad_Viewer.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.json-simple-1.1.1.jar}:\
${libs.absolutelayout.classpath}
# 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.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=com.netsyms.symat.padview.GUI
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
project.license=bsd
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

18
nbproject/project.xml

@ -0,0 +1,18 @@
<?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 Pad Viewer</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>

BIN
pub/PadViewer_windows_1_0.exe

1
pub/md5sums

@ -0,0 +1 @@
9947fbabf37cd9e01faa8653f49be351 *PadViewer_windows_1_0.exe

3
pub/output.txt

@ -0,0 +1,3 @@
# List of generated media files. The columns are tab-separated:
# id | media file type | display name | media file path
26 windows Windows C:\Users\Skylar\Documents\NetBeansProjects\SyMAT Pad Viewer\pub\PadViewer_windows_1_0.exe

32
pub/updates.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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.
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.
-->
<updateDescriptor baseUrl="">
<entry targetMediaFileId="26" updatableVersionMin="" updatableVersionMax="" fileName="PadViewer_windows_1_0.exe" newVersion="1.0" newMediaFileId="26" fileSize="28837760" bundledJre="windows-x86-1.8.0_51" archive="false">
<comment language="en" />
</entry>
</updateDescriptor>

449
script.install4j

@ -0,0 +1,449 @@
<?xml version="1.0" encoding="UTF-8"?>
<install4j version="6.0.2" transformSequenceNumber="5">
<directoryPresets config="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/pub" />
<application name="SyMAT Pad Viewer" distributionSourceDir="" applicationId="7784-7258-6804-9056" mediaDir="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/pub" mediaFilePattern="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:sys.version}" compression="6" lzmaCompression="false" pack200Compression="true" excludeSignedFromPacking="true" commonExternalFiles="false" createMd5Sums="true" shrinkRuntime="true" shortName="PadViewer" publisher="Netsyms Technologies" publisherWeb="http://symatapp.com" version="1.0" allPathsRelative="false" backupOnSave="false" autoSave="false" convertDotsToUnderscores="true" macSignature="????" macVolumeId="c773a4b297437087" javaMinVersion="1.8" javaMaxVersion="" allowBetaVM="false" jdkMode="runtimeJre" jdkName="">
<languages skipLanguageSelection="false" languageSelectionInPrincipalLanguage="false">
<principalLanguage id="en" customLocalizationFile="" />
<additionalLanguages />
</languages>
<searchSequence>
<registry />
<envVar name="JAVA_HOME" />
<envVar name="JDK_HOME" />
</searchSequence>
<variables />
<mergedProjects />
<codeSigning macEnabled="false" macPkcs12File="" windowsEnabled="true" windowsKeySource="pkcs12" windowsPvkFile="C:/Users/Skylar/Documents/codesigning.pvk" windowsSpcFile="C:/Users/Skylar/Documents/cert.spc" windowsPkcs12File="C:/Users/Skylar/Documents/certchain.pfx" />
</application>
<files keepModificationTimes="false" missingFilesStrategy="warn" globalExcludeSuffixes="" defaultOverwriteMode="4" defaultUninstallMode="0" launcherOverwriteMode="3" defaultFileMode="644" defaultDirMode="755">
<filesets />
<roots />
<mountPoints>
<mountPoint id="23" root="" location="" mode="755" />
<mountPoint id="24" root="" location="lib" mode="755" />
</mountPoints>
<entries>
<fileEntry mountPoint="23" file="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/dist/SyMAT_Pad_Viewer.jar" overwriteMode="1" shared="false" fileMode="644" uninstallMode="0" overrideFileMode="false" overrideOverwriteMode="true" overrideUninstallMode="false" />
<dirEntry mountPoint="24" file="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/dist/lib" overwriteMode="2" shared="false" fileMode="644" uninstallMode="0" overrideFileMode="false" overrideOverwriteMode="true" overrideUninstallMode="true" entryMode="direct" subDirectory="lib" excludeSuffixes="" dirMode="755" overrideDirMode="false">
<exclude />
</dirEntry>
</entries>
<components />
</files>
<launchers>
<launcher name="padview" id="22" customizedId="" external="false" excludeFromMenu="false" unixMode="755" menuName="" icnsFile="" customMacBundleIdentifier="false" macBundleIdentifier="" swtApp="false" fileset="" macBundleBinary="JavaApplicationStub" addMacEntitlements="false" macEntitlementsFile="" useCustomMacosExecutableName="false" customMacosExecutableName="">
<executable name="padview" type="1" iconSet="true" iconFile="" executableDir="" redirectStderr="true" stderrFile="error.log" stderrMode="overwrite" redirectStdout="false" stdoutFile="output.log" stdoutMode="overwrite" failOnStderrOutput="true" executableMode="1" changeWorkingDirectory="true" workingDirectory="." singleInstance="false" serviceStartType="2" serviceDependencies="" serviceDescription="" jreLocation="" executionLevel="asInvoker" checkConsoleParameter="false" globalSingleInstance="false" singleInstanceActivate="true" dpiAware="false">
<versionInfo include="false" fileVersion="" fileDescription="" legalCopyright="" internalName="" productName="" />
</executable>
<splashScreen show="false" width="0" height="0" bitmapFile="" windowsNative="false" textOverlay="false">
<text>
<statusLine x="20" y="20" text="" fontSize="8" fontColor="0,0,0" bold="false" />
<versionLine x="20" y="40" text="version ${compiler:sys.version}" fontSize="8" fontColor="0,0,0" bold="false" />
</text>
</splashScreen>
<java mainClass="com.netsyms.symat.padview.GUI" vmParameters="" arguments="" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
<classPath>
<scanDirectory location="lib" failOnError="false" />
<archive location="SyMAT_Pad_Viewer.jar" failOnError="false" />
</classPath>
<nativeLibraryDirectories />
</java>
<includedFiles />
<unextractableFiles />
<vmOptionsFile mode="template" overwriteMode="0" fileMode="644">
<content />
</vmOptionsFile>
<customScript mode="1" file="">
<content />
</customScript>
<infoPlist mode="1" file="">
<content />
</infoPlist>
<iconImageFiles>
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/16x16.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/24x24.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/32x32.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/48x48.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/64x64.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/128x128.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/256x256.png" />
<file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/512x512.png" />
</iconImageFiles>
</launcher>
</launchers>
<installerGui installerType="1" addOnAppId="" suggestPreviousLocations="true" autoUpdateDescriptorUrl="" useAutoUpdateBaseUrl="false" autoUpdateBaseUrl="">
<staticMembers script="" />
<customCode />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
<applications>
<application name="" id="installer" customizedId="" beanClass="com.install4j.runtime.beans.applications.InstallerApplication" enabled="true" commentSet="false" comment="" actionElevationType="elevated" fileset="" customIcnsFile="" customIcoFile="" macEntitlementsFile="" automaticLauncherIntegration="false" launchMode="startupFirstWindow" launchInNewProcess="false" launchSchedule="updateSchedule" allLaunchers="true">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.applications.InstallerApplication">
<void property="customWatermarkText">
<string>${compiler:sys.publisher}</string>
</void>
</object>
</java>
</serializedBean>
<launcherIds />
<variables />
<startup>
<screen name="" id="1" customizedId="" beanClass="com.install4j.runtime.beans.screens.StartupScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.StartupScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="13" customizedId="" beanClass="com.install4j.runtime.beans.actions.misc.RequestPrivilegesAction" enabled="true" commentSet="false" comment="" actionElevationType="none" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.misc.RequestPrivilegesAction">
<void property="failIfNotObtainedMac">
<boolean>false</boolean>
</void>
<void property="failIfNotObtainedWin">
<boolean>false</boolean>
</void>
<void property="obtainIfAdminMac">
<boolean>true</boolean>
</void>
<void property="obtainIfNormalMac">
<boolean>true</boolean>
</void>
<void property="obtainIfNormalWin">
<boolean>true</boolean>
</void>
</object>
</java>
</serializedBean>
<condition />
</action>
</actions>
<formComponents />
</screen>
</startup>
<screens>
<screen name="" id="2" customizedId="" beanClass="com.install4j.runtime.beans.screens.WelcomeScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.WelcomeScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="3" customizedId="" beanClass="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" multiExec="true" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction">
<void property="excludedVariables">
<array class="java.lang.String" length="1">
<void index="0">
<string>sys.installationDir</string>
</void>
</array>
</void>
</object>
</java>
</serializedBean>
<condition>context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
</action>
</actions>
<formComponents />
</screen>
<screen name="" id="25" customizedId="" beanClass="com.install4j.runtime.beans.screens.LicenseScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.LicenseScreen" id="LicenseScreen0">
<void property="acceptInitiallySelected">
<boolean>true</boolean>
</void>
<void id="LocalizedExternalFile0" property="displayedTextFile">
<void property="languageIdToExternalFile">
<void method="put">
<string>en</string>
<object class="com.install4j.api.beans.ExternalFile">
<string>C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/LICENSE.txt</string>
</object>
</void>
</void>
</void>
</object>
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
<screen name="" id="4" customizedId="" beanClass="com.install4j.runtime.beans.screens.InstallationDirectoryScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.InstallationDirectoryScreen" />
</java>
</serializedBean>
<condition>!context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="5" customizedId="" beanClass="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" multiExec="true" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction">
<void property="excludedVariables">
<array class="java.lang.String" length="1">
<void index="0">
<string>sys.installationDir</string>
</void>
</array>
</void>
</object>
</java>
</serializedBean>
<condition>context.getVariable("sys.responseFile") == null</condition>
</action>
</actions>
<formComponents />
</screen>
<screen name="" id="6" customizedId="" beanClass="com.install4j.runtime.beans.screens.ComponentsScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.ComponentsScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
<screen name="" id="7" customizedId="" beanClass="com.install4j.runtime.beans.screens.StandardProgramGroupScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.StandardProgramGroupScreen">
<void property="programGroupName">
<string>${compiler:sys.fullName}</string>
</void>
</object>
</java>
</serializedBean>
<condition>!context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
<screen name="" id="8" customizedId="" beanClass="com.install4j.runtime.beans.screens.InstallationScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="true" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.InstallationScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="9" customizedId="" beanClass="com.install4j.runtime.beans.actions.InstallFilesAction" enabled="true" commentSet="false" comment="" actionElevationType="elevated" rollbackBarrier="false" multiExec="false" failureStrategy="2" errorMessage="${i18n:FileCorrupted}">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.InstallFilesAction" />
</java>
</serializedBean>
<condition />
</action>
<action name="" id="10" customizedId="" beanClass="com.install4j.runtime.beans.actions.desktop.CreateProgramGroupAction" enabled="true" commentSet="false" comment="" actionElevationType="elevated" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.desktop.CreateProgramGroupAction">
<void property="programGroupName">
<string>SyMAT</string>
</void>
<void property="uninstallerMenuName">
<string>${i18n:UninstallerMenuEntry(${compiler:sys.fullName})}</string>
</void>
</object>
</java>
</serializedBean>
<condition>!context.getBooleanVariable("sys.programGroupDisabled")</condition>
</action>
<action name="" id="11" customizedId="" beanClass="com.install4j.runtime.beans.actions.desktop.RegisterAddRemoveAction" enabled="true" commentSet="false" comment="" actionElevationType="elevated" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.desktop.RegisterAddRemoveAction">
<void property="itemName">
<string>${compiler:sys.fullName} ${compiler:sys.version}</string>
</void>
</object>
</java>
</serializedBean>
<condition />
</action>
</actions>
<formComponents />
</screen>
<screen name="" id="12" customizedId="" beanClass="com.install4j.runtime.beans.screens.FinishedScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="true" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.FinishedScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
</screens>
</application>
<application name="" id="uninstaller" customizedId="" beanClass="com.install4j.runtime.beans.applications.UninstallerApplication" enabled="true" commentSet="false" comment="" actionElevationType="elevated" fileset="" customIcnsFile="" customIcoFile="" macEntitlementsFile="" automaticLauncherIntegration="false" launchMode="startupFirstWindow" launchInNewProcess="false" launchSchedule="updateSchedule" allLaunchers="true">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.applications.UninstallerApplication">
<void property="customMacosExecutableName">
<string>${i18n:UninstallerMenuEntry(${compiler:sys.fullName})}</string>
</void>
<void property="customWatermarkText">
<string>${compiler:sys.publisher}</string>
</void>
<void property="useCustomMacosExecutableName">
<boolean>true</boolean>
</void>
</object>
</java>
</serializedBean>
<launcherIds />
<variables />
<startup>
<screen name="" id="14" customizedId="" beanClass="com.install4j.runtime.beans.screens.StartupScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.StartupScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="20" customizedId="" beanClass="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction" />
</java>
</serializedBean>
<condition />
</action>
<action name="" id="21" customizedId="" beanClass="com.install4j.runtime.beans.actions.misc.RequireInstallerPrivilegesAction" enabled="true" commentSet="false" comment="" actionElevationType="none" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.misc.RequireInstallerPrivilegesAction" />
</java>
</serializedBean>
<condition />
</action>
</actions>
<formComponents />
</screen>
</startup>
<screens>
<screen name="" id="15" customizedId="" beanClass="com.install4j.runtime.beans.screens.UninstallWelcomeScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.UninstallWelcomeScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
<screen name="" id="16" customizedId="" beanClass="com.install4j.runtime.beans.screens.UninstallationScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.UninstallationScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="17" customizedId="" beanClass="com.install4j.runtime.beans.actions.UninstallFilesAction" enabled="true" commentSet="false" comment="" actionElevationType="elevated" rollbackBarrier="false" multiExec="false" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.UninstallFilesAction" />
</java>
</serializedBean>
<condition />
</action>
</actions>
<formComponents />
</screen>
<screen name="" id="19" customizedId="" beanClass="com.install4j.runtime.beans.screens.UninstallFailureScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="true" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.UninstallFailureScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
<screen name="" id="18" customizedId="" beanClass="com.install4j.runtime.beans.screens.UninstallSuccessScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="true" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.UninstallSuccessScreen" />
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions />
<formComponents />
</screen>
</screens>
</application>
</applications>
</installerGui>
<mediaSets>
<windows name="Windows" id="26" customizedId="" mediaFileName="" installDir="${compiler:sys.shortName}" overridePrincipalLanguage="false" jreBitType="32" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" includedJRE="windows-x86-1.8.0_51" manualJREEntry="false" bundleType="1" jreURL="" jreShared="true" directDownload="false" installOnlyIfNecessary="true" customInstallBaseDir="" contentFilesType="1" downloadURL="" verifyIntegrity="true">
<excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude />
<variables />
<autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
<commentFiles />
<customAttributes />
</autoUpdate>
<excludedComponents />
<includedDownloadableComponents />
</windows>
</mediaSets>
<buildIds buildAll="true" />
<buildOptions verbose="false" faster="false" disableSigning="false" disableJreBundling="false" debug="false" />
</install4j>

BIN
src/com/netsyms/symat/padview/128x128.png

After

Width: 128  |  Height: 128  |  Size: 18 KiB

BIN
src/com/netsyms/symat/padview/16x16.png

After

Width: 16  |  Height: 16  |  Size: 983 B

BIN
src/com/netsyms/symat/padview/24x24.png

After

Width: 24  |  Height: 24  |  Size: 1.7 KiB

BIN
src/com/netsyms/symat/padview/256x256.png

After

Width: 256  |  Height: 256  |  Size: 41 KiB

BIN
src/com/netsyms/symat/padview/32x32.png

After

Width: 32  |  Height: 32  |  Size: 2.7 KiB

BIN
src/com/netsyms/symat/padview/48x48.png

After

Width: 48  |  Height: 48  |  Size: 5.1 KiB

BIN
src/com/netsyms/symat/padview/512x512.png

After

Width: 512  |  Height: 512  |  Size: 50 KiB

BIN
src/com/netsyms/symat/padview/64x64.png

After

Width: 64  |  Height: 64  |  Size: 7.6 KiB

BIN
src/com/netsyms/symat/padview/96x96.png

After

Width: 96  |  Height: 96  |  Size: 13 KiB

171
src/com/netsyms/symat/padview/Controls.form

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jScrollPane1" alignment="1" min="-2" pref="132" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" pref="69" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="addBtn" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="delBtn" max="32767" attributes="0"/>
<Component id="previewBtn" max="32767" attributes="0"/>
<Component id="saveBtn" alignment="0" max="32767" attributes="0"/>
<Component id="openBtn" alignment="1" pref="79" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="296" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane2" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="addBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="openBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="saveBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="previewBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="delBtn" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane2" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="My Pads:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="addBtn">
<Properties>
<Property name="text" type="java.lang.String" value="+"/>
<Property name="toolTipText" type="java.lang.String" value="Add pad by ID"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addBtnActionPerformed"/>
</Events>
</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.JList" name="padPane">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="selectionMode" type="int" value="0"/>
</Properties>
<Events>
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="padPaneValueChanged"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="openBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Open"/>
<Property name="toolTipText" type="java.lang.String" value="Open pad for editing"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="saveBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Save..."/>
<Property name="toolTipText" type="java.lang.String" value="Save pad locally"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveBtnActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<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="previewPane">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="1"/>
<Property name="rows" type="int" value="1"/>
<Property name="tabSize" type="int" value="4"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Preview:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="previewBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Preview"/>
<Property name="toolTipText" type="java.lang.String" value="Preview pad contents"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="previewBtnActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="delBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Delete"/>
<Property name="toolTipText" type="java.lang.String" value="Remove pad from list"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="delBtnActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

278
src/com/netsyms/symat/padview/Controls.java

@ -0,0 +1,278 @@
/*
* 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:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * 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.
*
* 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.
*/
package com.netsyms.symat.padview;
import java.io.File;
import java.io.IOException;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
/**
*
* @author Skylar
*/
public class Controls extends javax.swing.JPanel {
private JFileChooser fc = new JFileChooser();
/**
* Creates new form Controls
*/
public Controls() {
FileFilter filter = new FileNameExtensionFilter("Plain Text (txt, text)", "txt", "text");
fc.setFileFilter(filter);
fc.addChoosableFileFilter(filter);
fc.addChoosableFileFilter(new FileNameExtensionFilter(
"Javascript (syjs, js)", "syjs", "js"));
fc.addChoosableFileFilter(new FileNameExtensionFilter(
"Python (sypy, py)", "sypy", "py"));
initComponents();
updateList();
}
public void saveFile(String contents) {
contents = contents.replaceAll("(?<!\r)\n", "\r\n");
int r = fc.showSaveDialog(this);
if (r == JFileChooser.APPROVE_OPTION) {
try {
File filedata = FileUtils.getFileWithExtension(fc);
FileUtils.saveFile(contents, filedata.getAbsolutePath(), true);
GUI.statusLbl.setText("Saved "+filedata.getName());
} catch (IOException ex) {
JOptionPane.showMessageDialog(null,
"Error: Cannot save file: " + ex.getMessage());
}
}
}
/**
* 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() {
jLabel1 = new javax.swing.JLabel();
addBtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
padPane = new javax.swing.JList();
openBtn = new javax.swing.JButton();
saveBtn = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
previewPane = new javax.swing.JTextArea();
jLabel2 = new javax.swing.JLabel();
previewBtn = new javax.swing.JButton();
delBtn = new javax.swing.JButton();
jLabel1.setText("My Pads:");
addBtn.setText("+");
addBtn.setToolTipText("Add pad by ID");
addBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addBtnActionPerformed(evt);
}
});
padPane.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
padPane.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
padPaneValueChanged(evt);
}
});
jScrollPane1.setViewportView(padPane);
openBtn.setText("Open");
openBtn.setToolTipText("Open pad for editing");
openBtn.setEnabled(false);
openBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openBtnActionPerformed(evt);
}
});
saveBtn.setText("Save...");
saveBtn.setToolTipText("Save pad locally");
saveBtn.setEnabled(false);
saveBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveBtnActionPerformed(evt);
}
});
previewPane.setEditable(false);
previewPane.setColumns(1);
previewPane.setRows(1);
previewPane.setTabSize(4);
jScrollPane2.setViewportView(previewPane);
jLabel2.setText("Preview:");
previewBtn.setText("Preview");
previewBtn.setToolTipText("Preview pad contents");
previewBtn.setEnabled(false);
previewBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
previewBtnActionPerformed(evt);
}
});
delBtn.setText("Delete");
delBtn.setToolTipText("Remove pad from list");
delBtn.setEnabled(false);
delBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
delBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(addBtn)))
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(delBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(previewBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(saveBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(openBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(0, 296, Short.MAX_VALUE))
.addComponent(jScrollPane2)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(addBtn))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(openBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(previewBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(delBtn)
.addContainerGap())
.addComponent(jScrollPane2)))
);
}// </editor-fold>//GEN-END:initComponents
private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBtnActionPerformed
String id = JOptionPane.showInputDialog(this,
"What is the pad ID?",
"Add Pad",
JOptionPane.QUESTION_MESSAGE);
if (id != null && !id.equals("")) {
if (id.contains("pad.symatapp.com/p/")) {
id = id.substring(id.lastIndexOf('/') + 1);
}
PadUtils.addPad(id);
}
updateList();
}//GEN-LAST:event_addBtnActionPerformed
private String getSelectedPad() {
return padPane.getSelectedValue().toString();
}
private void updateList() {
padPane.setListData(PadUtils.getPads());
}
private void padPaneValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_padPaneValueChanged
// Enable/disable action buttons to prevent errors.
boolean enable = true;
if (padPane.getSelectedValue() == null) {
enable = false;
}
openBtn.setEnabled(enable);
saveBtn.setEnabled(enable);
previewBtn.setEnabled(enable);
delBtn.setEnabled(enable);
}//GEN-LAST:event_padPaneValueChanged
private void openBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openBtnActionPerformed
GUI.loadPad(getSelectedPad());
}//GEN-LAST:event_openBtnActionPerformed
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
saveFile(PadUtils.getPad(getSelectedPad()));
updateList();
}//GEN-LAST:event_saveBtnActionPerformed
private void previewBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_previewBtnActionPerformed
previewPane.setText(PadUtils.getPad(getSelectedPad()));
previewPane.setCaretPosition(0);
updateList();
}//GEN-LAST:event_previewBtnActionPerformed
private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delBtnActionPerformed
int ans = JOptionPane.showConfirmDialog(this,
"Remove pad from list? It will not be removed from the server.",
"Delete?",
JOptionPane.OK_CANCEL_OPTION);
if (ans == JOptionPane.OK_OPTION) {
PadUtils.delPad(getSelectedPad());
}
updateList();
}//GEN-LAST:event_delBtnActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addBtn;
private javax.swing.JButton delBtn;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JButton openBtn;
private javax.swing.JList padPane;
private javax.swing.JButton previewBtn;
private javax.swing.JTextArea previewPane;
private javax.swing.JButton saveBtn;
// End of variables declaration//GEN-END:variables
}

89
src/com/netsyms/symat/padview/Debug.java

@ -0,0 +1,89 @@
/*
* 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:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * 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.
*
* 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.
*/
package com.netsyms.symat.padview;
/**
* 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();
}
}
}

123
src/com/netsyms/symat/padview/FileUtils.java

@ -0,0 +1,123 @@
/*
* 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:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * 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.
*
* 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.
*/
package com.netsyms.symat.padview;
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);
}
}
/**
* 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;
}
}

58
src/com/netsyms/symat/padview/GUI.form

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="title" type="java.lang.String" value="SyMAT Pad Viewer"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[600, 600]"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</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="9"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,88,0,0,2,88"/>
</AuxValues>