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 aJTableand one of the three entry lists in the roleListRolemanaged by theAbstractListMergeModel.From the point of view of the
JTableit 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 currentComparePairTypeOsmPrimitivegetReferredPrimitive(int idx)Gets the primitive at a given row indexListRolegetRole()Get the role of the table.intgetRowCount()java.lang.ObjectgetValueAt(int row, int column)booleanisCellEditable(int row, int column)booleanisIncludedInOppositeList(int row)replies true if the entry at the current position is present in the opposite list of the currentComparePairType.booleanisParticipatingInCurrentComparePair()replies true if theListRoleof thisAbstractListMergeModel.EntriesTableModelparticipates in the currentComparePairTypebooleanisSamePositionInOppositeList(int row)replies true if the entry atrowis equal to the entry at the same position in the opposite list of the currentComparePairType.voidsetValueAt(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:
getRowCountin interfacejavax.swing.table.TableModel- Overrides:
getRowCountin classjavax.swing.table.DefaultTableModel
-
getValueAt
public java.lang.Object getValueAt(int row, int column)
- Specified by:
getValueAtin interfacejavax.swing.table.TableModel- Overrides:
getValueAtin classjavax.swing.table.DefaultTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)
- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.DefaultTableModel
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin 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 theListRoleof thisAbstractListMergeModel.EntriesTableModelparticipates in the currentComparePairType- Returns:
- true, if the
ListRoleof thisAbstractListMergeModel.EntriesTableModelparticipates in the currentComparePairType - See Also:
AbstractListMergeModel.ComparePairListModel.getSelectedComparePair()
-
isSamePositionInOppositeList
public boolean isSamePositionInOppositeList(int row)
replies true if the entry atrowis 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
rowis 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:OsmPrimitivesTableModelGets the primitive at a given row index- Specified by:
getReferredPrimitivein interfaceOsmPrimitivesTableModel- Parameters:
idx- The row- Returns:
- The primitive in that row
-
-