Skip to content

Commit

Permalink
Merge pull request #48 from CommonWealthRobotics/kh/add-scenebuilder
Browse files Browse the repository at this point in the history
Kh/add scenebuilder
  • Loading branch information
madhephaestus committed Jul 11, 2024
2 parents 47ec0db + 0e3afaa commit 77be555
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,11 @@ private static File getExecutable(String exeType, IExternalEditor editor, String
if (type.toLowerCase().contains("dmg")) {
dmgExtract(jvmArchive, bindir + targetdir, exeInZip);
}
if (type.toLowerCase().contains("appimage") || type.toLowerCase().contains("exe")
|| type.toLowerCase().contains("msi")) {
if ( type.toLowerCase().contains("appimage") ||
type.toLowerCase().contains("exe") ||
type.toLowerCase().contains("msi")||
type.toLowerCase().contains("jar")
) {
standaloneEXE(type, name, targetdir, cmd);
}
// extract7zArchive
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.neuronrobotics.bowlerstudio.scripting;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;

import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;

import eu.mihosoft.vrl.v3d.CSG;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Tab;
import javafx.scene.layout.Pane;

public class FXMLBowlerLoader implements IScriptingLanguage {

@Override
public Object inlineScriptRun(File xml, ArrayList<Object> args) throws Exception {
FXMLLoader loader = new FXMLLoader(xml.toURI().toURL());
Pane newLoadedPane = loader.load();
// Create a tab
Tab myTab = new Tab();
//set the title of the new tab
myTab.setContent(newLoadedPane);
return myTab;
}

@Override
public Object inlineScriptRun(String code, ArrayList<Object> args) throws Exception {
throw new RuntimeException("This engine only supports files");
}

@Override
public String getShellType() {
// TODO Auto-generated method stub
return "fxml";
}
@Override
public boolean getIsTextFile() {
// TODO Auto-generated method stub
return true;
}
/**
* Get the contents of an empty file
*
* @return
*/
public String getDefaultContents() {
return "";
}
@Override
public ArrayList<String> getFileExtenetion() {
// TODO Auto-generated method stub
return new ArrayList<>(Arrays.asList("fxml","FXML","FxML"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public class ScriptingEngine {// this subclasses boarder pane for the widgets
addScriptingLanguage(new SequenceRunner());
addScriptingLanguage(new BlenderLoader());
addScriptingLanguage(new FreecadLoader());
addScriptingLanguage(new FXMLBowlerLoader());
}

public static void setWorkspace(File file) {
Expand Down

0 comments on commit 77be555

Please sign in to comment.