10/2/02 - higgins
According to the Java tutorial,
Rule: Once a Swing component has been realized, all code that might affect or
depend on the state of that component should be executed in the
event-dispatching thread
Currently, the SwingWorker class is used in a number of locations. namely
C:\work\morpho\src\edu\ucsb\nceas\morpho\editor\DocFrame.java
fixed
C:\work\morpho\src\edu\ucsb\nceas\morpho\Morpho.java
OK
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\DeleteCommand.java
morphoFrame.setBusy(true);refreshDataPackageFrame violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\ExportCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\LocalToNetworkCommand.java
frame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\NetworkToLocalCommand.java
frame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\OpenDialogBoxCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\OpenPackageCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\OpenPreviousVersionCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\RefreshCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\ReviseSearchCommand.java
morphoFrame.setBusy(true); violates rule
C:\work\morpho\src\edu\ucsb\nceas\morpho\query\SearchCommand.java
morphoFrame.setBusy(true); violates rule
A recurring violation of the rule appears in several places where the 'flapping
butterfly' is set with a 'setBusy' command outside the event thead. (This uses
the "ProgressIndicator" class to reset the icon used in a JComponent). No code
bugs are obviously caused by this in Morpho, but we should probably make the
setBusy operation into a thread and use 'invokeLater' to execute in the eventThread.