Skip to content

Commit

Permalink
updated the internal API
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Apr 7, 2024
1 parent e3f450e commit 948b41d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@
import javafx.scene.Parent;
import javafx.fxml.FXMLLoader;

public class VitaminWidgetTest extends Application {
public class VitaminWidgetTest extends Application {
private VitatminWidget tw;

@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = AssetFactory.loadLayout("layout/AddRemoveVitamins.fxml");
FXMLLoader loader = AssetFactory.loadLayout("layout/AddRemoveVitamins.fxml");
loader.setClassLoader(VitatminWidget.class.getClassLoader());
Parent w = loader.load();
tw = loader.getController();



File layoutFile = AssetFactory.loadFile("layout/default.css");
String nwfile = layoutFile.toURI().toString().replace("file:/", "file:///");
Scene scene = new Scene(w);

scene.getStylesheets().clear();
scene.getStylesheets().add(nwfile);
System.err.println("Loading CSS from " + nwfile);

primaryStage.setScene(scene);
primaryStage.setWidth(600);
primaryStage.setHeight(777);
primaryStage.setTitle("Test Application");
primaryStage.show();
primaryStage.setWidth(600);
primaryStage.setHeight(777);
primaryStage.setTitle("Test Application");
primaryStage.show();

}

public static void main(String[] args) {
JavaFXInitializer.go();
BowlerStudio.runLater(() -> {
Stage s = new Stage();
//
//
VitaminWidgetTest controller = new VitaminWidgetTest();
try {
controller.start(s);
Expand All @@ -54,26 +54,29 @@ public static void main(String[] args) {
VitatminWidget tw = controller.getTw();
new Thread(() -> {
try {
MobileBase mb = (MobileBase) ScriptingEngine.gitScriptRun("https://github.com/NeuronRobotics/NASACurisoity.git", "NASA_Curiosity.xml");
MobileBase mb = (MobileBase) ScriptingEngine
.gitScriptRun("https://github.com/NeuronRobotics/NASACurisoity.git", "NASA_Curiosity.xml");
tw.setVitaminProvider(mb.getAllDHChains().get(0).getLinkConfiguration(0));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}).start();
}).start();
});
}

/**
* @return the tw
*/
public VitatminWidget getTw() {
return tw;
}

/**
* @param tw the tw to set
*/
public void setTw(VitatminWidget tw) {
if(tw==null)
if (tw == null)
throw new RuntimeException();
this.tw = tw;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,14 @@ private void load(ScriptingWidgetType type, File currentFile) {
controlPane.getChildren().add(autoRun);
controlPane.getChildren().add(publish);
controlPane.getChildren().add(openFile);
controlPane.getChildren().add(new Label("file:"));
Label e = new Label("file:");
e.setMinWidth(30);
controlPane.getChildren().add(e);
controlPane.getChildren().add(fileNameBox);
fileNameBox.setMaxWidth(Double.MAX_VALUE);
controlPane.getChildren().add(new Label("git:"));
Label e2 = new Label("git:");
e2.setMinWidth(30);
controlPane.getChildren().add(e2);
controlPane.getChildren().add(fileListBox);
fileListBox.setMaxWidth(Double.MAX_VALUE);
controlPane.setMaxWidth(Double.MAX_VALUE);
Expand Down

0 comments on commit 948b41d

Please sign in to comment.