1   package org.wcb.gui.forms.wizard;
2   
3   import org.wcb.gui.component.JXTitlePanel;
4   import org.wcb.gui.dialog.file.FAA8710FileDialog;
5   import org.jdesktop.swingx.border.DropShadowBorder;
6   
7   import javax.swing.border.Border;
8   import javax.swing.border.CompoundBorder;
9   import javax.swing.*;
10  import java.awt.*;
11  import java.awt.event.ActionListener;
12  import java.awt.event.ActionEvent;
13  import java.io.File;
14  
15  
16  /**
17   * <small>
18   * <p/>
19   * Copyright (C)  2006  wbogaardt.
20   * This library is free software; you can redistribute it and/or
21   * modify it under the terms of the GNU Lesser General Public
22   * License as published by the Free Software Foundation; either
23   * version 2.1 of the License, or (at your option) any later version.
24   * <p/>
25   * This library is distributed in the hope that it will be useful,
26   * but WITHOUT ANY WARRANTY; without even the implied warranty of
27   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
28   * Lesser General Public License for more details.
29   * <p/>
30   * You should have received a copy of the GNU Lesser General Public
31   * License along with this library; if not, write to the Free Software
32   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
33   * <p/>
34   * $File:  $ <br>
35   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Oct 26, 2006 2:43:12 PM $ <br>
36   * </small>
37   *
38   * @author wbogaardt
39   *        Page 6 save pdf file to a user selected location.
40   */
41  
42  public class Step6of8710Wizard extends JXTitlePanel implements ActionListener {
43  
44      public Step6of8710Wizard() {
45          super("Step 6 of 6 - Save to File", new Color(0x3779ff));
46          Border shadow = new DropShadowBorder(Color.BLACK, 1, 5, .3f, 15, true, true, true, true);
47          setBorder(new CompoundBorder(shadow, getBorder()));
48          initComponents();
49      }
50  
51      /** This method is called from within the constructor to
52       * initialize the form.
53       * WARNING: Do NOT modify this code. The content of this method is
54       * always regenerated by the Form Editor.
55       */
56      private void initComponents() {
57          GridBagConstraints gridBagConstraints;
58  
59          fileName = new JTextField(System.getProperty("user.home") + File.separator + "8710-temp.pdf");
60          fileLocationButton = new JButton("..");
61          fileLocationButton.addActionListener(this);
62  
63          setLayout(new GridBagLayout());
64  
65          gridBagConstraints = new GridBagConstraints();
66          gridBagConstraints.anchor = GridBagConstraints.WEST;
67          add(new JLabel("File Name"), gridBagConstraints);
68  
69          gridBagConstraints = new GridBagConstraints();
70          gridBagConstraints.anchor = GridBagConstraints.WEST;
71          add(fileName, gridBagConstraints);
72  
73          gridBagConstraints = new GridBagConstraints();
74          gridBagConstraints.anchor = GridBagConstraints.WEST;
75          add(fileLocationButton, gridBagConstraints);
76      }
77  
78      public String getFilePathName() {
79          return fileName.getText();
80      }
81  
82      public void actionPerformed(ActionEvent evt) {
83          FAA8710FileDialog savePdfDialog = new FAA8710FileDialog();
84          String pdfPath = savePdfDialog.getFilePath();
85          if (pdfPath !=null && !pdfPath.equals("")) {
86              fileName.setText(pdfPath);
87          }
88      }
89  
90      // Variables declaration - do not modify
91  
92      private JTextField fileName;
93      private JButton fileLocationButton;
94  
95      // End of variables declaration
96  
97  }