Source Code Cross Referenced for SchemeApplet.java in  » Scripting » jscheme » jsint » 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 » Scripting » jscheme » jsint 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package jsint;
002:
003:        /**  
004:         * A jsint.SchemeApplet is an applet wrapper for a jsint.Scheme program
005:         * It reads the applet parameters to find which program to run
006:         * and then it creates a scheme interpreter to run that program.
007:         * @author Timothy J. Hickey, Copyright 2000, tim@cs.brandeis.edu, <a href="license.txt">license</a>
008:         * subsequently modified by Jscheme project members
009:         * licensed under zlib licence (see license.txt)
010:         */
011:
012:        import java.awt.*;
013:        import java.net.URL;
014:        import java.net.MalformedURLException;
015:        import java.util.*;
016:        import java.applet.*;
017:
018:        import jsint.*;
019:
020:        /**
021:         * this class defines an applet which will read
022:         * a file name from the applet parameter list and
023:         * will invoke the Jscheme interpreter on that file
024:         */
025:        public class SchemeApplet extends java.applet.Applet {
026:            Symbol init, start, stop, destroy;
027:
028:            public void init() {
029:                String progS = this .getParameter("prog"), // Scheme program to load
030:                exprS = this .getParameter("expr"), // Scheme expression to evaluate
031:                codeS = this .getParameter("compiledprog"), // compiled Scheme program to load
032:                initS = this .getParameter("init"), // Scheme procedure to call when initializing
033:                startS = this .getParameter("start"), // Scheme procedure to call when initializing
034:                stopS = this .getParameter("stop"), // Scheme procedure to call when initializing
035:                destroyS = this .getParameter("destroy"); // Scheme procedure to call when initializing
036:
037:                if (initS != null)
038:                    init = Symbol.intern(initS);
039:                if (startS != null)
040:                    start = Symbol.intern(startS);
041:                if (stopS != null)
042:                    stop = Symbol.intern(stopS);
043:                if (destroyS != null)
044:                    destroy = Symbol.intern(destroyS);
045:
046:                setBackground(new Color(250, 150, 255));
047:                setVisible(true);
048:
049:                try {
050:                    if (codeS != null)
051:                        Scheme.eval(new Pair(Symbol.intern(codeS
052:                                .concat(".load")), Pair.EMPTY));
053:
054:                    if (progS != null)
055:                        try {
056:                            Scheme.load(new InputPort(new URL(
057:                                    getDocumentBase(), progS).openStream()));
058:                        } catch (Exception e) {
059:                            Scheme.eval(U.list(Symbol.intern("load"), progS));
060:                        }
061:
062:                    if (exprS != null)
063:                        Scheme.eval((new InputPort((new java.io.StringReader(
064:                                exprS)))).read());
065:
066:                    if (init != null)
067:                        Scheme.eval(new Pair(init, new Pair(this , Pair.EMPTY)));
068:
069:                } catch (Exception e) {
070:                    E.warn("I/O Exception: " + e);
071:                    e.printStackTrace();
072:                }
073:            }
074:
075:            public void start() {
076:                try {
077:                    if (start != null)
078:                        Scheme
079:                                .eval(new Pair(start,
080:                                        new Pair(this , Pair.EMPTY)));
081:                } catch (Exception e) {
082:                    E.warn("I/O Exception: " + e);
083:                    e.printStackTrace();
084:                }
085:            }
086:
087:            public void stop() {
088:                try {
089:                    if (stop != null)
090:                        Scheme.eval(new Pair(stop, new Pair(this , Pair.EMPTY)));
091:                } catch (Exception e) {
092:                    E.warn("I/O Exception: " + e);
093:                    e.printStackTrace();
094:                }
095:            }
096:
097:            public void destroy() {
098:                try {
099:                    if (destroy != null)
100:                        Scheme.eval(new Pair(destroy,
101:                                new Pair(this , Pair.EMPTY)));
102:                } catch (Exception e) {
103:                    E.warn("I/O Exception: " + e);
104:                    e.printStackTrace();
105:                }
106:            }
107:
108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.