当前位置: 首页>>代码示例>>Java>>正文


Java SpinnerValueFactory.IntegerSpinnerValueFactory方法代码示例

本文整理汇总了Java中javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory方法的典型用法代码示例。如果您正苦于以下问题:Java SpinnerValueFactory.IntegerSpinnerValueFactory方法的具体用法?Java SpinnerValueFactory.IntegerSpinnerValueFactory怎么用?Java SpinnerValueFactory.IntegerSpinnerValueFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.SpinnerValueFactory的用法示例。


在下文中一共展示了SpinnerValueFactory.IntegerSpinnerValueFactory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
@Override
public void init()
{
	SpinnerValueFactory<Integer> spinnerYearValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 3000, currentDate.getYear()); 
	spinnerYear.setValueFactory(spinnerYearValueFactory);
	spinnerYear.setEditable(false);
	spinnerYear.focusedProperty().addListener((observable, oldValue, newValue) -> {
		if(!newValue)
		{
			spinnerYear.increment(0); // won't change value, but will commit editor
		}
	});
	
	comboBoxMonth.getItems().addAll(Helpers.getMonthList());
	comboBoxMonth.setValue(Helpers.getMonthList().get(currentDate.getMonthOfYear()-1));
	
	applyStyle();
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:19,代码来源:DatePickerController.java

示例2: initializeSpinner

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
public  static void initializeSpinner(final Spinner<Integer> spinner, final int minValue, final int maxValue, final int initialValue) {
    spinner.getEditor().setOnKeyPressed(event -> {
        switch (event.getCode()) {
            case UP:
                spinner.increment(1);
                break;
            case DOWN:
                spinner.decrement(1);
                break;
        }
    });
    spinner.setOnScroll(e -> {
        spinner.increment((int) (e.getDeltaY() / e.getMultiplierY()));
    });

    SpinnerValueFactory<Integer> factory = new SpinnerValueFactory.IntegerSpinnerValueFactory(minValue, maxValue, initialValue);
    spinner.setValueFactory(factory);
    spinner.setEditable(true);

    TextFormatter<Integer> formatter = new TextFormatter<>(factory.getConverter(), factory.getValue());
    spinner.getEditor().setTextFormatter(formatter);
    factory.valueProperty().bindBidirectional(formatter.valueProperty());

}
 
开发者ID:gmuecke,项目名称:boutique-de-jus,代码行数:25,代码来源:SpinnerUtil.java

示例3: initialize

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
@FXML
private void initialize() {
	SpinnerValueFactory<Integer> attackValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> strengthValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> defenceValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> hitpointsValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(9, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> rangedValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> magicValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);
	SpinnerValueFactory<Integer> prayerValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, Integer.MAX_VALUE);

	attackSpinner.setValueFactory(attackValueFactory);
	strengthSpinner.setValueFactory(strengthValueFactory);
	defenceSpinner.setValueFactory(defenceValueFactory);
	rangedSpinner.setValueFactory(rangedValueFactory);
	magicSpinner.setValueFactory(magicValueFactory);
	hitpointsSpinner.setValueFactory(hitpointsValueFactory);
	prayerSpinner.setValueFactory(prayerValueFactory);

    attackSpinner.setEditable(true);
    strengthSpinner.setEditable(true);
    defenceSpinner.setEditable(true);
    rangedSpinner.setEditable(true);
    magicSpinner.setEditable(true);
    prayerSpinner.setEditable(true);
    hitpointsSpinner.setEditable(true);

}
 
开发者ID:landonreams,项目名称:osrs-equipment-builder,代码行数:28,代码来源:PlayerEditDialogController.java

示例4: initSpinnerRepeatingPeriod

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private void initSpinnerRepeatingPeriod()
{
	SpinnerValueFactory<Integer> valueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 1000, 0);
	spinnerRepeatingPeriod.setValueFactory(valueFactory);
	spinnerRepeatingPeriod.setEditable(false);
	spinnerRepeatingPeriod.focusedProperty().addListener((observable, oldValue, newValue) -> {
		if(!newValue)
		{
			spinnerRepeatingPeriod.increment(0); // won't change value, but will commit editor
		}
	});
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:13,代码来源:NewPaymentController.java

示例5: setUpSpinnerInt

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private void setUpSpinnerInt(Spinner<Integer> spinner, int pos, int min, int max, int increment, int savedSet ){
	IntegerSpinnerValueFactory oswFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(min, max, savedSet, increment);
	spinner.setValueFactory(oswFactory);
	spinner.valueProperty().addListener((obs, oldValue, newValue) -> {
    System.out.println("New value: "+newValue);
    // hier könnte es rundungsfehler von double auf Number geben
    setValueSettings(pos, newValue);
	});
}
 
开发者ID:Raldir,项目名称:3DScanner.RaspberryPi,代码行数:10,代码来源:UIController.java

示例6: add

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private Spinner<Integer> add(IntegerOption ro) {
  Spinner<Integer> s = new Spinner<>(new SpinnerValueFactory.IntegerSpinnerValueFactory(ro.getMin(), ro.getMax(), ro.get()));
  onSubmit.add(() -> ro.set(s.getValue()));
  add(wrapWithText(s, ro.getDescribe()));
  return s;
}
 
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:7,代码来源:OptionsController.java

示例7: setSpinnerConfig

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
/**
 * setzt den spinner auf werte von 1 - 10 
 */
private void setSpinnerConfig() {
	SpinnerValueFactory svf = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 10);
	bbyStepsMinute.setValueFactory(svf);
	bbyStepsMinute.setOnMouseClicked(e -> getSpinnerValue());
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-team-immortalsgg,代码行数:9,代码来源:TDDTViewController.java


注:本文中的javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。