org.openstreetmap.josm.gui.conflict.pair.relation
Class RelationMemberListMergeModel

java.lang.Object
  extended by java.util.Observable
      extended by org.openstreetmap.josm.gui.conflict.pair.ListMergeModel<RelationMember>
          extended by org.openstreetmap.josm.gui.conflict.pair.relation.RelationMemberListMergeModel

public class RelationMemberListMergeModel
extends ListMergeModel<RelationMember>

The model for merging two lists of relation members


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.conflict.pair.ListMergeModel
ListMergeModel.ComparePairListModel, ListMergeModel.EntriesSelectionModel, ListMergeModel.EntriesTableModel
 
Field Summary
 
Fields inherited from class org.openstreetmap.josm.gui.conflict.pair.ListMergeModel
entries, FROZEN_PROP, mergedEntriesSelectionModel, mergedEntriesTableModel, myEntriesSelectionModel, myEntriesTableModel, theirEntriesSelectionModel, theirEntriesTableModel
 
Constructor Summary
RelationMemberListMergeModel()
           
 
Method Summary
protected  void buildMergedEntriesTableModel()
           
 RelationMemberConflictResolverCommand buildResolveCommand(Relation my, Relation their)
          Builds the command to resolve conflicts in the node list of a way
protected  RelationMember cloneEntryForMergedList(RelationMember entry)
          Creates a clone of an entry of type T suitable to be included in the list of merged entries
 OsmPrimitive getMyPrimitive(RelationMember entry)
           
 boolean isEqualEntry(RelationMember e1, RelationMember e2)
          checks whether two entries are equal.
 void populate(Relation my, Relation their, java.util.Map<PrimitiveId,PrimitiveId> mergedMap)
          populates the model with the relation members in relation my and their
protected  void setValueAt(javax.swing.table.DefaultTableModel model, java.lang.Object value, int row, int col)
          Handles method dispatches from ListMergeModel.EntriesTableModel.setValueAt(Object, int, int).
 
Methods inherited from class org.openstreetmap.josm.gui.conflict.pair.ListMergeModel
addPropertyChangeListener, alertCopyFailedForDeletedPrimitives, buildMyEntriesTableModel, buildTheirEntriesTableModel, clearMerged, copyAfterCurrent, copyAll, copyBeforeCurrent, copyMyAfterCurrent, copyMyBeforeCurrent, copyMyToEnd, copyMyToTop, copyTheirAfterCurrent, copyTheirBeforeCurrent, copyTheirToEnd, copyTheirToTop, copyToEnd, copyToTop, fireFrozenChanged, fireModelDataChanged, getComparePairListModel, getMergedEntries, getMergedEntriesSize, getMergedSelectionModel, getMergedTableModel, getMyEntries, getMyEntriesSize, getMyPrimitiveById, getMySelectionModel, getMyTableModel, getTheirEntries, getTheirEntriesSize, getTheirSelectionModel, getTheirTableModel, initPopulate, isFrozen, moveDownMerged, moveUpMerged, myAndTheirEntriesEqual, removeMerged, removePropertyChangeListener, setFrozen
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationMemberListMergeModel

public RelationMemberListMergeModel()
Method Detail

isEqualEntry

public boolean isEqualEntry(RelationMember e1,
                            RelationMember e2)
Description copied from class: ListMergeModel
checks whether two entries are equal. This is not necessarily the same as e1.equals(e2).

Specified by:
isEqualEntry in class ListMergeModel<RelationMember>
Parameters:
e1 - the first entry
e2 - the second entry
Returns:
true, if the entries are equal, false otherwise.

buildMergedEntriesTableModel

protected void buildMergedEntriesTableModel()
Overrides:
buildMergedEntriesTableModel in class ListMergeModel<RelationMember>

setValueAt

protected void setValueAt(javax.swing.table.DefaultTableModel model,
                          java.lang.Object value,
                          int row,
                          int col)
Description copied from class: ListMergeModel
Handles method dispatches from ListMergeModel.EntriesTableModel.setValueAt(Object, int, int).

Specified by:
setValueAt in class ListMergeModel<RelationMember>
Parameters:
model - the table model
value - the value to be set
row - the row index
col - the column index
See Also:
ListMergeModel.EntriesTableModel.setValueAt(Object, int, int)

populate

public void populate(Relation my,
                     Relation their,
                     java.util.Map<PrimitiveId,PrimitiveId> mergedMap)
populates the model with the relation members in relation my and their

Parameters:
my - my relation. Must not be null.
their - their relation. Must not be null.
mergedMap - The map of merged primitives if the conflict results from merging two layers
Throws:
java.lang.IllegalArgumentException - if my is null
java.lang.IllegalArgumentException - if their is null

cloneEntryForMergedList

protected RelationMember cloneEntryForMergedList(RelationMember entry)
Description copied from class: ListMergeModel
Creates a clone of an entry of type T suitable to be included in the list of merged entries

Specified by:
cloneEntryForMergedList in class ListMergeModel<RelationMember>
Parameters:
entry - the entry
Returns:
the cloned entry

getMyPrimitive

public OsmPrimitive getMyPrimitive(RelationMember entry)
Overrides:
getMyPrimitive in class ListMergeModel<RelationMember>
Returns:
Primitive from my dataset referenced by entry

buildResolveCommand

public RelationMemberConflictResolverCommand buildResolveCommand(Relation my,
                                                                 Relation their)
Builds the command to resolve conflicts in the node list of a way

Parameters:
my - my relation. Must not be null.
their - their relation. Must not be null
Returns:
the command
Throws:
java.lang.IllegalArgumentException - thrown, if my is null
java.lang.IllegalArgumentException - thrown, if their is null
java.lang.IllegalStateException - thrown, if the merge is not yet frozen


JOSM