diff --git a/build.gradle b/build.gradle index bf502ee7c..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) { @@ -203,10 +204,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' @@ -410,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' 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 2f3be2717..f1e7f5ec2 160000 --- a/libraries/bowler-script-kernel +++ b/libraries/bowler-script-kernel @@ -1 +1 @@ -Subproject commit 2f3be2717bef9ed9def8cdf3c6a1a2a19ab6fd01 +Subproject commit f1e7f5ec2d78b8218a42029ec14b72c2889bc38f diff --git a/libraries/dockfx b/libraries/dockfx index 7dbd26fe8..97acab24c 160000 --- a/libraries/dockfx +++ b/libraries/dockfx @@ -1 +1 @@ -Subproject commit 7dbd26fe86de957fe60bd91ce1f2150f9aebbe79 +Subproject commit 97acab24c6aae7f77e9fd523bfb67f93fec406c7 diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java index 2e7a752ca..4088e65bc 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerStudio.java @@ -50,10 +50,13 @@ 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; +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 +852,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() @@ -902,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); @@ -954,7 +960,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); } 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/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) { 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/PsudoSplash.java b/src/main/java/com/neuronrobotics/bowlerstudio/PsudoSplash.java index 167340d1c..f5137a409 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 static URL resource = PsudoSplash.class.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 static URL getResource() { + return resource; + } + + public static void setResource(URL r) { + resource = r; + } + } 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; } 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/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/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; 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