diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLab.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLab.java index b9c3ed2ee..a83495022 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLab.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLab.java @@ -48,7 +48,8 @@ public class CreatureLab extends AbstractBowlerStudioTab implements IOnEngineeri private ProgressIndicator pi; private MobileBaseCadManager baseManager; - private CheckBox autoRegen = new CheckBox("Auto-Regen CAD"); + private CheckBox autoRegen = new CheckBox("Auto-Generate CAD"); + private Button regen=new Button("Generate Cad Now"); Parent root; private BowlerJInputDevice gameController = null; CreatureLabControlsTab tab = new CreatureLabControlsTab(); @@ -79,6 +80,11 @@ public void initializeUI(BowlerAbstractDevice pm) { autoRegen.setOnAction(event -> { regenFromUiEvent(); }); + regen.setDisable(true); + regen.setOnAction(event -> { + autoRegen.setSelected(true); + regenFromUiEvent(); + }); // TODO Auto-generated method stub setText(pm.getScriptingName()); @@ -135,6 +141,7 @@ private void regenFromUiEvent() { autoRegen.setDisable(true); if (radioOptions != null) radioOptions.setDisable(true); + regen.setDisable(true); } baseManager.setAutoRegen(autoRegen.isSelected()); if (autoRegen.isSelected()) { @@ -263,14 +270,15 @@ public void run() { baseManager = MobileBaseCadManager.get(device, BowlerStudioController.getMobileBaseUI()); pi.progressProperty().bindBidirectional(baseManager.getProcesIndictor()); HBox progressIndicatorPanel = new HBox(10); - progressIndicatorPanel.getChildren().addAll(new Label("Cad Progress:"), pi); - progress.getChildren().addAll(progressIndicatorPanel, autoRegen, radioOptions); - progress.setStyle("-fx-background-color: #FFFFFF;"); - progress.setOpacity(.7); - progress.setMinHeight(100); - progress.setPrefSize(325, 150); - tab.setOverlayTop(progress); + progress.getChildren().addAll( regen,autoRegen, radioOptions); + progressIndicatorPanel.getChildren().addAll( progress,pi); + + progressIndicatorPanel.setStyle("-fx-background-color: #FFFFFF;"); + progressIndicatorPanel.setOpacity(.7); + progressIndicatorPanel.setMinHeight(100); + progressIndicatorPanel.setPrefSize(325, 150); + tab.setOverlayTop(progressIndicatorPanel); BowlerStudioModularFrame.getBowlerStudioModularFrame().showCreatureLab(); setCadMode(true);// start the UI in config mode @@ -286,6 +294,8 @@ public void changed(ObservableValue observable, Number oldValu autoRegen.setDisable(false); if (radioOptions != null) radioOptions.setDisable(false); + regen.setDisable(false); + }); } } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLabControlsTab.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLabControlsTab.java index 1a14b9fc0..750eab81b 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLabControlsTab.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CreatureLabControlsTab.java @@ -4,6 +4,7 @@ import javafx.fxml.FXML; import javafx.scene.control.TreeView; import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; public class CreatureLabControlsTab { @@ -53,7 +54,7 @@ public void setTreeBox(AnchorPane treeBox) { } - public void setOverlayTop(VBox progress) { + public void setOverlayTop(HBox progress) { // TODO Auto-generated method stub BowlerStudio.runLater(()->{ progressBar.getChildren().clear();