Source Code Cross Referenced for VideoClipFileFilter.java in  » Testing » jacareto » jacareto » toolkit » swing » 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 » Testing » jacareto » jacareto.toolkit.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Jacareto Copyright (c) 2002-2005
003:         * Applied Computer Science Research Group, Darmstadt University of
004:         * Technology, Institute of Mathematics & Computer Science,
005:         * Ludwigsburg University of Education, and Computer Based
006:         * Learning Research Group, Aachen University. All rights reserved.
007:         *
008:         * Jacareto is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public
010:         * License as published by the Free Software Foundation; either
011:         * version 2 of the License, or (at your option) any later version.
012:         *
013:         * Jacareto is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         * General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public
019:         * License along with Jacareto; if not, write to the Free
020:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021:         *
022:         */
023:
024:        package jacareto.toolkit.swing;
025:
026:        import jacareto.toolkit.io.FileUtilities;
027:
028:        import java.io.File;
029:
030:        import java.util.ArrayList;
031:        import java.util.Iterator;
032:        import java.util.List;
033:
034:        import javax.swing.filechooser.FileFilter;
035:
036:        /**
037:         * FileFilter for video files
038:         *
039:         * @author Oliver Specht
040:         * @version $revision$
041:         */
042:        public class VideoClipFileFilter extends FileFilter {
043:            /** The description of this FileFilter. */
044:            private String description;
045:
046:            /** The listof extensions this filter accepts */
047:            private List extensions = new ArrayList(2);
048:
049:            /**
050:             * Creates an video clip FileFilter with the default description. The default description is
051:             * ".AVI and .MPG files".
052:             */
053:            public VideoClipFileFilter() {
054:                this ("*.AVI and *.MPG files");
055:            }
056:
057:            /**
058:             * Creates an video clip FileFilter with the specified description.
059:             *
060:             * @param description The description for this filter
061:             */
062:            public VideoClipFileFilter(String description) {
063:                super ();
064:                setDescription(description);
065:                extensions.add("mov");
066:            }
067:
068:            /**
069:             * Returns the description of this filter.
070:             *
071:             * @return String The description
072:             *
073:             * @see #setDescription(String)
074:             */
075:            public String getDescription() {
076:                return description;
077:            }
078:
079:            /**
080:             * Sets the description of this filter. The default is ".MOV files"
081:             *
082:             * @param description The new description
083:             *
084:             * @see #getDescription()
085:             */
086:            public void setDescription(String description) {
087:                this .description = description;
088:            }
089:
090:            /**
091:             * Whether or not the given {@link File} is an video file.
092:             *
093:             * @param file The file to be tested
094:             *
095:             * @return boolean true when the given {@link File} is accepted
096:             */
097:            public boolean accept(File file) {
098:                if (file.isDirectory()) {
099:                    return true;
100:                }
101:
102:                String extension = FileUtilities.getExtension(file);
103:                boolean accepts = false;
104:
105:                Iterator iter = extensions.iterator();
106:
107:                while (iter.hasNext()) {
108:                    if (extension.equals(iter.next())) {
109:                        accepts = true;
110:                    }
111:                }
112:
113:                return accepts;
114:            }
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.