public class TagConflictResolverModel extends DefaultTableModel
Modifier and Type | Field and Description |
---|---|
private Map<String,MultiValueResolutionDecision> |
decisions |
private List<String> |
displayedKeys |
private Set<String> |
keysWithConflicts |
static String |
NUM_CONFLICTS_PROP |
private int |
numConflicts |
private boolean |
showTagsWithConflictsOnly |
private boolean |
showTagsWithMultiValuesOnly |
private PropertyChangeSupport |
support |
private TagCollection |
tags |
columnIdentifiers, dataVector
listenerList
Constructor and Description |
---|
TagConflictResolverModel()
Constructs a new
TagConflictResolverModel . |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
TagCollection |
getAllResolutions() |
MultiValueResolutionDecision |
getDecision(int row)
Returns the conflict resolution decision at the given row.
|
String |
getKey(int row)
Returns the OSM key at the given row.
|
Set<String> |
getKeysWithConflicts()
Returns the set of keys in conflict.
|
int |
getNumConflicts() |
int |
getNumDecisions() |
TagCollection |
getResolution() |
int |
getRowCount() |
Object |
getValueAt(int row,
int column) |
boolean |
isCellEditable(int row,
int column) |
boolean |
isResolvedCompletely()
Replies true if each
MultiValueResolutionDecision is decided. |
void |
populate(TagCollection tags,
Set<String> keysWithConflicts)
Populates the model with the tags for which conflicts are to be resolved.
|
void |
prepareDefaultTagDecisions()
Prepare the default decisions for the current model
|
void |
rebuild()
initializes the model from the current tags
|
protected void |
refreshNumConflicts() |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
protected void |
setNumConflicts(int numConflicts) |
void |
setShowTagsWithConflictsOnly(boolean showTagsWithConflictsOnly)
Sets whether all tags or only tags with conflicts are displayed
|
void |
setShowTagsWithMultiValuesOnly(boolean showTagsWithMultiValuesOnly)
Sets whether all conflicts or only conflicts with multiple values are displayed
|
void |
setValueAt(Object value,
int row,
int column) |
protected void |
sort() |
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, insertRow, insertRow, 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
private TagCollection tags
private List<String> displayedKeys
private Set<String> keysWithConflicts
private Map<String,MultiValueResolutionDecision> decisions
private int numConflicts
private PropertyChangeSupport support
private boolean showTagsWithConflictsOnly
private boolean showTagsWithMultiValuesOnly
public TagConflictResolverModel()
TagConflictResolverModel
.public void addPropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
protected void setNumConflicts(int numConflicts)
protected void refreshNumConflicts()
protected void sort()
public void rebuild()
public void populate(TagCollection tags, Set<String> keysWithConflicts)
tags
- the tag collection with the tags. Must not be null.keysWithConflicts
- the set of tag keys with conflictsIllegalArgumentException
- thrown if tags is nullpublic final String getKey(int row)
row
- The table rowpublic 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 boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class DefaultTableModel
public void setValueAt(Object value, int row, int column)
setValueAt
in interface TableModel
setValueAt
in class DefaultTableModel
public boolean isResolvedCompletely()
MultiValueResolutionDecision
is decided.MultiValueResolutionDecision
is decided; false otherwisepublic int getNumConflicts()
public int getNumDecisions()
public TagCollection getResolution()
public TagCollection getAllResolutions()
public MultiValueResolutionDecision getDecision(int row)
row
- The table rowpublic void setShowTagsWithConflictsOnly(boolean showTagsWithConflictsOnly)
showTagsWithConflictsOnly
- if true, only tags with conflicts are displayedpublic void setShowTagsWithMultiValuesOnly(boolean showTagsWithMultiValuesOnly)
showTagsWithMultiValuesOnly
- if true, only tags with multiple values are displayedpublic void prepareDefaultTagDecisions()
public final Set<String> getKeysWithConflicts()