skrueger.geotools
Class StyledFeatureCollectionTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by schmitzm.geotools.gui.FeatureCollectionTableModel
          extended by skrueger.geotools.StyledFeatureCollectionTableModel
All Implemented Interfaces:
Serializable, TableModel

public class StyledFeatureCollectionTableModel
extends FeatureCollectionTableModel

This class extends the the FeatureCollectionTableModel with the functionalities of the AttributeMetadata.

Author:
Stefan A. Krüger
See Also:
Serialized Form

Field Summary
protected  AttributeMetadataMap amdMap
          Contains the complete AttributeMetadata-Map of the styled layer.
protected  List<AttributeMetadata> amdMapVisibleOnly
          A cache for the #sortedValuesVisibleOnly()
protected  Envelope bounds
          Holds the Bounds for all features.
protected  String[] colTooltips
          Tooltips für die Spaltennamen.
protected  Filter filter
          Holds the current filter on the table
 
Fields inherited from class schmitzm.geotools.gui.FeatureCollectionTableModel
attrFilter, attrIdxForCol, attrTypes, colClass, colNames, featureArray, featureIdx, featureTable
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
StyledFeatureCollectionTableModel(StyledFeaturesInterface<?> styledFeatures)
          Creates a new table model for a styled layer.
 
Method Summary
 Envelope getBounds()
           
 Object getValueAt(int row, int col)
          This overwritten method filters the values for NODATA-values defined in the AttributeMetadata
protected  void reorganize(boolean fireTableStructureChanged)
          After calling super.reorganize(.) this method replaced the column descriptions with the titles of the AttributeMetaData.
protected  void setFeatureSource( fs, AttributeMetadataMap amdm, Filter filter)
          Sets a new data source for the table.
 void setStyledFeatures(StyledFeaturesInterface<?> styledFeatures)
          Converts the StyledFeatureCollection to a FeatureSource and sets this as the new data source for the table.
 
Methods inherited from class schmitzm.geotools.gui.FeatureCollectionTableModel
findFeature, getAttributeFilter, getColumnClass, getColumnCount, getColumnName, getFeature, getFeatureCollection, getFeaturesAsArray, getFeaturesAsCollection, getRowCount, reorganize, setAttributeFilter, setFeatureCollection
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amdMap

protected AttributeMetadataMap amdMap
Contains the complete AttributeMetadata-Map of the styled layer.


filter

protected Filter filter
Holds the current filter on the table


bounds

protected Envelope bounds
Holds the Bounds for all features. Only set once during the constructor


colTooltips

protected String[] colTooltips
Tooltips für die Spaltennamen. Wird nur beim Aufruf von reorganize(boolean) befuellt.


amdMapVisibleOnly

protected List<AttributeMetadata> amdMapVisibleOnly
A cache for the #sortedValuesVisibleOnly()

Constructor Detail

StyledFeatureCollectionTableModel

public StyledFeatureCollectionTableModel(StyledFeaturesInterface<?> styledFeatures)
Creates a new table model for a styled layer.

Parameters:
styledFeatures - the styled layer
filter - filter applied to the table
Method Detail

getValueAt

public Object getValueAt(int row,
                         int col)
This overwritten method filters the values for NODATA-values defined in the AttributeMetadata

Specified by:
getValueAt in interface TableModel
Overrides:
getValueAt in class FeatureCollectionTableModel
Parameters:
row - Zeilennummer (SimpleFeature), beginnend bei 0
col - Spaltennummer (Attribut), beginnen bei 0

setFeatureSource

protected void setFeatureSource( fs,
                                AttributeMetadataMap amdm,
                                Filter filter)
                         throws Exception
Sets a new data source for the table.

Parameters:
fs - the feature source
amdm - AttributeMetadata-Map to define the visible attributes and translation
Throws:
Exception

setStyledFeatures

public void setStyledFeatures(StyledFeaturesInterface<?> styledFeatures)
Converts the StyledFeatureCollection to a FeatureSource and sets this as the new data source for the table.

Parameters:
fs - the feature source
amd - AttributeMetadata-Map to define the visible attributes and translation

reorganize

protected void reorganize(boolean fireTableStructureChanged)
After calling super.reorganize(.) this method replaced the column descriptions with the titles of the AttributeMetaData.

Overrides:
reorganize in class FeatureCollectionTableModel
Parameters:
fireTableStructureChanged - indicates whether a table event is initiated after reorganize

getBounds

public Envelope getBounds()
Returns:
Cached bounds for the whole dataset (without applying the filter) or null