Search in sources :

Example 96 with Label

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);
}
Also used : BorderPane(javafx.scene.layout.BorderPane) VacuumEnvironment(aima.core.environment.vacuum.VacuumEnvironment) ColumnConstraints(javafx.scene.layout.ColumnConstraints) Label(javafx.scene.control.Label)

Example 97 with Label

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();
}
Also used : DialogPane(javafx.scene.control.DialogPane) GridPane(javafx.scene.layout.GridPane) StringWriter(java.io.StringWriter) TextArea(javafx.scene.control.TextArea) Dialog(javafx.scene.control.Dialog) Label(javafx.scene.control.Label) ButtonType(javafx.scene.control.ButtonType) PrintWriter(java.io.PrintWriter)

Example 98 with Label

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;
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) VBox(javafx.scene.layout.VBox) Separator(javafx.scene.control.Separator)

Example 99 with Label

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();
}
Also used : StageStyle(javafx.stage.StageStyle) Popup(io.bitsquare.gui.main.overlays.popups.Popup) LoggerFactory(org.slf4j.LoggerFactory) Security(java.security.Security) View(io.bitsquare.gui.common.view.View) StackPane(javafx.scene.layout.StackPane) KeyCombination(javafx.scene.input.KeyCombination) Application(javafx.application.Application) Parent(javafx.scene.Parent) UITimer(io.bitsquare.gui.common.UITimer) TradeWalletService(io.bitsquare.btc.TradeWalletService) ResultHandler(io.bitsquare.common.handlers.ResultHandler) BlockStoreException(org.bitcoinj.store.BlockStoreException) Pane(javafx.scene.layout.Pane) Font(javafx.scene.text.Font) LimitedKeyStrengthException(io.bitsquare.common.util.LimitedKeyStrengthException) FilterManager(io.bitsquare.filter.FilterManager) KeyEvent(javafx.scene.input.KeyEvent) InjectorViewFactory(io.bitsquare.gui.common.view.guice.InjectorViewFactory) Platform(javafx.application.Platform) List(java.util.List) io.bitsquare.gui.main.overlays.windows(io.bitsquare.gui.main.overlays.windows) Logger(ch.qos.logback.classic.Logger) MainViewModel(io.bitsquare.gui.main.MainViewModel) Environment(org.springframework.core.env.Environment) Dialogs(org.controlsfx.dialog.Dialogs) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) EventStreams(org.reactfx.EventStreams) CommonOptionKeys(io.bitsquare.common.CommonOptionKeys) ExceptionUtils(org.apache.commons.lang3.exception.ExceptionUtils) Scene(javafx.scene.Scene) MainView(io.bitsquare.gui.main.MainView) DebugView(io.bitsquare.gui.main.debug.DebugView) P2PService(io.bitsquare.p2p.P2PService) ArrayList(java.util.ArrayList) TradeManager(io.bitsquare.trade.TradeManager) CachingViewLoader(io.bitsquare.gui.common.view.CachingViewLoader) WalletService(io.bitsquare.btc.WalletService) SystemTray(io.bitsquare.gui.SystemTray) APP_NAME_KEY(io.bitsquare.app.AppOptionKeys.APP_NAME_KEY) KeyCode(javafx.scene.input.KeyCode) Modality(javafx.stage.Modality) Utilities(io.bitsquare.common.util.Utilities) Label(javafx.scene.control.Label) UserThread(io.bitsquare.common.UserThread) ImageUtil(io.bitsquare.gui.util.ImageUtil) IOException(java.io.IOException) ViewLoader(io.bitsquare.gui.common.view.ViewLoader) BouncyCastleProvider(org.bouncycastle.jce.provider.BouncyCastleProvider) Injector(com.google.inject.Injector) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) TimeUnit(java.util.concurrent.TimeUnit) Level(ch.qos.logback.classic.Level) Stage(javafx.stage.Stage) Paths(java.nio.file.Paths) OpenOfferManager(io.bitsquare.trade.offer.OpenOfferManager) ArbitratorManager(io.bitsquare.arbitration.ArbitratorManager) Guice(com.google.inject.Guice) Profiler(io.bitsquare.common.util.Profiler) Storage(io.bitsquare.storage.Storage) Image(javafx.scene.image.Image) AlertManager(io.bitsquare.alert.AlertManager) Label(javafx.scene.control.Label) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) StackPane(javafx.scene.layout.StackPane)

Example 100 with Label

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();
}
Also used : Label(javafx.scene.control.Label) InputTextField(io.bitsquare.gui.components.InputTextField) TextField(javafx.scene.control.TextField)

Aggregations

Label (javafx.scene.control.Label)138 Insets (javafx.geometry.Insets)47 Button (javafx.scene.control.Button)38 Scene (javafx.scene.Scene)26 HBox (javafx.scene.layout.HBox)26 VBox (javafx.scene.layout.VBox)25 GridPane (javafx.scene.layout.GridPane)20 TextField (javafx.scene.control.TextField)19 BorderPane (javafx.scene.layout.BorderPane)19 Node (javafx.scene.Node)17 ImageView (javafx.scene.image.ImageView)13 ArrayList (java.util.ArrayList)12 InputTextField (io.bitsquare.gui.components.InputTextField)11 List (java.util.List)11 Tooltip (javafx.scene.control.Tooltip)11 Stage (javafx.stage.Stage)11 Map (java.util.Map)9 ObservableList (javafx.collections.ObservableList)9 Image (javafx.scene.image.Image)9 StackPane (javafx.scene.layout.StackPane)9