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


001:        /*
002:         * $RCSfile: NullCRIF.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:12 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai;
013:
014:        import java.awt.RenderingHints;
015:        import java.awt.geom.Rectangle2D;
016:        import java.awt.geom.Rectangle2D.Float;
017:        import java.awt.image.RenderedImage;
018:        import java.awt.image.renderable.ContextualRenderedImageFactory;
019:        import java.awt.image.renderable.ParameterBlock;
020:        import java.awt.image.renderable.RenderableImage;
021:        import java.awt.image.renderable.RenderContext;
022:        import javax.media.jai.ImageLayout;
023:        import javax.media.jai.JAI;
024:        import javax.media.jai.RenderedOp;
025:
026:        /**
027:         * A <code>ContextualRenderedImageFactory</code> representing an operation
028:         * which performs no processing of its image source(s) per se, i.e., a no-op.
029:         *
030:         * <p> The primary use of this image factory is as a utility class in
031:         * implementing operations which generate only non-image data via the
032:         * use of <code>PropertyGenerator</code>s.  A <code>PropertyGenerator</code>
033:         * is defined as always contributing to the property environment of a given
034:         * operation when it is returned by the <code>getPropertyGenerators()</code>
035:         * method of the <code>OperationDescriptor</code> corresponding to the
036:         * operation.
037:         *
038:         * <p> The procedure to be followed to register an operation which generates
039:         * only non-image data as JAI image properties is as follows:
040:         *
041:         * <ul>
042:         * <li> Create a <code>PropertyGenerator</code> which calculates the
043:         * non-image data given the operation node;
044:         * <li> Create an <code>OperationDescriptor</code> the
045:         * <code>getPropertyGenerators()</code> method of which returns the
046:         * <code>PropertyGenerator</code> defined in the previous step;
047:         * <li> Register the <code>OperationDescriptor</code> with the
048:         * <code>OperationRegistry</code> as usual by passing it to
049:         * <code>registerOperationDescriptor()</code> along with the operation name;
050:         * <li> Register a <code>NullCRIF</code> as the image factory corresponding to
051:         * this operation.
052:         * </ul>
053:         *
054:         * The properties emitted by the associated <code>PropertyGenerator</code>(s)
055:         * will then be available by invoking <code>getProperty()</code> on the node
056:         * returned by <code>JAI.create()</code> using the registered operation name.
057:         *
058:         * @see CRIFImpl
059:         * @see java.awt.image.renderable.ContextualRenderedImageFactory
060:         *
061:         * @since JAI 1.1
062:         */
063:        public class NullCRIF extends CRIFImpl {
064:
065:            /**
066:             * Image returned by <code>RenderedImageFactory.create()</code>
067:             * when there are ono sources.
068:             */
069:            private static RenderedImage sourcelessImage = null;
070:
071:            /**
072:             * Constructs a <code>NullCRIF</code>.  The <code>operationName</code>
073:             * in the superclass is set to <code>null</code>.
074:             */
075:            public NullCRIF() {
076:                super ();
077:            }
078:
079:            /**
080:             * Sets the value of the <code>RenderedImage</code> to be returned by
081:             * the <code>RenderedImageFactory.create()</code> method when there are
082:             * no sources in the <code>ParameterBlock</code>.
083:             *
084:             * @param a <code>RenderedImage</code> or <code>null</code>.
085:             */
086:            public static final synchronized void setSourcelessImage(
087:                    RenderedImage im) {
088:                sourcelessImage = im;
089:            }
090:
091:            /**
092:             * Gets the value of the RenderedImage to be returned by the RIF.create()
093:             * method when there are no sources in the <code>ParameterBlock</code>.
094:             *
095:             * @return a <code>RenderedImage</code> or <code>null</code>.
096:             */
097:            public static final synchronized RenderedImage getSourcelessImage() {
098:                return sourcelessImage;
099:            }
100:
101:            /**
102:             * Returns the first source in the source list in the
103:             * <code>ParameterBlock</code> or the value returned by
104:             * <code>getSourcelessImage()</code> if there are no soures.
105:             *
106:             * @throws ClassCastException if there are sources and the source
107:             * at index zero is not a <code>RenderedImage</code>.
108:             */
109:            public RenderedImage create(ParameterBlock args,
110:                    RenderingHints renderHints) {
111:                return args.getNumSources() == 0 ? getSourcelessImage() : args
112:                        .getRenderedSource(0);
113:            }
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.