1 33 34 package edu.rice.cs.drjava.model.debug; 35 36 import edu.rice.cs.drjava.model.EventNotifier; 37 import edu.rice.cs.drjava.model.OpenDefinitionsDocument; 38 39 import java.awt.EventQueue ; 40 41 61 public class DebugEventNotifier extends EventNotifier<DebugListener> implements DebugListener { 62 63 64 public void debuggerStarted() { 65 assert EventQueue.isDispatchThread(); 66 _lock.startRead(); 67 try { 68 int size = _listeners.size(); 69 for (int i = 0; i < size; i++) { 70 _listeners.get(i).debuggerStarted(); 71 } 72 } 73 finally { _lock.endRead(); } 74 } 75 76 77 public void debuggerShutdown() { 78 assert EventQueue.isDispatchThread(); 79 _lock.startRead(); 80 try { 81 int size = _listeners.size(); 82 for (int i = 0; i < size; i++) { 83 _listeners.get(i).debuggerShutdown(); 84 } 85 } 86 finally { _lock.endRead(); } 87 } 88 89 95 public void threadLocationUpdated(OpenDefinitionsDocument doc, int lineNumber, boolean shouldHighlight) { 96 assert EventQueue.isDispatchThread(); 97 _lock.startRead(); 98 try { 99 int size = _listeners.size(); 100 for (int i = 0; i < size; i++) { 101 _listeners.get(i).threadLocationUpdated(doc, lineNumber, shouldHighlight); 102 } 103 } 104 finally { _lock.endRead(); } 105 } 106 107 111 public void regionAdded(Breakpoint bp, int index) { 112 assert EventQueue.isDispatchThread(); 113 _lock.startRead(); 114 try { 115 int size = _listeners.size(); 116 for (int i = 0; i < size; i++) { _listeners.get(i).regionAdded(bp, index); } 117 } 118 finally { _lock.endRead(); } 119 } 120 121 124 public void breakpointReached(Breakpoint bp) { 125 assert EventQueue.isDispatchThread(); 126 _lock.startRead(); 127 try { 128 int size = _listeners.size(); 129 for (int i = 0; i < size; i++) { 130 _listeners.get(i).breakpointReached(bp); 131 } 132 } 133 finally { 134 _lock.endRead(); 135 } 136 } 137 138 142 public void regionChanged(Breakpoint bp, int index) { 143 assert EventQueue.isDispatchThread(); 144 _lock.startRead(); 145 try { 146 int size = _listeners.size(); 147 for (int i = 0; i < size; i++) { 148 _listeners.get(i).regionChanged(bp, index); 149 } 150 } 151 finally { 152 _lock.endRead(); 153 } 154 } 155 156 159 public void watchSet(DebugWatchData w) { 160 assert EventQueue.isDispatchThread(); 161 _lock.startRead(); 162 try { 163 int size = _listeners.size(); 164 for (int i = 0; i < size; i++) { _listeners.get(i).watchSet(w); } 165 } 166 finally { _lock.endRead(); } 167 } 168 169 172 public void watchRemoved(DebugWatchData w) { 173 assert EventQueue.isDispatchThread(); 174 _lock.startRead(); 175 try { 176 int size = _listeners.size(); 177 for (int i = 0; i < size; i++) { _listeners.get(i).watchRemoved(w); } 178 } 179 finally { _lock.endRead(); } 180 } 181 182 185 public void regionRemoved(Breakpoint bp) { 186 assert EventQueue.isDispatchThread(); 187 _lock.startRead(); 188 try { 189 int size = _listeners.size(); 190 for (int i = 0; i < size; i++) _listeners.get(i).regionRemoved(bp); 191 } 192 finally { _lock.endRead(); } 193 } 194 195 196 public void stepRequested() { 197 assert EventQueue.isDispatchThread(); 198 _lock.startRead(); 199 try { 200 int size = _listeners.size(); 201 for (int i = 0; i < size; i++) _listeners.get(i).stepRequested(); 202 } 203 finally { _lock.endRead(); } 204 } 205 206 207 public void currThreadSuspended() { 208 _lock.startRead(); 209 try { 210 int size = _listeners.size(); 211 for (int i = 0; i < size; i++) _listeners.get(i).currThreadSuspended(); 212 } 213 finally { _lock.endRead(); } 214 } 215 216 217 public void currThreadResumed() { 218 assert EventQueue.isDispatchThread(); 219 _lock.startRead(); 220 try { 221 int size = _listeners.size(); 222 for (int i = 0; i < size; i++) _listeners.get(i).currThreadResumed(); 223 } 224 finally { _lock.endRead(); } 225 } 226 227 228 public void threadStarted() { 229 assert EventQueue.isDispatchThread(); 230 _lock.startRead(); 231 try { 232 int size = _listeners.size(); 233 for (int i = 0; i < size; i++) _listeners.get(i).threadStarted(); 234 } 235 finally { _lock.endRead(); } 236 } 237 238 239 public void currThreadDied() { 240 assert EventQueue.isDispatchThread(); 241 _lock.startRead(); 242 try { 243 int size = _listeners.size(); 244 for (int i = 0; i < size; i++) _listeners.get(i).currThreadDied(); 245 } 246 finally { _lock.endRead(); } 247 } 248 249 250 public void nonCurrThreadDied() { 251 assert EventQueue.isDispatchThread(); 252 _lock.startRead(); 253 try { 254 int size = _listeners.size(); 255 for (int i = 0; i < size; i++) _listeners.get(i).nonCurrThreadDied(); 256 } 257 finally { _lock.endRead(); } 258 } 259 260 263 public void currThreadSet(DebugThreadData thread) { 264 _lock.startRead(); 265 try { 266 int size = _listeners.size(); 267 for (int i = 0; i < size; i++) { 268 _listeners.get(i).currThreadSet(thread); 269 } 270 } 271 finally { _lock.endRead(); } 272 } 273 } 274 | Popular Tags |