public class SelectionTableModel extends javax.swing.table.AbstractTableModel implements SelectionChangedListener, MapView.LayerChangeListener
Modifier and Type | Field and Description |
---|---|
private java.util.List<OsmPrimitive> |
cache |
private OsmDataLayer |
layer
this selection table model only displays selected primitives in this layer
|
Constructor and Description |
---|
SelectionTableModel(OsmDataLayer layer)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed.
|
int |
getColumnCount() |
OsmPrimitive |
getPrimitive(int row)
Replies the primitive at row
row in this model |
int |
getRowCount() |
java.util.List<OsmPrimitive> |
getSelection() |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex) |
void |
layerAdded(Layer newLayer)
Notifies this listener that a layer has been added.
|
void |
layerRemoved(Layer oldLayer)
Notifies this listener that a layer has been removed.
|
protected void |
populateSelectedPrimitives(OsmDataLayer layer)
populates the model with the primitives currently selected in
layer |
void |
register() |
void |
selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
Informs the listener that the selection in the dataset has changed.
|
void |
unregister() |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
private OsmDataLayer layer
private java.util.List<OsmPrimitive> cache
public SelectionTableModel(OsmDataLayer layer) throws java.lang.IllegalArgumentException
layer
- the data layer. Must not be null.java.lang.IllegalArgumentException
- thrown if layer is nullpublic void register()
public void unregister()
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
public void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListener
activeLayerChange
in interface MapView.LayerChangeListener
oldLayer
- The previous active layernewLayer
- The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListener
layerAdded
in interface MapView.LayerChangeListener
newLayer
- The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListener
layerRemoved
in interface MapView.LayerChangeListener
oldLayer
- The old removed layerpublic void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListener
selectionChanged
in interface SelectionChangedListener
newSelection
- The new selection.public java.util.List<OsmPrimitive> getSelection()
protected void populateSelectedPrimitives(OsmDataLayer layer)
layer
layer
- the data layerpublic OsmPrimitive getPrimitive(int row)
row
in this modelrow
- the rowrow
in this model