Changeset 9450 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-14T19:26:02+01:00 (9 years ago)
Author:
stoecker
Message:

see #12191, only color code the changed part - possible improvement: with a bit more logic changed keys with unchanged values could be detected and added into one line instead of a replace/add pair (e.g. key-typo fixes)

File:
1 edited

Legend:

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

    r9223 r9450  
    2626    }
    2727
    28     protected void setBackgroundReadable(String key, HistoryBrowserModel.TagTableModel model, boolean isSelected) {
     28    protected void setBackgroundReadable(String key, HistoryBrowserModel.TagTableModel model, boolean isSelected, boolean isValue) {
    2929        Color bgColor = UIManager.getColor("Table.background");
    3030        if (!model.hasTag(key) && model.isCurrentPointInTime()
     
    3434                || !model.hasTag(key) && model.isReferencePointInTime()) {
    3535            bgColor = TwoColumnDiff.Item.DiffItemType.INSERTED.getColor();
    36         } else if (model.hasTag(key) && model.oppositeHasTag(key) && !model.hasSameValueAsOpposite(key)) {
     36        } else if (isValue && model.hasTag(key) && model.oppositeHasTag(key) && !model.hasSameValueAsOpposite(key)) {
    3737            bgColor = TwoColumnDiff.Item.DiffItemType.CHANGED.getColor();
    3838        }
     
    5959            setText(model.hasTag(key) ? key : "");
    6060            setToolTipText(getText());
    61             setBackgroundReadable(key, model, isSelected);
     61            setBackgroundReadable(key, model, isSelected, false);
    6262            break;
    6363        case 1:
     
    6565            setText(model.hasTag(key) ? model.getValue(key) : "");
    6666            setToolTipText(getText());
    67             setBackgroundReadable(key, model, isSelected);
     67            setBackgroundReadable(key, model, isSelected, true);
    6868            break;
    6969        }
Note: See TracChangeset for help on using the changeset viewer.