diff --git a/emulator/java/TeclaShieldEmulator/README b/emulator/java/TeclaShieldEmulator/README
new file mode 100644
index 0000000..2483cbb
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/README
@@ -0,0 +1,10 @@
+Tecla Shield Emulator (with an accessible GUI) - started by Rishabh Jain(rishabhiitd10@gmail.com, www.github.com/rishabhjain08)
+This is a Netbeans project and can be directly opened using it.
+For users who only wish to use the emulator, copy the "dist" folder to the location you desire and run the jar file "TeclaShieldEmulator.jar" located inside the "dist" folder. Add an additional argument -gui if you wish to use the gui version of the emulator. Press 'h' for help.
+Important note :
+1. Remember to rename your computer to "TeclaShield" or "TeklaShield"
+2. This will work only for Windows users, linux users should replace the "bluecove-2.1.1-SNAPSHOT.jar"(located at dist/lib) with the bluez version of the bluecove snapshot available at "http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.62/"
+3. All the folders and files inside the "dist" folder support the jar file and should not be deleted.
+4. Make sure that your bluetooth is turned on, otherwise running the emulator will cause an error.
+
+For users who wish to contribute to the emulator, the source code is available inside the src folder.
\ No newline at end of file
diff --git a/emulator/java/TeclaShieldEmulator/build.xml b/emulator/java/TeclaShieldEmulator/build.xml
new file mode 100644
index 0000000..6d5b37d
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/build.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project TeclaShieldEmulator.
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/build/built-jar.properties b/emulator/java/TeclaShieldEmulator/build/built-jar.properties
new file mode 100644
index 0000000..a5510ee
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/build/built-jar.properties
@@ -0,0 +1,4 @@
+#Fri, 13 Apr 2012 18:18:06 +0530
+
+
+E\:\\NetBeansProjects\\TeclaShieldEmulator=
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator$PingThread.class b/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator$PingThread.class
new file mode 100644
index 0000000..be1c79a
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator$PingThread.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator.class b/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator.class
new file mode 100644
index 0000000..2a1f851
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/Emulator/Emulator.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/CustomButton.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/CustomButton.class
new file mode 100644
index 0000000..0a7bda9
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/CustomButton.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$1.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$1.class
new file mode 100644
index 0000000..5d6afd4
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$1.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$10.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$10.class
new file mode 100644
index 0000000..3da4737
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$10.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$11.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$11.class
new file mode 100644
index 0000000..46ac7ee
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$11.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$12.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$12.class
new file mode 100644
index 0000000..c8045eb
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$12.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$13.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$13.class
new file mode 100644
index 0000000..da761b5
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$13.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$2.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$2.class
new file mode 100644
index 0000000..b3465b2
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$2.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$3.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$3.class
new file mode 100644
index 0000000..7cd1dd2
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$3.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$4.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$4.class
new file mode 100644
index 0000000..ce2b2d4
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$4.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$5.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$5.class
new file mode 100644
index 0000000..b1dda7a
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$5.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$6.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$6.class
new file mode 100644
index 0000000..c8fe1fa
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$6.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$7.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$7.class
new file mode 100644
index 0000000..3f168a0
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$7.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$8.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$8.class
new file mode 100644
index 0000000..1e89ccb
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$8.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$9.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$9.class
new file mode 100644
index 0000000..a438273
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$9.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$AttemptConnection.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$AttemptConnection.class
new file mode 100644
index 0000000..cd5f2c6
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$AttemptConnection.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$UpdateStatus.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$UpdateStatus.class
new file mode 100644
index 0000000..11b7442
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator$UpdateStatus.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator.class
new file mode 100644
index 0000000..045979e
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Gemulator.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/Entry.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/Entry.class
new file mode 100644
index 0000000..e14c764
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/Entry.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$1.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$1.class
new file mode 100644
index 0000000..346bc9c
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$1.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$2.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$2.class
new file mode 100644
index 0000000..32f7187
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$2.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$3.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$3.class
new file mode 100644
index 0000000..d261215
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame$3.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame.class
new file mode 100644
index 0000000..477a466
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Help/HelpFrame.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$1.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$1.class
new file mode 100644
index 0000000..d2619a5
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$1.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$2.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$2.class
new file mode 100644
index 0000000..d709b59
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$2.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$3.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$3.class
new file mode 100644
index 0000000..1dea4d3
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$3.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$4.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$4.class
new file mode 100644
index 0000000..9c76671
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$4.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$5.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$5.class
new file mode 100644
index 0000000..ae8de91
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast$5.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast.class b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast.class
new file mode 100644
index 0000000..080690d
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/GUI/Util/Toast.class differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/Resources/closeButton.png b/emulator/java/TeclaShieldEmulator/build/classes/Resources/closeButton.png
new file mode 100644
index 0000000..582cdd8
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/Resources/closeButton.png differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/Resources/green_orb.png b/emulator/java/TeclaShieldEmulator/build/classes/Resources/green_orb.png
new file mode 100644
index 0000000..0375fa5
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/Resources/green_orb.png differ
diff --git a/emulator/java/TeclaShieldEmulator/build/classes/Resources/red_orb.png b/emulator/java/TeclaShieldEmulator/build/classes/Resources/red_orb.png
new file mode 100644
index 0000000..fb1ad71
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/build/classes/Resources/red_orb.png differ
diff --git a/emulator/java/TeclaShieldEmulator/dist/README.TXT b/emulator/java/TeclaShieldEmulator/dist/README.TXT
new file mode 100644
index 0000000..54be0d7
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/dist/README.TXT
@@ -0,0 +1,32 @@
+========================
+BUILD OUTPUT DESCRIPTION
+========================
+
+When you build an Java application project that has a main class, the IDE
+automatically copies all of the JAR
+files on the projects classpath to your projects dist/lib folder. The IDE
+also adds each of the JAR files to the Class-Path element in the application
+JAR files manifest file (MANIFEST.MF).
+
+To run the project from the command line, go to the dist folder and
+type the following:
+
+java -jar "TeclaShieldEmulator.jar"
+
+To distribute this project, zip up the dist folder (including the lib folder)
+and distribute the ZIP file.
+
+Notes:
+
+* If two JAR files on the project classpath have the same name, only the first
+JAR file is copied to the lib folder.
+* Only JAR files are copied to the lib folder.
+If the classpath contains other types of files or folders, these files (folders)
+are not copied.
+* If a library on the projects classpath also has a Class-Path element
+specified in the manifest,the content of the Class-Path element has to be on
+the projects runtime path.
+* To set a main class in a standard Java project, right-click the project node
+in the Projects window and choose Properties. Then click Run and enter the
+class name in the Main Class field. Alternatively, you can manually type the
+class name in the manifest Main-Class element.
diff --git a/emulator/java/TeclaShieldEmulator/dist/TeclaShieldEmulator.jar b/emulator/java/TeclaShieldEmulator/dist/TeclaShieldEmulator.jar
new file mode 100644
index 0000000..ab9445c
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/dist/TeclaShieldEmulator.jar differ
diff --git a/emulator/java/TeclaShieldEmulator/dist/lib/bluecove-2.1.1-SNAPSHOT.jar b/emulator/java/TeclaShieldEmulator/dist/lib/bluecove-2.1.1-SNAPSHOT.jar
new file mode 100644
index 0000000..ce9ca6c
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/dist/lib/bluecove-2.1.1-SNAPSHOT.jar differ
diff --git a/emulator/java/TeclaShieldEmulator/manifest.mf b/emulator/java/TeclaShieldEmulator/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/build-impl.xml b/emulator/java/TeclaShieldEmulator/nbproject/build-impl.xml
new file mode 100644
index 0000000..2fa918d
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/build-impl.xml
@@ -0,0 +1,1042 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/genfiles.properties b/emulator/java/TeclaShieldEmulator/nbproject/genfiles.properties
new file mode 100644
index 0000000..c99bea5
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=f5e23911
+build.xml.script.CRC32=85520498
+build.xml.stylesheet.CRC32=28e38971@1.44.1.45
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=f5e23911
+nbproject/build-impl.xml.script.CRC32=95879a44
+nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/private/config.properties b/emulator/java/TeclaShieldEmulator/nbproject/private/config.properties
new file mode 100644
index 0000000..e69de29
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/private/private.properties b/emulator/java/TeclaShieldEmulator/nbproject/private/private.properties
new file mode 100644
index 0000000..9bca164
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/private/private.properties
@@ -0,0 +1,6 @@
+compile.on.save=true
+do.depend=false
+do.jar=true
+javac.debug=true
+javadoc.preview=true
+user.properties.file=C:\\Users\\Rishabh\\.netbeans\\7.0\\build.properties
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/private/private.xml b/emulator/java/TeclaShieldEmulator/nbproject/private/private.xml
new file mode 100644
index 0000000..c1f155a
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/private/private.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/project.properties b/emulator/java/TeclaShieldEmulator/nbproject/project.properties
new file mode 100644
index 0000000..30ae274
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/project.properties
@@ -0,0 +1,74 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=TeclaShieldEmulator
+application.vendor=Rishabh
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/TeclaShieldEmulator.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${libs.microedition.classpath}:\
+ ${libs.bluetooth.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=GUI.Gemulator
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/emulator/java/TeclaShieldEmulator/nbproject/project.xml b/emulator/java/TeclaShieldEmulator/nbproject/project.xml
new file mode 100644
index 0000000..4414a4d
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/nbproject/project.xml
@@ -0,0 +1,15 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ TeclaShieldEmulator
+
+
+
+
+
+
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/src/Emulator/Emulator.java b/emulator/java/TeclaShieldEmulator/src/Emulator/Emulator.java
new file mode 100644
index 0000000..57987d8
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/Emulator/Emulator.java
@@ -0,0 +1,252 @@
+package Emulator;
+
+/**
+ *
+ * @author Rishabh
+ */
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+import javax.bluetooth.*;
+import javax.microedition.io.*;
+
+public class Emulator {
+
+ private final UUID uuid = new UUID("27012f0c68af4fbf8dbe6bbaf7aa432a", false);
+ private final String name = "TeclaShield";
+ private final String url = "btspp://localhost:" + uuid
+ + ";name=" + name
+ + ";authenticate=false;encrypt=false;";
+ private LocalDevice localDevice = null;
+ private StreamConnectionNotifier server = null;
+ private StreamConnection conn = null;
+ private InputStream din = null;
+ private OutputStream dout = null;
+ private Map dict;
+ private BufferedReader reader = null;
+ private String helpString = "";
+ private PingThread pinging;
+ private boolean auto_release = true;
+ public static final int UP = 0x3E;
+ public static final int DOWN = 0x3D;
+ public static final int LEFT = 0x3B;
+ public static final int RIGHT = 0x37;
+ public static final int EXTRA_1 = 0x2F;
+ public static final int EXTRA_2 = 0x1F;
+ public static final int RELEASE = 0x3F;
+
+ public Emulator(){
+ dict = new HashMap();
+ dict.put("W",0x3E);
+ dict.put("S", 0x3D);
+ dict.put("A", 0x3B);
+ dict.put("D", 0x37);
+ dict.put("1", 0x2F);
+ dict.put("2", 0x1F);
+ dict.put("R", 0x3F);
+ auto_release = true;
+ reader = new BufferedReader(new InputStreamReader(System.in));
+ helpString +=
+ "**********HELP**********\n"
+ +"w/W : ECU1 pressed\n"
+ +"s/S : ECU2 pressed\n"
+ +"a/A : ECU3 pressed\n"
+ +"d/D : ECU4 pressed\n"
+ +"1 : Switch Port 1 pressed\n"
+ +"2 : Switch port 2 pressed\n"
+ +"h/H : View possible commands\n"
+ +"r/R : Generate realease switch event\n"
+ + "t/T : Toggle auto switch release event\n"
+ + "q/Q : Quit\n"
+ + "\n\n#####Auto switch release mode is a mode in which switch release events are inserted after every switch event\n"
+ + "Default set to true.\n"
+ + "Can be turned on or off by command t/T\n"
+ +"************************";
+ System.out.println(helpString);
+ }
+
+ public boolean discover(){
+ try {
+ localDevice = LocalDevice.getLocalDevice();
+ try{
+ localDevice.setDiscoverable(DiscoveryAgent.GIAC);
+ }catch(Exception exp){}
+ server = (StreamConnectionNotifier) Connector.open(url);
+ System.out.println("Waiting for connection...");
+ conn = server.acceptAndOpen();
+ System.out.println("Device connected...");
+ din = conn.openInputStream();
+ dout = conn.openOutputStream();
+ } catch (Exception ex) {
+ System.out.println("An error occured while connecting to the device");
+ return false;
+ }
+ return true;
+ }
+
+ public void setAutoRelease(boolean enabled){
+ auto_release = enabled;
+ }
+
+ public boolean sendKeyEvent(int keyEvent){
+ try {
+ synchronized(dout){
+ System.out.println("writing : " + keyEvent);
+ dout.write(keyEvent);
+ if(auto_release){
+ try {
+ Thread.sleep(200);
+ } catch (Exception ex) {}
+ dout.write(dict.get("R"));
+ }
+ }
+ } catch (Exception ex) {
+ System.out.println("An error occured while sending to the connected device");
+ return false;
+ }
+ return true;
+ }
+
+ class PingThread extends Thread{
+
+ private boolean end = false;
+
+ @Override
+ public void run() {
+ end = false;
+ while(!end){
+ try {
+ try {
+ this.sleep(100);
+ } catch (Exception ex) {}
+ int read = din.read();
+ if(read != -1)
+ synchronized(dout){
+ dout.write(read);
+ }
+ } catch (Exception ex) {
+ System.out.println("An error occured while pinging the connected device, disconnecting");
+ disconnect();
+ System.exit(0);
+ }
+ }
+ }
+
+ public void end(){
+ end = true;
+ }
+
+ };
+
+ public boolean connect(){
+ disconnect();
+ boolean discover = discover();
+ if(discover){
+ setPingState(true);
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ public void disconnect(){
+ setPingState(false);
+ try {
+ din.close();
+ } catch (Exception ex) {}
+ try {
+ dout.close();
+ } catch (Exception ex) {}
+ try {
+ server.close();
+ } catch (Exception ex) {}
+ }
+
+ public void setPingState(boolean state){
+ if(state){
+ try{
+ pinging.stop();
+ }catch(Exception e){}
+ pinging = new PingThread();
+ pinging.start();
+ }
+ else{
+ try{
+ pinging.stop();
+ }catch(Exception e){}
+ }
+ }
+ public void startEmulator(){
+ if(!this.discover()){
+ System.out.println("Closing the emulator");
+ System.exit(0);
+ }
+ setPingState(true);
+ this.listenKeys();
+ }
+
+ private void listenKeys(){
+ System.out.println("Enter the keystroke (h for help): ");
+ while(true){
+ char ans = 'h';
+ try {
+ String g = reader.readLine();
+ ans = (g.equals(""))?' ':g.charAt(0);
+ } catch (Exception ex) {
+ System.out.println("An internal error occured, exiting");
+ disconnect();
+ System.exit(0);
+ }
+ boolean sendKeyEvent = true;
+ if((ans == 'w' || ans == 'W') && dict.containsKey("W")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("W"));
+ }
+ else if((ans == 's' || ans == 'S') && dict.containsKey("S")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("S"));
+ }
+ else if((ans == 'a' || ans == 'A') && dict.containsKey("A")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("A"));
+ }
+ else if((ans == 'd' || ans =='D') && dict.containsKey("D")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("D"));
+ }
+ else if((ans == 'r' || ans =='R') && dict.containsKey("R")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("R"));
+ }
+ else if(ans == '1' && dict.containsKey("1")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("1"));
+ }
+ else if(ans == '2' && dict.containsKey("2")){
+ sendKeyEvent = this.sendKeyEvent(dict.get("2"));
+ }
+ else if(ans == 'h'|| ans =='H'){
+ System.out.println(helpString);
+ }
+ else if(ans == 't' || ans =='T'){
+ auto_release = !auto_release;
+ if(auto_release)
+ System.out.println("Auto release is now on");
+ else
+ System.out.println("Auto release is now off");
+ }
+ else if(ans == 'q' || ans =='Q'){
+ disconnect();
+ System.exit(0);
+ }
+ if(!sendKeyEvent){
+ System.out.println("An unknown error occured while sending this keystroke to the connected device, exiting");
+ disconnect();
+ System.exit(0);
+ }
+ }
+ }
+
+ public static void main(String[] args){
+ Emulator emulator = new Emulator();
+ emulator.startEmulator();
+ }
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/CustomButton.java b/emulator/java/TeclaShieldEmulator/src/GUI/CustomButton.java
new file mode 100644
index 0000000..8f5a049
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/CustomButton.java
@@ -0,0 +1,43 @@
+package GUI;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import javax.swing.JButton;
+
+/**
+ *
+ * @author Rishabh
+ */
+public class CustomButton extends JButton{
+
+ private Image pressedImage,releasedImage;
+
+ public CustomButton(){
+ super();
+ }
+
+ public CustomButton(String label){
+ super(label);
+ }
+
+ public void setPressedImage(Image pressedImage) {
+ this.pressedImage = pressedImage;
+ }
+
+ public void setReleasedImage(Image releasedImage) {
+ this.releasedImage = releasedImage;
+ }
+
+ @Override
+ public void paintComponents(Graphics g) {
+ super.paintComponents(g);
+ boolean selected = isSelected();
+ if(selected){
+ g.drawImage(pressedImage, 0, 0, null);
+ }
+ else{
+ g.drawImage(releasedImage, 0, 0, null);
+ }
+ }
+
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.form b/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.form
new file mode 100644
index 0000000..e6df604
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.form
@@ -0,0 +1,449 @@
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.java b/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.java
new file mode 100644
index 0000000..e16ddf2
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Gemulator.java
@@ -0,0 +1,847 @@
+/*
+ * Gemulator.java
+ *
+ * Created on Apr 12, 2012, 2:16:57 PM
+ */
+package GUI;
+
+import GUI.Util.Toast;
+import GUI.Help.HelpFrame;
+import Emulator.Emulator;
+import java.awt.KeyEventDispatcher;
+import java.awt.KeyboardFocusManager;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import javax.swing.ImageIcon;
+
+/**
+ *
+ * @author Rishabh
+ */
+public class Gemulator extends javax.swing.JFrame implements WindowListener{
+
+ private ImageIcon red_icon,green_icon;
+ private boolean connection_status_bool = false;
+ private Emulator emulator;
+ private UpdateStatus updateStatus;
+ private String title = "Tecla Shield Emulator";
+ private static final String no_device_connected = "You are currently not connected to any device";
+ private static final String device_got_disconnected = "You got disconnected from the device";
+ private static final String device_got_connected = "A device was successfully connected";
+ private static final String failed_connecting = "An attempt to connect to a device failed";
+ private AttemptConnection attemptConnection;
+
+ /** Creates new form Gemulator */
+ public Gemulator() {
+ red_icon = new ImageIcon(getClass().getResource("/Resources/red_orb.png"));
+ green_icon = new ImageIcon(getClass().getResource("/Resources/green_orb.png"));
+ initComponents();
+ setTitle(title);
+ emulator = new Emulator();
+ addWindowListener(this);
+ KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() {
+
+ private KeyEvent prevKeyEvent = null;
+
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent e) {
+ if(!isFocused() ||
+ (e.getID() == KeyEvent.KEY_TYPED) ||
+ (prevKeyEvent != null && e.getID() == prevKeyEvent.getID() && e.getKeyCode() == prevKeyEvent.getKeyCode())){
+ prevKeyEvent = e;
+ return false;
+ }
+ prevKeyEvent = e;
+ if(e.getID()== KeyEvent.KEY_PRESSED ){
+ int code = e.getKeyCode();
+ switch(code){
+ case KeyEvent.VK_UP:
+ ecu1MousePressed(null);
+ break;
+ case KeyEvent.VK_DOWN:
+ ecu2MousePressed(null);
+ break;
+ case KeyEvent.VK_LEFT:
+ ecu3MousePressed(null);
+ break;
+ case KeyEvent.VK_RIGHT:
+ ecu4MousePressed(null);
+ break;
+ case KeyEvent.VK_1:
+ extra1MousePressed(null);
+ break;
+ case KeyEvent.VK_NUMPAD1:
+ extra1MousePressed(null);
+ break;
+ case KeyEvent.VK_2:
+ extra2MousePressed(null);
+ break;
+ case KeyEvent.VK_NUMPAD2:
+ extra2MousePressed(null);
+ break;
+ }
+ }
+ else if(e.getID() == KeyEvent.KEY_RELEASED){
+ int code = e.getKeyCode();
+ switch(code){
+ case KeyEvent.VK_UP:
+ ecu1MouseReleased(null);
+ break;
+ case KeyEvent.VK_DOWN:
+ ecu2MouseReleased(null);
+ break;
+ case KeyEvent.VK_LEFT:
+ ecu3MouseReleased(null);
+ break;
+ case KeyEvent.VK_RIGHT:
+ ecu4MouseReleased(null);
+ break;
+ case KeyEvent.VK_1:
+ extra1MouseReleased(null);
+ break;
+ case KeyEvent.VK_2:
+ extra2MouseReleased(null);
+ break;
+ case KeyEvent.VK_NUMPAD1:
+ extra1MouseReleased(null);
+ break;
+ case KeyEvent.VK_NUMPAD2:
+ extra2MouseReleased(null);
+ break;
+ case KeyEvent.VK_H:
+ new HelpFrame().setVisible(true);
+ break;
+ case KeyEvent.VK_ESCAPE:
+ case KeyEvent.VK_Q:
+ emulator.disconnect();
+ System.exit(0);
+ }
+ }
+ //e.consume();
+ return false;
+ }
+ });
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ statusbar = new javax.swing.JPanel();
+ status_action = new javax.swing.JLabel();
+ connection_status_panel = new javax.swing.JPanel();
+ connection_status = new javax.swing.JLabel();
+ jSeparator1 = new javax.swing.JSeparator();
+ cancel_connection_panel = new javax.swing.JPanel();
+ cancel_connection = new javax.swing.JButton();
+ jProgressBar1 = new javax.swing.JProgressBar();
+ top_panel = new javax.swing.JPanel();
+ extra_switch_panel = new javax.swing.JPanel();
+ /*
+ extra1 = new javax.swing.JButton();
+ */extra1 = new CustomButton();
+ /*
+ extra2 = new javax.swing.JButton();
+ */extra2 = new CustomButton();
+ ecuPanel = new javax.swing.JPanel();
+ jPanel1 = new javax.swing.JPanel();
+ /*
+ ecu1 = new javax.swing.JButton();
+ */ecu1 = new CustomButton();
+ jPanel2 = new javax.swing.JPanel();
+ /*
+ ecu3 = new javax.swing.JButton();
+ */ecu3 = new CustomButton();
+ jPanel3 = new javax.swing.JPanel();
+ /*
+ ecu4 = new javax.swing.JButton();
+ */ecu4 = new CustomButton();
+ jPanel4 = new javax.swing.JPanel();
+ /*
+ ecu2 = new javax.swing.JButton();
+ */ecu2 = new CustomButton();
+ jPanel5 = new javax.swing.JPanel();
+ connectpanel = new javax.swing.JPanel();
+ toggle_connect = new javax.swing.JToggleButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+ statusbar.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+ status_action.setText("Current Action (Press h for help)");
+
+ connection_status.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+ connection_status.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/red_orb.png"))); // NOI18N
+ connection_status.setText("Connection Status");
+
+ jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
+
+ javax.swing.GroupLayout connection_status_panelLayout = new javax.swing.GroupLayout(connection_status_panel);
+ connection_status_panel.setLayout(connection_status_panelLayout);
+ connection_status_panelLayout.setHorizontalGroup(
+ connection_status_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, connection_status_panelLayout.createSequentialGroup()
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 2, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(connection_status)
+ .addContainerGap())
+ );
+ connection_status_panelLayout.setVerticalGroup(
+ connection_status_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(connection_status, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, connection_status_panelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 10, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+
+ cancel_connection.setText("Cancel Connection");
+ cancel_connection.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cancel_connectionActionPerformed(evt);
+ }
+ });
+
+ jProgressBar1.setIndeterminate(true);
+
+ javax.swing.GroupLayout cancel_connection_panelLayout = new javax.swing.GroupLayout(cancel_connection_panel);
+ cancel_connection_panel.setLayout(cancel_connection_panelLayout);
+ cancel_connection_panelLayout.setHorizontalGroup(
+ cancel_connection_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, cancel_connection_panelLayout.createSequentialGroup()
+ .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancel_connection))
+ );
+ cancel_connection_panelLayout.setVerticalGroup(
+ cancel_connection_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(cancel_connection, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
+ .addGroup(cancel_connection_panelLayout.createSequentialGroup()
+ .addGap(11, 11, 11)
+ .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
+
+ javax.swing.GroupLayout statusbarLayout = new javax.swing.GroupLayout(statusbar);
+ statusbar.setLayout(statusbarLayout);
+ statusbarLayout.setHorizontalGroup(
+ statusbarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusbarLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(status_action)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
+ .addComponent(cancel_connection_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(connection_status_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
+ statusbarLayout.setVerticalGroup(
+ statusbarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusbarLayout.createSequentialGroup()
+ .addGroup(statusbarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(cancel_connection_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(status_action, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
+ .addComponent(connection_status_panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(0, 0, 0))
+ );
+
+ cancel_connection_panel.setVisible(false);
+
+ extra1.setText("Extra Switch 1");
+ extra1.setToolTipText("numeric or numpad 1 key");
+ extra1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ extra1MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ extra1MousePressed(evt);
+ }
+ });
+ extra1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ extra1ActionPerformed(evt);
+ }
+ });
+
+ extra2.setText("Extra Switch 2");
+ extra2.setToolTipText("numeric or numpad 1");
+ extra2.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ extra2MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ extra2MousePressed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout extra_switch_panelLayout = new javax.swing.GroupLayout(extra_switch_panel);
+ extra_switch_panel.setLayout(extra_switch_panelLayout);
+ extra_switch_panelLayout.setHorizontalGroup(
+ extra_switch_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(extra_switch_panelLayout.createSequentialGroup()
+ .addGap(0, 0, 0)
+ .addGroup(extra_switch_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
+ .addComponent(extra1, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
+ .addComponent(extra2, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE))
+ .addGap(0, 0, 0))
+ );
+ extra_switch_panelLayout.setVerticalGroup(
+ extra_switch_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, extra_switch_panelLayout.createSequentialGroup()
+ .addComponent(extra1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
+ .addComponent(extra2, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE))
+ );
+
+ extra_switch_panelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {extra1, extra2});
+
+ ecuPanel.setLayout(new java.awt.GridLayout(3, 3, 10, 10));
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 155, Short.MAX_VALUE)
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 94, Short.MAX_VALUE)
+ );
+
+ ecuPanel.add(jPanel1);
+
+ ecu1.setText("Up");
+ ecu1.setToolTipText("up arrow key");
+ ecu1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ ecu1MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ ecu1MousePressed(evt);
+ }
+ });
+ ecuPanel.add(ecu1);
+
+ javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
+ jPanel2.setLayout(jPanel2Layout);
+ jPanel2Layout.setHorizontalGroup(
+ jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 155, Short.MAX_VALUE)
+ );
+ jPanel2Layout.setVerticalGroup(
+ jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 94, Short.MAX_VALUE)
+ );
+
+ ecuPanel.add(jPanel2);
+
+ ecu3.setText("Left");
+ ecu3.setToolTipText("left arrow key");
+ ecu3.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ ecu3MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ ecu3MousePressed(evt);
+ }
+ });
+ ecuPanel.add(ecu3);
+
+ javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+ jPanel3.setLayout(jPanel3Layout);
+ jPanel3Layout.setHorizontalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 155, Short.MAX_VALUE)
+ );
+ jPanel3Layout.setVerticalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 94, Short.MAX_VALUE)
+ );
+
+ ecuPanel.add(jPanel3);
+
+ ecu4.setText("right arrow key");
+ ecu4.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ ecu4MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ ecu4MousePressed(evt);
+ }
+ });
+ ecuPanel.add(ecu4);
+
+ javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
+ jPanel4.setLayout(jPanel4Layout);
+ jPanel4Layout.setHorizontalGroup(
+ jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 155, Short.MAX_VALUE)
+ );
+ jPanel4Layout.setVerticalGroup(
+ jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 94, Short.MAX_VALUE)
+ );
+
+ ecuPanel.add(jPanel4);
+
+ ecu2.setText("Down");
+ ecu2.setToolTipText("down arrow key");
+ ecu2.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseReleased(java.awt.event.MouseEvent evt) {
+ ecu2MouseReleased(evt);
+ }
+ public void mousePressed(java.awt.event.MouseEvent evt) {
+ ecu2MousePressed(evt);
+ }
+ });
+ ecu2.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ ecu2ActionPerformed(evt);
+ }
+ });
+ ecuPanel.add(ecu2);
+
+ javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
+ jPanel5.setLayout(jPanel5Layout);
+ jPanel5Layout.setHorizontalGroup(
+ jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 155, Short.MAX_VALUE)
+ );
+ jPanel5Layout.setVerticalGroup(
+ jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 94, Short.MAX_VALUE)
+ );
+
+ ecuPanel.add(jPanel5);
+
+ toggle_connect.setText("Connect");
+ toggle_connect.setToolTipText("no shortcut key");
+ toggle_connect.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ toggle_connectMouseClicked(evt);
+ }
+ });
+ toggle_connect.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ toggle_connectActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout connectpanelLayout = new javax.swing.GroupLayout(connectpanel);
+ connectpanel.setLayout(connectpanelLayout);
+ connectpanelLayout.setHorizontalGroup(
+ connectpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(toggle_connect, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
+ );
+ connectpanelLayout.setVerticalGroup(
+ connectpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(toggle_connect, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
+ );
+
+ javax.swing.GroupLayout top_panelLayout = new javax.swing.GroupLayout(top_panel);
+ top_panel.setLayout(top_panelLayout);
+ top_panelLayout.setHorizontalGroup(
+ top_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(top_panelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(ecuPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)
+ .addGap(18, 18, 18)
+ .addGroup(top_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(extra_switch_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(connectpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+ top_panelLayout.setVerticalGroup(
+ top_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(top_panelLayout.createSequentialGroup()
+ .addGroup(top_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(top_panelLayout.createSequentialGroup()
+ .addGap(0, 0, 0)
+ .addComponent(extra_switch_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(connectpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(ecuPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(statusbar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(top_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(0, 0, 0))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(top_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(statusbar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(0, 0, 0))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+private void ecu2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ecu2ActionPerformed
+// TODO add your handling code here:
+}//GEN-LAST:event_ecu2ActionPerformed
+
+private void ecu1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu1MousePressed
+ if(connection_status_bool){
+ setStatus("Sending ECU1 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.UP);
+ if(!sendKeyEvent){
+ notOnline(true);
+ }
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_ecu1MousePressed
+
+private void extra1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extra1ActionPerformed
+// TODO add your handling code here:
+}//GEN-LAST:event_extra1ActionPerformed
+
+private void ecu1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu1MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_ecu1MouseReleased
+
+private void ecu2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu2MousePressed
+ if(connection_status_bool){
+ setStatus("Sending ECU2 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.DOWN);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_ecu2MousePressed
+
+private void ecu2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu2MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_ecu2MouseReleased
+
+private void ecu3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu3MousePressed
+ if(connection_status_bool){
+ setStatus("Sending ECU3 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.LEFT);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_ecu3MousePressed
+
+private void ecu3MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu3MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_ecu3MouseReleased
+
+private void ecu4MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu4MousePressed
+ if(connection_status_bool){
+ setStatus("Sending ECU4 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RIGHT);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_ecu4MousePressed
+
+private void ecu4MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ecu4MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_ecu4MouseReleased
+
+private void extra1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_extra1MousePressed
+ if(connection_status_bool){
+ setStatus("Sending extra switch 1 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.EXTRA_1);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_extra1MousePressed
+
+private void extra1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_extra1MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_extra1MouseReleased
+
+private void extra2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_extra2MousePressed
+ if(connection_status_bool){
+ setStatus("Sending extra switch 2 pressed switch event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.EXTRA_2);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+ else{
+ new Toast(no_device_connected).setVisible(true);
+ }
+}//GEN-LAST:event_extra2MousePressed
+
+private void extra2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_extra2MouseReleased
+ if(connection_status_bool){
+ setStatus("Sending switch released event");
+ boolean sendKeyEvent = emulator.sendKeyEvent(Emulator.RELEASE);
+ if(!sendKeyEvent)
+ notOnline(true);
+ }
+}//GEN-LAST:event_extra2MouseReleased
+
+private void setStatus(String status){
+ setStatus(status, false);
+}
+
+private void setStatus(String status, boolean permanent){
+ if(updateStatus != null && updateStatus.isAlive()){
+ try{
+ updateStatus.stop();
+ }catch(Exception e){}
+ }
+ status_action.setText(status);
+ if(!permanent){
+ try{
+ updateStatus = new UpdateStatus();
+ updateStatus.start();
+ }catch(Exception exp){}
+ }
+}
+
+class UpdateStatus extends Thread{
+ @Override
+ public void run(){
+ try {
+ Thread.sleep(1000);
+ } catch (Exception ex) {}
+ status_action.setText("");
+ }
+}
+
+class AttemptConnection extends Thread{
+ @Override
+ public void run(){
+ boolean connect = emulator.connect();
+ if(connect){
+ nowOnline(true);
+ }
+ else{
+ new Toast(failed_connecting).setVisible(true);
+ notOnline(false);
+ }
+ }
+}
+
+private void toggle_connectMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toggle_connectMouseClicked
+ if(toggle_connect.isSelected()){
+ setStatus("Waiting for a device to connect...", true);
+ toggle_connect.setText("Disconnect");
+ top_panel.setVisible(false);
+ connection_status_panel.setVisible(false);
+ cancel_connection_panel.setVisible(true);
+ if(attemptConnection != null && attemptConnection.isAlive())
+ attemptConnection.stop();
+ attemptConnection = new AttemptConnection();
+ attemptConnection.start();
+ }
+ else{
+ toggle_connect.setText("Connect");
+ emulator.disconnect();
+ notOnline(true);
+ }
+}//GEN-LAST:event_toggle_connectMouseClicked
+
+private void toggle_connectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggle_connectActionPerformed
+// TODO add your handling code here:
+}//GEN-LAST:event_toggle_connectActionPerformed
+
+private void cancel_connectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_connectionActionPerformed
+ if(attemptConnection != null && attemptConnection.isAlive()){
+ try{
+ attemptConnection.stop();
+ emulator.disconnect();
+ }catch(Exception e){}
+ }
+ System.out.println("Cancelled the connection");
+ notOnline(false);
+}//GEN-LAST:event_cancel_connectionActionPerformed
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Windows".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(Gemulator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(Gemulator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(Gemulator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(Gemulator.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ if(args.length==0){
+ new Emulator().startEmulator();
+ }
+ else if(args[0] != null && args[0].equals("-gui")){
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ public void run() {
+ new Gemulator().setVisible(true);
+ }
+ });
+ }
+ else{
+ System.out.println("Incorrect arguments");
+ System.out.println("Either pass no arguments or pass -gui if you wish to access the gui version of the emulator");
+ }
+ }
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton cancel_connection;
+ private javax.swing.JPanel cancel_connection_panel;
+ private javax.swing.JLabel connection_status;
+ private javax.swing.JPanel connection_status_panel;
+ private javax.swing.JPanel connectpanel;
+ /*
+ private javax.swing.JButton ecu1;
+ */CustomButton ecu1;
+ /*
+ private javax.swing.JButton ecu2;
+ */CustomButton ecu2;
+ /*
+ private javax.swing.JButton ecu3;
+ */CustomButton ecu3;
+ /*
+ private javax.swing.JButton ecu4;
+ */CustomButton ecu4;
+ private javax.swing.JPanel ecuPanel;
+ /*
+ private javax.swing.JButton extra1;
+ */CustomButton extra1;
+ /*
+ private javax.swing.JButton extra2;
+ */CustomButton extra2;
+ private javax.swing.JPanel extra_switch_panel;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPanel jPanel2;
+ private javax.swing.JPanel jPanel3;
+ private javax.swing.JPanel jPanel4;
+ private javax.swing.JPanel jPanel5;
+ private javax.swing.JProgressBar jProgressBar1;
+ private javax.swing.JSeparator jSeparator1;
+ private javax.swing.JLabel status_action;
+ private javax.swing.JPanel statusbar;
+ private javax.swing.JToggleButton toggle_connect;
+ private javax.swing.JPanel top_panel;
+ // End of variables declaration//GEN-END:variables
+
+ @Override
+ public void windowOpened(WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ emulator.disconnect();
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e) {
+ }
+
+ private void notOnline(boolean show_toast) {
+ setStatus("Disconnected...");
+ top_panel.setVisible(true);
+ cancel_connection_panel.setVisible(false);
+ connection_status_panel.setVisible(true);
+ toggle_connect.setSelected(false);
+ toggle_connect.setText("Connect");
+ connection_status_bool = false;
+ connection_status.setText("Disconnected");
+ connection_status.setIcon(red_icon);
+ if(show_toast)
+ new Toast(device_got_disconnected).setVisible(true);
+ }
+
+ private void nowOnline(boolean show_toast) {
+ setStatus("Connected...");
+ top_panel.setVisible(true);
+ cancel_connection_panel.setVisible(false);
+ connection_status_panel.setVisible(true);
+ toggle_connect.setSelected(true);
+ toggle_connect.setText("Disconnect");
+ connection_status_bool = true;
+ connection_status.setText("Connected");
+ connection_status.setIcon(green_icon);
+ if(show_toast)
+ new Toast(device_got_connected).setVisible(true);
+ }
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.form b/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.form
new file mode 100644
index 0000000..9e429b8
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.form
@@ -0,0 +1,59 @@
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.java b/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.java
new file mode 100644
index 0000000..00a48ed
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Help/Entry.java
@@ -0,0 +1,76 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/*
+ * Entry.java
+ *
+ * Created on Apr 12, 2012, 11:46:38 PM
+ */
+package GUI.Help;
+
+import java.awt.Color;
+
+/**
+ *
+ * @author Rishabh
+ */
+public class Entry extends javax.swing.JPanel {
+
+ /** Creates new form Entry */
+ public Entry() {
+ this("Help text");
+ }
+
+ public Entry(String text) {
+ this(text,(float)(64/255));
+ }
+
+ public Entry(String text, float opacity) {
+ initComponents();
+ help_text.setText(text);
+ setBackground(new Color(0,0,0,(int)(Math.min(1.0, opacity)*255)));
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ help_text = new javax.swing.JLabel();
+
+ jLabel1.setText("jLabel1");
+
+ jLabel2.setText("jLabel2");
+
+ setBackground(new Color(0,0,0,255));
+
+ help_text.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
+ help_text.setForeground(new java.awt.Color(255, 255, 255));
+ help_text.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+ help_text.setText("Help text");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(help_text, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(help_text, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
+ );
+ }// //GEN-END:initComponents
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel help_text;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.form b/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.form
new file mode 100644
index 0000000..602b0e9
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.form
@@ -0,0 +1,100 @@
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.java b/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.java
new file mode 100644
index 0000000..c014a5f
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Help/HelpFrame.java
@@ -0,0 +1,183 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/*
+ * HelpFrame.java
+ *
+ * Created on Apr 12, 2012, 11:32:15 PM
+ */
+package GUI.Help;
+
+import java.awt.Color;
+import java.awt.GridLayout;
+import java.awt.KeyEventDispatcher;
+import java.awt.KeyboardFocusManager;
+import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ *
+ * @author Rishabh
+ */
+public class HelpFrame extends javax.swing.JFrame {
+
+ /** Creates new form HelpFrame */
+ private List shortcuts;
+ public HelpFrame() {
+ setUndecorated(true);
+ initComponents();
+ setTitle("Help");
+ setAlwaysOnTop(true);
+ setBackground(new Color(0,0,0,0));
+ help_panel.setBackground(new Color(0,0,0,50));
+ setSize(Toolkit.getDefaultToolkit().getScreenSize());
+ shortcuts = new LinkedList();
+ shortcuts.add("Press/release up arrow key to send ECU1 pressed/released key event");
+ shortcuts.add("Press/release down arrow key to send ECU2 pressed/released key event");
+ shortcuts.add("Press/release left arrow key to send ECU3 pressed/released key event");
+ shortcuts.add("Press/release right arrow key to send ECU4 pressed/released key event");
+ shortcuts.add("Press/release 1 to send extra switch 1 pressed/released key event");
+ shortcuts.add("Press/release 2 to send extra switch 2 pressed/released key event");
+ shortcuts.add("Press Q/q/Escape to close the emulator");
+ shortcuts.add("Press H/h to show help");
+ help_panel.setLayout(new GridLayout(shortcuts.size(), 1, 10, 10));
+ for(int i=0; i//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ help_panel = new javax.swing.JPanel();
+ title_bar = new javax.swing.JPanel();
+ close_button = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ javax.swing.GroupLayout help_panelLayout = new javax.swing.GroupLayout(help_panel);
+ help_panel.setLayout(help_panelLayout);
+ help_panelLayout.setHorizontalGroup(
+ help_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 400, Short.MAX_VALUE)
+ );
+ help_panelLayout.setVerticalGroup(
+ help_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 289, Short.MAX_VALUE)
+ );
+
+ title_bar.setBackground(new Color(0,0,0,200));
+
+ close_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
+ close_button.setForeground(new java.awt.Color(255, 255, 255));
+ close_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/closeButton.png"))); // NOI18N
+ close_button.setText("Close");
+ close_button.setToolTipText("Shourtcut : Q/q/ESC/H/h");
+ close_button.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ closeClicked(evt);
+ }
+ });
+
+ javax.swing.GroupLayout title_barLayout = new javax.swing.GroupLayout(title_bar);
+ title_bar.setLayout(title_barLayout);
+ title_barLayout.setHorizontalGroup(
+ title_barLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, title_barLayout.createSequentialGroup()
+ .addContainerGap(318, Short.MAX_VALUE)
+ .addComponent(close_button)
+ .addContainerGap())
+ );
+ title_barLayout.setVerticalGroup(
+ title_barLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(close_button, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)
+ );
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(title_bar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(help_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(title_bar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(0, 0, 0)
+ .addComponent(help_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+private void closeClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeClicked
+ dispose();
+}//GEN-LAST:event_closeClicked
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(HelpFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(HelpFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(HelpFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(HelpFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ public void run() {
+ new HelpFrame().setVisible(true);
+ }
+ });
+ }
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel close_button;
+ private javax.swing.JPanel help_panel;
+ private javax.swing.JPanel title_bar;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.form b/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.form
new file mode 100644
index 0000000..637f0fd
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.form
@@ -0,0 +1,105 @@
+
+
+
diff --git a/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.java b/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.java
new file mode 100644
index 0000000..2524c1e
--- /dev/null
+++ b/emulator/java/TeclaShieldEmulator/src/GUI/Util/Toast.java
@@ -0,0 +1,222 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/*
+ * Toast.java
+ *
+ * Created on Apr 12, 2012, 4:41:46 PM
+ */
+package GUI.Util;
+
+import java.awt.Color;
+import java.awt.Toolkit;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author Rishabh
+ */
+public class Toast extends javax.swing.JFrame implements WindowListener{
+
+ private long time_in_millis;
+ private String msg = null;
+ private static long max_time = 5000;
+ private static long default_time = 2500;
+ private static long min_time = 500;
+
+ /** Creates new form Toast */
+ public Toast() {
+ this("No message to display");
+ }
+
+ public Toast(String msg){
+ this(msg, default_time);
+ }
+
+ public Toast(String msg, long time_in_millis){
+ this.msg = msg;
+ this.time_in_millis = time_in_millis;
+ setUndecorated(true);
+ initComponents();
+ setFocusable(false);
+ setBackground(new Color(0, 0, 0, 150));
+ text.setText(msg);
+ addWindowListener(this);
+ setSize(Toolkit.getDefaultToolkit().getScreenSize());
+ }
+
+
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+ jPanel2 = new javax.swing.JPanel();
+ jPanel4 = new javax.swing.JPanel();
+ text = new javax.swing.JLabel();
+ jPanel3 = new javax.swing.JPanel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
+ setAlwaysOnTop(true);
+ getContentPane().setLayout(new java.awt.GridLayout(3, 1));
+
+ jPanel1.setBackground(new Color(0,0,0,64));
+ jPanel1.setOpaque(false);
+ jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ disposeMeOff(evt);
+ }
+ });
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 374, Short.MAX_VALUE)
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 40, Short.MAX_VALUE)
+ );
+
+ getContentPane().add(jPanel1);
+
+ jPanel2.setLayout(new java.awt.GridLayout(1, 3));
+
+ jPanel4.setLayout(new java.awt.GridLayout(1, 3));
+
+ text.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
+ text.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+ text.setText("No Information");
+ text.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ disposeMeOff(evt);
+ }
+ });
+ jPanel4.add(text);
+
+ jPanel2.add(jPanel4);
+
+ getContentPane().add(jPanel2);
+
+ jPanel3.setOpaque(false);
+ jPanel3.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ disposeMeOff(evt);
+ }
+ });
+
+ javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+ jPanel3.setLayout(jPanel3Layout);
+ jPanel3Layout.setHorizontalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 374, Short.MAX_VALUE)
+ );
+ jPanel3Layout.setVerticalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 40, Short.MAX_VALUE)
+ );
+
+ getContentPane().add(jPanel3);
+
+ pack();
+ }// //GEN-END:initComponents
+
+private void disposeMeOff(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_disposeMeOff
+ dispose();
+}//GEN-LAST:event_disposeMeOff
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(Toast.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(Toast.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(Toast.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(Toast.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ public void run() {
+ new Toast().setVisible(true);
+ }
+ });
+ }
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPanel jPanel2;
+ private javax.swing.JPanel jPanel3;
+ private javax.swing.JPanel jPanel4;
+ private javax.swing.JLabel text;
+ // End of variables declaration//GEN-END:variables
+
+ @Override
+ public void windowOpened(WindowEvent e) {
+ Thread t = new Thread(){
+ @Override
+ public void run(){
+ try {
+ Thread.sleep(Math.min(max_time, Math.max(min_time,time_in_millis)));
+ } catch (InterruptedException ex) {
+ Logger.getLogger(Toast.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ dispose();
+ }
+ };
+ t.start();
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e) {
+ }
+}
diff --git a/emulator/java/TeclaShieldEmulator/src/Resources/closeButton.png b/emulator/java/TeclaShieldEmulator/src/Resources/closeButton.png
new file mode 100644
index 0000000..582cdd8
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/src/Resources/closeButton.png differ
diff --git a/emulator/java/TeclaShieldEmulator/src/Resources/green_orb.png b/emulator/java/TeclaShieldEmulator/src/Resources/green_orb.png
new file mode 100644
index 0000000..0375fa5
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/src/Resources/green_orb.png differ
diff --git a/emulator/java/TeclaShieldEmulator/src/Resources/red_orb.png b/emulator/java/TeclaShieldEmulator/src/Resources/red_orb.png
new file mode 100644
index 0000000..fb1ad71
Binary files /dev/null and b/emulator/java/TeclaShieldEmulator/src/Resources/red_orb.png differ