Source Code Cross Referenced for guiJCGridClient.java in  » Net » JCGrid » org » homedns » dade » jcgrid » cmd » povray » 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 » Net » JCGrid » org.homedns.dade.jcgrid.cmd.povray 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         Copyright (C) 2004 David Bucciarelli (davibu@interfree.it)
003:
004:         This program is free software; you can redistribute it and/or
005:         modify it under the terms of the GNU General Public License
006:         as published by the Free Software Foundation; either version 2
007:         of the License, or (at your option) any later version.
008:
009:         This program is distributed in the hope that it will be useful,
010:         but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         GNU General Public License for more details.
013:
014:         You should have received a copy of the GNU General Public License
015:         along with this program; if not, write to the Free Software
016:         Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:         */
018:
019:        package org.homedns.dade.jcgrid.cmd.povray;
020:
021:        import java.io.*;
022:        import java.awt.*;
023:        import java.awt.image.*;
024:        import javax.swing.*;
025:
026:        import org.apache.log4j.*;
027:
028:        import org.homedns.dade.jcgrid.*;
029:        import org.homedns.dade.jcgrid.cmd.*;
030:        import org.homedns.dade.jcgrid.client.*;
031:        import org.homedns.dade.jcgrid.admin.*;
032:        import org.homedns.dade.jcgrid.gui.*;
033:
034:        public class guiJCGridClient extends javax.swing.JFrame {
035:            private final static String className = guiJCGridClient.class
036:                    .getName();
037:            private static Logger log = Logger.getLogger(className);
038:            private static Logger logDetail = Logger.getLogger("DETAIL."
039:                    + className);
040:
041:            private static final long serialVersionUID = 1L;
042:
043:            private guiJCGridConfig pGridConfig;
044:            private guiPOVRenderingPannel pPic;
045:            private guiRenderingSetting pSet;
046:            private guiJCGridAdminStatus pServerStatus;
047:            private guiJCGridAbout pAbout;
048:
049:            private GridNodeClientConfig clientConfig;
050:            private GridNodeAdminConfig adminConfig;
051:
052:            public guiJCGridClient() {
053:                pServerStatus = null;
054:                pAbout = null;
055:
056:                initComponents();
057:
058:                clientConfig = new GridNodeClientConfig();
059:                adminConfig = new GridNodeAdminConfig();
060:                adminConfig.autoSessioName();
061:
062:                // Share the same config
063:
064:                adminConfig.setGridConfig(clientConfig.getGridConfig());
065:
066:                // Grid config pannel
067:
068:                pGridConfig = new guiJCGridConfig(clientConfig.getGridConfig(),
069:                        this , false);
070:                pGridConfig.setVisible(true);
071:
072:                // Rendering pannel
073:
074:                pPic = new guiPOVRenderingPannel();
075:                GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
076:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
077:                gridBagConstraints.weightx = 1.0;
078:                gridBagConstraints.weighty = 1.0;
079:                this .getContentPane().add(pPic, gridBagConstraints);
080:
081:                // Rendering settings pannel
082:
083:                pSet = new guiRenderingSetting(clientConfig, this , false, pPic);
084:                pSet.setVisible(true);
085:            }
086:
087:            /** This method is called from within the constructor to
088:             * initialize the form.
089:             * WARNING: Do NOT modify this code. The content of this method is
090:             * always regenerated by the Form Editor.
091:             */
092:            private void initComponents() {//GEN-BEGIN:initComponents
093:                mBar = new javax.swing.JMenuBar();
094:                mFile = new javax.swing.JMenu();
095:                mLoadSettings = new javax.swing.JMenuItem();
096:                mSaveAsSettings = new javax.swing.JMenuItem();
097:                mSepa1 = new javax.swing.JSeparator();
098:                mSaveImageAs = new javax.swing.JMenuItem();
099:                mSepa2 = new javax.swing.JSeparator();
100:                mAbout = new javax.swing.JMenuItem();
101:                mSepa3 = new javax.swing.JSeparator();
102:                mExit = new javax.swing.JMenuItem();
103:                mAdmin = new javax.swing.JMenu();
104:                mStatus = new javax.swing.JMenuItem();
105:
106:                getContentPane().setLayout(new java.awt.GridBagLayout());
107:
108:                setTitle("JCGrid POVRay Client");
109:                setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
110:                setName("fMain");
111:                addWindowListener(new java.awt.event.WindowAdapter() {
112:                    public void windowClosing(java.awt.event.WindowEvent evt) {
113:                        exitForm(evt);
114:                    }
115:                });
116:
117:                mFile.setText("File");
118:                mLoadSettings.setText("Load settings");
119:                mLoadSettings
120:                        .addActionListener(new java.awt.event.ActionListener() {
121:                            public void actionPerformed(
122:                                    java.awt.event.ActionEvent evt) {
123:                                mLoadSettingsActionPerformed(evt);
124:                            }
125:                        });
126:
127:                mFile.add(mLoadSettings);
128:
129:                mSaveAsSettings.setText("Save settings as...");
130:                mSaveAsSettings
131:                        .addActionListener(new java.awt.event.ActionListener() {
132:                            public void actionPerformed(
133:                                    java.awt.event.ActionEvent evt) {
134:                                mSaveAsSettingsActionPerformed(evt);
135:                            }
136:                        });
137:
138:                mFile.add(mSaveAsSettings);
139:
140:                mFile.add(mSepa1);
141:
142:                mSaveImageAs.setText("Save image as...");
143:                mSaveImageAs
144:                        .addActionListener(new java.awt.event.ActionListener() {
145:                            public void actionPerformed(
146:                                    java.awt.event.ActionEvent evt) {
147:                                mSaveImageAsActionPerformed(evt);
148:                            }
149:                        });
150:
151:                mFile.add(mSaveImageAs);
152:
153:                mFile.add(mSepa2);
154:
155:                mAbout.setText("About");
156:                mAbout.setMnemonic('a');
157:                mAbout.addActionListener(new java.awt.event.ActionListener() {
158:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
159:                        mAboutActionPerformed(evt);
160:                    }
161:                });
162:
163:                mFile.add(mAbout);
164:
165:                mFile.add(mSepa3);
166:
167:                mExit.setText("Exit");
168:                mExit.addActionListener(new java.awt.event.ActionListener() {
169:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
170:                        mExitActionPerformed(evt);
171:                    }
172:                });
173:
174:                mFile.add(mExit);
175:
176:                mBar.add(mFile);
177:
178:                mAdmin.setText("Admin.");
179:                mStatus.setText("Server status");
180:                mStatus.addActionListener(new java.awt.event.ActionListener() {
181:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
182:                        mStatusActionPerformed(evt);
183:                    }
184:                });
185:
186:                mAdmin.add(mStatus);
187:
188:                mBar.add(mAdmin);
189:
190:                setJMenuBar(mBar);
191:
192:                setBounds(0, 0, 400, 300);
193:            }//GEN-END:initComponents
194:
195:            private void mAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mAboutActionPerformed
196:                if ((pAbout == null) || (!pAbout.isVisible())) {
197:                    pAbout = new guiJCGridAbout(this , false);
198:                    pAbout.setVisible(true);
199:                }
200:            }//GEN-LAST:event_mAboutActionPerformed
201:
202:            private void mStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mStatusActionPerformed
203:                if ((pServerStatus != null) && (pServerStatus.isVisible()))
204:                    pServerStatus.refreshInfo(adminConfig);
205:                else {
206:                    try {
207:                        pServerStatus = new guiJCGridAdminStatus(adminConfig,
208:                                this , false);
209:                        pServerStatus.setVisible(true);
210:                    } catch (Exception ex) {
211:                        log.warn(
212:                                "Error while opening the Admin. Status dialog",
213:                                ex);
214:
215:                        JOptionPane.showMessageDialog(this ,
216:                                "Error while opening the Admin. Status dialog",
217:                                "Admin error", JOptionPane.ERROR_MESSAGE);
218:                    }
219:                }
220:            }//GEN-LAST:event_mStatusActionPerformed
221:
222:            private void mSaveImageAsActionPerformed(
223:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mSaveImageAsActionPerformed
224:                JFileChooser chooser = new JFileChooser();
225:                chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
226:                chooser.setCurrentDirectory(new File(System
227:                        .getProperty("user.dir")));
228:
229:                int res = chooser.showSaveDialog(this );
230:
231:                if (res == JFileChooser.APPROVE_OPTION)
232:                    pPic.saveImage(chooser.getSelectedFile().getAbsolutePath());
233:            }//GEN-LAST:event_mSaveImageAsActionPerformed
234:
235:            private void mLoadSettingsActionPerformed(
236:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mLoadSettingsActionPerformed
237:                JFileChooser chooser = new JFileChooser();
238:                chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
239:                chooser.setCurrentDirectory(new File(System
240:                        .getProperty("user.dir")));
241:
242:                int res = chooser.showOpenDialog(this );
243:
244:                if (res == JFileChooser.APPROVE_OPTION) {
245:                    GridNodeClientConfig cfg = pSet.loadSettings(chooser
246:                            .getSelectedFile().getAbsolutePath());
247:
248:                    if (cfg != null) {
249:                        clientConfig = cfg;
250:
251:                        // Share the same config
252:
253:                        adminConfig.setGridConfig(clientConfig.getGridConfig());
254:
255:                        pGridConfig.refreshConfig(clientConfig.getGridConfig());
256:                    }
257:                }
258:            }//GEN-LAST:event_mLoadSettingsActionPerformed
259:
260:            private void mSaveAsSettingsActionPerformed(
261:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mSaveAsSettingsActionPerformed
262:                JFileChooser chooser = new JFileChooser();
263:                chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
264:                chooser.setCurrentDirectory(new File(System
265:                        .getProperty("user.dir")));
266:
267:                int res = chooser.showSaveDialog(this );
268:
269:                if (res == JFileChooser.APPROVE_OPTION)
270:                    pSet.saveSettings(chooser.getSelectedFile()
271:                            .getAbsolutePath());
272:            }//GEN-LAST:event_mSaveAsSettingsActionPerformed
273:
274:            private void mExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mExitActionPerformed
275:                this .exitForm(null);
276:            }//GEN-LAST:event_mExitActionPerformed
277:
278:            /** Exit the Application */
279:            private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
280:                System.exit(0);
281:            }//GEN-LAST:event_exitForm
282:
283:            /**
284:             * @param args the command line arguments
285:             */
286:            public static void main(String args[]) {
287:                try {
288:                    // Setup log4j
289:
290:                    MainCmd.setUpLog4J("gui-client", false);
291:
292:                    new guiJCGridClient().setVisible(true);
293:                } catch (Exception ex) {
294:                    log.warn("Error", ex);
295:                    System.exit(0);
296:                }
297:            }
298:
299:            // Variables declaration - do not modify//GEN-BEGIN:variables
300:            private javax.swing.JMenuItem mAbout;
301:            private javax.swing.JMenu mAdmin;
302:            private javax.swing.JMenuBar mBar;
303:            private javax.swing.JMenuItem mExit;
304:            private javax.swing.JMenu mFile;
305:            private javax.swing.JMenuItem mLoadSettings;
306:            private javax.swing.JMenuItem mSaveAsSettings;
307:            private javax.swing.JMenuItem mSaveImageAs;
308:            private javax.swing.JSeparator mSepa1;
309:            private javax.swing.JSeparator mSepa2;
310:            private javax.swing.JSeparator mSepa3;
311:            private javax.swing.JMenuItem mStatus;
312:            // End of variables declaration//GEN-END:variables
313:
314:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.