Changeset 10220 in josm for trunk/src


Ignore:
Timestamp:
2016-05-15T19:51:21+02:00 (8 years ago)
Author:
Don-vip
Message:

add new icons for ParallelWayAction + findbugs - DB_DUPLICATE_BRANCHES

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

Legend:

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

    r10152 r10220  
    5555 * 4. Visual cues could be better
    5656 *
    57  * 5. Cursors (Half-done)
    58  *
    59  * 6. (long term) Parallelize and adjust offsets of existing ways
     57 * 5. (long term) Parallelize and adjust offsets of existing ways
    6058 *
    6159 * == Code quality ==
     
    8381
    8482    private enum Mode {
    85         dragging, normal
     83        DRAGGING, NORMAL
    8684    }
    8785
     
    145143    public void enterMode() {
    146144        // super.enterMode() updates the status line and cursor so we need our state to be set correctly
    147         setMode(Mode.normal);
     145        setMode(Mode.NORMAL);
    148146        pWays = null;
    149147        updateAllPreferences(); // All default values should've been set now
     
    190188        // TODO: dynamic messages based on preferences. (Could be problematic translation wise)
    191189        switch (mode) {
    192         case normal:
     190        case NORMAL:
    193191            // CHECKSTYLE.OFF: LineLength
    194192            return tr("Select ways as in Select mode. Drag selected ways or a single way to create a parallel copy (Alt toggles tag preservation)");
    195193            // CHECKSTYLE.ON: LineLength
    196         case dragging:
     194        case DRAGGING:
    197195            return tr("Hold Ctrl to toggle snapping");
    198196        }
     
    203201    private void updateAllPreferences() {
    204202        updateModeLocalPreferences();
    205         // @formatter:off
    206         // @formatter:on
    207203    }
    208204
     
    252248        Cursor newCursor = null;
    253249        switch (mode) {
    254         case normal:
     250        case NORMAL:
    255251            if (matchesCurrentModifiers(setSelectedModifierCombo)) {
    256252                newCursor = ImageProvider.getCursor("normal", "parallel");
    257253            } else if (matchesCurrentModifiers(addToSelectionModifierCombo)) {
    258                 newCursor = ImageProvider.getCursor("normal", "parallel"); // FIXME
     254                newCursor = ImageProvider.getCursor("normal", "parallel_add");
    259255            } else if (matchesCurrentModifiers(toggleSelectedModifierCombo)) {
    260                 newCursor = ImageProvider.getCursor("normal", "parallel"); // FIXME
    261             } else if (Main.isDebugEnabled()) {
    262                 // TODO: set to a cursor indicating an error
    263                 Main.debug("TODO: set an error cursor");
     256                newCursor = ImageProvider.getCursor("normal", "parallel_remove");
    264257            }
    265258            break;
    266         case dragging:
    267             if (snap) {
    268                 // TODO: snapping cursor?
    269                 newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);
    270             } else {
    271                 newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);
    272             }
     259        case DRAGGING:
     260            newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);
     261            break;
     262        default: throw new AssertionError();
    273263        }
    274264        if (newCursor != null) {
     
    352342                addSourceWay(nearestWay);
    353343            } // else -> invalid modifier combination
    354         } else if (mode == Mode.dragging) {
     344        } else if (mode == Mode.DRAGGING) {
    355345            clearSourceWays();
    356346        }
    357347
    358         setMode(Mode.normal);
     348        setMode(Mode.NORMAL);
    359349        resetMouseTrackingState();
    360350        mv.repaint();
     
    392382        mouseHasBeenDragged = true;
    393383
    394         if (mode == Mode.normal) {
     384        if (mode == Mode.NORMAL) {
    395385            // Should we ensure that the copyTags modifiers are still valid?
    396386
     
    401391            if (!initParallelWays(mousePressedPos, copyTags))
    402392                return;
    403             setMode(Mode.dragging);
     393            setMode(Mode.DRAGGING);
    404394        }
    405395
     
    465455    @Override
    466456    public void paint(Graphics2D g, MapView mv, Bounds bbox) {
    467         if (mode == Mode.dragging) {
     457        if (mode == Mode.DRAGGING) {
    468458            // sanity checks
    469459            if (mv == null)
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r10212 r10220  
    611611                this.value = value;
    612612
    613             } else if (caseSensitive) {
    614                 this.key = key;
    615                 this.value = value;
    616                 this.keyPattern = null;
    617                 this.valuePattern = null;
    618613            } else {
    619614                this.key = key;
Note: See TracChangeset for help on using the changeset viewer.