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

Diff of /classpath/java/awt/KeyboardFocusManager.java

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

revision 1.5.2.8 by gnu_andrew, Wed Sep 28 17:50:19 2005 UTC revision 1.5.2.9 by gnu_andrew, Wed Nov 2 00:43:30 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package java.awt;  package java.awt;
40    
41  import java.applet.Applet;  import java.applet.Applet;
42    import java.awt.FocusTraversalPolicy;
43  import java.awt.event.FocusEvent;  import java.awt.event.FocusEvent;
44  import java.awt.event.KeyEvent;  import java.awt.event.KeyEvent;
45  import java.awt.event.WindowEvent;  import java.awt.event.WindowEvent;
# Line 213  public abstract class KeyboardFocusManag Line 214  public abstract class KeyboardFocusManag
214        currentFocusOwners */        currentFocusOwners */
215    private static Map currentFocusCycleRoots = new HashMap ();    private static Map currentFocusCycleRoots = new HashMap ();
216    
217    /** The default {@link FocusTraveralPolicy} that focus-managing    /** The default {@link FocusTraversalPolicy} that focus-managing
218        {@link Container}s will use to define their initial focus        {@link Container}s will use to define their initial focus
219        traversal policy. */        traversal policy. */
220    private FocusTraversalPolicy defaultPolicy;    private FocusTraversalPolicy defaultPolicy;
# Line 287  public abstract class KeyboardFocusManag Line 288  public abstract class KeyboardFocusManag
288      KeyboardFocusManager manager;      KeyboardFocusManager manager;
289    
290      if (m == null)      if (m == null)
291        manager = createFocusManager();        manager = new DefaultKeyboardFocusManager();
292      else      else
293        manager = m;        manager = m;
294    
# Line 295  public abstract class KeyboardFocusManag Line 296  public abstract class KeyboardFocusManag
296    }    }
297    
298    /**    /**
    * Creates a KeyboardFocusManager. The exact class is determined by the  
    * system property 'gnu.java.awt.FocusManager'. If this is not set,  
    * we default to DefaultKeyboardFocusManager.  
    */  
   private static KeyboardFocusManager createFocusManager()  
   {  
     String fmClassName = System.getProperty("gnu.java.awt.FocusManager",  
                                        "java.awt.DefaultKeyboardFocusManager");  
     try  
       {  
         Class fmClass = Class.forName(fmClassName);  
         KeyboardFocusManager fm = (KeyboardFocusManager) fmClass.newInstance();  
         return fm;  
       }  
     catch (ClassNotFoundException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be found.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
     catch (InstantiationException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be");  
         System.err.println("instantiated.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
     catch (IllegalAccessException ex)  
       {  
         System.err.println("The class " + fmClassName + " cannot be");  
         System.err.println("accessed.");  
         System.err.println("Check the setting of the system property");  
         System.err.println("gnu.java.awt.FocusManager");  
         return null;  
       }  
   }  
   
   /**  
299     * Retrieve the {@link Component} that has the keyboard focus, or     * Retrieve the {@link Component} that has the keyboard focus, or
300     * null if the focus owner was not set by a thread in the current     * null if the focus owner was not set by a thread in the current
301     * {@link java.lang.ThreadGroup}.     * {@link java.lang.ThreadGroup}.
# Line 1366  public abstract class KeyboardFocusManag Line 1327  public abstract class KeyboardFocusManag
1327     *     *
1328     * @return a global object set by the current ThreadGroup, or null     * @return a global object set by the current ThreadGroup, or null
1329     *     *
1330     * @see getFocusOwner     * @see #getFocusOwner()
1331     * @see getPermanentFocusOwner     * @see #getPermanentFocusOwner()
1332     * @see getFocusedWindow     * @see #getFocusedWindow()
1333     * @see getActiveWindow     * @see #getActiveWindow()
1334     * @see getCurrentFocusCycleRoot     * @see #getCurrentFocusCycleRoot()
1335     */     */
1336    private Object getObject (Map globalMap)    private Object getObject (Map globalMap)
1337    {    {
# Line 1390  public abstract class KeyboardFocusManag Line 1351  public abstract class KeyboardFocusManag
1351     * @throws SecurityException if this is not the keyboard focus     * @throws SecurityException if this is not the keyboard focus
1352     * manager associated with the current {@link java.lang.ThreadGroup}     * manager associated with the current {@link java.lang.ThreadGroup}
1353     *     *
1354     * @see getGlobalFocusOwner     * @see #getGlobalFocusOwner()
1355     * @see getGlobalPermanentFocusOwner     * @see #getGlobalPermanentFocusOwner()
1356     * @see getGlobalFocusedWindow     * @see #getGlobalFocusedWindow()
1357     * @see getGlobalActiveWindow     * @see #getGlobalActiveWindow()
1358     * @see getGlobalCurrentFocusCycleRoot     * @see #getGlobalCurrentFocusCycleRoot()
1359     */     */
1360    private Object getGlobalObject (Map globalMap)    private Object getGlobalObject (Map globalMap)
1361    {    {
# Line 1434  public abstract class KeyboardFocusManag Line 1395  public abstract class KeyboardFocusManag
1395     * @param newObject the object to set     * @param newObject the object to set
1396     * @param property the property that will change     * @param property the property that will change
1397     *     *
1398     * @see setGlobalFocusOwner     * @see #setGlobalFocusOwner(Component)
1399     * @see setGlobalPermanentFocusOwner     * @see #setGlobalPermanentFocusOwner(Component)
1400     * @see setGlobalFocusedWindow     * @see #setGlobalFocusedWindow(Window)
1401     * @see setGlobalActiveWindow     * @see #setGlobalActiveWindow(Window)
1402     * @see setGlobalCurrentFocusCycleRoot     * @see #setGlobalCurrentFocusCycleRoot(Container)
1403     */     */
1404    private void setGlobalObject (Map globalMap,    private void setGlobalObject (Map globalMap,
1405                                  Object newObject,                                  Object newObject,

Legend:
Removed from v.1.5.2.8  
changed lines
  Added in v.1.5.2.9

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