├── .github └── FUNDING.yml ├── .gitignore ├── Blockly@rduino_Plugin_Installation.pdf ├── BlocklyArduinoPlugin.zip ├── BlocklyArduinoPlugin └── tool │ ├── Blockly@rduino │ └── COPIER_ICI_BLOCKLY@RDUINO.txt │ ├── BlocklyArduinoPlugin.config │ └── BlocklyArduinoPlugin.jar ├── LICENSE ├── README.md ├── arborescence.jpg ├── capture_en.jpg ├── capture_en_mini1.jpg ├── capture_en_mini2.jpg ├── capture_fr.jpg ├── dev ├── BlocklyArduinoUpdater │ ├── BlocklyArduinoUpdater.java │ ├── blocklyarduinoupdater │ │ └── BlocklyArduinoUpdater.class │ ├── pde.jar │ └── version.xml ├── JavaUpdater │ ├── Update app │ │ ├── build.xml │ │ ├── build │ │ │ ├── built-jar.properties │ │ │ └── classes │ │ │ │ ├── .netbeans_automatic_build │ │ │ │ ├── .netbeans_update_resources │ │ │ │ └── updateapp │ │ │ │ ├── Main.class │ │ │ │ ├── UpdateInfo$1.class │ │ │ │ ├── UpdateInfo$2.class │ │ │ │ ├── UpdateInfo.class │ │ │ │ └── Updater.class │ │ ├── manifest.mf │ │ ├── nbproject │ │ │ ├── build-impl.xml │ │ │ ├── genfiles.properties │ │ │ ├── private │ │ │ │ ├── private.properties │ │ │ │ └── private.xml │ │ │ ├── project.properties │ │ │ └── project.xml │ │ └── src │ │ │ └── updateapp │ │ │ ├── Main.java │ │ │ ├── UpdateInfo.java │ │ │ └── Updater.java │ └── Update │ │ ├── build.xml │ │ ├── build │ │ ├── built-jar.properties │ │ └── classes │ │ │ ├── .netbeans_automatic_build │ │ │ ├── .netbeans_update_resources │ │ │ └── update │ │ │ ├── Main_Gui$1.class │ │ │ ├── Main_Gui$2.class │ │ │ ├── Main_Gui$3.class │ │ │ ├── Main_Gui$4.class │ │ │ └── Main_Gui.class │ │ ├── manifest.mf │ │ ├── nbproject │ │ ├── build-impl.xml │ │ ├── genfiles.properties │ │ ├── private │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── project.properties │ │ └── project.xml │ │ └── src │ │ └── update │ │ └── Main_Gui.java ├── LedMatrixEditor │ ├── build.xml │ ├── build │ │ ├── built-jar.properties │ │ └── classes │ │ │ ├── META-INF │ │ │ └── logo.png │ │ │ └── ledmatrixplugin │ │ │ ├── Browser$1.class │ │ │ ├── Browser$2.class │ │ │ ├── Browser.class │ │ │ ├── LedMatrixPlugin$1.class │ │ │ ├── LedMatrixPlugin$2.class │ │ │ ├── LedMatrixPlugin.class │ │ │ ├── LedMatrixServer.class │ │ │ ├── StartupApplet$1.class │ │ │ └── StartupApplet.class │ ├── dist │ │ ├── LedMatrixPlugin.jar │ │ ├── README.TXT │ │ └── lib │ │ │ ├── arduino-core.jar │ │ │ ├── commons-io-2.5.jar │ │ │ ├── jfxrt.jar │ │ │ └── pde.jar │ ├── lib │ │ ├── arduino-core.jar │ │ ├── commons-io-2.5.jar │ │ └── pde.jar │ ├── manifest.mf │ ├── nbproject │ │ ├── build-impl.xml │ │ ├── configs │ │ │ └── release.properties │ │ ├── genfiles.properties │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ ├── private.xml │ │ │ └── profiler │ │ │ │ └── settings.xml │ │ ├── project.properties │ │ └── project.xml │ └── src │ │ └── ledmatrixplugin │ │ ├── Browser.java │ │ ├── LedMatrixPlugin.java │ │ ├── LedMatrixServer.java │ │ └── StartupApplet.java ├── blocklyarduinoexe │ └── BlocklyArduinoExe.java ├── blynkserver │ ├── BlynkServer.class │ ├── BlynkServer.java │ ├── fxlauncher │ │ ├── AbstractLauncher.java │ │ ├── CreateManifest.java │ │ ├── DefaultUIProvider.java │ │ ├── FXManifest.java │ │ ├── FxlauncherClassCloader.java │ │ ├── HeadlessMainLauncher.java │ │ ├── Launcher.java │ │ ├── LauncherParams.java │ │ ├── LibraryFile.java │ │ ├── OS.java │ │ └── UIProvider.java │ ├── pde.jar │ └── resources │ │ └── app.xml └── topo.txt ├── nbproject ├── build-impl.xml ├── configs │ ├── Run_as_WebStart.properties │ └── Run_in_Browser.properties ├── genfiles.properties ├── jfx-impl.xml ├── project.properties └── project.xml └── src ├── Blockly@rduinoPlugin ├── build.xml ├── build │ ├── built-jar.properties │ └── classes │ │ ├── META-INF │ │ └── logo.png │ │ └── blocklyarduinoplugin │ │ ├── BlocklyArduinoPlugin$1.class │ │ ├── BlocklyArduinoPlugin$2.class │ │ ├── BlocklyArduinoPlugin.class │ │ ├── BlocklyArduinoServer$1.class │ │ ├── BlocklyArduinoServer$2.class │ │ ├── BlocklyArduinoServer$3.class │ │ ├── BlocklyArduinoServer$4.class │ │ ├── BlocklyArduinoServer$5.class │ │ ├── BlocklyArduinoServer.class │ │ ├── Browser$1.class │ │ ├── Browser$2.class │ │ ├── Browser.class │ │ ├── StartupApplet$1.class │ │ ├── StartupApplet.class │ │ ├── pom.xml │ │ └── target │ │ ├── classes │ │ └── .netbeans_automatic_build │ │ ├── fxlauncher-1.0.18.jar │ │ ├── javadoc-bundle-options │ │ └── javadoc-options-javadoc-resources.xml │ │ ├── maven-archiver │ │ └── pom.properties │ │ ├── maven-status │ │ └── maven-compiler-plugin │ │ │ └── testCompile │ │ │ └── default-testCompile │ │ │ └── inputFiles.lst │ │ └── test-classes │ │ └── .netbeans_automatic_build ├── dist │ ├── BlocklyArduinoPlugin.jar │ ├── README.TXT │ └── lib │ │ ├── arduino-core.jar │ │ ├── commons-io-2.5.jar │ │ ├── jfxrt.jar │ │ └── pde.jar ├── lib │ ├── arduino-core.jar │ ├── commons-io-2.5.jar │ └── pde.jar ├── manifest.mf ├── nbproject │ ├── build-impl.xml │ ├── configs │ │ └── release.properties │ ├── genfiles.properties │ ├── private │ │ ├── config.properties │ │ ├── private.properties │ │ ├── private.xml │ │ └── profiler │ │ │ └── settings.xml │ ├── project.properties │ └── project.xml └── src │ └── blocklyarduinoplugin │ ├── BlocklyArduinoPlugin.java │ ├── BlocklyArduinoServer.java │ ├── Browser.java │ ├── StartupApplet.java │ ├── pom.xml │ └── target │ ├── classes │ └── .netbeans_automatic_build │ ├── fxlauncher-1.0.18.jar │ ├── javadoc-bundle-options │ └── javadoc-options-javadoc-resources.xml │ ├── maven-archiver │ └── pom.properties │ ├── maven-status │ └── maven-compiler-plugin │ │ └── testCompile │ │ └── default-testCompile │ │ └── inputFiles.lst │ └── test-classes │ └── .netbeans_automatic_build ├── blocklyarduinoweb └── BlocklyArduinoWeb.java └── pde.jar /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [SebCanet] 2 | patreon: SebCanet 3 | custom: ['https://paypal.me/sebcanet?locale.x=fr_FR'] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /blocklyarduinoupdater/BlocklyArduinoUpdater/nbproject/private/ 2 | /BlocklyArduinoUpdater/build/ 3 | /BlocklyArduinoUpdater/dist/ 4 | /BlocklyArduinoUpdater/Update/build/ 5 | /BlocklyArduinoUpdater/Update/nbproject/private/ 6 | /BlocklyArduinoUpdater/Update/dist/ 7 | /BlocklyArduinoUpdater/UpdateApp/build/ 8 | /BlocklyArduinoUpdater/UpdateApp/dist/ 9 | Thumbs.db 10 | /Blockly@rduinoPlugin/build/ 11 | /Blockly@rduinoPlugin/dist/ 12 | /Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/ 13 | /nbproject/private/ 14 | /Blockly@rduinoPlugin/src/target/ -------------------------------------------------------------------------------- /Blockly@rduino_Plugin_Installation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/Blockly@rduino_Plugin_Installation.pdf -------------------------------------------------------------------------------- /BlocklyArduinoPlugin.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/BlocklyArduinoPlugin.zip -------------------------------------------------------------------------------- /BlocklyArduinoPlugin/tool/Blockly@rduino/COPIER_ICI_BLOCKLY@RDUINO.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/BlocklyArduinoPlugin/tool/Blockly@rduino/COPIER_ICI_BLOCKLY@RDUINO.txt -------------------------------------------------------------------------------- /BlocklyArduinoPlugin/tool/BlocklyArduinoPlugin.config: -------------------------------------------------------------------------------- 1 | ?lang=fr&card=arduino_uno -------------------------------------------------------------------------------- /BlocklyArduinoPlugin/tool/BlocklyArduinoPlugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/BlocklyArduinoPlugin/tool/BlocklyArduinoPlugin.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino IDE plugin for Blockly@rduino 2 | 3 | ## Presentation 4 | 5 | *Plugin to unzip inside Arduino\tools\. 6 | It creates a BlocklyArduinoPlugin folder within a jar server file, and you have to add Blockly@rduino (https://github.com/technologiescollege/Blockly-at-rduino).* 7 | 8 | ![screen capture](https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/master/capture_en.jpg) 9 | 10 | ## Présentation 11 | 12 | Blockly@rduino s’intègre complètement au logiciel Arduino pour une utilisation 100% hors ligne. Il suffira de lancer le logiciel Arduino puis de cliquer dans « outils -> Blockly@rduino ». Le greffon (lien de téléchargement en bas) est à décompresser dans le dossier « tools » du logiciel Arduino. Cela va créer un dossier BlocklyArduinoPlugin qui contient le serveur jar et dans lequel il faut décompresser Blockly@rduino (https://github.com/technologiescollege/Blockly-at-rduino). 13 | 14 | ![enter image description here](https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/master/capture_fr.jpg) 15 | 16 | ## Tools folder/dossier 'tools' 17 | 18 | ![enter image description here](https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/master/arborescence.jpg) 19 | 20 | ## How to install 21 | 22 | I created jar file just to unzip: 23 | - download plugin zip file: [https://github.com/technologiescollege/BlocklyArduinoIDEPlugin/raw/master/BlocklyArduinoPlugin.zip](https://github.com/technologiescollege/BlocklyArduinoIDEPlugin/raw/master/BlocklyArduinoPlugin.zip) 24 | - unzip it in **tools** folder, like you can see in 'Tools folder picture' 25 | - download Blockl@rduino zip file: [https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip](https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip) 26 | - unzip it in **plugin** folder, like you can see in 'Tools folder picture' (*beware of folder name!*) 27 | - launch IDE Arduino 28 | - run it from 'tools' menu 29 | 30 | ## Comment l'installer 31 | 32 | Je vous ai créé un plugin (fichier jar exécuté) pour lancer Blockly@rduino : 33 | 34 | - télécharger le zip du greffon : [https://github.com/technologiescollege/BlocklyArduinoIDEPlugin/raw/master/BlocklyArduinoPlugin.zip](https://github.com/technologiescollege/BlocklyArduinoIDEPlugin/raw/master/BlocklyArduinoPlugin.zip) 35 | - dézipper dans le dossier '**tools**', comme dans la capture d'écran précédente du 'dossier tools' 36 | - télécharger le zip de Blockly@rduino : [https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip](https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip) 37 | - dézipper dans le dossier du **plugin**, comme dans la capture d'écran précédente du dossier 'tools' (ATTENTION aux noms de dossier) 38 | - lancer l'EDI Arduino 39 | - lancer depuis le menu 'outils' 40 | - laisser faire... 41 | 42 | ## Update Blockly@rduino 43 | 44 | - download Blockl@rduino zip file: [https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip](https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip) 45 | - unzip it in **tools\BlocklyArduinoPlugin\tool\Blockly@rduino** folder, like you can see in 'Tools folder picture' (*beware of folder name!*) 46 | 47 | ## Mise à jour de Blcokly@rduino 48 | 49 | - télécharger le zip de Blockly@rduino : [https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip](https://github.com/technologiescollege/Blockly-at-rduino/archive/gh-pages.zip) 50 | - dézipper dans le dossier du **tools\BlocklyArduinoPlugin\tool\Blockly@rduino**, comme dans la capture d'écran précédente du dossier 'tools' (ATTENTION aux noms de dossier) 51 | 52 | 53 | ## HELP 54 | 55 | For any help, go on forum: http://blockly.technologiescollege.fr/forum/index.php 56 | 57 | Merci par avance des retours via le forum : http://blockly.technologiescollege.fr/forum/index.php 58 | 59 | ## Thanks 60 | 61 | Thanks to Dwenguino, my plugin is totally inspired from their plugin work: https://github.com/dwengovzw/Blockly-for-Dwenguino 62 | 63 | Merci à Dwenguino, mon plugin se base sur leur code de plugin : https://github.com/dwengovzw/Blockly-for-Dwenguino 64 | -------------------------------------------------------------------------------- /arborescence.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/arborescence.jpg -------------------------------------------------------------------------------- /capture_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/capture_en.jpg -------------------------------------------------------------------------------- /capture_en_mini1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/capture_en_mini1.jpg -------------------------------------------------------------------------------- /capture_en_mini2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/capture_en_mini2.jpg -------------------------------------------------------------------------------- /capture_fr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/capture_fr.jpg -------------------------------------------------------------------------------- /dev/BlocklyArduinoUpdater/BlocklyArduinoUpdater.java: -------------------------------------------------------------------------------- 1 | package blocklyarduinoupdater; 2 | 3 | import java.awt.Desktop; 4 | import java.io.IOException; 5 | import java.net.URI; 6 | import java.net.URISyntaxException; 7 | import java.nio.file.Paths; 8 | import processing.app.Editor; 9 | import processing.app.tools.Tool; 10 | 11 | 12 | public class BlocklyArduinoUpdater implements Tool { 13 | Editor editor; 14 | 15 | public void init(Editor editor) { 16 | this.editor = editor; 17 | } 18 | 19 | public String getMenuTitle() { 20 | return "Blockly@rduino updater"; 21 | } 22 | 23 | public void run() { 24 | try { 25 | String PathToExec = Paths.get(".").toAbsolutePath().normalize().toString(); 26 | PathToExec += "\\tools\\BlocklyArduinoUpdater\\tool\\"; 27 | //System.out.println("Current relative path is: " + PathToExec); 28 | Runtime runtime = Runtime.getRuntime(); 29 | runtime.exec(new String[] { PathToExec + "server.bat" } ); 30 | } catch (IOException e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dev/BlocklyArduinoUpdater/blocklyarduinoupdater/BlocklyArduinoUpdater.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/BlocklyArduinoUpdater/blocklyarduinoupdater/BlocklyArduinoUpdater.class -------------------------------------------------------------------------------- /dev/BlocklyArduinoUpdater/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/BlocklyArduinoUpdater/pde.jar -------------------------------------------------------------------------------- /dev/BlocklyArduinoUpdater/version.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/BlocklyArduinoUpdater/version.xml -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Update app. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 16 21:50:01 MDT 2010 2 | C\:\\Users\\H3R3T1C\\Desktop\\My\ Folder\\Java\\Update\ app= 3 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/updateapp/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/updateapp/Main.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo$1.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo$2.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/updateapp/UpdateInfo.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/build/classes/updateapp/Updater.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update app/build/classes/updateapp/Updater.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=f682ecb6 2 | build.xml.script.CRC32=38145bc2 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=f682ecb6 7 | nbproject/build-impl.xml.script.CRC32=1be4d620 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\babas\\AppData\\Roaming\\NetBeans\\8.2\\build.properties 3 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | file:/F:/Logiciels/Arduino_graphique/BlocklyArduinoIDEPlugin/JavaUpdater/Update%20app/src/updateapp/UpdateInfo.java 8 | file:/F:/Logiciels/Arduino_graphique/BlocklyArduinoIDEPlugin/JavaUpdater/Update%20app/src/updateapp/Main.java 9 | file:/F:/Logiciels/Arduino_graphique/BlocklyArduinoIDEPlugin/JavaUpdater/Update%20app/src/updateapp/Updater.java 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 24 16:42:43 CEST 2018 2 | excludes= 3 | javac.deprecation=false 4 | build.test.results.dir=${build.dir}/test/results 5 | run.classpath=${javac.classpath}\:${build.classes.dir} 6 | javadoc.nonavbar=false 7 | run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir} 8 | javac.target=1.6 9 | javadoc.noindex=false 10 | javadoc.additionalparam= 11 | includes=** 12 | build.classes.dir=${build.dir}/classes 13 | source.encoding=UTF-8 14 | javadoc.author=false 15 | test.src.dir=test 16 | build.dir=build 17 | build.test.classes.dir=${build.dir}/test/classes 18 | platform.active=default_platform 19 | javac.compilerargs= 20 | main.class=updateapp.Main 21 | dist.jar=${dist.dir}/Update app.jar 22 | javadoc.use=true 23 | build.sysclasspath=ignore 24 | debug.test.classpath=${run.test.classpath} 25 | dist.dir=dist 26 | build.classes.excludes=**/*.java,**/*.form 27 | javadoc.encoding=${source.encoding} 28 | javadoc.splitindex=true 29 | javac.source=1.6 30 | junit.selected.version=3 31 | debug.classpath=${run.classpath} 32 | run.jvmargs= 33 | build.generated.dir=${build.dir}/generated 34 | jar.compress=false 35 | javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:\:${libs.junit_4.classpath}\:${libs.hamcrest.classpath} 36 | javadoc.private=false 37 | meta.inf.dir=${src.dir}/META-INF 38 | manifest.file=manifest.mf 39 | dist.javadoc.dir=${dist.dir}/javadoc 40 | src.dir=src 41 | javac.classpath= 42 | build.generated.sources.dir=${build.dir}/generated-sources 43 | javadoc.version=false 44 | javadoc.windowtitle= 45 | javadoc.notree=false 46 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Update app 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/src/updateapp/Main.java: -------------------------------------------------------------------------------- 1 | 2 | package updateapp; 3 | 4 | /** 5 | * 6 | * @author Thomas Otero (H3R3T1C) 7 | */ 8 | public class Main { 9 | 10 | public static void main(String[] args) { 11 | try { 12 | if (Integer.parseInt(Updater.getLatestVersion()) > 0) { 13 | new UpdateInfo(Updater.getWhatsNew()); 14 | } 15 | } catch (Exception ex) { 16 | ex.printStackTrace(); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/src/updateapp/UpdateInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | 6 | package updateapp; 7 | 8 | import java.awt.BorderLayout; 9 | import java.awt.FlowLayout; 10 | import java.awt.event.ActionEvent; 11 | import java.awt.event.ActionListener; 12 | import javax.swing.JButton; 13 | import javax.swing.JEditorPane; 14 | import javax.swing.JFrame; 15 | import javax.swing.JPanel; 16 | import javax.swing.JScrollPane; 17 | 18 | /** 19 | * 20 | * @author Thomas Otero H3R3T1C 21 | */ 22 | public class UpdateInfo extends JFrame{ 23 | 24 | private JEditorPane infoPane; 25 | private JScrollPane scp; 26 | private JButton ok; 27 | private JButton cancel; 28 | private JPanel pan1; 29 | private JPanel pan2; 30 | 31 | public UpdateInfo(String info) { 32 | initComponents(); 33 | infoPane.setText(info); 34 | } 35 | 36 | private void initComponents() { 37 | 38 | this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 39 | this.setTitle("New Update Found"); 40 | pan1 = new JPanel(); 41 | pan1.setLayout(new BorderLayout()); 42 | 43 | pan2 = new JPanel(); 44 | pan2.setLayout(new FlowLayout()); 45 | 46 | infoPane = new JEditorPane(); 47 | infoPane.setContentType("text/html"); 48 | 49 | scp = new JScrollPane(); 50 | scp.setViewportView(infoPane); 51 | 52 | ok = new JButton("Update"); 53 | ok.addActionListener( new ActionListener(){ 54 | 55 | public void actionPerformed(ActionEvent e) { 56 | update(); 57 | } 58 | }); 59 | 60 | cancel = new JButton("Cancel"); 61 | cancel.addActionListener( new ActionListener(){ 62 | 63 | public void actionPerformed(ActionEvent e) { 64 | UpdateInfo.this.dispose(); 65 | } 66 | }); 67 | pan2.add(ok); 68 | pan2.add(cancel); 69 | pan1.add(pan2, BorderLayout.SOUTH); 70 | pan1.add(scp, BorderLayout.CENTER); 71 | this.add(pan1); 72 | pack(); 73 | show(); 74 | this.setSize(300, 200); 75 | } 76 | private void update() 77 | { 78 | String[] run = {"java","-jar","updater/update.jar"}; 79 | try { 80 | Runtime.getRuntime().exec(run); 81 | } catch (Exception ex) { 82 | ex.printStackTrace(); 83 | } 84 | System.exit(0); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update app/src/updateapp/Updater.java: -------------------------------------------------------------------------------- 1 | package updateapp; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.net.URL; 6 | /** 7 | * 8 | * @author Thomas Otero H3R3T1C 9 | */ 10 | public class Updater { 11 | private final static String versionURL = "http://h3r3t1cupdate.bravehost.com/version.html"; 12 | private final static String historyURL = "http://h3r3t1cupdate.bravehost.com/history.html"; 13 | public static String getLatestVersion() throws Exception 14 | { 15 | String data = getData(versionURL); 16 | return data.substring(data.indexOf("[version]")+9,data.indexOf("[/version]")); 17 | } 18 | public static String getWhatsNew() throws Exception 19 | { 20 | String data = getData(historyURL); 21 | return data.substring(data.indexOf("[history]")+9,data.indexOf("[/history]")); 22 | } 23 | private static String getData(String address)throws Exception 24 | { 25 | URL url = new URL(address); 26 | 27 | InputStream html = null; 28 | 29 | html = url.openStream(); 30 | 31 | int c = 0; 32 | StringBuffer buffer = new StringBuffer(""); 33 | 34 | while(c != -1) { 35 | c = html.read(); 36 | 37 | buffer.append((char)c); 38 | } 39 | return buffer.toString(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Update. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 16 21:56:22 MDT 2010 2 | C\:\\Users\\H3R3T1C\\Desktop\\My\ Folder\\Java\\Update= 3 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/.netbeans_update_resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/.netbeans_update_resources -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/update/Main_Gui$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/update/Main_Gui$1.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/update/Main_Gui$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/update/Main_Gui$2.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/update/Main_Gui$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/update/Main_Gui$3.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/update/Main_Gui$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/update/Main_Gui$4.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/build/classes/update/Main_Gui.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/JavaUpdater/Update/build/classes/update/Main_Gui.class -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=7a8b0aad 2 | build.xml.script.CRC32=77e1021b 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=7a8b0aad 7 | nbproject/build-impl.xml.script.CRC32=a116e951 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | user.properties.file=C:\\Users\\babas\\AppData\\Roaming\\NetBeans\\8.2\\build.properties 3 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 24 16:42:40 CEST 2018 2 | excludes= 3 | javac.deprecation=false 4 | build.test.results.dir=${build.dir}/test/results 5 | run.classpath=${javac.classpath}\:${build.classes.dir} 6 | javadoc.nonavbar=false 7 | run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir} 8 | javac.target=1.6 9 | javadoc.noindex=false 10 | javadoc.additionalparam= 11 | includes=** 12 | build.classes.dir=${build.dir}/classes 13 | source.encoding=UTF-8 14 | javadoc.author=false 15 | test.src.dir=test 16 | build.dir=build 17 | build.test.classes.dir=${build.dir}/test/classes 18 | platform.active=default_platform 19 | javac.compilerargs= 20 | main.class=update.Main_Gui 21 | dist.jar=${dist.dir}/Update.jar 22 | javadoc.use=true 23 | build.sysclasspath=ignore 24 | debug.test.classpath=${run.test.classpath} 25 | dist.dir=dist 26 | build.classes.excludes=**/*.java,**/*.form 27 | javadoc.encoding=${source.encoding} 28 | javadoc.splitindex=true 29 | javac.source=1.6 30 | junit.selected.version=3 31 | debug.classpath=${run.classpath} 32 | run.jvmargs= 33 | build.generated.dir=${build.dir}/generated 34 | jar.compress=false 35 | javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:\:${libs.junit_4.classpath}\:${libs.hamcrest.classpath} 36 | javadoc.private=false 37 | meta.inf.dir=${src.dir}/META-INF 38 | manifest.file=manifest.mf 39 | dist.javadoc.dir=${dist.dir}/javadoc 40 | src.dir=src 41 | javac.classpath= 42 | build.generated.sources.dir=${build.dir}/generated-sources 43 | javadoc.version=false 44 | javadoc.windowtitle= 45 | javadoc.notree=false 46 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Update 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dev/JavaUpdater/Update/src/update/Main_Gui.java: -------------------------------------------------------------------------------- 1 | 2 | package update; 3 | 4 | import java.awt.BorderLayout; 5 | import java.awt.FlowLayout; 6 | import java.awt.event.ActionEvent; 7 | import java.awt.event.ActionListener; 8 | import java.io.BufferedInputStream; 9 | import java.io.BufferedOutputStream; 10 | import java.io.File; 11 | import java.io.FileInputStream; 12 | import java.io.FileNotFoundException; 13 | import java.io.FileOutputStream; 14 | import java.io.IOException; 15 | import java.io.InputStream; 16 | import java.io.OutputStream; 17 | import java.net.MalformedURLException; 18 | import java.net.URL; 19 | import java.net.URLConnection; 20 | import java.util.Enumeration; 21 | import java.util.zip.ZipEntry; 22 | import java.util.zip.ZipFile; 23 | import javax.swing.JButton; 24 | import javax.swing.JFrame; 25 | import javax.swing.JOptionPane; 26 | import javax.swing.JPanel; 27 | import javax.swing.JScrollPane; 28 | import javax.swing.JTextArea; 29 | 30 | 31 | /** 32 | * 33 | * @author Thomas Otero (H3R3T1C) 34 | */ 35 | public class Main_Gui extends JFrame{ 36 | 37 | private Thread worker; 38 | private final String root = "update/"; 39 | 40 | private JTextArea outText; 41 | private JButton cancle; 42 | private JButton launch; 43 | private JScrollPane sp; 44 | private JPanel pan1; 45 | private JPanel pan2; 46 | 47 | public Main_Gui() { 48 | initComponents(); 49 | outText.setText("Contacting Download Server..."); 50 | download(); 51 | } 52 | private void initComponents() { 53 | 54 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 55 | 56 | 57 | 58 | pan1 = new JPanel(); 59 | pan1.setLayout(new BorderLayout()); 60 | 61 | pan2 = new JPanel(); 62 | pan2.setLayout(new FlowLayout()); 63 | 64 | outText = new JTextArea(); 65 | sp = new JScrollPane(); 66 | sp.setViewportView(outText); 67 | 68 | launch = new JButton("Launch App"); 69 | launch.setEnabled(false); 70 | launch.addActionListener(new ActionListener(){ 71 | 72 | public void actionPerformed(ActionEvent e) { 73 | launch(); 74 | } 75 | }); 76 | pan2.add(launch); 77 | 78 | cancle = new JButton("Cancel Update"); 79 | cancle.addActionListener(new ActionListener(){ 80 | 81 | public void actionPerformed(ActionEvent e) { 82 | System.exit(0); 83 | } 84 | }); 85 | pan2.add(cancle); 86 | pan1.add(sp,BorderLayout.CENTER); 87 | pan1.add(pan2,BorderLayout.SOUTH); 88 | 89 | add(pan1); 90 | pack(); 91 | this.setSize(500, 400); 92 | } 93 | 94 | private void download() 95 | { 96 | worker = new Thread( 97 | new Runnable(){ 98 | public void run() 99 | { 100 | try { 101 | downloadFile(getDownloadLinkFromHost()); 102 | unzip(); 103 | copyFiles(new File(root),new File("").getAbsolutePath()); 104 | cleanup(); 105 | launch.setEnabled(true); 106 | outText.setText(outText.getText()+"\nUpdate Finished!"); 107 | } catch (Exception ex) { 108 | ex.printStackTrace(); 109 | JOptionPane.showMessageDialog(null, "An error occured while preforming update!"); 110 | } 111 | } 112 | }); 113 | worker.start(); 114 | } 115 | private void launch() 116 | { 117 | String[] run = {"java","-jar","update app.jar"}; 118 | try { 119 | Runtime.getRuntime().exec(run); 120 | } catch (Exception ex) { 121 | ex.printStackTrace(); 122 | } 123 | System.exit(0); 124 | } 125 | private void cleanup() 126 | { 127 | outText.setText(outText.getText()+"\nPreforming clean up..."); 128 | File f = new File("update.zip"); 129 | f.delete(); 130 | remove(new File(root)); 131 | new File(root).delete(); 132 | } 133 | private void remove(File f) 134 | { 135 | File[]files = f.listFiles(); 136 | for(File ff:files) 137 | { 138 | if(ff.isDirectory()) 139 | { 140 | remove(ff); 141 | ff.delete(); 142 | } 143 | else 144 | { 145 | ff.delete(); 146 | } 147 | } 148 | } 149 | private void copyFiles(File f,String dir) throws IOException 150 | { 151 | File[]files = f.listFiles(); 152 | for(File ff:files) 153 | { 154 | if(ff.isDirectory()){ 155 | new File(dir+"/"+ff.getName()).mkdir(); 156 | copyFiles(ff,dir+"/"+ff.getName()); 157 | } 158 | else 159 | { 160 | copy(ff.getAbsolutePath(),dir+"/"+ff.getName()); 161 | } 162 | 163 | } 164 | } 165 | public void copy(String srFile, String dtFile) throws FileNotFoundException, IOException{ 166 | 167 | File f1 = new File(srFile); 168 | File f2 = new File(dtFile); 169 | 170 | InputStream in = new FileInputStream(f1); 171 | 172 | OutputStream out = new FileOutputStream(f2); 173 | 174 | byte[] buf = new byte[1024]; 175 | int len; 176 | while ((len = in.read(buf)) > 0){ 177 | out.write(buf, 0, len); 178 | } 179 | in.close(); 180 | out.close(); 181 | } 182 | private void unzip() throws IOException 183 | { 184 | int BUFFER = 2048; 185 | BufferedOutputStream dest = null; 186 | BufferedInputStream is = null; 187 | ZipEntry entry; 188 | ZipFile zipfile = new ZipFile("update.zip"); 189 | Enumeration e = zipfile.entries(); 190 | (new File(root)).mkdir(); 191 | while(e.hasMoreElements()) { 192 | entry = (ZipEntry) e.nextElement(); 193 | outText.setText(outText.getText()+"\nExtracting: " +entry); 194 | if(entry.isDirectory()) 195 | (new File(root+entry.getName())).mkdir(); 196 | else{ 197 | (new File(root+entry.getName())).createNewFile(); 198 | is = new BufferedInputStream 199 | (zipfile.getInputStream(entry)); 200 | int count; 201 | byte data[] = new byte[BUFFER]; 202 | FileOutputStream fos = new 203 | FileOutputStream(root+entry.getName()); 204 | dest = new 205 | BufferedOutputStream(fos, BUFFER); 206 | while ((count = is.read(data, 0, BUFFER)) 207 | != -1) { 208 | dest.write(data, 0, count); 209 | } 210 | dest.flush(); 211 | dest.close(); 212 | is.close(); 213 | } 214 | } 215 | 216 | } 217 | private void downloadFile(String link) throws MalformedURLException, IOException 218 | { 219 | URL url = new URL(link); 220 | URLConnection conn = url.openConnection(); 221 | InputStream is = conn.getInputStream(); 222 | long max = conn.getContentLength(); 223 | outText.setText(outText.getText()+"\n"+"Downloding file...\nUpdate Size(compressed): "+max+" Bytes"); 224 | BufferedOutputStream fOut = new BufferedOutputStream(new FileOutputStream(new File("update.zip"))); 225 | byte[] buffer = new byte[32 * 1024]; 226 | int bytesRead = 0; 227 | int in = 0; 228 | while ((bytesRead = is.read(buffer)) != -1) { 229 | in += bytesRead; 230 | fOut.write(buffer, 0, bytesRead); 231 | } 232 | fOut.flush(); 233 | fOut.close(); 234 | is.close(); 235 | outText.setText(outText.getText()+"\nDownload Complete!"); 236 | 237 | } 238 | private String getDownloadLinkFromHost() throws MalformedURLException, IOException 239 | { 240 | String path = "http://h3r3t1cupdate.bravehost.com/url.html"; 241 | URL url = new URL(path); 242 | 243 | InputStream html = null; 244 | 245 | html = url.openStream(); 246 | 247 | int c = 0; 248 | StringBuilder buffer = new StringBuilder(""); 249 | 250 | while(c != -1) { 251 | c = html.read(); 252 | buffer.append((char)c); 253 | 254 | } 255 | return buffer.substring(buffer.indexOf("[url]")+5,buffer.indexOf("[/url]")); 256 | } 257 | public static void main(String args[]) { 258 | java.awt.EventQueue.invokeLater(new Runnable() { 259 | public void run() { 260 | new Main_Gui().setVisible(true); 261 | } 262 | }); 263 | } 264 | 265 | } 266 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project LedMatrixPlugin. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Thu, 15 Mar 2018 22:53:55 +0100 2 | 3 | 4 | F\:\\Logiciels\\Arduino_graphique\\BlocklyArduinoIDEPlugin\\LedMatrixEditor= 5 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/META-INF/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/META-INF/logo.png -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser$1.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser$2.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/Browser.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin$1.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin$2.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixPlugin.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/LedMatrixServer.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/StartupApplet$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/StartupApplet$1.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/build/classes/ledmatrixplugin/StartupApplet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/build/classes/ledmatrixplugin/StartupApplet.class -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/LedMatrixPlugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/dist/LedMatrixPlugin.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "LedMatrixPlugin.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/lib/arduino-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/dist/lib/arduino-core.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/dist/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/lib/jfxrt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/dist/lib/jfxrt.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/dist/lib/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/dist/lib/pde.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/lib/arduino-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/lib/arduino-core.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/lib/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/lib/pde.jar -------------------------------------------------------------------------------- /dev/LedMatrixEditor/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/configs/release.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/LedMatrixEditor/nbproject/configs/release.properties -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=8243e687 2 | build.xml.script.CRC32=440197ab 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=8243e687 7 | nbproject/build-impl.xml.script.CRC32=bc4d7ed3 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | config=release 2 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | file.reference.jfxrt.jar=C:\\Program Files (x86)\\Java\\jdk1.8.0_162\\jre\\lib\\ext\\jfxrt.jar 5 | javac.debug=true 6 | javadoc.preview=true 7 | user.properties.file=C:\\Users\\babas\\AppData\\Roaming\\NetBeans\\8.2\\build.properties 8 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/F:/Logiciels/Arduino_graphique/BlocklyArduinoIDEPlugin/LedMatrixEditor/src/ledmatrixplugin/Browser.java 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/private/profiler/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #org.netbeans.modules.profiler.v2.features.MonitorFeature@#org.netbeans.modules.profiler.v2.features.MethodsFeature@#org.netbeans.modules.profiler.v2.features.ThreadsFeature@ 6 | false 7 | 8 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/project.properties: -------------------------------------------------------------------------------- 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.desc=Plugin and method from Dwenguino : http://www.dwengo.org 7 | application.homepage=https://github.com/technologiescollege/Blockly-at-rduino 8 | application.splash=F:\\Logiciels\\Arduino_graphique\\Blockly-at-rduino\\media\\logo.png 9 | application.title=LedMatrixPlugin 10 | application.vendor=SebCanet 11 | auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml 12 | build.classes.dir=${build.dir}/classes 13 | build.classes.excludes=**/*.java,**/*.form 14 | # This directory is removed when the project is cleaned: 15 | build.dir=build 16 | build.generated.dir=${build.dir}/generated 17 | build.generated.sources.dir=${build.dir}/generated-sources 18 | # Only compile against the classpath explicitly listed here: 19 | build.sysclasspath=ignore 20 | build.test.classes.dir=${build.dir}/test/classes 21 | build.test.results.dir=${build.dir}/test/results 22 | # Uncomment to specify the preferred debugger connection transport: 23 | #debug.transport=dt_socket 24 | debug.classpath=\ 25 | ${run.classpath} 26 | debug.test.classpath=\ 27 | ${run.test.classpath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/LedMatrixPlugin.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | endorsed.classpath= 35 | excludes= 36 | file.reference.arduino-core.jar=lib/arduino-core.jar 37 | file.reference.commons-io-2.5.jar=lib/commons-io-2.5.jar 38 | file.reference.jfxrt.jar=/usr/lib/jvm/default-java/jre/lib/ext/jfxrt.jar 39 | file.reference.pde.jar=lib/pde.jar 40 | includes=** 41 | jar.archive.disabled=${jnlp.enabled} 42 | jar.compress=false 43 | jar.index=${jnlp.enabled} 44 | javac.classpath=\ 45 | ${file.reference.pde.jar}:\ 46 | ${file.reference.arduino-core.jar}:\ 47 | ${file.reference.commons-io-2.5.jar}:\ 48 | ${file.reference.jfxrt.jar} 49 | # Space-separated list of extra javac options 50 | javac.compilerargs= 51 | javac.deprecation=false 52 | javac.external.vm=true 53 | javac.processorpath=\ 54 | ${javac.classpath} 55 | javac.source=1.8 56 | javac.target=1.8 57 | javac.test.classpath=\ 58 | ${javac.classpath}:\ 59 | ${build.classes.dir} 60 | javac.test.processorpath=\ 61 | ${javac.test.classpath} 62 | javadoc.additionalparam= 63 | javadoc.author=false 64 | javadoc.encoding=${source.encoding} 65 | javadoc.noindex=false 66 | javadoc.nonavbar=false 67 | javadoc.notree=false 68 | javadoc.private=true 69 | javadoc.splitindex=true 70 | javadoc.use=true 71 | javadoc.version=false 72 | javadoc.windowtitle= 73 | jnlp.applet.class=blocklyarduinoplugin.StartupApplet 74 | jnlp.applet.height=300 75 | jnlp.applet.width=300 76 | jnlp.codebase.type=no.codebase 77 | jnlp.descriptor=application 78 | jnlp.enabled=false 79 | jnlp.mixed.code=default 80 | jnlp.offline-allowed=false 81 | jnlp.signed=false 82 | jnlp.signing= 83 | jnlp.signing.alias= 84 | jnlp.signing.keystore= 85 | main.class=blocklyarduinoplugin.BlocklyArduinoPlugin 86 | # Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. 87 | manifest.custom.application.library.allowable.codebase= 88 | # Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. 89 | manifest.custom.caller.allowable.codebase= 90 | # Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed 91 | manifest.custom.codebase= 92 | # Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) 93 | manifest.custom.permissions= 94 | manifest.file=manifest.mf 95 | meta.inf.dir=${src.dir}/META-INF 96 | mkdist.disabled=false 97 | platform.active=default_platform 98 | project.license=gpl30 99 | run.classpath=\ 100 | ${javac.classpath}:\ 101 | ${build.classes.dir} 102 | # Space-separated list of JVM arguments used when running the project. 103 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 104 | # To set system properties for unit tests define test-sys-prop.name=value: 105 | run.jvmargs= 106 | run.test.classpath=\ 107 | ${javac.test.classpath}:\ 108 | ${build.test.classes.dir} 109 | source.encoding=UTF-8 110 | src.dir=src 111 | test.src.dir=test 112 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | LedMatrixPlugin 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dev/LedMatrixEditor/src/ledmatrixplugin/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package ledmatrixplugin; 7 | 8 | import java.io.File; 9 | import java.io.FileWriter; 10 | import java.io.IOException; 11 | import java.util.Optional; 12 | import javafx.beans.value.ChangeListener; 13 | import javafx.beans.value.ObservableValue; 14 | import javafx.concurrent.Worker.State; 15 | import javafx.event.EventHandler; 16 | import javafx.geometry.HPos; 17 | import javafx.geometry.VPos; 18 | import javafx.scene.control.Alert; 19 | import javafx.scene.control.Alert.AlertType; 20 | import javafx.scene.layout.Region; 21 | import javafx.scene.web.PromptData; 22 | import javafx.scene.web.WebEngine; 23 | import javafx.scene.web.WebView; 24 | import netscape.javascript.JSObject; 25 | import processing.app.Editor; 26 | import javafx.scene.control.TextInputDialog; 27 | import javafx.scene.web.WebEvent; 28 | import javafx.scene.control.ButtonType; 29 | import javafx.scene.control.Dialog; 30 | 31 | /** 32 | * 33 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 34 | */ 35 | class Browser extends Region { 36 | 37 | public WebView browser = new WebView(); 38 | public WebEngine webEngine = browser.getEngine(); 39 | public LedMatrixServer serverObject; 40 | public ChangeListener changeListener; 41 | 42 | public Browser(Editor editor) { 43 | //apply the styles 44 | getStyleClass().add("browser"); 45 | 46 | changeListener = new ChangeListener() { 47 | @Override 48 | public void changed(ObservableValue ov, 49 | State oldState, State newState) { 50 | if (newState == State.SUCCEEDED) { 51 | // The JavaAppp class implements the JavaScript to Java bindings 52 | serverObject = new LedMatrixServer(editor, Browser.this.getScene().getWindow()); 53 | JSObject win = (JSObject) webEngine.executeScript("window"); 54 | win.setMember("LedMatrixServer", serverObject); 55 | }else{ 56 | } 57 | } 58 | }; 59 | 60 | // process page loading 61 | webEngine.getLoadWorker().stateProperty().addListener(changeListener); 62 | 63 | webEngine.setOnAlert(new EventHandler>() { 64 | @Override 65 | public void handle(WebEvent event) { 66 | Alert alert = new Alert(AlertType.INFORMATION); 67 | alert.setContentText(event.getData()); 68 | alert.showAndWait(); 69 | } 70 | }); 71 | 72 | //Set handler to handle browser promp events 73 | webEngine.setPromptHandler((PromptData param) -> { 74 | TextInputDialog prompt = new TextInputDialog(); 75 | prompt.setTitle("LedMatrixEditor"); 76 | Optional result = prompt.showAndWait(); 77 | return result.orElse(""); 78 | }); 79 | 80 | webEngine.setConfirmHandler((String message) -> { 81 | Dialog confirm = new Dialog<>(); 82 | confirm.getDialogPane().setContentText(message); 83 | confirm.getDialogPane().getButtonTypes().addAll(ButtonType.YES, ButtonType.NO); 84 | boolean result = confirm.showAndWait().filter(ButtonType.YES::equals).isPresent(); 85 | return result ; 86 | }); 87 | 88 | String baseurl = "file:" + getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); 89 | baseurl = baseurl.replace("\\", "/"); 90 | baseurl = baseurl.replace("LedMatrixPlugin.jar", ""); 91 | 92 | webEngine.load(baseurl + "led-matrix-editor/index.html"); 93 | 94 | //add the web view to the scene 95 | getChildren().add(browser); 96 | } 97 | 98 | @Override protected void layoutChildren() { 99 | double w = getWidth(); 100 | double h = getHeight(); 101 | layoutInArea(browser,0,0,w,h,0, HPos.CENTER, VPos.CENTER); 102 | } 103 | 104 | @Override protected double computePrefWidth(double height) { 105 | return 800; 106 | } 107 | 108 | @Override protected double computePrefHeight(double width) { 109 | return 600; 110 | } 111 | } -------------------------------------------------------------------------------- /dev/LedMatrixEditor/src/ledmatrixplugin/LedMatrixPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package ledmatrixplugin; 7 | 8 | import java.awt.BorderLayout; 9 | import java.awt.Dimension; 10 | import java.awt.event.WindowAdapter; 11 | import java.awt.event.WindowEvent; 12 | import java.text.NumberFormat; 13 | import javafx.application.Platform; 14 | import javafx.embed.swing.JFXPanel; 15 | import javafx.scene.Scene; 16 | import javafx.scene.paint.Color; 17 | import javax.swing.JFrame; 18 | import javax.swing.SwingUtilities; 19 | import javax.swing.UIManager; 20 | 21 | import processing.app.Editor; 22 | import processing.app.tools.Tool; 23 | import processing.app.Preferences; 24 | 25 | /** 26 | * 27 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 28 | */ 29 | public class LedMatrixPlugin implements Tool { 30 | 31 | public static Editor editor; 32 | 33 | public static long startTimestamp = 0; 34 | 35 | private final int JFXPANEL_WIDTH_INT = 1024; 36 | private final int JFXPANEL_HEIGHT_INT = 768; 37 | public String portId = Preferences.get("serial.port"); 38 | /** 39 | * @param args the command line arguments 40 | */ 41 | public static void main(String[] args) { 42 | LedMatrixPlugin.startApplication(); 43 | 44 | } 45 | 46 | public static void startApplication(){ 47 | startTimestamp = System.currentTimeMillis(); 48 | SwingUtilities.invokeLater(new Runnable() { 49 | 50 | @Override 51 | public void run() { 52 | Platform.setImplicitExit(false); 53 | LedMatrixPlugin plugin = new LedMatrixPlugin(); 54 | try { 55 | UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 56 | } catch (Exception e) { 57 | } 58 | 59 | try { 60 | plugin.initGUI(); 61 | }catch(NullPointerException ex){ 62 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 63 | } 64 | } 65 | }); 66 | } 67 | 68 | private JFrame window; 69 | private JFXPanel jfxPanel; 70 | private Browser browser; 71 | 72 | private void initGUI() { 73 | window = new JFrame(); 74 | window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 75 | window.setLayout(new BorderLayout()); 76 | window.setSize(1024, 768); 77 | window.setLocationRelativeTo(null); 78 | window.addWindowListener(new WindowAdapter() 79 | { 80 | @Override 81 | public void windowClosing(WindowEvent e) { 82 | SwingUtilities.invokeLater(() -> { 83 | Platform.runLater(() -> { 84 | //browser.webEngine.load("about:blank"); 85 | SwingUtilities.invokeLater(() -> { 86 | //System.out.println("test"); 87 | try{ 88 | e.getWindow().dispose(); 89 | }catch (NullPointerException ex){ 90 | //System.out.println("This is a bug in java: https://bugs.openjdk.java.net/browse/JDK-8089371"); 91 | } 92 | }); 93 | }); 94 | }); 95 | } 96 | }); 97 | 98 | jfxPanel = new JFXPanel(); 99 | jfxPanel.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT)); 100 | window.add(jfxPanel, BorderLayout.CENTER); 101 | window.setVisible(true); 102 | 103 | Platform.runLater(() -> { 104 | showBrowser(); 105 | }); 106 | } 107 | 108 | private void showBrowser() { 109 | try { 110 | browser = new Browser(editor); 111 | jfxPanel.setScene(new Scene(browser, 800, 600, Color.web("#666970"))); 112 | } catch (NullPointerException ex) { 113 | //System.out.println("Houston we have a problem"); 114 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 115 | } 116 | } 117 | 118 | public static void printMemoryUsage(){ 119 | Runtime runtime = Runtime.getRuntime(); 120 | NumberFormat format = NumberFormat.getInstance(); 121 | 122 | StringBuilder sb = new StringBuilder(); 123 | long maxMemory = runtime.maxMemory(); 124 | long allocatedMemory = runtime.totalMemory(); 125 | long freeMemory = runtime.freeMemory(); 126 | 127 | sb.append("free memory: " + format.format(freeMemory / 1024) + "
"); 128 | sb.append("allocated memory: " + format.format(allocatedMemory / 1024) + "
"); 129 | sb.append("max memory: " + format.format(maxMemory / 1024) + "
"); 130 | sb.append("total free memory: " + format.format((freeMemory + (maxMemory - allocatedMemory)) / 1024) + "
"); 131 | 132 | //System.out.println(sb.toString()); 133 | } 134 | 135 | @Override 136 | public void run() { 137 | try{ 138 | LedMatrixPlugin.editor.toFront(); 139 | // Fill in author.name, author.url, tool.prettyVersion and 140 | // project.prettyName in build.properties for them to be auto-replaced here. 141 | LedMatrixPlugin.startApplication(); 142 | }catch(NullPointerException ex){ 143 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 144 | } 145 | } 146 | 147 | @Override 148 | public String getMenuTitle() { 149 | return "LedMatrixEditor"; 150 | } 151 | 152 | @Override 153 | public void init(Editor editor) { 154 | LedMatrixPlugin.editor = editor; 155 | } 156 | } -------------------------------------------------------------------------------- /dev/LedMatrixEditor/src/ledmatrixplugin/LedMatrixServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package ledmatrixplugin; 7 | 8 | import java.io.BufferedReader; 9 | import java.io.BufferedWriter; 10 | import java.io.File; 11 | import java.io.FileNotFoundException; 12 | import java.io.FileReader; 13 | import java.io.FileWriter; 14 | import java.io.IOException; 15 | import java.io.PrintWriter; 16 | import java.util.logging.Level; 17 | import java.util.logging.Logger; 18 | import java.util.stream.Collectors; 19 | import javafx.application.Platform; 20 | import javafx.stage.FileChooser; 21 | import javafx.stage.Window; 22 | import javax.swing.SwingUtilities; 23 | 24 | import java.lang.reflect.InvocationTargetException; 25 | import processing.app.Editor; 26 | 27 | /** 28 | * 29 | * @author Tom for Dwenguino 30 | */ 31 | public class LedMatrixServer { 32 | 33 | private String lastOpenedLocation = System.getProperty("user.home"); 34 | private Editor editor; 35 | private Window ownerWindow; 36 | Runnable runHandler; 37 | Runnable presentHandler; 38 | 39 | public LedMatrixServer(Editor editor, Window ownerWindow){ 40 | this.editor = editor; 41 | this.ownerWindow = ownerWindow; 42 | } 43 | 44 | public void exit() { 45 | Platform.exit(); 46 | } 47 | } -------------------------------------------------------------------------------- /dev/LedMatrixEditor/src/ledmatrixplugin/StartupApplet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package ledmatrixplugin; 7 | 8 | import java.awt.BorderLayout; 9 | import java.awt.Dimension; 10 | import javafx.application.Platform; 11 | import javafx.embed.swing.JFXPanel; 12 | import javafx.scene.Scene; 13 | import javafx.scene.paint.Color; 14 | import javax.swing.JApplet; 15 | import javax.swing.SwingUtilities; 16 | import processing.app.Editor; 17 | 18 | /** 19 | * 20 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 21 | */ 22 | public class StartupApplet extends JApplet { 23 | 24 | private JFXPanel fxContainer; 25 | private final int JFXPANEL_WIDTH_INT = 1024; 26 | private final int JFXPANEL_HEIGHT_INT = 768; 27 | private Editor editor; 28 | private Thread activeThread; 29 | private Browser browser; 30 | 31 | public StartupApplet(Editor editor){ 32 | this.editor = editor; 33 | } 34 | 35 | @Override 36 | public void init() { 37 | LedMatrixPlugin.startTimestamp = System.currentTimeMillis(); 38 | fxContainer = new JFXPanel(); 39 | fxContainer.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT)); 40 | add(fxContainer, BorderLayout.CENTER); 41 | Platform.setImplicitExit(false); 42 | Runnable activeRunnable = new Runnable() { 43 | @Override 44 | public void run() { 45 | createScene(); 46 | } 47 | }; 48 | Platform.runLater(activeRunnable); 49 | } 50 | 51 | private void createScene() { 52 | browser = new Browser(editor); 53 | fxContainer.setScene(new Scene(browser, 1024, 768, Color.web("#666970"))); 54 | } 55 | 56 | @Override 57 | public void stop() { 58 | browser.webEngine.load("about:blank"); 59 | SwingUtilities.invokeLater(() -> { 60 | fxContainer.removeNotify(); 61 | }); 62 | } 63 | } -------------------------------------------------------------------------------- /dev/blocklyarduinoexe/BlocklyArduinoExe.java: -------------------------------------------------------------------------------- 1 | package blocklyarduino; 2 | 3 | import java.awt.Desktop; 4 | import java.io.IOException; 5 | import java.net.URI; 6 | import java.net.URISyntaxException; 7 | import processing.app.Editor; 8 | import processing.app.tools.Tool; 9 | 10 | 11 | public class BlocklyArduino implements Tool { 12 | Editor editor; 13 | 14 | public void init(Editor editor) { 15 | this.editor = editor; 16 | } 17 | 18 | public String getMenuTitle() { 19 | return "Blockly@rduino"; 20 | } 21 | 22 | public void run() { 23 | try { 24 | Runtime runtime = Runtime.getRuntime(); 25 | runtime.exec(new String[] { "F:/speedyfox.exe" } ); 26 | } catch (IOException e) { 27 | e.printStackTrace(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dev/blynkserver/BlynkServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/blynkserver/BlynkServer.class -------------------------------------------------------------------------------- /dev/blynkserver/BlynkServer.java: -------------------------------------------------------------------------------- 1 | package blynkserver; 2 | 3 | import java.awt.Desktop; 4 | import java.io.IOException; 5 | import java.net.URI; 6 | import java.net.URISyntaxException; 7 | import java.nio.file.Paths; 8 | import processing.app.Editor; 9 | import processing.app.tools.Tool; 10 | 11 | 12 | public class BlynkServer implements Tool { 13 | Editor editor; 14 | 15 | public void init(Editor editor) { 16 | this.editor = editor; 17 | } 18 | 19 | public String getMenuTitle() { 20 | return "Blynk"; 21 | } 22 | 23 | public void run() { 24 | try { 25 | String PathToExec = Paths.get(".").toAbsolutePath().normalize().toString(); 26 | //System.out.println("Current relative path is: " + PathToExec); 27 | Runtime runtime = Runtime.getRuntime(); 28 | Process p = Runtime.getRuntime().exec("cmd /c \"" + PathToExec + "\\tools\\BlynkServer\\tool\\server.bat" + "\""); 29 | } catch (IOException e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/AbstractLauncher.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javafx.application.Application; 4 | 5 | import javax.net.ssl.HostnameVerifier; 6 | import javax.net.ssl.HttpsURLConnection; 7 | import javax.net.ssl.SSLContext; 8 | import javax.net.ssl.TrustManager; 9 | import javax.net.ssl.X509TrustManager; 10 | import javax.xml.bind.JAXB; 11 | import java.io.File; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.OutputStream; 15 | import java.net.URI; 16 | import java.net.URL; 17 | import java.net.URLClassLoader; 18 | import java.net.URLConnection; 19 | import java.nio.charset.StandardCharsets; 20 | import java.nio.file.Files; 21 | import java.nio.file.Path; 22 | import java.security.KeyManagementException; 23 | import java.security.NoSuchAlgorithmException; 24 | import java.security.cert.CertificateException; 25 | import java.security.cert.X509Certificate; 26 | import java.util.Base64; 27 | import java.util.List; 28 | import java.util.Map; 29 | import java.util.logging.FileHandler; 30 | import java.util.logging.Level; 31 | import java.util.logging.Logger; 32 | import java.util.logging.SimpleFormatter; 33 | import java.util.stream.Collectors; 34 | 35 | @SuppressWarnings("unchecked") 36 | public abstract class AbstractLauncher { 37 | private static final Logger log = Logger.getLogger("AbstractLauncher"); 38 | 39 | protected static FXManifest manifest; 40 | private String phase; 41 | 42 | /** 43 | * Make java.util.logger log to a file. Default it will log to $TMPDIR/fxlauncher.log. This can be overriden by using 44 | * comman line parameter --logfile=logfile 45 | * 46 | * @throws IOException 47 | */ 48 | protected void setupLogFile() throws IOException { 49 | String filename = System.getProperty("java.io.tmpdir") + File.separator + "fxlauncher.log"; 50 | if (getParameters().getNamed().containsKey("logfile")) 51 | filename = getParameters().getNamed().get("logfile"); 52 | System.out.println("logging to " + filename); 53 | FileHandler handler = new FileHandler(filename); 54 | handler.setFormatter(new SimpleFormatter()); 55 | log.addHandler(handler); 56 | } 57 | 58 | /** 59 | * Check if the SSL connection needs to ignore the validity of the ssl certificate. 60 | * 61 | * @throws KeyManagementException 62 | * @throws NoSuchAlgorithmException 63 | */ 64 | protected void checkSSLIgnoreflag() throws KeyManagementException, NoSuchAlgorithmException { 65 | if (getParameters().getUnnamed().contains("--ignoressl")) { 66 | setupIgnoreSSLCertificate(); 67 | } 68 | } 69 | 70 | protected ClassLoader createClassLoader(Path cacheDir) { 71 | List libs = manifest.files.stream().filter(LibraryFile::loadForCurrentPlatform).map(it -> it.toURL(cacheDir)).collect(Collectors.toList()); 72 | 73 | ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); 74 | if (systemClassLoader instanceof FxlauncherClassCloader) 75 | { 76 | ((FxlauncherClassCloader) systemClassLoader).addUrls(libs); 77 | return systemClassLoader; 78 | } 79 | else 80 | { 81 | ClassLoader classLoader = new URLClassLoader(libs.toArray(new URL[libs.size()])); 82 | Thread.currentThread().setContextClassLoader(classLoader); 83 | 84 | setupClassLoader(classLoader); 85 | 86 | return classLoader; 87 | } 88 | } 89 | 90 | protected void updateManifest() throws Exception { 91 | phase = "Update Manifest"; 92 | syncManifest(); 93 | } 94 | 95 | /** 96 | * Check if remote files are newer then local files. Return true if files are updated, triggering the whatsnew option else false. 97 | * Also return false and do not check for updates if the --offline commandline argument is set. 98 | * 99 | * @return true if new files have been downloaded, false otherwise. 100 | * @throws Exception 101 | */ 102 | protected boolean syncFiles() throws Exception { 103 | 104 | Path cacheDir = manifest.resolveCacheDir(getParameters().getNamed()); 105 | log.info(String.format("Using cache dir %s", cacheDir)); 106 | 107 | phase = "File Synchronization"; 108 | 109 | if (getParameters().getUnnamed().contains("--offline")) { 110 | log.info("not updating files from remote, offline selected"); 111 | return false; // to signal that nothing has changed. 112 | } 113 | List needsUpdate = manifest.files.stream() 114 | .filter(LibraryFile::loadForCurrentPlatform) 115 | .filter(it -> it.needsUpdate(cacheDir)) 116 | .collect(Collectors.toList()); 117 | 118 | if (needsUpdate.isEmpty()) 119 | return false; 120 | 121 | Long totalBytes = needsUpdate.stream().mapToLong(f -> f.size).sum(); 122 | Long totalWritten = 0L; 123 | 124 | for (LibraryFile lib : needsUpdate) { 125 | Path target = cacheDir.resolve(lib.file).toAbsolutePath(); 126 | Files.createDirectories(target.getParent()); 127 | 128 | URI uri = manifest.uri.resolve(lib.file); 129 | 130 | try (InputStream input = openDownloadStream(uri); OutputStream output = Files.newOutputStream(target)) { 131 | 132 | byte[] buf = new byte[65536]; 133 | 134 | int read; 135 | while ((read = input.read(buf)) > -1) { 136 | output.write(buf, 0, read); 137 | totalWritten += read; 138 | Double progress = totalWritten.doubleValue() / totalBytes.doubleValue(); 139 | updateProgress(progress); 140 | } 141 | } 142 | } 143 | return true; 144 | } 145 | 146 | private InputStream openDownloadStream(URI uri) throws IOException { 147 | if (uri.getScheme().equals("file")) return Files.newInputStream(new File(uri.getPath()).toPath()); 148 | 149 | URLConnection connection = uri.toURL().openConnection(); 150 | if (uri.getUserInfo() != null) { 151 | byte[] payload = uri.getUserInfo().getBytes(StandardCharsets.UTF_8); 152 | String encoded = Base64.getEncoder().encodeToString(payload); 153 | connection.setRequestProperty("Authorization", String.format("Basic %s", encoded)); 154 | } 155 | return connection.getInputStream(); 156 | } 157 | 158 | protected void createApplicationEnvironment() throws Exception { 159 | phase = "Create Application"; 160 | 161 | if (manifest == null) 162 | throw new IllegalArgumentException("Unable to retrieve embedded or remote manifest."); 163 | List preloadLibs = manifest.getPreloadNativeLibraryList(); 164 | for (String preloadLib : preloadLibs) 165 | System.loadLibrary(preloadLib); 166 | 167 | Path cacheDir = manifest.resolveCacheDir(getParameters() != null ? getParameters().getNamed() : null); 168 | 169 | ClassLoader classLoader = createClassLoader(cacheDir); 170 | Class appclass = (Class) classLoader.loadClass(manifest.launchClass); 171 | 172 | createApplication(appclass); 173 | } 174 | 175 | protected void syncManifest() throws Exception { 176 | Map namedParams = getParameters().getNamed(); 177 | 178 | String appStr = null; 179 | 180 | if (namedParams.containsKey("app")) { 181 | // get --app-param 182 | appStr = namedParams.get("app"); 183 | log.info(String.format("Loading manifest from 'app' parameter supplied: %s", appStr)); 184 | } 185 | 186 | if (namedParams.containsKey("uri")) { 187 | // get --uri-param 188 | String uriStr = namedParams.get("uri"); 189 | if (!uriStr.endsWith("/")) { 190 | uriStr = uriStr + "/"; 191 | } 192 | log.info(String.format("Syncing files from 'uri' parameter supplied: %s", uriStr)); 193 | 194 | URI uri = URI.create(uriStr); 195 | // load manifest from --app param if supplied, else default file at supplied uri 196 | URI app = appStr != null ? URI.create(appStr) : uri.resolve("app.xml"); 197 | manifest = FXManifest.load(app); 198 | // set supplied uri in manifest 199 | manifest.uri = uri; 200 | return; 201 | } 202 | 203 | if (appStr != null) { 204 | // --uri was not supplied, but --app was, so load manifest from that 205 | manifest = FXManifest.load(new File(appStr).toURI()); 206 | return; 207 | } 208 | 209 | URL embeddedManifest = AbstractLauncher.class.getResource("/app.xml"); 210 | manifest = JAXB.unmarshal(embeddedManifest, FXManifest.class); 211 | 212 | Path cacheDir = manifest.resolveCacheDir(namedParams); 213 | Path manifestPath = manifest.getPath(cacheDir); 214 | 215 | if (Files.exists(manifestPath)) 216 | manifest = JAXB.unmarshal(manifestPath.toFile(), FXManifest.class); 217 | 218 | if (getParameters().getUnnamed().contains("--offline")) { 219 | log.info("offline selected"); 220 | return; 221 | } 222 | try { 223 | FXManifest remoteManifest = FXManifest.load(manifest.getFXAppURI()); 224 | 225 | if (remoteManifest == null) { 226 | log.info(String.format("No remote manifest at %s", manifest.getFXAppURI())); 227 | } else if (!remoteManifest.equals(manifest)) { 228 | // Update to remote manifest if newer or we specifically accept downgrades 229 | if (remoteManifest.isNewerThan(manifest) || manifest.acceptDowngrade) { 230 | manifest = remoteManifest; 231 | JAXB.marshal(manifest, manifestPath.toFile()); 232 | } 233 | } 234 | } catch (Exception ex) { 235 | log.log(Level.WARNING, String.format("Unable to update manifest from %s", manifest.getFXAppURI()), ex); 236 | } 237 | } 238 | 239 | protected void setupIgnoreSSLCertificate() throws NoSuchAlgorithmException, KeyManagementException { 240 | log.info("starting ssl setup"); 241 | TrustManager[] trustManager = new TrustManager[]{ 242 | new X509TrustManager() { 243 | @Override 244 | public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { 245 | } 246 | 247 | @Override 248 | public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { 249 | 250 | } 251 | 252 | @Override 253 | public X509Certificate[] getAcceptedIssuers() { 254 | return null; 255 | } 256 | }}; 257 | SSLContext sslContext = SSLContext.getInstance("SSL"); 258 | sslContext.init(null, trustManager, new java.security.SecureRandom()); 259 | HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); 260 | 261 | HostnameVerifier hostnameVerifier = (s, sslSession) -> true; 262 | HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier); 263 | } 264 | 265 | protected boolean checkIgnoreUpdateErrorSetting() { 266 | return getParameters().getUnnamed().contains("--stopOnUpdateErrors"); 267 | } 268 | public String getPhase() { 269 | return phase; 270 | } 271 | 272 | public void setPhase(String phase) { 273 | this.phase = phase; 274 | } 275 | 276 | public FXManifest getManifest() { 277 | return manifest; 278 | } 279 | 280 | protected abstract Application.Parameters getParameters(); 281 | protected abstract void updateProgress(double progress); 282 | protected abstract void createApplication(Class appClass); 283 | protected abstract void reportError(String title, Throwable error); 284 | protected abstract void setupClassLoader(ClassLoader classLoader); 285 | } 286 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/CreateManifest.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import com.sun.javafx.application.ParametersImpl; 4 | 5 | import javax.xml.bind.JAXB; 6 | import java.io.IOException; 7 | import java.net.URI; 8 | import java.net.URISyntaxException; 9 | import java.nio.file.*; 10 | import java.nio.file.attribute.BasicFileAttributes; 11 | import java.util.ArrayList; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.Map; 15 | import java.util.stream.Collectors; 16 | 17 | public class CreateManifest { 18 | private static ArrayList includeExtensions = new ArrayList<>(); 19 | 20 | static { 21 | includeExtensions.addAll(Arrays.asList("jar", "war")); 22 | } 23 | 24 | public static void main(String[] args) throws IOException, URISyntaxException { 25 | URI baseURI = URI.create(args[0]); 26 | String launchClass = args[1]; 27 | Path appPath = Paths.get(args[2]); 28 | 29 | String cacheDir = null; 30 | Boolean acceptDowngrade = null; 31 | Boolean stopOnUpdateErrors = null; 32 | String parameters = null; 33 | String whatsNew = null; 34 | String preloadNativeLibraries = null; 35 | Boolean lingeringUpdateScreen = false; 36 | Boolean stopOnUpdateErrorsDeprecated = null; 37 | 38 | if (args.length > 3) { 39 | // Parse named parameters 40 | List rawParams = new ArrayList<>(); 41 | rawParams.addAll(Arrays.asList(args).subList(3, args.length)); 42 | ParametersImpl params = new ParametersImpl(rawParams); 43 | Map named = params.getNamed(); 44 | 45 | if (named != null) { 46 | // Configure cacheDir 47 | if (named.containsKey("cache-dir")) 48 | cacheDir = named.get("cache-dir"); 49 | 50 | // Configure acceptDowngrade 51 | if (named.containsKey("accept-downgrade")) 52 | acceptDowngrade = Boolean.valueOf(named.get("accept-downgrade")); 53 | 54 | // Configure stopOnUpdateErrors 55 | if (named.containsKey("stop-on-update-errors")) 56 | stopOnUpdateErrors = Boolean.valueOf(named.get("stop-on-update-errors")); 57 | 58 | // Configure preload native libraries 59 | if (named.containsKey("preload-native-libraries")) 60 | preloadNativeLibraries = named.get("preload-native-libraries"); 61 | 62 | // Should the update screen stay until the primary stage is shown? 63 | if (named.containsKey("lingering-update-screen")) 64 | lingeringUpdateScreen = Boolean.valueOf(named.get("lingering-update-screen")); 65 | 66 | // Configure the whats-new option 67 | if (named.containsKey("whats-new")) 68 | whatsNew = named.get("whats-new"); 69 | 70 | // Add additional files with these extensions to manifest 71 | if (named.containsKey("include-extensions")) 72 | includeExtensions.addAll( 73 | Arrays.stream(named.get("include-extensions").split(",")) 74 | .filter(s -> s != null && !s.isEmpty()) 75 | .collect(Collectors.toList()) 76 | ); 77 | } 78 | 79 | // Append the rest as manifest parameters 80 | StringBuilder rest = new StringBuilder(); 81 | for (String raw : params.getRaw()) { 82 | // Special case for deprecated parameter. 83 | if (raw.equals("--stopOnUpdateErrors")) { 84 | stopOnUpdateErrorsDeprecated = true; 85 | continue; 86 | } 87 | if (raw.startsWith("--cache-dir=")) continue; 88 | if (raw.startsWith("--accept-downgrade=")) continue; 89 | if (raw.startsWith("--stop-on-update-errors=")) continue; 90 | if (raw.startsWith("--include-extensions=")) continue; 91 | if (raw.startsWith("--preload-native-libraries=")) continue; 92 | if (raw.startsWith("--whats-new")) continue; 93 | if (raw.startsWith("--lingering-update-screen")) continue; 94 | if (rest.length() > 0) rest.append(" "); 95 | rest.append(raw); 96 | } 97 | 98 | // Add the raw parameter string to the manifest 99 | if (rest.length() > 0) 100 | parameters = rest.toString(); 101 | } 102 | 103 | FXManifest manifest = create(baseURI, launchClass, appPath); 104 | if (cacheDir != null) manifest.cacheDir = cacheDir; 105 | if (acceptDowngrade != null) manifest.acceptDowngrade = acceptDowngrade; 106 | if (parameters != null) manifest.parameters = parameters; 107 | if (preloadNativeLibraries != null) manifest.preloadNativeLibraries = preloadNativeLibraries; 108 | if (whatsNew != null) manifest.whatsNewPage = whatsNew; 109 | manifest.lingeringUpdateScreen = lingeringUpdateScreen; 110 | 111 | // Use --stop-on-update-errors if it was specified. 112 | if (stopOnUpdateErrors != null) { 113 | manifest.stopOnUpdateErrors = stopOnUpdateErrors; 114 | // If --stopOnUpdateErrors is also present, display warning. 115 | if (stopOnUpdateErrorsDeprecated != null) { 116 | System.out.println("Warning: --stopOnUpdateErrors is deprecated. " 117 | + "Overriding with --stop-on-update-errors."); 118 | } 119 | } 120 | // If --stop-on-update-errors was not specified, 121 | // use --stopOnUpdateError if it was specified. 122 | else if (stopOnUpdateErrorsDeprecated != null){ 123 | manifest.stopOnUpdateErrors = stopOnUpdateErrorsDeprecated; 124 | System.out.println("Warning: --stopOnUpdateErrors is deprecated. " 125 | + "Use --stop-on-update-errors instead."); 126 | } 127 | JAXB.marshal(manifest, appPath.resolve("app.xml").toFile()); 128 | } 129 | 130 | public static FXManifest create(URI baseURI, String launchClass, Path appPath) throws IOException, URISyntaxException { 131 | FXManifest manifest = new FXManifest(); 132 | manifest.ts = System.currentTimeMillis(); 133 | manifest.uri = baseURI; 134 | manifest.launchClass = launchClass; 135 | 136 | if(!manifest.uri.getPath().endsWith("/")) { 137 | manifest.uri = new URI(String.format("%s/", baseURI.toString())); 138 | } 139 | Files.walkFileTree(appPath, new SimpleFileVisitor() { 140 | public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { 141 | if (!Files.isDirectory(file) && shouldIncludeInManifest(file) && !file.getFileName().toString().startsWith("fxlauncher")) 142 | manifest.files.add(new LibraryFile(appPath, file)); 143 | return FileVisitResult.CONTINUE; 144 | } 145 | }); 146 | 147 | return manifest; 148 | } 149 | 150 | /** 151 | * Add the includeExtensions to the default list of "war" and "jar". 152 | * 153 | * Allthough the method is called setIncludeExtensions, it actually does an addAll. 154 | * @param includeExtensions 155 | */ 156 | public static void setIncludeExtensions(List includeExtensions) { 157 | CreateManifest.includeExtensions.addAll(includeExtensions); 158 | } 159 | 160 | private static boolean shouldIncludeInManifest(Path file) { 161 | String filename = file.getFileName().toString(); 162 | for (String ext : includeExtensions) { 163 | if (filename.toLowerCase().endsWith(String.format(".%s", ext.toLowerCase()))) return true; 164 | } 165 | return false; 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/DefaultUIProvider.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javafx.geometry.Insets; 4 | import javafx.scene.Parent; 5 | import javafx.scene.control.Label; 6 | import javafx.scene.control.ProgressBar; 7 | import javafx.scene.control.ProgressIndicator; 8 | import javafx.scene.layout.StackPane; 9 | import javafx.scene.layout.VBox; 10 | import javafx.stage.Stage; 11 | 12 | public class DefaultUIProvider implements UIProvider { 13 | private ProgressBar progressBar; 14 | 15 | public Parent createLoader() { 16 | StackPane root = new StackPane(new ProgressIndicator()); 17 | root.setPrefSize(200, 80); 18 | root.setPadding(new Insets(10)); 19 | return root; 20 | } 21 | 22 | public Parent createUpdater(FXManifest manifest) { 23 | progressBar = new ProgressBar(); 24 | progressBar.setStyle(manifest.progressBarStyle); 25 | 26 | Label label = new Label(manifest.updateText); 27 | label.setStyle(manifest.updateLabelStyle); 28 | 29 | VBox wrapper = new VBox(label, progressBar); 30 | wrapper.setStyle(manifest.wrapperStyle); 31 | 32 | return wrapper; 33 | } 34 | 35 | public void updateProgress(double progress) { 36 | progressBar.setProgress(progress); 37 | } 38 | 39 | public void init(Stage stage) { 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/FXManifest.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javax.xml.bind.JAXB; 4 | import javax.xml.bind.annotation.XmlAttribute; 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | import java.net.URI; 11 | import java.net.URLConnection; 12 | import java.nio.charset.StandardCharsets; 13 | import java.nio.file.Files; 14 | import java.nio.file.Path; 15 | import java.nio.file.Paths; 16 | import java.util.ArrayList; 17 | import java.util.Arrays; 18 | import java.util.Base64; 19 | import java.util.Collections; 20 | import java.util.List; 21 | import java.util.Map; 22 | import java.util.Objects; 23 | 24 | @SuppressWarnings("unchecked") 25 | @XmlRootElement(name = "Application") 26 | public class FXManifest { 27 | @XmlAttribute 28 | public Long ts; 29 | @XmlAttribute 30 | public URI uri; 31 | @XmlAttribute(name = "launch") 32 | public String launchClass; 33 | @XmlElement(name = "lib") 34 | public List files = new ArrayList<>(); 35 | @XmlElement 36 | public String updateText = "Updating..."; 37 | @XmlElement 38 | public String updateLabelStyle = "-fx-font-weight: bold;"; 39 | @XmlElement 40 | public String progressBarStyle = "-fx-pref-width: 200;"; 41 | @XmlElement 42 | public String wrapperStyle = "-fx-spacing: 10; -fx-padding: 25;"; 43 | @XmlElement 44 | public String parameters; 45 | @XmlElement 46 | public String cacheDir; 47 | @XmlElement 48 | public Boolean acceptDowngrade = false; 49 | @XmlElement 50 | public Boolean stopOnUpdateErrors = false; 51 | @XmlElement 52 | public String preloadNativeLibraries; 53 | @XmlElement 54 | public String whatsNewPage; 55 | @XmlElement 56 | public Boolean lingeringUpdateScreen = false; 57 | 58 | public List getPreloadNativeLibraryList() { 59 | if (preloadNativeLibraries == null || preloadNativeLibraries.isEmpty()) return Collections.emptyList(); 60 | return Arrays.asList(preloadNativeLibraries.split(".*,-*")); 61 | } 62 | 63 | public String getFilename() { 64 | return String.format("%s.xml", launchClass); 65 | } 66 | 67 | public URI getFXAppURI() { 68 | if (uri.getPath().endsWith("/")) 69 | return uri.resolve("app.xml"); 70 | 71 | return URI.create(uri.toString() + "/app.xml"); 72 | } 73 | 74 | public Path getPath(Path cacheDir) { 75 | return cacheDir.resolve(getFilename()); 76 | } 77 | 78 | public Path resolveCacheDir(Map namedParams) { 79 | if (namedParams == null) namedParams = Collections.emptyMap(); 80 | 81 | String cacheDir = namedParams.containsKey("cache-dir") ? namedParams.get("cache-dir") : this.cacheDir; 82 | 83 | if (cacheDir == null || cacheDir.isEmpty()) return Paths.get("."); 84 | 85 | Path path; 86 | 87 | if (cacheDir.contains("USERLIB")) { 88 | String replacement; 89 | switch (OS.current) { 90 | case mac: 91 | replacement = Paths.get(System.getProperty("user.home")) 92 | .resolve("Library") 93 | .resolve("Application Support") 94 | .resolve(cacheDir.substring(8)) 95 | .toString(); 96 | break; 97 | case win: 98 | replacement = Paths.get(System.getProperty("user.home")) 99 | .resolve("AppData") 100 | .resolve("Local") 101 | .resolve(cacheDir.substring(8)) 102 | .toString(); 103 | break; 104 | default: 105 | replacement = Paths.get(System.getProperty("user.home")) 106 | .resolve("." + cacheDir.substring(8)) 107 | .toString(); 108 | } 109 | path = Paths.get(replacement); 110 | } else if (cacheDir.startsWith("ALLUSERS")) { 111 | switch (OS.current) { 112 | case mac: 113 | path = Paths.get("/Library/Application Support") 114 | .resolve(cacheDir.substring(9)); 115 | break; 116 | case win: 117 | path = Paths.get(System.getenv("ALLUSERSPROFILE")) 118 | .resolve(cacheDir.substring(9)); 119 | break; 120 | default: 121 | path = Paths.get("/usr/local/share") 122 | .resolve(cacheDir.substring(9)); 123 | } 124 | } else { 125 | path = Paths.get(cacheDir); 126 | } 127 | 128 | if (!Files.exists(path)) { 129 | try { 130 | Files.createDirectories(path); 131 | } catch (IOException e) { 132 | throw new RuntimeException(e); 133 | } 134 | } 135 | 136 | return path; 137 | } 138 | 139 | public String getWhatsNewPage() 140 | { 141 | return whatsNewPage; 142 | } 143 | 144 | @Override 145 | public boolean equals(Object o) { 146 | if (this == o) return true; 147 | if (o == null || getClass() != o.getClass()) return false; 148 | 149 | FXManifest that = (FXManifest) o; 150 | 151 | if (ts != null ? !ts.equals(that.ts) : that.ts != null) return false; 152 | if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; 153 | if (launchClass != null ? !launchClass.equals(that.launchClass) : that.launchClass != null) return false; 154 | if (files != null ? !files.equals(that.files) : that.files != null) return false; 155 | if (updateText != null ? !updateText.equals(that.updateText) : that.updateText != null) return false; 156 | if (updateLabelStyle != null ? !updateLabelStyle.equals(that.updateLabelStyle) : that.updateLabelStyle != null) return false; 157 | if (progressBarStyle != null ? !progressBarStyle.equals(that.progressBarStyle) : that.progressBarStyle != null) return false; 158 | if (wrapperStyle != null ? !wrapperStyle.equals(that.wrapperStyle) : that.wrapperStyle != null) return false; 159 | if (parameters != null ? !parameters.equals(that.parameters) : that.parameters != null) return false; 160 | if (cacheDir != null ? !cacheDir.equals(that.cacheDir) : that.cacheDir != null) return false; 161 | if (lingeringUpdateScreen != null ? !lingeringUpdateScreen.equals(that.lingeringUpdateScreen) : that.lingeringUpdateScreen != null) return false; 162 | if (stopOnUpdateErrors != null ? !stopOnUpdateErrors.equals(that.stopOnUpdateErrors) : that.stopOnUpdateErrors != null) return false; 163 | return acceptDowngrade != null ? acceptDowngrade.equals(that.acceptDowngrade) : that.acceptDowngrade == null; 164 | 165 | } 166 | 167 | @Override 168 | public int hashCode() { 169 | int result = ts != null ? ts.hashCode() : 0; 170 | result = 31 * result + (uri != null ? uri.hashCode() : 0); 171 | result = 31 * result + (launchClass != null ? launchClass.hashCode() : 0); 172 | result = 31 * result + (files != null ? files.hashCode() : 0); 173 | result = 31 * result + (updateText != null ? updateText.hashCode() : 0); 174 | result = 31 * result + (updateLabelStyle != null ? updateLabelStyle.hashCode() : 0); 175 | result = 31 * result + (progressBarStyle != null ? progressBarStyle.hashCode() : 0); 176 | result = 31 * result + (wrapperStyle != null ? wrapperStyle.hashCode() : 0); 177 | result = 31 * result + (parameters != null ? parameters.hashCode() : 0); 178 | result = 31 * result + (cacheDir != null ? cacheDir.hashCode() : 0); 179 | result = 31 * result + (acceptDowngrade != null ? acceptDowngrade.hashCode() : 0); 180 | result = 31 * result + (stopOnUpdateErrors != null ? stopOnUpdateErrors.hashCode() : 0); 181 | return result; 182 | } 183 | 184 | public boolean isNewerThan(FXManifest other) { 185 | return ts == null || other.ts == null || ts > other.ts; 186 | } 187 | 188 | static FXManifest load(URI uri) throws IOException { 189 | if (Objects.equals(uri.getScheme(), "file")) { 190 | return JAXB.unmarshal(new File(uri.getPath()), FXManifest.class); 191 | } 192 | URLConnection connection = uri.toURL().openConnection(); 193 | if (uri.getUserInfo() != null) { 194 | byte[] payload = uri.getUserInfo().getBytes(StandardCharsets.UTF_8); 195 | String encoded = Base64.getEncoder().encodeToString(payload); 196 | connection.setRequestProperty("Authorization", String.format("Basic %s", encoded)); 197 | } 198 | try (InputStream input = connection.getInputStream()) { 199 | return JAXB.unmarshal(input, FXManifest.class); 200 | } 201 | } 202 | 203 | } 204 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/FxlauncherClassCloader.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import java.io.File; 4 | import java.net.MalformedURLException; 5 | import java.net.URL; 6 | import java.net.URLClassLoader; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by im on 22.02.17. 12 | */ 13 | public class FxlauncherClassCloader extends URLClassLoader 14 | { 15 | public FxlauncherClassCloader(ClassLoader parentClassLoader) 16 | { 17 | super(buildClasspath(System.getProperty("java.class.path")), parentClassLoader); 18 | } 19 | 20 | void addUrls(List urls) 21 | { 22 | for (URL url : urls) 23 | { 24 | this.addURL(url); 25 | } 26 | } 27 | 28 | private static URL[] buildClasspath(String classPath) 29 | { 30 | if (classPath == null || classPath.trim().length() < 1) 31 | { 32 | return new URL[0]; 33 | } 34 | 35 | List urls = new ArrayList<>(); 36 | 37 | int pos; 38 | while ((pos = classPath.indexOf(File.pathSeparatorChar)) > -1) 39 | { 40 | String part = classPath.substring(0, pos); 41 | 42 | addClasspathPart(urls, part); 43 | 44 | classPath = classPath.substring(pos + 1); 45 | } 46 | 47 | addClasspathPart(urls, classPath); 48 | 49 | return urls.toArray(new URL[urls.size()]); 50 | } 51 | 52 | private static void addClasspathPart(List urls, String part) 53 | { 54 | if (part == null || part.trim().length() < 1) 55 | { 56 | return; 57 | } 58 | 59 | try 60 | { 61 | urls.add(new File(part).toURI().toURL()); 62 | } 63 | catch (MalformedURLException e) 64 | { 65 | throw new RuntimeException(e); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/HeadlessMainLauncher.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javafx.application.Application; 4 | 5 | import java.lang.reflect.Method; 6 | import java.util.Arrays; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.logging.Level; 10 | import java.util.logging.Logger; 11 | 12 | @SuppressWarnings("unchecked") 13 | public class HeadlessMainLauncher extends AbstractLauncher 14 | { 15 | private static final Logger log = Logger.getLogger("HeadlessMainLauncher"); 16 | 17 | private LauncherParams parameters; 18 | 19 | private Class appClass; 20 | 21 | public HeadlessMainLauncher(LauncherParams parameters) 22 | { 23 | this.parameters = parameters; 24 | } 25 | 26 | public static void main(String[] args) throws Exception 27 | { 28 | List mainArgs = Arrays.asList(args); 29 | 30 | LauncherParams parameters = new LauncherParams(mainArgs); 31 | 32 | HeadlessMainLauncher headlessMainLauncher = new HeadlessMainLauncher(parameters); 33 | headlessMainLauncher.process(); 34 | } 35 | 36 | protected void process() throws Exception 37 | { 38 | syncManifest(); 39 | 40 | // replace parameters to deal with manifest settings 41 | parameters = new LauncherParams(parameters, getManifest()); 42 | 43 | setupLogFile(); 44 | checkSSLIgnoreflag(); 45 | 46 | updateManifest(); 47 | 48 | syncFiles(); 49 | 50 | createApplicationEnvironment(); 51 | launchApp(); 52 | } 53 | 54 | public LauncherParams getParameters() 55 | { 56 | return parameters; 57 | } 58 | 59 | @Override 60 | protected void updateProgress(double progress) 61 | { 62 | log.info(String.format("Progress: %d%%", (int) (progress * 100))); 63 | } 64 | 65 | @Override 66 | protected void createApplication(Class appClass) 67 | { 68 | this.appClass = appClass; 69 | } 70 | 71 | private void launchApp() throws Exception 72 | { 73 | setPhase("Application Start"); 74 | 75 | Method mainMethod = appClass.getMethod("main", String[].class); 76 | mainMethod.invoke(null, (Object) new String[0]); 77 | } 78 | 79 | protected void reportError(String title, Throwable error) 80 | { 81 | log.log(Level.SEVERE, title, error); 82 | } 83 | 84 | @Override 85 | protected void setupClassLoader(ClassLoader classLoader) 86 | { 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/Launcher.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import com.sun.javafx.application.ParametersImpl; 4 | import com.sun.javafx.application.PlatformImpl; 5 | import javafx.application.Application; 6 | import javafx.application.Platform; 7 | import javafx.fxml.FXMLLoader; 8 | import javafx.scene.Parent; 9 | import javafx.scene.Scene; 10 | import javafx.scene.control.Alert; 11 | import javafx.scene.control.TextArea; 12 | import javafx.scene.layout.StackPane; 13 | import javafx.scene.web.WebView; 14 | import javafx.stage.Stage; 15 | import javafx.stage.StageStyle; 16 | 17 | import java.io.*; 18 | import java.net.URI; 19 | import java.nio.file.Path; 20 | import java.util.*; 21 | import java.util.logging.Level; 22 | import java.util.logging.Logger; 23 | 24 | @SuppressWarnings("unchecked") 25 | public class Launcher extends Application { 26 | private static final Logger log = Logger.getLogger("Launcher"); 27 | 28 | private Application app; 29 | private Stage primaryStage; 30 | private Stage stage; 31 | private UIProvider uiProvider; 32 | private StackPane root; 33 | 34 | private final AbstractLauncher superLauncher = new AbstractLauncher() { 35 | @Override 36 | protected Parameters getParameters() { 37 | return Launcher.this.getParameters(); 38 | } 39 | 40 | @Override 41 | protected void updateProgress(double progress) { 42 | Platform.runLater(() -> uiProvider.updateProgress(progress)); 43 | } 44 | 45 | @Override 46 | protected void createApplication(Class appClass) { 47 | PlatformImpl.runAndWait(() -> 48 | { 49 | try { 50 | if (Application.class.isAssignableFrom(appClass)) { 51 | app = appClass.newInstance(); 52 | } 53 | } catch (Throwable t) { 54 | reportError("Error creating app class", t); 55 | } 56 | }); 57 | } 58 | 59 | @Override 60 | protected void reportError(String title, Throwable error) { 61 | log.log(Level.WARNING, title, error); 62 | 63 | Platform.runLater(() -> 64 | { 65 | Alert alert = new Alert(Alert.AlertType.ERROR); 66 | alert.setTitle(title); 67 | alert.setHeaderText(String.format("%s\ncheck the logfile 'fxlauncher.log, usually in the %s directory", title, System.getProperty("java.io.tmpdir"))); 68 | // alert.setHeaderText(title+"\nCheck the logfile usually in the "+System.getProperty("java.io.tmpdir") + "directory"); 69 | alert.getDialogPane().setPrefWidth(600); 70 | 71 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 72 | PrintWriter writer = new PrintWriter(out); 73 | error.printStackTrace(writer); 74 | writer.close(); 75 | TextArea text = new TextArea(out.toString()); 76 | alert.getDialogPane().setContent(text); 77 | 78 | alert.showAndWait(); 79 | Platform.exit(); 80 | }); 81 | } 82 | 83 | @Override 84 | protected void setupClassLoader(ClassLoader classLoader) { 85 | FXMLLoader.setDefaultClassLoader(classLoader); 86 | Platform.runLater(() -> Thread.currentThread().setContextClassLoader(classLoader)); 87 | } 88 | 89 | 90 | }; 91 | 92 | /** 93 | * Check if a new version is available and return the manifest for the new version or null if no update. 94 | *

95 | * Note that updates will only be detected if the application was actually launched with FXLauncher. 96 | * 97 | * @return The manifest for the new version if available 98 | */ 99 | public static FXManifest checkForUpdate() throws IOException { 100 | // We might be called even when FXLauncher wasn't used to start the application 101 | if (AbstractLauncher.manifest == null) return null; 102 | FXManifest manifest = FXManifest.load(URI.create(AbstractLauncher.manifest.uri + "/app.xml")); 103 | return manifest.equals(AbstractLauncher.manifest) ? null : manifest; 104 | } 105 | 106 | 107 | /** 108 | * Initialize the UI Provider by looking for an UIProvider inside the launcher 109 | * or fallback to the default UI. 110 | *

111 | * A custom implementation must be embedded inside the launcher jar, and 112 | * /META-INF/services/fxlauncher.UIProvider must point to the new implementation class. 113 | *

114 | * You must do this manually/in your build right around the "embed manifest" step. 115 | */ 116 | public void init() throws Exception { 117 | Iterator providers = ServiceLoader.load(UIProvider.class).iterator(); 118 | uiProvider = providers.hasNext() ? providers.next() : new DefaultUIProvider(); 119 | } 120 | 121 | public void start(Stage primaryStage) throws Exception { 122 | this.primaryStage = primaryStage; 123 | stage = new Stage(StageStyle.UNDECORATED); 124 | root = new StackPane(); 125 | final boolean[] filesUpdated = new boolean[1]; 126 | 127 | Scene scene = new Scene(root); 128 | stage.setScene(scene); 129 | 130 | superLauncher.setupLogFile(); 131 | superLauncher.checkSSLIgnoreflag(); 132 | this.uiProvider.init(stage); 133 | root.getChildren().add(uiProvider.createLoader()); 134 | 135 | stage.show(); 136 | 137 | new Thread(() -> { 138 | Thread.currentThread().setName("FXLauncher-Thread"); 139 | try { 140 | superLauncher.updateManifest(); 141 | createUpdateWrapper(); 142 | filesUpdated[0] = superLauncher.syncFiles(); 143 | } catch (Exception ex) { 144 | log.log(Level.WARNING, String.format("Error during %s phase", superLauncher.getPhase()), ex); 145 | if (superLauncher.checkIgnoreUpdateErrorSetting()) { 146 | superLauncher.reportError(String.format("Error during %s phase", superLauncher.getPhase()), ex); 147 | System.exit(1); 148 | } 149 | } 150 | 151 | try { 152 | superLauncher.createApplicationEnvironment(); 153 | launchAppFromManifest(filesUpdated[0]); 154 | } catch (Exception ex) { 155 | superLauncher.reportError(String.format("Error during %s phase", superLauncher.getPhase()), ex); 156 | } 157 | 158 | }).start(); 159 | } 160 | 161 | private void launchAppFromManifest(boolean showWhatsnew) throws Exception { 162 | superLauncher.setPhase("Application Environment Prepare"); 163 | 164 | try { 165 | initApplication(); 166 | } catch (Throwable ex) { 167 | superLauncher.reportError("Error during app init", ex); 168 | } 169 | superLauncher.setPhase("Application Start"); 170 | log.info("Show whats new dialog? " + showWhatsnew); 171 | 172 | PlatformImpl.runAndWait(() -> 173 | { 174 | try { 175 | if (showWhatsnew && superLauncher.getManifest().whatsNewPage != null) 176 | showWhatsNewDialog(superLauncher.getManifest().whatsNewPage); 177 | 178 | // Lingering update screen will close when primary stage is shown 179 | if (superLauncher.getManifest().lingeringUpdateScreen) { 180 | primaryStage.showingProperty().addListener(observable -> { 181 | if (stage.isShowing()) 182 | stage.close(); 183 | }); 184 | } else { 185 | stage.close(); 186 | } 187 | 188 | startApplication(); 189 | } catch (Throwable ex) { 190 | superLauncher.reportError("Failed to start application", ex); 191 | } 192 | }); 193 | } 194 | 195 | private void showWhatsNewDialog(String whatsNewPage) { 196 | WebView view = new WebView(); 197 | view.getEngine().load(Launcher.class.getResource(whatsNewPage).toExternalForm()); 198 | Alert alert = new Alert(Alert.AlertType.INFORMATION); 199 | alert.setTitle("What's new"); 200 | alert.setHeaderText("New in this update"); 201 | alert.getDialogPane().setContent(view); 202 | alert.showAndWait(); 203 | } 204 | 205 | public static void main(String[] args) { 206 | launch(args); 207 | } 208 | 209 | private void createUpdateWrapper() { 210 | superLauncher.setPhase("Update Wrapper Creation"); 211 | 212 | Platform.runLater(() -> 213 | { 214 | Parent updater = uiProvider.createUpdater(superLauncher.getManifest()); 215 | root.getChildren().clear(); 216 | root.getChildren().add(updater); 217 | }); 218 | } 219 | 220 | public void stop() throws Exception { 221 | if (app != null) 222 | app.stop(); 223 | } 224 | 225 | private void initApplication() throws Exception { 226 | if (app != null) { 227 | app.init(); 228 | } 229 | } 230 | 231 | private void startApplication() throws Exception { 232 | if (app != null) { 233 | ParametersImpl.registerParameters(app, new LauncherParams(getParameters(), superLauncher.getManifest())); 234 | PlatformImpl.setApplicationName(app.getClass()); 235 | superLauncher.setPhase("Application Init"); 236 | app.start(primaryStage); 237 | } else { 238 | // Start any executable jar (i.E. Spring Boot); 239 | List files = superLauncher.getManifest().files; 240 | String cacheDir = superLauncher.getManifest().cacheDir; 241 | String command = String.format("java -jar %s/%s", cacheDir, files.get(0).file); 242 | log.info(String.format("Execute command '%s'", command)); 243 | Runtime.getRuntime().exec(command); 244 | } 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/LauncherParams.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javafx.application.Application; 4 | 5 | import java.util.ArrayList; 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.stream.Collectors; 10 | 11 | /** 12 | * Implementation Application.Parameters that wraps the parameters given to the application 13 | * at startup, and adds any manifest configured parameters unless they were overriden 14 | * by the command line. 15 | */ 16 | public class LauncherParams extends Application.Parameters { 17 | private final List rawArgs = new ArrayList<>(); 18 | private final Map namedParams = new HashMap<>(); 19 | private final List unnamedParams = new ArrayList<>(); 20 | 21 | public LauncherParams(List rawArgs) { 22 | this.rawArgs.addAll(rawArgs); 23 | computeParams(); 24 | } 25 | 26 | public LauncherParams(Application.Parameters delegate, FXManifest manifest) { 27 | // Add all raw args from the parent application 28 | rawArgs.addAll(delegate.getRaw()); 29 | 30 | // Add parameters from the manifest unless they were already specified on the command line 31 | if (manifest.parameters != null) { 32 | for (String arg : manifest.parameters.split("\\s")) { 33 | if (arg != null) { 34 | if (rawArgs.contains(arg)) 35 | continue; 36 | 37 | if (arg.startsWith("--") && arg.contains("=")) { 38 | String argname = arg.substring(0, arg.indexOf("=")); 39 | if (rawArgs.stream().filter(a -> a.startsWith(argname)).findAny().isPresent()) 40 | continue; 41 | } 42 | 43 | rawArgs.add(arg); 44 | } 45 | } 46 | } 47 | 48 | computeParams(); 49 | } 50 | 51 | private void computeParams() { 52 | // Compute named and unnamed parameters 53 | computeNamedParams(); 54 | computeUnnamedParams(); 55 | } 56 | 57 | public List getRaw() { 58 | return rawArgs; 59 | } 60 | 61 | public List getUnnamed() { 62 | return unnamedParams; 63 | } 64 | 65 | public Map getNamed() { 66 | return namedParams; 67 | } 68 | 69 | /** 70 | * Returns true if the specified string is a named parameter of the 71 | * form: --name=value 72 | * 73 | * @param arg the string to check 74 | * @return true if the string matches the pattern for a named parameter. 75 | */ 76 | private boolean isNamedParam(String arg) { 77 | return arg.startsWith("--") && (arg.indexOf('=') > 2 && validFirstChar(arg.charAt(2))); 78 | } 79 | 80 | /** 81 | * This method parses the current array of raw arguments looking for 82 | * name,value pairs. These name,value pairs are then added to the map 83 | * for this parameters object, and are of the form: --name=value. 84 | */ 85 | private void computeNamedParams() { 86 | rawArgs.stream().filter(this::isNamedParam).forEach(arg -> { 87 | final int eqIdx = arg.indexOf('='); 88 | String key = arg.substring(2, eqIdx); 89 | String value = arg.substring(eqIdx + 1); 90 | namedParams.put(key, value); 91 | }); 92 | } 93 | /** 94 | * This method computes the list of unnamed parameters, by filtering the 95 | * list of raw arguments, stripping out the named parameters. 96 | */ 97 | private void computeUnnamedParams() { 98 | unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList())); 99 | } 100 | 101 | /** 102 | * Validate the first character of a key. It is valid if it is a letter or 103 | * an "_" character. 104 | * 105 | * @param c the first char of a key string 106 | * @return whether or not it is valid 107 | */ 108 | private boolean validFirstChar(char c) { 109 | return Character.isLetter(c) || c == '_'; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/LibraryFile.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javax.xml.bind.annotation.XmlAttribute; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.net.MalformedURLException; 7 | import java.net.URL; 8 | import java.nio.file.Files; 9 | import java.nio.file.Path; 10 | import java.util.regex.Matcher; 11 | import java.util.regex.Pattern; 12 | import java.util.zip.Adler32; 13 | 14 | public class LibraryFile { 15 | @XmlAttribute 16 | String file; 17 | @XmlAttribute 18 | Long checksum; 19 | @XmlAttribute 20 | Long size; 21 | @XmlAttribute 22 | OS os; 23 | 24 | public boolean needsUpdate(Path cacheDir) { 25 | Path path = cacheDir.resolve(file); 26 | try { 27 | return !Files.exists(path) || Files.size(path) != size || checksum(path) != checksum; 28 | } catch (IOException e) { 29 | throw new RuntimeException(e); 30 | } 31 | } 32 | 33 | public LibraryFile() { 34 | } 35 | 36 | public LibraryFile(Path basepath, Path file) throws IOException { 37 | this.file = basepath.relativize(file).toString().replace("\\", "/"); 38 | this.size = Files.size(file); 39 | this.checksum = checksum(file); 40 | 41 | String filename = file.getFileName().toString().toLowerCase(); 42 | Pattern osPattern = Pattern.compile(".+-(linux|win|mac)\\.[^.]+$"); 43 | Matcher osMatcher = osPattern.matcher(filename); 44 | if (osMatcher.matches()) { 45 | this.os = OS.valueOf(osMatcher.group(1)); 46 | } else { 47 | if (filename.endsWith(".dll")) { 48 | this.os = OS.win; 49 | } else if (filename.endsWith(".dylib")) { 50 | this.os = OS.mac; 51 | } else if (filename.endsWith(".so")) { 52 | this.os = OS.linux; 53 | } 54 | } 55 | } 56 | 57 | public boolean loadForCurrentPlatform() { 58 | return os == null || os == OS.current; 59 | } 60 | 61 | public URL toURL(Path cacheDir) { 62 | try { 63 | return cacheDir.resolve(file).toFile().toURI().toURL(); 64 | } catch (MalformedURLException whaat) { 65 | throw new RuntimeException(whaat); 66 | } 67 | } 68 | 69 | private static long checksum(Path path) throws IOException { 70 | try (InputStream input = Files.newInputStream(path)) { 71 | Adler32 checksum = new Adler32(); 72 | byte[] buf = new byte[16384]; 73 | 74 | int read; 75 | while ((read = input.read(buf)) > -1) 76 | checksum.update(buf, 0, read); 77 | 78 | return checksum.getValue(); 79 | } 80 | } 81 | 82 | public boolean equals(Object o) { 83 | if (this == o) return true; 84 | if (o == null || getClass() != o.getClass()) return false; 85 | 86 | LibraryFile that = (LibraryFile) o; 87 | 88 | if (!file.equals(that.file)) return false; 89 | if (!checksum.equals(that.checksum)) return false; 90 | return size.equals(that.size); 91 | 92 | } 93 | 94 | public int hashCode() { 95 | int result = file.hashCode(); 96 | result = 31 * result + checksum.hashCode(); 97 | result = 31 * result + size.hashCode(); 98 | return result; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/OS.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | enum OS { 4 | win, mac, linux, other; 5 | 6 | public static final OS current; 7 | 8 | static { 9 | String os = System.getProperty("os.name", "generic").toLowerCase(); 10 | 11 | if ((os.contains("mac")) || (os.contains("darwin"))) 12 | current = mac; 13 | else if (os.contains("win")) 14 | current = win; 15 | else if (os.contains("nux")) 16 | current = linux; 17 | else 18 | current = other; 19 | } 20 | } -------------------------------------------------------------------------------- /dev/blynkserver/fxlauncher/UIProvider.java: -------------------------------------------------------------------------------- 1 | package fxlauncher; 2 | 3 | import javafx.scene.Parent; 4 | import javafx.stage.Stage; 5 | 6 | /** 7 | * The UIProvider is responsible for creating the loader screen and the updater screen. 8 | * A default implementation is available in the {@link DefaultUIProvider} class, but you 9 | * can provide a custom implementation to alter the appearance of the loader UI. 10 | * 11 | * Implement this interface and make sure to embed the classes inside the fxlauncher.jar 12 | * right around the "embed manifest" step. You have to do this manually as there is no function 13 | * in the plugin to support this yet. Basically you have to do the following two steps: 14 | * 15 | * 1. Copy the implementation classes into the fxlauncher.jar 16 | * 2. Create META-INF/services/fxlauncher.UIProvider inside the fxlauncher.jar. The content must 17 | * be a string with the fully qualified name of your implementation class. 18 | * 19 | * Typical example: 20 | * 21 | *

22 | * # cd into directory with ui sources 23 | * jar uf fxlauncher.jar -C my/package/MyUIProvider.class 24 | * # cd into directory with META-INF folder 25 | * jar uf fxlauncher.jar -C META-INF/services/fxlauncher.UIProvider 26 | *
27 | */ 28 | public interface UIProvider { 29 | 30 | /** 31 | * Initialization method called before {@link #createLoader()} 32 | * and {@link #createUpdater(FXManifest)}. This is a good place to add 33 | * stylesheets and perform other configuration. 34 | * 35 | * @param stage The stage that will be used to contain the loader and updater. 36 | */ 37 | void init(Stage stage); 38 | 39 | /** 40 | * Create the Node that will be displayed while the launcher is loading resources, 41 | * before the update process starts. The default implementation is an intdeterminate 42 | * progress indicator, but you can return any arbitrary scene graph. 43 | * 44 | * @return The launcher UI 45 | */ 46 | Parent createLoader(); 47 | 48 | /** 49 | * Create the Node that will be displayed while the launcher is updating resources. 50 | * 51 | * This Node should update it's display whenever the {@link #updateProgress(double)} 52 | * method is called. 53 | * 54 | * @see #updateProgress(double) 55 | * @return The updater Node 56 | */ 57 | Parent createUpdater(FXManifest manifest); 58 | 59 | /** 60 | * Called when the update/download progress is changing. The progress is a value between 61 | * 0 and 1, indicating the completion rate of the update process. 62 | * 63 | * @param progress A number between 0 and 1 64 | */ 65 | void updateProgress(double progress); 66 | } 67 | -------------------------------------------------------------------------------- /dev/blynkserver/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/blynkserver/pde.jar -------------------------------------------------------------------------------- /dev/blynkserver/resources/app.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/dev/blynkserver/resources/app.xml -------------------------------------------------------------------------------- /dev/topo.txt: -------------------------------------------------------------------------------- 1 | mini cours : http://ydisanto.developpez.com/tutoriels/java/runtime-exec/ 2 | 3 | Installer java JDK. 4 | Recopier le fichier Arduino/lib/pde.jar 5 | 6 | Pour la compilation : 7 | - créer un rep blocklyarduino (attention minuscules !) 8 | - y copier BlocklyArduino.java et pde.jar 9 | - compiler : javac BlocklyArduino.java -cp pde.jar 10 | - supprimer le pde.jar et le BlocklyArduino.java pour ne garder que BlocklyArduino.class compilé 11 | - zipper le répertoire blockyarduino, sans options, et le renommer en BlocklyArduino.jar (attention MAJUSCULES !) 12 | - copier ce jar dans tools/BlocklyArduino/tool -------------------------------------------------------------------------------- /nbproject/configs/Run_as_WebStart.properties: -------------------------------------------------------------------------------- 1 | # Do not modify this property in this configuration. It can be re-generated. 2 | $label=Run as WebStart 3 | -------------------------------------------------------------------------------- /nbproject/configs/Run_in_Browser.properties: -------------------------------------------------------------------------------- 1 | # Do not modify this property in this configuration. It can be re-generated. 2 | $label=Run in Browser 3 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=0be22bf3 2 | build.xml.script.CRC32=1a955ccc 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=0be22bf3 7 | nbproject/build-impl.xml.script.CRC32=98553a02 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | application.title=BlocklyArduinoIDEPlugin 8 | application.vendor=babas 9 | build.classes.dir=${build.dir}/classes 10 | build.classes.excludes=**/*.java,**/*.form 11 | # This directory is removed when the project is cleaned: 12 | build.dir=build 13 | build.generated.dir=${build.dir}/generated 14 | build.generated.sources.dir=${build.dir}/generated-sources 15 | # Only compile against the classpath explicitly listed here: 16 | build.sysclasspath=ignore 17 | build.test.classes.dir=${build.dir}/test/classes 18 | build.test.results.dir=${build.dir}/test/results 19 | compile.on.save=true 20 | compile.on.save.unsupported.javafx=true 21 | # Uncomment to specify the preferred debugger connection transport: 22 | #debug.transport=dt_socket 23 | debug.classpath=\ 24 | ${run.classpath} 25 | debug.test.classpath=\ 26 | ${run.test.classpath} 27 | # This directory is removed when the project is cleaned: 28 | dist.dir=dist 29 | dist.jar=${dist.dir}/BlocklyArduinoIDEPlugin.jar 30 | dist.javadoc.dir=${dist.dir}/javadoc 31 | endorsed.classpath= 32 | excludes= 33 | file.reference.Blockly_rduinoPlugin-src=Blockly@rduinoPlugin/src 34 | file.reference.Blockly_rduinoPlugin-test=Blockly@rduinoPlugin/test 35 | includes=** 36 | # Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects 37 | jar.archive.disabled=true 38 | jar.compress=false 39 | javac.classpath=\ 40 | ${javafx.classpath.extension} 41 | # Space-separated list of extra javac options 42 | javac.compilerargs= 43 | javac.deprecation=false 44 | javac.processorpath=\ 45 | ${javac.classpath} 46 | javac.source=1.8 47 | javac.target=1.8 48 | javac.test.classpath=\ 49 | ${javac.classpath}:\ 50 | ${build.classes.dir} 51 | javac.test.processorpath=\ 52 | ${javac.test.classpath} 53 | javadoc.additionalparam= 54 | javadoc.author=false 55 | javadoc.encoding=${source.encoding} 56 | javadoc.noindex=false 57 | javadoc.nonavbar=false 58 | javadoc.notree=false 59 | javadoc.private=false 60 | javadoc.splitindex=true 61 | javadoc.use=true 62 | javadoc.version=false 63 | javadoc.windowtitle= 64 | javafx.application.implementation.version=1.0 65 | javafx.binarycss=false 66 | javafx.classpath.extension=\ 67 | ${java.home}/lib/javaws.jar:\ 68 | ${java.home}/lib/deploy.jar:\ 69 | ${java.home}/lib/plugin.jar 70 | javafx.deploy.allowoffline=true 71 | # If true, application update mode is set to 'background', if false, update mode is set to 'eager' 72 | javafx.deploy.backgroundupdate=false 73 | javafx.deploy.embedJNLP=true 74 | javafx.deploy.includeDT=true 75 | # Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs) 76 | javafx.disable.concurrent.runs=false 77 | # Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project 78 | javafx.enable.concurrent.external.runs=false 79 | # This is a JavaFX project 80 | javafx.enabled=true 81 | javafx.fallback.class=com.javafx.main.NoJavaFXFallback 82 | # Main class for JavaFX 83 | javafx.main.class= 84 | javafx.preloader.class= 85 | # This project does not use Preloader 86 | javafx.preloader.enabled=false 87 | javafx.preloader.jar.filename= 88 | javafx.preloader.jar.path= 89 | javafx.preloader.project.path= 90 | javafx.preloader.type=none 91 | # Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs. 92 | javafx.rebase.libs=false 93 | javafx.run.height=600 94 | javafx.run.width=800 95 | # Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects 96 | jnlp.enabled=false 97 | # Main class for Java launcher 98 | main.class=com.javafx.main.Main 99 | # For improved security specify narrower Codebase manifest attribute to prevent RIAs from being repurposed 100 | manifest.custom.codebase=* 101 | # Specify Permissions manifest attribute to override default (choices: sandbox, all-permissions) 102 | manifest.custom.permissions= 103 | manifest.file=manifest.mf 104 | meta.inf.dir=${src.dir}/META-INF 105 | platform.active=default_platform 106 | run.classpath=\ 107 | ${dist.jar}:\ 108 | ${javac.classpath}:\ 109 | ${build.classes.dir} 110 | run.test.classpath=\ 111 | ${javac.test.classpath}:\ 112 | ${build.test.classes.dir} 113 | source.encoding=UTF-8 114 | src.dir=${file.reference.Blockly_rduinoPlugin-src} 115 | test.src.dir=${file.reference.Blockly_rduinoPlugin-test} 116 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | BlocklyArduinoIDEPlugin 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project BlocklyArduinoPlugin. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Wed, 24 Oct 2018 17:41:20 +0200 2 | 3 | 4 | F\:\\Logiciels\\Arduino_graphique\\BlocklyArduinoIDEPlugin\\Blockly@rduinoPlugin= 5 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/META-INF/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/META-INF/logo.png -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin$1.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin$2.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoPlugin.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$1.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$2.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$3.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$4.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer$5.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/BlocklyArduinoServer.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser$1.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser$2.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/Browser.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/StartupApplet$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/StartupApplet$1.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/StartupApplet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/StartupApplet.class -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | no.tornado 8 | fxlauncher 9 | 1.0.18 10 | jar 11 | FX Launcher 12 | Auto updating launcher for JavaFX Applications 13 | https://github.com/edvin/fxlauncher 14 | 15 | 16 | 17 | sonatype-nexus-staging 18 | Nexus Release Repository 19 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 20 | 21 | 22 | 23 | 24 | SYSE 25 | https://www.syse.no/ 26 | 27 | 28 | 29 | 30 | The Apache License, Version 2.0 31 | http://www.apache.org/licenses/LICENSE-2.0.txt 32 | 33 | 34 | 35 | 36 | 37 | Edvin Syse 38 | es@syse.no 39 | SYSE AS 40 | https://www.syse.no 41 | 42 | 43 | 44 | 45 | scm:git:git@github.com:edvin/fxlauncher.git 46 | scm:git:git@github.com:edvin/fxlauncher.git 47 | git@github.com:edvin/fxlauncher.git 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.apache.maven.plugins 55 | maven-release-plugin 56 | 2.1 57 | 58 | forked-path 59 | false 60 | -Psonatype-oss-release 61 | 62 | 63 | 64 | 65 | 66 | 67 | org.apache.maven.plugins 68 | maven-compiler-plugin 69 | 3.3 70 | 71 | 1.8 72 | 1.8 73 | 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-jar-plugin 78 | 2.6 79 | 80 | 81 | 82 | fxlauncher.Launcher 83 | 84 | 85 | 86 | 87 | 88 | org.apache.maven.plugins 89 | maven-javadoc-plugin 90 | 2.10.3 91 | 92 | 93 | compile 94 | 95 | javadoc 96 | jar 97 | 98 | 99 | 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-source-plugin 104 | 2.4 105 | 106 | 107 | compile 108 | 109 | aggregate 110 | jar 111 | 112 | 113 | 114 | 115 | 116 | org.apache.maven.plugins 117 | maven-gpg-plugin 118 | 1.4 119 | 120 | 121 | sign-artifacts 122 | deploy 123 | 124 | sign 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | UTF-8 134 | 1.8 135 | 1.8 136 | 137 | 138 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/fxlauncher-1.0.18.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/fxlauncher-1.0.18.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | src/main/javadoc 10 | 11 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Apache Maven 2 | #Wed Oct 24 14:29:36 CEST 2018 3 | version=1.0.18 4 | groupId=no.tornado 5 | artifactId=fxlauncher 6 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/test-classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/build/classes/blocklyarduinoplugin/target/test-classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/BlocklyArduinoPlugin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/dist/BlocklyArduinoPlugin.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "BlocklyArduinoPlugin.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/lib/arduino-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/dist/lib/arduino-core.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/dist/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/lib/jfxrt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/dist/lib/jfxrt.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/dist/lib/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/dist/lib/pde.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/lib/arduino-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/lib/arduino-core.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/lib/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/lib/pde.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/configs/release.properties: -------------------------------------------------------------------------------- 1 | main.class=BlocklyArduinoPlugin 2 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=49edefbd 2 | build.xml.script.CRC32=2291a7a5 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.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=49edefbd 7 | nbproject/build-impl.xml.script.CRC32=e9eaa8bd 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | config=release 2 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | file.reference.jfxrt.jar=C:\\Program Files\\Java\\jdk1.8.0_161\\jre\\lib\\ext\\jfxrt.jar 5 | javac.debug=true 6 | javadoc.preview=true 7 | user.properties.file=C:\\Users\\babas\\AppData\\Roaming\\NetBeans\\8.2\\build.properties 8 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/private/profiler/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #org.netbeans.modules.profiler.v2.features.MonitorFeature@#org.netbeans.modules.profiler.v2.features.MethodsFeature@#org.netbeans.modules.profiler.v2.features.ThreadsFeature@ 6 | false 7 | 8 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/project.properties: -------------------------------------------------------------------------------- 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.desc=Plugin and method from Dwenguino : http://www.dwengo.org 7 | application.homepage=https://github.com/technologiescollege/Blockly-at-rduino 8 | application.splash=F:\\Logiciels\\Arduino_graphique\\Blockly-at-rduino\\media\\logo.png 9 | application.title=BlocklyArduinoPlugin 10 | application.vendor=SebCanet 11 | auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml 12 | build.classes.dir=${build.dir}/classes 13 | build.classes.excludes=**/*.java,**/*.form 14 | # This directory is removed when the project is cleaned: 15 | build.dir=build 16 | build.generated.dir=${build.dir}/generated 17 | build.generated.sources.dir=${build.dir}/generated-sources 18 | # Only compile against the classpath explicitly listed here: 19 | build.sysclasspath=ignore 20 | build.test.classes.dir=${build.dir}/test/classes 21 | build.test.results.dir=${build.dir}/test/results 22 | # Uncomment to specify the preferred debugger connection transport: 23 | #debug.transport=dt_socket 24 | debug.classpath=\ 25 | ${run.classpath} 26 | debug.test.classpath=\ 27 | ${run.test.classpath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/BlocklyArduinoPlugin.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | endorsed.classpath= 35 | excludes= 36 | file.reference.arduino-core.jar=lib/arduino-core.jar 37 | file.reference.commons-io-2.5.jar=lib/commons-io-2.5.jar 38 | file.reference.jfxrt.jar=/usr/lib/jvm/default-java/jre/lib/ext/jfxrt.jar 39 | file.reference.pde.jar=lib/pde.jar 40 | includes=** 41 | jar.archive.disabled=${jnlp.enabled} 42 | jar.compress=false 43 | jar.index=${jnlp.enabled} 44 | javac.classpath=\ 45 | ${file.reference.pde.jar}:\ 46 | ${file.reference.arduino-core.jar}:\ 47 | ${file.reference.commons-io-2.5.jar}:\ 48 | ${file.reference.jfxrt.jar} 49 | # Space-separated list of extra javac options 50 | javac.compilerargs= 51 | javac.deprecation=false 52 | javac.external.vm=true 53 | javac.processorpath=\ 54 | ${javac.classpath} 55 | javac.source=1.8 56 | javac.target=1.8 57 | javac.test.classpath=\ 58 | ${javac.classpath}:\ 59 | ${build.classes.dir} 60 | javac.test.processorpath=\ 61 | ${javac.test.classpath} 62 | javadoc.additionalparam= 63 | javadoc.author=true 64 | javadoc.encoding=${source.encoding} 65 | javadoc.noindex=false 66 | javadoc.nonavbar=false 67 | javadoc.notree=false 68 | javadoc.private=true 69 | javadoc.splitindex=true 70 | javadoc.use=true 71 | javadoc.version=true 72 | javadoc.windowtitle= 73 | jnlp.applet.class=blocklyarduinoplugin.StartupApplet 74 | jnlp.applet.height=300 75 | jnlp.applet.width=300 76 | jnlp.codebase.type=no.codebase 77 | jnlp.descriptor=application 78 | jnlp.enabled=false 79 | jnlp.mixed.code=default 80 | jnlp.offline-allowed=false 81 | jnlp.signed=false 82 | jnlp.signing= 83 | jnlp.signing.alias= 84 | jnlp.signing.keystore= 85 | main.class=blocklyarduinoplugin.BlocklyArduinoPlugin 86 | # Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. 87 | manifest.custom.application.library.allowable.codebase= 88 | # Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. 89 | manifest.custom.caller.allowable.codebase= 90 | # Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed 91 | manifest.custom.codebase= 92 | # Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) 93 | manifest.custom.permissions= 94 | manifest.file=manifest.mf 95 | meta.inf.dir=${src.dir}/META-INF 96 | mkdist.disabled=false 97 | platform.active=default_platform 98 | project.license=gpl30 99 | run.classpath=\ 100 | ${javac.classpath}:\ 101 | ${build.classes.dir} 102 | # Space-separated list of JVM arguments used when running the project. 103 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 104 | # To set system properties for unit tests define test-sys-prop.name=value: 105 | run.jvmargs= 106 | run.test.classpath=\ 107 | ${javac.test.classpath}:\ 108 | ${build.test.classes.dir} 109 | source.encoding=UTF-8 110 | src.dir=src 111 | test.src.dir=test 112 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | BlocklyArduinoPlugin 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/BlocklyArduinoPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package blocklyarduinoplugin; 7 | 8 | import java.awt.BorderLayout; 9 | import java.awt.Dimension; 10 | import java.awt.event.WindowAdapter; 11 | import java.awt.event.WindowEvent; 12 | import java.text.NumberFormat; 13 | import javafx.application.Platform; 14 | import javafx.embed.swing.JFXPanel; 15 | import javafx.scene.Scene; 16 | import javafx.scene.paint.Color; 17 | import javax.swing.JFrame; 18 | import javax.swing.SwingUtilities; 19 | import javax.swing.UIManager; 20 | 21 | import processing.app.Editor; 22 | import processing.app.tools.Tool; 23 | import processing.app.Preferences; 24 | 25 | /** 26 | * 27 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 28 | */ 29 | public class BlocklyArduinoPlugin implements Tool { 30 | 31 | public static Editor editor; 32 | 33 | public static long startTimestamp = 0; 34 | 35 | private final int JFXPANEL_WIDTH_INT = 1024; 36 | private final int JFXPANEL_HEIGHT_INT = 768; 37 | public String portId = Preferences.get("serial.port"); 38 | /** 39 | * @param args the command line arguments 40 | */ 41 | public static void main(String[] args) { 42 | BlocklyArduinoPlugin.startApplication(); 43 | 44 | } 45 | 46 | public static void startApplication(){ 47 | startTimestamp = System.currentTimeMillis(); 48 | SwingUtilities.invokeLater(new Runnable() { 49 | 50 | @Override 51 | public void run() { 52 | Platform.setImplicitExit(false); 53 | BlocklyArduinoPlugin plugin = new BlocklyArduinoPlugin(); 54 | try { 55 | UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); 56 | } catch (Exception e) { 57 | } 58 | 59 | try { 60 | plugin.initGUI(); 61 | }catch(NullPointerException ex){ 62 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 63 | } 64 | } 65 | }); 66 | } 67 | 68 | private JFrame window; 69 | private JFXPanel jfxPanel; 70 | private Browser browser; 71 | 72 | private void initGUI() { 73 | window = new JFrame(); 74 | window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 75 | window.setLayout(new BorderLayout()); 76 | window.setSize(1024, 768); 77 | window.setLocationRelativeTo(null); 78 | window.addWindowListener(new WindowAdapter() 79 | { 80 | @Override 81 | public void windowClosing(WindowEvent e) { 82 | SwingUtilities.invokeLater(() -> { 83 | Platform.runLater(() -> { 84 | //browser.webEngine.load("about:blank"); 85 | SwingUtilities.invokeLater(() -> { 86 | //System.out.println("test"); 87 | try{ 88 | e.getWindow().dispose(); 89 | }catch (NullPointerException ex){ 90 | //System.out.println("This is a bug in java: https://bugs.openjdk.java.net/browse/JDK-8089371"); 91 | } 92 | }); 93 | }); 94 | }); 95 | } 96 | }); 97 | 98 | jfxPanel = new JFXPanel(); 99 | jfxPanel.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT)); 100 | window.add(jfxPanel, BorderLayout.CENTER); 101 | window.setVisible(true); 102 | 103 | Platform.runLater(() -> { 104 | showBrowser(); 105 | }); 106 | } 107 | 108 | private void showBrowser() { 109 | try { 110 | browser = new Browser(editor); 111 | jfxPanel.setScene(new Scene(browser, 800, 600, Color.web("#666970"))); 112 | } catch (NullPointerException ex) { 113 | //System.out.println("Houston we have a problem"); 114 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 115 | } 116 | } 117 | 118 | public static void printMemoryUsage(){ 119 | Runtime runtime = Runtime.getRuntime(); 120 | NumberFormat format = NumberFormat.getInstance(); 121 | 122 | StringBuilder sb = new StringBuilder(); 123 | long maxMemory = runtime.maxMemory(); 124 | long allocatedMemory = runtime.totalMemory(); 125 | long freeMemory = runtime.freeMemory(); 126 | 127 | sb.append("free memory: " + format.format(freeMemory / 1024) + "
"); 128 | sb.append("allocated memory: " + format.format(allocatedMemory / 1024) + "
"); 129 | sb.append("max memory: " + format.format(maxMemory / 1024) + "
"); 130 | sb.append("total free memory: " + format.format((freeMemory + (maxMemory - allocatedMemory)) / 1024) + "
"); 131 | 132 | //System.out.println(sb.toString()); 133 | } 134 | 135 | @Override 136 | public void run() { 137 | try{ 138 | BlocklyArduinoPlugin.editor.toFront(); 139 | // Fill in author.name, author.url, tool.prettyVersion and 140 | // project.prettyName in build.properties for them to be auto-replaced here. 141 | BlocklyArduinoPlugin.startApplication(); 142 | }catch(NullPointerException ex){ 143 | //System.out.println(Arrays.toString(Thread.currentThread().getStackTrace())); 144 | } 145 | } 146 | 147 | @Override 148 | public String getMenuTitle() { 149 | return "Blockly@rduino"; 150 | } 151 | 152 | @Override 153 | public void init(Editor editor) { 154 | BlocklyArduinoPlugin.editor = editor; 155 | } 156 | } -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/BlocklyArduinoServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package blocklyarduinoplugin; 7 | 8 | import java.awt.image.BufferedImage; 9 | import java.io.BufferedReader; 10 | import java.io.BufferedWriter; 11 | import java.io.File; 12 | import java.io.FileNotFoundException; 13 | import java.io.FileReader; 14 | import java.io.FileWriter; 15 | import java.io.IOException; 16 | import java.io.OutputStream; 17 | import java.io.PrintWriter; 18 | import java.util.logging.Level; 19 | import java.util.logging.Logger; 20 | import java.util.stream.Collectors; 21 | import javafx.application.Platform; 22 | import javafx.embed.swing.SwingFXUtils; 23 | import javafx.stage.FileChooser; 24 | import javafx.stage.Window; 25 | import javafx.scene.Scene; 26 | import javafx.scene.image.Image; 27 | import javafx.stage.Stage; 28 | import javax.imageio.ImageIO; 29 | import javax.swing.SwingUtilities; 30 | 31 | import java.lang.reflect.InvocationTargetException; 32 | import processing.app.Editor; 33 | 34 | /** 35 | * 36 | * @author Tom for Dwenguino 37 | */ 38 | public class BlocklyArduinoServer { 39 | 40 | private String lastOpenedLocation = System.getProperty("user.home"); 41 | private Editor editor; 42 | private Window ownerWindow; 43 | Runnable runHandler; 44 | Runnable presentHandler; 45 | 46 | public BlocklyArduinoServer(Editor editor, Window ownerWindow){ 47 | this.editor = editor; 48 | this.ownerWindow = ownerWindow; 49 | } 50 | 51 | /** 52 | * Paste the created code to the Arduino IDE. 53 | * 54 | * @param code Arduino C code 55 | */ 56 | public void pasteCode(String code) { 57 | 58 | //System.out.println("uploading code"); 59 | SwingUtilities.invokeLater(new Runnable() { 60 | 61 | @Override 62 | public void run() { 63 | //System.out.println("code upload run method started"); 64 | try{ 65 | //System.out.println("make method"); 66 | java.lang.reflect.Method method; 67 | //System.out.println("get BlocklyArduinoPlugin class"); 68 | Class ed = BlocklyArduinoPlugin.editor.getClass(); 69 | //System.out.println("get args"); 70 | Class[] cArg = new Class[1]; 71 | //System.out.println("set first arg as string"); 72 | cArg[0] = String.class; 73 | //System.out.println("get setText method"); 74 | method = ed.getMethod("setText", cArg); 75 | //System.out.println("invoke method"); 76 | method.invoke(editor, code); 77 | }catch(NoSuchMethodException e) { 78 | //System.out.println("nosuchmethod"); 79 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 80 | } catch (IllegalAccessException e) { 81 | //System.out.println("illegalaccess"); 82 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 83 | } catch (SecurityException e) { 84 | //System.out.println("security"); 85 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 86 | } catch (InvocationTargetException e) { 87 | //System.out.println("invocationtarget"); 88 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 89 | } 90 | } 91 | }); 92 | } 93 | 94 | /** 95 | * Paste and verify the created code. 96 | * 97 | * @param code Arduino C code 98 | */ 99 | public void verifyCode(String code) { 100 | 101 | //System.out.println("uploading code"); 102 | SwingUtilities.invokeLater(new Runnable() { 103 | 104 | @Override 105 | public void run() { 106 | //System.out.println("code verify run method started"); 107 | try{ 108 | //System.out.println("make method"); 109 | java.lang.reflect.Method method; 110 | //System.out.println("get BlocklyArduinoPlugin class"); 111 | Class ed = BlocklyArduinoPlugin.editor.getClass(); 112 | //System.out.println("get args"); 113 | Class[] cArg = new Class[1]; 114 | //System.out.println("set first arg as string"); 115 | cArg[0] = String.class; 116 | //System.out.println("get setText method"); 117 | method = ed.getMethod("setText", cArg); 118 | //System.out.println("invoke method"); 119 | method.invoke(editor, code); 120 | }catch(NoSuchMethodException e) { 121 | //System.out.println("nosuchmethod"); 122 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 123 | } catch (IllegalAccessException e) { 124 | //System.out.println("illegalaccess"); 125 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 126 | } catch (SecurityException e) { 127 | //System.out.println("security"); 128 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 129 | } catch (InvocationTargetException e) { 130 | //System.out.println("invocationtarget"); 131 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 132 | } 133 | //System.out.println("handleExport"); 134 | //BlocklyArduinoPlugin.editor.handleRun(false, Editor.this.presentHandler, Editor.this.runHandler); 135 | //System.out.println("Done handling export"); 136 | } 137 | }); 138 | } 139 | 140 | /** 141 | * Uploads the created code to the Arduino board. 142 | * 143 | * @param code Arduino C code 144 | */ 145 | public void uploadCode(String code) { 146 | 147 | //System.out.println("uploading code"); 148 | SwingUtilities.invokeLater(new Runnable() { 149 | 150 | @Override 151 | public void run() { 152 | //System.out.println("code upload run method started"); 153 | try{ 154 | //System.out.println("make method"); 155 | java.lang.reflect.Method method; 156 | //System.out.println("get BlocklyArduinoPlugin class"); 157 | Class ed = BlocklyArduinoPlugin.editor.getClass(); 158 | //System.out.println("get args"); 159 | Class[] cArg = new Class[1]; 160 | //System.out.println("set first arg as string"); 161 | cArg[0] = String.class; 162 | //System.out.println("get setText method"); 163 | method = ed.getMethod("setText", cArg); 164 | //System.out.println("invoke method"); 165 | method.invoke(editor, code); 166 | }catch(NoSuchMethodException e) { 167 | //System.out.println("nosuchmethod"); 168 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 169 | } catch (IllegalAccessException e) { 170 | //System.out.println("illegalaccess"); 171 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 172 | } catch (SecurityException e) { 173 | //System.out.println("security"); 174 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 175 | } catch (InvocationTargetException e) { 176 | //System.out.println("invocationtarget"); 177 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 178 | } 179 | //System.out.println("handleExport"); 180 | BlocklyArduinoPlugin.editor.handleExport(false); 181 | //System.out.println("Done handling export"); 182 | } 183 | }); 184 | } 185 | 186 | /** 187 | * This method is called from javascript. It lets the user select a location 188 | * where to save the generated code to and saves them. 189 | * 190 | * @param code The Arduino c code generated from the blocks. 191 | */ 192 | public void saveCode(String code) { 193 | 194 | //System.out.println("uploading code"); 195 | SwingUtilities.invokeLater(new Runnable() { 196 | 197 | @Override 198 | public void run() { 199 | //System.out.println("code upload run method started"); 200 | try{ 201 | //System.out.println("make method"); 202 | java.lang.reflect.Method method; 203 | //System.out.println("get BlocklyArduinoPlugin class"); 204 | Class ed = BlocklyArduinoPlugin.editor.getClass(); 205 | //System.out.println("get args"); 206 | Class[] cArg = new Class[1]; 207 | //System.out.println("set first arg as string"); 208 | cArg[0] = String.class; 209 | //System.out.println("get setText method"); 210 | method = ed.getMethod("setText", cArg); 211 | //System.out.println("invoke method"); 212 | method.invoke(editor, code); 213 | }catch(NoSuchMethodException e) { 214 | //System.out.println("nosuchmethod"); 215 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 216 | } catch (IllegalAccessException e) { 217 | //System.out.println("illegalaccess"); 218 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 219 | } catch (SecurityException e) { 220 | //System.out.println("security"); 221 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 222 | } catch (InvocationTargetException e) { 223 | //System.out.println("invocationtarget"); 224 | BlocklyArduinoPlugin.editor.getCurrentTab().setText(code); 225 | } 226 | //System.out.println("handleExport"); 227 | BlocklyArduinoPlugin.editor.handleSaveAs(); 228 | //System.out.println("Done handling export"); 229 | } 230 | }); 231 | } 232 | 233 | /** 234 | * This method is called from javascript. It lets the user select a location 235 | * where to save the screen capture of the workspace. 236 | * 237 | * @param code Thecode generated from Blockly@rduino. 238 | */ 239 | public void saveWorkspaceCapture(String code) { 240 | 241 | FileChooser fileChooser = new FileChooser(); 242 | fileChooser.setInitialDirectory(new File(lastOpenedLocation)); 243 | fileChooser.setTitle("Capture"); 244 | fileChooser.getExtensionFilters().addAll( 245 | new FileChooser.ExtensionFilter("image", "*.svg") 246 | ); 247 | 248 | File selectedFile = fileChooser.showSaveDialog(ownerWindow); 249 | if (selectedFile != null) { 250 | try{ 251 | FileWriter fileWriter = null; 252 | fileWriter = new FileWriter(selectedFile); 253 | fileWriter.write(code); 254 | fileWriter.close(); 255 | } catch (IOException ex) { 256 | //Logger.getLogger(JavaFX_Text.class.getName()).log(Level.SEVERE, null, ex); 257 | } 258 | } 259 | } 260 | 261 | /** 262 | * Loads an xml file in which the user saved his blocks. 263 | * 264 | * @return xml data for the block structure. 265 | */ 266 | public String IDEloadXML() { 267 | //System.out.println("loading blocks"); 268 | FileChooser fileChooser = new FileChooser(); 269 | fileChooser.setInitialDirectory(new File(lastOpenedLocation)); 270 | fileChooser.getExtensionFilters().addAll( 271 | new FileChooser.ExtensionFilter("Blockly@rduino", "*.B@") 272 | ); 273 | File selectedFile = fileChooser.showOpenDialog(ownerWindow); 274 | String blockData = ""; 275 | //System.out.println("file selected"); 276 | if (selectedFile != null) { 277 | lastOpenedLocation = selectedFile.getParent(); 278 | //System.out.println("saved last opened location"); 279 | try { 280 | BufferedReader fReader = new BufferedReader(new FileReader(selectedFile)); 281 | blockData = fReader.lines().collect(Collectors.joining()); 282 | fReader.close(); 283 | } catch (FileNotFoundException ex) { 284 | //System.out.println("filenotfoundexception"); 285 | Logger.getLogger(BlocklyArduinoServer.class.getName()).log(Level.SEVERE, null, ex); 286 | } catch (IOException ex) { 287 | //System.out.println("ioexception"); 288 | Logger.getLogger(BlocklyArduinoServer.class.getName()).log(Level.SEVERE, null, ex); 289 | } 290 | } 291 | return blockData; 292 | } 293 | 294 | /** 295 | * This method is called from javascript. It lets the user select a location 296 | * where to save the blocks to and saves them. 297 | * 298 | * @param xml The xml structure of the created block program. 299 | */ 300 | public void IDEsaveXML(String xml) { 301 | //System.out.println("saving blocks"); 302 | 303 | FileChooser fileChooser = new FileChooser(); 304 | fileChooser.setInitialDirectory(new File(lastOpenedLocation)); 305 | fileChooser.setTitle("Save"); 306 | fileChooser.getExtensionFilters().addAll( 307 | new FileChooser.ExtensionFilter("Blockly@rduino", "*.B@") 308 | ); 309 | File selectedFile = fileChooser.showSaveDialog(ownerWindow); 310 | if (selectedFile != null) { 311 | if (selectedFile.getName().matches("^.*\\.B@$")) { 312 | // filename is OK as-is 313 | } else { 314 | selectedFile = new File(selectedFile.toString() + ".B@"); // append .B@ if "foo.jpg.xml" is OK 315 | } 316 | lastOpenedLocation = selectedFile.getParent(); 317 | try { 318 | BufferedWriter bWriter = new BufferedWriter(new FileWriter(selectedFile)); 319 | bWriter.write(xml); 320 | bWriter.flush(); 321 | bWriter.close(); 322 | } catch (IOException ex) { 323 | Logger.getLogger(BlocklyArduinoServer.class.getName()).log(Level.SEVERE, null, ex); 324 | } 325 | } 326 | } 327 | 328 | public void exit() { 329 | Platform.exit(); 330 | } 331 | } -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package blocklyarduinoplugin; 7 | 8 | import java.io.File; 9 | import java.io.FileReader; 10 | import java.io.FileWriter; 11 | import java.io.IOException; 12 | import java.io.BufferedReader; 13 | import java.util.Optional; 14 | import javafx.beans.value.ChangeListener; 15 | import javafx.beans.value.ObservableValue; 16 | import javafx.concurrent.Worker.State; 17 | import javafx.event.EventHandler; 18 | import javafx.geometry.HPos; 19 | import javafx.geometry.VPos; 20 | import javafx.scene.control.Alert; 21 | import javafx.scene.control.Alert.AlertType; 22 | import javafx.scene.layout.Region; 23 | import javafx.scene.web.PromptData; 24 | import javafx.scene.web.WebEngine; 25 | import javafx.scene.web.WebView; 26 | import netscape.javascript.JSObject; 27 | import processing.app.Editor; 28 | import javafx.scene.control.TextInputDialog; 29 | import javafx.scene.web.WebEvent; 30 | import javafx.scene.control.ButtonType; 31 | import javafx.scene.control.Dialog; 32 | 33 | /** 34 | * 35 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 36 | */ 37 | class Browser extends Region { 38 | 39 | public WebView browser = new WebView(); 40 | public WebEngine webEngine = browser.getEngine(); 41 | public BlocklyArduinoServer serverObject; 42 | public ChangeListener changeListener; 43 | 44 | public Browser(Editor editor) { 45 | //apply the styles 46 | getStyleClass().add("browser"); 47 | 48 | changeListener = new ChangeListener() { 49 | @Override 50 | public void changed(ObservableValue ov, 51 | State oldState, State newState) { 52 | if (newState == State.SUCCEEDED) { 53 | // The JavaAppp class implements the JavaScript to Java bindings 54 | serverObject = new BlocklyArduinoServer(editor, Browser.this.getScene().getWindow()); 55 | JSObject win = (JSObject) webEngine.executeScript("window"); 56 | win.setMember("BlocklyArduinoServer", serverObject); 57 | }else{ 58 | } 59 | } 60 | }; 61 | 62 | // process page loading 63 | webEngine.getLoadWorker().stateProperty().addListener(changeListener); 64 | 65 | webEngine.setOnAlert(new EventHandler>() { 66 | @Override 67 | public void handle(WebEvent event) { 68 | Alert alert = new Alert(AlertType.INFORMATION); 69 | alert.setContentText(event.getData()); 70 | alert.showAndWait(); 71 | } 72 | }); 73 | 74 | //Set handler to handle browser promp events 75 | webEngine.setPromptHandler((PromptData param) -> { 76 | TextInputDialog prompt = new TextInputDialog(); 77 | prompt.setTitle("BlocklyArduino"); 78 | Optional result = prompt.showAndWait(); 79 | return result.orElse(""); 80 | }); 81 | 82 | webEngine.setConfirmHandler((String message) -> { 83 | Dialog confirm = new Dialog<>(); 84 | confirm.getDialogPane().setContentText(message); 85 | confirm.getDialogPane().getButtonTypes().addAll(ButtonType.YES, ButtonType.NO); 86 | boolean result = confirm.showAndWait().filter(ButtonType.YES::equals).isPresent(); 87 | return result ; 88 | }); 89 | String location = getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); 90 | location = location.replace("BlocklyArduinoPlugin.jar", ""); 91 | File optionFile = new File(location + "BlocklyArduinoPlugin.config"); 92 | if(optionFile.exists() && optionFile.isFile()) { 93 | try{ 94 | FileReader filereading = new FileReader(optionFile); 95 | BufferedReader reader = new BufferedReader(filereading); 96 | String line = reader.readLine(); 97 | reader.close(); 98 | filereading.close(); 99 | //System.out.println(line); 100 | if (line == null) line = ""; 101 | String baseurl = "file:" + getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); 102 | baseurl = baseurl.replace("\\", "/"); 103 | baseurl = baseurl.replace("BlocklyArduinoPlugin.jar", ""); 104 | webEngine.load(baseurl + "Blockly@rduino/index_IDE.html" + line); 105 | getChildren().add(browser); 106 | } 107 | catch (IOException exception){ 108 | System.out.println("error reading"); 109 | } 110 | }else 111 | { 112 | String baseurl = "file:" + getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); 113 | baseurl = baseurl.replace("\\", "/"); 114 | baseurl = baseurl.replace("BlocklyArduinoPlugin.jar", ""); 115 | webEngine.load(baseurl + "Blockly@rduino/index_IDE.html"); 116 | //add the web view to the scene 117 | getChildren().add(browser); 118 | } 119 | } 120 | 121 | private void SaveFile(String content, File file){ 122 | try { 123 | FileWriter fileWriter = null; 124 | fileWriter = new FileWriter(file); 125 | fileWriter.write(content); 126 | fileWriter.close(); 127 | } catch (IOException ex) { 128 | //Logger.getLogger(JavaFX_Text.class.getName()).log(Level.SEVERE, null, ex); 129 | } 130 | 131 | } 132 | 133 | @Override protected void layoutChildren() { 134 | double w = getWidth(); 135 | double h = getHeight(); 136 | layoutInArea(browser,0,0,w,h,0, HPos.CENTER, VPos.CENTER); 137 | } 138 | 139 | @Override protected double computePrefWidth(double height) { 140 | return 800; 141 | } 142 | 143 | @Override protected double computePrefHeight(double width) { 144 | return 600; 145 | } 146 | } -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/StartupApplet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package blocklyarduinoplugin; 7 | 8 | import java.awt.BorderLayout; 9 | import java.awt.Dimension; 10 | import javafx.application.Platform; 11 | import javafx.embed.swing.JFXPanel; 12 | import javafx.scene.Scene; 13 | import javafx.scene.paint.Color; 14 | import javax.swing.JApplet; 15 | import javax.swing.SwingUtilities; 16 | import processing.app.Editor; 17 | 18 | /** 19 | * 20 | * @author Tom for Dwenguino https://github.com/dwengovzw/Blockly-for-Dwenguino 21 | */ 22 | public class StartupApplet extends JApplet { 23 | 24 | private JFXPanel fxContainer; 25 | private final int JFXPANEL_WIDTH_INT = 1024; 26 | private final int JFXPANEL_HEIGHT_INT = 768; 27 | private Editor editor; 28 | private Thread activeThread; 29 | private Browser browser; 30 | 31 | public StartupApplet(Editor editor){ 32 | this.editor = editor; 33 | } 34 | 35 | @Override 36 | public void init() { 37 | BlocklyArduinoPlugin.startTimestamp = System.currentTimeMillis(); 38 | fxContainer = new JFXPanel(); 39 | fxContainer.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT)); 40 | add(fxContainer, BorderLayout.CENTER); 41 | Platform.setImplicitExit(false); 42 | Runnable activeRunnable = new Runnable() { 43 | @Override 44 | public void run() { 45 | createScene(); 46 | } 47 | }; 48 | Platform.runLater(activeRunnable); 49 | } 50 | 51 | private void createScene() { 52 | browser = new Browser(editor); 53 | fxContainer.setScene(new Scene(browser, 1024, 768, Color.web("#666970"))); 54 | } 55 | 56 | @Override 57 | public void stop() { 58 | browser.webEngine.load("about:blank"); 59 | SwingUtilities.invokeLater(() -> { 60 | fxContainer.removeNotify(); 61 | }); 62 | } 63 | } -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | no.tornado 8 | fxlauncher 9 | 1.0.18 10 | jar 11 | FX Launcher 12 | Auto updating launcher for JavaFX Applications 13 | https://github.com/edvin/fxlauncher 14 | 15 | 16 | 17 | sonatype-nexus-staging 18 | Nexus Release Repository 19 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 20 | 21 | 22 | 23 | 24 | SYSE 25 | https://www.syse.no/ 26 | 27 | 28 | 29 | 30 | The Apache License, Version 2.0 31 | http://www.apache.org/licenses/LICENSE-2.0.txt 32 | 33 | 34 | 35 | 36 | 37 | Edvin Syse 38 | es@syse.no 39 | SYSE AS 40 | https://www.syse.no 41 | 42 | 43 | 44 | 45 | scm:git:git@github.com:edvin/fxlauncher.git 46 | scm:git:git@github.com:edvin/fxlauncher.git 47 | git@github.com:edvin/fxlauncher.git 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.apache.maven.plugins 55 | maven-release-plugin 56 | 2.1 57 | 58 | forked-path 59 | false 60 | -Psonatype-oss-release 61 | 62 | 63 | 64 | 65 | 66 | 67 | org.apache.maven.plugins 68 | maven-compiler-plugin 69 | 3.3 70 | 71 | 1.8 72 | 1.8 73 | 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-jar-plugin 78 | 2.6 79 | 80 | 81 | 82 | fxlauncher.Launcher 83 | 84 | 85 | 86 | 87 | 88 | org.apache.maven.plugins 89 | maven-javadoc-plugin 90 | 2.10.3 91 | 92 | 93 | compile 94 | 95 | javadoc 96 | jar 97 | 98 | 99 | 100 | 101 | 102 | org.apache.maven.plugins 103 | maven-source-plugin 104 | 2.4 105 | 106 | 107 | compile 108 | 109 | aggregate 110 | jar 111 | 112 | 113 | 114 | 115 | 116 | org.apache.maven.plugins 117 | maven-gpg-plugin 118 | 1.4 119 | 120 | 121 | sign-artifacts 122 | deploy 123 | 124 | sign 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | UTF-8 134 | 1.8 135 | 1.8 136 | 137 | 138 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/fxlauncher-1.0.18.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/fxlauncher-1.0.18.jar -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | src/main/javadoc 10 | 11 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Apache Maven 2 | #Wed Oct 24 14:29:36 CEST 2018 3 | version=1.0.18 4 | groupId=no.tornado 5 | artifactId=fxlauncher 6 | -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst -------------------------------------------------------------------------------- /src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/test-classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/Blockly@rduinoPlugin/src/blocklyarduinoplugin/target/test-classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /src/blocklyarduinoweb/BlocklyArduinoWeb.java: -------------------------------------------------------------------------------- 1 | package blocklyarduino; 2 | 3 | import java.awt.Desktop; 4 | import java.io.IOException; 5 | import java.net.URI; 6 | import java.net.URISyntaxException; 7 | import processing.app.Editor; 8 | import processing.app.tools.Tool; 9 | 10 | public class BlocklyArduino implements Tool { 11 | Editor editor; 12 | 13 | public void init(Editor editor) { 14 | this.editor = editor; 15 | } 16 | 17 | public String getMenuTitle() { 18 | return "Blockly@rduino"; 19 | } 20 | 21 | public void run() { 22 | Desktop desktop = Desktop.getDesktop(); 23 | try { 24 | desktop.browse(new URI("http://technologiescollege.github.io/Blockly-at-rduino/")); 25 | } catch (IOException e) { 26 | // TODO Auto-generated catch block 27 | e.printStackTrace(); 28 | } catch (URISyntaxException e) { 29 | // TODO Auto-generated catch block 30 | e.printStackTrace(); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/pde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/technologiescollege/BlocklyArduinoIDEPlugin/bc2d01e802e7cd27e107cafbabe162fc44c38e32/src/pde.jar --------------------------------------------------------------------------------