svn-gvsig-desktop / branches / org.gvsig.desktop-2018a / org.gvsig.desktop.library / org.gvsig.raster.legend / org.gvsig.raster.legend.tilecache / src / main / java / org / gvsig / raster / tilecache / provider / legend / TileCacheGetColorInterpretation.java @ 43803
History | View | Annotate | Download (2.33 KB)
1 |
package org.gvsig.raster.tilecache.provider.legend; |
---|---|
2 |
|
3 |
import org.slf4j.LoggerFactory; |
4 |
|
5 |
import org.gvsig.fmap.dal.exception.DataException; |
6 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
7 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
8 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
9 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
10 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
11 |
import org.gvsig.raster.tilecache.provider.TileCacheStoreProvider; |
12 |
import org.gvsig.raster.tilecache.provider.TileStructImage; |
13 |
import org.gvsig.tools.ToolsLocator; |
14 |
import org.gvsig.tools.dynobject.DynClass; |
15 |
import org.gvsig.tools.dynobject.DynMethod; |
16 |
import org.gvsig.tools.dynobject.DynObject; |
17 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
18 |
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException; |
19 |
|
20 |
/**
|
21 |
* @author dmartinezizquierdo
|
22 |
*
|
23 |
*/
|
24 |
public class TileCacheGetColorInterpretation implements DynMethod { |
25 |
|
26 |
final static private org.slf4j.Logger logger = LoggerFactory.getLogger(TileCacheGetColorInterpretation.class); |
27 |
|
28 |
private static Integer code = null; |
29 |
|
30 |
static void register(DynClass storeClass) { |
31 |
if (code != null) { |
32 |
return;
|
33 |
} |
34 |
code = ToolsLocator.getDynObjectManager() |
35 |
.registerDynMethod(storeClass, new TileCacheGetColorInterpretation());
|
36 |
|
37 |
} |
38 |
|
39 |
@Override
|
40 |
public int getCode() throws DynMethodNotSupportedException { |
41 |
return code;
|
42 |
} |
43 |
|
44 |
@Override
|
45 |
public String getDescription() { |
46 |
return "Tile Cache Color Interpretation"; |
47 |
} |
48 |
|
49 |
@Override
|
50 |
public String getName() { |
51 |
return RasterStore.DYNMETHOD_GETCOLORINTERPRETATION_NAME;
|
52 |
} |
53 |
|
54 |
@Override
|
55 |
public Object invoke(DynObject self, Object[] args) throws DynMethodException { |
56 |
ColorInterpretation colorInterpretation = null;
|
57 |
|
58 |
TileCacheStoreProvider tileCacheStoreProvider = (TileCacheStoreProvider) self; |
59 |
|
60 |
TileStructImage tileStructImage = tileCacheStoreProvider.getTileStructImage(); |
61 |
|
62 |
colorInterpretation = (ColorInterpretation) tileStructImage.getColorInterpretation(); |
63 |
|
64 |
return colorInterpretation;
|
65 |
} |
66 |
|
67 |
@Override
|
68 |
public TileCacheGetColorInterpretation clone() throws CloneNotSupportedException { |
69 |
return (TileCacheGetColorInterpretation) super.clone(); |
70 |
} |
71 |
} |