Source Code Cross Referenced for GeoTiffServiceImpl.java in  » GIS » udig-1.1 » net » refractions » udig » catalog » internal » 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 » udig 1.1 » net.refractions.udig.catalog.internal.geotiff 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    uDig - User Friendly Desktop Internet GIS client
003:         *    http://udig.refractions.net
004:         *    (C) 2004, Refractions Research Inc.
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:        package net.refractions.udig.catalog.internal.geotiff;
018:
019:        import java.io.File;
020:        import java.io.IOException;
021:        import java.net.URL;
022:        import java.text.MessageFormat;
023:        import java.util.ArrayList;
024:        import java.util.List;
025:
026:        import net.refractions.udig.catalog.IServiceInfo;
027:        import net.refractions.udig.catalog.geotiff.internal.Messages;
028:        import net.refractions.udig.catalog.rasterings.AbstractRasterGeoResource;
029:        import net.refractions.udig.catalog.rasterings.AbstractRasterService;
030:
031:        import org.eclipse.core.runtime.IProgressMonitor;
032:        import org.geotools.data.coverage.grid.GridFormatFactorySpi;
033:        import org.geotools.gce.geotiff.GeoTiffFormat;
034:        import org.opengis.coverage.grid.GridCoverageReader;
035:
036:        /**
037:         * Provides a handle to a geotiff service allowing the service to be lazily 
038:         * loaded.
039:         * @author mleslie
040:         * @since 0.6.0
041:         */
042:        public class GeoTiffServiceImpl extends AbstractRasterService {
043:            private GeoTiffServiceInfo info;
044:
045:            /**
046:             * Construct <code>GeoTiffServiceImpl</code>.
047:             *
048:             * @param id
049:             * @param factory
050:             */
051:            public GeoTiffServiceImpl(URL id, GridFormatFactorySpi factory) {
052:                super (id, factory);
053:            }
054:
055:            @Override
056:            public List<AbstractRasterGeoResource> members(
057:                    IProgressMonitor monitor) throws IOException {
058:                if (monitor != null) {
059:                    String msg = MessageFormat.format(
060:                            Messages.GeoTiffServiceImpl_connecting_to,
061:                            new Object[] {});
062:                    monitor.beginTask(msg, 5);
063:                }
064:                if (reader != null && monitor != null)
065:                    monitor.worked(3);
066:
067:                GeoTiffGeoResourceImpl res = new GeoTiffGeoResourceImpl(this ,
068:                        getTitle());
069:                List<AbstractRasterGeoResource> list = new ArrayList<AbstractRasterGeoResource>();
070:                list.add(res);
071:                if (monitor != null)
072:                    monitor.done();
073:                return list;
074:            }
075:
076:            public void dispose(IProgressMonitor monitor) {
077:                // do nothing
078:            }
079:
080:            public GridCoverageReader getReader() {
081:                if (this .reader == null) {
082:                    try {
083:                        File file = new File(getIdentifier().toURI());
084:                        this .reader = ((GeoTiffFormat) getFormat())
085:                                .getReader(file);
086:                    } catch (Exception ex) {
087:                        this .message = ex;
088:                    }
089:                }
090:                return this .reader;
091:            }
092:
093:            public IServiceInfo getInfo(IProgressMonitor monitor) {
094:                if (monitor != null)
095:                    monitor.beginTask(
096:                            Messages.GeoTiffServiceImpl_loading_task_title, 2);
097:                if (this .info == null) {
098:                    if (monitor != null)
099:                        monitor.worked(1);
100:                    this .info = new GeoTiffServiceInfo();
101:                }
102:                if (monitor != null)
103:                    monitor.done();
104:                return this .info;
105:            }
106:
107:            /**
108:             * Provides descriptive information about this service.
109:             * @author mleslie
110:             * @since 0.6.0
111:             */
112:            public class GeoTiffServiceInfo extends IServiceInfo {
113:                GeoTiffServiceInfo() {
114:                    super ();
115:                    this .keywords = new String[] {
116:                            "WorldImage", "world image", ".gif", ".jpg", ".jpeg", //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$
117:                            ".tif", ".tiff", ".png" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
118:                }
119:
120:                public String getTitle() {
121:                    return getIdentifier().getFile();
122:                }
123:
124:                public String getDescription() {
125:                    return getIdentifier().toString();
126:                }
127:            }
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.