DESY ACOP Beans Home

com.cosylab.application.state
Interface StateOriginator

All Known Implementing Classes:
AbstractDisplayerPanel, AbstractNumericDisplayerPanel, AcopDialKnob, AcopGauger, AcopLabel, AcopNumberLabel, AcopSlider, AcopWheelswitch, DialKnob, DialKnobDisplayer, DoubleNumberDisplayer, Gauger, GaugerDisplayer, LabelDisplayer, LabelledGauger, LabelledLedder, LabelledNumberField, LabelledWheelswitch, Piper, Slider, SliderDisplayer, SliderDisplayerSetter, WheelswitchDisplayer

public interface StateOriginator

This interface has to be implemented by the components which will exchange its state with the StateKeeper

Author:
dvitas

Method Summary
 State getState()
          Will be called by the StateKeeper in the process of the application state saving.
 void setState(State state)
          Will be called by the StateKeepr when it reads State object which belongs to this component.
 

Method Detail

getState

State getState()
Will be called by the StateKeeper in the process of the application state saving. The component which implements this interface will tipycally use StateFactory to create a State object and fill it with needed values. For example a component can use this snippet.
 
 public State getState() {
        State s = StateFactory.createState();
        s.putDouble("Min", getMinimum());
        s.putDouble("Max", getMaximum());
        s.putString("Format", getFormat());
        s.putString("Units", getUnits());
        return s;
 }
 
 

Returns:
state object

setState

void setState(State state)
Will be called by the StateKeepr when it reads State object which belongs to this component.

Parameters:
state - object previously created by this component


Copyright © 2010. All Rights Reserved.