Example usage for javafx.beans.property ObjectProperty set

List of usage examples for javafx.beans.property ObjectProperty set

Introduction

In this page you can find the example usage for javafx.beans.property ObjectProperty set.

Prototype

void set(T value);

Source Link

Document

Set the wrapped value.

Usage

From source file:Main.java

public static void main(String[] args) {
    ObjectProperty<Lighting> root = new SimpleObjectProperty<Lighting>();
    final ObjectBinding<Color> colorBinding = Bindings.select(root, "light", "color");
    colorBinding.addListener(new ChangeListener<Color>() {
        @Override/*from   w  w w  .j a  v a 2 s  . c  o m*/
        public void changed(ObservableValue<? extends Color> observableValue, Color oldValue, Color newValue) {
            System.out.println(oldValue + "new = " + newValue);
        }
    });
    Light firstLight = new Light.Point();
    firstLight.setColor(Color.BLACK);

    Light secondLight = new Light.Point();
    secondLight.setColor(Color.WHITE);

    Lighting firstLighting = new Lighting();
    firstLighting.setLight(firstLight);

    root.set(firstLighting);
    firstLighting.setLight(firstLight);
    firstLight.setColor(Color.RED);
}

From source file:org.noroomattheinn.visibletesla.NotifierController.java

private void showAreaDialog(ObjectProperty<GeoUtils.CircularArea> areaProp) {
    String apiKey = prefs.useCustomGoogleAPIKey.get() ? prefs.googleAPIKey.get() : Prefs.GoogleMapsAPIKey;

    ChooseLocationDialog cld = ChooseLocationDialog.show(app.stage, areaProp.get(), apiKey);
    if (!cld.cancelled()) {
        areaProp.set(cld.getArea());
    }/*ww  w .j av a  2 s .c o  m*/
}