Class NodeListMergeModel
- java.lang.Object
-
- org.openstreetmap.josm.gui.util.ChangeNotifier
-
- org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel<Node,WayNodesConflictResolverCommand>
-
- org.openstreetmap.josm.gui.conflict.pair.nodes.NodeListMergeModel
-
public class NodeListMergeModel extends AbstractListMergeModel<Node,WayNodesConflictResolverCommand>
The model for merging two lists of way nodes- Since:
- 1622
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel
AbstractListMergeModel.ComparePairListModel, AbstractListMergeModel.EntriesSelectionModel, AbstractListMergeModel.EntriesTableModel
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel
entries, FROZEN_PROP, mergedEntriesSelectionModel, mergedEntriesTableModel, myEntriesSelectionModel, myEntriesTableModel, theirEntriesSelectionModel, theirEntriesTableModel
-
-
Constructor Summary
Constructors Constructor Description NodeListMergeModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WayNodesConflictResolverCommand
buildResolveCommand(Conflict<? extends OsmPrimitive> conflict)
Builds the command to resolve conflicts in the list.protected Node
cloneEntryForMergedList(Node entry)
Creates a clone of an entry of type T suitable to be included in the list of merged entriesboolean
isEqualEntry(Node e1, Node e2)
checks whether two entries are equal.void
populate(Way my, Way their, Map<PrimitiveId,PrimitiveId> mergedMap)
protected void
setValueAt(DefaultTableModel model, Object value, int row, int col)
Handles method dispatches fromTableModel.setValueAt(Object, int, int)
.-
Methods inherited from class org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel
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 org.openstreetmap.josm.gui.util.ChangeNotifier
addChangeListener, fireStateChanged, removeChangeListener
-
-
-
-
Constructor Detail
-
NodeListMergeModel
public NodeListMergeModel()
-
-
Method Detail
-
populate
public void populate(Way my, Way their, Map<PrimitiveId,PrimitiveId> mergedMap)
- 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:
IllegalArgumentException
- if my is nullIllegalArgumentException
- if their is null
-
buildResolveCommand
public WayNodesConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict)
Description copied from class:AbstractListMergeModel
Builds the command to resolve conflicts in the list.- Specified by:
buildResolveCommand
in classAbstractListMergeModel<Node,WayNodesConflictResolverCommand>
- Parameters:
conflict
- the conflict data set- Returns:
- the command
-
isEqualEntry
public boolean isEqualEntry(Node e1, Node e2)
Description copied from class:AbstractListMergeModel
checks whether two entries are equal. This is not necessarily the same as e1.equals(e2).- Specified by:
isEqualEntry
in classAbstractListMergeModel<Node,WayNodesConflictResolverCommand>
- Parameters:
e1
- the first entrye2
- the second entry- Returns:
- true, if the entries are equal, false otherwise.
-
setValueAt
protected void setValueAt(DefaultTableModel model, Object value, int row, int col)
Description copied from class:AbstractListMergeModel
Handles method dispatches fromTableModel.setValueAt(Object, int, int)
.- Specified by:
setValueAt
in classAbstractListMergeModel<Node,WayNodesConflictResolverCommand>
- Parameters:
model
- the table modelvalue
- the value to be setrow
- the row indexcol
- the column index- See Also:
TableModel.setValueAt(Object, int, int)
-
cloneEntryForMergedList
protected Node cloneEntryForMergedList(Node entry)
Description copied from class:AbstractListMergeModel
Creates a clone of an entry of type T suitable to be included in the list of merged entries- Specified by:
cloneEntryForMergedList
in classAbstractListMergeModel<Node,WayNodesConflictResolverCommand>
- Parameters:
entry
- the entry- Returns:
- the cloned entry
-
-