public class TagConflictResolverModel extends javax.swing.table.DefaultTableModel
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,MultiValueResolutionDecision> |
decisions |
private java.util.List<java.lang.String> |
displayedKeys |
private java.util.Set<java.lang.String> |
keysWithConflicts |
static java.lang.String |
NUM_CONFLICTS_PROP |
private int |
numConflicts |
private boolean |
showTagsWithConflictsOnly |
private boolean |
showTagsWithMultiValuesOnly |
private java.beans.PropertyChangeSupport |
support |
private TagCollection |
tags |
Constructor and Description |
---|
TagConflictResolverModel()
Constructs a new
TagConflictResolverModel . |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
TagCollection |
getAllResolutions() |
MultiValueResolutionDecision |
getDecision(int row)
Returns the conflict resolution decision at the given row.
|
java.lang.String |
getKey(int row)
Returns the OSM key at the given row.
|
java.util.Set<java.lang.String> |
getKeysWithConflicts()
Returns the set of keys in conflict.
|
int |
getNumConflicts() |
int |
getNumDecisions() |
TagCollection |
getResolution() |
int |
getRowCount() |
java.lang.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,
java.util.Set<java.lang.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(java.beans.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(java.lang.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 java.lang.String NUM_CONFLICTS_PROP
private TagCollection tags
private java.util.List<java.lang.String> displayedKeys
private java.util.Set<java.lang.String> keysWithConflicts
private java.util.Map<java.lang.String,MultiValueResolutionDecision> decisions
private int numConflicts
private java.beans.PropertyChangeSupport support
private boolean showTagsWithConflictsOnly
private boolean showTagsWithMultiValuesOnly
public TagConflictResolverModel()
TagConflictResolverModel
.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
protected void setNumConflicts(int numConflicts)
protected void refreshNumConflicts()
protected void sort()
public void rebuild()
public void populate(TagCollection tags, java.util.Set<java.lang.String> keysWithConflicts)
tags
- the tag collection with the tags. Must not be null.keysWithConflicts
- the set of tag keys with conflictsjava.lang.IllegalArgumentException
- thrown if tags is nullpublic final java.lang.String getKey(int row)
row
- The table rowpublic 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 boolean isCellEditable(int row, int column)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
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
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 java.util.Set<java.lang.String> getKeysWithConflicts()