Source Code Cross Referenced for InteractionPropertiesDialog.java in  » Web-Framework » argun » biz » hammurapi » web » interaction » 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 » Web Framework » argun » biz.hammurapi.web.interaction 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * argun 1.0
003:         * Web 2.0 delivery framework 
004:         * Copyright (C) 2007  Hammurapi Group
005:         *
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2 of the License, or (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         * URL: http://www.hammurapi.biz
021:         * e-Mail: support@hammurapi.biz 
022:         */
023:        package biz.hammurapi.web.interaction;
024:
025:        import java.awt.GridBagConstraints;
026:        import java.awt.GridBagLayout;
027:        import java.awt.Insets;
028:        import java.awt.event.ActionEvent;
029:        import java.awt.event.ActionListener;
030:
031:        import javax.swing.ComboBoxModel;
032:        import javax.swing.DefaultComboBoxModel;
033:        import javax.swing.JButton;
034:        import javax.swing.JCheckBox;
035:        import javax.swing.JComboBox;
036:        import javax.swing.JEditorPane;
037:        import javax.swing.JFrame;
038:        import javax.swing.JLabel;
039:        import javax.swing.JScrollPane;
040:        import javax.swing.JTabbedPane;
041:        import javax.swing.JTextArea;
042:        import javax.swing.JTextField;
043:        import javax.swing.JTextPane;
044:
045:        /**
046:         * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
047:         * Builder, which is free for non-commercial use. If Jigloo is being used
048:         * commercially (ie, by a corporation, company or business for any purpose
049:         * whatever) then you should purchase a license for each developer using Jigloo.
050:         * Please visit www.cloudgarden.com for details. Use of Jigloo implies
051:         * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
052:         * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
053:         * ANY CORPORATE OR COMMERCIAL PURPOSE.
054:         */
055:        public class InteractionPropertiesDialog extends javax.swing.JDialog {
056:            private JButton okButton;
057:
058:            private JButton cancelButton;
059:
060:            private JTextArea afterTextArea;
061:
062:            private JScrollPane afterScrollPane;
063:
064:            private JTextArea beforeTextArea;
065:
066:            private JScrollPane beforeScrollPane;
067:
068:            private JCheckBox verticalCheckBox;
069:            private JComboBox scopeComboBox;
070:            private JLabel scopeLabel;
071:
072:            private JLabel nameLabel;
073:
074:            private JEditorPane descriptionEditorPane;
075:
076:            private JScrollPane descriptionScrollPane;
077:
078:            private JTabbedPane tabbedPanel;
079:
080:            private JTextField nameField;
081:
082:            private Interaction data;
083:
084:            /**
085:             * Auto-generated main method to display this JDialog
086:             */
087:            public static void main(String[] args) {
088:                JFrame frame = new JFrame();
089:                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
090:                InteractionPropertiesDialog inst = new InteractionPropertiesDialog(
091:                        frame, null);
092:                inst.setVisible(true);
093:                frame.dispose();
094:                //System.exit(0);
095:            }
096:
097:            public InteractionPropertiesDialog(JFrame frame, Interaction data) {
098:                super (frame);
099:                this .data = data;
100:                initGUI();
101:                nameField.setText(data.getName());
102:                afterTextArea.setText(data.getAfterCode());
103:                beforeTextArea.setText(data.getBeforeCode());
104:                //descriptionEditorPane.setEditorKit(new HTMLEditorKit());
105:                descriptionEditorPane.setText(data.getDescription());
106:                verticalCheckBox.setSelected(data.getIsVertical());
107:                scopeComboBox.setSelectedItem(data.getScope());
108:                if (scopeComboBox.getSelectedIndex() == -1) {
109:                    scopeComboBox.setSelectedIndex(0);
110:                }
111:            }
112:
113:            private void initGUI() {
114:                try {
115:                    GridBagLayout this Layout = new GridBagLayout();
116:                    this Layout.rowWeights = new double[] { 0.0, 0.1, 0.0 };
117:                    this Layout.rowHeights = new int[] { 32, 303, 7 };
118:                    this Layout.columnWeights = new double[] { 0.0, 0.0, 0.0,
119:                            0.1, 0.0 };
120:                    this Layout.columnWidths = new int[] { 45, 85, 42, 20, 7 };
121:                    getContentPane().setLayout(this Layout);
122:                    this .setName("Properties");
123:                    this .setModal(true);
124:                    this .setTitle("Properties");
125:                    this .setFocusable(false);
126:                    {
127:                        nameField = new JTextField();
128:                        getContentPane().add(
129:                                nameField,
130:                                new GridBagConstraints(1, 0, 4, 1, 0.0, 0.0,
131:                                        GridBagConstraints.WEST,
132:                                        GridBagConstraints.HORIZONTAL,
133:                                        new Insets(0, 0, 0, 0), 0, 0));
134:                        nameField.setText("Step name");
135:                        nameField.setSize(200, 20);
136:                    }
137:                    {
138:                        okButton = new JButton();
139:                        getContentPane().add(
140:                                okButton,
141:                                new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0,
142:                                        GridBagConstraints.EAST,
143:                                        GridBagConstraints.NONE, new Insets(3,
144:                                                0, 3, 5), 0, 0));
145:                        okButton.setText("OK");
146:                        okButton.addActionListener(new ActionListener() {
147:                            public void actionPerformed(ActionEvent evt) {
148:                                okButtonActionPerformed(evt);
149:                            }
150:                        });
151:                    }
152:                    {
153:                        cancelButton = new JButton();
154:                        getContentPane().add(
155:                                cancelButton,
156:                                new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0,
157:                                        GridBagConstraints.WEST,
158:                                        GridBagConstraints.NONE, new Insets(3,
159:                                                0, 3, 3), 0, 0));
160:                        cancelButton.setText("Cancel");
161:                        cancelButton.addActionListener(new ActionListener() {
162:                            public void actionPerformed(ActionEvent evt) {
163:                                cancelButtonActionPerformed(evt);
164:                            }
165:                        });
166:                    }
167:                    {
168:                        tabbedPanel = new JTabbedPane();
169:                        getContentPane().add(
170:                                tabbedPanel,
171:                                new GridBagConstraints(0, 1, 5, 1, 0.0, 0.0,
172:                                        GridBagConstraints.NORTHWEST,
173:                                        GridBagConstraints.BOTH, new Insets(0,
174:                                                0, 0, 0), 0, 0));
175:                        {
176:                            descriptionScrollPane = new JScrollPane();
177:                            tabbedPanel.addTab("Description", null,
178:                                    descriptionScrollPane, null);
179:                            descriptionScrollPane
180:                                    .setPreferredSize(new java.awt.Dimension(
181:                                            360, 159));
182:                            descriptionScrollPane.setAutoscrolls(true);
183:                            {
184:                                descriptionEditorPane = new JTextPane();
185:                                descriptionScrollPane
186:                                        .setViewportView(descriptionEditorPane);
187:                                descriptionEditorPane.setText("Description");
188:                                descriptionEditorPane
189:                                        .setPreferredSize(new java.awt.Dimension(
190:                                                411, 284));
191:                            }
192:                        }
193:                        {
194:                            beforeScrollPane = new JScrollPane();
195:                            tabbedPanel.addTab("Before", null,
196:                                    beforeScrollPane, null);
197:                            {
198:                                beforeTextArea = new JTextArea();
199:                                beforeScrollPane
200:                                        .setViewportView(beforeTextArea);
201:                                beforeTextArea
202:                                        .setText("// Put condition code here");
203:                                beforeTextArea.setFont(new java.awt.Font(
204:                                        "Courier New", 0, 11));
205:                                beforeTextArea.setTabSize(4);
206:                            }
207:                        }
208:                        {
209:                            afterScrollPane = new JScrollPane();
210:                            tabbedPanel.addTab("After", null, afterScrollPane,
211:                                    null);
212:                            afterScrollPane
213:                                    .setPreferredSize(new java.awt.Dimension(
214:                                            501, 287));
215:                            {
216:                                afterTextArea = new JTextArea();
217:                                afterScrollPane.setViewportView(afterTextArea);
218:                                afterTextArea
219:                                        .setText("// Put action code here");
220:                                afterTextArea.setFont(new java.awt.Font(
221:                                        "Courier New", 0, 11));
222:                                afterTextArea.setTabSize(4);
223:                            }
224:                        }
225:                    }
226:                    {
227:                        nameLabel = new JLabel();
228:                        getContentPane().add(
229:                                nameLabel,
230:                                new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
231:                                        GridBagConstraints.CENTER,
232:                                        GridBagConstraints.NONE, new Insets(0,
233:                                                0, 0, 5), 0, 0));
234:                        nameLabel.setText("Name");
235:                    }
236:                    {
237:                        verticalCheckBox = new JCheckBox();
238:                        getContentPane().add(
239:                                verticalCheckBox,
240:                                new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0,
241:                                        GridBagConstraints.WEST,
242:                                        GridBagConstraints.NONE, new Insets(0,
243:                                                5, 0, 0), 0, 0));
244:                        verticalCheckBox.setText("Vertical orientation");
245:                    }
246:                    {
247:                        scopeLabel = new JLabel();
248:                        getContentPane().add(
249:                                scopeLabel,
250:                                new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0,
251:                                        GridBagConstraints.WEST,
252:                                        GridBagConstraints.NONE, new Insets(0,
253:                                                5, 0, 0), 0, 0));
254:                        scopeLabel.setText("Scope");
255:                    }
256:                    {
257:                        ComboBoxModel scopeComboBoxModel = new DefaultComboBoxModel(
258:                                new String[] { "Public", "Parent", "Hidden" });
259:                        scopeComboBox = new JComboBox();
260:                        getContentPane().add(
261:                                scopeComboBox,
262:                                new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0,
263:                                        GridBagConstraints.WEST,
264:                                        GridBagConstraints.NONE, new Insets(0,
265:                                                2, 0, 0), 0, 0));
266:                        scopeComboBox.setModel(scopeComboBoxModel);
267:                    }
268:                    this .setSize(500, 400);
269:                } catch (Exception e) {
270:                    e.printStackTrace();
271:                }
272:            }
273:
274:            private void okButtonActionPerformed(ActionEvent evt) {
275:                data.setAfterCode(afterTextArea.getText());
276:                data.setBeforeCode(beforeTextArea.getText());
277:                data.setName(nameField.getText());
278:                data.setDescription(descriptionEditorPane.getText());
279:                data.setIsVertical(verticalCheckBox.isSelected());
280:                Object scope = scopeComboBox.getSelectedItem();
281:                data.setScope(scope == null ? null : scope.toString());
282:                data.getApplet().modelChanged();
283:                cancelButtonActionPerformed(evt);
284:            }
285:
286:            private void cancelButtonActionPerformed(ActionEvent evt) {
287:                setVisible(false);
288:                dispose();
289:            }
290:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.