Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/LabelEngineReader.java @ 247:30e10eb9ac68
Print out a message if an empty layer is not written to the mapfile.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 10 Aug 2011 13:23:29 +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 |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 package de.intevation.mxd.reader; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 import org.apache.log4j.Logger; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 import com.esri.arcgis.carto.ILayer; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 import com.esri.arcgis.carto.FeatureLayer; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 import com.esri.arcgis.carto.AnnotateLayerPropertiesCollection; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 import com.esri.arcgis.carto.IAnnotateLayerProperties; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 import com.esri.arcgis.carto.LabelEngineLayerProperties; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 import com.esri.arcgis.geodatabase.FeatureClassName; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 import com.esri.arcgis.system.IName; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 import com.esri.arcgis.system.IPropertySet; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 import com.esri.arcgis.display.ITextSymbol; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 import com.esri.arcgis.display.TextSymbol; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 import org.w3c.dom.Element; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 import de.intevation.mxd.utils.MapToXMLUtils; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 import java.io.IOException; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 import com.esri.arcgis.interop.AutomationException; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 /** |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 * Reads Label information. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 * |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 */ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 public class LabelEngineReader { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 /** |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 * The logger. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 */ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 private static final Logger logger = |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 Logger.getLogger(LabelEngineReader.class); |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 /** |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 * Privte member. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 */ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 private LabelEngineLayerProperties properties; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 private MapToXMLUtils util; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 private Element parent; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 |
181 | 60 /** |
61 * Constructor with annotation properties. | |
62 * | |
63 * @param prop The annotation properties object. | |
64 */ | |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 public LabelEngineReader(IAnnotateLayerProperties prop) |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 throws Exception { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 if(prop instanceof LabelEngineLayerProperties) { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 this.properties = (LabelEngineLayerProperties)prop; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 else { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
71 throw new Exception("Not an instance of" + |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
72 " LaberEngineLayerProperties: " + |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
73 prop.getClass().toString()); |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 /** |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 * Setter for XML document helper. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 * |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 * @param util The helper for storing map information. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 */ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 public void setUtil(MapToXMLUtils util) { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 this.util = util; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 |
181 | 86 /** |
87 * Setter for the parent DOM element. | |
88 * | |
89 * @param parent The parent DOM element. | |
90 */ | |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 public void setParent(Element parent) { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
92 this.parent = parent; |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 /** |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 * Reads the Label content. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 * |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 * @return The label XML element. |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 */ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 public Element read() |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 throws IOException{ |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 logger.debug("read()"); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
103 Element labelElement; |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 try { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 labelElement = util.addLabel(parent); |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 catch(Exception e) { |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 logger.error("Failed to create DOM-Element for Label."); |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 return null; |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
112 try { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
113 labelElement.setAttribute( |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
114 "expression", |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
115 properties.getExpression()); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
116 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
117 catch(IOException ioe) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
118 logger.warn("Could not read label expression."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
119 return null; |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
120 } |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 try { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
123 labelElement.setAttribute( |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 "offset", |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
125 String.valueOf(properties.getOffset())); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
126 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
127 catch(IOException ioe) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
128 logger.warn("Could not read label offset."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
129 } |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 try { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
132 labelElement.setAttribute( |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
133 "definition_query", |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
134 properties.getWhereClause()); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
135 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
136 catch(IOException ioe) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
137 logger.warn("Could not read label where clause."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
138 } |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
140 try { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
141 labelElement.setAttribute( |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
142 "max_scale", |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
143 String.valueOf(properties.getAnnotationMaximumScale())); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
144 labelElement.setAttribute( |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
145 "min_scale", |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
146 String.valueOf(properties.getAnnotationMinimumScale())); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
147 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
148 catch(IOException ioe) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
149 logger.warn("Could not read label scale."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
150 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
151 |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
152 try { |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 ITextSymbol sym = properties.getSymbol(); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
154 if(sym instanceof TextSymbol) { |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
155 TextSymbolReader tsr = new TextSymbolReader(sym); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
156 tsr.setParent(labelElement); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
157 tsr.setUtil(util); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
158 tsr.read(); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
159 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
160 } |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 catch(Exception e) { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
162 logger.warn("Could not read label text symbol."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
163 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
164 |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
179
diff
changeset
|
165 return labelElement; |
179
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 } |
f3a91cd7440b
Added a first version of feature labeling.
raimund renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |