List of usage examples for javafx.scene.control ComboBox ComboBox
public ComboBox(ObservableList<T> items)
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); ObservableList<String> list = FXCollections.observableArrayList("1", "2", "3", "4"); ComboBox<String> emailComboBox = new ComboBox<String>(list); emailComboBox.setValue("A"); System.out.println(emailComboBox.getVisibleRowCount()); GridPane grid = new GridPane(); grid.setVgap(4);/*from www . j a v a 2 s . co m*/ grid.setHgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); grid.add(new Label("To: "), 0, 0); grid.add(emailComboBox, 1, 0); Group root = (Group) scene.getRoot(); root.getChildren().add(grid); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); ObservableList<String> list = FXCollections.observableArrayList("1", "2", "3", "4"); ComboBox<String> emailComboBox = new ComboBox<String>(list); emailComboBox.setValue("A"); System.out.println(emailComboBox.itemsProperty()); GridPane grid = new GridPane(); grid.setVgap(4);/*from w w w . ja va2 s . c o m*/ grid.setHgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); grid.add(new Label("To: "), 0, 0); grid.add(emailComboBox, 1, 0); Group root = (Group) scene.getRoot(); root.getChildren().add(grid); stage.setScene(scene); stage.show(); }
From source file:de.perdian.apps.tagtiger.fx.handlers.batchupdate.UpdateFileNamesFromTagsActionEventHandler.java
@Override protected BatchUpdateDialog createDialog() { ObservableList<UpdateFileNamesFromTagsItem> items = FXCollections.observableArrayList( this.getOtherFiles().stream().map(UpdateFileNamesFromTagsItem::new).collect(Collectors.toList())); StringProperty patternFieldProperty = new SimpleStringProperty(); List<String> patternItems = Arrays.asList("${track} ${title}"); ComboBox<String> patternBox = new ComboBox<>(FXCollections.observableArrayList(patternItems)); patternBox.setEditable(true);//from w w w . ja va 2 s . co m patternBox.setMaxWidth(Double.MAX_VALUE); Bindings.bindBidirectional(patternFieldProperty, patternBox.editorProperty().get().textProperty()); HBox.setHgrow(patternBox, Priority.ALWAYS); Button executeButton = new Button(this.getLocalization().executeRename(), new ImageView(new Image(UpdateFileNamesFromTagsActionEventHandler.class.getClassLoader() .getResourceAsStream("icons/16/save.png")))); executeButton.setDisable(true); patternFieldProperty .addListener((o, oldValue, newValue) -> executeButton.setDisable(newValue.length() <= 0)); HBox patternFieldPane = new HBox(10, patternBox, executeButton); patternFieldPane.setPadding(new Insets(5, 5, 5, 5)); TitledPane patternFieldTitlePane = new TitledPane(this.getLocalization().fileNamePattern(), patternFieldPane); patternFieldTitlePane.setCollapsible(false); TableView<?> newFileNamesPane = this.createNewFileNamesPane(items); newFileNamesPane.setPrefHeight(400); VBox.setVgrow(newFileNamesPane, Priority.ALWAYS); VBox actionPane = new VBox(10, patternFieldTitlePane, newFileNamesPane); // Create the dialog and finish BatchUpdateDialog dialog = new BatchUpdateDialog(); dialog.setDialogPrefWidth(800); dialog.setDialogTitle(this.getLocalization().updateFileNames()); dialog.setActionPane(actionPane); dialog.setLegendPane(this.createLegendPane()); // Add listeners this.getOtherFiles().addListener( new WeakListChangeListener<>((Change<? extends TaggableFile> change) -> items.setAll(change .getList().stream().map(UpdateFileNamesFromTagsItem::new).collect(Collectors.toList())))); patternFieldProperty.addListener((o, oldValue, newValue) -> this.computeNewFileNames(items, newValue)); executeButton.setOnAction(event -> { this.updateNewFileNames(items); ((Stage) executeButton.getScene().getWindow()).close(); }); return dialog; }
From source file:eu.ggnet.dwoss.receipt.shipment.ShipmentUpdateStage.java
private void init(Shipment s) { okButton.setOnAction((ActionEvent event) -> { shipment = getShipment();//w ww . jav a 2s .c o m if (isValid()) close(); }); cancelButton.setOnAction((ActionEvent event) -> { close(); }); idField = new TextField(Long.toString(s.getId())); idField.setDisable(true); shipIdField = new TextField(s.getShipmentId()); Callback<ListView<TradeName>, ListCell<TradeName>> cb = new Callback<ListView<TradeName>, ListCell<TradeName>>() { @Override public ListCell<TradeName> call(ListView<TradeName> param) { return new ListCell<TradeName>() { @Override protected void updateItem(TradeName item, boolean empty) { super.updateItem(item, empty); if (item == null || empty) setText("Hersteller whlen..."); else setText(item.getName()); } }; } }; Set<TradeName> contractors = Client.lookup(MandatorSupporter.class).loadContractors().all(); ownerBox = new ComboBox<>(FXCollections.observableArrayList(contractors)); ownerBox.setMaxWidth(MAX_VALUE); ownerBox.setCellFactory(cb); ownerBox.getSelectionModel().selectedItemProperty().addListener( (ObservableValue<? extends TradeName> observable, TradeName oldValue, TradeName newValue) -> { if (newValue == null) return; shipment.setContractor(newValue); manufacturerBox.getSelectionModel().select(newValue.getManufacturer()); }); ObservableList<TradeName> manufacturers = FXCollections.observableArrayList(TradeName.getManufacturers()); manufacturerBox = new ComboBox<>(manufacturers); manufacturerBox.setMaxWidth(MAX_VALUE); manufacturerBox.setCellFactory(cb); SingleSelectionModel<TradeName> sm = ownerBox.getSelectionModel(); if (s.getContractor() == null) sm.selectFirst(); else sm.select(s.getContractor()); if (shipment.getDefaultManufacturer() != null) manufacturerBox.getSelectionModel().select(shipment.getDefaultManufacturer()); statusBox = new ComboBox<>(FXCollections.observableArrayList(Shipment.Status.values())); statusBox.setMaxWidth(MAX_VALUE); statusBox.getSelectionModel().select(s.getStatus() == null ? OPENED : s.getStatus()); GridPane grid = new GridPane(); grid.addRow(1, new Label("ID:"), idField); grid.addRow(2, new Label("Shipment ID:"), shipIdField); grid.addRow(3, new Label("Besitzer:"), ownerBox); grid.addRow(4, new Label("Hersteller:"), manufacturerBox); grid.addRow(5, new Label("Status"), statusBox); grid.setMaxWidth(MAX_VALUE); grid.vgapProperty().set(2.); grid.getColumnConstraints().add(0, new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.SOMETIMES, HPos.LEFT, false)); grid.getColumnConstraints().add(1, new ColumnConstraints(100, 150, Double.MAX_VALUE, Priority.ALWAYS, HPos.LEFT, true)); HBox hButtonBox = new HBox(okButton, cancelButton); hButtonBox.alignmentProperty().set(Pos.TOP_RIGHT); errorLabel.setWrapText(true); BorderPane rootPane = new BorderPane(grid, errorLabel, null, hButtonBox, null); this.setTitle(s.getId() > 0 ? "Shipment bearbeiten" : "Shipment anlegen"); this.setScene(new Scene(rootPane)); this.setResizable(false); }
From source file:dsfixgui.view.DSFSavesPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);/*from w w 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(SAVE_BACKUP.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///////////////////// // // //Toggle Save Backups saveBackupsPane = new FlowPane(); saveBackupsPane.getStyleClass().add("settings_pane"); saveBackupsLabel = new Label(SAVE_BACKUPS_LABEL + " "); saveBackupsLabel.getStyleClass().addAll("bold_text", "font_12_pt"); saveBackupsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableBackups.get() == 0) { saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(0)); } else { saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(1)); } saveBackupsPane.getChildren().addAll(saveBackupsLabel, saveBackupsPicker); // //Save Backup Interval saveIntervalPane = new FlowPane(); saveIntervalPane.getStyleClass().add("settings_pane"); saveIntervalLabel = new Label(SAVE_BACKUPS_INTERVAL_LABEL + " "); saveIntervalLabel.getStyleClass().addAll("bold_text", "font_12_pt"); saveIntervalLabel.setTooltip(new Tooltip(SAVE_INTERVAL_TT)); saveIntervalField = new TextField("" + config.backupInterval.get()); saveIntervalField.getStyleClass().add("settings_text_field"); saveIntervalPane.getChildren().addAll(saveIntervalLabel, saveIntervalField); // //Max Save Backups maxSavesPane = new FlowPane(); maxSavesPane.getStyleClass().add("settings_pane"); maxSavesLabel = new Label(MAX_BACKUPS_LABEL + " "); maxSavesLabel.getStyleClass().addAll("bold_text", "font_12_pt"); maxSavesField = new TextField("" + config.maxBackups.get()); maxSavesField.getStyleClass().add("settings_text_field"); maxSavesPane.getChildren().addAll(maxSavesLabel, maxSavesField); if (config.enableBackups.get() == 0) { saveIntervalField.setDisable(true); maxSavesField.setDisable(true); } primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, saveBackupsPane, saveIntervalPane, maxSavesPane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:dsfixgui.view.DSFHudPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);//from ww w . ja v a2 s . c o m 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(HUD.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///////////////////// // // //Toggle HUD Modifications hudModsPane = new FlowPane(); hudModsPane.getStyleClass().add("settings_pane"); hudModsLabel = new Label(HUD_MODS_LABEL + " "); hudModsLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudModsLabel.setTooltip(new Tooltip(HUD_MODS_TT)); hudModsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableHudMod.get() == 0) { hudModsPicker.setValue(hudModsPicker.getItems().get(0)); } else { hudModsPicker.setValue(hudModsPicker.getItems().get(1)); } hudModsPane.getChildren().addAll(hudModsLabel, hudModsPicker); // //Minimal HUD minimalHUDPane = new FlowPane(); minimalHUDPane.getStyleClass().add("settings_pane"); minimalHUDLabel = new Label(MINIMAL_HUD_LABEL + " "); minimalHUDLabel.getStyleClass().addAll("bold_text", "font_12_pt"); minimalHUDLabel.setTooltip(new Tooltip(MIN_HUD_TT)); minimalHUDPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableMinimalHud.get() == 0) { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(0)); } else { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(1)); } minimalHUDPane.getChildren().addAll(minimalHUDLabel, minimalHUDPicker); // //HUD Scale hudScalePane = new FlowPane(); hudScalePane.getStyleClass().add("settings_pane"); hudScaleLabel = new Label(HUD_SCALE_LABEL + " "); hudScaleLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudScaleLabel.setTooltip(new Tooltip(HUD_SCALE_TT)); hudScaleField = new TextField(config.hudScaleFactor.toString()); hudScaleField.getStyleClass().add("settings_med_text_field"); hudScalePane.getChildren().addAll(hudScaleLabel, hudScaleField); // //HUD Opacities Parent Label hudOpacitiesPane = new FlowPane(); hudOpacitiesPane.getStyleClass().add("settings_pane"); hudOpacitiesLabel = new Label(HUD_OPACITIES_LABEL + " "); hudOpacitiesLabel.getStyleClass().addAll("bold_text", "font_14_pt"); hudOpacitiesLabel.setTooltip(new Tooltip(HUD_OPS_TT)); hudOpacitiesPane.getChildren().addAll(hudOpacitiesLabel); // //Top Left HUD Opacity topLeftHUDOpPane = new FlowPane(); topLeftHUDOpPane.getStyleClass().add("settings_pane"); topLeftHUDOpLabel = new Label(TOP_LEFT_HUD_OP_LABEL + " "); topLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); topLeftHUDOpLabel.setTooltip(new Tooltip(TOP_LEFT_HUD_TT)); topLeftHUDOpField = new TextField( config.hudTopLeftOpacity.toString().substring(0, config.hudTopLeftOpacity.length() - 1)); topLeftHUDOpField.getStyleClass().add("settings_med_text_field"); topLeftHUDOpPane.getChildren().addAll(topLeftHUDOpLabel, topLeftHUDOpField); // //Bottom Left HUD Opacity bottomLeftHUDOpPane = new FlowPane(); bottomLeftHUDOpPane.getStyleClass().add("settings_pane"); bottomLeftHUDOpLabel = new Label(BOTTOM_LEFT_HUD_OP_LABEL + " "); bottomLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomLeftHUDOpLabel.setTooltip(new Tooltip(BOTTOM_LEFT_HUD_TT)); bottomLeftHUDOpField = new TextField( config.hudBottomLeftOpacity.toString().substring(0, config.hudBottomLeftOpacity.length() - 1)); bottomLeftHUDOpField.getStyleClass().add("settings_med_text_field"); bottomLeftHUDOpPane.getChildren().addAll(bottomLeftHUDOpLabel, bottomLeftHUDOpField); // //Bottom Riht HUD Opacity bottomRightHUDOpPane = new FlowPane(); bottomRightHUDOpPane.getStyleClass().add("settings_pane"); bottomRightHUDOpLabel = new Label(BOTTOM_RIGHT_HUD_OP_LABEL + " "); bottomRightHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomRightHUDOpLabel.setTooltip(new Tooltip(BOTTOM_RIGHT_HUD_TT)); bottomRightHUDOpField = new TextField( config.hudBottomRightOpacity.toString().substring(0, config.hudBottomRightOpacity.length() - 1)); bottomRightHUDOpField.getStyleClass().add("settings_med_text_field"); bottomRightHUDOpPane.getChildren().addAll(bottomRightHUDOpLabel, bottomRightHUDOpField); if (config.enableHudMod.get() == 0) { minimalHUDPicker.setDisable(true); hudScaleField.setDisable(true); topLeftHUDOpField.setDisable(true); bottomLeftHUDOpField.setDisable(true); bottomRightHUDOpField.setDisable(true); } primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, hudModsPane, minimalHUDPane, hudScalePane, hudOpacitiesPane, topLeftHUDOpPane, bottomLeftHUDOpPane, bottomRightHUDOpPane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:dsfixgui.view.DSFUnsafeSettingsPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);/*from w w w . j a va 2 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(UNSAFE_OPS.toUpperCase() + " " + SETTINGS.toUpperCase()); titleLabel.getStyleClass().addAll("settings_title", "red_text"); titleLabel.setTooltip(new Tooltip(UNSAFE_TT)); 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///////////////////// // // //Force Window Modes windowModePane = new FlowPane(); windowModePane.getStyleClass().add("settings_pane"); windowModeLabel = new Label(FORCE_WINDOW_MODE_LABEL + " "); windowModeLabel.getStyleClass().addAll("bold_text", "font_12_pt"); windowModeChoice = new ToggleGroup(); neitherWindowMode = new RadioButton(WINDOW_MODES[0] + " "); neitherWindowMode.setToggleGroup(windowModeChoice); forceWindowed = new RadioButton(WINDOW_MODES[1]); forceWindowed.setToggleGroup(windowModeChoice); forceFullscreen = new RadioButton(WINDOW_MODES[2]); forceFullscreen.setToggleGroup(windowModeChoice); if (config.forceWindowed.get() == 0 && config.forceFullscreen.get() == 0) { neitherWindowMode.setSelected(true); } else if (config.forceWindowed.get() == 1) { forceWindowed.setSelected(true); config.forceFullscreen.set(0); } else { forceFullscreen.setSelected(true); } windowModePane.getChildren().addAll(windowModeLabel, neitherWindowMode, forceWindowed, forceFullscreen); // //Toggle Vsync vsyncPane = new FlowPane(); vsyncPane.getStyleClass().add("settings_pane"); vsyncLabel = new Label(VSYNC_LABEL + " "); vsyncLabel.getStyleClass().addAll("bold_text", "font_12_pt"); vsyncLabel.setTooltip(new Tooltip(VSYNC_TT)); vsyncPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableVsync.get() == 0) { vsyncPicker.setValue(vsyncPicker.getItems().get(0)); } else { vsyncPicker.setValue(vsyncPicker.getItems().get(1)); } vsyncPane.getChildren().addAll(vsyncLabel, vsyncPicker); // //Fullscreen Refresh Rate refreshRatePane = new FlowPane(); refreshRatePane.getStyleClass().add("settings_pane"); refreshRateLabel = new Label(REFRESH_RATE_LABEL + " "); refreshRateLabel.getStyleClass().addAll("bold_text", "font_12_pt"); refreshRateLabel.setTooltip(new Tooltip(FULLSCREEN_HZ_TT)); refreshRateField = new TextField("" + config.fullscreenHz.get()); refreshRateField.getStyleClass().add("settings_text_field"); refreshRatePane.getChildren().addAll(refreshRateLabel, refreshRateField); // primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, windowModePane, vsyncPane, refreshRatePane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:de.rkl.tools.tzconv.TimezoneConverter.java
private ComboBox<ZoneId> createTimezoneComboBox() { final ComboBox<ZoneId> zoneIdBox = new ComboBox<>( observableArrayList(ApplicationModel.ZONE_OFFSETS_2_ZONE_IDS.values())); zoneIdBox.setEditable(false);/*ww w . j a v a 2 s. c o m*/ zoneIdBox.setValue(applicationModel.mainDateTime.getValue().getZone()); zoneIdBox.setOnAction(event -> applicationModel.mainDateTime .setValue(applicationModel.mainDateTime.getValue().withZoneSameLocal(zoneIdBox.getValue()))); return zoneIdBox; }
From source file:dsfixgui.view.DSFGraphicsPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);/*w w w. ja v a2s . c o m*/ 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:dsfixgui.view.DSPWPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);//w w w . ja v a 2s . c o m 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); }