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, setValueAtprivate 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.TableModelpublic int getRowCount()
getRowCount in interface javax.swing.table.TableModelpublic java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt in interface javax.swing.table.TableModelpublic void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListeneractiveLayerChange in interface MapView.LayerChangeListeneroldLayer - The previous active layernewLayer - The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListenerlayerAdded in interface MapView.LayerChangeListenernewLayer - The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListenerlayerRemoved in interface MapView.LayerChangeListeneroldLayer - The old removed layerpublic void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListenerselectionChanged in interface SelectionChangedListenernewSelection - The new selection.public java.util.List<OsmPrimitive> getSelection()
protected void populateSelectedPrimitives(OsmDataLayer layer)
layerlayer - the data layerpublic OsmPrimitive getPrimitive(int row)
row in this modelrow - the rowrow in this model