public class RelationMemberConflictResolverModel extends DefaultTableModel
TableModel
.Modifier and Type | Field and Description |
---|---|
protected List<RelationMemberConflictDecision> |
decisions
the list of conflict decisions
|
static String |
NUM_CONFLICTS_PROP
the property name for the number conflicts managed by this model
|
private int |
numConflicts
the number of conflicts
|
protected Collection<Relation> |
relations
the collection of relations for which we manage conflicts
|
private PropertyChangeSupport |
support |
columnIdentifiers, dataVector
listenerList
Constructor and Description |
---|
RelationMemberConflictResolverModel() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l) |
void |
applyRole(String role)
Apply a role to all member managed by this model.
|
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) |
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 String |
getProperty() |
int |
getRowCount() |
Object |
getValueAt(int row,
int column) |
protected boolean |
isChanged(Relation relation,
OsmPrimitive newPrimitive) |
boolean |
isResolvedCompletely()
Replies true if each
MultiValueResolutionDecision is decided. |
void |
populate(Collection<Relation> relations,
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(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 |
refresh()
Refreshes the model state.
|
void |
removePropertyChangeListener(PropertyChangeListener l) |
void |
setValueAt(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 String NUM_CONFLICTS_PROP
protected final List<RelationMemberConflictDecision> decisions
protected Collection<Relation> relations
private int numConflicts
private final PropertyChangeSupport support
public RelationMemberConflictResolverModel()
public boolean isResolvedCompletely()
MultiValueResolutionDecision
is decided.MultiValueResolutionDecision
is decided; false otherwisepublic int getNumConflicts()
protected void updateNumConflicts()
protected String getProperty()
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public int getRowCount()
getRowCount
in interface TableModel
getRowCount
in class DefaultTableModel
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
getValueAt
in class DefaultTableModel
public void setValueAt(Object value, int row, int column)
setValueAt
in interface TableModel
setValueAt
in class DefaultTableModel
protected void populate(Relation relation, OsmPrimitive primitive)
relation
referring to primitive
.relation
- the parent relationprimitive
- the child primitivepublic void populate(Collection<Relation> relations, 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(Collection<RelationToChildReference> references)
RelationToChildReference
s.references
- the references. Empty list assumed if null.public RelationMemberConflictDecision getDecision(int row)
row
row
- row
public int getNumDecisions()
public void refresh()
public void applyRole(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 List<Command> buildResolutionCommands(OsmPrimitive newPrimitive)
newPrimitive
- the primitive which members shall refer toprotected boolean isChanged(Relation relation, OsmPrimitive newPrimitive)
public Set<Relation> getModifiedRelations(OsmPrimitive newPrimitive)
newPrimitive
- the primitive which members shall refer to