Revision 707b6237
Added by Niels Hoffmann over 12 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import java.net.URI; |
14 | 14 |
import java.net.URISyntaxException; |
15 |
import java.util.ArrayList; |
|
15 | 16 |
import java.util.Arrays; |
17 |
import java.util.Collections; |
|
16 | 18 |
import java.util.HashSet; |
17 | 19 |
import java.util.List; |
18 | 20 |
import java.util.Map; |
... | ... | |
22 | 24 |
import org.eclipse.swt.widgets.Label; |
23 | 25 |
|
24 | 26 |
import eu.etaxonomy.cdm.common.UriUtils; |
25 |
import eu.etaxonomy.cdm.ext.geo.EditGeoServiceUtilities; |
|
26 | 27 |
import eu.etaxonomy.cdm.model.common.Language; |
27 | 28 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
28 | 29 |
import eu.etaxonomy.cdm.model.description.Distribution; |
29 | 30 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase; |
31 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
|
30 | 32 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
31 | 33 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
32 | 34 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
115 | 117 |
|
116 | 118 |
List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()}); |
117 | 119 |
|
118 |
String parameter = EditGeoServiceUtilities.getDistributionServiceRequestParameterString(getDistributions(), presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
|
|
120 |
String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(getTaxonDescriptions(), presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
|
|
119 | 121 |
|
120 |
|
|
121 |
String mapUriString = accessPoint + "?" + parameter + "&ms=1000"; |
|
122 |
String mapUriString = String.format("%s?%s&ms=1000", accessPoint, parameter); |
|
122 | 123 |
return mapUriString; |
123 | 124 |
} |
124 | 125 |
|
125 | 126 |
/** |
126 | 127 |
* @return |
127 | 128 |
*/ |
128 |
private Set<Distribution> getDistributions() { |
|
129 |
HashSet<Distribution> distributions = new HashSet<Distribution>(); |
|
130 |
|
|
131 |
for (DescriptionElementBase element : getEntity().getDescriptionElements()) { |
|
132 |
if (element instanceof Distribution) { |
|
133 |
distributions.add((Distribution) element); |
|
134 |
} |
|
135 |
} |
|
136 |
return distributions; |
|
129 |
private List<TaxonDescription> getTaxonDescriptions() { |
|
130 |
return Arrays.asList(((TaxonDescription) getEntity().getDescription()).getTaxon().getDescriptions().toArray(new TaxonDescription[0])); |
|
137 | 131 |
} |
138 | 132 |
|
139 | 133 |
} |
Also available in: Unified diff
Merged with trunk