Source Code Cross Referenced for GeoTiffFormatFactorySpi.java in  » GIS » GeoTools-2.4.1 » org » geotools » gce » geotiff » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.gce.geotiff 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        /*
017:         * NOTICE OF RELEASE TO THE PUBLIC DOMAIN
018:         *
019:         * This work was created by employees of the USDA Forest Service's
020:         * Fire Science Lab for internal use.  It is therefore ineligible for
021:         * copyright under title 17, section 105 of the United States Code.  You
022:         * may treat it as you would treat any public domain work: it may be used,
023:         * changed, copied, or redistributed, with or without permission of the
024:         * authors, for free or for compensation.  You may not claim exclusive
025:         * ownership of this code because it is already owned by everyone.  Use this
026:         * software entirely at your own risk.  No warranty of any kind is given. 
027:         *
028:         * A copy of 17-USC-105 should have accompanied this distribution in the file
029:         * 17USC105.html.  If not, you may access the law via the US Government's
030:         * public websites:
031:         *   - http://www.copyright.gov/title17/92chap1.html#105
032:         *   - http://www.gpoaccess.gov/uscode/  (enter "17USC105" in the search box.)
033:         */
034:        package org.geotools.gce.geotiff;
035:
036:        // Geotools dependencies
037:        import java.util.Collections;
038:        import java.util.Map;
039:
040:        import org.geotools.coverage.grid.io.GridFormatFactorySpi;
041:        import org.opengis.coverage.grid.Format;
042:
043:        /**
044:         * The <CODE>GeoTiffFormatFactorySpi</CODE> should never be instantiated
045:         * directly by user code. It is discovered by the <CODE>GridFormatFinder</CODE>
046:         * for automatic discovery. Use the standard Geotools method of discovering a
047:         * factory in order to create a format.
048:         * 
049:         * <p>
050:         * This format will only report itself to be &quot;available&quot; if the JAI
051:         * and JAI ImageI/O libraries are available. Otherwise it will be unavailable.
052:         * If a user attempts to create a new instance of the format when the required
053:         * libraries are unavailable, an <CODE>UnsupportedOperationException</CODE>
054:         * will be thrown.
055:         * </p>
056:         * 
057:         * @author Bryce Nordgren / USDA Forest Service
058:         * @author Simone Giannecchini
059:         * @source $URL:
060:         *         http://svn.geotools.org/geotools/trunk/gt/plugin/geotiff/src/org/geotools/gce/geotiff/GeoTiffFormatFactorySpi.java $
061:         */
062:        public final class GeoTiffFormatFactorySpi implements 
063:                GridFormatFactorySpi {
064:            /**
065:             * Creates a new instance of GeoTiffFormatFactorySpi
066:             */
067:            public GeoTiffFormatFactorySpi() {
068:            }
069:
070:            /**
071:             * Creates and returns a new instance of the <CODE>GeoTiffFormat</CODE>
072:             * class if the required libraries are present. If JAI and JAI Image I/O are
073:             * not present, will throw an <CODE>UnsupportedOperationException</CODE>.
074:             * 
075:             * @return <CODE>GeoTiffFormat</CODE> object.
076:             * 
077:             * @throws UnsupportedOperationException
078:             *             if this format is unavailable.
079:             */
080:            public Format createFormat() {
081:                if (!isAvailable()) {
082:                    throw new UnsupportedOperationException(
083:                            "The GeoTiff plugin requires the JAI and JAI ImageI/O libraries!");
084:                }
085:
086:                return new GeoTiffFormat();
087:            }
088:
089:            /**
090:             * Informs the caller whether the libraries required by the GeoTiff reader
091:             * are installed or not.
092:             * 
093:             * @return availability of the GeoTiff format.
094:             */
095:            public boolean isAvailable() {
096:                boolean available = true;
097:
098:                // if these classes are here, then the runtine environment has
099:                // access to JAI and the JAI ImageI/O toolbox.
100:                try {
101:                    Class.forName("javax.media.jai.JAI");
102:                    Class
103:                            .forName("com.sun.media.jai.operator.ImageReadDescriptor");
104:                } catch (ClassNotFoundException cnf) {
105:                    available = false;
106:                }
107:
108:                return available;
109:            }
110:
111:            /**
112:             * Returns the implementation hints. The default implementation returns en
113:             * empty map.
114:             * 
115:             * @return Empty Map.
116:             */
117:            public Map getImplementationHints() {
118:                return Collections.EMPTY_MAP;
119:            }
120:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.