Package javax.swing

Examples of javax.swing.InputMap.keys()


    harness.check(defaults.get("ScrollPane.border") instanceof BasicBorders.FieldBorder);
    harness.check(defaults.get("ScrollPane.font"), new FontUIResource("Dialog", Font.PLAIN, 12));
   
    harness.checkPoint("Slider");
    InputMap map = (InputMap) defaults.get("Slider.focusInputMap");
    KeyStroke[] keys = map.keys();
    InputMap focusInputMap = (InputMap) defaults.get("Slider.focusInputMap");
    List keyList = Arrays.asList(keys);
    harness.check(keyList.contains(KeyStroke.getKeyStroke("LEFT")));
    harness.check(keyList.contains(KeyStroke.getKeyStroke("RIGHT")));
    harness.check(keyList.contains(KeyStroke.getKeyStroke("UP")));
View Full Code Here


    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("END")), "maxScroll");
    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("PAGE_UP")), "positiveBlockIncrement");
    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("PAGE_DOWN")), "negativeBlockIncrement");
   
    InputMap rightToLeftMap = (InputMap) defaults.get("Slider.focusInputMap.RightToLeft");
    keys = rightToLeftMap != null ? rightToLeftMap.keys() : new KeyStroke[] {};
    keyList = Arrays.asList(keys);
    harness.check(keyList.contains(KeyStroke.getKeyStroke("RIGHT")));
    harness.check(keyList.contains(KeyStroke.getKeyStroke("KP_RIGHT")));
    harness.check(keyList.contains(KeyStroke.getKeyStroke("LEFT")));
    harness.check(keyList.contains(KeyStroke.getKeyStroke("KP_LEFT")));
View Full Code Here

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

    InputMap m1 = sb.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = sb.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    InputMap m2p = m2.getParent();
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_UP")), "negativeBlockIncrement");
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed PAGE_DOWN")), "positiveBlockIncrement");
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed END")), "maxScroll");
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed HOME")), "minScroll");
View Full Code Here

    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_LEFT")), "negativeUnitIncrement");
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed DOWN")), "positiveUnitIncrement");
    harness.check(m2p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")), "positiveUnitIncrement");

    InputMap m3 = sb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
  }
}
View Full Code Here

  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    JTabbedPane tp = new JTabbedPane();
    InputMap m1 = tp.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p.get(KeyStroke.getKeyStroke("ctrl pressed DOWN")),
            "requestFocusForVisibleComponent");
    harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_UP")),
            "navigateUp");
View Full Code Here

    harness.check(m1p.get(KeyStroke.getKeyStroke("pressed KP_RIGHT")),
            "navigateRight");
    harness.check(m1p.get(KeyStroke.getKeyStroke("pressed DOWN")),
            "navigateDown");
    InputMap m2 = tp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    InputMap m2p = m2.getParent();
    harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_DOWN")),
            "navigatePageDown");
    harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed PAGE_UP")),
            "navigatePageUp");
View Full Code Here

    harness.checkPoint("Slider");
    harness.check(defaults.get("Slider.altTrackColor"), null);
    harness.check(defaults.get("Slider.background"), new ColorUIResource(0, 0, 4));
    harness.check(defaults.get("Slider.focus"), new ColorUIResource(0, 0, 12));
    InputMap focusInputMap = (InputMap) defaults.get("Slider.focusInputMap");
    KeyStroke[] keys = focusInputMap.keys();
//    for (int i = 0; i < keys.length; i++) {
//        System.out.println(keys[i] + " --> " + focusInputMap.get(keys[i]));
//    }
    List keyList = Arrays.asList(keys);
    harness.check(keyList.contains(KeyStroke.getKeyStroke("LEFT")));
View Full Code Here

    harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed UP")),
            "requestFocus");
    harness.check(m2p.get(KeyStroke.getKeyStroke("ctrl pressed KP_UP")),
            "requestFocus");
    InputMap m3 = tp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    harness.check(m3.getParent(), null);
  }
}
View Full Code Here

    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("PAGE_DOWN")), "negativeBlockIncrement");
    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("ctrl PAGE_DOWN")), "negativeBlockIncrement");
    harness.check(focusInputMap.get(KeyStroke.getKeyStroke("ctrl PAGE_UP")), "positiveBlockIncrement");
   
    InputMap rightToLeftMap = (InputMap) defaults.get("Slider.focusInputMap.RightToLeft");
    keys = rightToLeftMap != null ? rightToLeftMap.keys() : new KeyStroke[] {};
    keyList = Arrays.asList(keys);
//    for (int i = 0; i < keys.length; i++) {
//        System.out.println(keys[i] + " --> " + focusInputMap.get(keys[i]));
//    }
    harness.check(keyList.contains(KeyStroke.getKeyStroke("RIGHT")));
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.