Source Code Cross Referenced for ImageStack.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: ImageStack.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:10 $
010:         * $State: Exp $
011:         */
012:        package javax.media.jai;
013:
014:        import java.util.Collection;
015:        import java.util.Iterator;
016:
017:        /**
018:         * A class representing a stack of images, each associated with a
019:         * spatial position/orientation defined in a common coordinate system.
020:         * The images are of the type <code>javax.media.jai.PlanarImage</code>;
021:         * the coordinates are of the type <code>java.lang.Object</code>.
022:         * The tuple (image, coordinate) is represented by class
023:         * <code>javax.media.jai.CoordinateImage</code>.
024:         *
025:         * <p> This class can be used to represent medical or geophysical images.
026:         *
027:         * @see PlanarImage
028:         *
029:         * @deprecated as of JAI 1.1. Use
030:         * <code>AttributedImageCollection</code> instead.
031:         */
032:        public abstract class ImageStack extends CollectionImage {
033:
034:            /** The default constructor. */
035:            protected ImageStack() {
036:            }
037:
038:            /**
039:             * Constructor.
040:             *
041:             * @param images  A collection of <code>CoordinateImage</code>.
042:             *
043:             * @throws IllegalArgumentException if <code>images</code> is <code>null</code>.
044:             */
045:            public ImageStack(Collection images) {
046:                super (images);
047:            }
048:
049:            /**
050:             * Returns the image associated with the specified coordinate,
051:             * or <code>null</code> if <code>c</code> is <code>null</code> or
052:             * if no match is found.
053:             *
054:             * @param c The specified coordinate object.
055:             */
056:            public PlanarImage getImage(Object c) {
057:                if (c != null) {
058:                    Iterator iter = iterator();
059:
060:                    while (iter.hasNext()) {
061:                        CoordinateImage ci = (CoordinateImage) iter.next();
062:                        if (ci.coordinate.equals(c)) {
063:                            return ci.image;
064:                        }
065:                    }
066:                }
067:
068:                return null;
069:            }
070:
071:            /**
072:             * Returns the coordinate associated with the specified image,
073:             * or <code>null</code> if <code>pi</code> is <code>null</code> or
074:             * if no match is found.
075:             *
076:             *  @param pi The specified planar image.
077:             */
078:            public Object getCoordinate(PlanarImage pi) {
079:                if (pi != null) {
080:                    Iterator iter = iterator();
081:
082:                    while (iter.hasNext()) {
083:                        CoordinateImage ci = (CoordinateImage) iter.next();
084:                        if (ci.image.equals(pi)) {
085:                            return ci.coordinate;
086:                        }
087:                    }
088:                }
089:
090:                return null;
091:            }
092:
093:            /**
094:             * Adds a <code>CoordinateImage</code> to this collection.  If the
095:             * specified image is <code>null</code>, it is not added to the
096:             * collection.
097:             *
098:             * @return true if and only if the <code>CoordinateImage</code> is added
099:             *         to the collection.
100:             */
101:            public boolean add(Object o) {
102:                if (o != null && o instanceof  CoordinateImage) {
103:                    return super .add(o);
104:                } else {
105:                    return false;
106:                }
107:            }
108:
109:            /**
110:             * Removes the <code>CoordinateImage</code> that contains the
111:             * specified image from this collection.
112:             *
113:             * @param pi The specified planar image.
114:             * @return true if and only if a <code>CoordinateImage</code> containing
115:             *         the specified image is removed from the collection.
116:             */
117:            public boolean remove(PlanarImage pi) {
118:                if (pi != null) {
119:                    Iterator iter = iterator();
120:
121:                    while (iter.hasNext()) {
122:                        CoordinateImage ci = (CoordinateImage) iter.next();
123:                        if (ci.image.equals(pi)) {
124:                            return super .remove(ci);
125:                        }
126:                    }
127:                }
128:
129:                return false;
130:            }
131:
132:            /**
133:             * Removes the <code>CoordinateImage</code> that contains the
134:             * specified coordinate from this collection.
135:             *
136:             * @param c The specified coordinate object.
137:             * @return true if and only if a <code>CoordinateImage</code> containing
138:             *         the specified coordinate is removed from the collection.
139:             */
140:            public boolean remove(Object c) {
141:                if (c != null) {
142:                    Iterator iter = iterator();
143:
144:                    while (iter.hasNext()) {
145:                        CoordinateImage ci = (CoordinateImage) iter.next();
146:                        if (ci.coordinate.equals(c)) {
147:                            return super .remove(ci);
148:                        }
149:                    }
150:                }
151:
152:                return false;
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.