Class AbstractListMergeModel.EntriesTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- javax.swing.table.DefaultTableModel
-
- org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel.EntriesTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
,OsmPrimitivesTableModel
- Enclosing class:
- AbstractListMergeModel<T extends PrimitiveId,C extends ConflictResolveCommand>
public class AbstractListMergeModel.EntriesTableModel extends DefaultTableModel implements OsmPrimitivesTableModel
This an adapter between aJTable
and one of the three entry lists in the roleListRole
managed by theAbstractListMergeModel
. From the point of view of theJTable
it is aTableModel
.
-
-
Field Summary
Fields Modifier and Type Field Description private ListRole
role
-
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description EntriesTableModel(ListRole role)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<T>
getEntries()
AbstractListMergeModel<T,C>
getListMergeModel()
Returns the list merge model.protected List<T>
getOppositeEntries()
replies the opposite list of entries with respect to the currentComparePairType
OsmPrimitive
getReferredPrimitive(int idx)
Gets the primitive at a given row indexListRole
getRole()
Get the role of the table.int
getRowCount()
Object
getValueAt(int row, int column)
boolean
isCellEditable(int row, int column)
boolean
isIncludedInOppositeList(int row)
replies true if the entry at the current position is present in the opposite list of the currentComparePairType
.boolean
isParticipatingInCurrentComparePair()
replies true if theListRole
of thisAbstractListMergeModel.EntriesTableModel
participates in the currentComparePairType
boolean
isSamePositionInOppositeList(int row)
replies true if the entry atrow
is equal to the entry at the same position in the opposite list of the currentComparePairType
.void
setValueAt(Object value, int row, int col)
-
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
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, removeTableModelListener
-
-
-
-
Constructor Detail
-
EntriesTableModel
public EntriesTableModel(ListRole role)
- Parameters:
role
- the role
-
-
Method Detail
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classDefaultTableModel
-
getValueAt
public Object getValueAt(int row, int column)
- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classDefaultTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)
- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classDefaultTableModel
-
setValueAt
public void setValueAt(Object value, int row, int col)
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classDefaultTableModel
-
getListMergeModel
public AbstractListMergeModel<T,C> getListMergeModel()
Returns the list merge model.- Returns:
- the list merge model
-
isParticipatingInCurrentComparePair
public boolean isParticipatingInCurrentComparePair()
replies true if theListRole
of thisAbstractListMergeModel.EntriesTableModel
participates in the currentComparePairType
- Returns:
- true, if the if the
ListRole
of thisAbstractListMergeModel.EntriesTableModel
participates in the currentComparePairType
- See Also:
AbstractListMergeModel.ComparePairListModel.getSelectedComparePair()
-
isSamePositionInOppositeList
public boolean isSamePositionInOppositeList(int row)
replies true if the entry atrow
is equal to the entry at the same position in the opposite list of the currentComparePairType
.- Parameters:
row
- the row number- Returns:
- true if the entry at
row
is equal to the entry at the same position in the opposite list of the currentComparePairType
- Throws:
IllegalStateException
- if this model is not participating in the currentComparePairType
- See Also:
ComparePairType.getOppositeRole(ListRole)
,getRole()
,getOppositeEntries()
-
isIncludedInOppositeList
public boolean isIncludedInOppositeList(int row)
replies true if the entry at the current position is present in the opposite list of the currentComparePairType
.- Parameters:
row
- the current row- Returns:
- true if the entry at the current position is present in the opposite list
of the current
ComparePairType
. - Throws:
IllegalStateException
- if this model is not participating in the currentComparePairType
- See Also:
ComparePairType.getOppositeRole(ListRole)
,getRole()
,getOppositeEntries()
-
getEntries
protected List<T> getEntries()
-
getOppositeEntries
protected List<T> getOppositeEntries()
replies the opposite list of entries with respect to the currentComparePairType
- Returns:
- the opposite list of entries
-
getReferredPrimitive
public OsmPrimitive getReferredPrimitive(int idx)
Description copied from interface:OsmPrimitivesTableModel
Gets the primitive at a given row index- Specified by:
getReferredPrimitive
in interfaceOsmPrimitivesTableModel
- Parameters:
idx
- The row- Returns:
- The primitive in that row
-
-