Ignore:
Timestamp:
2013-02-20T21:34:12+01:00 (13 years ago)
Author:
Don-vip
Message:

fix #8116 (forgot the other cases)

File:
1 edited

Legend:

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

    r5734 r5735  
    1212import java.awt.Toolkit;
    1313import java.awt.event.AWTEventListener;
     14import java.awt.event.ActionEvent;
     15import java.awt.event.ActionListener;
    1416import java.awt.event.InputEvent;
    1517import java.awt.event.KeyEvent;
     
    5052import org.openstreetmap.josm.gui.layer.Layer;
    5153import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     54import org.openstreetmap.josm.gui.util.GuiHelper;
    5255import org.openstreetmap.josm.tools.ImageProvider;
    5356import org.openstreetmap.josm.tools.Pair;
     
    440443            selectPrims(NavigatableComponent.asColl(toSelect), false, false);
    441444            useLastMoveCommandIfPossible();
     445            // Schedule a timer to update status line "initialMoveDelay+1" ms in the future
     446            GuiHelper.scheduleTimer(initialMoveDelay+1, new ActionListener() {
     447                public void actionPerformed(ActionEvent evt) {
     448                    updateStatusLine();
     449                }
     450            }, false);
    442451            break;
    443452        case select:
     
    853862    @Override
    854863    public String getModeHelpText() {
    855         if (mode == Mode.select && mouseDownButton == MouseEvent.BUTTON1 && mouseReleaseTime < mouseDownTime)
    856             return tr("Release the mouse button to select the objects in the rectangle.");
    857         else if (mode == Mode.move) {
    858             final boolean canMerge = getCurrentDataSet()!=null && !getCurrentDataSet().getSelectedNodes().isEmpty();
    859             final String mergeHelp = canMerge ? (" " + tr("Ctrl to merge with nearest node.")) : "";
    860             return tr("Release the mouse button to stop moving.") + mergeHelp;
    861         } else if (mode == Mode.rotate)
    862             return tr("Release the mouse button to stop rotating.");
    863         else if (mode == Mode.scale)
    864             return tr("Release the mouse button to stop scaling.");
    865         else
    866             return tr("Move objects by dragging; Shift to add to selection (Ctrl to toggle); Shift-Ctrl to rotate selected; Alt-Ctrl to scale selected; or change selection");
     864        if (mouseDownButton == MouseEvent.BUTTON1 && mouseReleaseTime < mouseDownTime) {
     865            if (mode == Mode.select)
     866                return tr("Release the mouse button to select the objects in the rectangle.");
     867            else if (mode == Mode.move && (System.currentTimeMillis() - mouseDownTime >= initialMoveDelay)) {
     868                final boolean canMerge = getCurrentDataSet()!=null && !getCurrentDataSet().getSelectedNodes().isEmpty();
     869                final String mergeHelp = canMerge ? (" " + tr("Ctrl to merge with nearest node.")) : "";
     870                return tr("Release the mouse button to stop moving.") + mergeHelp;
     871            } else if (mode == Mode.rotate)
     872                return tr("Release the mouse button to stop rotating.");
     873            else if (mode == Mode.scale)
     874                return tr("Release the mouse button to stop scaling.");
     875        }
     876        return tr("Move objects by dragging; Shift to add to selection (Ctrl to toggle); Shift-Ctrl to rotate selected; Alt-Ctrl to scale selected; or change selection");
    867877    }
    868878
Note: See TracChangeset for help on using the changeset viewer.