Changeset 3034 in josm for trunk/src/org/openstreetmap/josm/gui/conflict
- Timestamp:
- 2010-02-23T08:58:12+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/conflict/pair
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java
r2945 r3034 19 19 import org.openstreetmap.josm.command.SequenceCommand; 20 20 import org.openstreetmap.josm.command.VersionConflictResolveCommand; 21 import org.openstreetmap.josm.data.conflict.Conflict; 21 22 import org.openstreetmap.josm.data.osm.Node; 22 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 77 78 private OsmPrimitive my; 78 79 private OsmPrimitive their; 80 private Conflict<? extends OsmPrimitive> conflict; 79 81 80 82 private ImageIcon mergeComplete; … … 228 230 * 229 231 */ 230 public void populate(OsmPrimitive my, OsmPrimitive their) { 231 setMy(my); 232 setTheir(their); 233 propertiesMerger.populate(my, their); 232 public void populate(Conflict<? extends OsmPrimitive> conflict) { 233 setMy(conflict.getMy()); 234 setTheir(conflict.getTheir()); 235 this.conflict = conflict; 236 propertiesMerger.populate(conflict); 234 237 if (propertiesMerger.getModel().hasVisibleStateConflict()) { 235 238 tabbedPane.setEnabledAt(1, false); … … 239 242 } 240 243 tabbedPane.setEnabledAt(0, true); 241 tagMerger.populate( my, their);244 tagMerger.populate(conflict); 242 245 tabbedPane.setEnabledAt(1, true); 243 246 … … 246 249 tabbedPane.setEnabledAt(3,false); 247 250 } else if (my instanceof Way) { 248 nodeListMerger.populate( my, their);251 nodeListMerger.populate(conflict); 249 252 tabbedPane.setEnabledAt(2, true); 250 253 tabbedPane.setEnabledAt(3, false); … … 252 255 tabbedPane.setIconAt(3, null); 253 256 } else if (my instanceof Relation) { 254 relationMemberMerger.populate( my, their);257 relationMemberMerger.populate(conflict); 255 258 tabbedPane.setEnabledAt(2, false); 256 259 tabbedPane.setTitleAt(2,tr("Nodes")); … … 271 274 if (propertiesMerger.getModel().hasVisibleStateConflict()) { 272 275 if (propertiesMerger.getModel().isDecidedVisibleState()) { 273 commands.addAll(propertiesMerger.getModel().buildResolveCommand( my, their));276 commands.addAll(propertiesMerger.getModel().buildResolveCommand(conflict)); 274 277 } 275 278 } else { 276 279 if (tagMerger.getModel().getNumResolvedConflicts() > 0) { 277 commands.add(tagMerger.getModel().buildResolveCommand( my, their));278 } 279 commands.addAll(propertiesMerger.getModel().buildResolveCommand( my, their));280 commands.add(tagMerger.getModel().buildResolveCommand(conflict)); 281 } 282 commands.addAll(propertiesMerger.getModel().buildResolveCommand(conflict)); 280 283 if (my instanceof Way && nodeListMerger.getModel().isFrozen()) { 281 284 NodeListMergeModel model =(NodeListMergeModel)nodeListMerger.getModel(); 282 commands.add(model.buildResolveCommand( (Way)my, (Way)their));285 commands.add(model.buildResolveCommand(conflict)); 283 286 } else if (my instanceof Relation && relationMemberMerger.getModel().isFrozen()) { 284 287 RelationMemberListMergeModel model =(RelationMemberListMergeModel)relationMemberMerger.getModel(); … … 286 289 } 287 290 if (isResolvedCompletely()) { 288 commands.add(new VersionConflictResolveCommand( my, their));289 commands.add(new ModifiedConflictResolveCommand( my, their));291 commands.add(new VersionConflictResolveCommand(conflict)); 292 commands.add(new ModifiedConflictResolveCommand(conflict)); 290 293 } 291 294 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/IConflictResolver.java
r2945 r3034 2 2 package org.openstreetmap.josm.gui.conflict.pair; 3 3 4 import org.openstreetmap.josm.data.conflict.Conflict; 4 5 import org.openstreetmap.josm.data.osm.OsmPrimitive; 5 6 … … 7 8 8 9 void deletePrimitive(boolean deleted); 9 void populate( OsmPrimitive my, OsmPrimitive their);10 void populate(Conflict<? extends OsmPrimitive> conflict); 10 11 11 12 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java
r2949 r3034 9 9 10 10 import org.openstreetmap.josm.command.WayNodesConflictResolverCommand; 11 import org.openstreetmap.josm.data.conflict.Conflict; 11 12 import org.openstreetmap.josm.data.osm.DataSet; 12 13 import org.openstreetmap.josm.data.osm.Node; … … 61 62 * @param their their way. Must not be null 62 63 * @return the command 63 * @exception IllegalArgumentException thrown, if my is null or not a {@see Way}64 * @exception IllegalArgumentException thrown, if their is null or not a {@see Way}65 64 * @exception IllegalStateException thrown, if the merge is not yet frozen 66 65 */ 67 public WayNodesConflictResolverCommand buildResolveCommand(Way my, Way their) { 68 CheckParameterUtil.ensureParameterNotNull(my, "my"); 69 CheckParameterUtil.ensureParameterNotNull(their, "their"); 66 public WayNodesConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) { 70 67 if (! isFrozen()) 71 68 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Cannot build resolution command.")); 72 return new WayNodesConflictResolverCommand( my, their, getMergedEntries());69 return new WayNodesConflictResolverCommand(conflict, getMergedEntries()); 73 70 } 74 71 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java
r2945 r3034 4 4 import javax.swing.JTable; 5 5 6 import org.openstreetmap.josm.data.conflict.Conflict; 6 7 import org.openstreetmap.josm.data.osm.Node; 7 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 63 64 } 64 65 65 public void populate( OsmPrimitive my, OsmPrimitive their) {66 ((NodeListMergeModel)model).populate((Way) my, (Way)their);66 public void populate(Conflict<? extends OsmPrimitive> conflict) { 67 ((NodeListMergeModel)model).populate((Way)conflict.getMy(), (Way)conflict.getTheir()); 67 68 } 68 69 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java
r2940 r3034 21 21 import org.openstreetmap.josm.command.PurgePrimitivesCommand; 22 22 import org.openstreetmap.josm.command.UndeletePrimitivesCommand; 23 import org.openstreetmap.josm.data.conflict.Conflict; 23 24 import org.openstreetmap.josm.data.coor.LatLon; 24 25 import org.openstreetmap.josm.data.osm.DataSet; … … 161 162 * @param their their version of the primitive 162 163 */ 163 public void populate(OsmPrimitive my, OsmPrimitive their) { 164 this.my = my; 164 public void populate(Conflict<? extends OsmPrimitive> conflict) { 165 this.my = conflict.getMy(); 166 OsmPrimitive their = conflict.getTheir(); 165 167 if (my instanceof Node) { 166 168 myCoords = ((Node)my).getCoor(); … … 171 173 } 172 174 173 myDeletedState = my.isDeleted();175 myDeletedState = conflict.isMyDeleted() || my.isDeleted(); 174 176 theirDeletedState = their.isDeleted(); 175 177 … … 418 420 * @return the list of commands 419 421 */ 420 public List<Command> buildResolveCommand(OsmPrimitive my, OsmPrimitive their) throws OperationCancelledException{ 421 ArrayList<Command> cmds = new ArrayList<Command>(); 422 public List<Command> buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) throws OperationCancelledException{ 423 OsmPrimitive my = conflict.getMy(); 424 List<Command> cmds = new ArrayList<Command>(); 422 425 if (hasVisibleStateConflict() && isDecidedVisibleState()) { 423 426 if (isVisibleStateDecision(MergeDecisionType.KEEP_MINE)) { … … 436 439 } 437 440 if (hasCoordConflict() && isDecidedCoord()) { 438 cmds.add(new CoordinateConflictResolveCommand( (Node)my, (Node)their, coordMergeDecision));441 cmds.add(new CoordinateConflictResolveCommand(conflict, coordMergeDecision)); 439 442 } 440 443 if (hasDeletedStateConflict() && isDecidedDeletedState()) { 441 cmds.add(new DeletedStateConflictResolveCommand( my, their, deletedMergeDecision));444 cmds.add(new DeletedStateConflictResolveCommand(conflict, deletedMergeDecision)); 442 445 } 443 446 return cmds; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
r2945 r3034 22 22 import javax.swing.JPanel; 23 23 24 import org.openstreetmap.josm.data.conflict.Conflict; 24 25 import org.openstreetmap.josm.data.coor.LatLon; 25 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 718 719 } 719 720 720 public void populate( OsmPrimitive my, OsmPrimitive their) {721 model.populate( my, their);721 public void populate(Conflict<? extends OsmPrimitive> conflict) { 722 model.populate(conflict); 722 723 } 723 724 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java
r2945 r3034 5 5 import javax.swing.JTable; 6 6 7 import org.openstreetmap.josm.data.conflict.Conflict; 7 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; 8 9 import org.openstreetmap.josm.data.osm.Relation; … … 54 55 } 55 56 56 public void populate( OsmPrimitive my, OsmPrimitive their) {57 public void populate(Conflict<? extends OsmPrimitive> conflict) { 57 58 RelationMemberListMergeModel model = (RelationMemberListMergeModel)getModel(); 58 model.populate((Relation) my, (Relation)their);59 model.populate((Relation)conflict.getMy(), (Relation)conflict.getTheir()); 59 60 } 60 61 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModel.java
r2945 r3034 12 12 13 13 import org.openstreetmap.josm.command.TagConflictResolveCommand; 14 import org.openstreetmap.josm.data.conflict.Conflict; 14 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 16 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; … … 189 190 } 190 191 191 public TagConflictResolveCommand buildResolveCommand( OsmPrimitive my, OsmPrimitive their) {192 return new TagConflictResolveCommand( my, their, tagMergeItems);192 public TagConflictResolveCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) { 193 return new TagConflictResolveCommand(conflict, tagMergeItems); 193 194 } 194 195 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
r2945 r3034 26 26 import javax.swing.event.ListSelectionListener; 27 27 28 import org.openstreetmap.josm.data.conflict.Conflict; 28 29 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 30 import org.openstreetmap.josm.gui.conflict.pair.IConflictResolver; … … 421 422 } 422 423 423 public void populate( OsmPrimitive my, OsmPrimitive their) {424 model.populate( my, their);424 public void populate(Conflict<? extends OsmPrimitive> conflict) { 425 model.populate(conflict.getMy(), conflict.getTheir()); 425 426 mineTable.getSelectionModel().setSelectionInterval(0, 0); 426 427 theirTable.getSelectionModel().setSelectionInterval(0, 0);
Note:
See TracChangeset
for help on using the changeset viewer.