Esempio n. 1
0
 public static Shortcut createShortcut() {
   return Shortcut.registerShortcut(
       "system:copytags",
       tr("Edit: {0}", tr("Copy Tags")),
       KeyEvent.CHAR_UNDEFINED,
       Shortcut.NONE);
 }
Esempio n. 2
0
 /** Create an open action. The name is "Open a file". */
 public OpenFileAction() {
   super(
       tr("Open..."),
       "open",
       tr("Open a file."),
       Shortcut.registerShortcut(
           "system:open", tr("File: {0}", tr("Open...")), KeyEvent.VK_O, Shortcut.CTRL));
   putValue("help", ht("/Action/Open"));
 }
Esempio n. 3
0
 /** Constructs a new {@code SearchAction}. */
 public SearchAction() {
   super(
       tr("Search..."),
       "dialogs/search",
       tr("Search for objects."),
       Shortcut.registerShortcut("system:find", tr("Search..."), KeyEvent.VK_F, Shortcut.CTRL),
       true);
   putValue("help", ht("/Action/Search"));
 }
Esempio n. 4
0
 /** Create a new SplitWayAction. */
 public SplitWayAction() {
   super(
       tr("Split Way"),
       "splitway",
       tr("Split a way at the selected node."),
       Shortcut.registerShortcut(
           "tools:splitway", tr("Tool: {0}", tr("Split Way")), KeyEvent.VK_P, Shortcut.DIRECT),
       true);
   putValue("help", ht("/Action/SplitWay"));
 }
Esempio n. 5
0
 /**
  * Construct a new DeleteAction. Mnemonic is the delete - key.
  *
  * @param mapFrame The frame this action belongs to.
  */
 public DeleteAction(MapFrame mapFrame) {
   super(
       tr("Delete Mode"),
       "delete",
       tr("Delete nodes or ways."),
       Shortcut.registerShortcut(
           "mapmode:delete", tr("Mode: {0}", tr("Delete")), KeyEvent.VK_DELETE, Shortcut.CTRL),
       mapFrame,
       ImageProvider.getCursor("normal", "delete"));
 }
Esempio n. 6
0
 public PurgeAction() {
   /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */
   super(
       tr("Purge..."),
       "purge",
       tr("Forget objects but do not delete them on server when uploading."),
       Shortcut.registerShortcut(
           "system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.CTRL_SHIFT),
       true);
   putValue("help", HelpUtil.ht("/Action/Purge"));
 }
Esempio n. 7
0
 // Adds the menu entry, Shortcuts, etc.
 public JoinAreasAction() {
   super(
       tr("Join overlapping Areas"),
       "joinareas",
       tr("Joins areas that overlap each other"),
       Shortcut.registerShortcut(
           "tools:joinareas",
           tr("Tool: {0}", tr("Join overlapping Areas")),
           KeyEvent.VK_J,
           Shortcut.SHIFT),
       true);
 }
Esempio n. 8
0
 public AudioFwdAction() {
   super(
       trc("audio", "Forward"),
       "audio-fwd",
       trc("audio", "Jump forward"),
       Shortcut.registerShortcut(
           "audio:forward",
           tr("Audio: {0}", trc("audio", "Forward")),
           KeyEvent.VK_F7,
           Shortcut.GROUP_DIRECT),
       true);
 }
  private MapillaryFilterDialog() {
    super(
        tr("Mapillary filter"),
        "mapillaryfilter.png",
        tr("Open Mapillary filter dialog"),
        Shortcut.registerShortcut(
            tr("Mapillary filter"),
            tr("Open Mapillary filter dialog"),
            KeyEvent.VK_M,
            Shortcut.NONE),
        200);

    this.panel = new JPanel();

    this.signChooser.setEnabled(false);
    JPanel signChooserPanel = new JPanel();
    signChooserPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    signChooserPanel.add(this.signChooser);

    JPanel fromPanel = new JPanel();
    fromPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    fromPanel.add(new JLabel("Not older than: "));
    this.spinner = new SpinnerNumberModel(1, 0, 10000, 1);
    fromPanel.add(new JSpinner(this.spinner));
    this.time = new JComboBox<>(TIME_LIST);
    fromPanel.add(this.time);

    JPanel userSearchPanel = new JPanel();
    userSearchPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    this.user = new JTextField(10);
    this.user.addActionListener(new UpdateAction());
    userSearchPanel.add(new JLabel("User"));
    userSearchPanel.add(this.user);

    this.imported.setSelected(true);
    this.downloaded.setSelected(true);

    JPanel col1 = new JPanel(new GridLayout(2, 1));
    col1.add(this.downloaded);
    col1.add(fromPanel);
    this.panel.add(col1);
    JPanel col2 = new JPanel(new GridLayout(2, 1));
    col2.add(this.imported);
    col2.add(userSearchPanel);
    this.panel.add(col2);
    JPanel col3 = new JPanel(new GridLayout(2, 1));
    col3.add(this.onlySigns);
    col3.add(signChooserPanel);
    this.panel.add(col3);

    createLayout(
        this.panel, true, Arrays.asList(new SideButton[] {this.updateButton, this.resetButton}));
  }
Esempio n. 10
0
  private JButton addButtonAndShortcut(ActionDefinition action) {
    Action act = action.getParametrizedAction();
    JButton b = control.add(act);

    Shortcut sc = null;
    if (action.getAction() instanceof JosmAction) {
      sc = ((JosmAction) action.getAction()).getShortcut();
      if (sc.getAssignedKey() == KeyEvent.CHAR_UNDEFINED) {
        sc = null;
      }
    }

    long paramCode = 0;
    if (action.hasParameters()) {
      paramCode = action.parameters.hashCode();
    }

    String tt = action.getDisplayTooltip();
    if (tt == null) {
      tt = "";
    }

    if (sc == null || paramCode != 0) {
      String name = (String) action.getAction().getValue("toolbar");
      if (name == null) {
        name = action.getDisplayName();
      }
      if (paramCode != 0) {
        name = name + paramCode;
      }
      String desc =
          action.getDisplayName() + ((paramCode == 0) ? "" : action.parameters.toString());
      sc =
          Shortcut.registerShortcut(
              "toolbar:" + name, tr("Toolbar: {0}", desc), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
      Main.unregisterShortcut(sc);
      Main.registerActionShortcut(act, sc);

      // add shortcut info to the tooltip if needed
      if (sc.getAssignedUser()) {
        if (tt.startsWith("<html>") && tt.endsWith("</html>")) {
          tt = tt.substring(6, tt.length() - 6);
        }
        tt = Main.platform.makeTooltip(tt, sc);
      }
    }

    if (!tt.isEmpty()) {
      b.setToolTipText(tt);
    }
    return b;
  }
Esempio n. 11
0
 /**
  * Construct the action with "Save" as label.
  *
  * @param layer Save this layer.
  */
 public SaveAsAction() {
   super(
       tr("Save As..."),
       "save_as",
       tr("Save the current data to a new file."),
       Shortcut.registerShortcut(
           "system:saveas",
           tr("File: {0}", tr("Save As...")),
           KeyEvent.VK_S,
           Shortcut.GROUP_MENU,
           Shortcut.SHIFT_DEFAULT));
   putValue("help", ht("/Action/SaveAs"));
 }
 public BuildingSizeAction() {
   super(
       tr("Set buildings size"),
       "mapmode/building",
       tr("Set buildings size"),
       Shortcut.registerShortcut(
           "edit:buildingsdialog",
           tr("Edit: {0}", tr("Set buildings size")),
           KeyEvent.VK_W,
           Shortcut.GROUP_EDIT,
           Shortcut.SHIFT_DEFAULT),
       true);
 }
Esempio n. 13
0
 /** Constructs a new {@code AlignInCircleAction}. */
 public AlignInCircleAction() {
   super(
       tr("Align Nodes in Circle"),
       "aligncircle",
       tr("Move the selected nodes into a circle."),
       Shortcut.registerShortcut(
           "tools:aligncircle",
           tr("Tool: {0}", tr("Align Nodes in Circle")),
           KeyEvent.VK_O,
           Shortcut.DIRECT),
       true);
   putValue("help", ht("/Action/AlignInCircle"));
 }
 public RelationEditMode(MapFrame mapFrame) {
   super(
       tr("Edit relation"),
       "node/autonode",
       tr("Edit relations"),
       Shortcut.registerShortcut(
           "mapmode:editRelation",
           tr("Mode: {0}", tr("Edit relation")),
           KeyEvent.VK_H,
           Shortcut.GROUP_EDIT),
       mapFrame,
       Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 }
 public ConflateAction() {
   // TODO: make sure shortcuts make sense
   super(
       tr("Conflate"),
       "dialogs/conflation",
       tr("Conflate selected objects"),
       Shortcut.registerShortcut(
           "conflation:replace",
           tr("Conflation: {0}", tr("Replace")),
           KeyEvent.VK_F,
           Shortcut.ALT_CTRL),
       false);
 }
 public UndoSelectionAction() {
   super(
       tr("Undo selection"),
       "undoselection",
       tr("Reselect last added object or selection form history"),
       Shortcut.registerShortcut(
           "tools:undoselection",
           tr("Tool: {0}", "Undo selection"),
           KeyEvent.VK_Z,
           Shortcut.CTRL_SHIFT),
       true);
   putValue("help", ht("/Action/UndoSelection"));
 }
Esempio n. 17
0
 /** Constructor */
 public CheckAction(LicenseChangePlugin plugin) {
   super(
       tr("License Check"),
       "licensechange",
       tr("Performs the license check"),
       Shortcut.registerShortcut(
           "tools:licensechange",
           tr("Tool: {0}", tr("License Check")),
           KeyEvent.VK_C,
           Shortcut.ALT_CTRL_SHIFT),
       true);
   this.plugin = plugin;
 }
Esempio n. 18
0
 /** Constructs a new {@code OrthogonalizeAction}. */
 public OrthogonalizeAction() {
   super(
       tr("Orthogonalize Shape"),
       "ortho",
       tr("Move nodes so all angles are 90 or 180 degrees"),
       Shortcut.registerShortcut(
           "tools:orthogonalize",
           tr("Tool: {0}", tr("Orthogonalize Shape")),
           KeyEvent.VK_Q,
           Shortcut.DIRECT),
       true);
   putValue("help", ht("/Action/OrthogonalizeShape"));
 }
 PointInfoAction(MapFrame mapFrame) {
   super(
       tr("Point info"),
       "info-sml",
       tr("Point info."),
       Shortcut.registerShortcut(
           "tools:pointInfo",
           tr("Tool: {0}", tr("Point info")),
           KeyEvent.VK_X,
           Shortcut.CTRL_SHIFT),
       mapFrame,
       getCursor());
 }
 public SelectModNodesAction() {
   super(
       tr("Select last modified nodes"),
       "selmodnodes",
       tr("Select last modified nodes"),
       Shortcut.registerShortcut(
           "tools:selmodnodes",
           tr("Tool: {0}", "Select last modified nodes"),
           KeyEvent.VK_Z,
           Shortcut.GROUP_EDIT,
           Shortcut.SHIFT_DEFAULT),
       true);
   putValue("help", ht("/Action/SelectModNodes"));
 }
Esempio n. 21
0
 public AddNodeAction() {
   super(
       tr("Add Node..."),
       "addnode",
       tr("Add a node by entering latitude and longitude."),
       Shortcut.registerShortcut(
           "addnode",
           tr("Edit: {0}", tr("Add Node...")),
           KeyEvent.VK_D,
           Shortcut.GROUP_EDIT,
           Shortcut.SHIFT_DEFAULT),
       true);
   putValue("help", ht("/Action/AddNode"));
 }
 public ImageryAdjustMapMode(MapFrame mapFrame) {
   super(
       tr("Adjust imagery"),
       "adjustimg",
       tr("Adjust the position of the selected imagery layer"),
       Shortcut.registerShortcut(
           "imageryadjust:adjustmode",
           tr("Mode: {0}", tr("Adjust imagery")),
           KeyEvent.VK_Y,
           Shortcut.ALT_CTRL),
       mapFrame,
       ImageProvider.getCursor("normal", "move"));
   MapFrame.addMapModeChangeListener(this);
 }
Esempio n. 23
0
 /** Constructor */
 public Undo() {
   super(
       tr("Orthogonalize Shape / Undo"),
       "ortho",
       tr("Undo orthogonalization for certain nodes"),
       Shortcut.registerShortcut(
           "tools:orthogonalizeUndo",
           tr("Tool: {0}", tr("Orthogonalize Shape / Undo")),
           KeyEvent.VK_Q,
           Shortcut.SHIFT),
       true,
       "action/orthogonalize/undo",
       true);
 }
 public ToggleAction() {
   super(
       tr("Download OSM data continuosly"),
       "images/continous-download",
       tr("Download map data continuosly when paning and zooming."),
       Shortcut.registerShortcut(
           "continuosdownload:activate",
           tr("Toggle the continuos download on/off"),
           KeyEvent.VK_D,
           Shortcut.ALT_SHIFT),
       true,
       "continuosdownload/activate",
       true);
 }
Esempio n. 25
0
 /** Create an open action. The name is "Open a file". */
 public OpenLocationAction() {
   /* I18N: Command to download a specific location/URL */
   super(
       tr("Open Location..."),
       "openlocation",
       tr("Open an URL."),
       Shortcut.registerShortcut(
           "system:open_location",
           tr("File: {0}", tr("Open Location...")),
           KeyEvent.VK_L,
           Shortcut.GROUP_MENU),
       true);
   putValue("help", ht("/Action/OpenLocation"));
 }
 /**
  * Constructs a new <code>RecentRelationsAction</code>.
  *
  * @param editButton edit button
  */
 public RecentRelationsAction(SideButton editButton) {
   this.editButton = editButton;
   arrow = editButton.createArrow(this);
   arrow.setToolTipText(tr("List of recent relations"));
   Main.main.undoRedo.addCommandQueueListener(this);
   Main.getLayerManager().addLayerChangeListener(this);
   Main.getLayerManager().addActiveLayerChangeListener(this);
   enableArrow();
   shortcut =
       Shortcut.registerShortcut(
           "relationeditor:editrecentrelation",
           tr("Relation Editor: {0}", tr("Open recent relation")),
           KeyEvent.VK_ESCAPE,
           Shortcut.SHIFT);
   Main.registerActionShortcut(new LaunchEditorAction(), shortcut);
 }
Esempio n. 27
0
 /**
  * Constructs a new {@code RemoveAction}.
  *
  * @param memberTable member table
  * @param memberTableModel member table model
  * @param actionMapKey action map key
  */
 public RemoveAction(
     MemberTable memberTable, MemberTableModel memberTableModel, String actionMapKey) {
   super(memberTable, memberTableModel, actionMapKey);
   putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
   putValue(NAME, tr("Remove"));
   Shortcut sc =
       Shortcut.registerShortcut(
           "relationeditor:remove",
           tr("Relation Editor: Remove"),
           KeyEvent.VK_DELETE,
           Shortcut.ALT);
   sc.setAccelerator(this);
   putValue(
       SHORT_DESCRIPTION,
       Main.platform.makeTooltip(
           tr("Remove the currently selected members from this relation"), sc));
   setEnabled(false);
 }
  private MapillaryMainDialog() {
    super(
        tr(BASE_TITLE),
        "mapillary-main.svg",
        tr("Open Mapillary window"),
        Shortcut.registerShortcut(
            tr("Mapillary dialog"), tr("Open Mapillary main dialog"), KeyEvent.VK_M, Shortcut.NONE),
        200,
        false,
        MapillaryPreferenceSetting.class);
    addShortcuts();
    this.mapillaryImageDisplay = new MapillaryImageDisplay();

    this.blueButton.setForeground(Color.BLUE);
    this.redButton.setForeground(Color.RED);

    setMode(MODE.NORMAL);
  }
Esempio n. 29
0
 /** Create an open action. The name is "Open a file". */
 public OpenLocationAction() {
   /* I18N: Command to download a specific location/URL */
   super(
       tr("Open Location..."),
       "openlocation",
       tr("Open an URL."),
       Shortcut.registerShortcut(
           "system:open_location",
           tr("File: {0}", tr("Open Location...")),
           KeyEvent.VK_L,
           Shortcut.CTRL),
       true);
   putValue("help", ht("/Action/OpenLocation"));
   this.downloadTasks = new ArrayList<Class<? extends DownloadTask>>();
   addDownloadTaskClass(DownloadOsmTask.class);
   addDownloadTaskClass(DownloadGpsTask.class);
   addDownloadTaskClass(DownloadOsmChangeTask.class);
   addDownloadTaskClass(DownloadOsmUrlTask.class);
 }
  private ImageWayPointDialog() {
    this.dialog =
        new ToggleDialog(
            tr("WayPoint Image"),
            "imagewaypoint",
            tr("Display non-geotagged photos"),
            Shortcut.registerShortcut(
                "subwindow:imagewaypoint",
                tr("Toggle: {0}", tr("WayPoint Image")),
                KeyEvent.VK_Y,
                Shortcut.ALT_SHIFT),
            200);

    this.previousAction = new PreviousAction();
    this.nextAction = new NextAction();
    this.rotateLeftAction = new RotateLeftAction();
    this.rotateRightAction = new RotateRightAction();

    final JButton previousButton = new JButton(this.previousAction);
    final JButton nextButton = new JButton(this.nextAction);
    final JButton rotateLeftButton = new JButton(this.rotateLeftAction);
    final JButton rotateRightButton = new JButton(this.rotateRightAction);

    // default layout, FlowLayout, is fine
    final JPanel buttonPanel = new JPanel();
    buttonPanel.add(previousButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(rotateLeftButton);
    buttonPanel.add(rotateRightButton);

    final JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());

    this.imageDisplay = new ImageComponent();
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    mainPanel.add(this.imageDisplay, BorderLayout.CENTER);

    this.listener = new ImageChangeListener(this);
    ImageEntries.getInstance().addListener(this.listener);

    this.updateUI();
    dialog.add(mainPanel);
  }