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