Source Code Cross Referenced for VAWizard.java in  » Installer » VAInstall » com » memoire » vainstall » gui » 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 » VAInstall » com.memoire.vainstall.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $RCSfile: VAWizard.java,v $
003:         * @creation     01/02/00
004:         * @modification $Date: 2004/02/02 20:57:58 $
005:         */package com.memoire.vainstall.gui;
006:
007:        import java.awt.*;
008:        import java.awt.event.ActionListener;
009:        import java.awt.event.ActionEvent;
010:        import javax.swing.*;
011:        import javax.swing.border.*;
012:        import com.memoire.vainstall.VAStep;
013:        import com.memoire.vainstall.VAWizardInterface;
014:        import com.memoire.vainstall.VAGlobals;
015:        import com.memoire.vainstall.VAWelcomeStep;
016:        import com.memoire.vainstall.VALanguageStep;
017:
018:        /**
019:         * @version      $Id: VAWizard.java,v 1.9 2004/02/02 20:57:58 deniger Exp $
020:         * @author       Axel von Arnim
021:         */
022:
023:        public class VAWizard extends JDialog implements  VAWizardInterface,
024:                ActionListener {
025:            private static VAWizard UNIQUE_WIZARD = null;
026:            JButton btNext_, btBack_, btCancel_;
027:            VAPanel panel_;
028:            JPanel pnNav_;
029:
030:            protected VAWizard() {
031:                super ();
032:                init();
033:            }
034:
035:            protected void init() {
036:                super .setTitle(VAGlobals.i18n("UI_Title"));
037:                super .setDefaultCloseOperation(HIDE_ON_CLOSE);
038:                setModal(true);
039:
040:                Container cp = getContentPane();
041:                cp.setLayout(new BorderLayout());
042:                cp.setBackground(Color.red);
043:
044:                pnNav_ = new JPanel();
045:                pnNav_.setLayout(new FlowLayout(FlowLayout.RIGHT));
046:                pnNav_.setBorder(new CompoundBorder(new EtchedBorder(),
047:                        new EmptyBorder(new Insets(5, 5, 5, 5))));
048:                btNext_ = new JButton(VAGlobals.i18n("UI_Next"));
049:                btBack_ = new JButton(VAGlobals.i18n("UI_Back"));
050:                btCancel_ = new JButton(VAGlobals.i18n("UI_Cancel"));
051:                pnNav_.add(btCancel_);
052:                pnNav_.add(btBack_);
053:                pnNav_.add(btNext_);
054:                btNext_.addActionListener(this );
055:                btBack_.addActionListener(this );
056:                btCancel_.addActionListener(this );
057:
058:                panel_ = new VAPanel();
059:                Dimension d = VAImagePanel.IMAGE_PANEL.getPreferredSize();
060:                // System.out.println("image size: "+d.width+","+d.height);
061:                panel_.setPreferredSize(new Dimension(d.width + 400, d.height));
062:                cp.add(BorderLayout.CENTER, panel_);
063:                cp.add(BorderLayout.SOUTH, pnNav_);
064:                pack();
065:                setResizable(false);
066:
067:                // center dialog
068:                Dimension dimScreen = Toolkit.getDefaultToolkit()
069:                        .getScreenSize();
070:                this .setLocation((dimScreen.width - this .getSize().width) / 2,
071:                        (dimScreen.height - this .getSize().height) / 2);
072:            }
073:
074:            public static VAWizardInterface createWizard() {
075:                if (UNIQUE_WIZARD == null)
076:                    UNIQUE_WIZARD = new VAWizard();
077:                else
078:                    UNIQUE_WIZARD.init();
079:                return UNIQUE_WIZARD;
080:            }
081:
082:            public void setStep(VAStep step) {
083:                panel_ = (VAPanel) step;
084:                Container pnContent = getContentPane();
085:                pnContent.removeAll();
086:                //panel_.setPreferredSize(new Dimension(600,400));
087:                panel_.setBorder(new CompoundBorder(new EtchedBorder(),
088:                        new EmptyBorder(new Insets(5, 5, 5, 5))));
089:                pnContent.add(BorderLayout.CENTER, panel_);
090:
091:                // in case of language change we need to update the pnNav_ panel
092:                // this is a hack due to the static way of handling language
093:                if (step instanceof  VAWelcomeStep
094:                        || step instanceof  VALanguageStep) {
095:                    btNext_.setText(VAGlobals.i18n("UI_Next"));
096:                    btBack_.setText(VAGlobals.i18n("UI_Back"));
097:                    btCancel_.setText(VAGlobals.i18n("UI_Cancel"));
098:                    doLayout();
099:                    validate();
100:                }
101:
102:                pnContent.add(BorderLayout.SOUTH, pnNav_);
103:                pnContent.doLayout();
104:                invalidate();
105:                pnContent.validate();
106:                //    Dimension size=getSize();
107:                //    setSize(new Dimension(size.width, size.height));
108:                Dimension size = getSize();
109:                //setSize(new Dimension(size.width+1, size.height+1));
110:                //repaint();
111:            }
112:
113:            public VAPanel getPanel() {
114:                return panel_;
115:            }
116:
117:            public void setActionEnabled(int actions) {
118:                btCancel_.setEnabled((actions & CANCEL) == CANCEL);
119:                btBack_.setEnabled((actions & BACK) == BACK);
120:                btNext_.setEnabled(((actions & NEXT) == NEXT)
121:                        || ((actions & FINISH) == FINISH));
122:                if ((actions & FINISH) == FINISH) {
123:                    btNext_.setText(VAGlobals.i18n("UI_Finish"));
124:                }
125:            }
126:
127:            public void actionPerformed(ActionEvent e) {
128:                Object src = e.getSource();
129:                if (src == btCancel_)
130:                    dispose(true);
131:                else if (src == btBack_)
132:                    panel_.backAction();
133:                else if (src == btNext_) {
134:                    // OSX Repaint
135:                    // Necessary for Mac OS X MRJ.
136:                    // On Mac OS X RepaintManger.currentManager().paintDirtyRegions()
137:                    // does not work. Hence, calls to VAInstallStep.details
138:                    // VAInstallStep.status and to the progess bar do not work
139:                    // on OS X (build 1.4.1_01-69.1 [late 2003] and for several 
140:                    // builds before that one).
141:                    //
142:                    // A work around to the problem is to do work from a thread
143:                    // other than the event dispatch thread.  Here, a new thread
144:                    // is launched.  Associated with this, all calls to
145:                    // RepaintManager.currentManager().paintDirtyRegions()
146:                    // have been commented out.  They have been labeled
147:                    // with "OSX Repaint - see VAWizard.java" so that the original mode
148:                    // of operation can be restored if Apple ever gets its act together.
149:                    // The modification works fine on Linux and Windows.
150:                    //
151:                    // Note that use of Runnable causes the class file VAWizard$1.class
152:                    // to be generated.  It has been added to VAArchiver.java.  If you
153:                    // eliminate the use of a new thread here, remove the entry from
154:                    // VAArchiver.java
155:                    Runnable runner = new Runnable() {
156:                        public void run() {
157:                            panel_.nextAction();
158:                        }
159:                    };
160:                    new Thread(runner).start();
161:                }
162:            }
163:
164:            public void hide(boolean question) {
165:                if (question) {
166:                    int res = JOptionPane.showConfirmDialog(this , VAGlobals
167:                            .i18n("UI_AbortQuestion"), VAGlobals
168:                            .i18n("UI_Finish"), JOptionPane.YES_NO_OPTION,
169:                            JOptionPane.QUESTION_MESSAGE);
170:                    if (res == JOptionPane.YES_OPTION) {
171:                        panel_.cancelAction();
172:                    }
173:                } else
174:                    super .hide();
175:            }
176:
177:            public void dispose() {
178:                hide(true);
179:            }
180:
181:            public void dispose(boolean confirm) {
182:                hide(confirm);
183:            }
184:
185:            public void show() {
186:                super .show();
187:            }
188:
189:            public void hide() {
190:                hide(true);
191:            }
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.