Building Intelligent, Web-Based Control Systems
By Tom Milligan and Steve Coffin
Dr. Dobb's Journal March 1998
<B>(a)</B> emJri.setJriServer(this); emJri.setJSJriLink("Hrs"); emJri.setJSJriLink("Min"); emJri.setJSJriLink("Sec"); <B>(b)</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); } } <B>(c)</B> 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.
Copyright © 1998, Dr. Dobb's Journal