Package javax.swing

Examples of javax.swing.InputMap.keys()


*/
public class newMapKeysNull implements Testlet {
 
  public void test(TestHarness harness) {
          InputMap map = new InputMap();
          if (map.keys() != null)
            harness.fail("New InputMap should return null for keys()");
          if (map.allKeys() != null)
            harness.fail("New ActionMap should return null for allKeys()");
  }

View Full Code Here


  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    JPopupMenu p = new JPopupMenu();
    InputMap m1 = p.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
View Full Code Here

    InputMap m1 = p.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = p.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
//    InputMap m3p = m3.getParent();
View Full Code Here

    harness.check(m1p, null);
    InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = p.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
//    InputMap m3p = m3.getParent();
//    harness.check(m3p.get(KeyStroke.getKeyStroke("pressed ESCAPE")), "close");
//    for (int i = 0; i < m3p.keys().length; i++)
//    {
View Full Code Here

  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    JLabel label = new JLabel("Test");
    InputMap m1 = label.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = label.getInputMap(
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
View Full Code Here

    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = label.getInputMap(
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = label.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
View Full Code Here

    InputMap m2 = label.getInputMap(
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = label.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);

    // now make a label that is the label for a component
    JLabel label2 = new JLabel("Test");
    JButton button = new JButton("Target");
View Full Code Here

    harness.check(m1p, null);
    m2 = label2.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    m3 = label2.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    InputMap m3p = m3.getParent();
    harness.check(m3p.get(KeyStroke.getKeyStroke("alt pressed A")), "press");
    label2.setDisplayedMnemonic('B');
    harness.check(m3p.get(KeyStroke.getKeyStroke("alt pressed B")), "press");
  }
View Full Code Here

        ActionMap am = jta.getActionMap().getParent().getParent();
        assertNotNull(am);
        assertNotNull(im);
        assertEquals(1, im.size());
        assertTrue(am.size() > 0);
        assertEquals(im.keys()[0], KeyStroke.getKeyStroke('A', InputEvent.ALT_DOWN_MASK));
        Object actionName = im.get(im.keys()[0]);
        assertNotNull(am.get(actionName));
    }
}
View Full Code Here

        assertNotNull(am);
        assertNotNull(im);
        assertEquals(1, im.size());
        assertTrue(am.size() > 0);
        assertEquals(im.keys()[0], KeyStroke.getKeyStroke('A', InputEvent.ALT_DOWN_MASK));
        Object actionName = im.get(im.keys()[0]);
        assertNotNull(am.get(actionName));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.