Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java @ 26:3e24fffdf2bb
Moved reader components to reader folder.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 08 Apr 2011 12:26:17 +0200 |
parents | src/java/de/intevation/mxd/SimpleMarkerSymbolReader.java@cbd67b1100d8 |
children | 40c0b4e5f91a |
comparison
equal
deleted
inserted
replaced
25:cbd67b1100d8 | 26:3e24fffdf2bb |
---|---|
1 //package de.intevation.mxd.reader; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import org.apache.log4j.Logger; | |
6 | |
7 import com.esri.arcgis.display.ISymbol; | |
8 import com.esri.arcgis.display.SimpleMarkerSymbol; | |
9 import com.esri.arcgis.display.esriSimpleMarkerStyle; | |
10 import com.esri.arcgis.display.IRgbColor; | |
11 import com.esri.arcgis.display.RgbColor; | |
12 | |
13 /** | |
14 * Reads simple marker symbol information. | |
15 * | |
16 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
17 */ | |
18 public class SimpleMarkerSymbolReader implements ISymbolReader{ | |
19 | |
20 //Member | |
21 private static final Logger logger = Logger.getLogger(SimpleMarkerSymbolReader.class); | |
22 | |
23 private SimpleMarkerSymbol symbol; | |
24 | |
25 //Constructor | |
26 public SimpleMarkerSymbolReader(ISymbol symbol) throws Exception{ | |
27 logger.debug("contructor()"); | |
28 if(symbol instanceof SimpleMarkerSymbol) | |
29 this.symbol = (SimpleMarkerSymbol)symbol; | |
30 else | |
31 throw new Exception("Not a SimpleMarkerSymbol!"); | |
32 } | |
33 | |
34 | |
35 //Methods | |
36 public boolean read() throws IOException{ | |
37 logger.debug("read()"); | |
38 System.out.println("--------------------"); | |
39 System.out.println("Symbol information:"); | |
40 System.out.println("Name\t\t = " + symbol.getNameString()); | |
41 | |
42 if(symbol.getStyle() == esriSimpleMarkerStyle.esriSMSCircle) | |
43 System.out.println("Style\t\t = Point"); | |
44 if(symbol.getColor() instanceof IRgbColor){ | |
45 IRgbColor color = (IRgbColor)symbol.getColor(); | |
46 System.out.println("Color\t\t = (" + color.getRed() + | |
47 "," + color.getGreen() + | |
48 "," + color.getBlue() + ")"); | |
49 System.out.println("Transparency\t = " + color.getTransparency()); | |
50 } | |
51 else{ | |
52 System.out.println("Color type unknown! " + | |
53 symbol.getColor().getClass().toString()); | |
54 } | |
55 if(symbol.getOutlineColor() instanceof RgbColor){ | |
56 RgbColor color = (RgbColor)symbol.getOutlineColor(); | |
57 System.out.println("Outlinecolor\t = (" + color.getRed() + | |
58 "," + color.getGreen() + | |
59 "," + color.getBlue() + ")"); | |
60 System.out.println("Transparency\t = " + color.getTransparency()); | |
61 } | |
62 else{ | |
63 System.out.println("Color type unknown! " + | |
64 symbol.getOutlineColor().getClass().toString()); | |
65 } | |
66 | |
67 System.out.println("Size\t\t = " + symbol.getSize()); | |
68 System.out.println("OutlineSize\t\t = " + symbol.getOutlineSize()); | |
69 System.out.println("Angle\t\t = " + symbol.getAngle()); | |
70 System.out.println("Offset\t\t = " + symbol.getXOffset() + | |
71 "," + symbol.getYOffset()); | |
72 System.out.println(""); | |
73 return true; | |
74 } | |
75 | |
76 public void getSymbol() throws IOException{ | |
77 logger.debug("getSymbol() -> not implemented jet."); | |
78 } | |
79 } | |
80 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |