Changeset 16458 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-05-17T23:02:27+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/history
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java
r12615 r16458 37 37 } 38 38 39 protected void renderNode(TwoColumnDiff.Item item, boolean isSelected ) {39 protected void renderNode(TwoColumnDiff.Item item, boolean isSelected, boolean hasFocus) { 40 40 String text = ""; 41 41 setIcon(nodeIcon); … … 43 43 text = tr("Node {0}", item.value.toString()); 44 44 } 45 Color bgColor = item.state.getColor();46 45 if (item.state == DiffItemType.EMPTY) { 47 46 text = ""; 48 47 setIcon(null); 49 48 } 50 if (isSelected) {51 bgColor = BGCOLOR_SELECTED;52 }53 49 setText(text); 54 GuiHelper.setBackgroundReadable(this, bgColor);50 GuiHelper.setBackgroundReadable(this, item.state.getColor(isSelected, hasFocus)); 55 51 } 56 52 … … 61 57 62 58 if (value != null) { 63 renderNode((TwoColumnDiff.Item) value, isSelected );59 renderNode((TwoColumnDiff.Item) value, isSelected, hasFocus); 64 60 } 65 61 return this; -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java
r14864 r16458 41 41 setText(text); 42 42 setToolTipText(text); 43 GuiHelper.setBackgroundReadable(this, diffItem.state.getColor());44 43 } 45 44 … … 57 56 setText(text); 58 57 setToolTipText(text); 59 GuiHelper.setBackgroundReadable(this, diffItem.state.getColor());60 58 } 61 59 … … 78 76 } 79 77 78 GuiHelper.setBackgroundReadable(this, member.state.getColor(isSelected, hasFocus)); 80 79 return this; 81 80 } -
trunk/src/org/openstreetmap/josm/gui/history/TagTableCellRenderer.java
r11647 r16458 7 7 import javax.swing.JLabel; 8 8 import javax.swing.JTable; 9 import javax.swing.UIManager;10 9 import javax.swing.table.TableCellRenderer; 11 10 … … 34 33 35 34 protected void setBackgroundReadable(String key, TagTableModel model, boolean isSelected, boolean hasFocus, boolean isValue) { 36 Color bgColor = UIManager.getColor("Table.background");35 final TwoColumnDiff.Item.DiffItemType diffItemType; 37 36 if ((!model.hasTag(key) && model.isCurrentPointInTime()) 38 37 || (!model.oppositeHasTag(key) && model.isReferencePointInTime())) { 39 bgColor = TwoColumnDiff.Item.DiffItemType.DELETED.getColor();38 diffItemType = TwoColumnDiff.Item.DiffItemType.DELETED; 40 39 } else if ((!model.oppositeHasTag(key) && model.isCurrentPointInTime()) 41 40 || (!model.hasTag(key) && model.isReferencePointInTime())) { 42 bgColor = TwoColumnDiff.Item.DiffItemType.INSERTED.getColor();41 diffItemType = TwoColumnDiff.Item.DiffItemType.INSERTED; 43 42 } else if (isValue && model.hasTag(key) && model.oppositeHasTag(key) && !model.hasSameValueAsOpposite(key)) { 44 bgColor = TwoColumnDiff.Item.DiffItemType.CHANGED.getColor(); 43 diffItemType = TwoColumnDiff.Item.DiffItemType.CHANGED; 44 } else { 45 diffItemType = TwoColumnDiff.Item.DiffItemType.EMPTY; 45 46 } 46 if (isSelected) { 47 if (hasFocus) { 48 bgColor = BGCOLOR_SELECTED_FOCUS; 49 } else { 50 bgColor = BGCOLOR_SELECTED; 51 } 52 } 53 54 GuiHelper.setBackgroundReadable(this, bgColor); 47 GuiHelper.setBackgroundReadable(this, diffItemType.getColor(isSelected, hasFocus)); 55 48 } 56 49 -
trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
r11747 r16458 46 46 public Color getColor() { 47 47 return color; 48 } 49 50 public Color getColor(boolean isSelected, boolean hasFocus) { 51 if (isSelected && hasFocus) { 52 return TagTableCellRenderer.BGCOLOR_SELECTED_FOCUS; 53 } else if (isSelected) { 54 return TagTableCellRenderer.BGCOLOR_SELECTED; 55 } else { 56 return getColor(); 57 } 48 58 } 49 59 }
Note:
See TracChangeset
for help on using the changeset viewer.