|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
org.openstreetmap.josm.gui.conflict.tags.RelationMemberConflictResolverModel
public class RelationMemberConflictResolverModel
This model manages a list of conflicting relation members.
It can be used as TableModel
.
Field Summary | |
---|---|
private 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 |
private java.util.Collection<Relation> |
relations
the collection of relations for which we manage conflicts |
private java.beans.PropertyChangeSupport |
support
|
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
RelationMemberConflictResolverModel()
|
Method Summary | |
---|---|
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 |
int |
getRowCount()
|
java.lang.Object |
getValueAt(int row,
int column)
|
protected boolean |
isChanged(Relation relation,
OsmPrimitive newPrimitive)
|
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 |
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. |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
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 |
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 |
Field Detail |
---|
public static final java.lang.String NUM_CONFLICTS_PROP
private java.util.List<RelationMemberConflictDecision> decisions
private java.util.Collection<Relation> relations
private int numConflicts
private java.beans.PropertyChangeSupport support
Constructor Detail |
---|
public RelationMemberConflictResolverModel()
Method Detail |
---|
public int getNumConflicts()
protected void updateNumConflicts()
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 RelationMemberConflictDecision getDecision(int row)
row
row
-
row
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 to if the
decision is RelationMemberConflictDecisionType#REPLACE
protected boolean isChanged(Relation relation, OsmPrimitive newPrimitive)
public java.util.Set<Relation> getModifiedRelations(OsmPrimitive newPrimitive)
newPrimitive
- the primitive which members shall refer to if the
decision is RelationMemberConflictDecisionType#REPLACE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |