Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/GroupLayerReader.java @ 244:276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 09 Aug 2011 17:27:18 +0200 |
parents | df4e0946ef02 |
children | 2cb2f26d0d54 |
rev | line source |
---|---|
243
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
1 /* |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH, Germany <info@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
3 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
4 * This file is part of MXD2map. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
5 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
6 * This program is free software under the LGPL (>=v2.1) |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
7 * Read the file LICENCE.txt coming with the software for details |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
8 * or visit http://www.gnu.org/licenses/ if it does not exist. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
9 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
10 * MXD2map has been developed on behalf of the |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
11 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
12 * by Intevation GmbH. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
13 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
14 * Authors: |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
15 * Raimund Renkert <raimund.renkert@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
16 * Bjoern Schilberg <bjoern.schilberg@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
17 * Stephan Holl <stephan.holl@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
18 */ |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
181
diff
changeset
|
19 |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
20 package de.intevation.mxd.reader; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
21 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
22 import java.io.IOException; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
23 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
24 import org.apache.log4j.Logger; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
25 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
26 import com.esri.arcgis.carto.ILayer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
27 import com.esri.arcgis.carto.FeatureLayer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
28 import com.esri.arcgis.carto.GdbRasterCatalogLayer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
29 import com.esri.arcgis.carto.IFeatureRenderer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
30 import com.esri.arcgis.carto.SimpleRenderer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
31 import com.esri.arcgis.carto.ClassBreaksRenderer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
32 import com.esri.arcgis.carto.UniqueValueRenderer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
33 import com.esri.arcgis.carto.GroupLayer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
34 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
35 import org.w3c.dom.Document; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
36 import org.w3c.dom.Element; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
37 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
38 import de.intevation.mxd.ArcGISInitializer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
39 import de.intevation.mxd.utils.MapToXMLUtils; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
40 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
41 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
42 /** |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
43 * Reads Layer information. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
44 * |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
45 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
46 */ |
244
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
47 public class GroupLayerReader { |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
48 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
49 /** |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
50 * The logger. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
51 */ |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
52 private static final Logger logger = |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
53 Logger.getLogger(FeatureLayerReader.class); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
54 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
55 /** |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
56 * Privte member. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
57 */ |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
58 private GroupLayer layer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
59 private MapToXMLUtils util; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
60 private int invalidLayerCount; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
61 |
181 | 62 /** |
63 * Constructor with layer. | |
64 * | |
65 * @param layer The ArcGIS layer object. | |
66 */ | |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
67 public GroupLayerReader(ILayer layer) |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
68 throws Exception { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
69 if(layer instanceof GroupLayer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
70 this.layer = (GroupLayer)layer; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
71 invalidLayerCount = 0; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
72 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
73 else { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
74 throw new Exception("Not an instance of GroupLayer: " + |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
75 layer.getClass().toString()); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
76 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
77 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
78 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
79 /** |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
80 * Setter for XML document helper. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
81 * |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
82 * @param util The helper for storing map information. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
83 */ |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
84 public void setUtil(MapToXMLUtils util) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
85 this.util = util; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
86 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
87 |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
88 /** |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
89 * Reads the Layer content. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
90 * |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
91 * @return The layer XML element. |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
92 */ |
244
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
93 public Element read(String group) |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
94 throws IOException{ |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
95 logger.debug("read()"); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
96 Element layerElement = null; |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
97 for(int i = 0; i < layer.getCount();i++) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
98 ILayer lay = layer.getLayer(i); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
99 try { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
100 if (lay instanceof FeatureLayer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
101 FeatureLayerReader lr = new FeatureLayerReader(lay); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
102 lr.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
103 layerElement = lr.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
104 if (layerElement == null) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
105 continue; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
106 } |
244
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
107 layerElement.setAttribute("group", group + "/" + layer.getName()); |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
108 IFeatureRenderer renderer = |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
109 ((FeatureLayer)lay).getRenderer(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
110 IRendererReader rreader; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
111 if(renderer instanceof SimpleRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
112 rreader = new SimpleRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
113 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
114 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
115 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
116 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
117 else if(renderer instanceof ClassBreaksRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
118 rreader = new ClassBreakRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
119 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
120 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
121 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
122 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
123 else if(renderer instanceof UniqueValueRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
124 rreader = new UniqueValueRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
125 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
126 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
127 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
128 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
129 else{ |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
130 logger.debug("Not a known renderer type " + |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
131 renderer.getClass().toString()); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
132 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
133 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
134 else if(lay instanceof GdbRasterCatalogLayer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
135 GdbRasterCatalogLayerReader gclr = |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
136 new GdbRasterCatalogLayerReader(lay); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
137 gclr.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
138 layerElement = gclr.read(); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
139 layerElement.setAttribute("group", layer.getName()); |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
140 IFeatureRenderer renderer = |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
141 ((GdbRasterCatalogLayer)lay).getRenderer(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
142 IRendererReader rreader; |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
143 if(renderer instanceof SimpleRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
144 rreader = new SimpleRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
145 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
146 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
147 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
148 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
149 else if(renderer instanceof ClassBreaksRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
150 rreader = new ClassBreakRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
151 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
152 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
153 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
154 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
155 else if(renderer instanceof UniqueValueRenderer) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
156 rreader = new UniqueValueRendererReader(renderer); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
157 rreader.setParent(layerElement); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
158 rreader.setUtil(util); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
159 rreader.read(); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
160 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
161 else { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
162 logger.debug("Not a known renderer type " + |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
163 renderer.getClass().toString()); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
164 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
165 } |
244
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
166 else if(lay instanceof GroupLayer) { |
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
167 GroupLayerReader glr = new GroupLayerReader (lay); |
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
168 glr.setUtil(this.util); |
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
169 layerElement = glr.read("/" + layer.getName()); |
276f63c86f1c
Refactored group layer handling and "wms_title" metadata.
raimund renkert <raimund.renkert@intevation.de>
parents:
243
diff
changeset
|
170 } |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
171 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
172 catch(Exception e) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
173 invalidLayerCount++; |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
174 if(i == 0 && (i + 1) == layer.getCount() || |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
175 invalidLayerCount == layer.getCount()) { |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
176 throw new IOException( |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
177 "No valid layer in MXD file." + |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
178 " Aborting."); |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
179 } |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
180 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
181 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
148
diff
changeset
|
182 return layerElement; |
148
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
183 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
184 } |
2bf35f0babd0
Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff
changeset
|
185 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |