Menu

#10 Update WatcherWindow only on change

open
nobody
None
5
2007-08-25
2007-08-25
Bernd A.
No

The WatcherWindows are updated every 50 milliseconds in the main loop of the server thread, regardless of whether the observed object changed or not.

Code in Server.java:
Program.refreshTrainWatcherWindows();
Program.refreshSignalWatcherWindows();

The WatcherWindows should only be refreshed when the observed object changed.

The WatcherWindow should register itself to the observed object, and when the object changes, the object calls every "listening" WatcherWindow.

Discussion