src/share/classes/java/awt/DefaultKeyboardFocusManager.java

Print this page




1229             TypeAheadMarker marker = iter.previous();
1230             if (marker.after <= after) {
1231                 insertionIndex = i;
1232                 break;
1233             }
1234         }
1235 
1236         typeAheadMarkers.add(insertionIndex,
1237                              new TypeAheadMarker(after, untilFocused));
1238     }
1239 
1240     /**
1241      * Releases for normal dispatching to the current focus owner all
1242      * KeyEvents which were enqueued because of a call to
1243      * <code>enqueueKeyEvents</code> with the same timestamp and Component.
1244      * If the given timestamp is less than zero, the outstanding enqueue
1245      * request for the given Component with the <b>oldest</b> timestamp (if
1246      * any) should be cancelled.
1247      *
1248      * @param after the timestamp specified in the call to
1249      *        <code>enqueueKeyEvents</code>, or any value < 0
1250      * @param untilFocused the Component specified in the call to
1251      *        <code>enqueueKeyEvents</code>
1252      * @see #enqueueKeyEvents
1253      * @see #discardKeyEvents
1254      */
1255     protected synchronized void dequeueKeyEvents(long after,
1256                                                  Component untilFocused) {
1257         if (untilFocused == null) {
1258             return;
1259         }
1260 
1261         if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
1262             focusLog.finer("Dequeue at {0} for {1}",
1263                        after, untilFocused);
1264         }
1265 
1266         TypeAheadMarker marker;
1267         ListIterator<TypeAheadMarker> iter = typeAheadMarkers.listIterator
1268             ((after >= 0) ? typeAheadMarkers.size() : 0);
1269 




1229             TypeAheadMarker marker = iter.previous();
1230             if (marker.after <= after) {
1231                 insertionIndex = i;
1232                 break;
1233             }
1234         }
1235 
1236         typeAheadMarkers.add(insertionIndex,
1237                              new TypeAheadMarker(after, untilFocused));
1238     }
1239 
1240     /**
1241      * Releases for normal dispatching to the current focus owner all
1242      * KeyEvents which were enqueued because of a call to
1243      * <code>enqueueKeyEvents</code> with the same timestamp and Component.
1244      * If the given timestamp is less than zero, the outstanding enqueue
1245      * request for the given Component with the <b>oldest</b> timestamp (if
1246      * any) should be cancelled.
1247      *
1248      * @param after the timestamp specified in the call to
1249      *        <code>enqueueKeyEvents</code>, or any value &lt; 0
1250      * @param untilFocused the Component specified in the call to
1251      *        <code>enqueueKeyEvents</code>
1252      * @see #enqueueKeyEvents
1253      * @see #discardKeyEvents
1254      */
1255     protected synchronized void dequeueKeyEvents(long after,
1256                                                  Component untilFocused) {
1257         if (untilFocused == null) {
1258             return;
1259         }
1260 
1261         if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
1262             focusLog.finer("Dequeue at {0} for {1}",
1263                        after, untilFocused);
1264         }
1265 
1266         TypeAheadMarker marker;
1267         ListIterator<TypeAheadMarker> iter = typeAheadMarkers.listIterator
1268             ((after >= 0) ? typeAheadMarkers.size() : 0);
1269