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();
}
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();
}
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);
}
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);
}
}
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);
}
Aggregations