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


Java FloatProperty类代码示例

本文整理汇总了Java中javafx.beans.property.FloatProperty的典型用法代码示例。如果您正苦于以下问题:Java FloatProperty类的具体用法?Java FloatProperty怎么用?Java FloatProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: normalize

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@SuppressWarnings("unchecked")
static Object normalize(Property<?> prop, Class<?> clz) {
  if (clz.isAssignableFrom(IntegerProperty.class)) {
    return toInteger((Property<Integer>) prop);
  } else if (clz.isAssignableFrom(LongProperty.class)) {
    return toLong((Property<Long>) prop);
  } else if (clz.isAssignableFrom(FloatProperty.class)) {
    return toFloat((Property<Float>) prop);
  } else if (clz.isAssignableFrom(DoubleProperty.class)) {
    return toDouble((Property<Double>) prop);
  } else if (clz.isAssignableFrom(StringProperty.class)) {
    return toString((Property<String>) prop);
  } else if (clz.isAssignableFrom(ObjectProperty.class)) {
    return toObject((Property<Object>) prop);
  }
  return prop;
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:18,代码来源:BeanConvertUtil.java

示例2: testGeneratedOutputTypes

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@Test
public void testGeneratedOutputTypes() throws Exception {
    ObjectFactory of = new ObjectFactory();
    TestType cut = of.createTestType();
    assertTrue("StringProperty expected!", cut.aStringProperty() instanceof StringProperty);
    assertTrue("ObjectProperty expected!", cut.aBooleanProperty() instanceof ObjectProperty);
    assertTrue("ObjectProperty expected!", cut.aDoubleProperty() instanceof ObjectProperty);
    assertTrue("ObjectProperty expected!", cut.aFloatProperty() instanceof ObjectProperty);
    assertTrue("ObjectProperty expected!", cut.aLongProperty() instanceof ObjectProperty);
    cut.getAList();
    assertTrue("ListProperty expected!", cut.aListProperty() instanceof ListProperty);
    assertTrue("ObjectProperty expected!", cut.anIntegerProperty() instanceof ObjectProperty);

    assertTrue("BooleanProperty expected!", cut.aPrimitiveBooleanProperty() instanceof BooleanProperty);
    assertTrue("DoubleProperty expected!", cut.aPrimitiveDoubleProperty() instanceof DoubleProperty);
    assertTrue("FloatProperty expected!", cut.aPrimitiveFloatProperty() instanceof FloatProperty);
    assertTrue("LongProperty expected!", cut.aPrimitiveLongProperty() instanceof LongProperty);
    assertTrue("IntegerProperty expected!", cut.aPrimitiveIntegerProperty() instanceof IntegerProperty);
}
 
开发者ID:buschmais,项目名称:jaxbfx,代码行数:20,代码来源:FXBeanPropertyXJCPluginTest.java

示例3: propertyValueClass

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
/**
 * Provides the underlying value class for a given {@link Property}
 * 
 * @param property
 *            the {@link Property} to check
 * @return the value class of the {@link Property}
 */
@SuppressWarnings("unchecked")
protected static <T> Class<T> propertyValueClass(final Property<T> property) {
	Class<T> clazz = null;
	if (property != null) {
		if (StringProperty.class.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) String.class;
		} else if (IntegerProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Integer.class;
		} else if (BooleanProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Boolean.class;
		} else if (DoubleProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Double.class;
		} else if (FloatProperty.class
				.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) Float.class;
		} else if (LongProperty.class.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) Long.class;
		} else if (ListProperty.class.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) List.class;
		} else if (MapProperty.class.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) Map.class;
		} else {
			clazz = (Class<T>) Object.class;
		}
	}
	return clazz;
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:38,代码来源:BeanPathAdapter.java

示例4: primitivePropertyClasses

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@DataPoints
public static Class<?>[] primitivePropertyClasses() {
    return new Class<?>[]{
            BooleanProperty.class,
            IntegerProperty.class,
            LongProperty.class,
            FloatProperty.class,
            DoubleProperty.class,
    };
}
 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:11,代码来源:FxGsonSimpleTest.java

示例5: testNullPropertiesAccepted

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@Theory
public void testNullPropertiesAccepted(@FromDataPoints("safeProperties") Gson gson) {
    testSerialize(WithBooleanProp.class, "{\"prop\":null}", (BooleanProperty) null, (o, v) -> o.prop = v, gson);
    testSerialize(WithIntegerProp.class, "{\"prop\":null}", (IntegerProperty) null, (o, v) -> o.prop = v, gson);
    testSerialize(WithLongProp.class, "{\"prop\":null}", (LongProperty) null, (o, v) -> o.prop = v, gson);
    testSerialize(WithFloatProp.class, "{\"prop\":null}", (FloatProperty) null, (o, v) -> o.prop = v, gson);
    testSerialize(WithDoubleProp.class, "{\"prop\":null}", (DoubleProperty) null, (o, v) -> o.prop = v, gson);
}
 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:9,代码来源:FxGsonTest.java

示例6: TableItemTask

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
/**
 * constructor
 *
 * @param doc
 * @param cNames
 * @param classificationName
 * @param tableView
 */
public TableItemTask(Document doc, String[] cNames, String classificationName, Set<Integer> classIds, TableView<TableItem> tableView, FloatProperty maxBitScore, FloatProperty maxNormalizedBitScore, IntegerProperty maxReadLength, ReadOnlyDoubleProperty layoutWidth) {
    this.doc = doc;
    this.cNames = cNames;
    this.classificationName = classificationName;
    this.classIds = classIds;
    this.tableView = tableView;
    this.maxBitScore = maxBitScore;
    this.maxNormalizedBitScore = maxNormalizedBitScore;
    this.maxReadLength = maxReadLength;
    this.layoutWidth = layoutWidth;
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:20,代码来源:TableItemTask.java

示例7: bind

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
/**
 * @see #bind(ObjectProperty, String)
 * 
 * @param property {@link Property} to bind
 * @param key unique application store key
 */
public void bind(FloatProperty property, String key) {
  try {
    property.set(prefs.getFloat(validateKey(key), property.get()));
  } catch (NumberFormatException e) {
    prefs.putFloat(key, property.getValue());
  }
  property.addListener(o -> prefs.putFloat(key, property.getValue()));
}
 
开发者ID:comtel2000,项目名称:opc-ua-client,代码行数:15,代码来源:PersistenceService.java

示例8: createPersistentThicknessPreference

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
public static FloatProperty createPersistentThicknessPreference(final String name, final float defaultValue) {
	FloatProperty property = new PositiveFloatThicknessProperty(name, defaultValue);
	property.set(getUserPreferences().getFloat(name, defaultValue));
	property.addListener((v, o, n) -> getUserPreferences().putFloat(name, n.floatValue()));
	// Triggered when reset is called
	resetProperty.addListener((c, o, v) -> property.setValue(defaultValue));
	return property;
}
 
开发者ID:qupath,项目名称:qupath,代码行数:9,代码来源:PathPrefs.java

示例9: wrapFloatProperty

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
/**
 * Create a JavaFX {@link javafx.beans.property.FloatProperty} as a wrapper for a dolphin platform property
 *
 * @param dolphinProperty the dolphin platform property
 * @return the JavaFX property
 */
public static FloatProperty wrapFloatProperty(final Property<Float> dolphinProperty) {
    Assert.requireNonNull(dolphinProperty, "dolphinProperty");
    final FloatProperty property = new SimpleFloatProperty();
    FXBinder.bind(property).bidirectionalToNumeric(dolphinProperty);
    return property;
}
 
开发者ID:canoo,项目名称:dolphin-platform,代码行数:13,代码来源:FXWrapper.java

示例10: getFloatBinding

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
public Optional<FloatProperty> getFloatBinding(String key) {
  Optional<Property<?>> b = getBinding(key);
  if (!b.isPresent() || !FloatProperty.class.isInstance(b.get())) {
    return Optional.empty();
  }
  return Optional.of((FloatProperty) b.get());
}
 
开发者ID:comtel2000,项目名称:jfxvnc,代码行数:8,代码来源:SessionContext.java

示例11: testFloatProperty

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@Test
public void testFloatProperty() {
    FloatProperty actual = new SimpleFloatProperty(10f);
    assertThat(actual).hasValue(10f);

    assertThat(actual).hasSameValue(actual);
}
 
开发者ID:lestard,项目名称:assertj-javafx,代码行数:8,代码来源:FloatTest.java

示例12: propertyValueClass

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
/**
 * Provides the underlying value class for a given {@linkplain Property}
 * 
 * @param property
 *            the {@linkplain Property} to check
 * @return the value class of the {@linkplain Property}
 */
@SuppressWarnings("unchecked")
protected static <T> Class<T> propertyValueClass(final Property<T> property) {
	Class<T> clazz = null;
	if (property != null) {
		if (StringProperty.class.isAssignableFrom(property.getClass())) {
			clazz = (Class<T>) String.class;
		} else if (IntegerProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Integer.class;
		} else if (BooleanProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Boolean.class;
		} else if (DoubleProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Double.class;
		} else if (FloatProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Float.class;
		} else if (LongProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Long.class;
		} else if (ListProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) List.class;
		} else if (MapProperty.class.isAssignableFrom(property
				.getClass())) {
			clazz = (Class<T>) Map.class;
		} else {
			clazz = (Class<T>) Object.class;
		}
	}
	return clazz;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:41,代码来源:BeanPathAdapter.java

示例13: toFloat

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
public static FloatProperty toFloat(Property<Float> p) {
  return andFinal(() -> new SimpleFloatProperty(), np -> BidirectionalBinding.bindNumber(np, p));
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:4,代码来源:BeanConvertUtil.java

示例14: extractPrimitiveValue

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@Override
protected Float extractPrimitiveValue(FloatProperty property) {
    return property.get();
}
 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:5,代码来源:FloatPropertyTypeAdapter.java

示例15: createDefaultProperty

import javafx.beans.property.FloatProperty; //导入依赖的package包/类
@Override
protected FloatProperty createDefaultProperty() {
    return new SimpleFloatProperty();
}
 
开发者ID:joffrey-bion,项目名称:fx-gson,代码行数:5,代码来源:FloatPropertyTypeAdapter.java


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