Example usage for javafx.scene.control Label Label

List of usage examples for javafx.scene.control Label Label

Introduction

In this page you can find the example usage for javafx.scene.control Label Label.

Prototype

public Label(String text) 

Source Link

Document

Creates Label with supplied text.

Usage

From source file:gov.va.isaac.gui.preferences.plugins.properties.PreferencesPluginTextFieldProperty.java

/**
 * @param label//from   w  w  w  . jav  a2 s  .  c om
 * @param control
 * @param property
 * @param validator
 * @param stringConverter
 * @param binder
 * @param controlPersistedValueSetter
 * @param guiFormattingApplicator
 */
public PreferencesPluginTextFieldProperty(String name, TextField control, Property<String> property,
        ValidBooleanBinding validator, StringConverter<String> stringConverter,
        PropertyAction<String, TextField> binder, PropertyAction<String, TextField> controlPersistedValueSetter,
        PropertyAction<String, TextField> guiFormattingApplicator) {
    this(new Label(name), control, property, validator, stringConverter, binder, controlPersistedValueSetter,
            guiFormattingApplicator);
}

From source file:org.mskcc.shenkers.control.track.gene.GeneModelView.java

@Override
public Task<Pane> getContent(GeneModelContext context) {
    return context.spanProperty().getValue().map(i -> {

        String chr = i.getChr();/*from  w ww  . j  a v a 2 s  .c o m*/
        int start = i.getStart();
        int end = i.getEnd();

        Task<Pane> task = new PaneTask(context, chr, start, end);

        logger.info("returning task");
        return task;
    }).orElse(new Task<Pane>() {

        @Override
        protected Pane call() throws Exception {
            return new BorderPane(new Label("coordinates not set"));
        }
    }
    //                new BorderPane(new Label("bamview1: span not set"))
    //                new Pane()
    );
}

From source file:org.pdfsam.ui.dashboard.preference.PreferenceWorkspacePane.java

@Inject
public PreferenceWorkspacePane(@Named("workingDirectory") PreferenceBrowsableDirectoryField workingDirectory,
        @Named("workspace") PreferenceBrowsableFileField workspace,
        @Named("saveWorkspaceOnExit") PreferenceCheckBox saveWorkspaceOnExit) {
    I18nContext i18n = DefaultI18nContext.getInstance();
    workingDirectory.getTextField()/*from  ww  w .j a v a2 s  .c  o  m*/
            .setPromptText(i18n.i18n("Select a directory where documents will be saved and loaded by default"));
    workingDirectory.setBrowseWindowTitle(i18n.i18n("Select a directory"));
    HBox workigDirPane = new HBox(workingDirectory,
            helpIcon(i18n.i18n("Select a directory where documents will be saved and loaded by default")));
    HBox.setHgrow(workingDirectory, Priority.ALWAYS);
    workigDirPane.getStyleClass().add("with-help-hcontainer");

    workspace.getTextField().setPromptText(
            i18n.i18n("Select a previously saved workspace that will be automatically loaded at startup"));
    workspace.setBrowseWindowTitle(i18n.i18n("Select a workspace"));
    HBox workspaceDirPane = new HBox(workspace, helpIcon(
            i18n.i18n("Select a previously saved workspace that will be automatically loaded at startup")));
    HBox.setHgrow(workspace, Priority.ALWAYS);
    workspaceDirPane.getStyleClass().add("with-help-hcontainer");
    workspace.getTextField().validProperty().addListener((o, oldVal, newVal) -> {
        saveWorkspaceOnExit
                .setDisable(isBlank(workspace.getTextField().getText()) || newVal != ValidationState.VALID);
    });
    workspace.getTextField().validate();
    getChildren().addAll(new Label(i18n.i18n("Default working directory:")), workigDirPane,
            new Label(i18n.i18n("Load default workspace at startup:")), workspaceDirPane, saveWorkspaceOnExit);
    getStyleClass().addAll(Style.CONTAINER.css());
}

From source file:com.gmail.frogocomics.schematic.gui.Main.java

@Override
public void start(Stage primaryStage) throws Exception {
    this.primaryStage = primaryStage;
    this.root = new GridPane();
    this.primaryScene = new Scene(this.root, 1000, 600, Color.AZURE);

    Label title = new Label("Schematic Utilities");
    title.setId("schematic-utilities");
    title.setPrefWidth(this.primaryScene.getWidth() + 500);
    this.root.add(title, 0, 0);

    filesSelected.setId("files-selected");
    this.root.add(filesSelected, 0, 1);

    Region spacer1 = new Region();
    spacer1.setPrefWidth(30);//w w  w. ja  v a 2s. c  o m
    spacer1.setPrefHeight(30);

    Region spacer2 = new Region();
    spacer2.setPrefWidth(30);
    spacer2.setPrefHeight(30);

    Region spacer3 = new Region();
    spacer3.setPrefWidth(30);
    spacer3.setPrefHeight(250);

    Region spacer4 = new Region();
    spacer4.setPrefWidth(1000);
    spacer4.setPrefHeight(10);

    Region spacer5 = new Region();
    spacer5.setPrefWidth(30);
    spacer5.setPrefHeight(30);

    Region spacer6 = new Region();
    spacer6.setPrefWidth(1000);
    spacer6.setPrefHeight(10);

    Region spacer7 = new Region();
    spacer7.setPrefWidth(1000);
    spacer7.setPrefHeight(100);

    Region spacer8 = new Region();
    spacer8.setPrefWidth(30);
    spacer8.setPrefHeight(30);

    this.root.add(spacer4, 0, 3);

    listView.setId("schematic-list");
    listView.setEditable(false);
    listView.setPrefWidth(500);
    listView.setPrefHeight(250);
    this.root.add(new HBox(spacer3, listView), 0, 4);

    uploadFiles.setPadding(new Insets(5, 5, 5, 5));
    uploadFiles.setPrefWidth(120);
    uploadFiles.setPrefHeight(30);
    uploadFiles.setOnAction((event) -> {
        FileChooser fileChooser = new FileChooser();
        fileChooser.setTitle("Select schematic(s)");
        fileChooser.getExtensionFilters().addAll(
                new FileChooser.ExtensionFilter("MCEdit Schematic File", "*.schematic"),
                new FileChooser.ExtensionFilter("Biome World Object Version 2", "*.bo2"));
        List<File> selectedFiles = fileChooser.showOpenMultipleDialog(this.primaryStage);
        if (selectedFiles != null) {
            if (selectedFiles.size() == 1) {
                filesSelected.setText("There is currently 1 file selected");
            } else {
                filesSelected.setText(
                        "There are currently " + String.valueOf(selectedFiles.size()) + " files selected");
            }
            ObservableList<SchematicLocation> selectedSchematicFiles = FXCollections.observableArrayList();
            selectedSchematicFiles.addAll(selectedFiles.stream().map(f -> new SchematicLocation(f, f.getName()))
                    .collect(Collectors.toList()));
            listView.setItems(selectedSchematicFiles);
            this.schematics = selectedSchematicFiles;
        }

    });
    this.root.add(new HBox(spacer1, uploadFiles, spacer2,
            new Label("Only .schematic files are allowed at this point!")), 0, 2);

    editing.setPadding(new Insets(5, 5, 5, 5));
    editing.setPrefWidth(240);
    editing.setPrefHeight(30);
    editing.setDisable(true);
    editing.setOnAction(event -> this.primaryStage.setScene(Editing.getScene()));
    this.root.add(new HBox(spacer8, editing), 0, 8);

    loadSchematics.setPadding(new Insets(5, 5, 5, 5));
    loadSchematics.setPrefWidth(120);
    loadSchematics.setPrefHeight(30);
    loadSchematics.setOnAction(event -> {
        if (this.schematics != null) {
            ((Runnable) () -> {
                for (SchematicLocation location : this.schematics) {
                    if (FilenameUtils.isExtension(location.getLocation().getName(), "schematic")) {
                        try {
                            Schematics.schematics.add(McEditSchematicObject.load(location.getLocation()));
                        } catch (ParseException | ClassicNotSupportedException | IOException e) {
                            e.printStackTrace();
                        }
                    } else if (FilenameUtils.isExtension(location.getLocation().getName(), "bo2")) {
                        try {
                            Schematics.schematics.add(BiomeWorldV2Object.load(location.getLocation()));
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }).run();
            loadSchematics.setDisable(true);
            uploadFiles.setDisable(true);
            listView.setDisable(true);
            editing.setDisable(false);
        }
    });
    this.root.add(spacer6, 0, 5);
    this.root.add(new HBox(spacer5, loadSchematics), 0, 6);
    this.root.add(spacer7, 0, 7);

    this.primaryScene.getStylesheets()
            .add("https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800");
    this.primaryScene.getStylesheets().add(new File("style.css").toURI().toURL().toExternalForm());
    this.primaryStage.setScene(this.primaryScene);
    this.primaryStage.setResizable(false);
    this.primaryStage.setTitle("Schematic Utilities - by frogocomics");
    this.primaryStage.show();
}

From source file:org.pdfsam.ui.news.NewsStage.java

@Inject
public NewsStage(Collection<Image> logos, StylesConfig styles,
        @Named("newsDisplayPolicy") PreferenceComboBox<KeyStringValueItem<String>> newsDisplayPolicy) {
    BorderPane containerPane = new BorderPane();
    browser.setId("newsBrowser");
    containerPane.getStyleClass().addAll(Style.CONTAINER.css());
    containerPane.getStyleClass().add("-pdfsam-news-pane");
    containerPane.setCenter(browser);/*from   ww w  . j a  va 2 s.  c om*/
    HBox bottom = new HBox();

    ClosePane closePane = new ClosePane();
    HBox.setHgrow(closePane, Priority.ALWAYS);
    HBox comboPanel = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Show this:")),
            newsDisplayPolicy);
    comboPanel.getStyleClass().addAll(Style.CONTAINER.css());
    comboPanel.getStyleClass().add("-pdfsam-news-pane-bottom");
    bottom.getChildren().addAll(comboPanel, closePane);
    containerPane.setBottom(bottom);
    Scene scene = new Scene(containerPane);
    scene.getStylesheets().addAll(styles.styles());
    scene.setOnKeyReleased(new HideOnEscapeHandler(this));
    setScene(scene);
    setTitle(DefaultI18nContext.getInstance().i18n("What's new"));
    getIcons().addAll(logos);
    setMaximized(false);
}

From source file:net.sf.anathema.framework.presenter.action.about.AnathemaAboutAction.java

private void showCopyrightAndLicense(MigPane parent) {
    String copyright = resources.getString("Help.AboutDialog.CopyrightLabel");
    String license = resources.getString("Help.AboutDialog.LicenseLabel");
    parent.add(new Label(copyright), new CC().dockNorth().alignX("center"));
    parent.add(new Label(license), new CC().dockNorth().alignX("center"));
}

From source file:org.pdfsam.merge.MergeOptionsPane.java

MergeOptionsPane() {
    super(5);// www.j  av  a  2s  . c  o m
    this.containsForms = new CheckBox(DefaultI18nContext.getInstance().i18n("Merge form fields"));
    this.containsForms.setId("containsFormCheck");
    this.containsForms.setTooltip(new Tooltip(DefaultI18nContext.getInstance()
            .i18n("Some of the selected PDF documents contain forms, merge them")));
    this.blankIfOdd = new CheckBox(
            DefaultI18nContext.getInstance().i18n("Add a blank page if page number is odd"));
    this.blankIfOdd.setId("blankIfOddCheck");
    this.blankIfOdd.setTooltip(new Tooltip(DefaultI18nContext.getInstance()
            .i18n("Adds a blank page after each merged document if the document has an odd number of pages")));

    outline.getItems()
            .add(keyValue(OutlinePolicy.RETAIN, DefaultI18nContext.getInstance().i18n("Retain bookmarks")));
    outline.getItems()
            .add(keyValue(OutlinePolicy.DISCARD, DefaultI18nContext.getInstance().i18n("Discard bookmarks")));
    outline.getItems().add(keyValue(OutlinePolicy.ONE_ENTRY_EACH_DOC,
            DefaultI18nContext.getInstance().i18n("Create one entry for each merged document")));
    outline.getSelectionModel().selectFirst();
    outline.setId("outlineCombo");

    HBox bookmarksPolicy = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Bookmarks handling:")),
            outline);
    bookmarksPolicy.getStyleClass().addAll(Style.VITEM.css());
    bookmarksPolicy.getStyleClass().addAll(Style.HCONTAINER.css());

    getStyleClass().addAll(Style.CONTAINER.css());
    getChildren().addAll(this.containsForms, this.blankIfOdd, bookmarksPolicy);
}

From source file:org.pdfsam.rotate.RotateOptionsPane.java

RotateOptionsPane() {
    super(Style.DEFAULT_SPACING);
    this.rotationType.getItems()
            .add(keyValue(PredefinedSetOfPages.ALL_PAGES, DefaultI18nContext.getInstance().i18n("All pages")));
    this.rotationType.getItems().add(
            keyValue(PredefinedSetOfPages.EVEN_PAGES, DefaultI18nContext.getInstance().i18n("Even pages")));
    this.rotationType.getItems()
            .add(keyValue(PredefinedSetOfPages.ODD_PAGES, DefaultI18nContext.getInstance().i18n("Odd pages")));
    this.rotationType.getSelectionModel().selectFirst();
    this.rotationType.setId("rotationType");

    this.rotation.getItems()
            .add(keyValue(Rotation.DEGREES_90, DefaultI18nContext.getInstance().i18n("90 degrees clockwise")));
    this.rotation.getItems().add(
            keyValue(Rotation.DEGREES_180, DefaultI18nContext.getInstance().i18n("180 degrees clockwise")));
    this.rotation.getItems().add(
            keyValue(Rotation.DEGREES_270, DefaultI18nContext.getInstance().i18n("270 degrees clockwise")));
    this.rotation.getSelectionModel().selectFirst();
    this.rotation.setId("rotation");

    getStyleClass().addAll(Style.HCONTAINER.css());
    getStyleClass().addAll(Style.CONTAINER.css());
    getChildren().addAll(new Label(DefaultI18nContext.getInstance().i18n("Rotate ")), this.rotationType,
            this.rotation);
    eventStudio().addAnnotatedListeners(this);
}

From source file:gov.va.isaac.gui.preferences.plugins.properties.PreferencesPluginTextFieldProperty.java

public PreferencesPluginTextFieldProperty(String name, boolean emptyStringAllowed) {
    this(new Label(name), emptyStringAllowed);
}

From source file:org.mskcc.shenkers.control.track.rest.RestIntervalView.java

@Override
public Task<Pane> getContent(RestIntervalContext context) {
    return context.spanProperty().getValue().map(i -> {

        String chr = i.getChr();// w  w w .  j ava  2s.c  o  m
        int start = i.getStart();
        int end = i.getEnd();

        Task<Pane> task = new PaneTask(context, chr, start, end);

        logger.info("returning task");
        return task;
    }).orElse(new Task<Pane>() {

        @Override
        protected Pane call() throws Exception {
            return new BorderPane(new Label("coordinates not set"));
        }
    }
    //                new BorderPane(new Label("bamview1: span not set"))
    //                new Pane()
    );
}