1   package org.wcb.gui.dialog;
2   
3   import org.wcb.gui.component.JXTitlePanel;
4   import org.wcb.gui.forms.E6BForm;
5   import org.wcb.gui.util.UIHelper;
6   import org.jdesktop.swingx.border.DropShadowBorder;
7   
8   import javax.swing.*;
9   import javax.swing.border.Border;
10  import javax.swing.border.CompoundBorder;
11  import java.awt.*;
12  
13  /**
14   * <small>
15   * <p/>
16   * Copyright (c)  2006  wbogaardt.
17   * This library is free software; you can redistribute it and/or
18   * modify it under the terms of the GNU Lesser General Public
19   * License as published by the Free Software Foundation; either
20   * version 2.1 of the License, or (at your option) any later version.
21   *
22   * This library is distributed in the hope that it will be useful,
23   * but WITHOUT ANY WARRANTY; without even the implied warranty of
24   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25   * Lesser General Public License for more details.
26   *
27   * You should have received a copy of the GNU Lesser General Public
28   * License along with this library; if not, write to the Free Software
29   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
30   * <p/>
31   * $File:  $ <br>
32   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Sep 18, 2006 9:56:58 AM $ <br>
33   * </small>
34   *
35   * @author wbogaardt
36   *       This pops up the dialog box for the e6b calculator.
37   */
38  
39  public class E6BCalculatorDialog extends JDialog  {
40  
41      public E6BCalculatorDialog() {
42          setTitle("E6B");
43          setModal(true);
44          setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
45          initComponents();
46      }
47  
48      /**
49       * Init the componets in the dialog.
50       */
51      private void initComponents() {
52          getContentPane().setLayout(new BorderLayout());
53          JPanel mainPanel =  new JXTitlePanel("E6B Calculator", new Color(0x37762c));
54          Border shadow = new DropShadowBorder(Color.BLACK, 1, 10, .5f, 15, false, true, true, true);
55          mainPanel.setBorder(new CompoundBorder(shadow, mainPanel.getBorder()));
56          mainPanel.add(new E6BForm());
57          getContentPane().add(mainPanel, BorderLayout.CENTER);
58          pack();
59          UIHelper.centerDialogToScreen(this);
60      }
61  }