Source Code Cross Referenced for HelloPanel.java in  » Installer » IzPack » com » izforge » izpack » panels » 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 » IzPack » com.izforge.izpack.panels 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003:         * 
004:         * http://izpack.org/
005:         * http://izpack.codehaus.org/
006:         * 
007:         * Copyright 2002 Jan Blok
008:         * 
009:         * Licensed under the Apache License, Version 2.0 (the "License");
010:         * you may not use this file except in compliance with the License.
011:         * You may obtain a copy of the License at
012:         * 
013:         *     http://www.apache.org/licenses/LICENSE-2.0
014:         *     
015:         * Unless required by applicable law or agreed to in writing, software
016:         * distributed under the License is distributed on an "AS IS" BASIS,
017:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018:         * See the License for the specific language governing permissions and
019:         * limitations under the License.
020:         */
021:
022:        package com.izforge.izpack.panels;
023:
024:        import java.awt.LayoutManager2;
025:        import java.util.ArrayList;
026:
027:        import javax.swing.JLabel;
028:
029:        import com.izforge.izpack.Info;
030:        import com.izforge.izpack.gui.IzPanelLayout;
031:        import com.izforge.izpack.gui.LabelFactory;
032:        import com.izforge.izpack.gui.LayoutConstants;
033:        import com.izforge.izpack.installer.InstallData;
034:        import com.izforge.izpack.installer.InstallerFrame;
035:        import com.izforge.izpack.installer.IzPanel;
036:
037:        /**
038:         * The Hello panel class.
039:         * 
040:         * @author Julien Ponge
041:         */
042:        public class HelloPanel extends IzPanel {
043:
044:            /**
045:             * 
046:             */
047:            private static final long serialVersionUID = 3257848774955905587L;
048:
049:            /**
050:             * The constructor.
051:             * 
052:             * @param parent The parent.
053:             * @param idata The installation data.
054:             */
055:            public HelloPanel(InstallerFrame parent, InstallData idata) {
056:                this (parent, idata, new IzPanelLayout());
057:            }
058:
059:            /**
060:             * Creates a new HelloPanel object with the given layout manager. Valid layout manager are the
061:             * IzPanelLayout and the GridBagLayout. New panels should be use the IzPanelLaout. If lm is
062:             * null, no layout manager will be created or initialized.
063:             * 
064:             * @param parent The parent IzPack installer frame.
065:             * @param idata The installer internal data.
066:             * @param layout layout manager to be used with this IzPanel
067:             */
068:
069:            public HelloPanel(InstallerFrame parent, InstallData idata,
070:                    LayoutManager2 layout) {
071:                // Layout handling. This panel was changed from a mixed layout handling
072:                // with GridBagLayout and BoxLayout to IzPanelLayout. It can be used as an
073:                // example how to use the IzPanelLayout. For this there are some comments
074:                // which are excrescent for a "normal" panel.
075:                // Set a IzPanelLayout as layout for this panel.
076:                // This have to be the first line during layout if IzPanelLayout will be used.
077:                super (parent, idata, layout);
078:                // We create and put the labels
079:                String str;
080:                str = parent.langpack.getString("HelloPanel.welcome1")
081:                        + idata.info.getAppName() + " "
082:                        + idata.info.getAppVersion()
083:                        + parent.langpack.getString("HelloPanel.welcome2");
084:                JLabel welcomeLabel = LabelFactory.create(str, parent.icons
085:                        .getImageIcon("host"), LEADING);
086:                // IzPanelLayout is a constraint orientated layout manager. But if no constraint is
087:                // given, a default will be used. It starts in the first line.
088:                // NEXT_LINE have to insert also in the first line!!
089:                add(welcomeLabel, NEXT_LINE);
090:                // Yes, there exist also a strut for the IzPanelLayout.
091:                // But the strut will be only used for one cell. A vertical strut will be use
092:                // NEXT_ROW, a horizontal NEXT_COLUMN. For more information see the java doc.
093:                // add(IzPanelLayout.createVerticalStrut(20));
094:                // But for a strut you have to define a fixed height. Alternative it is possible
095:                // to create a paragraph gap which is configurable.
096:                add(IzPanelLayout.createParagraphGap());
097:
098:                ArrayList<Info.Author> authors = idata.info.getAuthors();
099:                int size = authors.size();
100:                if (size > 0) {
101:                    str = parent.langpack.getString("HelloPanel.authors");
102:                    JLabel appAuthorsLabel = LabelFactory.create(str,
103:                            parent.icons.getImageIcon("information"), LEADING);
104:                    // If nothing will be sad to the IzPanelLayout the position of an add will be
105:                    // determined in the default constraint. For labels it is CURRENT_ROW, NEXT_COLUMN.
106:                    // But at this point we would place the label in the next row. It is possible
107:                    // to create an IzPanelConstraint with this options, but it is also possible to
108:                    // use simple the NEXT_LINE object as constraint. Attention!! Do not use
109:                    // LayoutConstants.NEXT_ROW else LayoutConstants.NEXT_LINE because NEXT_ROW is an
110:                    // int and with it an other add method will be used without any warning (there the
111:                    // parameter will be used as position of the component in the panel, not the
112:                    // layout manager.
113:                    add(appAuthorsLabel, LayoutConstants.NEXT_LINE);
114:
115:                    JLabel label;
116:                    for (int i = 0; i < size; i++) {
117:                        Info.Author a = authors.get(i);
118:                        String email = (a.getEmail() != null && a.getEmail()
119:                                .length() > 0) ? (" <" + a.getEmail() + ">")
120:                                : "";
121:                        label = LabelFactory.create(
122:                                " - " + a.getName() + email, parent.icons
123:                                        .getImageIcon("empty"), LEADING);
124:                        add(label, NEXT_LINE);
125:                    }
126:                    add(IzPanelLayout.createParagraphGap());
127:                }
128:
129:                if (idata.info.getAppURL() != null) {
130:                    str = parent.langpack.getString("HelloPanel.url")
131:                            + idata.info.getAppURL();
132:                    JLabel appURLLabel = LabelFactory.create(str, parent.icons
133:                            .getImageIcon("bookmark"), LEADING);
134:                    add(appURLLabel, LayoutConstants.NEXT_LINE);
135:                }
136:                // At end of layouting we should call the completeLayout method also they do nothing.
137:                getLayoutHelper().completeLayout();
138:            }
139:
140:            /**
141:             * Indicates wether the panel has been validated or not.
142:             * 
143:             * @return Always true.
144:             */
145:            public boolean isValidated() {
146:                return true;
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.