Search in sources :

Example 16 with Label

use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.

the class DetailsView method populateHeader.

/**
     * Populate the header with a label for the title of this details view and a close button
     */
private void populateHeader() {
    this.titleLabel = new Label();
    this.titleLabel.getStyleClass().add("descriptionTitle");
    this.titleLabel.setAlignment(Pos.CENTER_LEFT);
    this.titleLabel.setWrapText(true);
    this.closeButton = new Button();
    this.closeButton.getStyleClass().add("closeIcon");
    this.closeButton.setOnAction(event -> onClose.run());
    this.closeButton.setAlignment(Pos.CENTER_RIGHT);
    Region filler = new Region();
    HBox headerBox = new HBox();
    headerBox.getChildren().setAll(titleLabel, filler, closeButton);
    HBox.setHgrow(filler, Priority.ALWAYS);
    this.setTop(headerBox);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) Region(javafx.scene.layout.Region)

Example 17 with Label

use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.

the class AppPanel method refreshScripts.

/**
     * Refreshes the shown scripts.
     * When this method is called it begins by clearing the <code>scriptGrid</code>.
     * Afterwards this method refills it.
     */
private void refreshScripts() {
    scriptGrid.getChildren().clear();
    for (int i = 0; i < filteredScripts.size(); i++) {
        ScriptDTO script = filteredScripts.get(i);
        Label scriptName = new Label(script.getScriptName());
        if (settingsManager.isViewScriptSource()) {
            final Tooltip tooltip = new Tooltip(tr("Source: {0}", script.getScriptSource()));
            Tooltip.install(scriptName, tooltip);
        }
        Button installButton = new Button(tr("Install"));
        installButton.setOnMouseClicked(evt -> {
            try {
                onScriptInstall.accept(script);
            } catch (IllegalArgumentException e) {
                LOGGER.error("Failed to get script", e);
                new ErrorMessage(tr("Error while trying to download the installer"), e).show();
            }
        });
        scriptGrid.addRow(i, scriptName, installButton);
        GridPane.setHgrow(scriptName, Priority.ALWAYS);
    }
}
Also used : ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) ErrorMessage(org.phoenicis.javafx.views.common.ErrorMessage)

Example 18 with Label

use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.

the class StepRepresentationPresentation method drawStepContent.

@Override
protected void drawStepContent() {
    final String title = this.getParentWizardTitle();
    VBox contentPane = new VBox();
    contentPane.setId("presentationBackground");
    Label titleWidget = new Label(title + "\n\n");
    titleWidget.setId("presentationTextTitle");
    Text textWidget = new Text(textToShow);
    textWidget.setId("presentationText");
    TextFlow flow = new TextFlow();
    flow.getChildren().add(textWidget);
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setId("presentationScrollPane");
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setFitToWidth(true);
    scrollPane.setContent(flow);
    VBox.setVgrow(scrollPane, Priority.ALWAYS);
    contentPane.getChildren().add(scrollPane);
    getParent().getRoot().setCenter(contentPane);
}
Also used : ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) VBox(javafx.scene.layout.VBox)

Example 19 with Label

use of javafx.scene.control.Label in project SmartCity-Market by TechnionYP5777.

the class ManageCatalogProductDetailsTab method initialize.

@Override
public void initialize(URL location, ResourceBundle __) {
    createManufacturerList();
    createIngredientList();
    filterManu.textProperty().addListener(obs -> {
        String filter = filterManu.getText();
        filteredDataManu.setPredicate(filter == null || filter.length() == 0 ? s -> true : s -> s.contains(filter));
    });
    manufacturerList.setCellFactory(CheckBoxListCell.forListView(new Callback<String, ObservableValue<Boolean>>() {

        @Override
        public ObservableValue<Boolean> call(String item) {
            BooleanProperty observable = new SimpleBooleanProperty();
            observable.set(selectedManu.contains(item));
            observable.addListener((obs, wasSelected, isNowSelected) -> {
                if (isNowSelected)
                    selectedManu.add(item);
                else
                    selectedManu.remove(item);
                enableButtons();
            });
            return observable;
        }
    }));
    filterIngr.textProperty().addListener(obs -> {
        String filter = filterIngr.getText();
        filteredDataIngr.setPredicate(filter == null || filter.length() == 0 ? s -> true : s -> s.contains(filter));
    });
    ingredientsList.setCellFactory(CheckBoxListCell.forListView(new Callback<String, ObservableValue<Boolean>>() {

        @Override
        public ObservableValue<Boolean> call(String item) {
            BooleanProperty observable = new SimpleBooleanProperty();
            observable.set(selectedIngr.contains(item));
            observable.addListener((obs, wasSelected, isNowSelected) -> {
                if (isNowSelected)
                    selectedIngr.add(item);
                else
                    selectedIngr.remove(item);
                enableButtons();
            });
            return observable;
        }
    }));
    Label lbl1 = new Label("Insert New Manufacturar");
    newManu = new JFXTextField();
    okNewManu = new JFXButton("Done!");
    okNewManu.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent __) {
            addManuPressed();
        }
    });
    VBox manuContainer = new VBox();
    manuContainer.getChildren().addAll(lbl1, newManu, okNewManu);
    manuContainer.setPadding(new Insets(10, 50, 50, 50));
    manuContainer.setSpacing(10);
    JFXPopup popup1 = new JFXPopup(manuContainer);
    addManuBtn.setOnMouseClicked(e -> popup1.show(addManuBtn, PopupVPosition.TOP, PopupHPosition.LEFT));
    newManu.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
    Label lbl2 = new Label("Insert New Ingredient");
    newIngr = new JFXTextField();
    okNewIngr = new JFXButton("Done!");
    okNewIngr.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent __) {
            addIngPressed();
        }
    });
    VBox ingrContainer = new VBox();
    ingrContainer.getChildren().addAll(lbl2, newIngr, okNewIngr);
    ingrContainer.setPadding(new Insets(10, 50, 50, 50));
    ingrContainer.setSpacing(10);
    JFXPopup popup2 = new JFXPopup(ingrContainer);
    addIngrBtn.setOnMouseClicked(e -> popup2.show(addIngrBtn, PopupVPosition.TOP, PopupHPosition.LEFT));
    newIngr.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
    Label lbl3 = new Label("Rename Selected Manufacturar");
    renameManuLbl = new JFXTextField();
    okRenameManu = new JFXButton("Done!");
    okRenameManu.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent __) {
            renameManuPressed();
        }
    });
    VBox renameManuContainer = new VBox();
    renameManuContainer.getChildren().addAll(lbl3, renameManuLbl, okRenameManu);
    renameManuContainer.setPadding(new Insets(10, 50, 50, 50));
    renameManuContainer.setSpacing(10);
    JFXPopup popup3 = new JFXPopup(renameManuContainer);
    renameManu.setOnMouseClicked(e -> popup3.show(renameManu, PopupVPosition.TOP, PopupHPosition.LEFT));
    renameManuLbl.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
    Label lbl4 = new Label("Rename Selected Ingredient");
    renameIngrLbl = new JFXTextField();
    okRenameIngr = new JFXButton("Done!");
    okRenameIngr.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent __) {
            renameIngrPressed();
        }
    });
    VBox renameIngrContainer = new VBox();
    renameIngrContainer.getChildren().addAll(lbl4, renameIngrLbl, okRenameIngr);
    renameIngrContainer.setPadding(new Insets(10, 50, 50, 50));
    renameIngrContainer.setSpacing(10);
    JFXPopup popup4 = new JFXPopup(renameIngrContainer);
    renameIngr.setOnMouseClicked(e -> popup4.show(renameIngr, PopupVPosition.TOP, PopupHPosition.LEFT));
    renameIngrLbl.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
    enableButtons();
    enableAddButtons();
}
Also used : EventHandler(javafx.event.EventHandler) JFXButton(com.jfoenix.controls.JFXButton) Initializable(javafx.fxml.Initializable) URL(java.net.URL) CheckBoxListCell(javafx.scene.control.cell.CheckBoxListCell) PopupVPosition(com.jfoenix.controls.JFXPopup.PopupVPosition) FXCollections(javafx.collections.FXCollections) HashMap(java.util.HashMap) Manufacturer(BasicCommonClasses.Manufacturer) VBox(javafx.scene.layout.VBox) JFXPopup(com.jfoenix.controls.JFXPopup) EmployeeNotConnected(EmployeeDefs.AEmployeeException.EmployeeNotConnected) HashSet(java.util.HashSet) ParamIDAlreadyExists(EmployeeDefs.AEmployeeException.ParamIDAlreadyExists) Logger(org.apache.log4j.Logger) Insets(javafx.geometry.Insets) ResourceBundle(java.util.ResourceBundle) ManfacturerStillInUse(EmployeeDefs.AEmployeeException.ManfacturerStillInUse) ConnectionFailure(EmployeeDefs.AEmployeeException.ConnectionFailure) ParamIDDoesNotExist(EmployeeDefs.AEmployeeException.ParamIDDoesNotExist) Callback(javafx.util.Callback) CriticalError(SMExceptions.CommonExceptions.CriticalError) Label(javafx.scene.control.Label) StackTraceUtil(UtilsImplementations.StackTraceUtil) JFXListView(com.jfoenix.controls.JFXListView) FilteredList(javafx.collections.transformation.FilteredList) Manager(EmployeeImplementations.Manager) IngredientStillInUse(EmployeeDefs.AEmployeeException.IngredientStillInUse) FXML(javafx.fxml.FXML) InjectionFactory(UtilsImplementations.InjectionFactory) BooleanProperty(javafx.beans.property.BooleanProperty) ActionEvent(javafx.event.ActionEvent) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) PopupHPosition(com.jfoenix.controls.JFXPopup.PopupHPosition) IManager(EmployeeContracts.IManager) ObservableValue(javafx.beans.value.ObservableValue) ObservableList(javafx.collections.ObservableList) Ingredient(BasicCommonClasses.Ingredient) JFXTextField(com.jfoenix.controls.JFXTextField) InvalidParameter(EmployeeDefs.AEmployeeException.InvalidParameter) JFXPopup(com.jfoenix.controls.JFXPopup) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) Insets(javafx.geometry.Insets) BooleanProperty(javafx.beans.property.BooleanProperty) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) ActionEvent(javafx.event.ActionEvent) JFXTextField(com.jfoenix.controls.JFXTextField) Label(javafx.scene.control.Label) JFXButton(com.jfoenix.controls.JFXButton) Callback(javafx.util.Callback) VBox(javafx.scene.layout.VBox)

Example 20 with Label

use of javafx.scene.control.Label in project Smartcity-Smarthouse by TechnionYP5777.

the class MessageViewController method buildStreamModePane.

void buildStreamModePane() {
    streamFieldMap = new HashMap<>();
    int currentRow = 0;
    streamMode.add(new Label("Name"), 0, currentRow);
    streamMode.add(new Label("From"), 1, currentRow);
    streamMode.add(new Label("To"), 2, currentRow++);
    for (final SensorField ¢ : currentSensor.getFields()) {
        streamMode.add(new Label(¢.getName()), 0, currentRow);
        final List<Node> nodes = new ArrayList<>();
        if (¢.getType() == Types.BOOLEAN) {
            final ComboBox<BooleanValues> b = new ComboBox<>();
            b.getItems().addAll(BooleanValues.values());
            streamMode.add(b, 1, currentRow);
            nodes.add(b);
        } else {
            final TextField t1 = new TextField(), t2 = new TextField();
            streamMode.add(t1, 1, currentRow);
            nodes.add(t1);
            if (¢.getType() != Types.STRING) {
                streamMode.add(t2, 2, currentRow);
                nodes.add(t2);
            }
        }
        streamFieldMap.put(¢, nodes);
        ++currentRow;
    }
    streamMode.add(new Label("Send Interval(integer only):"), 0, currentRow);
    final TextField t1 = new TextField(), t2 = new TextField();
    streamMode.add(t1, 1, currentRow);
    streamMode.add(t2, 2, currentRow);
    timeInput = new Pair<>(t1, t2);
}
Also used : SensorField(il.ac.technion.cs.smarthouse.simulator.model.SensorField) ComboBox(javafx.scene.control.ComboBox) Node(javafx.scene.Node) Label(javafx.scene.control.Label) ArrayList(java.util.ArrayList) 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