svn-gvsig-desktop / branches / v2_0_0_prep / libraries / org.gvsig.arcims / src / org / gvsig / remoteclient / arcims / styling / renderers / ArcImsFLegendFactory.java @ 32367
History | View | Annotate | Download (21.3 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2010 Prodevelop S.L. main development
|
26 |
* http://www.prodevelop.es
|
27 |
*/
|
28 |
|
29 |
package org.gvsig.remoteclient.arcims.styling.renderers; |
30 |
|
31 |
|
32 |
|
33 |
import org.slf4j.Logger; |
34 |
import org.slf4j.LoggerFactory; |
35 |
|
36 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
37 |
import org.gvsig.remoteclient.arcims.ArcXML; |
38 |
import org.gvsig.remoteclient.arcims.exceptions.ArcImsException; |
39 |
import org.gvsig.remoteclient.arcims.styling.symbols.ArcImsFSymbolFactory; |
40 |
import org.gvsig.remoteclient.arcims.styling.symbols.IArcIMSSymbol; |
41 |
import org.gvsig.remoteclient.arcims.utils.FieldInformation; |
42 |
import org.gvsig.remoteclient.arcims.utils.ServiceInfoTags; |
43 |
import org.gvsig.remoteclient.arcims.utils.ServiceInformation; |
44 |
import org.gvsig.remoteclient.arcims.utils.ServiceInformationLayerFeatures; |
45 |
|
46 |
import java.text.DecimalFormatSymbols; |
47 |
import java.text.ParseException; |
48 |
|
49 |
import java.util.ArrayList; |
50 |
import java.util.Iterator; |
51 |
|
52 |
|
53 |
/**
|
54 |
* Factory class to produce FLegend's from ArcIMS Renderers defintions
|
55 |
* @author jsanz
|
56 |
*
|
57 |
*/
|
58 |
public class ArcImsFLegendFactory { |
59 |
private static Logger logger = LoggerFactory.getLogger(ArcImsFLegendFactory.class.getName()); |
60 |
private char ds; |
61 |
private ServiceInformationLayerFeatures silf;
|
62 |
private ServiceInformation si;
|
63 |
|
64 |
// //We use a class variable to overwrite every label definition
|
65 |
// private VectorialLegend auxLabelsOuter = null;
|
66 |
//
|
67 |
// // private String PATRON = ArcXML.PATRON;
|
68 |
// // DecimalFormat formatter;
|
69 |
// private int featType;
|
70 |
//
|
71 |
// /**
|
72 |
// * @param ds Decimal separator char
|
73 |
// * @param msilf An object with all the information to build
|
74 |
// * the legend of a vectorial layer
|
75 |
// * @see org.gvsig.remoteclient.arcims.utils.ServiceInformationLayerFeatures
|
76 |
// */
|
77 |
// public ArcImsFLegendFactory(ServiceInformation msi, String layerId) {
|
78 |
// si = msi;
|
79 |
// ds = msi.getSeparators().getDs();
|
80 |
// ArcImsFSymbolFactory.ds = ds;
|
81 |
//
|
82 |
// silf = (ServiceInformationLayerFeatures) this.si.getLayerById(layerId);
|
83 |
// this.featType = getSymbType(silf.getFclasstype());
|
84 |
//
|
85 |
// DecimalFormatSymbols dfs = new DecimalFormatSymbols();
|
86 |
// dfs.setDecimalSeparator(ds);
|
87 |
//
|
88 |
// // formatter = new DecimalFormat(PATRON,dfs);
|
89 |
// }
|
90 |
//
|
91 |
// /**
|
92 |
// * Main method on this class. It calls proper getLegend method
|
93 |
// * based on type of render.
|
94 |
// * @param render
|
95 |
// * @return
|
96 |
// * @throws ArcImsException
|
97 |
// */
|
98 |
// public ILegend getMainLegend() throws ArcImsException {
|
99 |
// logger.info("======Start creating main layer Legend======");
|
100 |
//
|
101 |
// Renderer render = silf.getLayerMainRenderer();
|
102 |
// ILegend leg = getLegend(render, true);
|
103 |
// logger.info("======Getting main Legend (" +
|
104 |
// getClassName(leg.getClass()) + ")======");
|
105 |
//
|
106 |
// return leg;
|
107 |
// }
|
108 |
//
|
109 |
// /**
|
110 |
// * Main method that calls proper getLengend methods according to the type
|
111 |
// * of renderer is passed.
|
112 |
// * @param render
|
113 |
// * @param isMainRender
|
114 |
// * @return
|
115 |
// * @throws ArcImsException
|
116 |
// */
|
117 |
// private VectorialLegend getLegend(Renderer render, boolean isMainRender)
|
118 |
// throws ArcImsException {
|
119 |
// VectorialLegend leg = null;
|
120 |
//
|
121 |
// /*
|
122 |
// if (render instanceof SimpleRenderer) {
|
123 |
// SimpleRenderer srender = (SimpleRenderer) render;
|
124 |
// leg = getLegend(srender);
|
125 |
// }
|
126 |
// else if (render instanceof ValueMapRenderer) {
|
127 |
// ValueMapRenderer srender = (ValueMapRenderer) render;
|
128 |
// leg = getLegend(srender);
|
129 |
// }
|
130 |
// // In the main legend, a ScaleDependent and a GroupRenderer can be
|
131 |
// // treated in the same way
|
132 |
// else if (isMainRender && (render instanceof GroupRenderer)) {
|
133 |
// GroupRenderer groupRender = (GroupRenderer) render;
|
134 |
// leg = getLegend(groupRender);
|
135 |
// }
|
136 |
// // Otherwise, we will use their proper method
|
137 |
// else if (!isMainRender && (render instanceof GroupRenderer)) {
|
138 |
// if (render instanceof ScaleDependentRenderer) {
|
139 |
// ScaleDependentRenderer sdRender = (ScaleDependentRenderer) render;
|
140 |
// leg = getLegend(sdRender);
|
141 |
// }
|
142 |
//
|
143 |
// // In the main legend, a ScaleDependent and a GroupRenderer can be
|
144 |
// // treated in the same way
|
145 |
// else if (render instanceof GroupRenderer) {
|
146 |
// GroupRenderer groupRender = (GroupRenderer) render;
|
147 |
// leg = getLegend(groupRender);
|
148 |
// }
|
149 |
// }
|
150 |
// else
|
151 |
// leg = getDefaultLegend();
|
152 |
// */
|
153 |
// if (render instanceof SimpleRenderer) {
|
154 |
// SimpleRenderer srender = (SimpleRenderer) render;
|
155 |
// leg = getLegend(srender);
|
156 |
// } else if (render instanceof ValueMapRenderer) {
|
157 |
// ValueMapRenderer srender = (ValueMapRenderer) render;
|
158 |
// leg = getLegend(srender);
|
159 |
// }
|
160 |
// // In the main legend, a ScaleDependent and a GroupRenderer can be
|
161 |
// // treated in the same way (ScaleDependent inherits from GroupRenderer)
|
162 |
// else if (render instanceof GroupRenderer) {
|
163 |
// GroupRenderer groupRender = (GroupRenderer) render;
|
164 |
// leg = getLegend(groupRender);
|
165 |
// } else {
|
166 |
// leg = getDefaultLegend();
|
167 |
// }
|
168 |
//
|
169 |
// if (leg != null) {
|
170 |
// logger.info("Getting Render of type: " +
|
171 |
// getClassName(render.getClass()));
|
172 |
//
|
173 |
// return leg;
|
174 |
// } else {
|
175 |
// throw new ArcImsException("arcims_legend_error");
|
176 |
// }
|
177 |
// }
|
178 |
//
|
179 |
// /**
|
180 |
// * Method to generate a valid simple legend.
|
181 |
// * @return
|
182 |
// */
|
183 |
// private VectorialLegend getDefaultLegend() {
|
184 |
// SingleSymbolLegend leg = new SingleSymbolLegend();
|
185 |
// leg.setDefaultSymbol(ArcImsFSymbolFactory.getDefaultFSymbol(featType));
|
186 |
// leg.setShapeType(featType);
|
187 |
// logger.info("Getting default legend");
|
188 |
//
|
189 |
// return leg;
|
190 |
// }
|
191 |
//
|
192 |
// /**
|
193 |
// * Gets a simple Legend with only one symbol
|
194 |
// * @see com.iver.cit.gvsig.fmap.rendering.SingleSymbolLegend
|
195 |
// * @param renderer
|
196 |
// * @return
|
197 |
// */
|
198 |
// private VectorialLegend getLegend(SimpleRenderer renderer) {
|
199 |
// //Get the ArcIMS Simbol
|
200 |
// IArcIMSSymbol imsSimb = renderer.getSymbol();
|
201 |
//
|
202 |
// //Get the FSymbol of the renderer
|
203 |
// FSymbol simb = imsSimb.getFSymbol();
|
204 |
//
|
205 |
// //Creates the legend
|
206 |
// SingleSymbolLegend leg = new SingleSymbolLegend();
|
207 |
// leg.setDefaultSymbol(simb);
|
208 |
// leg.setShapeType(this.featType);
|
209 |
// logger.info("Getting a Simple Renderer");
|
210 |
//
|
211 |
// return (VectorialLegend) leg;
|
212 |
// }
|
213 |
//
|
214 |
// /**
|
215 |
// * Gets a Legend based on intervals
|
216 |
// * @see com.iver.cit.gvsig.fmap.rendering.VectorialIntervalLegend
|
217 |
// * @param renderer
|
218 |
// * @return
|
219 |
// * @throws ArcImsException
|
220 |
// */
|
221 |
// private VectorialLegend getLegend(ValueMapRenderer renderer)
|
222 |
// throws ArcImsException {
|
223 |
// //Get the proper Field Information object
|
224 |
// FieldInformation fi = silf.getFieldInformation(renderer.getLookupfield());
|
225 |
//
|
226 |
// //Gets the array of ranges
|
227 |
// ArrayList values = renderer.getValues();
|
228 |
// Iterator it = values.iterator();
|
229 |
//
|
230 |
// //Creates the two types of legends
|
231 |
// VectorialIntervalLegend viLeg = new VectorialIntervalLegend();
|
232 |
// VectorialUniqueValueLegend vuLeg = new VectorialUniqueValueLegend();
|
233 |
//
|
234 |
// //Initialize counters
|
235 |
// int nIntervals = 0;
|
236 |
// int nUniques = 0;
|
237 |
//
|
238 |
// //Create a default simbol
|
239 |
// FSymbol defSimb = ArcImsFSymbolFactory.getDefaultFSymbol(this.featType);
|
240 |
// defSimb.setDescription("Default");
|
241 |
//
|
242 |
// boolean hasDefSymbol = false;
|
243 |
//
|
244 |
// //Fills with intervals and symbols
|
245 |
// while (it.hasNext()) {
|
246 |
// //Only RangeValueMaps are allowed
|
247 |
// TypeValueMap tvm = (TypeValueMap) it.next();
|
248 |
//
|
249 |
// //Gets the symbol
|
250 |
// IArcIMSSymbol simb = tvm.getSymbol();
|
251 |
// FSymbol fsimb = simb.getFSymbol();
|
252 |
//
|
253 |
// //Set the description
|
254 |
// String descr = tvm.getLabel();
|
255 |
//
|
256 |
// if (descr == null) {
|
257 |
// descr = "";
|
258 |
// }
|
259 |
//
|
260 |
// fsimb.setDescription(descr);
|
261 |
//
|
262 |
// if (tvm instanceof RangeValueMap) {
|
263 |
// RangeValueMap rvm = (RangeValueMap) tvm;
|
264 |
//
|
265 |
// //Get the bounds of the intverval
|
266 |
// String sFrom = rvm.getLower();
|
267 |
// String sTo = rvm.getUpper();
|
268 |
// double from = Double.parseDouble(sFrom.replace(ds, '.'));
|
269 |
// double to = Double.parseDouble(sTo.replace(ds, '.'));
|
270 |
//
|
271 |
// if (descr == null) {
|
272 |
// fsimb.setDescription(sFrom + "-" + sTo);
|
273 |
// }
|
274 |
//
|
275 |
// //Creates the Interval
|
276 |
// FInterval interv = new FInterval(from, to);
|
277 |
//
|
278 |
// //Adds the symbol to the legend
|
279 |
// viLeg.addSymbol(interv, fsimb);
|
280 |
//
|
281 |
// // viLeg.setIntervalSymbol(interv,fsimb);
|
282 |
// nIntervals++;
|
283 |
// } else if (tvm instanceof ExactValueMap) {
|
284 |
// ExactValueMap evm = (ExactValueMap) tvm;
|
285 |
//
|
286 |
// //We have to build a Value object
|
287 |
// String strVal = evm.getValue();
|
288 |
//
|
289 |
// try {
|
290 |
// Value val = ArcImsValueFactory.createValueByType(strVal,
|
291 |
// fi.getType(), this.ds);
|
292 |
// vuLeg.addSymbol(val, fsimb);
|
293 |
// } catch (ParseException e) {
|
294 |
// logger.error(e.getMessage(), e);
|
295 |
// throw new ArcImsException("arcims_legend_error");
|
296 |
// }
|
297 |
//
|
298 |
// nUniques++;
|
299 |
// } else if (tvm instanceof OtherValueMap) {
|
300 |
// hasDefSymbol = true;
|
301 |
// defSimb = fsimb;
|
302 |
// }
|
303 |
// }
|
304 |
//
|
305 |
// /*
|
306 |
// * Determine what type of legend the method will return (Unique or Interval)
|
307 |
// * The condition will be the legend with more classes (intervals, values)
|
308 |
// */
|
309 |
// VectorialLegend leg = null;
|
310 |
// ClassifiedLegend cleg = null;
|
311 |
//
|
312 |
// if (nUniques >= nIntervals) {
|
313 |
// leg = vuLeg;
|
314 |
// cleg = vuLeg;
|
315 |
// } else {
|
316 |
// leg = viLeg;
|
317 |
// cleg = viLeg;
|
318 |
// }
|
319 |
//
|
320 |
// /*
|
321 |
// * Finally we can add the field name and default symbol
|
322 |
// */
|
323 |
//
|
324 |
// //Set the field name
|
325 |
// cleg.setFieldName(ArcXML.replaceUnwantedCharacters(fi.getName()));
|
326 |
//
|
327 |
// // Set the default symbol, if it is used and asign the symbol to a nullvalue
|
328 |
// leg.setDefaultSymbol(defSimb);
|
329 |
// leg.useDefaultSymbol(hasDefSymbol);
|
330 |
//
|
331 |
// if (hasDefSymbol) {
|
332 |
// if (leg instanceof VectorialUniqueValueLegend) {
|
333 |
// vuLeg.addSymbol(new NullUniqueValue(), leg.getDefaultSymbol());
|
334 |
// } else {
|
335 |
// viLeg.addSymbol(new NullIntervalValue(), leg.getDefaultSymbol());
|
336 |
// }
|
337 |
// }
|
338 |
//
|
339 |
// logger.info("Getting a Value Map Renderer");
|
340 |
//
|
341 |
// return leg;
|
342 |
// }
|
343 |
//
|
344 |
// // /**
|
345 |
// // * Gets the most detailed legend from the ScaleDependentRender
|
346 |
// // * @param sdrender
|
347 |
// // * @return
|
348 |
// // */
|
349 |
// // private VectorialLegend getLegend(ScaleDependentRenderer sdrender) throws ArcImsException {
|
350 |
// // VectorialLegend leg = getLegend((GroupRenderer) sdrender);
|
351 |
// // logger.info("Getting a ScaleDependent Renderer");
|
352 |
// // return leg;
|
353 |
// // }
|
354 |
// private VectorialLegend getLegend(GroupRenderer groupRender)
|
355 |
// throws ArcImsException {
|
356 |
// ArrayList renderers = groupRender.renderers;
|
357 |
// ArrayList legends = new ArrayList();
|
358 |
// VectorialLegend biggerScale = null;
|
359 |
// VectorialLegend leg = null;
|
360 |
// double[] limit = { Double.MAX_VALUE, 0 };
|
361 |
// Iterator it = renderers.iterator();
|
362 |
//
|
363 |
// //We use a class variable to overwrite every label definition
|
364 |
// VectorialLegend auxLabelsInner = null;
|
365 |
//
|
366 |
// while (it.hasNext()) {
|
367 |
// leg = null;
|
368 |
//
|
369 |
// Renderer iRender = (Renderer) it.next();
|
370 |
//
|
371 |
// //If we don't have a Label renderer use the generic method
|
372 |
// if (!(iRender instanceof ILabelRenderer)) {
|
373 |
// leg = getLegend(iRender, false);
|
374 |
// }
|
375 |
// //Otherwise, use the specific method for labels
|
376 |
// else {
|
377 |
// auxLabelsInner = getLegend((ILabelRenderer) iRender);
|
378 |
// }
|
379 |
//
|
380 |
// //If renderer is Scale Dependent, we inspect their scale limits
|
381 |
// if (iRender instanceof ScaleDependentRenderer) {
|
382 |
// ScaleDependentRenderer iSDRender = (ScaleDependentRenderer) iRender;
|
383 |
// String strLow = iSDRender.getLower();
|
384 |
// String strUpp = iSDRender.getUpper();
|
385 |
// double low = 0;
|
386 |
// double upp = Double.MAX_VALUE;
|
387 |
//
|
388 |
// if (strLow != null) {
|
389 |
// low = Double.parseDouble(strLow.replace(ds, '.'));
|
390 |
// }
|
391 |
//
|
392 |
// if (strUpp != null) {
|
393 |
// upp = Double.parseDouble(strUpp.replace(ds, '.'));
|
394 |
// }
|
395 |
//
|
396 |
// //First loop
|
397 |
// if (biggerScale == null) {
|
398 |
// biggerScale = leg;
|
399 |
// limit[0] = low;
|
400 |
// limit[1] = upp;
|
401 |
// }
|
402 |
// /*
|
403 |
// * Next loops we allways get the minimum interval
|
404 |
// * If lower bounds are equal, we get the lower upper value
|
405 |
// */
|
406 |
// else if ((low <= limit[0]) && (upp <= limit[1])) {
|
407 |
// limit[0] = low;
|
408 |
// limit[1] = upp;
|
409 |
// biggerScale = leg;
|
410 |
// }
|
411 |
// }
|
412 |
//
|
413 |
// if (leg != null) {
|
414 |
// legends.add(leg);
|
415 |
// }
|
416 |
// }
|
417 |
//
|
418 |
// /*
|
419 |
// * TODO At this time we will return the first (bottom) legend of the ArrayList
|
420 |
// * or the most detailed legend if there are any ScaleDependentRenderers
|
421 |
// * Probably I will add more "logic" into this code
|
422 |
// */
|
423 |
// VectorialLegend finalLegend = null;
|
424 |
// boolean onlyLabels = false;
|
425 |
//
|
426 |
// /*
|
427 |
// * Check if auxLabels is equal to the last element of the array Legends and if
|
428 |
// * it's true, merge it with the first one (its label definition)
|
429 |
// */
|
430 |
// if (auxLabelsOuter!=null && legends.size()>0){
|
431 |
//
|
432 |
// for (int i=0;i<legends.size();i++){
|
433 |
//// FSymbol simb1 = auxLabelsOuter.getDefaultSymbol();
|
434 |
//// FSymbol simb2 = ((VectorialLegend) legends.get(i)).getDefaultSymbol();
|
435 |
// FSymbol simb1 = (FSymbol) auxLabelsOuter.getDefaultSymbol();
|
436 |
// FSymbol simb2 = (FSymbol) ((VectorialLegend) legends.get(i)).getDefaultSymbol();
|
437 |
//
|
438 |
// if (simb1==simb2){
|
439 |
// //Null the biggerScale to force the next if statement
|
440 |
// biggerScale = null;
|
441 |
// //Merge the auxLabels object into the first legend of the arrayList
|
442 |
// VectorialLegend legend = setLabelDefIntoSymbol(auxLabelsOuter,(VectorialLegend) legends.get(0));
|
443 |
// legends.set(0,legend);
|
444 |
// //Null the auxlabelsinner to avoid the last if
|
445 |
// auxLabelsInner = null;
|
446 |
// break;
|
447 |
// }
|
448 |
// }
|
449 |
//
|
450 |
//
|
451 |
// }
|
452 |
//
|
453 |
// //We don't have any scaledependent
|
454 |
// if (((biggerScale == null) && (legends.size() > 0))) {
|
455 |
// //if (!(groupRender instanceof ScaleDependentRenderer)){
|
456 |
// logger.info("Getting the bottom renderer of the Group Renderer");
|
457 |
// finalLegend = (VectorialLegend) legends.get(0);
|
458 |
// }
|
459 |
// //We have any scaledpendent
|
460 |
// else if (biggerScale != null) {
|
461 |
// logger.info(
|
462 |
// "Getting the most detailed ScaleDependent renderer of the Group Renderer");
|
463 |
// finalLegend = biggerScale;
|
464 |
// }
|
465 |
// //We don't have any legend parsed (maybe the layer only have label definitions
|
466 |
// else {
|
467 |
// finalLegend = LegendFactory.createSingleSymbolLegend(this.featType);
|
468 |
// onlyLabels = true;
|
469 |
// }
|
470 |
//
|
471 |
// /*
|
472 |
// * Finally if some label renderer is found, we have to pass the label
|
473 |
// * properties to the final legend
|
474 |
// */
|
475 |
// if (auxLabelsInner != null) {
|
476 |
// finalLegend = setLabelDefIntoSymbol(auxLabelsInner,finalLegend);
|
477 |
//
|
478 |
// // finalLegend.getDefaultSymbol().setShapeVisible(!onlyLabels);
|
479 |
// ((FSymbol) finalLegend.getDefaultSymbol()).setShapeVisible(!onlyLabels);
|
480 |
//
|
481 |
// auxLabelsOuter = finalLegend;
|
482 |
// }
|
483 |
// return finalLegend;
|
484 |
// }
|
485 |
//
|
486 |
// /**
|
487 |
// * Method that returns a SingleSymboLegend with Font definition and
|
488 |
// * field to retrieve labels. These properties will be transferred to the
|
489 |
// * main layer legend.
|
490 |
// * @param renderer
|
491 |
// * @return
|
492 |
// */
|
493 |
// private VectorialLegend getLegend(ILabelRenderer renderer) {
|
494 |
// //Get the proper Field Information object
|
495 |
// FieldInformation fi = silf.getFieldInformation(renderer.getField());
|
496 |
//
|
497 |
// //Create a legend
|
498 |
// SingleSymbolLegend leg = (SingleSymbolLegend) LegendFactory.createSingleSymbolLegend(this.featType);
|
499 |
// IArcIMSSymbol arcSimb = null;
|
500 |
//
|
501 |
// //Get the ArcIMS Symbol with Font definition
|
502 |
// if (renderer instanceof SimpleLabelRenderer) {
|
503 |
// SimpleLabelRenderer slrender = (SimpleLabelRenderer) renderer;
|
504 |
// arcSimb = slrender.getSymbol();
|
505 |
// } else if (renderer instanceof ValueMapLabelRenderer) {
|
506 |
// ValueMapLabelRenderer vmlrender = (ValueMapLabelRenderer) renderer;
|
507 |
// arcSimb = vmlrender.getValue(0).getSymbol();
|
508 |
// }
|
509 |
//
|
510 |
// //Asign it (or a default) to the legend
|
511 |
// if (arcSimb != null) {
|
512 |
// leg.setDefaultSymbol(arcSimb.getFSymbol());
|
513 |
// } else {
|
514 |
// leg.setDefaultSymbol(ArcImsFSymbolFactory.getDefaultFSymbol(
|
515 |
// this.featType));
|
516 |
// }
|
517 |
//
|
518 |
// //Set the label field
|
519 |
// leg.setLabelField(ArcXML.replaceUnwantedCharacters(fi.getName()));
|
520 |
//
|
521 |
// //Return the legend
|
522 |
// return leg;
|
523 |
// }
|
524 |
//
|
525 |
// /**
|
526 |
// * @return Returns the featType.
|
527 |
// */
|
528 |
// public int getFeatType() {
|
529 |
// return featType;
|
530 |
// }
|
531 |
//
|
532 |
// /**
|
533 |
// * @param featType The featType to set.
|
534 |
// */
|
535 |
// public void setFeatType(int featType) {
|
536 |
// this.featType = featType;
|
537 |
// }
|
538 |
//
|
539 |
// /**
|
540 |
// * Gets the simple class name
|
541 |
// * @param mclass
|
542 |
// * @return
|
543 |
// */
|
544 |
// private String getClassName(Class mclass) {
|
545 |
// String[] classSplitted = mclass.getName().split("\\.");
|
546 |
//
|
547 |
// return classSplitted[classSplitted.length - 1];
|
548 |
// }
|
549 |
//
|
550 |
// /**
|
551 |
// * Private method to set into a legend the label definition of another legend
|
552 |
// * @param withLabels
|
553 |
// * @param finalLegend
|
554 |
// * @return
|
555 |
// */
|
556 |
// private VectorialLegend setLabelDefIntoSymbol(VectorialLegend withLabels,
|
557 |
// VectorialLegend finalLegend) {
|
558 |
//
|
559 |
// //Set the label
|
560 |
// finalLegend.setLabelField(withLabels.getLabelField());
|
561 |
// //Get simbol with font definition
|
562 |
//
|
563 |
// // FSymbol simbWithFont = withLabels.getDefaultSymbol();
|
564 |
// FSymbol simbWithFont = (FSymbol) withLabels.getDefaultSymbol();
|
565 |
//
|
566 |
// //Get simbol to insert font definition
|
567 |
// // FSymbol simb = finalLegend.getDefaultSymbol();
|
568 |
// FSymbol simb = (FSymbol) finalLegend.getDefaultSymbol();
|
569 |
//
|
570 |
// //Insert into simb the font properties
|
571 |
// simb.setFont(simbWithFont.getFont());
|
572 |
// simb.setFontColor(simbWithFont.getFontColor());
|
573 |
// simb.setFontSize(simbWithFont.getFontSize());
|
574 |
// simb.setFontSizeInPixels(true);
|
575 |
// //Set simbol modified into final legend to return
|
576 |
// finalLegend.setDefaultSymbol(simb);
|
577 |
//
|
578 |
// return finalLegend;
|
579 |
// }
|
580 |
//
|
581 |
// /**
|
582 |
// * Converts ArcIMS feature type to a FConstant value
|
583 |
// * @param fclasstype
|
584 |
// * @return
|
585 |
// */
|
586 |
// private int getSymbType(String fclasstype) {
|
587 |
// if (fclasstype.equals(ServiceInfoTags.aPOLYGON)) {
|
588 |
// return FConstant.SYMBOL_TYPE_FILL;
|
589 |
// }
|
590 |
//
|
591 |
// if (fclasstype.equals(ServiceInfoTags.aPOLYLINE)) {
|
592 |
// return FConstant.SYMBOL_TYPE_LINE;
|
593 |
// }
|
594 |
//
|
595 |
// if (fclasstype.equals(ServiceInfoTags.aMULTIPOINT)) {
|
596 |
// return FConstant.SYMBOL_TYPE_POINT;
|
597 |
// }
|
598 |
//
|
599 |
// return FConstant.SHAPE_TYPE_NULL;
|
600 |
// }
|
601 |
} |