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 extends State> 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
--------------------------------------------------------------------------------