001: /*
002: * SSHTools - Java SSH2 API
003: *
004: * Copyright (C) 2002-2003 Lee David Painter and Contributors.
005: *
006: * Contributions made by:
007: *
008: * Brett Smith
009: * Richard Pernavas
010: * Erwin Bolwidt
011: *
012: * This program is free software; you can redistribute it and/or
013: * modify it under the terms of the GNU General Public License
014: * as published by the Free Software Foundation; either version 2
015: * of the License, or (at your option) any later version.
016: *
017: * This program is distributed in the hope that it will be useful,
018: * but WITHOUT ANY WARRANTY; without even the implied warranty of
019: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
020: * GNU General Public License for more details.
021: *
022: * You should have received a copy of the GNU General Public License
023: * along with this program; if not, write to the Free Software
024: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
025: */
026: package com.sshtools.common.keygen;
027:
028: import java.awt.*;
029:
030: import javax.swing.*;
031: import javax.swing.border.*;
032:
033: /**
034: *
035: *
036: * @author $author$
037: * @version $Revision: 1.14 $
038: */
039: public class KeygenPanel2 extends JPanel {
040: // Actions
041:
042: /** */
043: public final static int GENERATE_KEY_PAIR = 0;
044:
045: /** */
046: public final static int CONVERT_IETF_SECSH_TO_OPENSSH = 1;
047:
048: /** */
049: public final static int CONVERT_OPENSSH_TO_IETF_SECSH = 2;
050:
051: /** */
052: public final static int CHANGE_PASSPHRASE = 3;
053:
054: // Private instance variables
055: private JButton browseInput;
056: BorderLayout borderLayout1 = new BorderLayout();
057: JPanel jPanel1 = new JPanel();
058: JTabbedPane key1Panel = new JTabbedPane();
059: JPanel key1GeneratePanel = new JPanel();
060: JPanel file = new JPanel();
061: BorderLayout borderLayout2 = new BorderLayout();
062: JPanel key1DataPanel = new JPanel();
063: JScrollPane jScrollPane1 = new JScrollPane();
064: JTextArea jTextArea1 = new JTextArea();
065: GridLayout gridLayout1 = new GridLayout();
066: TitledBorder titledBorder1;
067: TitledBorder titledBorder2;
068: GridBagLayout gridBagLayout1 = new GridBagLayout();
069: JLabel jLabel1 = new JLabel();
070: JTextField jTextField1 = new JTextField();
071: JButton jButton1 = new JButton();
072: JButton jButton2 = new JButton();
073:
074: /**
075: * Creates a new KeygenPanel2 object.
076: */
077: public KeygenPanel2() {
078: super ();
079:
080: try {
081: jbInit();
082: } catch (Exception e) {
083: e.printStackTrace();
084: }
085: }
086:
087: private void jbInit() throws Exception {
088: titledBorder1 = new TitledBorder("Data");
089: titledBorder2 = new TitledBorder("Key 1");
090: this .setLayout(borderLayout1);
091: jPanel1.setLayout(borderLayout2);
092: jTextArea1.setText("jTextArea1");
093: key1DataPanel.setLayout(gridLayout1);
094: key1DataPanel.setBorder(titledBorder1);
095: jPanel1.setBorder(titledBorder2);
096: file.setLayout(gridBagLayout1);
097: jLabel1.setText("File:");
098: jTextField1.setText("jTextField1");
099: jButton1.setText("Open");
100: jButton2.setText("Browse");
101: this .add(jPanel1, BorderLayout.CENTER);
102: jPanel1.add(key1Panel, BorderLayout.NORTH);
103: key1Panel.add(key1GeneratePanel, "Generate");
104: key1Panel.add(file, "File");
105: jPanel1.add(key1DataPanel, BorderLayout.CENTER);
106: key1DataPanel.add(jScrollPane1, null);
107: jScrollPane1.getViewport().add(jTextArea1, null);
108: file.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
109: GridBagConstraints.CENTER,
110: GridBagConstraints.HORIZONTAL, new Insets(2, 2, 0, 3),
111: 0, 0));
112: file.add(jTextField1, new GridBagConstraints(1, 0, 1, 1, 1.0,
113: 0.0, GridBagConstraints.CENTER,
114: GridBagConstraints.HORIZONTAL, new Insets(2, 2, 0, 0),
115: 0, 0));
116: file.add(jButton1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
117: GridBagConstraints.CENTER,
118: GridBagConstraints.HORIZONTAL, new Insets(2, 2, 0, 2),
119: 0, 0));
120: file.add(jButton2, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
121: GridBagConstraints.CENTER,
122: GridBagConstraints.HORIZONTAL, new Insets(2, 0, 0, 2),
123: 0, 0));
124: }
125: }
|