Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/UniqueValueRendererReader.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/UniqueValueRendererReader.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.carto.IFeatureRenderer; | |
8 import com.esri.arcgis.display.ISymbol; | |
9 import com.esri.arcgis.carto.UniqueValueRenderer; | |
10 | |
11 /** | |
12 * Reads unique vaule renderer information. | |
13 * | |
14 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | |
15 */ | |
16 public class UniqueValueRendererReader implements IRendererReader{ | |
17 | |
18 //Member | |
19 private ISymbol symbol; | |
20 private IFeatureRenderer renderer; | |
21 private static final Logger logger = Logger.getLogger(FeatureLayerReader.class); | |
22 | |
23 //Constructor | |
24 public UniqueValueRendererReader(IFeatureRenderer renderer){ | |
25 this.renderer = renderer; | |
26 } | |
27 | |
28 | |
29 //Methods | |
30 public boolean read() throws IOException{ | |
31 logger.debug("read()"); | |
32 if(renderer instanceof UniqueValueRenderer){ | |
33 UniqueValueRenderer sr = (UniqueValueRenderer)renderer; | |
34 System.out.println("--------------------"); | |
35 System.out.println("Renderer inforamtion:"); | |
36 System.out.println("Value count\t\t = " + sr.getValueCount()); | |
37 for(int i = 0; i < sr.getValueCount(); i++){ | |
38 String val = sr.getValue(i); | |
39 System.out.println("Value\t\t = " + val); | |
40 System.out.println("Label\t\t = " + sr.getLabel(val)); | |
41 System.out.println("Description\t\t = " + sr.getDescription(val)); | |
42 } | |
43 System.out.println(""); | |
44 symbol = sr.getDefaultSymbol(); | |
45 try{ | |
46 ISymbolReader isr= new SimpleMarkerSymbolReader(symbol); | |
47 isr.read(); | |
48 return true; | |
49 } | |
50 catch(Exception e){ | |
51 e.printStackTrace(); | |
52 } | |
53 } | |
54 return false; | |
55 } | |
56 | |
57 public void getRenderer() throws IOException{ | |
58 logger.debug("getRenderer() -> not implemented jet."); | |
59 } | |
60 } | |
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |