Source Code Cross Referenced for XAudio.java in  » XML-UI » xui32 » com » xoetrope » 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 » XML UI » xui32 » com.xoetrope.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.swing;
002:
003:        import com.xoetrope.carousel.build.BuildProperties;
004:        import java.applet.Applet;
005:        import java.applet.AudioClip;
006:        import java.io.IOException;
007:
008:        import javax.swing.JComponent;
009:        import net.xoetrope.debug.DebugLogger;
010:        import net.xoetrope.xui.XAttributedComponent;
011:        import net.xoetrope.xui.XProject;
012:        import net.xoetrope.xui.XProjectManager;
013:
014:        /**
015:         * A component capable of playing audio clips
016:         *
017:         * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
018:         * the GNU Public License (GPL), please see license.txt for more details. If
019:         * you make commercial use of this software you must purchase a commercial
020:         * license from Xoetrope.</p>
021:         * <p> $Revision: 1.10 $</p>
022:         */
023:        public class XAudio extends JComponent implements  XAttributedComponent {
024:            /**
025:             * The owner project and the context in which this object operates.
026:             */
027:            protected XProject currentProject = XProjectManager
028:                    .getCurrentProject();
029:
030:            /**
031:             * Create a new audio component
032:             */
033:            public XAudio() {
034:                setOpaque(false);
035:            }
036:
037:            /**
038:             * Performs any post creation initialisation of the control.
039:             * @throws java.io.IOException problems were encountered while trying to initailize the component. This component's init method actually does nothing
040:             */
041:            public void init() throws IOException {
042:            }
043:
044:            /**
045:             * Set one or more attributes of the component.
046:             * @param attribName the name of the attribute
047:             * <ul>
048:             *<li>content - the file name of the audio clip</li>
049:             *</ul>
050:             * @param attribValue the value of the attribute
051:             * @return 0 for success, non zero otherwise
052:             */
053:            public int setAttribute(String attribName, Object attribValue) {
054:                String attribNameLwr = attribName.toLowerCase();
055:                if (attribNameLwr.equals("content")
056:                        || attribNameLwr.equals("value"))
057:                    setValue((String) attribValue);
058:
059:                return 0;
060:            }
061:
062:            /**
063:             * Sets the image at the specified index.
064:             * The index is forced to be in the range of valid images and
065:             * if no images exist then no action is taken.
066:             * @param _fileName the name of the new image.
067:             */
068:            public void setValue(String _fileName) {
069:                if (_fileName != null) {
070:                    fileName = _fileName;
071:                    try {
072:                        ac = Applet.newAudioClip(currentProject
073:                                .findResource(fileName));
074:                    } catch (Exception e) {
075:                        if (BuildProperties.DEBUG)
076:                            DebugLogger
077:                                    .logError("Unable to load the audio clip: "
078:                                            + _fileName);
079:
080:                        ac = null;
081:                    }
082:                }
083:            }
084:
085:            /**
086:             * Gets the image at the specified index.
087:             * The index is forced to be in the range of valid images and
088:             * if no images exist then no action is taken.
089:             * @return the file name
090:             */
091:            public String getValue() {
092:                return fileName;
093:            }
094:
095:            /**
096:             * Starts the sound playback
097:             */
098:            public void start() {
099:                if (ac != null)
100:                    ac.play();
101:            }
102:
103:            /**
104:             * Starts the continuous sound playback
105:             */
106:            public void loop() {
107:                if (ac != null)
108:                    ac.loop();
109:            }
110:
111:            /**
112:             * Stops the playback.
113:             */
114:            public void stop() {
115:                if (ac != null)
116:                    ac.stop();
117:            }
118:
119:            private int zOrder = 3;
120:
121:            private String fileName = " ";
122:            private AudioClip ac;
123:
124:            // Original coordinates.
125:            private int oX, oY, oW, oH;
126:            static final long serialVersionUID = -3675838130865645852L;
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.