Ignore:
Timestamp:
2015-08-31T19:39:14+02:00 (4 years ago)
Author:
simon04
Message:

see #11819 - History dialog: show reversed nodes in yellow, show explanatory tooltip on column header

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r8510 r8702  
    100100                        reversed = model.isReversed();
    101101                        columnModel.getColumn(0).setHeaderValue(reversed ? reversedText : nonReversedText);
     102                        table.getTableHeader().setToolTipText(
     103                                reversed ? tr("The nodes of this way are in reverse order") : null);
    102104                        table.getTableHeader().repaint();
    103105                    }
  • trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java

    r8674 r8702  
    3535            DELETED(new Color(255, 197, 197)),
    3636            CHANGED(new Color(255, 234, 213)),
     37            REVERSED(new Color(255, 255, 204)),
    3738            SAME(new Color(234, 234, 234)),
    3839            EMPTY(new Color(234, 234, 234));
     
    8081                || script != null && scriptReversed.deleted + scriptReversed.inserted < script.deleted + script.inserted) {
    8182            this.referenceReversed = true;
    82             twoColumnDiffFromScript(scriptReversed, referenceReversed, current);
     83            twoColumnDiffFromScript(scriptReversed, referenceReversed, current, true);
    8384        } else {
    8485            this.referenceReversed = false;
    85             twoColumnDiffFromScript(script, reference, current);
     86            twoColumnDiffFromScript(script, reference, current, false);
    8687        }
    8788    }
     
    9192     * This method expands this script into a full two column description.
    9293     */
    93     private void twoColumnDiffFromScript(Diff.Change script, Object[] a, Object[] b) {
     94    private void twoColumnDiffFromScript(Diff.Change script, Object[] a, Object[] b, final boolean reversed) {
    9495        int ia = 0;
    9596        int ib = 0;
     
    99100            int inserted = script.inserted;
    100101            while (ia < script.line0 && ib < script.line1) {
    101                 Item cell = new Item(DiffItemType.SAME, a[ia]);
    102                 referenceDiff.add(cell);
    103                 currentDiff.add(cell);
    104                 ia++;
    105                 ib++;
     102                referenceDiff.add(new Item(reversed ? DiffItemType.REVERSED : DiffItemType.SAME, a[ia++]));
     103                currentDiff.add(new Item(DiffItemType.SAME, b[ib++]));
    106104            }
    107105
     
    123121        }
    124122        while (ia < a.length && ib < b.length) {
    125             referenceDiff.add(new Item(DiffItemType.SAME, a[ia++]));
     123            referenceDiff.add(new Item(reversed ? DiffItemType.REVERSED : DiffItemType.SAME, a[ia++]));
    126124            currentDiff.add(new Item(DiffItemType.SAME, b[ib++]));
    127125        }
Note: See TracChangeset for help on using the changeset viewer.