org.openstreetmap.josm.command
Class RelationMemberConflictResolverCommand

java.lang.Object
  extended by org.openstreetmap.josm.command.PseudoCommand
      extended by org.openstreetmap.josm.command.Command
          extended by org.openstreetmap.josm.command.RelationMemberConflictResolverCommand

public class RelationMemberConflictResolverCommand
extends Command

Represent a command for resolving conflicts in the member lists of two Relations.


Field Summary
private  OsmDataLayer layer
          the layer this conflict is resolved in
private  java.util.List<RelationMember> mergedMembers
          the list of merged nodes.
private  Relation my
          my relation
private  Relation their
          their relation
 
Constructor Summary
RelationMemberConflictResolverCommand(Relation my, Relation their, java.util.List<RelationMember> mergedMembers)
           
 
Method Summary
 boolean executeCommand()
          Executes the command on the dataset.
 void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
          Fill in the changed data this command operates on.
 javax.swing.Icon getDescriptionIcon()
          Provides a descriptive icon of this command.
 java.lang.String getDescriptionText()
          Provides a description text representing this command.
 void undoCommand()
          Undoes the command.
 
Methods inherited from class org.openstreetmap.josm.command.Command
checkAndConfirmOutlyingOperation, getLayer, getOrig, getParticipatingPrimitives, invalidBecauselayerRemoved
 
Methods inherited from class org.openstreetmap.josm.command.PseudoCommand
getChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

my

private final Relation my
my relation


their

private final Relation their
their relation


mergedMembers

private final java.util.List<RelationMember> mergedMembers
the list of merged nodes. This becomes the list of news of my way after the command is executed


layer

private OsmDataLayer layer
the layer this conflict is resolved in

Constructor Detail

RelationMemberConflictResolverCommand

public RelationMemberConflictResolverCommand(Relation my,
                                             Relation their,
                                             java.util.List<RelationMember> mergedMembers)
Parameters:
my - my relation
their - their relation
mergedNodeList - the list of merged relation members
Method Detail

getDescriptionText

public java.lang.String getDescriptionText()
Description copied from class: PseudoCommand
Provides a description text representing this command.

Specified by:
getDescriptionText in class PseudoCommand

getDescriptionIcon

public javax.swing.Icon getDescriptionIcon()
Description copied from class: PseudoCommand
Provides a descriptive icon of this command.

Overrides:
getDescriptionIcon in class PseudoCommand

executeCommand

public boolean executeCommand()
Description copied from class: Command
Executes the command on the dataset. This implementation will remember all primitives returned by fillModifiedData for restoring them on undo.

Overrides:
executeCommand in class Command

fillModifiedData

public void fillModifiedData(java.util.Collection<OsmPrimitive> modified,
                             java.util.Collection<OsmPrimitive> deleted,
                             java.util.Collection<OsmPrimitive> added)
Description copied from class: Command
Fill in the changed data this command operates on. Add to the lists, don't clear them.

Specified by:
fillModifiedData in class Command
Parameters:
modified - The modified primitives
deleted - The deleted primitives
added - The added primitives

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