01: /*
02: * Geotools2 - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package org.geotools.gce.image;
18:
19: import java.util.Collections;
20: import java.util.Map;
21:
22: import org.geotools.coverage.grid.io.GridFormatFactorySpi;
23: import org.opengis.coverage.grid.Format;
24:
25: /**
26: * DOCUMENT ME!
27: *
28: * @author rgould TODO To change the template for this generated type comment go
29: * to Window - Preferences - Java - Code Style - Code Templates
30: * @source $URL:
31: * http://svn.geotools.org/geotools/trunk/gt/plugin/image/src/org/geotools/gce/image/WorldImageFormatFactory.java $
32: */
33: public final class WorldImageFormatFactory implements
34: GridFormatFactorySpi {
35: public Format createFormat() {
36: return new WorldImageFormat();
37: }
38:
39: public boolean isAvailable() {
40: boolean available = true;
41:
42: // if these classes are here, then the runtine environment has
43: // access to JAI and the JAI ImageI/O toolbox.
44: try {
45: Class.forName("javax.media.jai.JAI");
46: Class
47: .forName("com.sun.media.jai.operator.ImageReadDescriptor");
48: } catch (ClassNotFoundException cnf) {
49: available = false;
50: }
51:
52: return available;
53: }
54:
55: /**
56: * Returns the implementation hints. The default implementation returns en
57: * empty map.
58: *
59: */
60: public Map getImplementationHints() {
61: return Collections.EMPTY_MAP;
62: }
63: }
|