4 |
import java.util.Map; |
import java.util.Map; |
5 |
import java.util.HashMap; |
import java.util.HashMap; |
6 |
import java.util.List; |
import java.util.List; |
7 |
|
import java.util.SortedMap; |
8 |
|
import java.util.TreeMap; |
9 |
import java.net.URL; |
import java.net.URL; |
10 |
|
|
11 |
import org.geotools.feature.FeatureCollection; |
import org.geotools.feature.FeatureCollection; |
13 |
import org.geotools.map.DefaultMapLayer; |
import org.geotools.map.DefaultMapLayer; |
14 |
import org.geotools.coverage.grid.GridCoverage2D; |
import org.geotools.coverage.grid.GridCoverage2D; |
15 |
import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader; |
import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader; |
16 |
|
import org.geotools.data.FeatureSource; |
17 |
import org.geotools.styling.ColorMap; |
import org.geotools.styling.ColorMap; |
18 |
import org.geotools.styling.ColorMapEntry; |
import org.geotools.styling.ColorMapEntry; |
19 |
import org.geotools.styling.Style; |
import org.geotools.styling.Style; |
154 |
title, |
title, |
155 |
style |
style |
156 |
); |
); |
157 |
|
|
158 |
if ( styledObject == null ) |
if ( styledObject == null ) |
159 |
throw new UnsupportedOperationException("Can not create StyledMapInterface object from "+(object == null ? "null" : object.getClass())); |
throw new UnsupportedOperationException("Can not create StyledMapInterface object from "+(object == null ? "null" : object.getClass())); |
160 |
|
|
162 |
} |
} |
163 |
|
|
164 |
/** |
/** |
165 |
|
* Return only the visible or invisible entries of an AttributeMetaData-Map. |
166 |
|
* @param amdMap AttributeMetaData-Map |
167 |
|
* @param visible indicated whether the visible or invisible entries are |
168 |
|
* returned |
169 |
|
*/ |
170 |
|
public static Map<Integer,AttributeMetaData> getVisibleAttributeMetaData(Map<Integer,AttributeMetaData> amdMap, boolean visible) { |
171 |
|
SortedMap<Integer,AttributeMetaData> filteredMap = new TreeMap<Integer,AttributeMetaData>(); |
172 |
|
for (AttributeMetaData amd : amdMap.values()) |
173 |
|
if ( amd.isVisible() ) |
174 |
|
filteredMap.put(amd.getColIdx(), amd); |
175 |
|
|
176 |
|
return filteredMap; |
177 |
|
} |
178 |
|
|
179 |
|
|
180 |
|
/** |
181 |
* Parses a {@link AttributeMetaData} object from an JDOM-{@link Element}. |
* Parses a {@link AttributeMetaData} object from an JDOM-{@link Element}. |
182 |
* This method works like {@link AMLImport#parseDataAttribute(org.w3c.dom.Node}, |
* This method works like {@link AMLImport#parseDataAttribute(org.w3c.dom.Node}, |
183 |
* but for JDOM. |
* but for JDOM. |