197 Object source, 198 boolean removeAllEvents) 199 { 200 eventQueue.removeSourceEvents(source, removeAllEvents); 201 } 202 public boolean noEvents(EventQueue eventQueue) { 203 return eventQueue.noEvents(); 204 } 205 public void wakeup(EventQueue eventQueue, boolean isShutdown) { 206 eventQueue.wakeup(isShutdown); 207 } 208 public void invokeAndWait(Object source, Runnable r) 209 throws InterruptedException, InvocationTargetException 210 { 211 EventQueue.invokeAndWait(source, r); 212 } 213 public void setFwDispatcher(EventQueue eventQueue, 214 FwDispatcher dispatcher) { 215 eventQueue.setFwDispatcher(dispatcher); 216 } 217 }); 218 } 219 220 public EventQueue() { 221 for (int i = 0; i < NUM_PRIORITIES; i++) { 222 queues[i] = new Queue(); 223 } 224 /* 225 * NOTE: if you ever have to start the associated event dispatch 226 * thread at this point, be aware of the following problem: 227 * If this EventQueue instance is created in 228 * SunToolkit.createNewAppContext() the started dispatch thread 229 * may call AppContext.getAppContext() before createNewAppContext() 230 * completes thus causing mess in thread group to appcontext mapping. 231 */ 232 233 appContext = AppContext.getAppContext(); 234 pushPopLock = (Lock)appContext.get(AppContext.EVENT_QUEUE_LOCK_KEY); 235 pushPopCond = (Condition)appContext.get(AppContext.EVENT_QUEUE_COND_KEY); 236 } | 197 Object source, 198 boolean removeAllEvents) 199 { 200 eventQueue.removeSourceEvents(source, removeAllEvents); 201 } 202 public boolean noEvents(EventQueue eventQueue) { 203 return eventQueue.noEvents(); 204 } 205 public void wakeup(EventQueue eventQueue, boolean isShutdown) { 206 eventQueue.wakeup(isShutdown); 207 } 208 public void invokeAndWait(Object source, Runnable r) 209 throws InterruptedException, InvocationTargetException 210 { 211 EventQueue.invokeAndWait(source, r); 212 } 213 public void setFwDispatcher(EventQueue eventQueue, 214 FwDispatcher dispatcher) { 215 eventQueue.setFwDispatcher(dispatcher); 216 } 217 218 @Override 219 public long getMostRecentEventTimeForTarget(Object target) { 220 AppContext appContext = SunToolkit.targetToAppContext(target); 221 return SunToolkit.getSystemEventQueueImplPP(appContext) 222 .getMostRecentEventTimeImpl(); 223 } 224 }); 225 } 226 227 public EventQueue() { 228 for (int i = 0; i < NUM_PRIORITIES; i++) { 229 queues[i] = new Queue(); 230 } 231 /* 232 * NOTE: if you ever have to start the associated event dispatch 233 * thread at this point, be aware of the following problem: 234 * If this EventQueue instance is created in 235 * SunToolkit.createNewAppContext() the started dispatch thread 236 * may call AppContext.getAppContext() before createNewAppContext() 237 * completes thus causing mess in thread group to appcontext mapping. 238 */ 239 240 appContext = AppContext.getAppContext(); 241 pushPopLock = (Lock)appContext.get(AppContext.EVENT_QUEUE_LOCK_KEY); 242 pushPopCond = (Condition)appContext.get(AppContext.EVENT_QUEUE_COND_KEY); 243 } |