public class RelationMemberConflictResolverModel extends javax.swing.table.DefaultTableModel
TableModel
.Modifier and Type | Field and Description |
---|---|
protected java.util.List<RelationMemberConflictDecision> |
decisions
the list of conflict decisions
|
static java.lang.String |
NUM_CONFLICTS_PROP
the property name for the number conflicts managed by this model
|
private int |
numConflicts
the number of conflicts
|
protected java.util.Collection<? extends OsmPrimitive> |
primitives
the collection of primitives for which we manage conflicts
|
protected java.util.Collection<Relation> |
relations
the collection of relations for which we manage conflicts
|
private java.beans.PropertyChangeSupport |
support |
Constructor and Description |
---|
RelationMemberConflictResolverModel() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l) |
void |
applyRole(java.lang.String role)
Apply a role to all member managed by this model.
|
java.util.List<Command> |
buildResolutionCommands(OsmPrimitive newPrimitive)
Builds a collection of commands executing the decisions made in this model.
|
protected Command |
buildResolveCommand(Relation relation,
OsmPrimitive newPrimitive) |
RelationMemberConflictDecision |
getDecision(int row)
Replies the decision at position
row |
protected RelationMemberConflictDecision |
getDecision(Relation relation,
int pos) |
java.util.Set<Relation> |
getModifiedRelations(OsmPrimitive newPrimitive)
Replies the set of relations which have to be modified according
to the decisions managed by this model.
|
int |
getNumConflicts()
Replies the current number of conflicts
|
int |
getNumDecisions()
Replies the number of decisions managed by this model
|
protected java.lang.String |
getProperty() |
int |
getRowCount() |
java.lang.Object |
getValueAt(int row,
int column) |
protected boolean |
isChanged(Relation relation,
OsmPrimitive newPrimitive) |
(package private) static boolean |
isCollectionOfConsecutiveNumbers(java.util.Collection<java.lang.Integer> numbers) |
boolean |
isResolvedCompletely()
Replies true if each
MultiValueResolutionDecision is decided. |
void |
populate(java.util.Collection<Relation> relations,
java.util.Collection<? extends OsmPrimitive> memberPrimitives)
Populates the model with the relation members belonging to one of the relations in
relations
and referring to one of the primitives in memberPrimitives . |
void |
populate(java.util.Collection<RelationToChildReference> references)
Populates the model with the relation members represented as a collection of
RelationToChildReference s. |
protected void |
populate(Relation relation,
OsmPrimitive primitive)
Populates the model with the members of the relation
relation
referring to primitive . |
void |
prepareDefaultRelationDecisions()
Prepare the default decisions for the current model.
|
void |
refresh()
Refreshes the model state.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l) |
void |
setValueAt(java.lang.Object value,
int row,
int column) |
protected void |
updateNumConflicts()
Updates the current number of conflicts from list of decisions and emits
a property change event if necessary.
|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
public static final java.lang.String NUM_CONFLICTS_PROP
protected final transient java.util.List<RelationMemberConflictDecision> decisions
protected transient java.util.Collection<Relation> relations
protected transient java.util.Collection<? extends OsmPrimitive> primitives
private int numConflicts
private final java.beans.PropertyChangeSupport support
public RelationMemberConflictResolverModel()
public boolean isResolvedCompletely()
MultiValueResolutionDecision
is decided.MultiValueResolutionDecision
is decided; false otherwisepublic int getNumConflicts()
protected void updateNumConflicts()
protected java.lang.String getProperty()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
getRowCount
in class javax.swing.table.DefaultTableModel
public java.lang.Object getValueAt(int row, int column)
getValueAt
in interface javax.swing.table.TableModel
getValueAt
in class javax.swing.table.DefaultTableModel
public void setValueAt(java.lang.Object value, int row, int column)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.DefaultTableModel
protected void populate(Relation relation, OsmPrimitive primitive)
relation
referring to primitive
.relation
- the parent relationprimitive
- the child primitivepublic void populate(java.util.Collection<Relation> relations, java.util.Collection<? extends OsmPrimitive> memberPrimitives)
relations
and referring to one of the primitives in memberPrimitives
.relations
- the parent relations. Empty list assumed if null.memberPrimitives
- the child primitives. Empty list assumed if null.public void populate(java.util.Collection<RelationToChildReference> references)
RelationToChildReference
s.references
- the references. Empty list assumed if null.public void prepareDefaultRelationDecisions()
static boolean isCollectionOfConsecutiveNumbers(java.util.Collection<java.lang.Integer> numbers)
public RelationMemberConflictDecision getDecision(int row)
row
row
- positionrow
public int getNumDecisions()
public void refresh()
public void applyRole(java.lang.String role)
role
- the role. Empty string assumed if null.protected RelationMemberConflictDecision getDecision(Relation relation, int pos)
protected Command buildResolveCommand(Relation relation, OsmPrimitive newPrimitive)
public java.util.List<Command> buildResolutionCommands(OsmPrimitive newPrimitive)
newPrimitive
- the primitive which members shall refer toprotected boolean isChanged(Relation relation, OsmPrimitive newPrimitive)
public java.util.Set<Relation> getModifiedRelations(OsmPrimitive newPrimitive)
newPrimitive
- the primitive which members shall refer to