forked from BancroftRoboDogs/LabCodeRepoSetup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.groovy
30 lines (23 loc) · 885 Bytes
/
main.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine
import javafx.fxml.FXMLLoader
import javafx.scene.control.Tab
import javafx.scene.layout.Pane
// This is a simple linkages generator
println "Launching Lab Code Configuration"
def controller = ScriptingEngine.gitScriptRun(
"https://github.com/WPIRoboticsEngineering/LabCodeRepoSetup.git", // git location of the library
"uicontroller.groovy" , // file to load
null
)
File xml = ScriptingEngine.fileFromGit("https://github.com/WPIRoboticsEngineering/LabCodeRepoSetup.git", "main.fxml")
FXMLLoader loader = new FXMLLoader(xml.toURI().toURL())
loader.setController(controller)
Pane newLoadedPane = loader.load();
Thread.sleep(1000);
// Create a tab
Tab myTab = new Tab();
//set the title of the new tab
myTab.setText("Lab Code Repo Setup");
//add content to the tab
myTab.setContent(newLoadedPane);
return myTab