Changeset 5966 in josm


Ignore:
Timestamp:
2013-05-18T20:15:51+02:00 (12 years ago)
Author:
akks
Message:

fix #8723: left click on position in status bar now opens lat/lon window again

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r5965 r5966  
    88import java.awt.event.ActionEvent;
    99import java.awt.event.KeyEvent;
    10 import java.awt.event.MouseEvent;
    11 import java.awt.event.MouseListener;
     10import javax.swing.Icon;
    1211
    1312import javax.swing.JLabel;
     
    2120import org.openstreetmap.josm.data.coor.LatLon;
    2221import org.openstreetmap.josm.gui.MapView;
     22
    2323import org.openstreetmap.josm.tools.GBC;
    2424import org.openstreetmap.josm.tools.OsmUrlToBounds;
     
    3131     */
    3232    public JumpToAction() {
    33         super(tr("Jump To Position"), null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
    34         KeyEvent.VK_J, Shortcut.CTRL), false);
    35         putValue("toolbar", "action/jumpto");
    36         Main.toolbar.register(this);
     33        super(tr("Jump To Position"), (Icon) null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
     34        KeyEvent.VK_J, Shortcut.CTRL), true, "action/jumpto", false);
    3735    }
    3836
     
    169167    }
    170168
     169    @Override
    171170    public void actionPerformed(ActionEvent e) {
    172171        showJumpToDialog();
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r5965 r5966  
    7979    final MapView mv;
    8080    final Collector collector;
    81 
     81   
    8282    public class BackgroundProgressMonitor implements ProgressMonitorDialog {
    8383
     
    141141    final JProgressBar progressBar = new JProgressBar();
    142142    public final BackgroundProgressMonitor progressMonitor = new BackgroundProgressMonitor();
     143   
     144    private MouseListener jumpToOnLeftClick;
    143145
    144146    /**
     
    701703            }
    702704        });
     705       
     706        // also show Jump To dialog on mouse click (except context menu)
     707        jumpToOnLeftClick = new MouseAdapter() {
     708            @Override
     709            public void mouseClicked(MouseEvent e) {
     710                if (e.getButton() != MouseEvent.BUTTON3) {
     711                    Main.main.menu.jumpToAct.showJumpToDialog();
     712                }
     713            }
     714        };
    703715
    704716        // Listen for mouse movements and set the position text field
     
    740752        add(distText, GBC.std().insets(3,0,0,0));
    741753
     754        latText.addMouseListener(jumpToOnLeftClick);
     755        lonText.addMouseListener(jumpToOnLeftClick);
     756       
    742757        helpText.setEditable(false);
    743758        add(nameText, GBC.std().insets(3,0,0,0));
Note: See TracChangeset for help on using the changeset viewer.