Class TagTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.history.TagTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
public final class TagTableModel extends AbstractTableModel
The table model for the tags of the version atPointInTimeType.REFERENCE_POINT_IN_TIME
orPointInTimeType.CURRENT_POINT_IN_TIME
- Since:
- 11647 (extracted from HistoryBrowserModel)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private List<String>
keys
private HistoryBrowserModel
model
private PointInTimeType
pointInTimeType
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description TagTableModel(HistoryBrowserModel historyModel, PointInTimeType type)
Constructs a newTagTableModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
(package private) TwoColumnDiff.Item.DiffItemType
getDiffItemType(String key, boolean isValue)
String
getKeyAt(int row)
Get the key for the given row.String
getOppositeValue(String key)
Returns the tag value in the opposite point in time for the given key.PointInTimeType
getPointInTimeType()
Returns the type of point in time.int
getRowCount()
String
getValue(String key)
Returns the tag value for the given key.Object
getValueAt(int row, int column)
Color
getVersionColor(HistoryOsmPrimitive primitive)
Returns the color for the given primitive timestampString
getVersionString(HistoryOsmPrimitive primitive)
Returns a version string for the given primitive,"*"
if it is is latest.HistoryOsmPrimitive
getWhichChangedTag(String key)
Returns the history primitive which changed the given key.boolean
hasSameValueAsOpposite(String key)
Determines if the tag value is the same in the opposite point in time for the given key.boolean
hasTag(String key)
Determines if a tag exists for the given key.(package private) void
initKeyList()
boolean
isCurrentPointInTime()
Determines if this is the current point in time.boolean
isReferencePointInTime()
Determines if this is the reference point in time.boolean
oppositeHasTag(String key)
Determines if a tag exists in the opposite point in time for the given key.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
pointInTimeType
private final PointInTimeType pointInTimeType
-
model
private final HistoryBrowserModel model
-
-
Constructor Detail
-
TagTableModel
public TagTableModel(HistoryBrowserModel historyModel, PointInTimeType type)
Constructs a newTagTableModel
.- Parameters:
historyModel
- parentHistoryBrowserModel
type
- type of point in time
-
-
Method Detail
-
initKeyList
void initKeyList()
-
getRowCount
public int getRowCount()
-
getValueAt
public Object getValueAt(int row, int column)
-
getKeyAt
public String getKeyAt(int row)
Get the key for the given row.- Parameters:
row
- The row- Returns:
- The key in that row.
- Since:
- 10637
-
hasTag
public boolean hasTag(String key)
Determines if a tag exists for the given key.- Parameters:
key
- tag key- Returns:
true
if a tag exists for the given key
-
getValue
public String getValue(String key)
Returns the tag value for the given key.- Parameters:
key
- tag key- Returns:
- tag value, or null
-
getWhichChangedTag
public HistoryOsmPrimitive getWhichChangedTag(String key)
Returns the history primitive which changed the given key.- Parameters:
key
- the OSM key- Returns:
- the history primitive which changed the given key
-
getVersionString
public String getVersionString(HistoryOsmPrimitive primitive)
Returns a version string for the given primitive,"*"
if it is is latest.- Parameters:
primitive
- the history primitive- Returns:
- a version string for the given primitive
-
getVersionColor
public Color getVersionColor(HistoryOsmPrimitive primitive)
Returns the color for the given primitive timestamp- Parameters:
primitive
- the history primitive- Returns:
- the color for the given primitive timestamp
-
oppositeHasTag
public boolean oppositeHasTag(String key)
Determines if a tag exists in the opposite point in time for the given key.- Parameters:
key
- tag key- Returns:
true
if a tag exists for the given key
-
getOppositeValue
public String getOppositeValue(String key)
Returns the tag value in the opposite point in time for the given key.- Parameters:
key
- tag key- Returns:
- tag value, or null
-
hasSameValueAsOpposite
public boolean hasSameValueAsOpposite(String key)
Determines if the tag value is the same in the opposite point in time for the given key.- Parameters:
key
- tag key- Returns:
true
if the tag value is the same in the opposite point in time for the given key
-
getPointInTimeType
public PointInTimeType getPointInTimeType()
Returns the type of point in time.- Returns:
- the type of point in time
-
isCurrentPointInTime
public boolean isCurrentPointInTime()
Determines if this is the current point in time.- Returns:
true
if this is the current point in time
-
isReferencePointInTime
public boolean isReferencePointInTime()
Determines if this is the reference point in time.- Returns:
true
if this is the reference point in time
-
getColumnCount
public int getColumnCount()
-
getDiffItemType
TwoColumnDiff.Item.DiffItemType getDiffItemType(String key, boolean isValue)
-
-