Example usage for javafx.beans.property Property setValue

List of usage examples for javafx.beans.property Property setValue

Introduction

In this page you can find the example usage for javafx.beans.property Property setValue.

Prototype

void setValue(T value);

Source Link

Document

Set the wrapped value.

Usage

From source file:de.ks.binding.Binding.java

protected void resetProperties() {
    properties.entrySet().forEach(entry -> {
        @SuppressWarnings("unchecked")
        Property<Object> property = (Property<Object>) entry.getValue();
        if (!property.isBound()) {
            Object defaultValue = getDefaultValue(property);
            property.setValue(defaultValue);
        }//  w  w  w  . ja  va  2 s .c om
    });
}

From source file:de.ks.binding.Binding.java

@SuppressWarnings("unchecked")
protected void applyModelToProperties(Object model) {
    properties.entrySet().forEach(entry -> {
        Object value = entry.getKey().getValue(model);
        @SuppressWarnings("unchecked")
        Property<Object> property = (Property<Object>) entry.getValue();
        Pair<Function, Function> converter = converters.get(property);
        if (converter != null && value != null) {
            value = converter.getKey().apply(value);
        }/*w w  w.  ja va  2s  .  c  o m*/
        if (!property.isBound()) {
            property.setValue(value);
        }
    });
}

From source file:uk.ac.bris.cs.scotlandyard.ui.controller.BaseGame.java

private <T> void setAndBind(Property<T> source, Property<T> target) {
    target.setValue(source.getValue());
    target.bindBidirectional(source);
}