Example usage for com.jgoodies.binding.adapter Bindings addComponentPropertyHandler

List of usage examples for com.jgoodies.binding.adapter Bindings addComponentPropertyHandler

Introduction

In this page you can find the example usage for com.jgoodies.binding.adapter Bindings addComponentPropertyHandler.

Prototype

public static void addComponentPropertyHandler(JComponent component, ValueModel valueModel) 

Source Link

Document

If the given model is a ComponentValueModel, a component property handler is registered with this model.

Usage

From source file:repast.simphony.ui.RunOptionsPanel.java

public void init(RunOptionsModel optionsModel) {
    PresentationModel pModel = new PresentationModel(optionsModel);
    ValueModel model = pModel.getModel("pauseAt");
    Bindings.bind(pauseAtFld, model);

    model = pModel.getModel("stopAt");
    Bindings.bind(stopAtFld, model);

    model = pModel.getModel("sparklineLength");
    Bindings.bind(sparklineLengthFld, model);
    sparklineLengthFld.setText("" + RunEnvironment.DEFAULT_SPARKLINE_LENGTH);

    model = pModel.getModel("sparklineType");
    Bindings.bind(sparklineTypeFld, model);
    sparklineTypeFld.setSelected(RunEnvironment.DEFAULT_SPARKLINE_TYPE);

    pauseAtFld.addFocusListener(tempFocusCommitter);
    stopAtFld.addFocusListener(tempFocusCommitter);
    sparklineLengthFld.addFocusListener(tempFocusCommitter);

    model = pModel.getModel("scheduleTickDelay");
    Bindings.addComponentPropertyHandler(slider1, model);
    slider1.setModel(new BoundedRangeAdapter(model, 0, 0, 100));
}