/[classpath]/classpath/java/awt/DefaultKeyboardFocusManager.java
ViewVC logotype

Diff of /classpath/java/awt/DefaultKeyboardFocusManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by mkoch, Mon Sep 27 15:11:46 2004 UTC revision 1.11 by mark, Sun Nov 7 00:42:13 2004 UTC
# Line 171  public class DefaultKeyboardFocusManager Line 171  public class DefaultKeyboardFocusManager
171    
172          if (e.id == FocusEvent.FOCUS_GAINED)          if (e.id == FocusEvent.FOCUS_GAINED)
173            {            {
174              if (((FocusEvent) e).isTemporary ())              if (! (target instanceof Window))
175                setGlobalFocusOwner (target);                {
176              else                  if (((FocusEvent) e).isTemporary ())
177                setGlobalPermanentFocusOwner (target);                    setGlobalFocusOwner (target);
178            }                  else
179          else if (e.id == FocusEvent.FOCUS_LOST)                    setGlobalPermanentFocusOwner (target);
180            {                }
181              // We need to set the window's focus owner here; we can't  
182              // set it when the window loses focus because by that time              // Keep track of this window's focus owner.
             // the previous focus owner has already lost focus  
             // (FOCUS_LOST events are delivered before  
             // WINDOW_LOST_FOCUS events).  
183    
184              // Find the target Component's top-level ancestor.              // Find the target Component's top-level ancestor.
185              Container parent = target.getParent ();              Container parent = target.getParent ();
# Line 195  public class DefaultKeyboardFocusManager Line 192  public class DefaultKeyboardFocusManager
192                (Window) target : (Window) parent;                (Window) target : (Window) parent;
193    
194              Component focusOwner = getFocusOwner ();              Component focusOwner = getFocusOwner ();
195              if (focusOwner != null)              if (focusOwner != null
196                    && ! (focusOwner instanceof Window))
197                toplevel.setFocusOwner (focusOwner);                toplevel.setFocusOwner (focusOwner);
198              }
199            else if (e.id == FocusEvent.FOCUS_LOST)
200              {
201              if (((FocusEvent) e).isTemporary ())              if (((FocusEvent) e).isTemporary ())
202                setGlobalFocusOwner (null);                setGlobalFocusOwner (null);
203              else              else

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26