annotate src/java/de/intevation/mxd/reader/GroupLayerReader.java @ 243:df4e0946ef02

Added LGPL header.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 09 Aug 2011 14:24:51 +0200
parents 0bde090506f9
children 276f63c86f1c
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 */
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
47 public class GroupLayerReader
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
48 implements ILayerReader {
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 /**
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
51 * The logger.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
52 */
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
53 private static final Logger logger =
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
54 Logger.getLogger(FeatureLayerReader.class);
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 /**
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
57 * Privte member.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
58 */
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
59 private GroupLayer layer;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
60 private MapToXMLUtils util;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
61 private int invalidLayerCount;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
62
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
63 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
64 * Constructor with layer.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
65 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
66 * @param layer The ArcGIS layer object.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
67 */
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
68 public GroupLayerReader(ILayer layer)
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
69 throws Exception {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
70 if(layer instanceof GroupLayer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
71 this.layer = (GroupLayer)layer;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
72 invalidLayerCount = 0;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
73 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
74 else {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
75 throw new Exception("Not an instance of GroupLayer: " +
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
76 layer.getClass().toString());
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 /**
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
81 * Setter for XML document helper.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
82 *
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
83 * @param util The helper for storing map information.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
84 */
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
85 public void setUtil(MapToXMLUtils util) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
86 this.util = util;
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 /**
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
90 * Reads the Layer content.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
91 *
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
92 * @return The layer XML element.
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
93 */
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
94 public Element read()
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
95 throws IOException{
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
96 logger.debug("read()");
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
97 Element layerElement = null;
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
98 for(int i = 0; i < layer.getCount();i++) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
99 ILayer lay = layer.getLayer(i);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
100 try {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
101 if (lay instanceof FeatureLayer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
102 FeatureLayerReader lr = new FeatureLayerReader(lay);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
103 lr.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
104 layerElement = lr.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
105 if (layerElement == null) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
106 continue;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
107 }
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
108 layerElement.setAttribute("group", layer.getName());
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
109 IFeatureRenderer renderer =
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
110 ((FeatureLayer)lay).getRenderer();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
111 IRendererReader rreader;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
112 if(renderer instanceof SimpleRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
113 rreader = new SimpleRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
114 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
115 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
116 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
117 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
118 else if(renderer instanceof ClassBreaksRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
119 rreader = new ClassBreakRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
120 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
121 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
122 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
123 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
124 else if(renderer instanceof UniqueValueRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
125 rreader = new UniqueValueRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
126 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
127 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
128 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
129 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
130 else{
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
131 logger.debug("Not a known renderer type " +
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
132 renderer.getClass().toString());
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 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
135 else if(lay instanceof GdbRasterCatalogLayer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
136 GdbRasterCatalogLayerReader gclr =
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
137 new GdbRasterCatalogLayerReader(lay);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
138 gclr.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
139 layerElement = gclr.read();
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
140 layerElement.setAttribute("group", layer.getName());
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
141 IFeatureRenderer renderer =
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
142 ((GdbRasterCatalogLayer)lay).getRenderer();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
143 IRendererReader rreader;
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
144 if(renderer instanceof SimpleRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
145 rreader = new SimpleRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
146 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
147 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
148 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
149 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
150 else if(renderer instanceof ClassBreaksRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
151 rreader = new ClassBreakRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
152 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
153 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
154 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
155 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
156 else if(renderer instanceof UniqueValueRenderer) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
157 rreader = new UniqueValueRendererReader(renderer);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
158 rreader.setParent(layerElement);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
159 rreader.setUtil(util);
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
160 rreader.read();
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
161 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
162 else {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
163 logger.debug("Not a known renderer type " +
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
164 renderer.getClass().toString());
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
165 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
166 }
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
167 }
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
168 catch(Exception e) {
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
169 invalidLayerCount++;
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
170 if(i == 0 && (i + 1) == layer.getCount() ||
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
171 invalidLayerCount == layer.getCount()) {
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
172 throw new IOException(
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
173 "No valid layer in MXD file." +
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
174 " Aborting.");
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
175 }
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
176 }
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
177 }
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 148
diff changeset
178 return layerElement;
148
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
179 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
180 }
2bf35f0babd0 Implemented new group layer functionality.
vc11884admin@VC11884.win.bsh.de
parents:
diff changeset
181 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)