annotate src/java/de/intevation/mxd/reader/FillSymbolReader.java @ 347:02d3c1665a46

Shorten long paths for better pdf representation
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 16 Nov 2012 17:02:33 +0100
parents a46adb3697fa
children
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
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 package de.intevation.mxd.reader;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 import java.lang.Exception;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 import org.w3c.dom.Element;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 import org.apache.log4j.Logger;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 import com.esri.arcgis.display.ISymbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 import com.esri.arcgis.display.IFillSymbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 import com.esri.arcgis.display.MultiLayerFillSymbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 import com.esri.arcgis.display.SimpleFillSymbol;
75
9ea64427ac7e Added marker fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 72
diff changeset
32 import com.esri.arcgis.display.MarkerFillSymbol;
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 75
diff changeset
33 import com.esri.arcgis.display.LineFillSymbol;
251
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
34 import com.esri.arcgis.display.PictureFillSymbol;
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 /**
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 * Wrapper for fill symbol reader.
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 *
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 */
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 public class FillSymbolReader
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 extends AbstractSymbolReader {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 /**
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 * The logger.
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46 */
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47 private static final Logger logger =
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 Logger.getLogger(FillSymbolReader.class);
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
50 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
51 * Private member.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
52 */
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
53 private ISymbol symbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54 private IFillSymbol fillSymbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
56 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
57 * Default constructor.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
58 */
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
59 public FillSymbolReader()
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
60 throws Exception {
336
a46adb3697fa Fix annoying typo. s/contructor/constructor
Andre Heinecke <aheinecke@intevation.de>
parents: 260
diff changeset
61 logger.debug("constructor()");
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 this.symbol = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 this.fillSymbol = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
65
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
66 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
67 * Constructor with symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
68 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
69 * @param symbol The symbol used to display polygons.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
70 */
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
71 public FillSymbolReader(ISymbol symbol)
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
72 throws Exception {
336
a46adb3697fa Fix annoying typo. s/contructor/constructor
Andre Heinecke <aheinecke@intevation.de>
parents: 260
diff changeset
73 logger.debug("constructor(ISymbol)");
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
74 this.symbol = symbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75 this.fillSymbol = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
78 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
79 * Constructor with symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
80 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
81 * @param symbol The symbol used to display polygons.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
82 */
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
83 public FillSymbolReader(IFillSymbol symbol)
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
84 throws Exception {
336
a46adb3697fa Fix annoying typo. s/contructor/constructor
Andre Heinecke <aheinecke@intevation.de>
parents: 260
diff changeset
85 logger.debug("constructor(ILineSymbol)");
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86 this.fillSymbol = symbol;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 this.symbol= null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
90 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
91 * Read the symbol attributes.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
92 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
93 * @return DOM element containing the symbol attributes.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
94 */
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
95 public Element read() {
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
96 ISymbolReader sreader = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
97 if(symbol != null) {
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
98 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
99 if(symbol instanceof SimpleFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
100 sreader = new SimpleFillSymbolReader(symbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
101 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
102 else if(symbol instanceof MultiLayerFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
103 sreader = new MultiLayerFillSymbolReader(symbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
104 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
105 else if(symbol instanceof MarkerFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
106 sreader = new MarkerFillSymbolReader(symbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
107 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
108 else if(symbol instanceof LineFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
109 sreader = new LineFillSymbolReader(symbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
110 }
251
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
111 else if(symbol instanceof PictureFillSymbol) {
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
112 sreader = new PictureFillSymbolReader(symbol);
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
113 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
114 else {
180
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
115 logger.debug("The reader for type " +
f4eb506499f5 Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents: 115
diff changeset
116 symbol.getClass().toString() +
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
117 " is not implemented!");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
118 return parent;
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
119 }
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
120 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
121 catch(Exception e) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
122 logger.error(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
123 "Could not read the symbol " +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
124 symbol.getClass().toString());
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
125 return parent;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
126 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
127 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
128 else if(fillSymbol != null) {
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
129 try {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
130 if(fillSymbol instanceof SimpleFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
131 sreader = new SimpleFillSymbolReader(fillSymbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
132 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
133 else if(fillSymbol instanceof MultiLayerFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
134 sreader = new MultiLayerFillSymbolReader(fillSymbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
135 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
136 else if(fillSymbol instanceof MarkerFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
137 sreader = new MarkerFillSymbolReader(fillSymbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
138 }
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
139 else if(fillSymbol instanceof LineFillSymbol) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
140 sreader = new LineFillSymbolReader(fillSymbol);
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
141 }
251
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
142 else if(fillSymbol instanceof PictureFillSymbol) {
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
143 sreader = new PictureFillSymbolReader(fillSymbol);
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
144 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
145 else {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
146 logger.debug("The reader for type " +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
147 fillSymbol.getClass().toString() +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
148 " is not implemented!");
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
149 return parent;
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
150 }
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
151 }
115
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
152 catch(Exception e) {
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
153 logger.error(
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
154 "Could not read the symbol " +
fb93f20478cc Improved exception handling for symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 76
diff changeset
155 symbol.getClass().toString());
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
156 return parent;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
157 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
158 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
159 else {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
160 return parent;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
161 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
162 if (sreader != null) {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
163 sreader.setParent(parent);
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
164 sreader.setUtil(util);
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
165 sreader.read();
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
166 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
167 return parent;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
168 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
169
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
170 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
171 * Sets the symbol to read.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
172 *
260
10e0aa283217 Updated documentation and added ant task for javadoc generation.
raimund renkert <raimund.renkert@intevation.de>
parents: 251
diff changeset
173 * @param sym The symbol used to display polygons.
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
174 */
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
175 public void setSymbol(ISymbol sym) {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
176 this.symbol = sym;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
177 this.fillSymbol = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
178 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
179
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
180 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
181 * Sets the symbol to read.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
182 *
260
10e0aa283217 Updated documentation and added ant task for javadoc generation.
raimund renkert <raimund.renkert@intevation.de>
parents: 251
diff changeset
183 * @param sym The symbol used to display polygons.
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
184 */
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
185 public void setSymbol(IFillSymbol sym) {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
186 this.symbol = null;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
187 this.fillSymbol = sym;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
188 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
189
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
190 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
191 * Determine whether this reader can be used to read the symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
192 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
193 * @param sym The ArcGIS symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
194 */
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
195 public boolean canRead(ISymbol sym) {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
196 if(sym instanceof SimpleFillSymbol ||
75
9ea64427ac7e Added marker fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 72
diff changeset
197 sym instanceof MarkerFillSymbol ||
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 75
diff changeset
198 sym instanceof MultiLayerFillSymbol ||
251
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
199 sym instanceof LineFillSymbol ||
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
200 sym instanceof PictureFillSymbol) {
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
201 return true;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
202 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
203 else {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
204 return false;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
205 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
206 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
207
181
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
208 /**
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
209 * Determine whether this reader can be used to read the symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
210 *
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
211 * @param sym The ArcGIS symbol.
0bde090506f9 Added comments.
Raimund Renkert <rrenkert@intevation.de>
parents: 180
diff changeset
212 */
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
213 public boolean canRead(IFillSymbol sym) {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
214 if(sym instanceof SimpleFillSymbol ||
75
9ea64427ac7e Added marker fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 72
diff changeset
215 sym instanceof MarkerFillSymbol ||
76
3087c89a5bb8 Added line fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 75
diff changeset
216 sym instanceof MultiLayerFillSymbol ||
251
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
217 sym instanceof LineFillSymbol ||
6b80e46b8f38 Added picture symbol support to the converter.
raimund renkert <raimund.renkert@intevation.de>
parents: 243
diff changeset
218 sym instanceof PictureFillSymbol) {
72
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
219 return true;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
220 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
221 else {
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
222 return false;
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
223 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
224 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
225 }
2cbe423b1fda Added wrapper for fill symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
226 // 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)