Java 类javafx.beans.property.FloatProperty 实例源码

项目:JavaFX-EX    文件:BeanConvertUtil.java   
@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;
}
项目:JavaFX-EX    文件:BeanConvertUtil.java   
@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;
}
项目:jaxbfx    文件:FXBeanPropertyXJCPluginTest.java   
@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);
}
项目:Java-9-Programming-Blueprints    文件:BeanPathAdapter.java   
/**
 * 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;
}
项目:fx-gson    文件:FxGsonSimpleTest.java   
@DataPoints
public static Class<?>[] primitivePropertyClasses() {
    return new Class<?>[]{
            BooleanProperty.class,
            IntegerProperty.class,
            LongProperty.class,
            FloatProperty.class,
            DoubleProperty.class,
    };
}
项目:fx-gson    文件:FxGsonTest.java   
@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);
}
项目:megan-ce    文件:TableItemTask.java   
/**
 * 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;
}
项目:opc-ua-client    文件:PersistenceService.java   
/**
 * @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()));
}
项目:qupath    文件:PathPrefs.java   
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;
}
项目:dolphin-platform    文件:FXWrapper.java   
/**
 * 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;
}
项目:jfxvnc    文件:SessionContext.java   
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());
}
项目:assertj-javafx    文件:FloatTest.java   
@Test
public void testFloatProperty() {
    FloatProperty actual = new SimpleFloatProperty(10f);
    assertThat(actual).hasValue(10f);

    assertThat(actual).hasSameValue(actual);
}
项目:javafx-demos    文件:BeanPathAdapter.java   
/**
 * 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;
}
项目:JavaFX-EX    文件:BeanConvertUtil.java   
public static FloatProperty toFloat(Property<Float> p) {
  return andFinal(() -> new SimpleFloatProperty(), np -> BidirectionalBinding.bindNumber(np, p));
}
项目:fx-gson    文件:FloatPropertyTypeAdapter.java   
@Override
protected Float extractPrimitiveValue(FloatProperty property) {
    return property.get();
}
项目:fx-gson    文件:FloatPropertyTypeAdapter.java   
@Override
protected FloatProperty createDefaultProperty() {
    return new SimpleFloatProperty();
}
项目:fx-gson    文件:FloatPropertyTypeAdapter.java   
@Override
protected FloatProperty wrapNonNullPrimitiveValue(Float deserializedValue) {
    return new SimpleFloatProperty(deserializedValue);
}
项目:fx-gson    文件:FxGsonTest.java   
@Theory
public void testNullPropertiesFail_float(@FromDataPoints("strictProperties") Gson gson) {
    thrown.expect(NullPropertyException.class);
    testSerialize(WithFloatProp.class, "{\"prop\":null}", (FloatProperty) null, (o, v) -> o.prop = v, gson);
}
项目:SkyHussars    文件:PlaneProperties.java   
public FloatProperty getMassEmpty() {
    return massEmpty;
}
项目:SkyHussars    文件:PlaneProperties.java   
public void setMassEmpty(FloatProperty massEmpty) {
    this.massEmpty = massEmpty;
}
项目:SkyHussars    文件:PlaneProperties.java   
public FloatProperty getMassTakeOffMax() {
    return massTakeOffMax;
}
项目:SkyHussars    文件:PlaneProperties.java   
public void setMassTakeOffMax(FloatProperty massTakeOffMax) {
    this.massTakeOffMax = massTakeOffMax;
}
项目:SkyHussars    文件:PlaneProperties.java   
public FloatProperty getMassGross() {
    return massGross;
}
项目:SkyHussars    文件:PlaneProperties.java   
public void setMassGross(FloatProperty massGross) {
    this.massGross = massGross;
}
项目:JavaFX-EX    文件:BeanConvertUtil.java   
public static FloatProperty toFloat(Property<Float> p) {
  return andFinal(() -> new SimpleFloatProperty(), np -> BidirectionalBinding.bindNumber(np, p));
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty additionalCostsProperty() {
    return this.additionalCosts;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty cleaningCostsProperty() {
    return this.cleaningCosts;
}
项目:drbookings    文件:SettingsManager.java   
public FloatProperty cleaningFeesProperty() {
    return this.cleaningFees;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty earningsPayoutPercentProperty() {
    return this.earningsPayoutPercent;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty referenceColdRentLongTermProperty() {
    return this.referenceColdRentLongTerm;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty serviceFeesPercentProperty() {
    return this.serviceFeesPercent;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty serviceFeesProperty() {
    return this.serviceFees;
}
项目:drbookings    文件:SettingsManager.java   
public final FloatProperty workHoursPerMonthProperty() {
    return this.workHoursPerMonth;
}
项目:drbookings    文件:BookingEntry.java   
@Override
public FloatProperty grossEarningsProperty() {
       return grossEarnings;
   }
项目:drbookings    文件:BookingEntry.java   
@Override
public FloatProperty netEarningsProperty() {
       return netEarnings;
   }
项目:drbookings    文件:DateBean.java   
public FloatProperty totalEarningsProperty() {
    return this.totalEarnings;
}
项目:drbookings    文件:CleaningEntry.java   
public final FloatProperty cleaningCostsProperty() {
    return this.cleaningCosts;
}
项目:drbookings    文件:MinimumPriceProvider.java   
public final FloatProperty minimumPriceProperty() {
    return this.minimumPrice;
}
项目:drbookings    文件:ReferenceIncomeProvider.java   
public final FloatProperty referenceIncomeProperty() {
    return this.referenceIncome;
}
项目:drbookings    文件:OccupancyRateProvider.java   
public final FloatProperty occupancyRateProperty() {
    return this.occupancyRate;
}