KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cmsinstaller > FinishDialog


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cmsinstaller;
25 import javax.swing.*;
26 import java.awt.*;
27
28 /**
29  * This is the database dialog.
30  */

31
32 public class FinishDialog extends JPanel
33 {
34     private InfoGlueInstaller infoGlueInstaller = null;
35     
36     private final static String JavaDoc introductionHeader = "Complete Installation";
37     private final static String JavaDoc introductionMessage = "It's now time to complete the installation by copying the codebase to the webcontainer.\n\nPlease press finish to complete the installation.";
38     
39     private JTextArea errorMessage = null;
40     
41     private int xPosLabels = 10;
42     private int xPosLabelsWidth = 130;
43     private int xPosValues = 150;
44     private int xPosValuesWidth = 260;
45     
46     
47     public FinishDialog(InfoGlueInstaller infoGlueInstaller)
48     {
49         this.infoGlueInstaller = infoGlueInstaller;
50         
51         this.setSize(450, 350);
52         this.setLayout(null);
53         this.setBackground(Color.white);
54         JLabel introductionLabel = new JLabel(introductionHeader);
55         introductionLabel.setBounds(0, 0, 400, 30);
56         introductionLabel.setFont(new java.awt.Font JavaDoc("Dialog", java.awt.Font.BOLD, 16));
57         
58         JTextArea textArea = new JTextArea(introductionMessage);
59         textArea.setEditable(false);
60         textArea.setBounds(0, 30, 400, 200);
61         textArea.setWrapStyleWord(true);
62         textArea.setLineWrap(true);
63         
64         this.errorMessage = new JTextArea("");
65         this.errorMessage.setForeground(Color.red);
66         this.errorMessage.setEditable(false);
67         this.errorMessage.setBounds(xPosLabels, 240, 320, 50);
68         this.errorMessage.setWrapStyleWord(true);
69         this.errorMessage.setLineWrap(true);
70         
71         this.add(introductionLabel);
72         this.add(textArea);
73         
74         this.add(errorMessage);
75                 
76         infoGlueInstaller.setBackButtonCommand("ShowServerDialog");
77         infoGlueInstaller.setNextButtonCommand("ShowDoneDialog");
78         infoGlueInstaller.setNextButtonLabel("Finish");
79     }
80     
81     
82     public void setErrorMessage(String JavaDoc errorMessage)
83     {
84         this.errorMessage.setText("An error made the installation stop: \n" + errorMessage);
85     }
86
87     public void paint(Graphics g)
88     {
89         Graphics2D g2 = (Graphics2D)g;
90         g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
91         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
92
93         super.paint(g);
94     }
95
96 }
Popular Tags