org.openstreetmap.josm.gui.conflict.tags
Class TagConflictResolverModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
org.openstreetmap.josm.gui.conflict.tags.TagConflictResolverModel
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.table.TableModel
public class TagConflictResolverModel
- extends javax.swing.table.DefaultTableModel
- See Also:
- Serialized Form
Fields inherited from class javax.swing.table.DefaultTableModel |
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Methods inherited from class javax.swing.table.DefaultTableModel |
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NUM_CONFLICTS_PROP
public static final java.lang.String NUM_CONFLICTS_PROP
tags
private TagCollection tags
displayedKeys
private java.util.List<java.lang.String> displayedKeys
keysWithConflicts
private java.util.Set<java.lang.String> keysWithConflicts
decisions
private java.util.HashMap<java.lang.String,MultiValueResolutionDecision> decisions
numConflicts
private int numConflicts
support
private java.beans.PropertyChangeSupport support
showTagsWithConflictsOnly
private boolean showTagsWithConflictsOnly
showTagsWithMultiValuesOnly
private boolean showTagsWithMultiValuesOnly
TagConflictResolverModel
public TagConflictResolverModel()
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
setNumConflicts
protected void setNumConflicts(int numConflicts)
refreshNumConflicts
protected void refreshNumConflicts()
sort
protected void sort()
rebuild
protected void rebuild()
- initializes the model from the current tags
populate
public void populate(TagCollection tags,
java.util.Set<java.lang.String> keysWithConflicts)
- Populates the model with the tags for which conflicts are to be resolved.
- Parameters:
tags
- the tag collection with the tags. Must not be null.keysWithConflicts
- the set of tag keys with conflicts
- Throws:
java.lang.IllegalArgumentException
- thrown if tags is null
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interface javax.swing.table.TableModel
- Overrides:
getRowCount
in class javax.swing.table.DefaultTableModel
getValueAt
public java.lang.Object getValueAt(int row,
int column)
- Specified by:
getValueAt
in interface javax.swing.table.TableModel
- Overrides:
getValueAt
in class javax.swing.table.DefaultTableModel
isCellEditable
public boolean isCellEditable(int row,
int column)
- Specified by:
isCellEditable
in interface javax.swing.table.TableModel
- Overrides:
isCellEditable
in class javax.swing.table.DefaultTableModel
setValueAt
public void setValueAt(java.lang.Object value,
int row,
int column)
- Specified by:
setValueAt
in interface javax.swing.table.TableModel
- Overrides:
setValueAt
in class javax.swing.table.DefaultTableModel
isResolvedCompletely
public boolean isResolvedCompletely()
- Replies true if each
MultiValueResolutionDecision
is decided.
- Returns:
- true if each
MultiValueResolutionDecision
is decided; false
otherwise
getNumConflicts
public int getNumConflicts()
getNumDecisions
public int getNumDecisions()
getResolution
public TagCollection getResolution()
getAllResolutions
public TagCollection getAllResolutions()
getDecision
public MultiValueResolutionDecision getDecision(int row)
setShowTagsWithConflictsOnly
public void setShowTagsWithConflictsOnly(boolean showTagsWithConflictsOnly)
- Sets whether all tags or only tags with conflicts are displayed
- Parameters:
showTagsWithConflictsOnly
- if true, only tags with conflicts are displayed
setShowTagsWithMultiValuesOnly
public void setShowTagsWithMultiValuesOnly(boolean showTagsWithMultiValuesOnly)
- Sets whether all conflicts or only conflicts with multiple values are displayed
- Parameters:
showTagsWithMultiValuesOnly
- if true, only tags with multiple values are displayed
prepareDefaultTagDecisions
public void prepareDefaultTagDecisions()
- Prepare the default decisions for the current model
JOSM