Java 类javax.swing.plaf.ComponentInputMapUIResource 实例源码

项目:javify    文件:BasicRootPaneUI.java   
/**
 * Installs look and feel keyboard actions on the root pane.
 *
 * @param rp the root pane to install the keyboard actions to
 */
protected void installKeyboardActions(JRootPane rp)
{
  // Install the keyboard actions.
  ActionMapUIResource am = new ActionMapUIResource();
  am.put("press", new DefaultPressAction(rp));
  am.put("release", new DefaultReleaseAction(rp));
  SwingUtilities.replaceUIActionMap(rp, am);

  // Install the input map from the UIManager. It seems like the actual
  // bindings are installed in the JRootPane only when the defaultButton
  // property receives a value. So we also only install an empty
  // input map here, and fill it in propertyChange.
  ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp);
  SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW,
                                   im);
}
项目:jvm-stm    文件:BasicRootPaneUI.java   
/**
 * Installs look and feel keyboard actions on the root pane.
 *
 * @param rp the root pane to install the keyboard actions to
 */
protected void installKeyboardActions(JRootPane rp)
{
  // Install the keyboard actions.
  ActionMapUIResource am = new ActionMapUIResource();
  am.put("press", new DefaultPressAction(rp));
  am.put("release", new DefaultReleaseAction(rp));
  SwingUtilities.replaceUIActionMap(rp, am);

  // Install the input map from the UIManager. It seems like the actual
  // bindings are installed in the JRootPane only when the defaultButton
  // property receives a value. So we also only install an empty
  // input map here, and fill it in propertyChange.
  ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp);
  SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW,
                                   im);
}
项目:JamVM-PH    文件:BasicRootPaneUI.java   
/**
 * Installs look and feel keyboard actions on the root pane.
 *
 * @param rp the root pane to install the keyboard actions to
 */
protected void installKeyboardActions(JRootPane rp)
{
  // Install the keyboard actions.
  ActionMapUIResource am = new ActionMapUIResource();
  am.put("press", new DefaultPressAction(rp));
  am.put("release", new DefaultReleaseAction(rp));
  SwingUtilities.replaceUIActionMap(rp, am);

  // Install the input map from the UIManager. It seems like the actual
  // bindings are installed in the JRootPane only when the defaultButton
  // property receives a value. So we also only install an empty
  // input map here, and fill it in propertyChange.
  ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp);
  SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW,
                                   im);
}
项目:classpath    文件:BasicRootPaneUI.java   
/**
 * Installs look and feel keyboard actions on the root pane.
 *
 * @param rp the root pane to install the keyboard actions to
 */
protected void installKeyboardActions(JRootPane rp)
{
  // Install the keyboard actions.
  ActionMapUIResource am = new ActionMapUIResource();
  am.put("press", new DefaultPressAction(rp));
  am.put("release", new DefaultReleaseAction(rp));
  SwingUtilities.replaceUIActionMap(rp, am);

  // Install the input map from the UIManager. It seems like the actual
  // bindings are installed in the JRootPane only when the defaultButton
  // property receives a value. So we also only install an empty
  // input map here, and fill it in propertyChange.
  ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp);
  SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW,
                                   im);
}
项目:Desktop    文件:JhromeTabbedPaneUI.java   
/**
 * Installs the state needed for mnemonics.
 */
private void initMnemonics() {
    mnemonicToIndexMap = new Hashtable<Integer, Integer>();
    mnemonicInputMap = new ComponentInputMapUIResource(tabbedPane);
    mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabbedPane, JComponent.WHEN_IN_FOCUSED_WINDOW));
    SwingUtilities.replaceUIInputMap(tabbedPane, JComponent.WHEN_IN_FOCUSED_WINDOW, mnemonicInputMap);
}
项目:cn1    文件:LookAndFeelTest.java   
public void testMakeComponentInputMap() {
    Object[] keys = new Object[] { "SPACE", "pressed" };
    JButton button = new JButton();
    ComponentInputMap componentInputMap = LookAndFeel.makeComponentInputMap(button, keys);
    assertTrue(componentInputMap instanceof ComponentInputMapUIResource);
    assertTrue(componentInputMap.getComponent() instanceof JButton);
    assertEquals(button, componentInputMap.getComponent());
    assertEquals(1, componentInputMap.size());
}
项目:freeVM    文件:LookAndFeelTest.java   
public void testMakeComponentInputMap() {
    Object[] keys = new Object[] { "SPACE", "pressed" };
    JButton button = new JButton();
    ComponentInputMap componentInputMap = LookAndFeel.makeComponentInputMap(button, keys);
    assertTrue(componentInputMap instanceof ComponentInputMapUIResource);
    assertTrue(componentInputMap.getComponent() instanceof JButton);
    assertEquals(button, componentInputMap.getComponent());
    assertEquals(1, componentInputMap.size());
}
项目:freeVM    文件:LookAndFeelTest.java   
public void testMakeComponentInputMap() {
    Object[] keys = new Object[] { "SPACE", "pressed" };
    JButton button = new JButton();
    ComponentInputMap componentInputMap = LookAndFeel.makeComponentInputMap(button, keys);
    assertTrue(componentInputMap instanceof ComponentInputMapUIResource);
    assertTrue(componentInputMap.getComponent() instanceof JButton);
    assertEquals(button, componentInputMap.getComponent());
    assertEquals(1, componentInputMap.size());
}
项目:cn1    文件:LookAndFeel.java   
public static ComponentInputMap makeComponentInputMap(final JComponent comp, final Object[] keys) {
    ComponentInputMapUIResource result = new ComponentInputMapUIResource(comp);
    loadKeyBindings(result, keys);

    return result;
}
项目:freeVM    文件:LookAndFeel.java   
public static ComponentInputMap makeComponentInputMap(final JComponent comp, final Object[] keys) {
    ComponentInputMapUIResource result = new ComponentInputMapUIResource(comp);
    loadKeyBindings(result, keys);

    return result;
}
项目:freeVM    文件:LookAndFeel.java   
public static ComponentInputMap makeComponentInputMap(final JComponent comp, final Object[] keys) {
    ComponentInputMapUIResource result = new ComponentInputMapUIResource(comp);
    loadKeyBindings(result, keys);

    return result;
}
项目:javify    文件:LookAndFeel.java   
/**
 * Creates a ComponentInputMap from keys.
 * <code>keys</code> describes the InputMap, every even indexed
 * item is either a KeyStroke or a String representing a KeyStroke and every
 * odd indexed item is the Object associated with that KeyStroke in an
 * ActionMap.
 *
 * @param c the JComponent associated with the ComponentInputMap
 * @param keys the Object array describing the InputMap as above
 *
 * @return A new input map.
 */
public static ComponentInputMap makeComponentInputMap(JComponent c,
                                                      Object[] keys)
{
  ComponentInputMap retMap = new ComponentInputMapUIResource(c);
  loadKeyBindings(retMap, keys);
  return retMap;
}
项目:jvm-stm    文件:LookAndFeel.java   
/**
 * Creates a ComponentInputMap from keys.  
 * <code>keys</code> describes the InputMap, every even indexed
 * item is either a KeyStroke or a String representing a KeyStroke and every
 * odd indexed item is the Object associated with that KeyStroke in an 
 * ActionMap.
 * 
 * @param c the JComponent associated with the ComponentInputMap
 * @param keys the Object array describing the InputMap as above
 * 
 * @return A new input map.
 */
public static ComponentInputMap makeComponentInputMap(JComponent c,
                    Object[] keys)
{
  ComponentInputMap retMap = new ComponentInputMapUIResource(c);
  loadKeyBindings(retMap, keys);
  return retMap;
}
项目:JamVM-PH    文件:LookAndFeel.java   
/**
 * Creates a ComponentInputMap from keys.  
 * <code>keys</code> describes the InputMap, every even indexed
 * item is either a KeyStroke or a String representing a KeyStroke and every
 * odd indexed item is the Object associated with that KeyStroke in an 
 * ActionMap.
 * 
 * @param c the JComponent associated with the ComponentInputMap
 * @param keys the Object array describing the InputMap as above
 * 
 * @return A new input map.
 */
public static ComponentInputMap makeComponentInputMap(JComponent c,
                    Object[] keys)
{
  ComponentInputMap retMap = new ComponentInputMapUIResource(c);
  loadKeyBindings(retMap, keys);
  return retMap;
}
项目:classpath    文件:LookAndFeel.java   
/**
 * Creates a ComponentInputMap from keys.
 * <code>keys</code> describes the InputMap, every even indexed
 * item is either a KeyStroke or a String representing a KeyStroke and every
 * odd indexed item is the Object associated with that KeyStroke in an
 * ActionMap.
 *
 * @param c the JComponent associated with the ComponentInputMap
 * @param keys the Object array describing the InputMap as above
 *
 * @return A new input map.
 */
public static ComponentInputMap makeComponentInputMap(JComponent c,
                                                      Object[] keys)
{
  ComponentInputMap retMap = new ComponentInputMapUIResource(c);
  loadKeyBindings(retMap, keys);
  return retMap;
}