Examples of KeyBoardLayout


Examples of ch.fork.AdHocRailway.technical.configuration.KeyBoardLayout

        speedControlPanel.add(lockButton);
        return speedControlPanel;
    }

    private void initKeyboardActions() {
        KeyBoardLayout kbl = Preferences.getInstance().getKeyBoardLayout();
        InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
        getActionMap().put
            ("Accelerate" + number, new LocomotiveAccelerateAction());
        kbl.assignKeys(inputMap, "Accelerate" + number);
        getActionMap().put
            ("Deccelerate" + number, new LocomotiveDeccelerateAction());
        kbl.assignKeys(inputMap, "Deccelerate" + number);
        getActionMap().put
            ("ToggleDirection" + number, new LocomotiveToggleDirectionAction());
        kbl.assignKeys(inputMap, "ToggleDirection" + number);
    }
View Full Code Here

Examples of ch.fork.AdHocRailway.technical.configuration.KeyBoardLayout

                            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
                }

            }
            for (JPanel p : panels) {
                KeyBoardLayout kbl
                    = Preferences.getInstance().getKeyBoardLayout();
                InputMap inputMap = p.getInputMap
                    (JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
                p.getActionMap().put("CurvedLeft", new CurvedLeftAction(route));
                kbl.assignKeys(inputMap, "CurvedLeft");
                p.getActionMap().put
                    ("CurvedRight", new CurvedRightAction(route));
                kbl.assignKeys(inputMap, "CurvedRight");
                p.getActionMap().put("Straight", new StraightAction(route));
                kbl.assignKeys(inputMap, "Straight");
                p.getActionMap().put
                    ("EnableRoute", new EnableRouteAction(route));
                kbl.assignKeys(inputMap, "EnableRoute");
                p.getActionMap().put
                    ("DisableRoute", new DisableRouteAction(route));
                kbl.assignKeys(inputMap, "DisableRoute");
            }
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.technical.configuration.KeyBoardLayout

                    Integer.toString(i),
                    KeyStroke.getKeyStroke("NUMPAD" + Integer.toString(i)),
                    WHEN_IN_FOCUSED_WINDOW);

        }
        KeyBoardLayout kbl = Preferences.getInstance().getKeyBoardLayout();
        InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW);
        getActionMap().put("RouteNumberEntered", new PeriodEnteredAction());
        kbl.assignKeys(inputMap, "RouteNumberEntered");
        getActionMap().put("CurvedLeft", new CurvedLeftAction());
        kbl.assignKeys(inputMap, "CurvedLeft");
        getActionMap().put("CurvedRight", new CurvedRightAction());
        kbl.assignKeys(inputMap, "CurvedRight");
        getActionMap().put("Straight", new StraightAction());
        kbl.assignKeys(inputMap, "Straight");
        getActionMap().put("EnableRoute", new EnableRouteAction());
        kbl.assignKeys(inputMap, "EnableRoute");
        getActionMap().put("DisableRoute", new DisableRouteAction());
        kbl.assignKeys(inputMap, "DisableRoute");
    }
View Full Code Here

Examples of de.t68.utils.keyboard.KeyboardLayout

    {
        keyboardTextField.setText(original.getText());
        if (popup == null)
        {
            popup = new JPopupMenu();
            KeyboardLayout layout = LanguageMap.getInstance().getKeyboardLayoutForCurrentLocale();
            VKeyboard keyboard = new VKeyboard(layout, keyFontSize, keyboardTextField);
            popup.add(keyboard);
            popup.pack();
        }
        popup.show(original, 0, 0);
View Full Code Here

Examples of de.t68.utils.keyboard.KeyboardLayout

        tb.setPreferredSize(new Dimension(20, 200));
        f.getContentPane().setLayout(new BorderLayout());
        f.getContentPane().add(p, BorderLayout.CENTER);
        final LanguageMap map = LanguageMap.getInstance();

        KeyboardLayout layout = map.getKeyboardLayoutForLocale("th", "TH");
        final VKeyboard v = new VKeyboard(layout, tb);
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(v.getKeyPanel(), BorderLayout.CENTER);
        final JComboBox<String> comboBox = new JComboBox<>(new Vector<>(map.keySet()));
        comboBox.setFocusable(false);
        JPanel boxPanel = new JPanel(new FlowLayout());
        boxPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 20));
        boxPanel.add(comboBox);
        panel.add(boxPanel, BorderLayout.NORTH);
        comboBox.setSelectedItem(layout.getLocaleString().get(0));
        comboBox.addItemListener(new ItemListener() {

            public void itemStateChanged(ItemEvent e)
            {
                Object item = comboBox.getSelectedItem();
                if (item instanceof String)
                {
                    KeyboardLayout keyboardLayout = map.get(item);
                    if (keyboardLayout != null)
                        v.setKeyboardLayout(keyboardLayout);
                }
            }
        });
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.