/[classpath]/classpath/javax/swing/SwingUtilities.java
ViewVC logotype

Diff of /classpath/javax/swing/SwingUtilities.java

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

revision 1.15.2.3 by gnu_andrew, Sun Jan 16 02:14:49 2005 UTC revision 1.15.2.4 by gnu_andrew, Sat Jan 22 02:20:02 2005 UTC
# Line 47  import java.awt.FontMetrics; Line 47  import java.awt.FontMetrics;
47  import java.awt.Frame;  import java.awt.Frame;
48  import java.awt.Graphics;  import java.awt.Graphics;
49  import java.awt.Insets;  import java.awt.Insets;
50    import java.awt.KeyboardFocusManager;
51  import java.awt.Point;  import java.awt.Point;
52  import java.awt.Rectangle;  import java.awt.Rectangle;
53  import java.awt.Shape;  import java.awt.Shape;
# Line 129  public class SwingUtilities implements S Line 130  public class SwingUtilities implements S
130    }    }
131    
132    /**    /**
133       * Returns the focus owner or <code>null</code> if <code>comp</code> is not
134       * the focus owner or a parent of it.
135       *
136       * @param comp the focus owner or a parent of it
137       *
138       * @return the focus owner, or <code>null</code>
139       *
140       * @deprecated 1.4 Replaced by
141       * <code>KeyboardFocusManager.getFocusOwner()</code>.
142       */
143      public static Component findFocusOwner(Component comp)
144      {
145        // Get real focus owner.
146        Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
147                                                   .getFocusOwner();
148    
149        // Check if comp is the focus owner or a parent of it.
150        Component tmp = focusOwner;
151        
152        while (tmp != null)
153          {
154            if (tmp == comp)
155              return focusOwner;
156    
157            tmp = tmp.getParent();
158          }
159        
160        return null;
161      }
162      
163      /**
164     * Calculates the bounds of a component in the component's own coordinate     * Calculates the bounds of a component in the component's own coordinate
165     * space. The result has the same height and width as the component's     * space. The result has the same height and width as the component's
166     * bounds, but its location is set to (0,0).     * bounds, but its location is set to (0,0).

Legend:
Removed from v.1.15.2.3  
changed lines
  Added in v.1.15.2.4

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