Example usage for javafx.scene.control TextField TextField

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

Introduction

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

Prototype

public TextField(String text) 

Source Link

Document

Creates a TextField with initial text content.

Usage

From source file:webapptest.FXMLDocumentController.java

@FXML
public void shiftDeleteButtonPressed(ActionEvent event) {
    //enables deleting of a shift
    shiftDelete = true;//from  w  ww. ja v a2s  .  c o m

    //displays the shift information to be deleted inside the delete area
    shiftDeleteDisplay.getChildren().add(new TextField(shiftDeleteID.getText()));
    shiftDeleteDisplay.getChildren().add(new TextField(shiftDeleteEmpID.getText()));

}

From source file:webapptest.FXMLDocumentController.java

@FXML //Pressed to initiate a delete for an employee
public void deleteEmpButtonPressed(ActionEvent event) throws IOException {
    //enables deleting of an employee
    employeeDelete = true;/* ww w .  j av a 2s.co  m*/

    //displays the employee id to be deleted inside the delete area
    empDeleteDisplay.getChildren().add(new TextField(empDeleteID.getText()));
    empDeleteDisplay.getChildren().add(new TextField(empDeleteName.getText()));
}

From source file:de.pixida.logtest.designer.automaton.AutomatonEdge.java

private void createDurationInput(final GridPane gp, final boolean isMin,
        final TimeIntervalForEditing timeInterval) {
    final DurationForEditing duration = isMin ? timeInterval.getMinDuration() : timeInterval.getMaxDuration();

    final int targetRow = isMin ? 0 : 1;
    int column = 0;

    final Text fromOrTo = new Text((isMin ? "Min" : "Max") + ": ");
    gp.add(fromOrTo, column++, targetRow);

    final String mathOperator = isMin ? ">" : "<";
    final String inclusive = "Inclusive: " + mathOperator + "=";
    final String exclusive = "Exclusive: " + mathOperator;
    final ChoiceBox<String> intervalBorderInput = new ChoiceBox<>(
            FXCollections.observableArrayList(inclusive, exclusive));
    intervalBorderInput.setValue(duration.isInclusive() ? inclusive : exclusive);
    intervalBorderInput.getSelectionModel().selectedIndexProperty()
            .addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> {
                duration.setInclusive(0 == (Integer) newValue);
                this.timingConditionsUpdated();
                this.getGraph().handleChange();
            });/*from  ww w .j av a 2  s  .  c o m*/
    gp.add(intervalBorderInput, column++, targetRow);

    final TextField valueInput = new TextField(duration.getValue());
    valueInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        duration.setValue(newValue);
        this.timingConditionsUpdated();
        this.getGraph().handleChange();
    });
    gp.add(valueInput, column++, targetRow);

    final String currentChoice = JsonTimeUnit.convertTimeUnitToString(duration.getUnit());
    final ChoiceBox<String> timeUnitInput = new ChoiceBox<>(
            FXCollections.observableArrayList(JsonTimeUnit.getListOfPossibleNames()));
    timeUnitInput.setValue(currentChoice);
    timeUnitInput.getSelectionModel().selectedIndexProperty()
            .addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> {
                duration.setUnit(JsonTimeUnit.indexToTimeUnit((Integer) newValue));
                this.timingConditionsUpdated();
                this.getGraph().handleChange();
            });
    gp.add(timeUnitInput, column++, targetRow);
}

From source file:webapptest.FXMLDocumentController.java

@FXML //DIsplays the shifts from the server
public void refreshShiftsButtonPressed(ActionEvent event) {
    shiftList.getChildren().clear();/*w  w  w .j ava2 s  .  c o m*/

    //get the data of employees from the server
    List<String> temp = new ArrayList<>();
    temp.add("get_shift_specific");
    String input = sendData(temp);

    //parse the data into an object
    List<Shift> shifts = parseShiftData(input);

    //display the headings for the employee display
    HBox heading = new HBox();
    Label sID = new Label("Shift ID");
    Label sTime = new Label("Shift Time");
    Label sEmp = new Label("Shift Employee");
    Label sFac = new Label("Shift House");

    heading.getChildren().add(sID);
    heading.getChildren().add(sTime);
    heading.getChildren().add(sEmp);
    heading.getChildren().add(sFac);

    shiftList.getChildren().add(heading);

    //loop through all available employees and display to screen
    for (Shift s : shifts) {
        HBox tempLine = new HBox();

        TextField sIDText = new TextField(s.getShiftID());
        TextField sTimeText = new TextField(s.getShiftTime());
        TextField sEmpText = new TextField(s.getEmpID());
        TextField sFacText = new TextField(s.getHouseID());

        tempLine.getChildren().add(sIDText);
        tempLine.getChildren().add(sTimeText);
        tempLine.getChildren().add(sEmpText);
        tempLine.getChildren().add(sFacText);

        shiftList.getChildren().add(tempLine);
    }
}

From source file:dsfixgui.view.DSPWPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);/*from   w  w w .ja  v a2s  .  com*/
    spacerColumn.setPercentWidth(3.0);
    primaryColumn = new ColumnConstraints();
    primaryColumn.setFillWidth(true);
    primaryColumn.setPercentWidth(95.0);
    primaryPane = new GridPane();
    primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn);
    primaryVBox = new VBox();
    primaryVBox.getStyleClass().add("spacing_15");
    primaryPane.add(primaryVBox, 1, 0);
    titleLabel = new Label(DSPW_SHORT.toUpperCase() + " " + SETTINGS.toUpperCase());
    titleLabel.getStyleClass().add("settings_title");
    titleBar = new HBox();
    titleBar.setAlignment(Pos.CENTER);
    titleBar.getChildren().add(titleLabel);
    restoreDefaultsBar = new HBox();
    restoreDefaultsBar.setAlignment(Pos.CENTER);
    restoreDefaultsBar.setSpacing(5.0);
    applySettingsButton = new Button(APPLY_SETTINGS);
    restoreDefaultsButton = new Button(RESTORE_DEFAULTS);
    applySettingsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton);
    spacerHBox = new HBox();
    spacerHBox.setMinHeight(10.0);
    bottomSpacerHBox = new HBox();
    bottomSpacerHBox.setMinHeight(10.0);

    /////////////////////SETTINGS PANES/////////////////////
    //
    //
    //Version Banner
    versionBannerPane = new FlowPane();
    versionBannerPane.getStyleClass().add("settings_pane");
    versionBannerLabel = new Label(VERSION_LABEL);
    versionBannerLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    versionBannerLabel.setTooltip(new Tooltip(VERSION_TT));
    versionBannerChoice = new ToggleGroup();
    versionBannerOn = new RadioButton(ON_OFF[0] + "   ");
    versionBannerOn.setToggleGroup(versionBannerChoice);
    versionBannerOff = new RadioButton(ON_OFF[1]);
    versionBannerOff.setToggleGroup(versionBannerChoice);
    if (config.ShowVersionBanner.toString().equals(TRUE_FALSE[0])) {
        versionBannerOn.setSelected(true);
    } else {
        versionBannerOff.setSelected(true);
    }
    versionBannerPane.getChildren().addAll(versionBannerLabel, versionBannerOn, versionBannerOff);
    //
    //Toggle Overlay
    overlayPane = new FlowPane();
    overlayPane.getStyleClass().add("settings_pane");
    overlayLabel = new Label(OVERLAY_LABEL);
    overlayLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    overlayLabel.setTooltip(new Tooltip(OVERLAY_TT));
    overlayChoice = new ToggleGroup();
    overlayOn = new RadioButton(ON_OFF[0] + "   ");
    overlayOn.setToggleGroup(overlayChoice);
    overlayOff = new RadioButton(ON_OFF[1]);
    overlayOff.setToggleGroup(overlayChoice);
    if (config.ShowOverlay.toString().equals(TRUE_FALSE[0])) {
        overlayOn.setSelected(true);
    } else {
        overlayOff.setSelected(true);
    }
    overlayPane.getChildren().addAll(overlayLabel, overlayOn, overlayOff);
    //
    //Text Alignment
    textAlignmentPane = new FlowPane();
    textAlignmentPane.getStyleClass().add("settings_pane");
    textAlignmentLabel = new Label(TEXT_ALIGNMENT_LABEL);
    textAlignmentLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    textAlignmentLabel.setTooltip(new Tooltip(TEXT_ALIGNMENT_TT));
    textAlignmentChoice = new ToggleGroup();
    textAlignmentLeft = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[0] + "   ");
    textAlignmentLeft.setToggleGroup(textAlignmentChoice);
    textAlignmentCenter = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[1]);
    textAlignmentCenter.setToggleGroup(textAlignmentChoice);
    textAlignmentRight = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[2]);
    textAlignmentRight.setToggleGroup(textAlignmentChoice);
    if (config.TextAlignment.toString().equals(DSPW_TEXT_ALIGNMENT_OPTIONS[0])) {
        textAlignmentLeft.setSelected(true);
    } else if (config.TextAlignment.toString().equals(DSPW_TEXT_ALIGNMENT_OPTIONS[1])) {
        textAlignmentCenter.setSelected(true);
    } else {
        textAlignmentRight.setSelected(true);
    }
    textAlignmentPane.getChildren().addAll(textAlignmentLabel, textAlignmentLeft, textAlignmentCenter,
            textAlignmentRight);
    //
    //Invasion Notification Sound
    invasionNotifPane = new FlowPane();
    invasionNotifPane.getStyleClass().add("settings_pane");
    invasionNotifLabel = new Label(INVASION_NOTIF_LABEL);
    invasionNotifLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    invasionNotifLabel.setTooltip(new Tooltip(INVASION_NOTIF_TT));
    invasionNotifChoice = new ToggleGroup();
    invasionNotifOn = new RadioButton(ON_OFF[0] + "   ");
    invasionNotifOn.setToggleGroup(invasionNotifChoice);
    invasionNotifOff = new RadioButton(ON_OFF[1]);
    invasionNotifOff.setToggleGroup(invasionNotifChoice);
    if (config.InvasionSoundNotification.toString().equals(TRUE_FALSE[0])) {
        invasionNotifOn.setSelected(true);
    } else {
        invasionNotifOff.setSelected(true);
    }
    invasionNotifPane.getChildren().addAll(invasionNotifLabel, invasionNotifOn, invasionNotifOff);
    //
    //Cheater Notification Sound
    cheaterNotifPane = new FlowPane();
    cheaterNotifPane.getStyleClass().add("settings_pane");
    cheaterNotifLabel = new Label(CHEATER_NOTIF_LABEL);
    cheaterNotifLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    cheaterNotifLabel.setTooltip(new Tooltip(CHEATER_NOTIF_TT));
    cheaterNotifChoice = new ToggleGroup();
    cheaterNotifOn = new RadioButton(ON_OFF[0] + "   ");
    cheaterNotifOn.setToggleGroup(cheaterNotifChoice);
    cheaterNotifOff = new RadioButton(ON_OFF[1]);
    cheaterNotifOff.setToggleGroup(cheaterNotifChoice);
    if (config.CheaterSoundNotification.toString().equals(TRUE_FALSE[0])) {
        cheaterNotifOn.setSelected(true);
    } else {
        cheaterNotifOff.setSelected(true);
    }
    cheaterNotifPane.getChildren().addAll(cheaterNotifLabel, cheaterNotifOn, cheaterNotifOff);
    //
    //Block Arena Freeze
    blockArenaFreezePane = new FlowPane();
    blockArenaFreezePane.getStyleClass().add("settings_pane");
    blockArenaFreezeLabel = new Label(BLOCK_ARENA_FREEZE_LABEL);
    blockArenaFreezeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    blockArenaFreezeLabel.setTooltip(new Tooltip(BLOCK_ARENA_FREEZE_TT));
    blockArenaFreezeChoice = new ToggleGroup();
    blockArenaFreezeOn = new RadioButton(BLOCK_FREEZE_CHOICES[0] + "   ");
    blockArenaFreezeOn.setToggleGroup(blockArenaFreezeChoice);
    blockArenaFreezeOff = new RadioButton(BLOCK_FREEZE_CHOICES[1]);
    blockArenaFreezeOff.setToggleGroup(blockArenaFreezeChoice);
    if (config.BlockArenaFreeze.toString().equals(TRUE_FALSE[0])) {
        blockArenaFreezeOn.setSelected(true);
    } else {
        blockArenaFreezeOff.setSelected(true);
    }
    blockArenaFreezePane.getChildren().addAll(blockArenaFreezeLabel, blockArenaFreezeOn, blockArenaFreezeOff);
    //
    //Show Node Count
    nodeCountPane = new FlowPane();
    nodeCountPane.getStyleClass().add("settings_pane");
    nodeCountLabel = new Label(NODE_COUNT_LABEL);
    nodeCountLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    nodeCountLabel.setTooltip(new Tooltip(NODE_COUNT_TT));
    nodeCountChoice = new ToggleGroup();
    nodeCountOn = new RadioButton(ON_OFF[0] + "   ");
    nodeCountOn.setToggleGroup(nodeCountChoice);
    nodeCountOff = new RadioButton(ON_OFF[1]);
    nodeCountOff.setToggleGroup(nodeCountChoice);
    if (config.ShowNodeDbCount.toString().equals(TRUE_FALSE[0])) {
        nodeCountOn.setSelected(true);
    } else {
        nodeCountOff.setSelected(true);
    }
    nodeCountPane.getChildren().addAll(nodeCountLabel, nodeCountOn, nodeCountOff);
    //
    //Increase Node Limit
    increaseNodesPane = new FlowPane();
    increaseNodesPane.getStyleClass().add("settings_pane");
    increaseNodesLabel = new Label(INCREASE_NODES_LABEL);
    increaseNodesLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    increaseNodesLabel.setTooltip(new Tooltip(INCREASE_NODES_TT));
    increaseNodesChoice = new ToggleGroup();
    increaseNodesOn = new RadioButton(ON_OFF[0] + "   ");
    increaseNodesOn.setToggleGroup(increaseNodesChoice);
    increaseNodesOff = new RadioButton(ON_OFF[1]);
    increaseNodesOff.setToggleGroup(increaseNodesChoice);
    if (config.IncreaseNodeDbLimit.toString().equals(TRUE_FALSE[0])) {
        increaseNodesOn.setSelected(true);
    } else {
        increaseNodesOff.setSelected(true);
    }
    increaseNodesPane.getChildren().addAll(increaseNodesLabel, increaseNodesOn, increaseNodesOff);
    //
    //Font Size
    fontSizePane = new FlowPane();
    fontSizePane.getStyleClass().add("settings_pane");
    fontSizeLabel = new Label(FONT_SIZE_LABEL + " ");
    fontSizeLabel.setTooltip(new Tooltip(FONT_SIZE_TT));
    fontSizeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    fontSizeField = new TextField("" + config.FontSize.toString());
    fontSizeField.getStyleClass().add("settings_text_field");
    fontSizeField.setTooltip(new Tooltip(FONT_SIZE_FIELD_TT));
    fontSizePane.getChildren().addAll(fontSizeLabel, fontSizeField);
    //
    //Toggle Date
    datePane = new FlowPane();
    datePane.getStyleClass().add("settings_pane");
    dateLabel = new Label(DATE_LABEL);
    dateLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dateLabel.setTooltip(new Tooltip(DATE_TT));
    dateChoice = new ToggleGroup();
    dateOn = new RadioButton(ON_OFF[0] + "   ");
    dateOn.setToggleGroup(dateChoice);
    dateOff = new RadioButton(ON_OFF[1]);
    dateOff.setToggleGroup(dateChoice);
    if (config.DisplayDate.toString().equals(TRUE_FALSE[0])) {
        dateOn.setSelected(true);
    } else {
        dateOff.setSelected(true);
    }
    datePane.getChildren().addAll(dateLabel, dateOn, dateOff);
    //
    //Toggle Time
    timePane = new FlowPane();
    timePane.getStyleClass().add("settings_pane");
    timeLabel = new Label(TIME_LABEL);
    timeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    timeLabel.setTooltip(new Tooltip(TIME_TT));
    timeChoice = new ToggleGroup();
    timeOn = new RadioButton(ON_OFF[0] + "   ");
    timeOn.setToggleGroup(timeChoice);
    timeOff = new RadioButton(ON_OFF[1]);
    timeOff.setToggleGroup(timeChoice);
    if (config.DisplayClock.toString().equals(TRUE_FALSE[0])) {
        timeOn.setSelected(true);
    } else {
        timeOff.setSelected(true);
    }
    timePane.getChildren().addAll(timeLabel, timeOn, timeOff);
    //
    //Check for Updates
    updatePane = new FlowPane();
    updatePane.getStyleClass().add("settings_pane");
    updateLabel = new Label(UPDATE_LABEL);
    updateLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    updateLabel.setTooltip(new Tooltip(UPDATE_TT));
    updateChoice = new ToggleGroup();
    updateOn = new RadioButton(ON_OFF[0] + "   ");
    updateOn.setToggleGroup(updateChoice);
    updateOff = new RadioButton(ON_OFF[1]);
    updateOff.setToggleGroup(updateChoice);
    if (config.CheckForUpdates.toString().equals(TRUE_FALSE[0])) {
        updateOn.setSelected(true);
    } else {
        updateOff.setSelected(true);
    }
    updatePane.getChildren().addAll(updateLabel, updateOn, updateOff);
    //
    //DLL Chaining
    dllChainPane = new FlowPane();
    dllChainPane.getStyleClass().add("settings_pane");
    dllChainLabel = new Label(DLL_CHAIN_LABEL + " ");
    dllChainLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dllChainLabel.setTooltip(new Tooltip(DSPW_DLL_CHAIN_TT));
    dllChainField = new TextField();
    dllChainField.setEditable(false);
    dllChainButton = new Button("...");
    dllChainButton.setTooltip(new Tooltip(DLL_CHAIN_TOOLTIP));
    noChainButton = new Button(NO_CHAIN_BT);
    if (config.d3d9dllWrapper.toString().equals(NONE)) {
        noChainButton.setDisable(true);
        dllChainField.setStyle("-fx-text-fill: gray;");
    } else {
        noChainButton.setDisable(false);
    }
    dllChainField.setText(config.d3d9dllWrapper.toString());
    dllChainPane.getChildren().addAll(dllChainLabel, dllChainField, dllChainButton, noChainButton);
    //
    //
    //
    //////////////////////////////////
    ///////////Key Bindings///////////
    //////////////////////////////////
    //
    //
    //Keybinds Parent Label
    keybindsPane = new FlowPane();
    keybindsPane.getStyleClass().add("settings_pane");
    keybindsLabel = new Label(KEYBINDS_LABEL);
    keybindsLabel.getStyleClass().addAll("bold_text", "font_14_pt");
    keybindsPane.getChildren().add(keybindsLabel);
    //
    //Ban Phantom
    banPane = new FlowPane();
    banPane.getStyleClass().add("settings_pane");
    banLabel = new Label(BAN_LABEL + "  ");
    banLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    banPicker = new ComboBox(keybinds);
    banPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_BanPhantom.toString())));
    banPane.getChildren().addAll(banLabel, banPicker);
    //
    //Ignore Phantom
    ignorePane = new FlowPane();
    ignorePane.getStyleClass().add("settings_pane");
    ignoreLabel = new Label(IGNORE_LABEL + "  ");
    ignoreLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    ignorePicker = new ComboBox(keybinds);
    ignorePicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_IgnorePhantom.toString())));
    ignorePane.getChildren().addAll(ignoreLabel, ignorePicker);
    //
    //Toggle Overlay
    toggleOverlayPane = new FlowPane();
    toggleOverlayPane.getStyleClass().add("settings_pane");
    toggleOverlayLabel = new Label(TOGGLE_OVERLAY_LABEL + "  ");
    toggleOverlayLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    toggleOverlayPicker = new ComboBox(keybinds);
    toggleOverlayPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_HideOverlay.toString())));
    toggleOverlayPane.getChildren().addAll(toggleOverlayLabel, toggleOverlayPicker);
    //
    //About Dark Souls PvP Watchdog
    aboutPane = new FlowPane();
    aboutPane.getStyleClass().add("settings_pane");
    aboutLabel = new Label(ABOUT_DSPW_LABEL + "  ");
    aboutLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    aboutPicker = new ComboBox(keybinds);
    aboutPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_AboutDSPW.toString())));
    aboutPane.getChildren().addAll(aboutLabel, aboutPicker);

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, versionBannerPane, overlayPane,
            textAlignmentPane, invasionNotifPane, cheaterNotifPane, blockArenaFreezePane, nodeCountPane,
            increaseNodesPane, fontSizePane, datePane, timePane, updatePane, dllChainPane, keybindsPane,
            banPane, ignorePane, toggleOverlayPane, aboutPane, bottomSpacerHBox);

    initializeEventHandlers();

    this.setContent(primaryPane);
}

From source file:de.pixida.logtest.designer.automaton.AutomatonEdge.java

protected void createTextFieldInput(final ConfigFrame cf, final String propertyName, final String initialValue,
        final Consumer<String> applyValue, final Monospace monospace) {
    final TextField inputField = new TextField(initialValue);
    this.setMonospaceIfDesired(monospace, inputField);
    inputField.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        applyValue.accept(newValue);// w  w w  .ja  va  2 s .c  om
        this.getGraph().handleChange();
    });
    cf.addOption(propertyName, inputField);
}

From source file:de.pixida.logtest.designer.logreader.LogReaderEditor.java

private TextField createIntegerInputField(final TextField textInput, final Supplier<Integer> getter,
        final Consumer<Integer> setter) {
    final TextField integerInput = new TextField(getter.get() == null ? "" : String.valueOf(getter.get()));
    integerInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        if (!newValue.matches("\\d*")) {
            integerInput.setText(newValue.replaceAll("[^\\d]", ""));
            newValue = textInput.getText();
        }//from w  ww  .  j  a  va2s .  co  m
        if (StringUtils.isNotBlank(newValue)) {
            try {
                setter.accept(Integer.parseInt(newValue));
            } catch (final NumberFormatException nfe) {
                // This can only happen if the value is "too long" / too high for "int"
                integerInput.setText(String.valueOf(Integer.MAX_VALUE));
                setter.accept(Integer.MAX_VALUE);
            }
        } else {
            setter.accept(null);
        }
        this.setChanged(true);
    });
    final double maxWidthOfIntegerInput = 80d;
    integerInput.setMaxWidth(maxWidthOfIntegerInput);
    return integerInput;
}

From source file:webapptest.FXMLDocumentController.java

@FXML //Displays the list of facilities
public void refreshFacility(ActionEvent event) {
    facilityList.getChildren().clear();/*w w  w.j ava  2 s .  c  om*/

    //get the data of employees from the server
    List<String> temp = new ArrayList<>();
    temp.add("get_all_houses");
    String input = sendData(temp);

    //parse the data into an object
    List<Facility> facs = parseFacilityData(input);

    //display the headings for the employee display
    HBox heading = new HBox();
    Label id = new Label("House ID");
    Label neighborhood = new Label("House Neighborhood");

    heading.getChildren().add(id);
    heading.getChildren().add(neighborhood);

    facilityList.getChildren().add(heading);

    //loop through all available employees and display to screen
    for (Facility fac : facs) {
        HBox tempLine = new HBox();

        TextField hid = new TextField(fac.getHouseID());
        TextField hneighborhood = new TextField(fac.getHouseNeighborhood());

        tempLine.getChildren().add(hid);
        tempLine.getChildren().add(hneighborhood);

        facilityList.getChildren().add(tempLine);
    }
}

From source file:webapptest.FXMLDocumentController.java

@FXML //Displays the employees in the database
public void refreshButtonPressed(ActionEvent event) {
    employeeList.getChildren().clear();/*from  w ww  . j av  a2s. c  om*/

    //get the data of employees from the server
    List<String> temp = new ArrayList<>();
    temp.add("employee_info");
    String input = sendData(temp);

    //parse the data into an object
    List<Employee> emps = parseEmpData(input);

    //display the headings for the employee display
    HBox heading = new HBox();
    Label id = new Label("Employee ID");
    Label name = new Label("Employee Name");
    Label phone = new Label("Employee Phone Number");
    Label user = new Label("Employee User Name");
    Label manager = new Label("Is Manager?");
    Label backup = new Label("Is Backup?");

    heading.getChildren().add(id);
    heading.getChildren().add(name);
    heading.getChildren().add(phone);
    heading.getChildren().add(user);
    heading.getChildren().add(manager);
    heading.getChildren().add(backup);

    employeeList.getChildren().add(heading);

    //loop through all available employees and display to screen
    for (Employee emp : emps) {
        HBox tempLine = new HBox();

        String managerString;
        if (emp.getManager() == true) {
            managerString = "true";
        } else {
            managerString = "false";
        }
        String backupString;
        if (emp.getBackup() == true) {
            backupString = "true";
        } else {
            backupString = "false";
        }

        TextField tfid = new TextField(Integer.toString(emp.getID()));
        TextField tfname = new TextField(emp.getName());
        TextField tfphone = new TextField(emp.getPhone());
        TextField tfuser = new TextField(emp.getUserName());
        TextField tfmanager = new TextField(managerString);
        TextField tfbackup = new TextField(backupString);

        tempLine.getChildren().add(tfid);
        tempLine.getChildren().add(tfname);
        tempLine.getChildren().add(tfphone);
        tempLine.getChildren().add(tfuser);
        tempLine.getChildren().add(tfmanager);
        tempLine.getChildren().add(tfbackup);

        employeeList.getChildren().add(tempLine);
    }
}

From source file:org.simmi.GeneSetHead.java

License:asdf

public void cogBlastDlg(Set<String> species) {
    Dialog<String> cogdlg = new Dialog();

    ToggleGroup group = new ToggleGroup();
    VBox vbox = new VBox();
    RadioButton docker = new RadioButton("docker");
    docker.setToggleGroup(group);/*from w ww . j  a  v  a2 s. c  o m*/
    RadioButton local = new RadioButton("local");
    local.setToggleGroup(group);
    docker.setSelected(true);
    TextField dbpath = new TextField("/cdd_delta");
    TextField host = new TextField("geneset");

    vbox.getChildren().add(docker);
    vbox.getChildren().add(local);
    vbox.getChildren().add(dbpath);
    vbox.getChildren().add(host);

    cogdlg.getDialogPane().setContent(vbox);

    /*String dbPath = "/data/Cog";
    JTextField tf = new JTextField( dbPath );
    JTextField host = new JTextField("localhost");
    JOptionPane.showMessageDialog( null, new Object[] {tf, host} );*/

    cogdlg.getDialogPane().getButtonTypes().add(ButtonType.OK);
    cogdlg.getDialogPane().getButtonTypes().add(ButtonType.CANCEL);
    cogdlg.setResultConverter(param -> {
        if (!param.getButtonData().isCancelButton()) {
            return dbpath.getText();
        }
        return "";
    });
    Optional<String> ostr = cogdlg.showAndWait();
    if (ostr.isPresent()) {
        String str = ostr.get();
        if (str.length() > 0)
            SwingUtilities.invokeLater(() -> {
                geneset.cogBlast(species, dbpath.getText(), host.getText(), false, docker.isSelected());
            });
    }
}