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 of styled objects.

Author:
Martin Schmitz (University of Bonn/Germany)
See Also:
Serialized Form

Field Summary
protected  Envelope bounds
          Holds the Bounds for all features.
protected  FeatureSource featureSource
          Holds the data source for the table as FeatureSource.
protected  Filter filter
          Holds the current filter on the table
protected  StyledLayerInterface<?> layer
          Holds the data source as styled layer.
protected  Map<Integer,AttributeMetaData> origAMD
          Contains the complete AttributeMetaData-Map of the styled layer.
protected  Map<Integer,AttributeMetaData> visibleAMD
          Contains only the visible elements of the AttributeMetaData-Map
 
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(StyledFeatureCollectionInterface layer)
          Creates a new table model for a styled layer.
StyledFeatureCollectionTableModel(StyledFeatureCollectionInterface layer, Filter filter)
          Creates a new table model for a styled layer.
StyledFeatureCollectionTableModel(StyledFeaturesInterface layer)
          Creates a new table model for a styled layer.
StyledFeatureCollectionTableModel(StyledFeaturesInterface layer, Filter filter)
          Creates a new table model for a styled layer.
 
Method Summary
 Envelope getBounds()
           
 Filter getFilter()
           
protected  void reorganize(boolean fireTableStructureChanged)
          After calling super.reorganize(.) this method replaced the column descriptions with the titles of the AttributeMetaData.
 void setFeatureCollection(StyledFeaturesInterface layer, Filter filter)
          Converts the StyledFeatureCollection to a FeatureSource and sets this as the new data source for the table.
 void setFeatureCollection(StyledFeatureSourceInterface layer, Filter filter)
          Sets the StyledFeatureCollection as new data source for the table.
protected  void setFeatureSource(FeatureSource fs, Map<Integer,AttributeMetaData> amd, Filter filter)
          Sets a new data source for the table.
 void setFilter(Filter filter)
          Resets the filter for the table.
 
Methods inherited from class schmitzm.geotools.gui.FeatureCollectionTableModel
findFeature, getAttributeFilter, getColumnClass, getColumnCount, getColumnName, getFeature, getFeatureCollection, getFeaturesAsArray, getFeaturesAsCollection, getRowCount, getValueAt, 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

layer

protected StyledLayerInterface<?> layer
Holds the data source as styled layer.


visibleAMD

protected Map<Integer,AttributeMetaData> visibleAMD
Contains only the visible elements of the AttributeMetaData-Map


featureSource

protected FeatureSource featureSource
Holds the data source for the table as FeatureSource.


origAMD

protected Map<Integer,AttributeMetaData> origAMD
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

Constructor Detail

StyledFeatureCollectionTableModel

public StyledFeatureCollectionTableModel(StyledFeatureCollectionInterface layer)
Creates a new table model for a styled layer.

Parameters:
layer - the styled layer

StyledFeatureCollectionTableModel

public StyledFeatureCollectionTableModel(StyledFeatureCollectionInterface layer,
                                         Filter filter)
Creates a new table model for a styled layer.

Parameters:
layer - the styled layer
filter - filter applied to the table

StyledFeatureCollectionTableModel

public StyledFeatureCollectionTableModel(StyledFeaturesInterface layer)
Creates a new table model for a styled layer.

Parameters:
layer - the styled layer

StyledFeatureCollectionTableModel

public StyledFeatureCollectionTableModel(StyledFeaturesInterface layer,
                                         Filter filter)
Creates a new table model for a styled layer.

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

setFeatureSource

protected void setFeatureSource(FeatureSource fs,
                                Map<Integer,AttributeMetaData> amd,
                                Filter filter)
                         throws Exception
Sets a new data source for the table.

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

setFeatureCollection

public void setFeatureCollection(StyledFeaturesInterface layer,
                                 Filter filter)
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

setFeatureCollection

public void setFeatureCollection(StyledFeatureSourceInterface layer,
                                 Filter filter)
Sets the StyledFeatureCollection as new data source for the table.

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

setFilter

public void setFilter(Filter filter)
Resets the filter for the table.

Parameters:
filter - a filter

getFilter

public Filter getFilter()
Returns:
Filter.INCLUDE or the Filter applied to the Features

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