use of javafx.scene.control.Label in project aima-java by aimacode.
the class VacuumEnvironmentViewCtrl method initialize.
@Override
public void initialize(Environment env) {
if (env instanceof VacuumEnvironment) {
this.locations = ((VacuumEnvironment) env).getLocations();
envStateView.getChildren().clear();
envStateView.getColumnConstraints().clear();
ColumnConstraints colCons = new ColumnConstraints();
colCons.setPercentWidth(100.0 / locations.size());
int i = 0;
for (String loc : locations) {
BorderPane pane = new BorderPane();
pane.setTop(new Label(loc));
pane.setStyle("-fx-background-color: white");
envStateView.add(pane, i++, 0);
envStateView.getColumnConstraints().add(colCons);
}
}
super.initialize(env);
}
use of javafx.scene.control.Label in project aic-praise by aic-sri-international.
the class FXUtil method exception.
public static void exception(Throwable th) {
Dialog<ButtonType> dialog = new Dialog<ButtonType>();
dialog.setTitle("Program exception");
final DialogPane dialogPane = dialog.getDialogPane();
dialogPane.setContentText("Details of the problem:");
dialogPane.getButtonTypes().addAll(ButtonType.OK);
dialogPane.setContentText(th.getMessage());
dialog.initModality(Modality.APPLICATION_MODAL);
Label label = new Label("Exception stacktrace:");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
th.printStackTrace(pw);
pw.close();
TextArea textArea = new TextArea(sw.toString());
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);
GridPane root = new GridPane();
root.setVisible(false);
root.setMaxWidth(Double.MAX_VALUE);
root.add(label, 0, 0);
root.add(textArea, 0, 1);
dialogPane.setExpandableContent(root);
dialog.showAndWait();
}
use of javafx.scene.control.Label in project aic-praise by aic-sri-international.
the class SGSolverDemoController method openMenuContent.
private Node openMenuContent() {
VBox openMenu = new VBox(2);
openMenu.setPadding(new Insets(3, 3, 3, 3));
Button saveAsButton = new Button("Save As...");
saveAsButton.setOnAction(this::saveModelAs);
FXUtil.setButtonStackedIcons(saveAsButton, FontAwesomeIcons.SAVE, FontAwesomeIcons.PENCIL);
HBox saveAsHBox = newButtonHBox();
saveAsHBox.getChildren().addAll(saveAsButton, new Label("Save As..."));
Separator hSep = new Separator(Orientation.HORIZONTAL);
hSep.setPrefWidth(170);
importUAIModelButton.setOnAction(this::importUAIModel);
FXUtil.setDefaultButtonIcon(importUAIModelButton, FontAwesomeIcons.PUZZLE_PIECE);
HBox importUAIHBox = newButtonHBox();
importUAIHBox.getChildren().addAll(importUAIModelButton, new Label("Import UAI Model..."));
exportUAIModelButton.setOnAction(this::exportUAIModel);
FXUtil.setDefaultButtonIcon(exportUAIModelButton, FontAwesomeIcons.ARCHIVE);
HBox exportUAIHBox = newButtonHBox();
exportUAIHBox.getChildren().addAll(exportUAIModelButton, new Label("Export to UAI Model..."));
openMenu.getChildren().addAll(saveAsHBox, hSep, importUAIHBox, exportUAIHBox);
return openMenu;
}
use of javafx.scene.control.Label in project bitsquare by bitsquare.
the class BitsquareApp method showFPSWindow.
private void showFPSWindow() {
Label label = new Label();
EventStreams.animationTicks().latestN(100).map(ticks -> {
int n = ticks.size() - 1;
return n * 1_000_000_000.0 / (ticks.get(n) - ticks.get(0));
}).map(d -> String.format("FPS: %.3f", d)).feedTo(label.textProperty());
Pane root = new StackPane();
root.getChildren().add(label);
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.setTitle("FPS");
stage.initModality(Modality.NONE);
stage.initStyle(StageStyle.UTILITY);
stage.initOwner(scene.getWindow());
stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10);
stage.setY(primaryStage.getY());
stage.setWidth(200);
stage.setHeight(100);
stage.show();
}
use of javafx.scene.control.Label in project bitsquare by bitsquare.
the class CryptoCurrencyForm method addFormForDisplayAccount.
@Override
public void addFormForDisplayAccount() {
gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, "Account name:", cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
Tuple2<Label, TextField> tuple2 = addLabelTextField(gridPane, ++gridRow, "Altcoin address:", cryptoCurrencyAccount.getAddress());
addressLabel = tuple2.first;
TextField field = tuple2.second;
field.setMouseTransparent(false);
addLabelTextField(gridPane, ++gridRow, "Altcoin:", cryptoCurrencyAccount.getSingleTradeCurrency().getNameAndCode());
addAllowedPeriod();
}
Aggregations