Source Code Cross Referenced for TileCodecDescriptorImpl.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » tilecodec » 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 » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai.tilecodec 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: TileCodecDescriptorImpl.java,v $
003:         *
004:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * Use is subject to license terms.
007:         *
008:         * $Revision: 1.1 $
009:         * $Date: 2005/02/11 04:57:55 $
010:         * $State: Exp $
011:         */package javax.media.jai.tilecodec;
012:
013:        import javax.media.jai.PropertyGenerator;
014:
015:        /**
016:         * An abstract class that implements the <code>TileCodecDescriptor</code>
017:         * interface and is suitable for subclassing. This class provides default
018:         * implementations for some of the methods from
019:         * <code>TileCodecDescriptor</code>. Subclasses should override these methods
020:         * if they do not wish to retain the default implementation.
021:         *
022:         * All <code>String</code>s are treated in a case-retentive and 
023:         * case-insensitive manner.
024:         *
025:         * @since JAI 1.1
026:         */
027:        public abstract class TileCodecDescriptorImpl implements 
028:                TileCodecDescriptor {
029:
030:            private String formatName;
031:            private boolean includesSMInfo, includesLocationInfo;
032:
033:            /**
034:             * Creates a <code>TileCodecDescriptorImpl</code> with the given
035:             * format name and <code>boolean</code>s to specify whether layout
036:             * information is included in the encoded stream.
037:             *
038:             * @param formatName              The name of the format. This is also
039:             *                                the name under which this descriptor
040:             *                                will be registered under in the 
041:             *                                <code>OperationRegistry</code>.
042:             * @param includesSampleModelInfo Whether the format encodes the tile's
043:             *                                <code>SampleModel</code> or equivalent
044:             *                                information into the encoded stream.
045:             * @param includesLocationInfo    Whether the format encodes the tile's
046:             *                                upper left corner position or equivalent
047:             *                                information into the encoded stream.
048:             * @throws IllegalArgumentException if formatName is null.
049:             */
050:            public TileCodecDescriptorImpl(String formatName,
051:                    boolean includesSampleModelInfo,
052:                    boolean includesLocationInfo) {
053:
054:                // Cause IllegalArgumentException if formatName is null
055:                if (formatName == null) {
056:                    throw new IllegalArgumentException(JaiI18N
057:                            .getString("TileCodecDescriptorImpl0"));
058:                }
059:
060:                this .formatName = formatName;
061:                this .includesSMInfo = includesSampleModelInfo;
062:                this .includesLocationInfo = includesLocationInfo;
063:            }
064:
065:            /** 
066:             * Returns the name of the format.
067:             */
068:            public String getName() {
069:                return formatName;
070:            }
071:
072:            /**
073:             * Returns the registry modes supported by this descriptor. The
074:             * default implementation of this method in this class returns a 
075:             * <code>String</code> array containing the "tileDecoder" and 
076:             * "tileEncoder" strings. If the subclass does not support any of
077:             * these modes, it should override this method to return the names of
078:             * those modes that it supports.
079:             *
080:             * @see javax.media.jai.RegistryMode
081:             */
082:            public String[] getSupportedModes() {
083:                return new String[] { "tileDecoder", "tileEncoder" };
084:            }
085:
086:            /**
087:             * This method is implemented to return true if the specified 
088:             * registryModeName is either "tileDecoder" or "tileEncoder". If
089:             * the subclass doesn't support any one of these modes, it should
090:             * override this method to return true only for the supported mode(s).
091:             *
092:             * @param registryModeName The name of the registry mode to check 
093:             *                         support for.
094:             * @throws IllegalArgumentException if registryModeName is null.
095:             */
096:            public boolean isModeSupported(String registryModeName) {
097:
098:                if (registryModeName == null) {
099:                    throw new IllegalArgumentException(JaiI18N
100:                            .getString("TileCodecDescriptorImpl1"));
101:                }
102:
103:                if (registryModeName.equalsIgnoreCase("tileDecoder") == true
104:                        || registryModeName.equalsIgnoreCase("tileEncoder") == true) {
105:                    return true;
106:                }
107:
108:                return false;
109:            }
110:
111:            /**
112:             * Whether this descriptor supports properties.
113:             *
114:             * @return true, if the implementation of this descriptor supports
115:             * properties. false otherwise. Since tile codecs do not support
116:             * properties, so this default implementation returns false.
117:             *
118:             * @see PropertyGenerator
119:             */
120:            public boolean arePropertiesSupported() {
121:                return false;
122:            }
123:
124:            /**
125:             * Returns an array of <code>PropertyGenerator</code>s implementing
126:             * the property inheritance for this operation.  Since neither
127:             * <code>TileEncoder</code> or <code>TileDecoder</code> supports
128:             * properties, the default implementation throws an 
129:             * <code>UnsupportedOperationException</code>. Subclasses should
130:             * override this method if they wish to produce inherited properties.
131:             *
132:             * @throws IllegalArgumentException if <code>modeName</code> is null.
133:             * @throws UnsupportedOperationException if
134:             * <code>arePropertiesSupported()</code> returns <code>false</code>
135:             */
136:            public PropertyGenerator[] getPropertyGenerators(String modeName) {
137:
138:                if (modeName == null) {
139:                    throw new IllegalArgumentException(JaiI18N
140:                            .getString("TileCodecDescriptorImpl1"));
141:                }
142:
143:                throw new UnsupportedOperationException(JaiI18N
144:                        .getString("TileCodecDescriptorImpl2"));
145:            }
146:
147:            /**
148:             * Returns true if the format encodes layout information generally
149:             * specified via the <code>SampleModel</code> in the encoded data stream.
150:             */
151:            public boolean includesSampleModelInfo() {
152:                return includesSMInfo;
153:            }
154:
155:            /**
156:             * Returns true if the format encodes in the data stream the location of 
157:             * the <code>Raster</code> with respect to its enclosing image.
158:             */
159:            public boolean includesLocationInfo() {
160:                return includesLocationInfo;
161:            }
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.