Search in sources :

Example 6 with TitledPane

use of javafx.scene.control.TitledPane in project arquivoProject by fader-azevedo.

the class PdfViewerController method showErrorMessage.

private void showErrorMessage(String message, Throwable exception) {
    // TODO: move to fxml (or better, use ControlsFX)
    final Stage dialog = new Stage();
    dialog.initOwner(pagination.getScene().getWindow());
    dialog.initStyle(StageStyle.UNDECORATED);
    final VBox root = new VBox(10);
    root.setPadding(new Insets(10));
    StringWriter errorMessage = new StringWriter();
    exception.printStackTrace(new PrintWriter(errorMessage));
    final Label detailsLabel = new Label(errorMessage.toString());
    TitledPane details = new TitledPane();
    details.setText("Details:");
    Label briefMessageLabel = new Label(message);
    final HBox detailsLabelHolder = new HBox();
    Button closeButton = new Button("OK");
    closeButton.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent event) {
            dialog.hide();
        }
    });
    HBox closeButtonHolder = new HBox();
    closeButtonHolder.getChildren().add(closeButton);
    closeButtonHolder.setAlignment(Pos.CENTER);
    closeButtonHolder.setPadding(new Insets(5));
    root.getChildren().addAll(briefMessageLabel, details, detailsLabelHolder, closeButtonHolder);
    details.setExpanded(false);
    details.setAnimated(false);
    details.expandedProperty().addListener(new ChangeListener<Boolean>() {

        @Override
        public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
            if (newValue) {
                detailsLabelHolder.getChildren().add(detailsLabel);
            } else {
                detailsLabelHolder.getChildren().remove(detailsLabel);
            }
            dialog.sizeToScene();
        }
    });
    final Scene scene = new Scene(root);
    dialog.setScene(scene);
    dialog.show();
}
Also used : TitledPane(javafx.scene.control.TitledPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) ActionEvent(javafx.event.ActionEvent) Label(javafx.scene.control.Label) Scene(javafx.scene.Scene) StringWriter(java.io.StringWriter) Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) VBox(javafx.scene.layout.VBox) PrintWriter(java.io.PrintWriter)

Example 7 with TitledPane

use of javafx.scene.control.TitledPane in project Gargoyle by callakrsos.

the class NrchRealtimeSrchFlowComposite method init.

protected void init() {
    lblRequestTime.setMaxHeight(Double.MAX_VALUE);
    choWaitItems = new ChoiceBox<>(FXCollections.observableArrayList("", "5", "10", "15", "20", "25", "30"));
    Button btnReload = new Button("Reload");
    HBox hboxItems = new HBox(5, /* choWaitItems, new Label("단위 (초)"), chkTimer, */
    btnReload, lblRequestTime);
    hboxItems.setAlignment(Pos.CENTER_LEFT);
    hboxItems.setPadding(new Insets(5));
    BorderPane borTop = new BorderPane();
    Button btnStart = new Button("시작");
    Button btnStop = new Button("중지");
    btnStart.setDisable(true);
    btnStop.setDisable(true);
    borTop.setTop(new TitledPane("Timer", new HBox(5, choWaitItems, btnStart, btnStop)));
    borTop.setCenter(hboxItems);
    this.getParent().setTop(borTop);
    btnReload.setOnAction(ev -> {
        reload();
    });
    choWaitItems.valueProperty().addListener((oba, o, n) -> {
        if (ValueUtil.isNotEmpty(n) && !isRecycle.get()) {
            btnStart.setDisable(false);
        } else {
            btnStart.setDisable(true);
        }
    });
    btnStart.setOnAction(e -> {
        isRecycle.set(true);
        service.restart();
        btnStart.setDisable(true);
        btnStop.setDisable(false);
    });
    btnStop.setOnAction(e -> {
        isRecycle.set(false);
        service.cancel();
        btnStart.setDisable(false);
        btnStop.setDisable(true);
    });
    isRecycle.addListener((oba, o, n) -> {
        if (n) {
            choWaitItems.setDisable(true);
        } else {
            choWaitItems.setDisable(false);
        }
    });
    defineService();
    try {
        service.setExecutor(gargoyleThreadExecutors);
        service.start();
    } catch (RejectedExecutionException e) {
        if (gargoyleThreadExecutors.isShutdown() || gargoyleThreadExecutors.isTerminated()) {
            gargoyleThreadExecutors = ExecutorDemons.newFixedThreadExecutor(REALTIME_SRCH_THREAD_POOL_NAME, 1);
            service.setExecutor(gargoyleThreadExecutors);
        }
        LOGGER.error(ValueUtil.toString(e));
        // One more time.
        defineService();
        service.start();
    }
// reload();
}
Also used : TitledPane(javafx.scene.control.TitledPane) HBox(javafx.scene.layout.HBox) BorderPane(javafx.scene.layout.BorderPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) MouseButton(javafx.scene.input.MouseButton) RejectedExecutionException(java.util.concurrent.RejectedExecutionException)

Example 8 with TitledPane

use of javafx.scene.control.TitledPane in project jgnash by ccavanaugh.

the class TabViewPane method addTab.

public void addTab(final Node node, final String description) {
    BorderPane borderPane = new BorderPane();
    TitledPane titledPane = new TitledPane(description, null);
    titledPane.setCollapsible(false);
    titledPane.setExpanded(false);
    titledPane.setFocusTraversable(false);
    titledPane.getStyleClass().add(VIEW_TITLE);
    borderPane.setTop(titledPane);
    borderPane.setCenter(node);
    Tab tab = new Tab();
    tab.setText(description);
    tab.setContent(borderPane);
    getTabs().add(tab);
}
Also used : TitledPane(javafx.scene.control.TitledPane) BorderPane(javafx.scene.layout.BorderPane) Tab(javafx.scene.control.Tab)

Example 9 with TitledPane

use of javafx.scene.control.TitledPane in project TeachingInSimulation by ScOrPiOzzy.

the class PreparationMenu method initialize.

/**
 * 界面初始化
 * @param catalog
 */
private void initialize(Catalog subject) {
    this.subject.setText(subject.getName());
    this.projects.getPanes().clear();
    this.group.getToggles().clear();
    List<Catalog> projects = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(subject.getId());
    for (Catalog project : projects) {
        TitledPane pane = new TitledPane();
        pane.setOnMousePressed(e -> {
            if (pane.getContent() == null) {
                initializeContent(pane, project);
                pane.setOnMousePressed(null);
            }
        });
        pane.setGraphic(createGraphicTitle(project));
        this.projects.getPanes().add(pane);
    }
}
Also used : TitledPane(javafx.scene.control.TitledPane) CatalogAction(com.cas.sim.tis.action.CatalogAction) Catalog(com.cas.sim.tis.entity.Catalog)

Example 10 with TitledPane

use of javafx.scene.control.TitledPane in project aic-praise by aic-sri-international.

the class QueryController method displayQueryAnswer.

private void displayQueryAnswer(String query, Expression result, HOGModel parsedModel, long millisecondsToCompute) {
    String answer = "P(" + query + " | ... ) = " + result;
    String timeTaken = Util.toHoursMinutesAndSecondsString(millisecondsToCompute);
    String title = "Query took " + timeTaken + " to compute '" + answer + "'";
    HOGMCodeArea resultCodeArea = new HOGMCodeArea(false);
    resultCodeArea.setText(answer);
    resultCodeArea.setEditable(false);
    Node resultContent = null;
    if (PRAiSEController.isInDebugMode()) {
        HOGMCodeArea parsedModelArea = createParsedModelView(parsedModel);
        TabPane resultTabs = new TabPane();
        resultTabs.getTabs().add(new Tab("Answer", resultCodeArea));
        resultTabs.getTabs().add(new Tab("Parsed As", parsedModelArea));
        resultContent = resultTabs;
    } else {
        resultContent = resultCodeArea;
    }
    TitledPane resultPane = new TitledPane(title, resultContent);
    FXUtil.setTitledPaneIcon(resultPane, FontAwesomeIcons.CHECK);
    showResultPane(resultPane);
}
Also used : TitledPane(javafx.scene.control.TitledPane) TabPane(javafx.scene.control.TabPane) HOGMCodeArea(com.sri.ai.praise.other.application.praise.app.editor.HOGMCodeArea) Tab(javafx.scene.control.Tab) Node(javafx.scene.Node)

Aggregations

TitledPane (javafx.scene.control.TitledPane)11 Node (javafx.scene.Node)6 Tab (javafx.scene.control.Tab)6 BorderPane (javafx.scene.layout.BorderPane)5 TabPane (javafx.scene.control.TabPane)4 Scene (javafx.scene.Scene)3 HOGMCodeArea (com.sri.ai.praise.other.application.praise.app.editor.HOGMCodeArea)2 HOGMCodeArea (com.sri.ai.praise.sgsolver.demo.editor.HOGMCodeArea)2 IOException (java.io.IOException)2 Insets (javafx.geometry.Insets)2 Parent (javafx.scene.Parent)2 Button (javafx.scene.control.Button)2 HBox (javafx.scene.layout.HBox)2 Pane (javafx.scene.layout.Pane)2 CatalogAction (com.cas.sim.tis.action.CatalogAction)1 Catalog (com.cas.sim.tis.entity.Catalog)1 FileWrapper (com.kyj.fx.voeditor.visual.component.FileWrapper)1 ImageViewPane (com.kyj.fx.voeditor.visual.component.ImageViewPane)1 JavaProjectFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem)1 JavaProjectMemberFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectMemberFileTreeItem)1