org.openstreetmap.josm.gui.conflict.pair.nodes
Class NodeListMergeModel

java.lang.Object
  extended by java.util.Observable
      extended by org.openstreetmap.josm.gui.conflict.pair.ListMergeModel<Node>
          extended by org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMergeModel

public class NodeListMergeModel
extends ListMergeModel<Node>


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
NodeListMergeModel()
           
 
Method Summary
 WayNodesConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict)
          Builds the command to resolve conflicts in the node list of a way
protected  Node cloneEntryForMergedList(Node entry)
          Creates a clone of an entry of type T suitable to be included in the list of merged entries
 boolean isEqualEntry(Node e1, Node e2)
          checks whether two entries are equal.
 void populate(Way my, Way their, java.util.Map<PrimitiveId,PrimitiveId> mergedMap)
          Populates the model with the nodes in the two Ways 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, buildMergedEntriesTableModel, 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, getMyPrimitive, 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

NodeListMergeModel

public NodeListMergeModel()
Method Detail

populate

public void populate(Way my,
                     Way their,
                     java.util.Map<PrimitiveId,PrimitiveId> mergedMap)
Populates the model with the nodes in the two Ways my and their.

Parameters:
my - my way (i.e. the way in the local dataset)
their - their way (i.e. the way in the server dataset)
mergedMap - The map of merged primitives if the conflict results from merging two layers
Throws:
java.lang.IllegalArgumentException - thrown, if my is null
java.lang.IllegalArgumentException - thrown, if their is null

buildResolveCommand

public WayNodesConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict)
Builds the command to resolve conflicts in the node list of a way

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

isEqualEntry

public boolean isEqualEntry(Node e1,
                            Node 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<Node>
Parameters:
e1 - the first entry
e2 - the second entry
Returns:
true, if the entries are equal, false otherwise.

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<Node>
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)

cloneEntryForMergedList

protected Node cloneEntryForMergedList(Node 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<Node>
Parameters:
entry - the entry
Returns:
the cloned entry


JOSM