annotate src/java/de/intevation/mxd/reader/PictureMarkerSymbolReader.java @ 110:01cd6b736acd

* mapserver/mapfile/mxd.map: Added ows_enable_request-directive to allow OGC-services.
author Stephan Holl <stephan.holl@intevation.de>
date Tue, 14 Jun 2011 12:40:37 +0200
parents 475ee3e4bc8b
children fb93f20478cc
rev   line source
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package de.intevation.mxd.reader;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import org.apache.log4j.Logger;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import com.esri.arcgis.display.ISymbol;
63
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
6 import com.esri.arcgis.display.IMarkerSymbol;
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import com.esri.arcgis.display.PictureMarkerSymbol;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 import com.esri.arcgis.carto.PictureElement;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import org.w3c.dom.Element;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 /**
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 * Reads picture marker symbol information.
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 *
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 */
80
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
17 public class PictureMarkerSymbolReader
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
18 extends AbstractSymbolReader {
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 /**
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 * The logger.
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 */
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 private static final Logger logger =
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 Logger.getLogger(PictureMarkerSymbolReader.class);
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 /**
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 * Private member.
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 */
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 private PictureMarkerSymbol symbol;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 public PictureMarkerSymbolReader(ISymbol symbol)
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 throws Exception {
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 logger.debug("contructor()");
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 if(symbol instanceof PictureMarkerSymbol) {
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 this.symbol = (PictureMarkerSymbol)symbol;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 }
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 else {
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 throw new Exception("Not a PictureMarkerSymbol!");
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 }
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 }
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41
63
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
42 public PictureMarkerSymbolReader(IMarkerSymbol symbol)
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
43 throws Exception {
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
44 logger.debug("contructor()");
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
45 if(symbol instanceof PictureMarkerSymbol) {
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
46 this.symbol = (PictureMarkerSymbol)symbol;
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
47 }
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
48 else {
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
49 throw new Exception("Not a PictureMarkerSymbol!");
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
50 }
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
51 }
5c5ef5768893 Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 58
diff changeset
52
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
53 /**
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54 * Reads the symbol attributes.
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55 *
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 * @return The XML node.
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 */
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
58 public Element read()
74
7eba97e8201b Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents: 69
diff changeset
59 throws Exception {
84
2362609ffa66 Added TODOs for picture symbols.
Raimund Renkert <rrenkert@intevation.de>
parents: 83
diff changeset
60 //TODO Read the picture from mxd and write it as base64 string to the
2362609ffa66 Added TODOs for picture symbols.
Raimund Renkert <rrenkert@intevation.de>
parents: 83
diff changeset
61 // XML Element.
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 logger.debug("read()");
80
83932f18dddc All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents: 74
diff changeset
63 Element symbolElement = util.addSymbol(parent);
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
64
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
65 symbolElement.setAttribute(
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
66 "angle",
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
67 String.valueOf(symbol.getAngle()));
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
68 symbolElement.setAttribute(
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 "size",
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
70 String.valueOf(symbol.getSize()));
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
71 symbolElement.setAttribute(
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72 "x_offset",
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
73 String.valueOf(symbol.getXOffset()));
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
74 symbolElement.setAttribute(
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75 "y_offset",
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
76 String.valueOf(symbol.getYOffset()));
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77 symbolElement.setAttribute(
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 "name",
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 symbol.getNameString());
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
80 PictureElement pElem = new PictureElement();
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
81 pElem.importPicture(symbol.getPicture());
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
82 symbolElement.setAttribute("style", "picture");
89
475ee3e4bc8b Added "type" as XML attribute to symbols.
Raimund Renkert <rrenkert@intevation.de>
parents: 84
diff changeset
83 symbolElement.setAttribute("type", "marker");
58
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 return symbolElement;
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 }
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86 }
4e0464c620f0 Introduced the picture symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 // 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)