Statistics
| Revision:

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 @ 43876

History | View | Annotate | Download (2.09 KB)

1
package org.gvsig.raster.tilecache.provider.legend;
2

    
3
import org.gvsig.fmap.dal.raster.RasterStore;
4
import org.slf4j.LoggerFactory;
5

    
6
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation;
7
import org.gvsig.raster.tilecache.provider.TileCacheStoreProvider;
8
import org.gvsig.raster.tilecache.provider.TileStructImage;
9
import org.gvsig.tools.ToolsLocator;
10
import org.gvsig.tools.dynobject.DynClass;
11
import org.gvsig.tools.dynobject.DynMethod;
12
import org.gvsig.tools.dynobject.DynObject;
13
import org.gvsig.tools.dynobject.exception.DynMethodException;
14
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
15

    
16
/**
17
 * @author dmartinezizquierdo
18
 *
19
 */
20
public class TileCacheGetColorInterpretation implements DynMethod {
21

    
22
    final static private org.slf4j.Logger logger = LoggerFactory.getLogger(TileCacheGetColorInterpretation.class);
23

    
24
    private static Integer code = null;
25

    
26
    static void register(DynClass storeClass) {
27
        if (code != null) {
28
            return;
29
        }
30
        code = ToolsLocator.getDynObjectManager()
31
                .registerDynMethod(storeClass, new TileCacheGetColorInterpretation());
32

    
33
    }
34

    
35
    @Override
36
    public int getCode() throws DynMethodNotSupportedException {
37
        return code;
38
    }
39

    
40
    @Override
41
    public String getDescription() {
42
        return "Tile Cache Color Interpretation";
43
    }
44

    
45
    @Override
46
    public String getName() {
47
        return RasterStore.DYNMETHOD_GETCOLORINTERPRETATION_NAME;
48
    }
49

    
50
    @Override
51
    public Object invoke(DynObject self, Object[] args) throws DynMethodException {
52
        ColorInterpretation colorInterpretation = null;
53

    
54
        TileCacheStoreProvider tileCacheStoreProvider = (TileCacheStoreProvider) self;
55

    
56
        TileStructImage tileStructImage = tileCacheStoreProvider.getTileStructImage();
57

    
58
        colorInterpretation = (ColorInterpretation) tileStructImage.getColorInterpretation();
59

    
60
        return colorInterpretation;
61
    }
62

    
63
    @Override
64
    public TileCacheGetColorInterpretation clone() throws CloneNotSupportedException {
65
        return (TileCacheGetColorInterpretation) super.clone();
66
    }
67
}