46 |
import schmitzm.geotools.feature.FeatureUtil; |
import schmitzm.geotools.feature.FeatureUtil; |
47 |
import schmitzm.geotools.gui.FeatureCollectionTableModel; |
import schmitzm.geotools.gui.FeatureCollectionTableModel; |
48 |
import skrueger.AttributeMetadata; |
import skrueger.AttributeMetadata; |
49 |
|
import skrueger.AttributeMetadataImpl; |
50 |
|
|
51 |
import com.vividsolutions.jts.geom.Envelope; |
import com.vividsolutions.jts.geom.Envelope; |
52 |
|
|
53 |
/** |
/** |
54 |
* This class extends the the {@link FeatureCollectionTableModel} with the |
* This class extends the the {@link FeatureCollectionTableModel} with the |
55 |
* functionalities of the {@link AttributeMetadata}. |
* functionalities of the {@link AttributeMetadataImpl}. |
56 |
* <ul> |
* <ul> |
57 |
* <li>column names are translated according to |
* <li>column names are translated according to |
58 |
* {@link AttributeMetadata#getTitle()}</li> |
* {@link AttributeMetadataImpl#getTitle()}</li> |
59 |
* <li>columns are hidden according to {@link AttributeMetaData#isVisible()()}</li> |
* <li>columns are hidden according to {@link AttributeMetaData#isVisible()()}</li> |
60 |
* <li>Any filter defined in the {@link StyledFeaturesInterface} will be |
* <li>Any filter defined in the {@link StyledFeaturesInterface} will be |
61 |
* applied.</li> |
* applied.</li> |
67 |
FeatureCollectionTableModel { |
FeatureCollectionTableModel { |
68 |
final static private Logger LOGGER = Logger |
final static private Logger LOGGER = Logger |
69 |
.getLogger(StyledFeatureCollectionTableModel.class); |
.getLogger(StyledFeatureCollectionTableModel.class); |
70 |
/** Contains the complete {@link AttributeMetadata}-Map of the styled layer. */ |
/** Contains the complete {@link AttributeMetadataImpl}-Map of the styled layer. */ |
71 |
protected AttributeMetadataMap amdMap = null; |
protected AttributeMetadataMap<? extends AttributeMetadata> amdMap = null; |
72 |
/** Holds the current filter on the table */ |
/** Holds the current filter on the table */ |
73 |
protected Filter filter = null; |
protected Filter filter = null; |
74 |
/** Holds the Bounds for all features. Only set once during the constructor **/ |
/** Holds the Bounds for all features. Only set once during the constructor **/ |
80 |
protected String[] colTooltips = null; |
protected String[] colTooltips = null; |
81 |
|
|
82 |
/** A cache for the #sortedValuesVisibleOnly() **/ |
/** A cache for the #sortedValuesVisibleOnly() **/ |
83 |
protected List<AttributeMetadata> amdMapVisibleOnly = null; |
protected List<? extends AttributeMetadata> amdMapVisibleOnly = null; |
84 |
|
|
85 |
/** |
/** |
86 |
* Creates a new table model for a styled layer. |
* Creates a new table model for a styled layer. |
97 |
|
|
98 |
/** |
/** |
99 |
* This overwritten method filters the values for NODATA-values defined in |
* This overwritten method filters the values for NODATA-values defined in |
100 |
* the {@link AttributeMetadata} |
* the {@link AttributeMetadataImpl} |
101 |
*/ |
*/ |
102 |
@Override |
@Override |
103 |
public Object getValueAt(int row, int col) { |
public Object getValueAt(int row, int col) { |
111 |
* @param fs |
* @param fs |
112 |
* the feature source |
* the feature source |
113 |
* @param amdm |
* @param amdm |
114 |
* {@link AttributeMetadata}-Map to define the visible attributes |
* {@link AttributeMetadataImpl}-Map to define the visible attributes |
115 |
* and translation |
* and translation |
116 |
*/ |
*/ |
117 |
protected void setFeatureSource( |
protected void setFeatureSource( |
118 |
FeatureSource<SimpleFeatureType, SimpleFeature> fs, |
FeatureSource<SimpleFeatureType, SimpleFeature> fs, |
119 |
AttributeMetadataMap amdm, Filter filter) throws Exception { |
AttributeMetadataMap<? extends AttributeMetadata> amdm, Filter filter) throws Exception { |
120 |
|
|
121 |
if (filter == null) |
if (filter == null) |
122 |
filter = Filter.INCLUDE; |
filter = Filter.INCLUDE; |
170 |
* @param fs |
* @param fs |
171 |
* the feature source |
* the feature source |
172 |
* @param amd |
* @param amd |
173 |
* {@link AttributeMetadata}-Map to define the visible attributes |
* {@link AttributeMetadataImpl}-Map to define the visible attributes |
174 |
* and translation |
* and translation |
175 |
*/ |
*/ |
176 |
public void setStyledFeatures(StyledFeaturesInterface<?> styledFeatures) { |
public void setStyledFeatures(StyledFeaturesInterface<?> styledFeatures) { |