@Override public void changed( ObservableValue<? extends String> ov, String t, String t1 ) { String newZoom = zoom( t1 ); comboZoom.setValue( newZoom ); } });
private void setupControls() { ObservableList<FootstepPlannerType> plannerTypeOptions = FXCollections.observableArrayList(FootstepPlannerType.values); plannerTypeComboBox.setItems(plannerTypeOptions); plannerTypeComboBox.setValue(FootstepPlannerType.A_STAR); }
@SuppressWarnings("unchecked") protected <T extends Enum<T>> void loadUIControlProperty(Topic<T> topic, ComboBox<T> comboBox) { String loadedProperty = filePropertyHelper.loadProperty(topic.getName()); if (loadedProperty != null) { T valueOf = (T) Enum.valueOf(comboBox.getItems().get(0).getClass(), loadedProperty); comboBox.setValue(valueOf); } } }
public void setupControls() { ObservableList<DisplayType> displayTypeOptions = FXCollections.observableArrayList(DisplayType.values()); displayTypeComboBox.setItems(displayTypeOptions); displayTypeComboBox.setValue(DisplayType.PLANE); ObservableList<ColoringType> coloringTypeOptions = FXCollections.observableArrayList(ColoringType.values()); coloringTypeComboBox.setItems(coloringTypeOptions); coloringTypeComboBox.setValue(ColoringType.REGION); bufferSizeSlider.setLabelFormatter(StringConverterTools.thousandRounding(true)); }
/** * Refresh the combobox items. This method is typically called when the list of possible values of the handled parameter has changed. */ public void refreshCombo() { log.debug("Applying refreshCombo() to {}...", this); prmCombo.getItems().clear(); String currentDisplayedValue = null; List<Value<T>> possibleValues = parameter.getPossibleValues(); for(Value<T> value : possibleValues) { prmCombo.getItems().add(value.getDisplayedValue()); if(Objects.equals(value.getValue(), parameter.getValue())) { currentDisplayedValue = value.getDisplayedValue(); } } if(currentDisplayedValue == null && !possibleValues.isEmpty()) { currentDisplayedValue = possibleValues.get(0).getDisplayedValue(); } prmCombo.setValue(currentDisplayedValue); log.debug("combo items for {}: {}, selected: {}", this, prmCombo.getItems(), currentDisplayedValue); }
@Override public void changed(ObservableValue ov, CropData oldCropData, CropData newCropData) { vtyComboBox.setValue(null); clnComboBox.setValue(null); if (oldCropData != null && newCropData == null) { vtyList.clear(); clnList.clear(); } if (newCropData != null) { //TODO: add null value explicitly to always have a selectable '<None>' option? vtyList.setAll(cropManager.varietiesForCrop(newCropData.getId())); clnList.setAll(cropManager.classificationsForCrop(newCropData.getId())); } } });
comboZoom.setItems( FXCollections.observableList( zoomModel ) ); comboZoom.setEditable( true ); comboZoom.setValue( "100%" ); //NOI18N comboZoom.valueProperty().addListener( new ChangeListener<String>() {
comboBox.setValue((T)buildString());
private void populate(List<EngineSetting> engineSettings) { final VBox displayPane = new VBox(); displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); final GridPane displayContentPane = new GridPane(); displayContentPane.getStyleClass().add("grid"); int row = 0; for (EngineSetting setting : engineSettings) { final ComboBox<String> comboBox = new ComboBox<>(); comboBox.setMaxWidth(Double.MAX_VALUE); ObservableList<String> items = FXCollections.observableArrayList(setting.getOptions()); comboBox.setItems(items); comboBox.setValue(setting.getCurrentOption(this.container.getName())); comboBox.valueProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> { this.lockAll(); setting.setOption(this.container.getName(), items.indexOf(newValue)); this.unlockAll(); })); displayContentPane.add(new TextWithStyle(setting.getText(), CAPTION_TITLE_CSS_CLASS), 0, row); displayContentPane.add(comboBox, 1, row); lockableElements.add(comboBox); ++row; } Region spacer = new Region(); GridPane.setHgrow(spacer, Priority.ALWAYS); displayContentPane.add(spacer, 2, 0); displayPane.getChildren().addAll(displayContentPane); this.setContent(displayPane); }
private <T> void keyPressed(KeyEvent event) { KeyCode code = event.getCode(); if (code.isLetterKey() || code.isDigitKey() || code == KeyCode.SPACE) { String letter = code.getChar(); if (event.getSource() instanceof ComboBox) { ComboBox<T> comboBox = (ComboBox<T>) event.getSource(); T item = getEntryWithKey(letter, comboBox.getConverter(), comboBox.getItems(), comboBox); if (item != null) { comboBox.setValue(item); } } else if (event.getSource() instanceof ChoiceBox) { ChoiceBox<T> choiceBox = (ChoiceBox<T>) event.getSource(); T item = getEntryWithKey(letter, choiceBox.getConverter(), choiceBox.getItems(), choiceBox); if (item != null) { choiceBox.setValue(item); } } } }
private void setupControls() { startXPosition.setValueFactory(createStartGoalPositionValueFactory()); startYPosition.setValueFactory(createStartGoalPositionValueFactory()); startZPosition.setValueFactory(createStartGoalPositionValueFactory()); goalXPosition.setValueFactory(createStartGoalPositionValueFactory()); goalYPosition.setValueFactory(createStartGoalPositionValueFactory()); goalZPosition.setValueFactory(createStartGoalPositionValueFactory()); startYaw.setValueFactory(createStartGoalOrientationValueFactory()); goalYaw.setValueFactory(createStartGoalOrientationValueFactory()); ObservableList<us.ihmc.footstepPlanning.FootstepPlannerType> plannerTypeOptions = FXCollections.observableArrayList(FootstepPlannerType.values); plannerType.setItems(plannerTypeOptions); plannerType.setValue(FootstepPlannerType.A_STAR); timeout.setValueFactory(createTimeoutValueFactory()); horizonLength.setValueFactory(createHorizonValueFactory()); }
countCol.prefWidthProperty().bind(storageContentTable.widthProperty().subtract(2).multiply(0.25)); storageDetailMinutes.setValue(storageDetailMinutesOptions.get(0)); updateStorageDetails();