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:boundary.GraphPane.java

private Node addThresholdSlider(float min, float max) {
    HBox hBox = new HBox();

    hBox.setPadding(new Insets(15, 12, 15, 12));
    hBox.setStyle("-fx-background-color: #66FFFF;");

    Label lblThreshold = new Label("Threshold: ");
    lblThreshold.setPrefSize(100, 20);/*from  w  w  w.ja v a  2 s.co m*/

    Label lblValue = new Label("Value: ");
    lblValue.setPrefSize(50, 20);
    TextField tfValue = new TextField(String.valueOf(min));

    Slider thresholdSlider = new Slider();
    thresholdSlider.setMin(Math.floor(min));
    thresholdSlider.setMax(Math.ceil(max));
    thresholdSlider.setMajorTickUnit(Math.ceil((max - min) / 5));
    thresholdSlider.setMinorTickCount(1);
    thresholdSlider.setBlockIncrement(1);
    thresholdSlider.setSnapToTicks(true);
    thresholdSlider.setShowTickMarks(true);

    thresholdSlider.valueProperty().addListener(new ChangeListener<Number>() {

        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {

            edgePredicate.setThreshold(newValue.floatValue());
            vertexPredicate.setThreshold(newValue.floatValue());

            vv.repaint();

            tfValue.setText(String.format(Locale.US, "%.2f", newValue.floatValue()));

        }
    });

    tfValue.addEventHandler(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {

        @Override
        public void handle(KeyEvent event) {
            float value;

            try {
                value = Float.parseFloat(tfValue.getText());
            } catch (Exception ex) {
                value = 0;
            }
            edgePredicate.setThreshold(value);
            vertexPredicate.setThreshold(value);

            vv.repaint();

            thresholdSlider.setValue(value);

        }
    });

    Label lblSearch = new Label("Search: ");
    lblSearch.setPrefSize(70, 20);

    TextField tf = new TextField();

    tf.addEventHandler(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {

        @Override
        public void handle(KeyEvent event) {
            String toFind = tf.getText().toLowerCase();

            for (NodeInfo nodeInfo : nodesHighlighted)
                nodeInfo.setHighlighted(false);

            if (nodesHighlighted.size() > 0) {
                nodesHighlighted.clear();
                vv.repaint();
            }

            if (toFind.length() > 2) {
                for (NodeInfo nodeInfo : nodes.values()) {
                    if (nodeInfo.getUserData().toLowerCase().contains((toFind))) {
                        nodeInfo.setHighlighted(true);
                        nodesHighlighted.add(nodeInfo);
                    }
                }

                if (nodesHighlighted.size() == 1) {
                    Layout<String, String> layout = vv.getGraphLayout();
                    Point2D q = layout.transform(nodesHighlighted.get(0).id);
                    Point2D lvc = vv.getRenderContext().getMultiLayerTransformer()
                            .inverseTransform(vv.getCenter());
                    final double dx = (lvc.getX() - q.getX()) / 10;
                    final double dy = (lvc.getY() - q.getY()) / 10;

                    Runnable animator = new Runnable() {

                        public void run() {
                            for (int i = 0; i < 10; i++) {
                                vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT)
                                        .translate(dx, dy);
                                try {
                                    Thread.sleep(100);
                                } catch (InterruptedException ex) {
                                }
                            }
                        }
                    };

                    Thread thread = new Thread(animator);
                    thread.start();
                }
                vv.repaint();
            }
        }
    });

    hBox.getChildren().addAll(lblThreshold, thresholdSlider, lblValue, tfValue, lblSearch, tf);

    return hBox;
}

From source file:webapptest.FXMLDocumentController.java

@FXML
public void groupRefreshButtonPressed(ActionEvent event) {
    groupList.getChildren().clear();/*from w w w  . jav a2 s  .c  o m*/

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

    //parse the data into an object
    List<Group> grps = parseGroupData(input);

    //display the headings for the group display
    HBox heading = new HBox();
    Label ID = new Label("Database ID");
    Label gid = new Label("Group ID");
    Label name = new Label("Group Name");
    Label manager = new Label("Manager ID");
    Label employee = new Label("Employee ID");

    heading.getChildren().add(ID);
    heading.getChildren().add(gid);
    heading.getChildren().add(name);
    heading.getChildren().add(manager);
    heading.getChildren().add(employee);

    groupList.getChildren().add(heading);
    for (Group grp : grps) {

        List<Member> member = grp.getEmps();

        for (Member mem : member) { //Loops through the members of the group
            HBox tempLine = new HBox();
            TextField tfid = new TextField(mem.getID());
            TextField tfname = new TextField(mem.getName());
            TextField tfgroupid = new TextField(mem.getGroupID());
            TextField tfmanager = new TextField(mem.getManager());
            TextField tfemp = new TextField(mem.getEmps());

            tempLine.getChildren().add(tfid);
            tempLine.getChildren().add(tfname);
            tempLine.getChildren().add(tfgroupid);
            tempLine.getChildren().add(tfmanager);
            tempLine.getChildren().add(tfemp);

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

From source file:com.anavationllc.o2jb.ConfigurationApp.java

private TextField getUser() {
    if (user == null) {
        user = new TextField(
                loadedProps != null && loadedProps.containsKey("user") ? loadedProps.get("user") : "");
        user.setPromptText(msg("form.user.prompt"));
        user.setMinWidth(TextField.USE_PREF_SIZE);
        user.setPrefWidth(TEXT_BOX_WIDTH);
        user.setOnKeyReleased(getKeyEventHandler());
    }//from ww w  .  j av  a 2 s . co  m
    return user;
}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private void addRowNetEarnings(final Pane content, final BookingBean be) {
    final HBox box = new HBox();
    box.setSpacing(boxSpacing);/* w  ww  .  java 2s. c o m*/
    box.setPadding(boxPadding);
    box.setAlignment(Pos.CENTER_LEFT);
    box.setFillHeight(true);
    final TextField grossEarningsExpression = new TextField(be.getGrossEarningsExpression());
    grossEarningsExpression.setPrefWidth(prefTextInputFieldWidth * 1.5);
    booking2GrossEarnings.put(be, grossEarningsExpression);
    final Text grossEarnings = new Text(decimalFormat.format(be.getGrossEarnings()));
    final TextFlow tf = new TextFlow(new Text("Gross Earnings: "), grossEarningsExpression, new Text(" = "),
            grossEarnings, new Text(""));
    box.getChildren().addAll(tf);
    if (be.getGrossEarnings() <= 0) {
        box.getStyleClass().addAll("warning", "warning-bg");
    }

    final HBox box2 = new HBox();
    box2.setSpacing(boxSpacing);
    box2.setPadding(boxPadding);
    box2.setAlignment(Pos.CENTER_LEFT);
    box2.setFillHeight(true);

    Text text = new Text("Amount received: ");
    TextField textField = new TextField();
    textField.setText(new NumberStringConverter().toString(be.getPaymentSoFar()));
    textField.setEditable(false);
    be.paymentSoFarProperty().addListener((c, o, n) -> {
        textField.setText(new NumberStringConverter().toString(n));
    });
    box2.getChildren().addAll(text, textField);
    content.getChildren().addAll(box, box2);

}

From source file:webapptest.FXMLDocumentController.java

@FXML
public void groupDeleteButtonPressed(ActionEvent event) {
    //enables deleting of a facility
    groupDelete = true;//from   www.j av a 2 s .c  om

    //displays the facility id to be deleted inside the delete area
    groupDeleteDisplay.getChildren().add(new TextField(groupDeleteID.getText()));
    groupDeleteDisplay.getChildren().add(new TextField(groupDeleteName.getText()));

}

From source file:com.anavationllc.o2jb.ConfigurationApp.java

private TextField getDriverClass() {
    if (driverClass == null) {
        driverClass = new TextField(
                loadedProps != null && loadedProps.containsKey("driver") ? loadedProps.get("driver") : "");
        driverClass.setPromptText(msg("form.driver.prompt"));
        driverClass.setMinWidth(TextField.USE_PREF_SIZE);
        driverClass.setPrefWidth(TEXT_BOX_WIDTH);
        driverClass.setOnKeyReleased(getKeyEventHandler());
    }//from ww w  . j a v a  2 s. com
    return driverClass;
}

From source file:com.anavationllc.o2jb.ConfigurationApp.java

private TextField getClassPath() {
    if (classPath == null) {
        classPath = new TextField(
                loadedProps != null && loadedProps.containsKey("cp") ? loadedProps.get("cp") : "");
        classPath.setPromptText(msg("form.cp.prompt"));
        classPath.setMinWidth(TextField.USE_PREF_SIZE);
        classPath.setPrefWidth(TEXT_BOX_WIDTH);
        classPath.setOnKeyReleased(getKeyEventHandler());
    }//from  w  w  w .  ja v  a 2 s .c  o m
    return classPath;
}

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

private List<Triple<String, Node, String>> createConfigurationForm() {
    final List<Triple<String, Node, String>> formItems = new ArrayList<>();

    // Headline pattern
    final TextField textInput = new TextField(this.logReader.getHeadlinePattern());
    textInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        this.logReader.setHeadlinePattern(newValue);
        this.setChanged(true);
    });/*from  w w  w .  j  ava2 s.c om*/
    textInput.setStyle("-fx-font-family: monospace");
    formItems.add(Triple.of("Headline Pattern", textInput,
            "The perl style regular expression is used to spot the beginning of"
                    + " log entries in the log file. If a log entry consists of multiple lines, this pattern must only match the first"
                    + " line, called \"head line\". Groups can intentionally be matched to spot values like timestamp or channel name."
                    + " All matching groups are removed from the payload before they are processed by an automaton."));

    // Index of timestamp
    Supplier<Integer> getter = () -> this.logReader.getHeadlinePatternIndexOfTimestamp();
    Consumer<Integer> setter = value -> this.logReader.setHeadlinePatternIndexOfTimestamp(value);
    final TextField indexOfTimestampInput = this.createIntegerInputField(textInput, getter, setter);
    formItems.add(Triple.of("Timestamp Group", indexOfTimestampInput,
            "Denotes which matching group in the headline pattern contains"
                    + " the timestamp. Index 0 references the whole pattern match, index 1 is the first matching group etc. The timestamp must"
                    + " always be a valid integer. Currently, this integer is always interpreted as milliseconds. If no value is set, no"
                    + " timestamp will be extracted and timing conditions cannot be used. If the referenced matching group is optional"
                    + " and does not match for a specific head line, the last recent timestamp will be used for the extracted log entry."));

    // Index of channel
    getter = () -> this.logReader.getHeadlinePatternIndexOfChannel();
    setter = value -> this.logReader.setHeadlinePatternIndexOfChannel(value);
    final TextField indexOfChannelInput = this.createIntegerInputField(textInput, getter, setter);
    formItems.add(Triple.of("Channel Group", indexOfChannelInput,
            "Denotes which matching group in the headline pattern contains"
                    + " the channel. If the value is empty or the matching group is optional and it did not match, the default channel is used"
                    + " for the extracted log entry."));

    // Trim payload
    CheckBox cb = new CheckBox();
    cb.setSelected(this.logReader.getTrimPayload());
    cb.selectedProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> {
        this.logReader.setTrimPayload(BooleanUtils.toBoolean(newValue));
        this.setChanged(true);
    });
    formItems.add(Triple.of("Trim Payload", cb, "Only has effect on multiline payloads."
            + " If enabled, all leading and trailing whitespaces are removed from the payload"
            + " after the matching groups are removed. This allows for regular expressions in the automaton that match the beginning"
            + " and the end of the payload, without having to take care too much for whitespaces in the source log file."));

    // Handling of non headline lines
    this.createInputForHandlingOfNonHeadlineLines(formItems);

    // Trim payload
    cb = new CheckBox();
    cb.setSelected(this.logReader.getRemoveEmptyPayloadLinesFromMultilineEntry());
    cb.selectedProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> {
        this.logReader.setRemoveEmptyPayloadLinesFromMultilineEntry(BooleanUtils.toBoolean(newValue));
        this.setChanged(true);
    });
    formItems.add(Triple.of("Remove Empty Lines", cb,
            "If enabled, empty lines will be removed from multiline payload entries."));

    // Charset
    final SortedMap<String, Charset> charsets = Charset.availableCharsets();
    final ChoiceBox<String> encodingInput = new ChoiceBox<>(
            FXCollections.observableArrayList(charsets.keySet()));
    encodingInput.getSelectionModel().select(this.logReader.getLogFileCharset().name());
    encodingInput.getSelectionModel().selectedItemProperty()
            .addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
                this.logReader.setLogFileCharset(charsets.get(newValue));
                this.setChanged(true);
            });
    formItems.add(Triple.of("Log File Encoding", encodingInput,
            "Encoding of the log file. Note that some of the encodings are"
                    + " platform specific such that reading the log on a different platform might fail. Usually, log files are written"
                    + " using UTF-8, UTF-16, ISO-8859-1 or ASCII."));

    return formItems;
}

From source file:dsfixgui.view.DSFGraphicsPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);/* ww  w.  j a  va2 s . c  om*/
    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(GRAPHICS.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/////////////////////
    //
    //
    //
    //MAIN GRAPHICS OPTIONS
    //
    //Render resolution
    renderResPane = new FlowPane();
    renderResPane.getStyleClass().add("settings_pane");
    renderResLabel = new Label(RENDER_RES_LABEL + "   ");
    renderResLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    renderResLabel.setTooltip(new Tooltip(RENDER_RES_TT));
    renderWidthLabel = new Label(WIDTH_HEIGHT[0] + ":");
    renderWidthField = new TextField("");
    renderWidthField.appendText("" + config.getRenderWidth());
    renderWidthField.getStyleClass().add("settings_text_field");
    renderHeightLabel = new Label("  " + WIDTH_HEIGHT[1] + ":");
    renderHeightField = new TextField("");
    renderHeightField.appendText("" + config.getRenderHeight());
    renderHeightField.getStyleClass().add("settings_text_field");
    setWindowsRenderRes = new Button(USE_WINDOWS_RES);
    renderResPane.getChildren().addAll(renderResLabel, renderWidthLabel, renderWidthField, renderHeightLabel,
            renderHeightField, setWindowsRenderRes);
    //
    //Present Resolution
    presentResPane = new FlowPane();
    presentResPane.getStyleClass().add("settings_pane");
    presentResLabel = new Label(PRESENT_RES_LABEL + "  ");
    presentResLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    presentResLabel.setTooltip(new Tooltip(PRESENT_RES_TT));
    presentResSpacer = new HBox();
    presentResSpacer.setMinWidth(3);
    presentWidthLabel = new Label(WIDTH_HEIGHT[0] + ":");
    presentWidthField = new TextField("");
    presentWidthField.appendText(config.getPresentWidth() + "");
    presentRes[0] = config.getPresentWidth() + "";
    presentWidthField.getStyleClass().add("settings_text_field");
    presentHeightLabel = new Label("  " + WIDTH_HEIGHT[1] + ":");
    presentHeightField = new TextField("");
    presentHeightField.appendText(config.getPresentHeight() + "");
    presentRes[1] = config.getPresentHeight() + "";
    presentHeightField.getStyleClass().add("settings_text_field");
    setWindowsPresentRes = new Button(USE_WINDOWS_RES);
    presentResSpacer2 = new HBox();
    presentResSpacer2.setMinWidth(5);
    presentResChoice = new ToggleGroup();
    usePresentRes = new RadioButton(USE_PRESENT_RES + "   ");
    usePresentRes.setToggleGroup(presentResChoice);
    dontUsePresentRes = new RadioButton(DONT_USE_PRES_RES);
    dontUsePresentRes.setToggleGroup(presentResChoice);
    //Check if presentRes is off
    if (config.getPresentWidth() == 0 && config.getPresentHeight() == 0) {
        presentWidthField.setDisable(true);
        presentHeightField.setDisable(true);
        setWindowsPresentRes.setDisable(true);
        dontUsePresentRes.setSelected(true);
    } else {
        presentWidthField.setDisable(false);
        presentWidthField.setText("" + config.getPresentWidth());
        presentHeightField.setDisable(false);
        presentHeightField.setText("" + config.getPresentHeight());
        setWindowsPresentRes.setDisable(false);
        usePresentRes.setSelected(true);
        recheckTextInput(presentWidthField);
        recheckTextInput(presentHeightField);
    }
    presentResPane.getChildren().addAll(presentResLabel, presentResSpacer, presentWidthLabel, presentWidthField,
            presentHeightLabel, presentHeightField, setWindowsPresentRes, presentResSpacer2, usePresentRes,
            dontUsePresentRes);
    //
    //
    //
    //ANTIALIASING OPTIONS
    //
    //AA Quality
    aaQualityPane = new FlowPane();
    aaQualityPane.getStyleClass().add("settings_pane");
    aaQualityLabel = new Label(AA_QUALITY_LABEL + "  ");
    aaQualityLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    aaQualityLabel.setTooltip(new Tooltip(AA_QUALITY_TT));
    aaQualityPicker = new ComboBox(FXCollections.observableArrayList(AAQUALITIES));
    aaQualityPicker.setValue(AAQUALITIES[config.aaQuality.get()]);
    aaQualityPane.getChildren().addAll(aaQualityLabel, aaQualityPicker);
    //
    //AA Type
    aaTypePane = new FlowPane();
    aaTypePane.getStyleClass().add("settings_pane");
    aaTypeLabel = new Label(AA_TYPE_LABEL + "  ");
    aaTypeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    aaTypeLabel.setTooltip(new Tooltip(AA_TYPE_TT));
    aaTypePicker = new ComboBox(FXCollections.observableArrayList(AATYPES));
    aaTypePicker.setValue(config.aaType.toString());
    if (config.aaQuality.get() == 0) {
        aaTypePicker.setDisable(true);
    }
    aaTypePane.getChildren().addAll(aaTypeLabel, aaTypePicker);
    //
    //
    //
    //AMBIENT OCCLUSION OPTIONS
    //
    //SSAO Strength
    ssaoStrengthPane = new FlowPane();
    ssaoStrengthPane.getStyleClass().add("settings_pane");
    ssaoStrengthLabel = new Label(SSAO_STRENGTH_LABEL + "  ");
    ssaoStrengthLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    ssaoStrengthLabel.setTooltip(new Tooltip(SSAO_STRENGTH_TT));
    ssaoStrengthPicker = new ComboBox(FXCollections.observableArrayList(SSAOSTRENGTHS));
    ssaoStrengthPicker.setValue(SSAOSTRENGTHS[config.ssaoStrength.get()]);
    ssaoStrengthPane.getChildren().addAll(ssaoStrengthLabel, ssaoStrengthPicker);
    //
    //SSAO Scale
    ssaoScalePane = new FlowPane();
    ssaoScalePane.getStyleClass().add("settings_pane");
    ssaoScaleLabel = new Label(SSAO_SCALE_LABEL + "  ");
    ssaoScaleLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    ssaoScaleLabel.setTooltip(new Tooltip(SSAO_SCALE_TT));
    ssaoScalePicker = new ComboBox(FXCollections.observableArrayList(SSAOSCALES));
    ssaoScalePicker.setValue(SSAOSCALES[config.ssaoScale.get() - 1]);
    if (config.ssaoStrength.get() == 0) {
        ssaoScalePicker.setDisable(true);
    }
    ssaoScalePane.getChildren().addAll(ssaoScaleLabel, ssaoScalePicker);
    //
    //SSAO Type
    ssaoTypePane = new FlowPane();
    ssaoTypePane.getStyleClass().add("settings_pane");
    ssaoTypeLabel = new Label(SSAO_TYPE_LABEL + "  ");
    ssaoTypeLabel.setTooltip(new Tooltip(SSAO_TYPE_TT));
    ssaoTypeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    ssaoTypePicker = new ComboBox(FXCollections.observableArrayList(SSAOTYPES));
    ssaoTypePicker.setValue(config.ssaoType.toString());
    if (config.ssaoStrength.get() == 0) {
        ssaoTypePicker.setDisable(true);
    }
    ssaoTypePane.getChildren().addAll(ssaoTypeLabel, ssaoTypePicker);
    //
    //
    //
    //DEPTH OF FIELD OPTIONS
    //
    //DOF Override Resolution
    dofOverridePane = new FlowPane();
    dofOverridePane.getStyleClass().add("settings_pane");
    dofOverrideLabel = new Label(DOF_OVERRIDE_LABEL + "  ");
    dofOverrideLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dofOverrideLabel.setTooltip(new Tooltip(DOF_OVERRIDE_TT));
    dofOverridePicker = new ComboBox(FXCollections.observableArrayList(DOFOVERRIDERESOLUTIONS));
    for (int i = 0; i < DOF_OVERRIDE_OPTIONS.length; i++) {
        if (config.getDOFOverride() == DOF_OVERRIDE_OPTIONS[i]) {
            dofOverridePicker.setValue(DOFOVERRIDERESOLUTIONS[i]);
        }
    }
    dofOverridePane.getChildren().addAll(dofOverrideLabel, dofOverridePicker);
    //
    //DOF Scaling
    dofScalingPane = new FlowPane();
    dofScalingPane.getStyleClass().add("settings_pane");
    dofScalingLabel = new Label(DOF_SCALING_LABEL + "  ");
    dofScalingLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dofScalingLabel.setTooltip(new Tooltip(DOF_SCALING_OR_TT));
    dofScalingChoice = new ToggleGroup();
    dofScalingEnabled = new RadioButton(ENABLE_DISABLE[0] + "   ");
    dofScalingEnabled.setToggleGroup(dofScalingChoice);
    dofScalingDisabled = new RadioButton(ENABLE_DISABLE[1]);
    dofScalingDisabled.setToggleGroup(dofScalingChoice);
    if (config.disableDofScaling.get() == 0) {
        dofScalingEnabled.setSelected(true);
    } else {
        dofScalingDisabled.setSelected(true);
    }
    dofScalingPane.getChildren().addAll(dofScalingLabel, dofScalingEnabled, dofScalingDisabled);
    //
    //DOF Additional Blur
    dofAddPane = new FlowPane();
    dofAddPane.getStyleClass().add("settings_pane");
    dofAddLabel = new Label(DOF_ADD_BLUR_LABEL + "  ");
    dofAddLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dofAddLabel.setTooltip(new Tooltip(DOF_ADD_BLUR_TT));
    dofAddPicker = new ComboBox(FXCollections.observableArrayList(DOF_ADDITIONAL_BLUR));
    for (int i = 0; i < DOF_ADDITIONAL_BLUR_OPTIONS.length; i++) {
        if (config.dofBlurAmount.toString().equals(DOF_ADDITIONAL_BLUR_OPTIONS[i])) {
            dofAddPicker.setValue(DOF_ADDITIONAL_BLUR[i]);
        }
    }
    dofAddPane.getChildren().addAll(dofAddLabel, dofAddPicker);
    if (config.disableDOF) {
        dofScalingEnabled.setDisable(true);
        dofScalingDisabled.setDisable(true);
        dofAddPicker.setDisable(true);
        dofOverridePicker.setValue(DOFOVERRIDERESOLUTIONS[5]);
        setWindowsPresentRes.setDisable(true);
        presentWidthField.setDisable(true);
        presentHeightField.setDisable(true);
        usePresentRes.setDisable(true);
        dontUsePresentRes.setDisable(true);
    }
    //
    //
    //
    //FRAMERATE OPTIONS
    //
    //Unlock Framerate
    unlockFPSPane = new FlowPane();
    unlockFPSPane.getStyleClass().add("settings_pane");
    unlockFPSLabel = new Label(UNLOCK_FPS_LABEL + "  ");
    unlockFPSLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    unlockFPSLabel.setTooltip(new Tooltip(UNLOCK_FPS_TT));
    unlockFPSChoice = new ToggleGroup();
    fpsLocked = new RadioButton(LOCK_UNLOCK[0] + "   ");
    fpsLocked.setToggleGroup(unlockFPSChoice);
    fpsUnlocked = new RadioButton(LOCK_UNLOCK[1]);
    fpsUnlocked.setToggleGroup(unlockFPSChoice);
    if (config.unlockFPS.get() == 0) {
        fpsLocked.setSelected(true);
    } else {
        fpsUnlocked.setSelected(true);
    }
    unlockFPSPane.getChildren().addAll(unlockFPSLabel, fpsLocked, fpsUnlocked);
    //
    //Bonfire FPSFix Keybind
    fpsFixKeyPane = new FlowPane();
    fpsFixKeyPane.getStyleClass().add("settings_pane");
    fpsFixKeyLabel = new Label(FPS_FIX_KEY_LABEL + "  ");
    fpsFixKeyLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    fpsFixKeyLabel.setTooltip(new Tooltip(FPS_FIX_TT));

    fpsFixKeyPicker = new ComboBox(FPS_FIX_KEYS_ARRAY_LIST);
    fpsFixKeyPicker.setTooltip(new Tooltip(FPS_FIX_TT));
    fpsFixKeyPane.getChildren().addAll(fpsFixKeyLabel, fpsFixKeyPicker);
    //
    fpsFixKey = getFPSFixKey();
    if (fpsFixKey != null) {
        fpsFixKeyPicker.setValue(FPS_FIX_KEYS[FPS_FIX_KEYS_HEX_ARRAY_LIST.indexOf("0x" + fpsFixKey)]);
    } else {
        fpsFixKeyPicker.setValue(FPS_FIX_KEYS[4]);
        fpsFixKeyPicker.setDisable(true);
    }
    //
    //FPS Limit
    fpsLimitPane = new FlowPane();
    fpsLimitPane.getStyleClass().add("settings_pane");
    fpsLimitLabel = new Label(FPS_LIMIT_LABEL + "         ");
    fpsLimitLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    fpsLimitLabel.setTooltip(new Tooltip(FPS_LIMIT_TT));
    fpsLimitField = new TextField("" + config.FPSlimit);
    fpsLimitField.getStyleClass().add("settings_small_text_field");
    fpsLimitPane.getChildren().addAll(fpsLimitLabel, fpsLimitField);
    //
    if (config.unlockFPS.get() == 0) {
        fpsLimitField.setDisable(true);
    }
    //
    //FPS Threshold (for automatic disabling of AA)
    fpsThresholdPane = new FlowPane();
    fpsThresholdPane.getStyleClass().add("settings_pane");
    fpsThresholdLabel = new Label(FPS_THRESHOLD_LABEL + " ");
    fpsThresholdLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    fpsThresholdLabel.setTooltip(new Tooltip(FPS_THRESHOLD_TT));
    fpsThresholdField = new TextField("" + config.FPSthreshold);
    fpsThresholdField.getStyleClass().add("settings_small_text_field");
    fpsThresholdPane.getChildren().addAll(fpsThresholdLabel, fpsThresholdField);
    //
    //
    //
    //TEXTURE FILTERING OPTIONS
    //
    //Texture Filtering Override
    texOverridePane = new FlowPane();
    texOverridePane.getStyleClass().add("settings_pane");
    texOverrideLabel = new Label(TEX_FILTERING_OVERRIDE_LABEL + "  ");
    texOverrideLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    texOverrideLabel.setTooltip(new Tooltip(TEX_FILT_OR_TT));
    texOverridePicker = new ComboBox(FXCollections.observableArrayList(FILTERINGOVERRIDES));
    for (int i = 0; i < FILTERING_OVERRIDE_OPTIONS.length; i++) {
        if (config.filteringOverride.get() == i) {
            texOverridePicker.setValue(FILTERINGOVERRIDES[i]);
        }
    }
    texOverridePane.getChildren().addAll(texOverrideLabel, texOverridePicker);

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, renderResPane, presentResPane,
            aaQualityPane, aaTypePane, ssaoStrengthPane, ssaoScalePane, ssaoTypePane, dofOverridePane,
            dofScalingPane, dofAddPane, fpsFixKeyPane, unlockFPSPane, fpsLimitPane, fpsThresholdPane,
            texOverridePane, bottomSpacerHBox);

    if (config.disableDOF) {
        dofScalingEnabled.setDisable(true);
        dofScalingDisabled.setDisable(true);
        dofAddPicker.setDisable(true);
        presentWidthField.setDisable(true);
        presentHeightField.setDisable(true);
        setWindowsPresentRes.setDisable(true);
        usePresentRes.setDisable(true);
        dontUsePresentRes.setDisable(true);
        dofScalingDisabled.setSelected(true);
        dofAddPicker.setValue(dofAddPicker.getItems().get(0));
        if (usePresentRes.isSelected()) {
            presentRes[0] = presentWidthField.getText();
            presentRes[1] = presentHeightField.getText();
        }
        presentWidthField.setText("0");
        presentHeightField.setText("0");
    }

    recheckTextInput(presentWidthField);
    recheckTextInput(presentHeightField);
    recheckTextInput(renderWidthField);
    recheckTextInput(renderHeightField);

    initializeEventHandlers();
    this.setContent(primaryPane);
}

From source file:webapptest.FXMLDocumentController.java

@FXML //Pressed to initiate a delete for a facility
public void deleteFacButtonPressed(ActionEvent event) throws IOException {
    //enables deleting of a facility
    facilityDelete = true;/*from ww w  .  j a va  2  s  .com*/

    //displays the facility id to be deleted inside the delete area
    facDeleteDisplay.getChildren().add(new TextField(facDeleteID.getText()));
    facDeleteDisplay.getChildren().add(new TextField(facDeleteNeighborhood.getText()));
}