Building Intelligent, Web-Based Control Systems

By Tom Milligan and Steve Coffin

Dr. Dobb's Journal March 1998

(a)
emJri.setJriServer(this);
emJri.setJSJriLink("Hrs");
emJri.setJSJriLink("Min");
emJri.setJSJriLink("Sec");
(b)
public void notifyChange(String variable, Object value) {
    if( variable.equals("Sec")) {
        seconds = ((Integer)value).intValue();
        timeDisplay.setSeconds(seconds);
    }
    else if( variable.equals("Hrs") ) {
        hours = ((Integer)value).intValue();     
        set_hours();
    }
    else if( variable.equals("Min")) {
        minutes = ((Integer)value).intValue();
        timeDisplay.setMinutes(minutes); 
    }
}
(c)
timeDisplay.setJriLink("Sec", "Seconds");

Example 3: (a) Setting up the callbacks for the embedded variables; (b) the notifyChange function; (c) setting a direct link between the Sec variable and the emObject timeDisplay.

Back to Article


Copyright © 1998, Dr. Dobb's Journal