- Timestamp:
- 2003-06-03T14:04:26+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/ModalDialog.java
r4431 r4458 40 40 /** true if this dialog should be modal, ie block user actions to its owner window, false otherwise. */ 41 41 protected boolean modal = false; 42 42 /** true if this dialog is currently waiting some thread. */ 43 protected boolean waiting = false; 43 44 /** Constructor. 44 45 */ … … 119 120 */ 120 121 public void setVisible (boolean visible) { 122 ///ystem.err.println("setVisible(" + visible + ")"); 121 123 getParent ().setEnabled (!(visible && modal)); 122 124 super.setVisible (visible); 123 if (modal && visible) 125 if (modal && visible) { 124 126 try { 125 127 if (SwingUtilities.isEventDispatchThread ()) { 128 ///ystem.err.println("is Event Dispatch Thread."); 126 129 EventQueue theQueue = getToolkit().getSystemEventQueue(); 127 130 while (isVisible ()) { … … 134 137 } 135 138 } 139 ///ystem.err.println("No longer visible - AWT"); 136 140 } else synchronized (getTreeLock ()) { 137 while (isVisible ()) 141 ///ystem.err.println("is other Thread."); 142 while (isVisible ()) { 138 143 try { 144 waiting = true; 139 145 getTreeLock().wait(); 146 waiting = false; 140 147 } catch (InterruptedException e) { 148 ///ystem.err.println("Interrupted!!!"); 141 149 break; 142 150 } 151 ///ystem.err.println("No longer visible - Other"); 152 } 143 153 } 144 154 } catch (Exception ex) { 145 155 ex.printStackTrace(); 146 156 } 157 } 158 else if(modal && !visible && waiting) { 159 ///ystem.err.println("Tree lock is: " + getTreeLock()); 160 synchronized(getTreeLock()) { 161 ///ystem.err.println("Notify!"); 162 getTreeLock().notify(); 163 } 164 } 147 165 } 148 166
Note:
See TracChangeset
for help on using the changeset viewer.