Package org.openstreetmap.josm.actions

Examples of org.openstreetmap.josm.actions.JosmAction


        if (!zoomToEditLayerBoundingBox())
          new AutoScaleAction("data").actionPerformed(null);

        new MapMover(MapView.this, Main.contentPane);
        JosmAction mv;
        mv = new MoveAction(MoveAction.Direction.UP);
        if (mv.getShortcut() != null) {
          Main.contentPane.getInputMap(
              JComponent.WHEN_IN_FOCUSED_WINDOW).put(
              mv.getShortcut().getKeyStroke(), "UP");
          Main.contentPane.getActionMap().put("UP", mv);
        }
        mv = new MoveAction(MoveAction.Direction.DOWN);
        if (mv.getShortcut() != null) {
          Main.contentPane.getInputMap(
              JComponent.WHEN_IN_FOCUSED_WINDOW).put(
              mv.getShortcut().getKeyStroke(), "DOWN");
          Main.contentPane.getActionMap().put("DOWN", mv);
        }
        mv = new MoveAction(MoveAction.Direction.LEFT);
        if (mv.getShortcut() != null) {
          Main.contentPane.getInputMap(
              JComponent.WHEN_IN_FOCUSED_WINDOW).put(
              mv.getShortcut().getKeyStroke(), "LEFT");
          Main.contentPane.getActionMap().put("LEFT", mv);
        }
        mv = new MoveAction(MoveAction.Direction.RIGHT);
        if (mv.getShortcut() != null) {
          Main.contentPane.getInputMap(
              JComponent.WHEN_IN_FOCUSED_WINDOW).put(
              mv.getShortcut().getKeyStroke(), "RIGHT");
          Main.contentPane.getActionMap().put("RIGHT", mv);
        }
      }
    });
View Full Code Here


                final Tag t = tags.get(i);
                // Create action for reusing the tag, with keyboard shortcut Ctrl+(1-5)
                String actionShortcutKey = "properties:recent:"+count;
                String actionShortcutShiftKey = "properties:recent:shift:"+count;
                Shortcut sc = Shortcut.registerShortcut(actionShortcutKey, tr("Choose recent tag {0}", count), KeyEvent.VK_0+count, Shortcut.CTRL);
                final JosmAction action = new JosmAction(actionShortcutKey, null, tr("Use this tag again"), sc, false) {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        keys.setSelectedItem(t.getKey());
                        // Update list of values (fix #7951)
                        // fix #8298 - update list of values before setting value (?)
                        focus.focusGained(null);
                        values.setSelectedItem(t.getValue());
                        selectValuesCombobox();
                    }
                };
                Shortcut scShift = Shortcut.registerShortcut(actionShortcutShiftKey, tr("Apply recent tag {0}", count), KeyEvent.VK_0+count, Shortcut.CTRL_SHIFT);
                final JosmAction actionShift = new JosmAction(actionShortcutShiftKey, null, tr("Use this tag again"), scShift, false) {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        action.actionPerformed(null);
                        performTagAdding();
                        selectKeysComboBox();
View Full Code Here

        String name = getRelation() == null ? tr("New Relation") : getRelation().getLocalName();
        final String tt = tr("Focus Relation Editor with relation ''{0}'' in layer ''{1}''",
                name, getLayer().getName());
        name = tr("Relation Editor: {0}", name == null ? getRelation().getId() : name);
        final JMenu wm = Main.main.menu.windowMenu;
        final JosmAction focusAction = new JosmAction(name, "dialogs/relationlist", tt, null, false, false) {
            @Override
            public void actionPerformed(ActionEvent e) {
                final RelationEditor r = (RelationEditor) getValue("relationEditor");
                r.setVisible(true);
            }
        };
        focusAction.putValue("relationEditor", this);
        windowMenuItem = MainMenu.add(wm, focusAction, MainMenu.WINDOW_MENU_GROUP.VOLATILE);
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.actions.JosmAction

Copyright © 2018 www.massapicom. 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.