org.openstreetmap.josm.command
Class ConflictResolveCommand

java.lang.Object
  extended by org.openstreetmap.josm.command.PseudoCommand
      extended by org.openstreetmap.josm.command.Command
          extended by org.openstreetmap.josm.command.ConflictResolveCommand
Direct Known Subclasses:
CoordinateConflictResolveCommand, DeletedStateConflictResolveCommand, ModifiedConflictResolveCommand, TagConflictResolveCommand, VersionConflictResolveCommand, WayNodesConflictResolverCommand

public abstract class ConflictResolveCommand
extends Command

This is the common base class for Commands which manipulate Conflicts in addition to OsmPrimitives. A ConflictResolverCommand can remember a collection of conflicts it resolves. Upon undoing it reconstitutes them.


Field Summary
private  ConflictCollection resolvedConflicts
          the list of resolved conflicts
 
Constructor Summary
ConflictResolveCommand()
           
ConflictResolveCommand(OsmDataLayer layer)
           
 
Method Summary
protected  void reconstituteConflicts()
          reconstitutes all remembered conflicts.
protected  void rememberConflict(Conflict<?> c)
          remembers a conflict in the internal list of remembered conflicts
 void undoCommand()
          Undoes the command.
 
Methods inherited from class org.openstreetmap.josm.command.Command
checkAndConfirmOutlyingOperation, executeCommand, fillModifiedData, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved
 
Methods inherited from class org.openstreetmap.josm.command.PseudoCommand
getChildren, getDescriptionIcon, getDescriptionText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resolvedConflicts

private ConflictCollection resolvedConflicts
the list of resolved conflicts

Constructor Detail

ConflictResolveCommand

public ConflictResolveCommand()

ConflictResolveCommand

public ConflictResolveCommand(OsmDataLayer layer)
Method Detail

rememberConflict

protected void rememberConflict(Conflict<?> c)
remembers a conflict in the internal list of remembered conflicts

Parameters:
c - the remembered conflict

reconstituteConflicts

protected void reconstituteConflicts()
reconstitutes all remembered conflicts. Add the remembered conflicts to the set of conflicts of the OsmDataLayer this command was applied to.


undoCommand

public void undoCommand()
Description copied from class: Command
Undoes the command. It can be assumed that all objects are in the same state they were before. It can also be assumed that executeCommand was called exactly once before. This implementation undoes all objects stored by a former call to executeCommand.

Overrides:
undoCommand in class Command


JOSM