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:
java.io.Serializable
,javax.swing.table.TableModel
,OsmPrimitivesTableModel
- Enclosing class:
- AbstractListMergeModel<T extends PrimitiveId,C extends ConflictResolveCommand>
public class AbstractListMergeModel.EntriesTableModel extends javax.swing.table.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 the
JTable
it is aTableModel
.
-
-
Constructor Summary
Constructors Constructor Description EntriesTableModel(ListRole role)
Create a newAbstractListMergeModel.EntriesTableModel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<T>
getEntries()
AbstractListMergeModel<T,C>
getListMergeModel()
Returns the list merge model.protected java.util.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()
java.lang.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(java.lang.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
-
-
-
-
Constructor Detail
-
EntriesTableModel
public EntriesTableModel(ListRole role)
Create a newAbstractListMergeModel.EntriesTableModel
- Parameters:
role
- the role
-
-
Method Detail
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
- Overrides:
getRowCount
in classjavax.swing.table.DefaultTableModel
-
getValueAt
public java.lang.Object getValueAt(int row, int column)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
getValueAt
in classjavax.swing.table.DefaultTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.DefaultTableModel
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.swing.table.DefaultTableModel
-
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
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:
java.lang.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:
java.lang.IllegalStateException
- if this model is not participating in the currentComparePairType
- See Also:
ComparePairType.getOppositeRole(ListRole)
,getRole()
,getOppositeEntries()
-
getEntries
protected java.util.List<T> getEntries()
-
getOppositeEntries
protected java.util.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
-
-