Revision 19419 branches/v10/extensions/extPublish/src/org/gvsig/publish/infoproject/legends/UniqueValuesLegendInfo.java
UniqueValuesLegendInfo.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
import com.hardcode.gdbms.engine.values.Value; |
50 | 50 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
51 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
51 | 52 |
import com.iver.cit.gvsig.fmap.rendering.UniqueValueLegend; |
52 | 53 |
|
53 | 54 |
public class UniqueValuesLegendInfo implements IUniqueValuesLegendInfo { |
54 | 55 |
|
55 | 56 |
private UniqueValueLegend legend=null; |
57 |
private FLyrVect layer=null; |
|
56 | 58 |
private HashMap symbols = null; |
57 |
|
|
59 |
/** |
|
60 |
* default constructor |
|
61 |
* @param legend2 |
|
62 |
* @deprecated |
|
63 |
*/ |
|
58 | 64 |
public UniqueValuesLegendInfo(UniqueValueLegend legend2) { |
59 | 65 |
legend = legend2; |
60 | 66 |
symbols = new HashMap(); |
61 | 67 |
initialize(); |
62 | 68 |
} |
69 |
/** |
|
70 |
* |
|
71 |
* @param lyrVect gvSIG vectorial layer |
|
72 |
*/ |
|
73 |
public UniqueValuesLegendInfo(FLyrVect lyrVect) { |
|
74 |
this.layer = lyrVect; |
|
75 |
this.legend = (UniqueValueLegend)lyrVect.getLegend(); |
|
76 |
this.symbols = new HashMap(); |
|
77 |
initialize(); |
|
78 |
} |
|
63 | 79 |
private void initialize(){ |
64 | 80 |
Object[] values = legend.getValues(); |
65 | 81 |
for (int i = 0; i < values.length; i++){ |
... | ... | |
93 | 109 |
return stringValues; |
94 | 110 |
|
95 | 111 |
//return legend.getDescriptions(); |
96 |
} |
|
112 |
} |
|
113 |
/* |
|
114 |
* (non-Javadoc) |
|
115 |
* @see org.gvsig.publish.infoproject.ILegendInfo#getSLDString() |
|
116 |
*/ |
|
117 |
public String getSLDString() { |
|
118 |
if (layer != null){ |
|
119 |
return legend.getSLDString(layer.getName()); |
|
120 |
}else{ |
|
121 |
return legend.getSLDString("default"); |
|
122 |
} |
|
123 |
} |
|
97 | 124 |
|
98 | 125 |
} |
Also available in: Unified diff