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


Java SpinnerValueFactory.setValue方法代码示例

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


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

示例1: marathon_select

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") @Override public boolean marathon_select(String value) {
    Spinner<?> spinner = (Spinner<?>) getComponent();
    if (!spinner.isEditable()) {
        @SuppressWarnings("rawtypes")
        SpinnerValueFactory factory = ((Spinner<?>) getComponent()).getValueFactory();
        Object convertedValue = factory.getConverter().fromString(value);
        factory.setValue(convertedValue);
        return true;
    }
    TextField spinnerEditor = spinner.getEditor();
    if (spinnerEditor == null) {
        throw new JavaAgentException("Null value returned by getEditor() on spinner", null);
    }
    IJavaFXElement ele = JavaFXElementFactory.createElement(spinnerEditor, driver, window);
    spinnerEditor.getProperties().put("marathon.celleditor", true);
    ele.marathon_select(value);
    return true;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:JavaFXSpinnerElement.java

示例2: commitEditorText

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private void commitEditorText(Spinner<T> spinner) {
    if (!spinner.isEditable()) return;
    try {
        String text = spinner.getEditor().getText();
        SpinnerValueFactory<T> valueFactory = spinner.getValueFactory();
        if (valueFactory != null) {
            StringConverter<T> converter = valueFactory.getConverter();
            if (converter != null) {
                T value = converter.fromString(text);
                if (value == null)
                    return;
                valueFactory.setValue(value);
            }
        }
    } catch (NumberFormatException e) {
        // Ignore text input.
        return;
    }
}
 
开发者ID:tbressler,项目名称:waterrower-workout,代码行数:20,代码来源:SpinnerFocusChangeListener.java

示例3: initialize

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    logger.entry();
    double currentValue = 0;
    double step = .1;
    try {
        if (logicalTimeFactory != null) {
            switch (logicalTimeFactory.getName()) {
                case "HLAfloat64Time":
                    currentValue = ((HLAfloat64Time) currentLogicalTime).getValue();
                    break;
                case "HLAinteger64Time":
                    step = 1;
                    currentValue = ((HLAinteger64Time) currentLogicalTime).getValue();
                    break;
            }
        }
    } catch (Exception ex) {
        logger.log(Level.WARN, ex.getMessage(), ex);
    }

    SpinnerValueFactory sVF = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE, 0, step);
    sVF.setValue(currentValue);
    LogicalTimeSpin.setValueFactory(sVF);
    logger.exit();
}
 
开发者ID:EMostafaAli,项目名称:HlaListener,代码行数:30,代码来源:NextMessageRequestServiceController.java

示例4: initialize

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    logger.entry();
    double currentValue = 0;
    double step = .1;
    try {
        if (logicalTimeFactory != null) {
            switch (logicalTimeFactory.getName()) {
                case "HLAfloat64Time":
                    currentValue = ((HLAfloat64Time) currentLogicalTime).getValue();
                    break;
                case "HLAinteger64Time":
                    step = 1;
                    currentValue = ((HLAinteger64Time) currentLogicalTime).getValue();
                    break;
            }
        }
    } catch (Exception ex) {
        logger.log(Level.WARN, ex.getMessage(), ex);
    }

    SpinnerValueFactory<Double> sVF = new SpinnerValueFactory.DoubleSpinnerValueFactory(0, Double.MAX_VALUE, 0, step);
    sVF.setValue(currentValue);
    LogicalTimeSpin.setValueFactory(sVF);
    logger.exit();
}
 
开发者ID:EMostafaAli,项目名称:HlaListener,代码行数:30,代码来源:TimeAdvanceRequestServiceController.java

示例5: commitEditorText

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private void commitEditorText() {
  if (!isEditable())
    return;
  String text = getEditor().getText();
  SpinnerValueFactory<T> valueFactory = getValueFactory();
  if (valueFactory != null) {
    StringConverter<T> converter = valueFactory.getConverter();
    if (converter != null) {
      T value = converter.fromString(text);
      valueFactory.setValue(value);
    }
  }
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:14,代码来源:SpinnerAutoCommit.java

示例6: commitEditorText

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private <T> void commitEditorText(Spinner<T> spinner) {
  if (!spinner.isEditable()) {
    return;
  }
  String text = spinner.getEditor().getText();
  SpinnerValueFactory<T> valueFactory = spinner.getValueFactory();
  if (valueFactory != null) {
    StringConverter<T> converter = valueFactory.getConverter();
    if (converter != null) {
      T value = converter.fromString(text);
      valueFactory.setValue(value);
    }
  }
}
 
开发者ID:WPIRoboticsProjects,项目名称:GRIP,代码行数:15,代码来源:ListSpinnerInputSocketController.java

示例7: createSVF

import javafx.scene.control.SpinnerValueFactory; //导入方法依赖的package包/类
private SpinnerValueFactory<String> createSVF()
{
    SpinnerValueFactory<String> svf = new TextSpinnerValueFactory();
    svf.setValue(value_text);
    return svf;
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:7,代码来源:SpinnerRepresentation.java


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