Source Code Cross Referenced for CompilationDialog.java in  » Installer » jsmooth » net » charabia » jsmoothgen » application » gui » util » 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 » Installer » jsmooth » net.charabia.jsmoothgen.application.gui.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          JSmooth: a VM wrapper toolkit for Windows
003:          Copyright (C) 2003 Rodrigo Reyes <reyes@charabia.net>
004:
005:          This program is free software; you can redistribute it and/or modify
006:          it under the terms of the GNU General Public License as published by
007:          the Free Software Foundation; either version 2 of the License, or
008:          (at your option) any later version.
009:
010:          This program is distributed in the hope that it will be useful,
011:          but WITHOUT ANY WARRANTY; without even the implied warranty of
012:          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:          GNU General Public License for more details.
014:
015:          You should have received a copy of the GNU General Public License
016:          along with this program; if not, write to the Free Software
017:          Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
018:
019:         */
020:
021:        package net.charabia.jsmoothgen.application.gui.util;
022:
023:        import net.charabia.jsmoothgen.application.*;
024:        import java.util.*;
025:
026:        /**
027:         *
028:         * @author  Rodrigo
029:         */
030:        public class CompilationDialog extends javax.swing.JDialog implements 
031:                ExeCompiler.StepListener {
032:            private ExeCompiler m_compiler;
033:            private boolean m_result = false;
034:            private boolean m_canceled = false;
035:
036:            /** Creates new form CompilationDialog */
037:            public CompilationDialog(java.awt.Frame parent, boolean modal) {
038:                super (parent, modal);
039:                initComponents();
040:            }
041:
042:            /** This method is called from within the constructor to
043:             * initialize the form.
044:             * WARNING: Do NOT modify this code. The content of this method is
045:             * always regenerated by the Form Editor.
046:             */
047:            private void initComponents() {//GEN-BEGIN:initComponents
048:                java.awt.GridBagConstraints gridBagConstraints;
049:
050:                jLabel1 = new javax.swing.JLabel();
051:                m_progress = new javax.swing.JProgressBar();
052:                jScrollPane1 = new javax.swing.JScrollPane();
053:                m_state = new javax.swing.JTextArea(10, 60);
054:                m_state.setLineWrap(true);
055:                m_cancelbutton = new javax.swing.JButton();
056:
057:                getContentPane().setLayout(new java.awt.GridBagLayout());
058:
059:                addWindowListener(new java.awt.event.WindowAdapter() {
060:                    public void windowClosing(java.awt.event.WindowEvent evt) {
061:                        closeDialog(evt);
062:                    }
063:                });
064:
065:                jLabel1
066:                        .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
067:                jLabel1.setText("Progress");
068:                gridBagConstraints = new java.awt.GridBagConstraints();
069:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
070:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
071:                gridBagConstraints.weightx = 1.0;
072:                getContentPane().add(jLabel1, gridBagConstraints);
073:
074:                gridBagConstraints = new java.awt.GridBagConstraints();
075:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
076:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
077:                gridBagConstraints.insets = new java.awt.Insets(5, 20, 5, 20);
078:                getContentPane().add(m_progress, gridBagConstraints);
079:
080:                //        jScrollPane1.setBorder(new javax.swing.border.TitledBorder("Compilation Information"));
081:                //        m_state.setBackground((java.awt.Color) javax.swing.UIManager.getDefaults().get("Button.background"));
082:                //        m_state.setBorder(null);
083:                m_state.setEditable(false);
084:                jScrollPane1.setViewportView(m_state);
085:
086:                gridBagConstraints = new java.awt.GridBagConstraints();
087:                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
088:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
089:                gridBagConstraints.weightx = 1.0;
090:                gridBagConstraints.weighty = 1.0;
091:                gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
092:                getContentPane().add(jScrollPane1, gridBagConstraints);
093:
094:                m_cancelbutton.setText("Cancel");
095:                m_cancelbutton
096:                        .addActionListener(new java.awt.event.ActionListener() {
097:                            public void actionPerformed(
098:                                    java.awt.event.ActionEvent evt) {
099:                                cancelbuttonActionPerformed(evt);
100:                            }
101:                        });
102:
103:                gridBagConstraints = new java.awt.GridBagConstraints();
104:                gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
105:                gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
106:                gridBagConstraints.weighty = 0.0001;
107:                gridBagConstraints.fill = java.awt.GridBagConstraints.NONE;
108:                getContentPane().add(m_cancelbutton, gridBagConstraints);
109:
110:                java.awt.Dimension screenSize = java.awt.Toolkit
111:                        .getDefaultToolkit().getScreenSize();
112:                setBounds((screenSize.width - 319) / 2,
113:                        (screenSize.height - 158) / 2, 319, 158);
114:            }//GEN-END:initComponents
115:
116:            private void cancelbuttonActionPerformed(
117:                    java.awt.event.ActionEvent evt)//GEN-FIRST:event_cancelbuttonActionPerformed
118:            {//GEN-HEADEREND:event_cancelbuttonActionPerformed
119:                // Add your handling code here:
120:                m_result = false;
121:                m_canceled = true;
122:                dispose();
123:            }//GEN-LAST:event_cancelbuttonActionPerformed
124:
125:            /** Closes the dialog */
126:            private void closeDialog(java.awt.event.WindowEvent evt)//GEN-FIRST:event_closeDialog
127:            {
128:                setVisible(false);
129:                dispose();
130:            }//GEN-LAST:event_closeDialog
131:
132:            public void setCompiler(ExeCompiler comp) {
133:                m_compiler = comp;
134:                comp.addListener(this );
135:                m_progress.setMaximum(100);
136:                m_progress.setMinimum(0);
137:                m_state.setText("");
138:            }
139:
140:            public void compile(Runnable r) {
141:                Thread t = new Thread(r);
142:                t.start();
143:                setModal(true);
144:                setVisible(true);
145:            }
146:
147:            /**
148:             * @param args the command line arguments
149:             */
150:            public static void main(String args[]) {
151:                new CompilationDialog(new javax.swing.JFrame(), true)
152:                        .setVisible(true);
153:            }
154:
155:            public void complete() {
156:                if (!m_canceled) {
157:                    m_result = true;
158:                    setNewState(100, "Done");
159:                    m_cancelbutton.setText("Done");
160:                    m_cancelbutton.grabFocus();
161:                }
162:            }
163:
164:            public void failed() {
165:                if (!m_canceled) {
166:                    m_result = false;
167:                    StringBuffer buf = new StringBuffer();
168:                    buf.append("Compilation failed!\n");
169:                    Vector v = m_compiler.getErrors();
170:                    for (int i = 0; i < v.size(); i++) {
171:                        buf.append("\n- ");
172:                        buf.append(v.get(i).toString());
173:                    }
174:                    buf.append("\n");
175:                    setNewState(100, buf.toString());
176:                }
177:            }
178:
179:            public void setNewState(int percentComplete, String state) {
180:                m_progress.setValue(percentComplete);
181:                m_state.append(state + "\n");
182:            }
183:
184:            public boolean getResult() {
185:                return m_result;
186:            }
187:
188:            // Variables declaration - do not modify//GEN-BEGIN:variables
189:            private javax.swing.JLabel jLabel1;
190:            private javax.swing.JScrollPane jScrollPane1;
191:            private javax.swing.JButton m_cancelbutton;
192:            private javax.swing.JProgressBar m_progress;
193:            private javax.swing.JTextArea m_state;
194:            // End of variables declaration//GEN-END:variables
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.