Source Code Cross Referenced for PropertyChangeSupportJAI.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: PropertyChangeSupportJAI.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:16 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai;
013:
014:        import java.beans.PropertyChangeEvent;
015:        import java.beans.PropertyChangeListener;
016:        import java.beans.PropertyChangeSupport;
017:
018:        /**
019:         * Extension of the beans utility class <code>PropertyChangeSupport</code>
020:         * which adds an accessor for the parameter passed to the constructor.  All
021:         * events fired by the <code>firePropertyChange()</code> methods of this
022:         * class are instances of <code>PropertyChangeEventJAI</code>; consequently
023:         * all property names are forced to lower case for recognition purposes.
024:         * The property name-specific <code>PropertyChangeListener</code> registration
025:         * and unregistration methods defined in this class also force the supplied
026:         * property name to lower case.
027:         *
028:         * @see PropertyChangeSupport
029:         *
030:         * @since JAI 1.1
031:         */
032:        public final class PropertyChangeSupportJAI extends
033:                PropertyChangeSupport {
034:            /**
035:             * The <code>PropertyChangeEvent</code> source.
036:             */
037:            protected Object propertyChangeEventSource;
038:
039:            /**
040:             * Constructs a <code>PropertyChangeSupportJAI</code> object.  The
041:             * parameter is cached for later use and retrieval.
042:             *
043:             * @param propertyChangeEventSource The property change event source.
044:             * @throws If <code>propertyChangeEventSource</code> is <code>null</code>
045:             *         then a <code>NullPointerException</code> will be thrown
046:             *         in the superclass.
047:             */
048:            public PropertyChangeSupportJAI(Object propertyChangeEventSource) {
049:                // if propertyChangeEventSource is null, a NullPointerException
050:                // is thrown in the superclass.
051:                super (propertyChangeEventSource);
052:
053:                this .propertyChangeEventSource = propertyChangeEventSource;
054:            }
055:
056:            /**
057:             * Retrieve the parameter passed to the constructor.
058:             *
059:             * @return The property change event source.
060:             */
061:            public Object getPropertyChangeEventSource() {
062:                return propertyChangeEventSource;
063:            }
064:
065:            /**
066:             * Add a <code>PropertyChangeListener</code> for a specific property.
067:             * The <code>propertyName</code> is forced to lower case.
068:             *
069:             * @exception IllegalArgumentException if <code>propertyName</code> is
070:             *            <code>null</code>.
071:             */
072:            public void addPropertyChangeListener(String propertyName,
073:                    PropertyChangeListener listener) {
074:
075:                if (propertyName == null) {
076:                    throw new IllegalArgumentException(JaiI18N
077:                            .getString("Generic0"));
078:                }
079:
080:                super .addPropertyChangeListener(propertyName.toLowerCase(),
081:                        listener);
082:            }
083:
084:            /**
085:             * Remove a <code>PropertyChangeListener</code> for a specific property.
086:             * The <code>propertyName</code> is forced to lower case.
087:             *
088:             * @exception IllegalArgumentException if <code>propertyName</code> is
089:             *            <code>null</code>.
090:             */
091:            public void removePropertyChangeListener(String propertyName,
092:                    PropertyChangeListener listener) {
093:
094:                if (propertyName == null) {
095:                    throw new IllegalArgumentException(JaiI18N
096:                            .getString("Generic0"));
097:                }
098:
099:                super .removePropertyChangeListener(propertyName.toLowerCase(),
100:                        listener);
101:            }
102:
103:            /**
104:             * Report a bound property update to any registered listeners.
105:             * If the supplied object is not a <code>PropertyChangeEventJAI</code>
106:             * then a <code>PropertyChangeEventJAI</code> is constructed from the
107:             * event object's accessors and fired instead.
108:             *
109:             * @param evt The <code>PropertyChangeEvent</code> object.
110:             */
111:            public void firePropertyChange(PropertyChangeEvent evt) {
112:                if (!(evt instanceof  PropertyChangeEventJAI)) {
113:                    evt = new PropertyChangeEventJAI(evt.getSource(), evt
114:                            .getPropertyName(), evt.getOldValue(), evt
115:                            .getNewValue());
116:                }
117:                super .firePropertyChange(evt);
118:            }
119:
120:            /**
121:             * Report a bound property update to any registered listeners.
122:             * A <code>PropertyChangeEventJAI</code> is created from the cached
123:             * property event source and the supplied parameters and fired using
124:             * the superclass <code>firePropertyChange(PropertyChangeEvent)</code>
125:             * method.
126:             *
127:             * @param propertyName The name of the changed property.
128:             * @param oldValue The old value of the property.
129:             * @param newValue The new value of the property.
130:             */
131:            public void firePropertyChange(String propertyName,
132:                    Object oldValue, Object newValue) {
133:                PropertyChangeEventJAI evt = new PropertyChangeEventJAI(
134:                        propertyChangeEventSource, propertyName, oldValue,
135:                        newValue);
136:                super .firePropertyChange(evt);
137:            }
138:
139:            /**
140:             * Check whether there are any listeners for a specific property.
141:             * The <code>propertyName</code> is forced to lower case.
142:             *
143:             * @param propertyName  The name of the property.
144:             * @return <code>true</code> if there are one or more listeners for
145:             *         the given property
146:             */
147:            public synchronized boolean hasListeners(String propertyName) {
148:                return super.hasListeners(propertyName.toLowerCase());
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.