KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > wizard > DefaultDODSWizard


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19
20 /*
21  *
22  * @author Nenad Vico
23  * @version 1.0.0
24  *
25  */

26 package org.enhydra.dods.wizard;
27
28 import java.awt.Dimension JavaDoc;
29 import java.awt.Toolkit JavaDoc;
30 import javax.swing.UIManager JavaDoc;
31 import org.enhydra.dods.generator.DODSGenerator;
32 import org.enhydra.dods.generator.DODSWizard;
33
34 /**
35  * <p>Title: </p>
36  * <p>Description: </p>
37  * <p>Copyright: Copyright (c) 2002</p>
38  * <p>Company: </p>
39  * @author Nenad Vico
40  * @version 1.0
41  */

42
43 /**
44  * DODS Generator Wizard's main class.
45  */

46 public class DefaultDODSWizard extends DODSWizard {
47     public static WizardFrame1 frame = null;
48     boolean packFrame = false;
49     public DefaultDODSWizard(DODSGenerator generator) {
50         super(generator);
51         try {
52             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
53         } catch (Exception JavaDoc e) {
54             e.printStackTrace();
55         }
56     }
57
58     public void startup() {
59         frame = new WizardFrame1();
60         if (packFrame) {
61             frame.pack();
62         } else {
63             frame.validate();
64         }
65         // Center the window
66
Dimension JavaDoc screenSize = Toolkit.getDefaultToolkit().getScreenSize();
67         Dimension JavaDoc frameSize = frame.getSize();
68
69         if (frameSize.height > screenSize.height) {
70             frameSize.height = screenSize.height;
71         }
72         if (frameSize.width > screenSize.width) {
73             frameSize.width = screenSize.width;
74         }
75         frame.setLocation((screenSize.width - frameSize.width) / 2,
76                 (screenSize.height - frameSize.height) / 2);
77         frame.setVisible(true);
78         frame.setDefaultFocus();
79     }
80     
81 }
82
Popular Tags