/[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.7 by gnu_andrew, Wed Feb 16 01:11:42 2005 UTC revision 1.15.2.8 by gnu_andrew, Fri May 20 18:20:57 2005 UTC
# Line 1319  public class SwingUtilities Line 1319  public class SwingUtilities
1319             && b.x >= a.x && b.x + b.width <= a.x + a.width && b.y >= a.y             && b.x >= a.x && b.x + b.width <= a.x + a.width && b.y >= a.y
1320             && b.y + b.height <= a.y + a.height;             && b.y + b.height <= a.y + a.height;
1321    }    }
1322    
1323      /**
1324       * Returns the InputMap that is provided by the ComponentUI of
1325       * <code>component</code> for the specified condition.
1326       *
1327       * @param component the component for which the InputMap is returned
1328       * @param cond the condition that specifies which of the three input
1329       *     maps should be returned, may be
1330       *     {@link JComponent#WHEN_IN_FOCUSED_WINDOW},
1331       *     {@link JComponent#WHEN_FOCUSED} or
1332       *     {@link JComponent#WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
1333       *
1334       * @return
1335       */
1336      public static InputMap getUIInputMap(JComponent component, int cond)
1337      {
1338        if (UIManager.getUI(component) != null)
1339          // we assume here that the UI class sets the parent of the component's
1340          // InputMap, which is the correct behaviour. If it's not, then
1341          // this can be considered a bug
1342          return component.getInputMap(cond).getParent();
1343        else
1344          return null;
1345      }
1346    
1347      /**
1348       * Returns the ActionMap that is provided by the ComponentUI of
1349       * <code>component</code>.
1350       *
1351       * @param component the component for which the ActionMap is returned
1352       */
1353      public static ActionMap getUIActionMap(JComponent component)
1354      {
1355        if (UIManager.getUI(component) != null)
1356          // we assume here that the UI class sets the parent of the component's
1357          // ActionMap, which is the correct behaviour. If it's not, then
1358          // this can be considered a bug
1359          return component.getActionMap().getParent();
1360        else
1361          return null;
1362      }
1363  }  }

Legend:
Removed from v.1.15.2.7  
changed lines
  Added in v.1.15.2.8

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