Changeset 15729 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-01-19T12:11:15+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/conflict/tags
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionType.java
r12660 r15729 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import javax.swing.JLabel;7 5 8 6 /** … … 26 24 UNDECIDED; 27 25 28 /** 29 * Sets the label according to the current decision. 30 * @param decision The decision 31 * @param label The label to set 32 */ 33 public static void prepareLabel(RelationMemberConflictDecisionType decision, JLabel label) { 34 switch(decision) { 35 case REMOVE: 36 label.setText(tr("Remove")); 37 label.setToolTipText(tr("Remove this relation member from the relation")); 38 break; 39 case KEEP: 40 label.setText(tr("Keep")); 41 label.setToolTipText(tr("Keep this relation member for the target object")); 42 break; 43 case UNDECIDED: 44 label.setText(tr("Undecided")); 45 label.setToolTipText(tr("Not decided yet")); 46 break; 26 String getLabelText() { 27 switch (this) { 28 case REMOVE: 29 return tr("Remove"); 30 case KEEP: 31 return tr("Keep"); 32 case UNDECIDED: 33 default: 34 return tr("Undecided"); 35 } 36 } 37 38 String getLabelToolTipText() { 39 switch (this) { 40 case REMOVE: 41 return tr("Remove this relation member from the relation"); 42 case KEEP: 43 return tr("Keep this relation member for the target object"); 44 case UNDECIDED: 45 default: 46 return tr("Not decided yet"); 47 47 } 48 48 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
r13564 r15729 5 5 6 6 import java.awt.Component; 7 import java.util.EnumSet; 7 8 8 9 import javax.swing.JTable; … … 15 16 import org.openstreetmap.josm.gui.conflict.ConflictColors; 16 17 import org.openstreetmap.josm.gui.conflict.pair.relation.RelationMemberTable; 18 import org.openstreetmap.josm.gui.history.VersionTable; 17 19 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; 18 20 … … 73 75 74 76 AutoCompletingTextField roleEditor = new AutoCompletingTextField(0, false); 75 RelationMemberConflictDecisionRenderer decisionRenderer = new RelationMemberConflictDecisionRenderer();76 RelationMemberConflictDecisionEditor decisionEditor = new RelationMemberConflictDecisionEditor();77 77 78 78 // column 0 - Relation … … 114 114 addColumn(col); 115 115 116 // column 4 - New Way 117 col = new TableColumn(4); 118 col.setHeaderValue(tr("Decision")); 119 col.setResizable(true); 120 col.setCellRenderer(decisionRenderer); 121 col.setCellEditor(decisionEditor); 122 col.setWidth(100); 123 col.setPreferredWidth(100); 124 col.setMaxWidth(100); 125 addColumn(col); 116 // column 4 - decision keep 117 // column 5 - decision remove 118 int index = 4; 119 for (RelationMemberConflictDecisionType type : EnumSet.of( 120 RelationMemberConflictDecisionType.KEEP, RelationMemberConflictDecisionType.REMOVE)) { 121 col = new TableColumn(index); 122 col.setHeaderValue(type.getLabelText()); 123 col.setResizable(true); 124 final VersionTable.RadioButtonRenderer renderer = new VersionTable.RadioButtonRenderer(); 125 renderer.setToolTipText(type.getLabelToolTipText()); 126 col.setCellRenderer(renderer); 127 col.setCellEditor(new VersionTable.RadioButtonEditor()); 128 col.setWidth(50); 129 col.setPreferredWidth(50); 130 col.setMaxWidth(50); 131 addColumn(col); 132 index++; 133 } 126 134 } 127 135 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java
r11627 r15729 115 115 case 2: /* role */ return d.getRole(); 116 116 case 3: /* original */ return d.getOriginalPrimitive(); 117 case 4: /* decision */ return d.getDecision(); 117 case 4: /* decision keep */ return RelationMemberConflictDecisionType.KEEP.equals(d.getDecision()); 118 case 5: /* decision remove */ return RelationMemberConflictDecisionType.REMOVE.equals(d.getDecision()); 118 119 } 119 120 return null; … … 127 128 d.setRole((String) value); 128 129 break; 129 case 4: /* decision */ 130 d.decide((RelationMemberConflictDecisionType) value); 131 refresh(false); 130 case 4: /* decision keep */ 131 if (Boolean.TRUE.equals(value)) { 132 d.decide(RelationMemberConflictDecisionType.KEEP); 133 refresh(false); 134 } 135 break; 136 case 5: /* decision remove */ 137 if (Boolean.TRUE.equals(value)) { 138 d.decide(RelationMemberConflictDecisionType.REMOVE); 139 refresh(false); 140 } 132 141 break; 133 142 default: // Do nothing
Note:
See TracChangeset
for help on using the changeset viewer.