Source Code Cross Referenced for GZIPTileCodecDescriptor.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: GZIPTileCodecDescriptor.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:54 $
010:         * $State: Exp $
011:         */package javax.media.jai.tilecodec;
012:
013:        import java.awt.image.SampleModel;
014:        import javax.media.jai.ParameterListDescriptor;
015:        import javax.media.jai.ParameterListDescriptorImpl;
016:        import javax.media.jai.PropertyGenerator;
017:
018:        /**
019:         * <p>This class is the descriptor for the "GZIP" tile codec. This codec
020:         * scheme uses "gzip" as the method of compressing tile data. This is a 
021:         * lossless tile codec. The format name for the gzip tile codec is "gzip".
022:         * The encoded stream contains the <code>SampleModel</code> and the tile's
023:         * upper left corner position, thus the <code>includesSampleModelInfo()</code>
024:         * and <code>includesLocationInfo()</code> methods in this descriptor return
025:         * true.
026:         *
027:         * <p> The "gzip" codec scheme does not support any parameters.
028:         *
029:         * <p><table border=1>
030:         * <caption>Resource List</caption>
031:         * <tr><th>Name</th>        <th>Value</th></tr>
032:         * <tr><td>Vendor</td>      <td>com.sun.media.jai</td></tr>
033:         * <tr><td>Description</td> <td>A descriptor to describe the lossless "gzip" 
034:         *                              codec scheme. </td></tr>
035:         * <tr><td>DocURL</td>      <td>http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/tilecodec/GZIPTileCodecDescriptor.html</td></tr>
036:         * <tr><td>Version</td>     <td>1.2</td></tr>
037:         * </table></p>
038:         *
039:         * <p><table border=1>
040:         * <caption>Parameter List</caption>
041:         * <tr><th>Name</th>          <th>Class Type</th>
042:         *                            <th>Default Value</th></tr>
043:         * </table></p>
044:         *
045:         * @since JAI 1.1
046:         */
047:        public class GZIPTileCodecDescriptor extends TileCodecDescriptorImpl {
048:
049:            private static ParameterListDescriptorImpl pld = new ParameterListDescriptorImpl();
050:
051:            /**
052:             * Creates a <code>GZIPTileCodecDescriptor</code> 
053:             */
054:            public GZIPTileCodecDescriptor() {
055:                super ("gzip", true, true);
056:            }
057:
058:            /**
059:             * Returns a <code>TileCodecParameterList</code> valid for the 
060:             * specified modeName and compatible with the supplied
061:             * <code>TileCodecParameterList</code>. For example, given a
062:             * <code>TileCodecParameterList</code> used to encode a tile with
063:             * the modeName being specified as "tileDecoder", this method will
064:             * return a <code>TileCodecParameterList</code> 
065:             * sufficient to decode that same tile. For the gzip tile codec, 
066:             * no parameters are used. So null will be returned for any valid 
067:             * modeName specified.
068:             *
069:             * @param modeName       The registry mode to return a valid parameter 
070:             *                       list for.
071:             * @param otherParamList The parameter list for which a compatible 
072:             *                       parameter list for the complementary modeName is
073:             *                       to be found.
074:             *
075:             * @throws IllegalArgumentException if <code>modeName</code> is null.
076:             * @throws IllegalArgumentException if <code>modeName</code> is not
077:             * one of the modes valid for this descriptor, i.e those returned
078:             * from the getSupportedNames() method.
079:             */
080:            public TileCodecParameterList getCompatibleParameters(
081:                    String modeName, TileCodecParameterList otherParamList) {
082:                if (modeName == null)
083:                    throw new IllegalArgumentException(JaiI18N
084:                            .getString("TileCodecDescriptorImpl1"));
085:
086:                String validNames[] = getSupportedModes();
087:                boolean valid = false;
088:
089:                for (int i = 0; i < validNames.length; i++) {
090:                    if (modeName.equalsIgnoreCase(validNames[i])) {
091:                        valid = true;
092:                        break;
093:                    }
094:                }
095:
096:                if (valid == false) {
097:                    throw new IllegalArgumentException(JaiI18N
098:                            .getString("TileCodec1"));
099:                }
100:
101:                return null;
102:            }
103:
104:            /**
105:             * Returns the default parameters for the specified modeName as an
106:             * instance of the <code>TileCodecParameterList</code>. For the 
107:             * gzip tile codec, no parameters are used. So null will be
108:             * returned for any valid modeName specified. 
109:             *
110:             * @param modeName       The registry mode to return a valid parameter 
111:             *                       list for.
112:             *
113:             * @throws IllegalArgumentException if <code>modeName</code> is null.
114:             * @throws IllegalArgumentException if <code>modeName</code> is not
115:             * one of the modes valid for this descriptor, i.e those returned
116:             * from the getSupportedNames() method.
117:             */
118:            public TileCodecParameterList getDefaultParameters(String modeName) {
119:                if (modeName == null)
120:                    throw new IllegalArgumentException(JaiI18N
121:                            .getString("TileCodecDescriptorImpl1"));
122:
123:                String validNames[] = getSupportedModes();
124:                boolean valid = false;
125:
126:                for (int i = 0; i < validNames.length; i++) {
127:                    if (modeName.equalsIgnoreCase(validNames[i])) {
128:                        valid = true;
129:                        break;
130:                    }
131:                }
132:
133:                if (valid == false) {
134:                    throw new IllegalArgumentException(JaiI18N
135:                            .getString("TileCodec1"));
136:                }
137:
138:                return null;
139:            }
140:
141:            /**
142:             * Returns the default parameters for the specified modeName as an
143:             * instance of the <code>TileCodecParameterList</code>, adding a 
144:             * "sampleModel" parameter with the specified value to the parameter
145:             * list. For the gzip tile codec, no parameters are used. So null will be
146:             * returned for any valid modeName specified.
147:             * 
148:             * <p> This method should be used when includesSampleModelInfo()
149:             * returns false. If includesSampleModelInfo() returns true, the
150:             * supplied <code>SampleModel</code> is ignored.
151:             *
152:             * <p> If a parameter named "sampleModel" exists in the default 
153:             * parameter list, the supplied SampleModel will override the value 
154:             * associated with this default parameter.
155:             *
156:             * @param modeName The registry mode to return a valid parameter list for.
157:             * @param sm       The <code>SampleModel</code> used to create the 
158:             *                 default decoding parameter list.
159:             *
160:             * @throws IllegalArgumentException if <code>modeName</code> is null.
161:             * @throws IllegalArgumentException if <code>modeName</code> is not
162:             * one of the modes valid for this descriptor, i.e those returned
163:             * from the getSupportedNames() method.
164:             */
165:            public TileCodecParameterList getDefaultParameters(String modeName,
166:                    SampleModel sm) {
167:                if (modeName == null)
168:                    throw new IllegalArgumentException(JaiI18N
169:                            .getString("TileCodecDescriptorImpl1"));
170:
171:                String validNames[] = getSupportedModes();
172:                boolean valid = false;
173:
174:                for (int i = 0; i < validNames.length; i++) {
175:                    if (modeName.equalsIgnoreCase(validNames[i])) {
176:                        valid = true;
177:                        break;
178:                    }
179:                }
180:
181:                if (valid == false) {
182:                    throw new IllegalArgumentException(JaiI18N
183:                            .getString("TileCodec1"));
184:                }
185:
186:                return null;
187:            }
188:
189:            /**
190:             * Returns the <code>ParameterListDescriptor</code> that describes
191:             * the associated parameters (NOT sources). This method returns
192:             * null if there are no parameters for the specified modeName.
193:             * If the specified modeName supports parameters but the
194:             * implementing class does not have parameters, then this method
195:             * returns a non-null <code>ParameterListDescriptor</code> whose
196:             * <code>getNumParameters()</code> returns 0.
197:             *
198:             * @param modeName The mode to get the ParameterListDescriptor for.
199:             *
200:             * @throws IllegalArgumentException if <code>modeName</code> is null.
201:             *
202:             * @throws IllegalArgumentException if <code>modeName</code> is null.
203:             * @throws IllegalArgumentException if <code>modeName</code> is not
204:             * one of the modes valid for this descriptor, i.e those returned
205:             * from the getSupportedNames() method.
206:             */
207:            public ParameterListDescriptor getParameterListDescriptor(
208:                    String modeName) {
209:
210:                if (modeName == null)
211:                    throw new IllegalArgumentException(JaiI18N
212:                            .getString("TileCodecDescriptorImpl1"));
213:
214:                String validNames[] = getSupportedModes();
215:                boolean valid = false;
216:
217:                for (int i = 0; i < validNames.length; i++) {
218:                    if (modeName.equalsIgnoreCase(validNames[i])) {
219:                        valid = true;
220:                        break;
221:                    }
222:                }
223:
224:                if (valid == false) {
225:                    throw new IllegalArgumentException(JaiI18N
226:                            .getString("TileCodec1"));
227:                }
228:
229:                return pld;
230:            }
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.