Revision 6902 org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.osm/org.gvsig.osm.provider.legend/src/main/java/org/gvsig/osm/provider/legend/OSMRasterGetColorInterpretation.java
OSMRasterGetColorInterpretation.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
package org.gvsig.osm.provider.legend; |
25 | 25 |
|
26 |
import java.awt.Color; |
|
27 |
import java.util.ArrayList; |
|
28 |
import java.util.List; |
|
29 |
|
|
26 | 30 |
import org.slf4j.LoggerFactory; |
27 | 31 |
|
28 | 32 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
29 | 33 |
import org.gvsig.osm.provider.OSMRasterProvider; |
30 |
import org.gvsig.raster.lib.legend.api.ColorInterpretation; |
|
31 | 34 |
import org.gvsig.raster.lib.legend.api.RasterLegendLocator; |
32 | 35 |
import org.gvsig.raster.lib.legend.api.RasterLegendManager; |
36 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
|
37 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTable; |
|
38 |
import org.gvsig.raster.lib.legend.api.colortable.colortableclass.ColorTableClass; |
|
33 | 39 |
import org.gvsig.tools.ToolsLocator; |
34 | 40 |
import org.gvsig.tools.dynobject.DynClass; |
35 | 41 |
import org.gvsig.tools.dynobject.DynMethod; |
... | ... | |
85 | 91 |
colorInterpretation = legendManager.createColorInterpretation(ColorInterpretation.ARGB); |
86 | 92 |
// } else { |
87 | 93 |
// colorInterpretation = legendManager.createColorInterpretation(ColorInterpretation.PALETTE); |
94 |
// |
|
95 |
// ColorTable colorTable; |
|
96 |
// |
|
97 |
// //FIXME: |
|
98 |
// List<ColorTableClass> colorTableClasses=new ArrayList<ColorTableClass>(); |
|
99 |
// double[] minMax={0d,255d}; |
|
100 |
// |
|
101 |
// Double increment=1.0; |
|
102 |
// |
|
103 |
// for (int i=0;i<=255;i++){ |
|
104 |
// String className=i+""; |
|
105 |
// double value=((minMax[0]+(i*increment))); |
|
106 |
// double interpolation=50.0; |
|
107 |
// int intARGB = ((i & 0xFF) << 24) | // alpha |
|
108 |
// ((i & 0xFF) << 16) | // red |
|
109 |
// ((i & 0xFF) << 8) | // green |
|
110 |
// ((i & 0xFF) << 0); // blue |
|
111 |
// Color color=new Color(intARGB); |
|
112 |
// ColorTableClass colorTableClass = legendManager.createColorTableClass(className, value, interpolation, color); |
|
113 |
// colorTableClasses.add(colorTableClass); |
|
114 |
// } |
|
115 |
// colorTable = legendManager.createColorTable(OSMRasterProvider.NAME+"_color_table", |
|
116 |
// colorTableClasses, true); |
|
117 |
// colorInterpretation.setPalette(colorTable); |
|
118 |
// colorInterpretation.setPaletteBand(0); |
|
119 |
// |
|
88 | 120 |
// } |
89 | 121 |
|
122 |
|
|
90 | 123 |
return colorInterpretation; |
91 | 124 |
} |
92 | 125 |
|
Also available in: Unified diff