Class PropertiesMergeModel
java.lang.Object
org.openstreetmap.josm.gui.util.ChangeNotifier
org.openstreetmap.josm.gui.conflict.pair.properties.PropertiesMergeModel
This is the model for resolving conflicts in the properties of the
OsmPrimitives. In particular, it represents conflicts in the coordinates of Nodes and
the deleted or visible state of OsmPrimitives.
This model is a ChangeNotifier. It notifies registered ChangeListeners whenever the
internal state changes.
This model also emits property changes for RESOLVED_COMPLETELY_PROP. Property change
listeners may register themselves using addPropertyChangeListener(PropertyChangeListener).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MergeDecisionTypestatic final Stringprivate MergeDecisionTypeprivate OsmPrimitiveprivate LatLonprivate booleanprivate List<OsmPrimitive>static final Stringprivate Booleanprivate final PropertyChangeSupportprivate LatLonprivate booleanprivate List<OsmPrimitive> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildResolveCommand(Conflict<? extends OsmPrimitive> conflict) Builds the command(s) to apply the conflict resolutions to my primitivevoiddecideCoordsConflict(MergeDecisionType decision) Decides a conflict between local and server coordinatesvoiddecideDeletedStateConflict(MergeDecisionType decision) decides the conflict between two deleted statesvoidreplies the coordinates of the mergedOsmPrimitive.Replies deleted state of combined datasetprivate booleangetMergedDeletedState(MergeDecisionType decision) replies the coordinates of myOsmPrimitive.Replies deleted state of local datasetReturns local referrersreplies the coordinates of theirOsmPrimitive.Replies deleted state of Server datasetReturns server referrersbooleanreplies true if my and their primitive have a conflict between their coordinate valuesbooleanreplies true if my and their primitive have a conflict between their deleted statesbooleanisCoordMergeDecision(MergeDecisionType decision) replies true if the current decision for the coordinate conflict isdecisionbooleanreplies true if there is a coordinate conflict and if this conflict is resolvedbooleanreplies true if there is a conflict in the deleted state and if this conflict is resolvedbooleanisDeletedStateDecision(MergeDecisionType decision) replies true if the current decision for the deleted state conflict isdecisionbooleanreplies true if all conflict in this model are resolvedvoidpopulate(Conflict<? extends OsmPrimitive> conflict) Populates the model with the differences between local and server versionvoidMethods inherited from class org.openstreetmap.josm.gui.util.ChangeNotifier
addChangeListener, fireStateChanged, removeChangeListener
-
Field Details
-
RESOLVED_COMPLETELY_PROP
-
DELETE_PRIMITIVE_PROP
-
my
-
myCoords
-
theirCoords
-
coordMergeDecision
-
myDeletedState
-
theirDeletedState
-
myReferrers
-
theirReferrers
-
deletedMergeDecision
-
support
-
resolvedCompletely
-
-
Constructor Details
-
PropertiesMergeModel
public PropertiesMergeModel()Constructs a newPropertiesMergeModel.
-
-
Method Details
-
addPropertyChangeListener
-
removePropertyChangeListener
-
fireCompletelyResolved
-
isDecidedCoord
replies true if there is a coordinate conflict and if this conflict is resolved- Returns:
- true if there is a coordinate conflict and if this conflict is resolved; false, otherwise
-
isDecidedDeletedState
replies true if there is a conflict in the deleted state and if this conflict is resolved- Returns:
- true if there is a conflict in the deleted state and if this conflict is resolved; false, otherwise
-
isCoordMergeDecision
replies true if the current decision for the coordinate conflict isdecision- Parameters:
decision- conflict resolution decision- Returns:
- true if the current decision for the coordinate conflict is
decision; false, otherwise
-
isDeletedStateDecision
replies true if the current decision for the deleted state conflict isdecision- Parameters:
decision- conflict resolution decision- Returns:
- true if the current decision for the deleted state conflict is
decision; false, otherwise
-
populate
Populates the model with the differences between local and server version- Parameters:
conflict- The conflict information
-
getMyCoords
replies the coordinates of myOsmPrimitive. null, if my primitive hasn't coordinates (i.e. because it is aWay).- Returns:
- the coordinates of my
OsmPrimitive. null, if my primitive hasn't coordinates (i.e. because it is aWay).
-
getTheirCoords
replies the coordinates of theirOsmPrimitive. null, if their primitive hasn't coordinates (i.e. because it is aWay).- Returns:
- the coordinates of my
OsmPrimitive. null, if my primitive hasn't coordinates (i.e. because it is aWay).
-
getMergedCoords
replies the coordinates of the mergedOsmPrimitive. null, if the current primitives have no coordinates or if the conflict is yetMergeDecisionType.UNDECIDED- Returns:
- the coordinates of the merged
OsmPrimitive. null, if the current primitives have no coordinates or if the conflict is yetMergeDecisionType.UNDECIDED
-
decideCoordsConflict
Decides a conflict between local and server coordinates- Parameters:
decision- the decision
-
getMyDeletedState
Replies deleted state of local dataset- Returns:
- The state of deleted flag
-
getTheirDeletedState
Replies deleted state of Server dataset- Returns:
- The state of deleted flag
-
getMergedDeletedState
Replies deleted state of combined dataset- Returns:
- The state of deleted flag
-
getMyReferrers
Returns local referrers- Returns:
- The referrers
-
getTheirReferrers
Returns server referrers- Returns:
- The referrers
-
getMergedDeletedState
-
decideDeletedStateConflict
decides the conflict between two deleted states- Parameters:
decision- the decision (must not be null)- Throws:
IllegalArgumentException- if decision is null
-
hasCoordConflict
replies true if my and their primitive have a conflict between their coordinate values- Returns:
- true if my and their primitive have a conflict between their coordinate values; false otherwise
-
hasDeletedStateConflict
replies true if my and their primitive have a conflict between their deleted states- Returns:
trueif my and their primitive have a conflict between their deleted states
-
isResolvedCompletely
replies true if all conflict in this model are resolved- Returns:
trueif all conflict in this model are resolved;falseotherwise
-
buildResolveCommand
Builds the command(s) to apply the conflict resolutions to my primitive- Parameters:
conflict- The conflict information- Returns:
- The list of commands
-
getMyPrimitive
-