From 1b5f66d19f4a3a3601845140656382ae328d3993 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Mon, 15 Jul 2024 17:37:56 -0400 Subject: [PATCH 01/16] Update for cadoodle compat --- libraries/bowler-script-kernel | 2 +- libraries/dockfx | 2 +- .../tabs/AbstractBowlerStudioTab.java | 10 +- .../bowlerstudio/tabs/LocalFileScriptTab.java | 4 +- .../java/javafx/embed/swing/MySwingNode.java | 163 ------------------ 5 files changed, 9 insertions(+), 172 deletions(-) delete mode 100644 src/main/java/javafx/embed/swing/MySwingNode.java diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 2f3be2717..55ba49ff0 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 2f3be2717bef9ed9def8cdf3c6a1a2a19ab6fd01 +Subproject commit 55ba49ff04fed09b8aec0047eeb7f5cc16e84dff diff --git a/libraries/dockfx b/libraries/dockfx index 7dbd26fe8..bccf51cca 160000 --- a/libraries/dockfx +++ b/libraries/dockfx @@ -1 +1 @@ -Subproject commit 7dbd26fe86de957fe60bd91ce1f2150f9aebbe79 +Subproject commit bccf51cca5a9fa9749379803905164367d2a2c12 diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/tabs/AbstractBowlerStudioTab.java b/src/main/java/com/neuronrobotics/bowlerstudio/tabs/AbstractBowlerStudioTab.java index 44622e5e1..6eafd7859 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/tabs/AbstractBowlerStudioTab.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/tabs/AbstractBowlerStudioTab.java @@ -11,8 +11,8 @@ import com.neuronrobotics.sdk.common.BowlerAbstractDevice; import com.neuronrobotics.sdk.common.IConnectionEventListener; import com.neuronrobotics.sdk.common.IDeviceConnectionEventListener; -import com.sun.javafx.scene.control.behavior.TabPaneBehavior; -import com.sun.javafx.scene.control.skin.TabPaneSkin; +//import com.sun.javafx.scene.control.behavior.TabPaneBehavior; +//import com.sun.javafx.scene.control.skin.TabPaneSkin; import eu.mihosoft.vrl.v3d.CSG; import javafx.application.Platform; @@ -101,9 +101,9 @@ public void requestClose() { BowlerStudioModularFrame.getBowlerStudioModularFrame().closeTab(this); } // - private TabPaneBehavior getBehavior() { - return ((TabPaneSkin) getTabPane().getSkin()).getBehavior(); - } +// private TabPaneBehavior getBehavior() { +// return ((TabPaneSkin) getTabPane().getSkin()).getBehavior(); +// } public void setActive(boolean a){ active=a; diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/tabs/LocalFileScriptTab.java b/src/main/java/com/neuronrobotics/bowlerstudio/tabs/LocalFileScriptTab.java index 0250fdc49..09ab3a05a 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/tabs/LocalFileScriptTab.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/tabs/LocalFileScriptTab.java @@ -33,7 +33,7 @@ import javax.swing.text.Highlighter.HighlightPainter; import javafx.application.Platform; -import javafx.embed.swing.MySwingNode; +//import javafx.embed.swing.MySwingNode; import javafx.embed.swing.SwingNode; import javafx.event.EventHandler; import javafx.scene.layout.VBox; @@ -282,7 +282,7 @@ public void mouseClicked(MouseEvent e) { spscrollPane = new RTextScrollPane(textArea); - swingNode = new MySwingNode(this); + swingNode = new javafx.embed.swing.SwingNode(); // swingNode=new javafx.embed.swing.SwingNode(); getScripting().setFocusTraversable(false); diff --git a/src/main/java/javafx/embed/swing/MySwingNode.java b/src/main/java/javafx/embed/swing/MySwingNode.java deleted file mode 100644 index bec3e838b..000000000 --- a/src/main/java/javafx/embed/swing/MySwingNode.java +++ /dev/null @@ -1,163 +0,0 @@ -package javafx.embed.swing; - -import javafx.beans.property.DoubleProperty; -import javafx.scene.layout.VBox; -import javafx.stage.Window; - -public class MySwingNode extends SwingNode { - - VBox myEnclosingNode; - - public MySwingNode(VBox myEnclosingNode) { - this.myEnclosingNode=myEnclosingNode; - } - - /* - * Called on EDT - */ - @Override - void setImageBuffer(final int[] data, - final int x, final int y, - final int w, final int h, - final int linestride, - final int scale) - { - try { - Window win = getScene().getWindow(); - super.setImageBuffer(data, - x, y, - w, h, - linestride, - scale); - }catch(Exception ex){ - ex.printStackTrace(); - } - } - - @Override - void setImageBounds(final int x, final int y, final int w, final int h) { - try { - // this can throw an NPE - Window win = getScene().getWindow(); - super.setImageBounds(x, y, w, h); - - } catch (java.lang.NullPointerException ex) { - ex.printStackTrace(); - } - - } - - @Override - public double prefWidth(double height) { - try { - return super.prefWidth(height); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - double doubleValue = myEnclosingNode.prefWidthProperty().doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - - } - - @Override - public double prefHeight(double height) { - try { - return super.prefHeight(height); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - double doubleValue = myEnclosingNode.prefHeightProperty().doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - - } - /** - * Returns the {@code SwingNode}'s minimum width for use in layout calculations. - * This value corresponds to the minimum width of the Swing component. - * - * @return the minimum width that the node should be resized to during layout - */ - @Override - public double maxWidth(double height) { - try { - return super.maxWidth(height); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - double doubleValue = myEnclosingNode.maxWidthProperty().doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - - } - - /** - * Returns the {@code SwingNode}'s minimum height for use in layout - * calculations. This value corresponds to the minimum height of the Swing - * component. - * - * @return the minimum height that the node should be resized to during layout - */ - @Override - public double maxHeight(double width) { - try { - return super.maxHeight(width); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - double doubleValue = myEnclosingNode.maxHeightProperty().doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - } - - /** - * Returns the {@code SwingNode}'s minimum width for use in layout calculations. - * This value corresponds to the minimum width of the Swing component. - * - * @return the minimum width that the node should be resized to during layout - */ - @Override - public double minWidth(double height) { - try { - return super.minWidth(height); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - DoubleProperty minWidthProperty = myEnclosingNode.minWidthProperty(); - double doubleValue = minWidthProperty.doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - - } - - /** - * Returns the {@code SwingNode}'s minimum height for use in layout - * calculations. This value corresponds to the minimum height of the Swing - * component. - * - * @return the minimum height that the node should be resized to during layout - */ - @Override - public double minHeight(double width) { - try { - return super.minHeight(width); - } catch (Exception e) { - // System.out.println("Error in "+file); - // e.printStackTrace(); - double doubleValue = myEnclosingNode.minHeightProperty().doubleValue(); - if(doubleValue<0) - doubleValue=640; - return doubleValue; - } - } -} \ No newline at end of file From 2c680fb4616d8e4836bcbb52d76bb1a8b82a0ca2 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 12:47:30 -0400 Subject: [PATCH 02/16] compatibility --- libraries/.gitignore | 1 + libraries/bowler-script-kernel | 2 +- libraries/dockfx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/.gitignore b/libraries/.gitignore index 58c32c89c..d5466332e 100644 --- a/libraries/.gitignore +++ b/libraries/.gitignore @@ -1,2 +1,3 @@ /.project /.settings/ +/.classpath diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 55ba49ff0..08252b70f 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 55ba49ff04fed09b8aec0047eeb7f5cc16e84dff +Subproject commit 08252b70f3d1bda7c6539b28a3d6384c53998f86 diff --git a/libraries/dockfx b/libraries/dockfx index bccf51cca..53a813ba2 160000 --- a/libraries/dockfx +++ b/libraries/dockfx @@ -1 +1 @@ -Subproject commit bccf51cca5a9fa9749379803905164367d2a2c12 +Subproject commit 53a813ba234d1d8fa20beff5fc086b6b2adfa365 From e3b6e3d295fcbabe458840c0086531879b1ac4f7 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 17:52:59 -0400 Subject: [PATCH 03/16] depend on the kernels groovy --- build.gradle | 4 ---- libraries/bowler-script-kernel | 2 +- libraries/dockfx | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index bf502ee7c..f65e894d2 100644 --- a/build.gradle +++ b/build.gradle @@ -203,10 +203,6 @@ dependencies { implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.6' - implementation group: 'org.codehaus.groovy', name: 'groovy', version:'2.3.7'; - //make grapes work - implementation group: 'org.apache.ivy', name:'ivy', version:'2.2.0' - implementation group: 'org.controlsfx', name: 'controlsfx', version: '8.0.6' implementation group: 'commons-lang', name: 'commons-lang', version: '2.6' implementation group: 'commons-codec', name: 'commons-codec', version: '1.7' diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 08252b70f..369f3e707 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 08252b70f3d1bda7c6539b28a3d6384c53998f86 +Subproject commit 369f3e707a643a2efabeeab396beb7ad17bd609e diff --git a/libraries/dockfx b/libraries/dockfx index 53a813ba2..8d6fc706f 160000 --- a/libraries/dockfx +++ b/libraries/dockfx @@ -1 +1 @@ -Subproject commit 53a813ba234d1d8fa20beff5fc086b6b2adfa365 +Subproject commit 8d6fc706f73a5ea0e1676fda593f658cdf9ee3f8 From 9ea303fbd5951d460582ea8337fdd25fd3b52757 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 17:53:29 -0400 Subject: [PATCH 04/16] Add the new DockFX API to modular frame where dockfx are maanged --- .../neuronrobotics/bowlerstudio/BowlerStudio.java | 3 +++ .../bowlerstudio/BowlerStudioModularFrame.java | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java index 2e7a752ca..74bbc18bf 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java @@ -53,7 +53,9 @@ import javafx.scene.transform.Affine; import javafx.stage.Stage; +import org.dockfx.DockNode; import org.dockfx.DockPane; +import org.dockfx.IStageModifyer; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.InvalidRefNameException; import org.eclipse.jgit.api.errors.InvalidRemoteException; @@ -849,6 +851,7 @@ public void start(Stage primaryStage) { root.setStyle("-fx-font-size: "+((int)tmp)+"pt"); }); + double sw = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() .getDisplayMode().getWidth(); double sh = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioModularFrame.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioModularFrame.java index b80cf7c2c..be84a509e 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioModularFrame.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioModularFrame.java @@ -5,6 +5,7 @@ **/ import com.neuronrobotics.bowlerstudio.assets.AssetFactory; +import com.neuronrobotics.bowlerstudio.assets.FontSizeManager; import com.neuronrobotics.bowlerstudio.scripting.PasswordManager; import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine; import com.neuronrobotics.bowlerstudio.scripting.ScriptingFileWidget; @@ -16,6 +17,7 @@ import javafx.beans.Observable; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; import javafx.scene.control.Tab; import javafx.scene.image.Image; import javafx.scene.layout.AnchorPane; @@ -25,6 +27,7 @@ import org.dockfx.DockNode; import org.dockfx.DockPane; import org.dockfx.DockPos; +import org.dockfx.IStageModifyer; import java.io.File; import java.io.IOException; @@ -345,6 +348,18 @@ public static Stage getPrimaryStage() { public static void setPrimaryStage(Stage primaryStage) { BowlerStudioModularFrame.primaryStage = primaryStage; + DockNode.addStageToDockingSystem(primaryStage); + DockNode.setModifyer(new IStageModifyer() { + @Override + public void onNewStage(Stage s) { + Parent r = s.getScene().getRoot(); + FontSizeManager.addListener(fontNum->{ + BowlerStudioController.getBowlerStudio().setFontSize(fontNum); + double tmp = FontSizeManager.getImageScale()*9; + r.setStyle("-fx-font-size: "+((int)tmp)+"pt"); + }); + } + }); } public ScriptingFileWidget createFileTab(File file) { From e5803ef141f2fbbdda9e8960d0902fb6e68cf122 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 18:11:36 -0400 Subject: [PATCH 05/16] kkernel --- libraries/bowler-script-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 369f3e707..4ab044913 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 369f3e707a643a2efabeeab396beb7ad17bd609e +Subproject commit 4ab044913c92bef893ce9b7b3e54d36ebb550fac From 8f35ce8606cafede3e3bcdcffaacbb213da9cc52 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 18:27:57 -0400 Subject: [PATCH 06/16] kernel --- libraries/bowler-script-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 4ab044913..3e32a551e 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 4ab044913c92bef893ce9b7b3e54d36ebb550fac +Subproject commit 3e32a551eef4ed4b3b6ebf6d826f85543826d434 From e6173fe538731725cb46b0765638e37d401b0437 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 18:39:34 -0400 Subject: [PATCH 07/16] kernel --- libraries/bowler-script-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index 3e32a551e..c2e0acdf9 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 3e32a551eef4ed4b3b6ebf6d826f85543826d434 +Subproject commit c2e0acdf9f57b7f44082f99f29404e6a899eab25 From 9045f2e8943bfc9046981cc596b14679bcc1c31e Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 16 Jul 2024 19:53:24 -0400 Subject: [PATCH 08/16] using synchronized database --- libraries/bowler-script-kernel | 2 +- .../bowlerstudio/BowlerStudioMenu.java | 21 ++++++---- .../BowlerStudioMenuWorkspace.java | 42 +++++++++---------- .../bowlerstudio/creature/JogWidget.java | 8 ++-- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index c2e0acdf9..a2c445a55 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit c2e0acdf9f57b7f44082f99f29404e6a899eab25 +Subproject commit a2c445a552e550eb5fcb283968a53c15074450ab diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenu.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenu.java index addccd539..0ffc38d20 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenu.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenu.java @@ -241,7 +241,7 @@ private void setToLoggedIn(final String n) { new Thread() { public void run() { //ConfigurationDatabase.loginEvent(username); - ConfigurationDatabase.getParamMap("workspace"); + //ConfigurationDatabase.getParamMap("workspace"); BowlerStudioMenuWorkspace.loginEvent(); if (!PasswordManager.hasNetwork()) return; @@ -269,8 +269,9 @@ public void run() { } private void openFilesInUI() { - HashMap openGits = ConfigurationDatabase.getParamMap("studio-open-git"); - Object[] set = openGits.keySet().toArray(); + String key ="studio-open-git"; + //HashMap openGits = ConfigurationDatabase.getParamMap("studio-open-git"); + Object[] set = ConfigurationDatabase.keySet("studio-open-git").toArray(); for (int i = 0; i < set.length; i++) { try { Thread.sleep(300); @@ -281,22 +282,24 @@ private void openFilesInUI() { String s = (String) set[i]; try { @SuppressWarnings("unchecked") - ArrayList repoFile = (ArrayList) openGits.get(s); + ArrayList repoFile = (ArrayList) ConfigurationDatabase.getObject(key,s, new ArrayList<>()); File f = ScriptingEngine.fileFromGit(repoFile.get(0), repoFile.get(1)); if (!f.exists() || BowlerStudio.createFileTab(f) == null) { - openGits.remove(s); + ConfigurationDatabase.removeObject(key, s); System.err.println("Removing missing " + s); } } catch (Throwable e) { - openGits.remove(s); + ConfigurationDatabase.removeObject(key, s); System.out.println("Error loading file " + s); } } } - HashMap openWeb = ConfigurationDatabase.getParamMap("studio-open-web"); - for (String s : openWeb.keySet()) { - String repoFile = (String) openWeb.get(s); + //HashMap openWeb = ConfigurationDatabase.getParamMap("studio-open-web"); + String webKey="studio-open-web"; + for (String s : ConfigurationDatabase.keySet(webKey)) { + String repoFile = (String) ConfigurationDatabase.getObject(webKey,s,null); + if(repoFile!=null) try { bowlerStudioModularFrame.openUrlInNewTab(new URL(repoFile)); } catch (Exception e) { diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenuWorkspace.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenuWorkspace.java index 841808511..551a5e163 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenuWorkspace.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudioMenuWorkspace.java @@ -22,6 +22,7 @@ @SuppressWarnings("restriction") public class BowlerStudioMenuWorkspace { + private static final String key = "workspace"; private static Menu workspaceMenu; private static final int maxMenueSize = 20; private static boolean sorting = false; @@ -41,9 +42,10 @@ public static void loginEvent() { rank.clear(); new Thread(() -> { if (ScriptingEngine.hasNetwork()) - for (int i = 0; i < getWorkspaceData().keySet().size(); i++) { + + for (int i = 0; i < ConfigurationDatabase.keySet(key).size(); i++) { try { - String o = (String) getWorkspaceData().keySet().toArray()[i]; + String o = (String) ConfigurationDatabase.keySet(key).toArray()[i]; if (o.endsWith(".git")) { boolean wasState = ScriptingEngine.isPrintProgress(); ScriptingEngine.setPrintProgress(false); @@ -57,7 +59,7 @@ public static void loginEvent() { BowlerStudioMenu.checkandDelete(o); }catch (Throwable ex) { ex.printStackTrace(); - getWorkspaceData().remove(o); + ConfigurationDatabase.removeObject(key, o); // ScriptingEngine.deleteRepo(o); // i--; } @@ -65,7 +67,7 @@ public static void loginEvent() { } else { - getWorkspaceData().remove(o); + ConfigurationDatabase.remove(key,o); } } catch (Exception e) { e.printStackTrace(); @@ -89,16 +91,16 @@ public static void add(String url, String menueMessage) { menueMessage = new Date().toString(); } ArrayList data; - if (getWorkspaceData() != null) - synchronized (getWorkspaceData()) { - if (getWorkspaceData().get(url) == null) { + + + if (ConfigurationDatabase.getObject(key,url,null) == null) { data = new ArrayList(); data.add(menueMessage); data.add(new Long(System.currentTimeMillis()).toString()); - getWorkspaceData().put(url, data); + ConfigurationDatabase.put(key,url, data); //System.out.println("Workspace add: " + url); } - } + // data = (ArrayList) workspaceData.get(url); // data.set(1, new Long(System.currentTimeMillis()).toString()); sort(); @@ -115,20 +117,20 @@ public static void sort() { boolean rankChanged = false; try { ArrayList myOptions = new ArrayList(); - synchronized (getWorkspaceData()) { - for (String o : getWorkspaceData().keySet()) { + + for (String o : ConfigurationDatabase.keySet(key)) { // System.out.println("Opt: "+o); myOptions.add(o); } - } + ArrayList menu = new ArrayList<>(); while (myOptions.size() > 0) { int bestIndex = 0; String besturl = (String) myOptions.get(bestIndex); - long newestTime = Long.parseLong(((ArrayList) getWorkspaceData().get(besturl)).get(1)); + long newestTime = Long.parseLong(((ArrayList) ConfigurationDatabase.get(key,besturl)).get(1)); for (int i = 0; i < myOptions.size(); i++) { String nowurl = (String) myOptions.get(i); - long myTime = Long.parseLong(((ArrayList) getWorkspaceData().get(nowurl)).get(1)); + long myTime = Long.parseLong(((ArrayList) ConfigurationDatabase.get(key,nowurl)).get(1)); if (myTime >= newestTime) { newestTime = myTime; besturl = nowurl; @@ -176,7 +178,7 @@ public static void sort() { new Thread(() -> { for (String url : menu) { //System.out.println("Workspace : " + url); - ArrayList arrayList = (ArrayList) getWorkspaceData().get(url); + ArrayList arrayList = (ArrayList) ConfigurationDatabase.getObject(key,url,new ArrayList<>()); if (arrayList != null) BowlerStudioMenu.setUpRepoMenue(workspaceMenu, url, false, false, arrayList.get(0)); @@ -199,14 +201,12 @@ public static void sort() { } } - public static HashMap getWorkspaceData() { - return ConfigurationDatabase.getParamMap("workspace"); - } +// public static HashMap getWorkspaceData() { +// return ConfigurationDatabase.getParamMap("workspace"); +// } public static void remove(String url) { - synchronized (getWorkspaceData()) { - getWorkspaceData().remove(url); - } + ConfigurationDatabase.removeObject(key, url); } } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/JogWidget.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/JogWidget.java index b5a57048c..ca37a0c5b 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/JogWidget.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/JogWidget.java @@ -360,10 +360,12 @@ public void setGameController(BowlerJInputDevice gameController) { game.setText("Remove Game Controller"); paramsKey = gameController.getControllerName(); - HashMap map = ConfigurationDatabase.getParamMap(paramsKey); + //HashMap map = ConfigurationDatabase.getParamMap(paramsKey); boolean hasmap = false; - if (map.containsKey("jogKinx") && map.containsKey("jogKiny") && map.containsKey("jogKinz") - && map.containsKey("jogKinslider")) { + if (ConfigurationDatabase.containsKey(paramsKey,"jogKinx") && + ConfigurationDatabase.containsKey(paramsKey,"jogKiny") && + ConfigurationDatabase.containsKey(paramsKey,"jogKinz") + && ConfigurationDatabase.containsKey(paramsKey,"jogKinslider")) { hasmap = true; } From e5cca37d8ac57b7cc90508f51cb3e1ad49da15a2 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Wed, 17 Jul 2024 11:05:49 -0400 Subject: [PATCH 09/16] Use the config file for app nname --- libraries/bowler-script-kernel | 2 +- src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index a2c445a55..d99eb87bb 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit a2c445a552e550eb5fcb283968a53c15074450ab +Subproject commit d99eb87bb59741998cdb0f1792bacdf920ebe9d4 diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java index 74bbc18bf..23b90e2ed 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java @@ -957,7 +957,7 @@ public void onDeviceRemoved(BowlerAbstractDevice arg0) { public static void setTitle(String title) { if(title==null) - title="Bowler Studio: v " + StudioBuildInfo.getVersion(); + title=StudioBuildInfo.getAppName()+" v " + StudioBuildInfo.getVersion(); if(primaryStage2!=null) primaryStage2.setTitle(title); } From 0e9ae818cc8b33f55dcfbbe9829f3c6bb58357a1 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 09:49:49 -0400 Subject: [PATCH 10/16] force the forbidden ref in the gradle buid --- build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f65e894d2..aa28986ff 100644 --- a/build.gradle +++ b/build.gradle @@ -71,6 +71,7 @@ plugins { id 'java' id 'signing' id 'application' + id 'eclipse' } apply plugin: 'com.github.johnrengelman.shadow' if (project == rootProject) { @@ -406,7 +407,17 @@ task ('showAll') { } } } - +eclipse{ + jdt { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + file { + withProperties { properties -> + properties.setProperty('org.eclipse.jdt.core.compiler.problem.forbiddenReference', 'ignore') + } + } + } +} shadowJar { zip64 true mainClassName = 'com.neuronrobotics.bowlerstudio.BowlerStudio' From 419eef776db9e73b6620436d20b4df89a0749555 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 10:13:36 -0400 Subject: [PATCH 11/16] DockFX is now Java 8-17 compliant! --- libraries/dockfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/dockfx b/libraries/dockfx index 8d6fc706f..97acab24c 160000 --- a/libraries/dockfx +++ b/libraries/dockfx @@ -1 +1 @@ -Subproject commit 8d6fc706f73a5ea0e1676fda593f658cdf9ee3f8 +Subproject commit 97acab24c6aae7f77e9fd523bfb67f93fec406c7 From ef4e95759c4524a0ef2508161f60a040d454bc15 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 10:26:03 -0400 Subject: [PATCH 12/16] Using correct Log --- .../com/neuronrobotics/bowlerstudio/GistHelper.java | 5 +++-- .../creature/MobleBaseMenueFactory.java | 13 +++++++------ .../bowlerstudio/creature/ParallelWidget.java | 2 +- .../neuronrobotics/nrconsole/util/CommitWidget.java | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/GistHelper.java b/src/main/java/com/neuronrobotics/bowlerstudio/GistHelper.java index e97d13ecc..2097c67df 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/GistHelper.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/GistHelper.java @@ -2,9 +2,10 @@ import com.neuronrobotics.bowlerstudio.scripting.PasswordManager; import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine; +import com.neuronrobotics.sdk.common.Log; import com.neuronrobotics.sdk.util.ThreadUtil; import org.eclipse.jgit.api.errors.GitAPIException; -import org.jfree.util.Log; +//import org.jfree.util.Log; import org.kohsuke.github.GHGist; import org.kohsuke.github.GHGistBuilder; import org.kohsuke.github.GHGistFile; @@ -89,7 +90,7 @@ private static String createGistFromBuilder(GHGistBuilder builder, String filena } ThreadUtil.wait(500); - Log.warn(filename + " not built yet"); + //Log.warn(filename + " not built yet"); } System.out.println("Creating gist at " + filename); diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobleBaseMenueFactory.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobleBaseMenueFactory.java index 410904eaf..f09937410 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobleBaseMenueFactory.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobleBaseMenueFactory.java @@ -20,6 +20,7 @@ import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR; import com.neuronrobotics.sdk.addons.kinematics.parallel.ParallelGroup; import com.neuronrobotics.sdk.common.DeviceManager; +import com.neuronrobotics.sdk.common.Log; import com.neuronrobotics.sdk.util.ThreadUtil; import javafx.application.Platform; import javafx.fxml.FXMLLoader; @@ -39,7 +40,7 @@ import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.InvalidRemoteException; import org.eclipse.jgit.api.errors.TransportException; -import org.jfree.util.Log; +//import org.jfree.util.Log; import org.kohsuke.github.GHCreateRepositoryBuilder; import org.kohsuke.github.GHGist; import org.kohsuke.github.GHGistBuilder; @@ -359,7 +360,7 @@ public void run() { TreeItem setCAD = new TreeItem<>("Set CAD Engine...", AssetFactory.loadIcon("Set-CAD-Engine.png")); callbackMapForTreeitems.put(setCAD, () -> { PromptForGit.prompt("Select a CAD Engine From a Gist", device.getGitCadEngine()[0], (gitsId, file) -> { - Log.warn("Loading cad engine"); + Log.warning("Loading cad engine"); try { creatureLab.setGitCadEngine(gitsId, file, device); File code = ScriptingEngine.fileFromGit(gitsId, file); @@ -386,7 +387,7 @@ public void run() { callbackMapForTreeitems.put(resetWalking, () -> { PromptForGit.prompt("Select a Walking Engine From a Gist", device.getGitWalkingEngine()[0], (gitsId, file) -> { - Log.warn("Loading walking engine"); + Log.warning("Loading walking engine"); try { creatureLab.setGitWalkingEngine(gitsId, file, device); File code = ScriptingEngine.fileFromGit(gitsId, file); @@ -683,7 +684,7 @@ public void run() { } ThreadUtil.wait(500); - Log.warn(gist + " not built yet"); + Log.warning(gist + " not built yet"); } // BowlerStudio.openUrlInNewTab(gist.getHtmlUrl()); System.out.println("Creating gist at: " + gitURL); @@ -1460,7 +1461,7 @@ public void onTransformChaging(TransformNR newTrans) { TreeItem setCAD = new TreeItem<>("Set CAD Engine...", AssetFactory.loadIcon("Set-CAD-Engine.png")); callbackMapForTreeitems.put(setCAD, () -> { PromptForGit.prompt("Select a CAD Engine From Git", dh.getGitCadEngine()[0], (gitsId, file) -> { - Log.warn("Loading cad engine"); + Log.warning("Loading cad engine"); try { creatureLab.setGitCadEngine(gitsId, file, dh); openCadTab(creatureLab, gitsId, file); @@ -1485,7 +1486,7 @@ public void onTransformChaging(TransformNR newTrans) { AssetFactory.loadIcon("Set-DH-Kinematics.png")); callbackMapForTreeitems.put(resetWalking, () -> { PromptForGit.prompt("Select a DH Solver Engine From Git", dh.getGitDhEngine()[0], (gitsId, file) -> { - Log.warn("Loading walking engine"); + Log.warning("Loading walking engine"); try { creatureLab.setGitDhEngine(gitsId, file, dh); File code = ScriptingEngine.fileFromGit(gitsId, file); diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/ParallelWidget.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/ParallelWidget.java index 4622cfbbe..5260da224 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/ParallelWidget.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/ParallelWidget.java @@ -1,6 +1,6 @@ package com.neuronrobotics.bowlerstudio.creature; -import org.jfree.util.Log; +//import org.jfree.util.Log; import com.neuronrobotics.bowlerstudio.BowlerStudio; import com.neuronrobotics.bowlerstudio.IssueReportingExceptionHandler; diff --git a/src/main/java/com/neuronrobotics/nrconsole/util/CommitWidget.java b/src/main/java/com/neuronrobotics/nrconsole/util/CommitWidget.java index 3590dd4b7..ad2f165e6 100644 --- a/src/main/java/com/neuronrobotics/nrconsole/util/CommitWidget.java +++ b/src/main/java/com/neuronrobotics/nrconsole/util/CommitWidget.java @@ -4,12 +4,13 @@ import java.util.Optional; import org.eclipse.jgit.api.Git; -import org.jfree.util.Log; +//import org.jfree.util.Log; import com.neuronrobotics.bowlerstudio.BowlerStudio; import com.neuronrobotics.bowlerstudio.IssueReportingExceptionHandler; import com.neuronrobotics.bowlerstudio.assets.FontSizeManager; import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine; +import com.neuronrobotics.sdk.common.Log; import com.neuronrobotics.video.OSUtil; import javafx.application.Platform; From 24706aee83a2460a32a6c01fb9f58c11141a49b8 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 10:34:30 -0400 Subject: [PATCH 13/16] Modularize the spash screen --- .../bowlerstudio/PsudoSplash.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java b/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java index 167340d1c..2caad2bed 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java @@ -3,19 +3,15 @@ import java.awt.AlphaComposite; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Container; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.GraphicsDevice; -import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.IOException; +import java.net.URL; -import javafx.scene.image.Image; import javax.imageio.ImageIO; -import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.UIManager; @@ -29,6 +25,8 @@ public class PsudoSplash implements GitLogProgressMonitor{ JFrame interfaceFrame; private String message = ""; private String log = ""; + private URL resource = getClass().getResource("splash.png"); + @Override public void onUpdate(String update, Exception e) { //e.printStackTrace(System.err); @@ -55,7 +53,7 @@ public CustomPanel() { * | | package image(folder) ( or | .class 404error.jpg files, if no package * exists.) */ - image = ImageIO.read(getClass().getResource("splash.png")); + image = ImageIO.read(getResource()); } catch (IOException ioe) { System.out.println("Unable to fetch image."); @@ -130,7 +128,7 @@ public void run() { interfaceFrame.setVisible(true); interfaceFrame.setBackground(new Color(0, 0, 0, 0)); try { - interfaceFrame.setIconImage(ImageIO.read(getClass().getResource("splash.png"))); + interfaceFrame.setIconImage(ImageIO.read(resource)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -194,5 +192,13 @@ public void setMessage(String message) { log=""; } + public URL getResource() { + return resource; + } + + public void setResource(URL resource) { + this.resource = resource; + } + } From 368150dca480a7577f62d8e297d33366a9ce92b8 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 10:40:11 -0400 Subject: [PATCH 14/16] Make spash resource static --- .../java/com/neuronrobotics/bowlerstudio/PsudoSplash.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java b/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java index 2caad2bed..f5137a409 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java @@ -25,7 +25,7 @@ public class PsudoSplash implements GitLogProgressMonitor{ JFrame interfaceFrame; private String message = ""; private String log = ""; - private URL resource = getClass().getResource("splash.png"); + private static URL resource = PsudoSplash.class.getResource("splash.png"); @Override public void onUpdate(String update, Exception e) { @@ -192,12 +192,12 @@ public void setMessage(String message) { log=""; } - public URL getResource() { + public static URL getResource() { return resource; } - public void setResource(URL resource) { - this.resource = resource; + public static void setResource(URL r) { + resource = r; } From f86ddaba1540ecc6519acbd71c654b7bec8261d5 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 18 Jul 2024 11:19:00 -0400 Subject: [PATCH 15/16] use the splash Image as the Application Icon in the tray --- .../java/com/neuronrobotics/bowlerstudio/BowlerStudio.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java index 23b90e2ed..4088e65bc 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java @@ -50,6 +50,7 @@ import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.TextArea; +import javafx.scene.image.Image; import javafx.scene.transform.Affine; import javafx.stage.Stage; @@ -905,7 +906,9 @@ public void start(Stage primaryStage) { setTitle(null); try { - primaryStage.getIcons().add(AssetFactory.loadAsset("BowlerStudioTrayIcon.png")); + + Image loadAsset = new Image(PsudoSplash.getResource().toString()); + primaryStage.getIcons().add(loadAsset); } catch (Exception e) { reporter.uncaughtException(Thread.currentThread(), e); From 3701f2202c45f343a30ef716a68f7cec1d8af720 Mon Sep 17 00:00:00 2001 From: Kevin harrington Date: Fri, 19 Jul 2024 13:49:01 -0400 Subject: [PATCH 16/16] vitamin location update --- libraries/bowler-script-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/bowler-script-kernel b/libraries/bowler-script-kernel index d99eb87bb..f1e7f5ec2 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit d99eb87bb59741998cdb0f1792bacdf920ebe9d4 +Subproject commit f1e7f5ec2d78b8218a42029ec14b72c2889bc38f