Browse Source

Inital commit

tags/1.0b^0
Skylar 3 years ago
commit
db88149138
46 changed files with 4931 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 229
    0
      LICENSE.txt
  3. 73
    0
      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
    0
      lib/nblibraries.properties
  9. 3
    0
      manifest.mf
  10. 1438
    0
      nbproject/build-impl.xml
  11. 8
    0
      nbproject/genfiles.properties
  12. 79
    0
      nbproject/project.properties
  13. 18
    0
      nbproject/project.xml
  14. BIN
      pub/PadViewer_windows_1_0.exe
  15. 1
    0
      pub/md5sums
  16. 3
    0
      pub/output.txt
  17. 32
    0
      pub/updates.xml
  18. 449
    0
      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
    0
      src/com/netsyms/symat/padview/Controls.form
  29. 278
    0
      src/com/netsyms/symat/padview/Controls.java
  30. 89
    0
      src/com/netsyms/symat/padview/Debug.java
  31. 123
    0
      src/com/netsyms/symat/padview/FileUtils.java
  32. 58
    0
      src/com/netsyms/symat/padview/GUI.form
  33. 141
    0
      src/com/netsyms/symat/padview/GUI.java
  34. 227
    0
      src/com/netsyms/symat/padview/PadUtils.java
  35. 83
    0
      src/com/netsyms/symat/padview/PrefStorage.java
  36. 80
    0
      src/com/netsyms/symat/padview/SplashScreen.form
  37. 107
    0
      src/com/netsyms/symat/padview/SplashScreen.java
  38. 20
    0
      src/com/netsyms/symat/padview/WebView.form
  39. 193
    0
      src/com/netsyms/symat/padview/WebView.java
  40. BIN
      src/com/netsyms/symat/padview/splash.png
  41. 639
    0
      src/org/etherpad_lite_client/EPLiteClient.java
  42. 259
    0
      src/org/etherpad_lite_client/EPLiteConnection.java
  43. 7
    0
      src/org/etherpad_lite_client/EPLiteException.java
  44. 47
    0
      src/org/etherpad_lite_client/GETRequest.java
  45. 59
    0
      src/org/etherpad_lite_client/POSTRequest.java
  46. 9
    0
      src/org/etherpad_lite_client/Request.java

+ 1
- 0
.gitignore View File

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

+ 229
- 0
LICENSE.txt View File

@@ -0,0 +1,229 @@
1
+Copyright (c) 2015, Netsyms Technologies.
2
+All rights reserved.
3
+Redistribution and use in source and binary forms, with or without
4
+modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this
7
+   list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright notice,
9
+   this list of conditions and the following disclaimer in the documentation
10
+   and/or other materials provided with the distribution.
11
+
12
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
16
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+POSSIBILITY OF SUCH DAMAGE.
23
+
24
+
25
+
26
+This application also contains JSON.simple, under the Apache License:
27
+
28
+
29
+                                 Apache License
30
+                           Version 2.0, January 2004
31
+                        http://www.apache.org/licenses/
32
+
33
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
34
+
35
+   1. Definitions.
36
+
37
+      "License" shall mean the terms and conditions for use, reproduction,
38
+      and distribution as defined by Sections 1 through 9 of this document.
39
+
40
+      "Licensor" shall mean the copyright owner or entity authorized by
41
+      the copyright owner that is granting the License.
42
+
43
+      "Legal Entity" shall mean the union of the acting entity and all
44
+      other entities that control, are controlled by, or are under common
45
+      control with that entity. For the purposes of this definition,
46
+      "control" means (i) the power, direct or indirect, to cause the
47
+      direction or management of such entity, whether by contract or
48
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
49
+      outstanding shares, or (iii) beneficial ownership of such entity.
50
+
51
+      "You" (or "Your") shall mean an individual or Legal Entity
52
+      exercising permissions granted by this License.
53
+
54
+      "Source" form shall mean the preferred form for making modifications,
55
+      including but not limited to software source code, documentation
56
+      source, and configuration files.
57
+
58
+      "Object" form shall mean any form resulting from mechanical
59
+      transformation or translation of a Source form, including but
60
+      not limited to compiled object code, generated documentation,
61
+      and conversions to other media types.
62
+
63
+      "Work" shall mean the work of authorship, whether in Source or
64
+      Object form, made available under the License, as indicated by a
65
+      copyright notice that is included in or attached to the work
66
+      (an example is provided in the Appendix below).
67
+
68
+      "Derivative Works" shall mean any work, whether in Source or Object
69
+      form, that is based on (or derived from) the Work and for which the
70
+      editorial revisions, annotations, elaborations, or other modifications
71
+      represent, as a whole, an original work of authorship. For the purposes
72
+      of this License, Derivative Works shall not include works that remain
73
+      separable from, or merely link (or bind by name) to the interfaces of,
74
+      the Work and Derivative Works thereof.
75
+
76
+      "Contribution" shall mean any work of authorship, including
77
+      the original version of the Work and any modifications or additions
78
+      to that Work or Derivative Works thereof, that is intentionally
79
+      submitted to Licensor for inclusion in the Work by the copyright owner
80
+      or by an individual or Legal Entity authorized to submit on behalf of
81
+      the copyright owner. For the purposes of this definition, "submitted"
82
+      means any form of electronic, verbal, or written communication sent
83
+      to the Licensor or its representatives, including but not limited to
84
+      communication on electronic mailing lists, source code control systems,
85
+      and issue tracking systems that are managed by, or on behalf of, the
86
+      Licensor for the purpose of discussing and improving the Work, but
87
+      excluding communication that is conspicuously marked or otherwise
88
+      designated in writing by the copyright owner as "Not a Contribution."
89
+
90
+      "Contributor" shall mean Licensor and any individual or Legal Entity
91
+      on behalf of whom a Contribution has been received by Licensor and
92
+      subsequently incorporated within the Work.
93
+
94
+   2. Grant of Copyright License. Subject to the terms and conditions of
95
+      this License, each Contributor hereby grants to You a perpetual,
96
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
97
+      copyright license to reproduce, prepare Derivative Works of,
98
+      publicly display, publicly perform, sublicense, and distribute the
99
+      Work and such Derivative Works in Source or Object form.
100
+
101
+   3. Grant of Patent License. Subject to the terms and conditions of
102
+      this License, each Contributor hereby grants to You a perpetual,
103
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
104
+      (except as stated in this section) patent license to make, have made,
105
+      use, offer to sell, sell, import, and otherwise transfer the Work,
106
+      where such license applies only to those patent claims licensable
107
+      by such Contributor that are necessarily infringed by their
108
+      Contribution(s) alone or by combination of their Contribution(s)
109
+      with the Work to which such Contribution(s) was submitted. If You
110
+      institute patent litigation against any entity (including a
111
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
112
+      or a Contribution incorporated within the Work constitutes direct
113
+      or contributory patent infringement, then any patent licenses
114
+      granted to You under this License for that Work shall terminate
115
+      as of the date such litigation is filed.
116
+
117
+   4. Redistribution. You may reproduce and distribute copies of the
118
+      Work or Derivative Works thereof in any medium, with or without
119
+      modifications, and in Source or Object form, provided that You
120
+      meet the following conditions:
121
+
122
+      (a) You must give any other recipients of the Work or
123
+          Derivative Works a copy of this License; and
124
+
125
+      (b) You must cause any modified files to carry prominent notices
126
+          stating that You changed the files; and
127
+
128
+      (c) You must retain, in the Source form of any Derivative Works
129
+          that You distribute, all copyright, patent, trademark, and
130
+          attribution notices from the Source form of the Work,
131
+          excluding those notices that do not pertain to any part of
132
+          the Derivative Works; and
133
+
134
+      (d) If the Work includes a "NOTICE" text file as part of its
135
+          distribution, then any Derivative Works that You distribute must
136
+          include a readable copy of the attribution notices contained
137
+          within such NOTICE file, excluding those notices that do not
138
+          pertain to any part of the Derivative Works, in at least one
139
+          of the following places: within a NOTICE text file distributed
140
+          as part of the Derivative Works; within the Source form or
141
+          documentation, if provided along with the Derivative Works; or,
142
+          within a display generated by the Derivative Works, if and
143
+          wherever such third-party notices normally appear. The contents
144
+          of the NOTICE file are for informational purposes only and
145
+          do not modify the License. You may add Your own attribution
146
+          notices within Derivative Works that You distribute, alongside
147
+          or as an addendum to the NOTICE text from the Work, provided
148
+          that such additional attribution notices cannot be construed
149
+          as modifying the License.
150
+
151
+      You may add Your own copyright statement to Your modifications and
152
+      may provide additional or different license terms and conditions
153
+      for use, reproduction, or distribution of Your modifications, or
154
+      for any such Derivative Works as a whole, provided Your use,
155
+      reproduction, and distribution of the Work otherwise complies with
156
+      the conditions stated in this License.
157
+
158
+   5. Submission of Contributions. Unless You explicitly state otherwise,
159
+      any Contribution intentionally submitted for inclusion in the Work
160
+      by You to the Licensor shall be under the terms and conditions of
161
+      this License, without any additional terms or conditions.
162
+      Notwithstanding the above, nothing herein shall supersede or modify
163
+      the terms of any separate license agreement you may have executed
164
+      with Licensor regarding such Contributions.
165
+
166
+   6. Trademarks. This License does not grant permission to use the trade
167
+      names, trademarks, service marks, or product names of the Licensor,
168
+      except as required for reasonable and customary use in describing the
169
+      origin of the Work and reproducing the content of the NOTICE file.
170
+
171
+   7. Disclaimer of Warranty. Unless required by applicable law or
172
+      agreed to in writing, Licensor provides the Work (and each
173
+      Contributor provides its Contributions) on an "AS IS" BASIS,
174
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
175
+      implied, including, without limitation, any warranties or conditions
176
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
177
+      PARTICULAR PURPOSE. You are solely responsible for determining the
178
+      appropriateness of using or redistributing the Work and assume any
179
+      risks associated with Your exercise of permissions under this License.
180
+
181
+   8. Limitation of Liability. In no event and under no legal theory,
182
+      whether in tort (including negligence), contract, or otherwise,
183
+      unless required by applicable law (such as deliberate and grossly
184
+      negligent acts) or agreed to in writing, shall any Contributor be
185
+      liable to You for damages, including any direct, indirect, special,
186
+      incidental, or consequential damages of any character arising as a
187
+      result of this License or out of the use or inability to use the
188
+      Work (including but not limited to damages for loss of goodwill,
189
+      work stoppage, computer failure or malfunction, or any and all
190
+      other commercial damages or losses), even if such Contributor
191
+      has been advised of the possibility of such damages.
192
+
193
+   9. Accepting Warranty or Additional Liability. While redistributing
194
+      the Work or Derivative Works thereof, You may choose to offer,
195
+      and charge a fee for, acceptance of support, warranty, indemnity,
196
+      or other liability obligations and/or rights consistent with this
197
+      License. However, in accepting such obligations, You may act only
198
+      on Your own behalf and on Your sole responsibility, not on behalf
199
+      of any other Contributor, and only if You agree to indemnify,
200
+      defend, and hold each Contributor harmless for any liability
201
+      incurred by, or claims asserted against, such Contributor by reason
202
+      of your accepting any such warranty or additional liability.
203
+
204
+   END OF TERMS AND CONDITIONS
205
+
206
+   APPENDIX: How to apply the Apache License to your work.
207
+
208
+      To apply the Apache License to your work, attach the following
209
+      boilerplate notice, with the fields enclosed by brackets "[]"
210
+      replaced with your own identifying information. (Don't include
211
+      the brackets!)  The text should be enclosed in the appropriate
212
+      comment syntax for the file format. We also recommend that a
213
+      file or class name and description of purpose be included on the
214
+      same "printed page" as the copyright notice for easier
215
+      identification within third-party archives.
216
+
217
+   Copyright [yyyy] [name of copyright owner]
218
+
219
+   Licensed under the Apache License, Version 2.0 (the "License");
220
+   you may not use this file except in compliance with the License.
221
+   You may obtain a copy of the License at
222
+
223
+       http://www.apache.org/licenses/LICENSE-2.0
224
+
225
+   Unless required by applicable law or agreed to in writing, software
226
+   distributed under the License is distributed on an "AS IS" BASIS,
227
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
228
+   See the License for the specific language governing permissions and
229
+   limitations under the License.

+ 73
- 0
build.xml View File

@@ -0,0 +1,73 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- You may freely edit this file. See commented blocks below for -->
3
+<!-- some examples of how to customize the build. -->
4
+<!-- (If you delete it and reopen the project it will be recreated.) -->
5
+<!-- By default, only the Clean and Build commands use this build script. -->
6
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
7
+<!-- the Compile on Save feature is turned off for the project. -->
8
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9
+<!-- in the project's Project Properties dialog box.-->
10
+<project name="SyMAT_Pad_Viewer" default="default" basedir=".">
11
+    <description>Builds, tests, and runs the project SyMAT Pad Viewer.</description>
12
+    <import file="nbproject/build-impl.xml"/>
13
+    <!--
14
+
15
+    There exist several targets which are by default empty and which can be 
16
+    used for execution of your tasks. These targets are usually executed 
17
+    before and after some main targets. They are: 
18
+
19
+      -pre-init:                 called before initialization of project properties
20
+      -post-init:                called after initialization of project properties
21
+      -pre-compile:              called before javac compilation
22
+      -post-compile:             called after javac compilation
23
+      -pre-compile-single:       called before javac compilation of single file
24
+      -post-compile-single:      called after javac compilation of single file
25
+      -pre-compile-test:         called before javac compilation of JUnit tests
26
+      -post-compile-test:        called after javac compilation of JUnit tests
27
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
28
+      -post-compile-test-single: called after javac compilation of single JUunit test
29
+      -pre-jar:                  called before JAR building
30
+      -post-jar:                 called after JAR building
31
+      -post-clean:               called after cleaning build products
32
+
33
+    (Targets beginning with '-' are not intended to be called on their own.)
34
+
35
+    Example of inserting an obfuscator after compilation could look like this:
36
+
37
+        <target name="-post-compile">
38
+            <obfuscate>
39
+                <fileset dir="${build.classes.dir}"/>
40
+            </obfuscate>
41
+        </target>
42
+
43
+    For list of available properties check the imported 
44
+    nbproject/build-impl.xml file. 
45
+
46
+
47
+    Another way to customize the build is by overriding existing main targets.
48
+    The targets of interest are: 
49
+
50
+      -init-macrodef-javac:     defines macro for javac compilation
51
+      -init-macrodef-junit:     defines macro for junit execution
52
+      -init-macrodef-debug:     defines macro for class debugging
53
+      -init-macrodef-java:      defines macro for class execution
54
+      -do-jar:                  JAR building
55
+      run:                      execution of project 
56
+      -javadoc-build:           Javadoc generation
57
+      test-report:              JUnit report generation
58
+
59
+    An example of overriding the target for project execution could look like this:
60
+
61
+        <target name="run" depends="SyMAT_Pad_Viewer-impl.jar">
62
+            <exec dir="bin" executable="launcher.exe">
63
+                <arg file="${dist.jar}"/>
64
+            </exec>
65
+        </target>
66
+
67
+    Notice that the overridden target depends on the jar target and not only on 
68
+    the compile target as the regular run target does. Again, for a list of available 
69
+    properties which you can use, check the target you are overriding in the
70
+    nbproject/build-impl.xml file. 
71
+
72
+    -->
73
+</project>

BIN
icon.png View File


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


BIN
lib/absolutelayout/AbsoluteLayout.jar View File


BIN
lib/json-simple-1.1.1.jar View File


+ 7
- 0
lib/nblibraries.properties View File

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

+ 3
- 0
manifest.mf View File

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

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


+ 8
- 0
nbproject/genfiles.properties View File

@@ -0,0 +1,8 @@
1
+build.xml.data.CRC32=f1252578
2
+build.xml.script.CRC32=27e95213
3
+build.xml.stylesheet.CRC32=8064a381@1.75.2.48
4
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
+nbproject/build-impl.xml.data.CRC32=f1252578
7
+nbproject/build-impl.xml.script.CRC32=33b38239
8
+nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48

+ 79
- 0
nbproject/project.properties View File

@@ -0,0 +1,79 @@
1
+annotation.processing.enabled=true
2
+annotation.processing.enabled.in.editor=false
3
+annotation.processing.processors.list=
4
+annotation.processing.run.all.processors=true
5
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
6
+application.title=SyMAT Pad Viewer
7
+application.vendor=Skylar
8
+build.classes.dir=${build.dir}/classes
9
+build.classes.excludes=**/*.java,**/*.form
10
+# This directory is removed when the project is cleaned:
11
+build.dir=build
12
+build.generated.dir=${build.dir}/generated
13
+build.generated.sources.dir=${build.dir}/generated-sources
14
+# Only compile against the classpath explicitly listed here:
15
+build.sysclasspath=ignore
16
+build.test.classes.dir=${build.dir}/test/classes
17
+build.test.results.dir=${build.dir}/test/results
18
+# Uncomment to specify the preferred debugger connection transport:
19
+#debug.transport=dt_socket
20
+debug.classpath=\
21
+    ${run.classpath}
22
+debug.test.classpath=\
23
+    ${run.test.classpath}
24
+# Files in build.classes.dir which should be excluded from distribution jar
25
+dist.archive.excludes=
26
+# This directory is removed when the project is cleaned:
27
+dist.dir=dist
28
+dist.jar=${dist.dir}/SyMAT_Pad_Viewer.jar
29
+dist.javadoc.dir=${dist.dir}/javadoc
30
+endorsed.classpath=
31
+excludes=
32
+file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
33
+includes=**
34
+jar.compress=false
35
+javac.classpath=\
36
+    ${file.reference.json-simple-1.1.1.jar}:\
37
+    ${libs.absolutelayout.classpath}
38
+# Space-separated list of extra javac options
39
+javac.compilerargs=
40
+javac.deprecation=false
41
+javac.processorpath=\
42
+    ${javac.classpath}
43
+javac.source=1.8
44
+javac.target=1.8
45
+javac.test.classpath=\
46
+    ${javac.classpath}:\
47
+    ${build.classes.dir}
48
+javac.test.processorpath=\
49
+    ${javac.test.classpath}
50
+javadoc.additionalparam=
51
+javadoc.author=false
52
+javadoc.encoding=${source.encoding}
53
+javadoc.noindex=false
54
+javadoc.nonavbar=false
55
+javadoc.notree=false
56
+javadoc.private=false
57
+javadoc.splitindex=true
58
+javadoc.use=true
59
+javadoc.version=false
60
+javadoc.windowtitle=
61
+main.class=com.netsyms.symat.padview.GUI
62
+manifest.file=manifest.mf
63
+meta.inf.dir=${src.dir}/META-INF
64
+mkdist.disabled=false
65
+platform.active=default_platform
66
+project.license=bsd
67
+run.classpath=\
68
+    ${javac.classpath}:\
69
+    ${build.classes.dir}
70
+# Space-separated list of JVM arguments used when running the project.
71
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
72
+# To set system properties for unit tests define test-sys-prop.name=value:
73
+run.jvmargs=
74
+run.test.classpath=\
75
+    ${javac.test.classpath}:\
76
+    ${build.test.classes.dir}
77
+source.encoding=UTF-8
78
+src.dir=src
79
+test.src.dir=test

+ 18
- 0
nbproject/project.xml View File

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://www.netbeans.org/ns/project/1">
3
+    <type>org.netbeans.modules.java.j2seproject</type>
4
+    <configuration>
5
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
6
+            <name>SyMAT Pad Viewer</name>
7
+            <source-roots>
8
+                <root id="src.dir"/>
9
+            </source-roots>
10
+            <test-roots>
11
+                <root id="test.src.dir"/>
12
+            </test-roots>
13
+        </data>
14
+        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
15
+            <definitions>.\lib\nblibraries.properties</definitions>
16
+        </libraries>
17
+    </configuration>
18
+</project>

BIN
pub/PadViewer_windows_1_0.exe View File


+ 1
- 0
pub/md5sums View File

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

+ 3
- 0
pub/output.txt View File

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

+ 32
- 0
pub/updates.xml View File

@@ -0,0 +1,32 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!--
3
+Copyright (c) 2015, Netsyms Technologies
4
+All rights reserved.
5
+
6
+Redistribution and use in source and binary forms, with or without
7
+modification, are permitted provided that the following conditions are met:
8
+
9
+* Redistributions of source code must retain the above copyright notice, this
10
+  list of conditions and the following disclaimer.
11
+* Redistributions in binary form must reproduce the above copyright notice,
12
+  this list of conditions and the following disclaimer in the documentation
13
+  and/or other materials provided with the distribution.
14
+
15
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
+POSSIBILITY OF SUCH DAMAGE.
26
+-->
27
+
28
+<updateDescriptor baseUrl="">
29
+  <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">
30
+    <comment language="en" />
31
+  </entry>
32
+</updateDescriptor>

+ 449
- 0
script.install4j View File

@@ -0,0 +1,449 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<install4j version="6.0.2" transformSequenceNumber="5">
3
+  <directoryPresets config="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/pub" />
4
+  <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="">
5
+    <languages skipLanguageSelection="false" languageSelectionInPrincipalLanguage="false">
6
+      <principalLanguage id="en" customLocalizationFile="" />
7
+      <additionalLanguages />
8
+    </languages>
9
+    <searchSequence>
10
+      <registry />
11
+      <envVar name="JAVA_HOME" />
12
+      <envVar name="JDK_HOME" />
13
+    </searchSequence>
14
+    <variables />
15
+    <mergedProjects />
16
+    <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" />
17
+  </application>
18
+  <files keepModificationTimes="false" missingFilesStrategy="warn" globalExcludeSuffixes="" defaultOverwriteMode="4" defaultUninstallMode="0" launcherOverwriteMode="3" defaultFileMode="644" defaultDirMode="755">
19
+    <filesets />
20
+    <roots />
21
+    <mountPoints>
22
+      <mountPoint id="23" root="" location="" mode="755" />
23
+      <mountPoint id="24" root="" location="lib" mode="755" />
24
+    </mountPoints>
25
+    <entries>
26
+      <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" />
27
+      <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">
28
+        <exclude />
29
+      </dirEntry>
30
+    </entries>
31
+    <components />
32
+  </files>
33
+  <launchers>
34
+    <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="">
35
+      <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">
36
+        <versionInfo include="false" fileVersion="" fileDescription="" legalCopyright="" internalName="" productName="" />
37
+      </executable>
38
+      <splashScreen show="false" width="0" height="0" bitmapFile="" windowsNative="false" textOverlay="false">
39
+        <text>
40
+          <statusLine x="20" y="20" text="" fontSize="8" fontColor="0,0,0" bold="false" />
41
+          <versionLine x="20" y="40" text="version ${compiler:sys.version}" fontSize="8" fontColor="0,0,0" bold="false" />
42
+        </text>
43
+      </splashScreen>
44
+      <java mainClass="com.netsyms.symat.padview.GUI" vmParameters="" arguments="" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
45
+        <classPath>
46
+          <scanDirectory location="lib" failOnError="false" />
47
+          <archive location="SyMAT_Pad_Viewer.jar" failOnError="false" />
48
+        </classPath>
49
+        <nativeLibraryDirectories />
50
+      </java>
51
+      <includedFiles />
52
+      <unextractableFiles />
53
+      <vmOptionsFile mode="template" overwriteMode="0" fileMode="644">
54
+        <content />
55
+      </vmOptionsFile>
56
+      <customScript mode="1" file="">
57
+        <content />
58
+      </customScript>
59
+      <infoPlist mode="1" file="">
60
+        <content />
61
+      </infoPlist>
62
+      <iconImageFiles>
63
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/16x16.png" />
64
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/24x24.png" />
65
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/32x32.png" />
66
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/48x48.png" />
67
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/64x64.png" />
68
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/128x128.png" />
69
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/256x256.png" />
70
+        <file path="C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/src/com/netsyms/symat/padview/512x512.png" />
71
+      </iconImageFiles>
72
+    </launcher>
73
+  </launchers>
74
+  <installerGui installerType="1" addOnAppId="" suggestPreviousLocations="true" autoUpdateDescriptorUrl="" useAutoUpdateBaseUrl="false" autoUpdateBaseUrl="">
75
+    <staticMembers script="" />
76
+    <customCode />
77
+    <autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
78
+      <commentFiles />
79
+      <customAttributes />
80
+    </autoUpdate>
81
+    <applications>
82
+      <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">
83
+        <serializedBean>
84
+          <java class="java.beans.XMLDecoder">
85
+            <object class="com.install4j.runtime.beans.applications.InstallerApplication">
86
+              <void property="customWatermarkText">
87
+                <string>${compiler:sys.publisher}</string>
88
+              </void>
89
+            </object>
90
+          </java>
91
+        </serializedBean>
92
+        <launcherIds />
93
+        <variables />
94
+        <startup>
95
+          <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="">
96
+            <serializedBean>
97
+              <java class="java.beans.XMLDecoder">
98
+                <object class="com.install4j.runtime.beans.screens.StartupScreen" />
99
+              </java>
100
+            </serializedBean>
101
+            <condition />
102
+            <validation />
103
+            <preActivation />
104
+            <postActivation />
105
+            <actions>
106
+              <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="">
107
+                <serializedBean>
108
+                  <java class="java.beans.XMLDecoder">
109
+                    <object class="com.install4j.runtime.beans.actions.misc.RequestPrivilegesAction">
110
+                      <void property="failIfNotObtainedMac">
111
+                        <boolean>false</boolean>
112
+                      </void>
113
+                      <void property="failIfNotObtainedWin">
114
+                        <boolean>false</boolean>
115
+                      </void>
116
+                      <void property="obtainIfAdminMac">
117
+                        <boolean>true</boolean>
118
+                      </void>
119
+                      <void property="obtainIfNormalMac">
120
+                        <boolean>true</boolean>
121
+                      </void>
122
+                      <void property="obtainIfNormalWin">
123
+                        <boolean>true</boolean>
124
+                      </void>
125
+                    </object>
126
+                  </java>
127
+                </serializedBean>
128
+                <condition />
129
+              </action>
130
+            </actions>
131
+            <formComponents />
132
+          </screen>
133
+        </startup>
134
+        <screens>
135
+          <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="">
136
+            <serializedBean>
137
+              <java class="java.beans.XMLDecoder">
138
+                <object class="com.install4j.runtime.beans.screens.WelcomeScreen" />
139
+              </java>
140
+            </serializedBean>
141
+            <condition />
142
+            <validation />
143
+            <preActivation />
144
+            <postActivation />
145
+            <actions>
146
+              <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="">
147
+                <serializedBean>
148
+                  <java class="java.beans.XMLDecoder">
149
+                    <object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction">
150
+                      <void property="excludedVariables">
151
+                        <array class="java.lang.String" length="1">
152
+                          <void index="0">
153
+                            <string>sys.installationDir</string>
154
+                          </void>
155
+                        </array>
156
+                      </void>
157
+                    </object>
158
+                  </java>
159
+                </serializedBean>
160
+                <condition>context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
161
+              </action>
162
+            </actions>
163
+            <formComponents />
164
+          </screen>
165
+          <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="">
166
+            <serializedBean>
167
+              <java class="java.beans.XMLDecoder">
168
+                <object class="com.install4j.runtime.beans.screens.LicenseScreen" id="LicenseScreen0">
169
+                  <void property="acceptInitiallySelected">
170
+                    <boolean>true</boolean>
171
+                  </void>
172
+                  <void id="LocalizedExternalFile0" property="displayedTextFile">
173
+                    <void property="languageIdToExternalFile">
174
+                      <void method="put">
175
+                        <string>en</string>
176
+                        <object class="com.install4j.api.beans.ExternalFile">
177
+                          <string>C:/Users/Skylar/Documents/NetBeansProjects/SyMAT Pad Viewer/LICENSE.txt</string>
178
+                        </object>
179
+                      </void>
180
+                    </void>
181
+                  </void>
182
+                </object>
183
+              </java>
184
+            </serializedBean>
185
+            <condition />
186
+            <validation />
187
+            <preActivation />
188
+            <postActivation />
189
+            <actions />
190
+            <formComponents />
191
+          </screen>
192
+          <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="">
193
+            <serializedBean>
194
+              <java class="java.beans.XMLDecoder">
195
+                <object class="com.install4j.runtime.beans.screens.InstallationDirectoryScreen" />
196
+              </java>
197
+            </serializedBean>
198
+            <condition>!context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
199
+            <validation />
200
+            <preActivation />
201
+            <postActivation />
202
+            <actions>
203
+              <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="">
204
+                <serializedBean>
205
+                  <java class="java.beans.XMLDecoder">
206
+                    <object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction">
207
+                      <void property="excludedVariables">
208
+                        <array class="java.lang.String" length="1">
209
+                          <void index="0">
210
+                            <string>sys.installationDir</string>
211
+                          </void>
212
+                        </array>
213
+                      </void>
214
+                    </object>
215
+                  </java>
216
+                </serializedBean>
217
+                <condition>context.getVariable("sys.responseFile") == null</condition>
218
+              </action>
219
+            </actions>
220
+            <formComponents />
221
+          </screen>
222
+          <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="">
223
+            <serializedBean>
224
+              <java class="java.beans.XMLDecoder">
225
+                <object class="com.install4j.runtime.beans.screens.ComponentsScreen" />
226
+              </java>
227
+            </serializedBean>
228
+            <condition />
229
+            <validation />
230
+            <preActivation />
231
+            <postActivation />
232
+            <actions />
233
+            <formComponents />
234
+          </screen>
235
+          <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="">
236
+            <serializedBean>
237
+              <java class="java.beans.XMLDecoder">
238
+                <object class="com.install4j.runtime.beans.screens.StandardProgramGroupScreen">
239
+                  <void property="programGroupName">
240
+                    <string>${compiler:sys.fullName}</string>
241
+                  </void>
242
+                </object>
243
+              </java>
244
+            </serializedBean>
245
+            <condition>!context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
246
+            <validation />
247
+            <preActivation />
248
+            <postActivation />
249
+            <actions />
250
+            <formComponents />
251
+          </screen>
252
+          <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="">
253
+            <serializedBean>
254
+              <java class="java.beans.XMLDecoder">
255
+                <object class="com.install4j.runtime.beans.screens.InstallationScreen" />
256
+              </java>
257
+            </serializedBean>
258
+            <condition />
259
+            <validation />
260
+            <preActivation />
261
+            <postActivation />
262
+            <actions>
263
+              <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}">
264
+                <serializedBean>
265
+                  <java class="java.beans.XMLDecoder">
266
+                    <object class="com.install4j.runtime.beans.actions.InstallFilesAction" />
267
+                  </java>
268
+                </serializedBean>
269
+                <condition />
270
+              </action>
271
+              <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="">
272
+                <serializedBean>
273
+                  <java class="java.beans.XMLDecoder">
274
+                    <object class="com.install4j.runtime.beans.actions.desktop.CreateProgramGroupAction">
275
+                      <void property="programGroupName">
276
+                        <string>SyMAT</string>
277
+                      </void>
278
+                      <void property="uninstallerMenuName">
279
+                        <string>${i18n:UninstallerMenuEntry(${compiler:sys.fullName})}</string>
280
+                      </void>
281
+                    </object>
282
+                  </java>
283
+                </serializedBean>
284
+                <condition>!context.getBooleanVariable("sys.programGroupDisabled")</condition>
285
+              </action>
286
+              <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="">
287
+                <serializedBean>
288
+                  <java class="java.beans.XMLDecoder">
289
+                    <object class="com.install4j.runtime.beans.actions.desktop.RegisterAddRemoveAction">
290
+                      <void property="itemName">
291
+                        <string>${compiler:sys.fullName} ${compiler:sys.version}</string>
292
+                      </void>
293
+                    </object>
294
+                  </java>
295
+                </serializedBean>
296
+                <condition />
297
+              </action>
298
+            </actions>
299
+            <formComponents />
300
+          </screen>
301
+          <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="">
302
+            <serializedBean>
303
+              <java class="java.beans.XMLDecoder">
304
+                <object class="com.install4j.runtime.beans.screens.FinishedScreen" />
305
+              </java>
306
+            </serializedBean>
307
+            <condition />
308
+            <validation />
309
+            <preActivation />
310
+            <postActivation />
311
+            <actions />
312
+            <formComponents />
313
+          </screen>
314
+        </screens>
315
+      </application>
316
+      <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">
317
+        <serializedBean>
318
+          <java class="java.beans.XMLDecoder">
319
+            <object class="com.install4j.runtime.beans.applications.UninstallerApplication">
320
+              <void property="customMacosExecutableName">
321
+                <string>${i18n:UninstallerMenuEntry(${compiler:sys.fullName})}</string>
322
+              </void>
323
+              <void property="customWatermarkText">
324
+                <string>${compiler:sys.publisher}</string>
325
+              </void>
326
+              <void property="useCustomMacosExecutableName">
327
+                <boolean>true</boolean>
328
+              </void>
329
+            </object>
330
+          </java>
331
+        </serializedBean>
332
+        <launcherIds />
333
+        <variables />
334
+        <startup>
335
+          <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="">
336
+            <serializedBean>
337
+              <java class="java.beans.XMLDecoder">
338
+                <object class="com.install4j.runtime.beans.screens.StartupScreen" />
339
+              </java>
340
+            </serializedBean>
341
+            <condition />
342
+            <validation />
343
+            <preActivation />
344
+            <postActivation />
345
+            <actions>
346
+              <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="">
347
+                <serializedBean>
348
+                  <java class="java.beans.XMLDecoder">
349
+                    <object class="com.install4j.runtime.beans.actions.misc.LoadResponseFileAction" />
350
+                  </java>
351
+                </serializedBean>
352
+                <condition />
353
+              </action>
354
+              <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="">
355
+                <serializedBean>
356
+                  <java class="java.beans.XMLDecoder">
357
+                    <object class="com.install4j.runtime.beans.actions.misc.RequireInstallerPrivilegesAction" />
358
+                  </java>
359
+                </serializedBean>
360
+                <condition />
361
+              </action>
362
+            </actions>
363
+            <formComponents />
364
+          </screen>
365
+        </startup>
366
+        <screens>
367
+          <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="">
368
+            <serializedBean>
369
+              <java class="java.beans.XMLDecoder">
370
+                <object class="com.install4j.runtime.beans.screens.UninstallWelcomeScreen" />
371
+              </java>
372
+            </serializedBean>
373
+            <condition />
374
+            <validation />
375
+            <preActivation />
376
+            <postActivation />
377
+            <actions />
378
+            <formComponents />
379
+          </screen>
380
+          <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="">
381
+            <serializedBean>
382
+              <java class="java.beans.XMLDecoder">
383
+                <object class="com.install4j.runtime.beans.screens.UninstallationScreen" />
384
+              </java>
385
+            </serializedBean>
386
+            <condition />
387
+            <validation />
388
+            <preActivation />
389
+            <postActivation />
390
+            <actions>
391
+              <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="">
392
+                <serializedBean>
393
+                  <java class="java.beans.XMLDecoder">
394
+                    <object class="com.install4j.runtime.beans.actions.UninstallFilesAction" />
395
+                  </java>
396
+                </serializedBean>
397
+                <condition />
398
+              </action>
399
+            </actions>
400
+            <formComponents />
401
+          </screen>
402
+          <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="">
403
+            <serializedBean>
404
+              <java class="java.beans.XMLDecoder">
405
+                <object class="com.install4j.runtime.beans.screens.UninstallFailureScreen" />
406
+              </java>
407
+            </serializedBean>
408
+            <condition />
409
+            <validation />
410
+            <preActivation />
411
+            <postActivation />
412
+            <actions />
413
+            <formComponents />
414
+          </screen>
415
+          <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="">
416
+            <serializedBean>
417
+              <java class="java.beans.XMLDecoder">
418
+                <object class="com.install4j.runtime.beans.screens.UninstallSuccessScreen" />
419
+              </java>
420
+            </serializedBean>
421
+            <condition />
422
+            <validation />
423
+            <preActivation />
424
+            <postActivation />
425
+            <actions />
426
+            <formComponents />
427
+          </screen>
428
+        </screens>
429
+      </application>
430
+    </applications>
431
+  </installerGui>
432
+  <mediaSets>
433
+    <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">
434
+      <excludedLaunchers />
435
+      <excludedBeans />
436
+      <overriddenPrincipalLanguage id="en" customLocalizationFile="" />
437
+      <exclude />
438
+      <variables />
439
+      <autoUpdate useMinUpdatableVersion="false" minUpdatableVersion="" useMaxUpdatableVersion="false" maxUpdatableVersion="">
440
+        <commentFiles />
441
+        <customAttributes />
442
+      </autoUpdate>
443
+      <excludedComponents />
444
+      <includedDownloadableComponents />
445
+    </windows>
446
+  </mediaSets>
447
+  <buildIds buildAll="true" />
448
+  <buildOptions verbose="false" faster="false" disableSigning="false" disableJreBundling="false" debug="false" />
449
+</install4j>

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


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


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


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


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


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


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


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


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


+ 171
- 0
src/com/netsyms/symat/padview/Controls.form View File

@@ -0,0 +1,171 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
+  <AuxValues>
5
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
6
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
7
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
8
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
9
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
10
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
11
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
12
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
13
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
14
+  </AuxValues>
15
+
16
+  <Layout>
17
+    <DimensionLayout dim="0">
18
+      <Group type="103" groupAlignment="0" attributes="0">
19
+          <Group type="102" alignment="0" attributes="0">
20
+              <Group type="103" groupAlignment="1" max="-2" attributes="0">
21
+                  <Component id="jScrollPane1" alignment="1" min="-2" pref="132" max="-2" attributes="0"/>
22
+                  <Group type="102" alignment="0" attributes="0">
23
+                      <Component id="jLabel1" min="-2" pref="69" max="-2" attributes="0"/>
24
+                      <EmptySpace max="32767" attributes="0"/>
25
+                      <Component id="addBtn" min="-2" max="-2" attributes="0"/>
26
+                  </Group>
27
+              </Group>
28
+              <EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
29
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
30
+                  <Component id="delBtn" max="32767" attributes="0"/>
31
+                  <Component id="previewBtn" max="32767" attributes="0"/>
32
+                  <Component id="saveBtn" alignment="0" max="32767" attributes="0"/>
33
+                  <Component id="openBtn" alignment="1" pref="79" max="32767" attributes="0"/>
34
+              </Group>
35
+              <EmptySpace max="-2" attributes="0"/>
36
+              <Group type="103" groupAlignment="0" attributes="0">
37
+                  <Group type="102" attributes="0">
38
+                      <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
39
+                      <EmptySpace min="0" pref="296" max="32767" attributes="0"/>
40
+                  </Group>
41
+                  <Component id="jScrollPane2" max="32767" attributes="0"/>
42
+              </Group>
43
+          </Group>
44
+      </Group>
45
+    </DimensionLayout>
46
+    <DimensionLayout dim="1">
47
+      <Group type="103" groupAlignment="0" attributes="0">
48
+          <Group type="102" alignment="0" attributes="0">
49
+              <Group type="103" groupAlignment="3" attributes="0">
50
+                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
51
+                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
52
+                  <Component id="addBtn" alignment="3" min="-2" max="-2" attributes="0"/>
53
+              </Group>
54
+              <EmptySpace max="-2" attributes="0"/>
55
+              <Group type="103" groupAlignment="0" attributes="0">
56
+                  <Component id="jScrollPane1" alignment="0" pref="0" max="32767" attributes="0"/>
57
+                  <Group type="102" alignment="0" attributes="0">
58
+                      <Component id="openBtn" min="-2" max="-2" attributes="0"/>
59
+                      <EmptySpace max="-2" attributes="0"/>
60
+                      <Component id="saveBtn" min="-2" max="-2" attributes="0"/>
61
+                      <EmptySpace max="-2" attributes="0"/>
62
+                      <Component id="previewBtn" min="-2" max="-2" attributes="0"/>
63
+                      <EmptySpace max="-2" attributes="0"/>
64
+                      <Component id="delBtn" min="-2" max="-2" attributes="0"/>
65
+                      <EmptySpace max="32767" attributes="0"/>
66
+                  </Group>
67
+                  <Component id="jScrollPane2" max="32767" attributes="0"/>
68
+              </Group>
69
+          </Group>
70
+      </Group>
71
+    </DimensionLayout>
72
+  </Layout>
73
+  <SubComponents>
74
+    <Component class="javax.swing.JLabel" name="jLabel1">
75
+      <Properties>
76
+        <Property name="text" type="java.lang.String" value="My Pads:"/>
77
+      </Properties>
78
+    </Component>
79
+    <Component class="javax.swing.JButton" name="addBtn">
80
+      <Properties>
81
+        <Property name="text" type="java.lang.String" value="+"/>
82
+        <Property name="toolTipText" type="java.lang.String" value="Add pad by ID"/>
83
+      </Properties>
84
+      <Events>
85
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addBtnActionPerformed"/>
86
+      </Events>
87
+    </Component>
88
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
89
+      <AuxValues>
90
+        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
91
+      </AuxValues>
92
+
93
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
94
+      <SubComponents>
95
+        <Component class="javax.swing.JList" name="padPane">
96
+          <Properties>
97
+            <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
98
+              <StringArray count="0"/>
99
+            </Property>
100
+            <Property name="selectionMode" type="int" value="0"/>
101
+          </Properties>
102
+          <Events>
103
+            <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="padPaneValueChanged"/>
104
+          </Events>
105
+        </Component>
106
+      </SubComponents>
107
+    </Container>
108
+    <Component class="javax.swing.JButton" name="openBtn">
109
+      <Properties>
110
+        <Property name="text" type="java.lang.String" value="Open"/>
111
+        <Property name="toolTipText" type="java.lang.String" value="Open pad for editing"/>
112
+        <Property name="enabled" type="boolean" value="false"/>
113
+      </Properties>
114
+      <Events>
115
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openBtnActionPerformed"/>
116
+      </Events>
117
+    </Component>
118
+    <Component class="javax.swing.JButton" name="saveBtn">
119
+      <Properties>
120
+        <Property name="text" type="java.lang.String" value="Save..."/>
121
+        <Property name="toolTipText" type="java.lang.String" value="Save pad locally"/>
122
+        <Property name="enabled" type="boolean" value="false"/>
123
+      </Properties>
124
+      <Events>
125
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveBtnActionPerformed"/>
126
+      </Events>
127
+    </Component>
128
+    <Container class="javax.swing.JScrollPane" name="jScrollPane2">
129
+      <AuxValues>
130
+        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
131
+      </AuxValues>
132
+
133
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
134
+      <SubComponents>
135
+        <Component class="javax.swing.JTextArea" name="previewPane">
136
+          <Properties>
137
+            <Property name="editable" type="boolean" value="false"/>
138
+            <Property name="columns" type="int" value="1"/>
139
+            <Property name="rows" type="int" value="1"/>
140
+            <Property name="tabSize" type="int" value="4"/>
141
+          </Properties>
142
+        </Component>
143
+      </SubComponents>
144
+    </Container>
145
+    <Component class="javax.swing.JLabel" name="jLabel2">
146
+      <Properties>
147
+        <Property name="text" type="java.lang.String" value="Preview:"/>
148
+      </Properties>
149
+    </Component>
150
+    <Component class="javax.swing.JButton" name="previewBtn">
151
+      <Properties>
152
+        <Property name="text" type="java.lang.String" value="Preview"/>
153
+        <Property name="toolTipText" type="java.lang.String" value="Preview pad contents"/>
154
+        <Property name="enabled" type="boolean" value="false"/>
155
+      </Properties>
156
+      <Events>
157
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="previewBtnActionPerformed"/>
158
+      </Events>
159
+    </Component>
160
+    <Component class="javax.swing.JButton" name="delBtn">
161
+      <Properties>
162
+        <Property name="text" type="java.lang.String" value="Delete"/>
163
+        <Property name="toolTipText" type="java.lang.String" value="Remove pad from list"/>
164
+        <Property name="enabled" type="boolean" value="false"/>
165
+      </Properties>
166
+      <Events>
167
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="delBtnActionPerformed"/>
168
+      </Events>
169
+    </Component>
170
+  </SubComponents>
171
+</Form>

+ 278
- 0
src/com/netsyms/symat/padview/Controls.java View File

@@ -0,0 +1,278 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.io.File;
29
+import java.io.IOException;
30
+import javax.swing.JFileChooser;
31
+import javax.swing.JOptionPane;
32
+import javax.swing.filechooser.FileFilter;
33
+import javax.swing.filechooser.FileNameExtensionFilter;
34
+
35
+/**
36
+ *
37
+ * @author Skylar
38
+ */
39
+public class Controls extends javax.swing.JPanel {
40
+
41
+    private JFileChooser fc = new JFileChooser();
42
+
43
+    /**
44
+     * Creates new form Controls
45
+     */
46
+    public Controls() {
47
+        FileFilter filter = new FileNameExtensionFilter("Plain Text (txt, text)", "txt", "text");
48
+        fc.setFileFilter(filter);
49
+        fc.addChoosableFileFilter(filter);
50
+        fc.addChoosableFileFilter(new FileNameExtensionFilter(
51
+                "Javascript (syjs, js)", "syjs", "js"));
52
+        fc.addChoosableFileFilter(new FileNameExtensionFilter(
53
+                "Python (sypy, py)", "sypy", "py"));
54
+        initComponents();
55
+        updateList();
56
+    }
57
+
58
+    public void saveFile(String contents) {
59
+        contents = contents.replaceAll("(?<!\r)\n", "\r\n");
60
+        int r = fc.showSaveDialog(this);
61
+        if (r == JFileChooser.APPROVE_OPTION) {
62
+            try {
63
+                File filedata = FileUtils.getFileWithExtension(fc);
64
+                FileUtils.saveFile(contents, filedata.getAbsolutePath(), true);
65
+                GUI.statusLbl.setText("Saved "+filedata.getName());
66
+            } catch (IOException ex) {
67
+                JOptionPane.showMessageDialog(null,
68
+                        "Error:  Cannot save file: " + ex.getMessage());
69
+            }
70
+        }
71
+    }
72
+
73
+    /**
74
+     * This method is called from within the constructor to initialize the form.
75
+     * WARNING: Do NOT modify this code. The content of this method is always
76
+     * regenerated by the Form Editor.
77
+     */
78
+    @SuppressWarnings("unchecked")
79
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
80
+    private void initComponents() {
81
+
82
+        jLabel1 = new javax.swing.JLabel();
83
+        addBtn = new javax.swing.JButton();
84
+        jScrollPane1 = new javax.swing.JScrollPane();
85
+        padPane = new javax.swing.JList();
86
+        openBtn = new javax.swing.JButton();
87
+        saveBtn = new javax.swing.JButton();
88
+        jScrollPane2 = new javax.swing.JScrollPane();
89
+        previewPane = new javax.swing.JTextArea();
90
+        jLabel2 = new javax.swing.JLabel();
91
+        previewBtn = new javax.swing.JButton();
92
+        delBtn = new javax.swing.JButton();
93
+
94
+        jLabel1.setText("My Pads:");
95
+
96
+        addBtn.setText("+");
97
+        addBtn.setToolTipText("Add pad by ID");
98
+        addBtn.addActionListener(new java.awt.event.ActionListener() {
99
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
100
+                addBtnActionPerformed(evt);
101
+            }
102
+        });
103
+
104
+        padPane.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
105
+        padPane.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
106
+            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
107
+                padPaneValueChanged(evt);
108
+            }
109
+        });
110
+        jScrollPane1.setViewportView(padPane);
111
+
112
+        openBtn.setText("Open");
113
+        openBtn.setToolTipText("Open pad for editing");
114
+        openBtn.setEnabled(false);
115
+        openBtn.addActionListener(new java.awt.event.ActionListener() {
116
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
117
+                openBtnActionPerformed(evt);
118
+            }
119
+        });
120
+
121
+        saveBtn.setText("Save...");
122
+        saveBtn.setToolTipText("Save pad locally");
123
+        saveBtn.setEnabled(false);
124
+        saveBtn.addActionListener(new java.awt.event.ActionListener() {
125
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
126
+                saveBtnActionPerformed(evt);
127
+            }
128
+        });
129
+
130
+        previewPane.setEditable(false);
131
+        previewPane.setColumns(1);
132
+        previewPane.setRows(1);
133
+        previewPane.setTabSize(4);
134
+        jScrollPane2.setViewportView(previewPane);
135
+
136
+        jLabel2.setText("Preview:");
137
+
138
+        previewBtn.setText("Preview");
139
+        previewBtn.setToolTipText("Preview pad contents");
140
+        previewBtn.setEnabled(false);
141
+        previewBtn.addActionListener(new java.awt.event.ActionListener() {
142
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
143
+                previewBtnActionPerformed(evt);
144
+            }
145
+        });
146
+
147
+        delBtn.setText("Delete");
148
+        delBtn.setToolTipText("Remove pad from list");
149
+        delBtn.setEnabled(false);
150
+        delBtn.addActionListener(new java.awt.event.ActionListener() {
151
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
152
+                delBtnActionPerformed(evt);
153
+            }
154
+        });
155
+
156
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
157
+        this.setLayout(layout);
158
+        layout.setHorizontalGroup(
159
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
160
+            .addGroup(layout.createSequentialGroup()
161
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
162
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
163
+                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
164
+                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
165
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
166
+                        .addComponent(addBtn)))
167
+                .addGap(6, 6, 6)
168
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
169
+                    .addComponent(delBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
170
+                    .addComponent(previewBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
171
+                    .addComponent(saveBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
172
+                    .addComponent(openBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))
173
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
174
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
175
+                    .addGroup(layout.createSequentialGroup()
176
+                        .addComponent(jLabel2)
177
+                        .addGap(0, 296, Short.MAX_VALUE))
178
+                    .addComponent(jScrollPane2)))
179
+        );
180
+        layout.setVerticalGroup(
181
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
182
+            .addGroup(layout.createSequentialGroup()
183
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
184
+                    .addComponent(jLabel1)
185
+                    .addComponent(jLabel2)
186
+                    .addComponent(addBtn))
187
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
188
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
189
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
190
+                    .addGroup(layout.createSequentialGroup()
191
+                        .addComponent(openBtn)
192
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
193
+                        .addComponent(saveBtn)
194
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
195
+                        .addComponent(previewBtn)
196
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
197
+                        .addComponent(delBtn)
198
+                        .addContainerGap())
199
+                    .addComponent(jScrollPane2)))
200
+        );
201
+    }// </editor-fold>//GEN-END:initComponents
202
+
203
+    private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBtnActionPerformed
204
+        String id = JOptionPane.showInputDialog(this,
205
+                "What is the pad ID?",
206
+                "Add Pad",
207
+                JOptionPane.QUESTION_MESSAGE);
208
+        if (id != null && !id.equals("")) {
209
+            if (id.contains("pad.symatapp.com/p/")) {
210
+                id = id.substring(id.lastIndexOf('/') + 1);
211
+            }
212
+            PadUtils.addPad(id);
213
+        }
214
+        updateList();
215
+    }//GEN-LAST:event_addBtnActionPerformed
216
+
217
+    private String getSelectedPad() {
218
+        return padPane.getSelectedValue().toString();
219
+    }
220
+
221
+    private void updateList() {
222
+        padPane.setListData(PadUtils.getPads());
223
+    }
224
+
225
+    private void padPaneValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_padPaneValueChanged
226
+        // Enable/disable action buttons to prevent errors.
227
+        boolean enable = true;
228
+        if (padPane.getSelectedValue() == null) {
229
+            enable = false;
230
+        }
231
+        openBtn.setEnabled(enable);
232
+        saveBtn.setEnabled(enable);
233
+        previewBtn.setEnabled(enable);
234
+        delBtn.setEnabled(enable);
235
+    }//GEN-LAST:event_padPaneValueChanged
236
+
237
+    private void openBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openBtnActionPerformed
238
+        GUI.loadPad(getSelectedPad());
239
+    }//GEN-LAST:event_openBtnActionPerformed
240
+
241
+    private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
242
+        saveFile(PadUtils.getPad(getSelectedPad()));
243
+        updateList();
244
+    }//GEN-LAST:event_saveBtnActionPerformed
245
+
246
+    private void previewBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_previewBtnActionPerformed
247
+        previewPane.setText(PadUtils.getPad(getSelectedPad()));
248
+        previewPane.setCaretPosition(0);
249
+
250
+        updateList();
251
+    }//GEN-LAST:event_previewBtnActionPerformed
252
+
253
+    private void delBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delBtnActionPerformed
254
+        int ans = JOptionPane.showConfirmDialog(this,
255
+            "Remove pad from list?  It will not be removed from the server.",
256
+            "Delete?",
257
+            JOptionPane.OK_CANCEL_OPTION);
258
+        if (ans == JOptionPane.OK_OPTION) {
259
+            PadUtils.delPad(getSelectedPad());
260
+        }
261
+        updateList();
262
+    }//GEN-LAST:event_delBtnActionPerformed
263
+
264
+
265
+    // Variables declaration - do not modify//GEN-BEGIN:variables
266
+    private javax.swing.JButton addBtn;
267
+    private javax.swing.JButton delBtn;
268
+    private javax.swing.JLabel jLabel1;
269
+    private javax.swing.JLabel jLabel2;
270
+    private javax.swing.JScrollPane jScrollPane1;
271
+    private javax.swing.JScrollPane jScrollPane2;
272
+    private javax.swing.JButton openBtn;
273
+    private javax.swing.JList padPane;
274
+    private javax.swing.JButton previewBtn;
275
+    private javax.swing.JTextArea previewPane;
276
+    private javax.swing.JButton saveBtn;
277
+    // End of variables declaration//GEN-END:variables
278
+}

+ 89
- 0
src/com/netsyms/symat/padview/Debug.java View File

@@ -0,0 +1,89 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+/**
29
+ * This class handles debug logging, so it's easy to disable.
30
+ *
31
+ * @author Skylar
32
+ */
33
+public class Debug {
34
+
35
+    // If output should be on or off
36
+    public static boolean debug = true;
37
+
38
+    /**
39
+     * Turn debug output on and off.
40
+     *
41
+     * @param b
42
+     */
43
+    public static void setDebug(boolean b) {
44
+        debug = b;
45
+    }
46
+
47
+    /**
48
+     * Check if debug output is enabled.
49
+     *
50
+     * @return true if it is.
51
+     */
52
+    public static boolean getDebug() {
53
+        return debug;
54
+    }
55
+
56
+    /**
57
+     * Call System.out.println(data) if debug output enabled.
58
+     *
59
+     * @param data Data to print.
60
+     */
61
+    public static void println(Object data) {
62
+        if (debug) {
63
+            System.out.println(data);
64
+        }
65
+    }
66
+
67
+    /**
68
+     * Call System.err.println(data) if debug output enabled.
69
+     *
70
+     * @param data Data to print.
71
+     */
72
+    public static void printerr(Object data) {
73
+        if (debug) {
74
+            System.err.println(data);
75
+        }
76
+    }
77
+
78
+    /**
79
+     * Call e.printStackTrace() if debug output enabled.
80
+     *
81
+     * @param e an Exception.
82
+     */
83
+    @SuppressWarnings(value = {"CallToPrintStackTrace"})
84
+    public static void stacktrace(Exception e) {
85
+        if (debug) {
86
+            e.printStackTrace();
87
+        }
88
+    }
89
+}

+ 123
- 0
src/com/netsyms/symat/padview/FileUtils.java View File

@@ -0,0 +1,123 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.io.File;
29
+import java.io.FileOutputStream;
30
+import java.io.IOException;
31
+import java.io.PrintStream;
32
+import java.net.MalformedURLException;
33
+import java.net.URL;
34
+import java.nio.charset.StandardCharsets;
35
+import java.nio.file.Files;
36
+import java.nio.file.Paths;
37
+import java.util.Scanner;
38
+import javax.swing.JFileChooser;
39
+import javax.swing.filechooser.FileNameExtensionFilter;
40
+
41
+/**
42
+ * File Utilities.
43
+ *
44
+ * @author Skylar
45
+ */
46
+public class FileUtils {
47
+
48
+    /**
49
+     * Read a UTF-8 text file.
50
+     *
51
+     * @param path Where is the file?
52
+     * @return The file contents.
53
+     * @throws IOException
54
+     */
55
+    public static String readFile(String path)
56
+            throws IOException {
57
+        byte[] encoded = Files.readAllBytes(Paths.get(path));
58
+        return new String(encoded, StandardCharsets.UTF_8);
59
+    }
60
+
61
+    /**
62
+     * Returns the selected file from a JFileChooser, including the extension
63
+     * from the file filter.
64
+     *
65
+     * Credit to http://stackoverflow.com/users/964243/boann
66
+     *
67
+     * @param c The JFileChooser to extract from.
68
+     * @return duh.
69
+     */
70
+    public static File getFileWithExtension(JFileChooser c) {
71
+        File file = c.getSelectedFile();
72
+        if (c.getFileFilter() instanceof FileNameExtensionFilter) {
73
+            String[] exts = ((FileNameExtensionFilter) c.getFileFilter()).getExtensions();
74
+            String nameLower = file.getName().toLowerCase();
75
+            for (String ext : exts) { // check if it already has a valid extension
76
+                if (nameLower.endsWith('.' + ext.toLowerCase())) {
77
+                    return file; // if yes, return as-is
78
+                }
79
+            }
80
+            // if not, append the first extension from the selected filter
81
+            file = new File(file.toString() + '.' + exts[0]);
82
+        }
83
+        return file;
84
+    }
85
+
86
+    public static void saveFile(String content, String path, boolean addToRecent)
87
+            throws IOException {
88
+        try (PrintStream out = new PrintStream(new FileOutputStream(path))) {
89
+            out.print(content);
90
+        }
91
+    }
92
+
93
+    /**
94
+     * Get an MD5 hash.
95
+     *
96
+     * http://stackoverflow.com/a/6565597/2534036
97
+     *
98
+     * @param md5 the text to hash.
99
+     * @return
100
+     */
101
+    public static String MD5(String md5) {
102
+        try {
103
+            java.security.MessageDigest md
104
+                    = java.security.MessageDigest.getInstance("MD5");
105
+            byte[] array = md.digest(md5.getBytes());
106
+            StringBuilder sb = new StringBuilder();
107
+            for (int i = 0; i < array.length; ++i) {
108
+                sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1, 3));
109
+            }
110
+            return sb.toString();
111
+        } catch (java.security.NoSuchAlgorithmException e) {
112
+        }
113
+        return null;
114
+    }
115
+
116
+    public static String getUrl(String url) throws MalformedURLException, IOException {
117
+        String out;
118
+        try (Scanner sc = new Scanner(new URL(url).openStream(), "UTF-8")) {
119
+            out = sc.useDelimiter("\\A").next();
120
+        }
121
+        return out;
122
+    }
123
+}

+ 58
- 0
src/com/netsyms/symat/padview/GUI.form View File

@@ -0,0 +1,58 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
4
+  <Properties>
5
+    <Property name="defaultCloseOperation" type="int" value="3"/>
6
+    <Property name="title" type="java.lang.String" value="SyMAT Pad Viewer"/>
7
+    <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
8
+      <Dimension value="[600, 600]"/>
9
+    </Property>
10
+  </Properties>
11
+  <SyntheticProperties>
12
+    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
13
+    <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
14
+  </SyntheticProperties>
15
+  <AuxValues>
16
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
17
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
18
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
19
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
20
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
21
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
22
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
23
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
24
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="9"/>
25
+    <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"/>
26
+  </AuxValues>
27
+
28
+  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
29
+  <SubComponents>
30
+    <Container class="javax.swing.JPanel" name="jPanel1">
31
+      <Properties>
32
+        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
33
+          <Dimension value="[400, 20]"/>
34
+        </Property>
35
+      </Properties>
36
+      <Constraints>
37
+        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
38
+          <BorderConstraints direction="Last"/>
39
+        </Constraint>
40
+      </Constraints>
41
+
42
+      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
43
+      <SubComponents>
44
+        <Component class="javax.swing.JLabel" name="statusLbl">
45
+          <Properties>
46
+            <Property name="text" type="java.lang.String" value="Welcome!"/>
47
+            <Property name="toolTipText" type="java.lang.String" value=""/>
48
+          </Properties>
49
+          <Constraints>
50
+            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
51
+              <BorderConstraints direction="Center"/>
52
+            </Constraint>
53
+          </Constraints>
54
+        </Component>
55
+      </SubComponents>
56
+    </Container>
57
+  </SubComponents>
58
+</Form>

+ 141
- 0
src/com/netsyms/symat/padview/GUI.java View File

@@ -0,0 +1,141 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.awt.BorderLayout;
29
+import java.awt.Image;
30
+import java.util.ArrayList;
31
+import javax.swing.ImageIcon;
32
+
33
+/**
34
+ *
35
+ * @author Skylar
36
+ */
37
+public class GUI extends javax.swing.JFrame {
38
+
39
+    public static ArrayList<Image> logo = new ArrayList<>();
40
+    public static WebView web;
41
+    public static Controls controls;
42
+    
43
+    public static final String VERSION = "1.0";
44
+    public static final int VERSIONCODE = 1;
45
+    public static final String SYMAT = "SyMAT";
46
+    public static final String PRODUCT = "Pad Viewer";
47
+    
48
+    /**
49
+     * Creates new form GUI
50
+     */
51
+    public GUI() {
52
+        initComponents();
53
+        setIconImages(logo);
54
+        web = new WebView();
55
+        controls = new Controls();
56
+        add(controls, BorderLayout.NORTH);
57
+        add(web, BorderLayout.CENTER);
58
+        web.setVisible(true);
59
+        controls.setVisible(true);
60
+    }
61
+    
62
+    public static void loadPad(String pad) {
63
+        web.loadURL(PadUtils.PADS_URL + "/p/" + pad, pad);
64
+    }
65
+
66
+    /**
67
+     * This method is called from within the constructor to initialize the form.
68
+     * WARNING: Do NOT modify this code. The content of this method is always
69
+     * regenerated by the Form Editor.
70
+     */
71
+    @SuppressWarnings("unchecked")
72
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
73
+    private void initComponents() {
74
+
75
+        jPanel1 = new javax.swing.JPanel();
76
+        statusLbl = new javax.swing.JLabel();
77
+
78
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
79
+        setTitle("SyMAT Pad Viewer");
80
+        setPreferredSize(new java.awt.Dimension(600, 600));
81
+
82
+        jPanel1.setPreferredSize(new java.awt.Dimension(400, 20));
83
+        jPanel1.setLayout(new java.awt.BorderLayout());
84
+
85
+        statusLbl.setText("Welcome!");
86
+        statusLbl.setToolTipText("");
87
+        jPanel1.add(statusLbl, java.awt.BorderLayout.CENTER);
88
+
89
+        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END);
90
+
91
+        pack();
92
+        setLocationRelativeTo(null);
93
+    }// </editor-fold>//GEN-END:initComponents
94
+
95
+    /**
96
+     * @param args the command line arguments
97
+     */
98
+    public static void main(String args[]) {
99
+        /* Set the Nimbus look and feel */
100
+        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
101
+        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
102
+         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
103
+         */
104
+        try {
105
+            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
106
+                if ("Nimbus".equals(info.getName())) {
107
+                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
108
+                    break;
109
+                }
110
+            }
111
+        } catch (ClassNotFoundException ex) {
112
+            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
113
+        } catch (InstantiationException ex) {
114
+            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
115
+        } catch (IllegalAccessException ex) {
116
+            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
117
+        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
118
+            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
119
+        }
120
+        //</editor-fold>
121
+
122
+        // Set icon
123
+        String[] sizes = {"16", "24", "32", "48", "64", "96", "128", "256", "512"};
124
+        for (String s : sizes) {
125
+            logo.add(new ImageIcon(
126
+                    GUI.class.getResource(s + "x" + s + ".png")).getImage());
127
+        }
128
+        
129
+        /* Create and display the form */
130
+        java.awt.EventQueue.invokeLater(new Runnable() {
131
+            public void run() {
132
+                new SplashScreen().setVisible(true);
133
+            }
134
+        });
135
+    }
136
+
137
+    // Variables declaration - do not modify//GEN-BEGIN:variables
138
+    public static javax.swing.JPanel jPanel1;
139
+    public static javax.swing.JLabel statusLbl;
140
+    // End of variables declaration//GEN-END:variables
141
+}

+ 227
- 0
src/com/netsyms/symat/padview/PadUtils.java View File

@@ -0,0 +1,227 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.io.BufferedReader;
29
+import java.io.InputStreamReader;
30
+import java.util.Random;
31
+import javax.swing.JOptionPane;
32
+import org.etherpad_lite_client.EPLiteClient;
33
+import org.etherpad_lite_client.EPLiteException;
34
+
35
+/**
36
+ *
37
+ * @author Skylar
38
+ */
39
+public class PadUtils {
40
+
41
+    public static final String PADS_URL = "http://pad.symatapp.com";
42
+
43
+    /**
44
+     * Add the given pad ID to the local pad list.
45
+     *
46
+     * @param id the pad ID.
47
+     */
48
+    public static void addPad(String id) {
49
+        String pads = PrefStorage.getSetting("pads");
50
+
51
+        // Check for dupes
52
+        for (String p : pads.split("\\|")) {
53
+            if (p.equals(id)) {
54
+                return;
55
+            }
56
+        }
57
+
58
+        if (pads.equals("")) {
59
+            pads = id;
60
+        } else {
61
+            pads += "|" + id;
62
+        }
63
+        PrefStorage.saveSetting("pads", pads);
64
+    }
65
+
66
+    /**
67
+     * Delete the pad with the given ID from local memory.
68
+     * <br />It will still exist online.
69
+     *
70
+     * @param id the pad ID.
71
+     */
72
+    public static void delPad(String id) {
73
+        String pads = PrefStorage.getSetting("pads");
74
+        String result = "";
75
+        int i = 0;
76
+        for (String pad : pads.split("\\|")) {
77
+            if (!pad.equals(id)) {
78
+                if (i > 0) {
79
+                    result += "|";
80
+                }
81
+                result += pad;
82
+                i++;
83
+            }
84
+        }
85
+
86
+        PrefStorage.saveSetting("pads", result);
87
+    }
88
+
89
+    /**
90
+     * Get an array of saved pads.
91
+     *
92
+     * @return String[] of pad IDs
93
+     */
94
+    public static String[] getPads() {
95
+        String pads = PrefStorage.getSetting("pads");
96
+        if (!pads.equals("")) {
97
+            if (pads.contains("|")) {
98
+                return pads.split("\\|");
99
+            } else {
100
+                String[] padlist = {pads};
101
+                return padlist;
102
+            }
103
+        } else {
104
+            String[] padlist = {};
105
+            return padlist;
106
+        }
107
+    }
108
+
109
+    /**
110
+     * Create a new pad on the server with the given ID.
111
+     *
112
+     * @param id The pad ID to create. If blank is auto-generated.
113
+     * @param content Text to initialize the pad with.
114
+     * @return Created pad ID.
115
+     * @throws Exception if things break.
116
+     */
117
+    public static String genPad(String id, String content) throws Exception {
118
+        // Generate ID if blank
119
+        if (id.equals("")) {
120
+            id = genID();
121
+        }
122
+
123
+        // Create pad with given text.
124
+        try {
125
+            getClient().createPad(id, content);
126
+        } catch (EPLiteException ex) {
127
+            getClient().setText(id, content);
128
+        }
129
+        return id;
130
+    }
131
+
132
+    /**
133
+     * Generate a random pad ID with length 15.
134
+     * <br />There are about 1.217 x 10^26 possibilities (121 septillion).
135
+     * <br />If this starts giving out used IDs, I'll be too rich to care.
136
+     *
137
+     * @return the ID.
138
+     */
139
+    public static String genID() {
140
+        int length = 15;
141
+        String[] chars = ("0123456789"
142
+                + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
143
+                + "abcdefghijklmnopqrstuvwxyz").split("");
144
+        String out = "";
145
+        Random rng = new Random();
146
+
147
+        for (int i = 0; i < length; i++) {
148
+            out += chars[rng.nextInt(chars.length)];
149
+        }
150
+
151
+        return out;
152
+    }
153
+
154
+    /**
155
+     * Get a client for the pad API.
156
+     *
157
+     * @return the client.
158
+     * @throws Exception if things break.
159
+     */
160
+    public static EPLiteClient getClient() throws Exception {
161
+        String apikey;
162
+        // Enable key change without full SyMAT update
163
+        if (!PrefStorage.getSetting("padkey-override", "").equals("")) {
164
+            apikey = PrefStorage.getSetting("padkey-override", "");
165
+        } else {
166
+            // Load the API key from a file, so it's not included with Git.
167
+            BufferedReader reader = new BufferedReader(
168
+                    new InputStreamReader(
169
+                            PadUtils.class
170
+                            .getResourceAsStream("/padkey")));
171
+            apikey = reader.readLine();
172
+        }
173
+        // New client
174
+        return new EPLiteClient(PADS_URL, apikey);
175
+    }
176
+
177
+    /**
178
+     * Get the pad text.
179
+     *
180
+     * @param id the pad ID.
181
+     * @return the text, or error message.
182
+     */
183
+    public static String getPad(String id) {
184
+        String text = "";
185
+        try {
186
+            text = getClient().getText(id).getOrDefault("text", "").toString();
187
+        } catch (Exception ex) {
188
+            text = "Error: " + ex.getMessage();
189
+        }
190
+        return text;
191
+    }
192
+
193
+    /**
194
+     * Set pad text.
195
+     *
196
+     * @param id Pad ID
197
+     * @param content Pad text
198
+     */
199
+    public static void setPad(String id, String content) {
200
+        try {
201
+            getClient().setText(id, content);
202
+        } catch (Exception ex) {
203
+            JOptionPane.showMessageDialog(
204
+                    null,
205
+                    "Could not sync pad contents: " + ex.getMessage(),
206
+                    "Error",
207
+                    JOptionPane.ERROR_MESSAGE);
208
+        }
209
+    }
210
+
211
+    /**
212
+     * Delete the given pad ID.
213
+     *
214
+     * @param id the pad ID.
215
+     * @param purge If true will delete from server also.
216
+     */
217
+    public static void delPad(String id, boolean purge) {
218
+        delPad(id);
219
+        if (purge) {
220
+            try {
221
+                getClient().deletePad(id);
222
+            } catch (Exception ex) {
223
+                // Meh.  No big deal.
224
+            }
225
+        }
226
+    }
227
+}

+ 83
- 0
src/com/netsyms/symat/padview/PrefStorage.java View File

@@ -0,0 +1,83 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.util.ArrayList;
29
+import java.util.List;
30
+import java.util.prefs.BackingStoreException;
31
+import java.util.prefs.Preferences;
32
+
33
+/**
34
+ *
35
+ * @author Skylar Ittner
36
+ */
37
+public class PrefStorage {
38
+
39
+    private static final Preferences prefs = Preferences.userNodeForPackage(PrefStorage.class);
40
+
41
+    public static void saveSetting(String key, String value) {
42
+        prefs.put(key, value);
43
+    }
44
+
45
+    public static boolean isset(String key) {
46
+        return !getSetting(key, "NULL").equals("NULL");
47
+    }
48
+
49
+    public static void unset(String key) {
50
+        saveSetting(key, "");
51
+        save();
52
+        prefs.remove(key);
53
+        save();
54
+    }
55
+
56
+    public static String getSetting(String key) {
57
+        return prefs.get(key, "");
58
+    }
59
+
60
+    public static String getSetting(String key, String emptyResponse) {
61
+        return prefs.get(key, emptyResponse);
62
+    }
63
+
64
+    public static boolean save() {
65
+        try {
66
+            prefs.flush();
67
+            prefs.sync();
68
+        } catch (BackingStoreException ex) {
69
+            System.err.println("Settings could not be saved!");
70
+            return false;
71
+        }
72
+        return true;
73
+    }
74
+
75
+    /**
76
+     * Wipe all settings.
77
+     *
78
+     * @throws java.util.prefs.BackingStoreException
79
+     */
80
+    public static void wipe() throws BackingStoreException {
81
+        prefs.clear();
82
+    }
83
+}

+ 80
- 0
src/com/netsyms/symat/padview/SplashScreen.form View File

@@ -0,0 +1,80 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
4
+  <Properties>
5
+    <Property name="defaultCloseOperation" type="int" value="3"/>
6
+    <Property name="undecorated" type="boolean" value="true"/>
7
+    <Property name="resizable" type="boolean" value="false"/>
8
+  </Properties>
9
+  <SyntheticProperties>
10
+    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
11
+    <SyntheticProperty name="generateCenter" type="boolean" value="true"/>
12
+  </SyntheticProperties>
13
+  <AuxValues>
14
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
15
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
16
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
17
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
18
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
19
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
20
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
21
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
22
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
23
+    <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,1,46,0,0,1,-112"/>
24
+  </AuxValues>
25
+
26
+  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
27
+    <Property name="useNullLayout" type="boolean" value="false"/>
28
+  </Layout>
29
+  <SubComponents>
30
+    <Component class="javax.swing.JLabel" name="jLabel3">
31
+      <Properties>
32
+        <Property name="text" type="java.lang.String" value="Netsyms Technologies"/>
33
+      </Properties>
34
+      <Constraints>
35
+        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
36
+          <AbsoluteConstraints x="10" y="270" width="130" height="30"/>
37
+        </Constraint>
38
+      </Constraints>
39
+    </Component>
40
+    <Component class="javax.swing.JLabel" name="jLabel1">
41
+      <Properties>
42
+        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
43
+          <Font name="Tahoma" size="24" style="0"/>
44
+        </Property>
45
+        <Property name="horizontalAlignment" type="int" value="0"/>
46
+        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
47
+          <Connection code="&quot;&lt;html&gt;&quot;&#xd;&#xa;+ GUI.SYMAT &#xd;&#xa;+ &quot; &lt;span style=\&quot;color:#555555;\&quot;&gt;&quot;&#xd;&#xa;+ GUI.PRODUCT&#xd;&#xa;+ &quot;&lt;/span&gt;&quot;&#xd;&#xa;" type="code"/>
48
+        </Property>
49
+      </Properties>
50
+      <Constraints>
51
+        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
52
+          <AbsoluteConstraints x="0" y="180" width="400" height="-1"/>
53
+        </Constraint>
54
+      </Constraints>
55
+    </Component>
56
+    <Component class="javax.swing.JLabel" name="jLabel4">
57
+      <Properties>
58
+        <Property name="horizontalAlignment" type="int" value="11"/>
59
+        <Property name="text" type="java.lang.String" value="symatapp.com"/>
60
+      </Properties>
61
+      <Constraints>
62
+        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
63
+          <AbsoluteConstraints x="280" y="270" width="110" height="30"/>
64
+        </Constraint>
65
+      </Constraints>
66
+    </Component>
67
+    <Component class="javax.swing.JLabel" name="jLabel2">
68
+      <Properties>
69
+        <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
70
+          <Image iconType="3" name="/com/netsyms/symat/padview/splash.png"/>
71
+        </Property>
72
+      </Properties>
73
+      <Constraints>
74
+        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
75
+          <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/>
76
+        </Constraint>
77
+      </Constraints>
78
+    </Component>
79
+  </SubComponents>
80
+</Form>

+ 107
- 0
src/com/netsyms/symat/padview/SplashScreen.java View File

@@ -0,0 +1,107 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import static com.netsyms.symat.padview.GUI.logo;
29
+
30
+/**
31
+ *
32
+ * @author Skylar
33
+ */
34
+public class SplashScreen extends javax.swing.JFrame {
35
+
36
+    public SplashScreen me;
37
+    
38
+    /**
39
+     * Creates new form SplashScreen
40
+     */
41
+    public SplashScreen() {
42
+        initComponents();
43
+        setIconImages(logo);
44
+        me = this;
45
+
46
+        new java.util.Timer().schedule(
47
+                new java.util.TimerTask() {
48
+                    @Override
49
+                    public void run() {
50
+                        new GUI().setVisible(true);
51
+                        me.dispose();
52
+                    }
53
+                },
54
+                3000
55
+        );
56
+    }
57
+
58
+    /**
59
+     * This method is called from within the constructor to initialize the form.
60
+     * WARNING: Do NOT modify this code. The content of this method is always
61
+     * regenerated by the Form Editor.
62
+     */
63
+    @SuppressWarnings("unchecked")
64
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
65
+    private void initComponents() {
66
+
67
+        jLabel3 = new javax.swing.JLabel();
68
+        jLabel1 = new javax.swing.JLabel();
69
+        jLabel4 = new javax.swing.JLabel();
70
+        jLabel2 = new javax.swing.JLabel();
71
+
72
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
73
+        setUndecorated(true);
74
+        setResizable(false);
75
+        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
76
+
77
+        jLabel3.setText("Netsyms Technologies");
78
+        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, 130, 30));
79
+
80
+        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
81
+        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
82
+        jLabel1.setText("<html>"
83
+            + GUI.SYMAT 
84
+            + " <span style=\"color:#555555;\">"
85
+            + GUI.PRODUCT
86
+            + "</span>"
87
+        );
88
+        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 180, 400, -1));
89
+
90
+        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
91
+        jLabel4.setText("symatapp.com");
92
+        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 270, 110, 30));
93
+
94
+        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/netsyms/symat/padview/splash.png"))); // NOI18N
95
+        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));
96
+
97
+        pack();
98
+        setLocationRelativeTo(null);
99
+    }// </editor-fold>//GEN-END:initComponents
100
+
101
+    // Variables declaration - do not modify//GEN-BEGIN:variables
102
+    private javax.swing.JLabel jLabel1;
103
+    private javax.swing.JLabel jLabel2;
104
+    private javax.swing.JLabel jLabel3;
105
+    private javax.swing.JLabel jLabel4;
106
+    // End of variables declaration//GEN-END:variables
107
+}

+ 20
- 0
src/com/netsyms/symat/padview/WebView.form View File

@@ -0,0 +1,20 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+
3
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
+  <Events>
5
+    <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentResized"/>
6
+  </Events>
7
+  <AuxValues>
8
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
9
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
10
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
11
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
12
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
13
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
14
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
15
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
16
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
17
+  </AuxValues>
18
+
19
+  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
20
+</Form>

+ 193
- 0
src/com/netsyms/symat/padview/WebView.java View File

@@ -0,0 +1,193 @@
1
+/* 
2
+ * Copyright (c) 2015, Netsyms Technologies
3
+ * All rights reserved.
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * * Redistributions of source code must retain the above copyright notice, this
9
+ *   list of conditions and the following disclaimer.
10
+ * * Redistributions in binary form must reproduce the above copyright notice,
11
+ *   this list of conditions and the following disclaimer in the documentation
12
+ *   and/or other materials provided with the distribution.
13
+ *
14
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
+ * POSSIBILITY OF SUCH DAMAGE.
25
+ */
26
+package com.netsyms.symat.padview;
27
+
28
+import java.awt.BorderLayout;
29
+import javafx.application.Platform;
30
+import javafx.beans.value.ChangeListener;
31
+import javafx.beans.value.ObservableValue;
32
+import javafx.collections.ObservableList;
33
+import javafx.concurrent.Worker;
34
+import javafx.embed.swing.JFXPanel;
35
+import javafx.event.EventHandler;
36
+import javafx.scene.Group;
37
+import javafx.scene.Node;
38
+import javafx.scene.Scene;
39
+import javafx.scene.web.PromptData;
40
+import javafx.scene.web.WebEngine;
41
+import javafx.scene.web.WebEvent;
42
+import javafx.util.Callback;
43
+import javax.swing.JOptionPane;
44
+
45
+/**
46
+ *
47
+ * @author Skylar
48
+ */
49
+public class WebView extends javax.swing.JPanel {
50
+
51
+    private javafx.scene.web.WebView browser;
52
+    private WebEngine webEngine;
53
+    private JFXPanel jfxPanel;
54
+    private Group root;
55
+    private Scene scene;
56
+
57
+    private String loaded = "";
58
+
59
+    /**
60
+     * Creates new form WebView
61
+     */
62
+    public WebView() {
63
+        initComponents();
64
+        jfxPanel = new JFXPanel();
65
+        Platform.runLater(new Runnable() {
66
+            @Override
67
+            public void run() {
68
+                browser = new javafx.scene.web.WebView();
69
+                browser.setPrefSize(getWidth(), getHeight());
70
+                root = new Group();
71
+                scene = new Scene(root);
72
+                ObservableList<Node> children = root.getChildren();
73
+                children.add(browser);
74
+                jfxPanel.setScene(scene);
75
+                webEngine = browser.getEngine();
76
+                webEngine.getLoadWorker().stateProperty().addListener(
77
+                        new ChangeListener<Worker.State>() {
78
+                            @Override
79
+                            public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) {
80
+                                if (newState == Worker.State.RUNNING) {
81
+                                    GUI.statusLbl.setText("Loading...");
82
+                                } else if (newState == Worker.State.SCHEDULED
83
+                                || newState == Worker.State.READY) {
84
+
85
+                                } else {
86
+                                    GUI.statusLbl.setText(loaded);
87
+                                }
88
+                            }
89
+                        });
90
+                webEngine.setOnAlert(
91
+                        new EventHandler<WebEvent<String>>() {
92
+                            @Override
93
+                            public void handle(WebEvent<String> t) {
94
+                                JOptionPane.showMessageDialog(jfxPanel, t.getData(), "Message from webpage", JOptionPane.INFORMATION_MESSAGE);
95
+                            }
96
+                        });
97
+
98
+                webEngine.setPromptHandler(
99
+                        new Callback<PromptData, String>() {
100
+                            @Override
101
+                            public String call(PromptData p) {
102
+                                return JOptionPane.showInputDialog(jfxPanel, p.getMessage(), "Question from webpage", JOptionPane.QUESTION_MESSAGE);
103
+                            }
104
+                        });
105
+                webEngine.setConfirmHandler(
106
+                        new Callback<String, Boolean>() {
107
+
108
+                            @Override
109
+                            public Boolean call(String p) {
110
+                                return (JOptionPane.showConfirmDialog(