JAL-1432 updated copyright notices
[jalview.git] / src / jalview / jbgui / GRestInputParamEditDialog.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.jbgui;
20
21 import java.awt.Dimension;
22 import java.awt.event.KeyEvent;
23 import java.awt.event.KeyListener;
24
25 import jalview.gui.JvSwingUtils;
26 import jalview.gui.OptsAndParamsPage;
27
28 import javax.swing.*;
29 import javax.swing.border.TitledBorder;
30 import javax.swing.event.ListSelectionEvent;
31 import javax.swing.event.ListSelectionListener;
32
33 import net.miginfocom.swing.MigLayout;
34
35 public class GRestInputParamEditDialog
36 {
37
38   protected JPanel dpane;
39
40   protected JPanel okcancel;
41
42   protected JList typeList;
43
44   protected JTextField tok;
45
46   protected JPanel options;
47
48   protected JPanel optionsPanel;
49
50   public GRestInputParamEditDialog()
51   {
52     jbInit();
53   }
54
55   protected void jbInit()
56   {
57     dpane = new JPanel(new MigLayout("", "[][][fill]", "[][fill][]"));
58     dpane.setPreferredSize(new Dimension(
59             110 + 100 + OptsAndParamsPage.PARAM_WIDTH, 400));
60     typeList = new JList();
61     typeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
62     typeList.getSelectionModel().addListSelectionListener(
63             new ListSelectionListener()
64             {
65
66               @Override
67               public void valueChanged(ListSelectionEvent e)
68               {
69                 type_SelectionChangedActionPerformed(e);
70               };
71             });
72
73     tok = new JTextField();
74     tok.addKeyListener(new KeyListener()
75     {
76
77       @Override
78       public void keyTyped(KeyEvent e)
79       {
80       }
81
82       @Override
83       public void keyReleased(KeyEvent e)
84       {
85         tokChanged_actionPerformed();
86       }
87
88       @Override
89       public void keyPressed(KeyEvent e)
90       {
91
92       }
93     });
94     options = new JPanel(new MigLayout("", "[grow 100,fill]", ""));
95     optionsPanel = new JPanel(new MigLayout("", "[fill]", "[fill]"));
96     JScrollPane optionView = new JScrollPane();
97     optionView.setViewportView(options);
98     JvSwingUtils.mgAddtoLayout(dpane, "Input Parameter name", new JLabel(
99             "Name"), tok, "grow,spanx 3,wrap");
100     JPanel paramsType = new JPanel(new MigLayout("", "[grow 100,fill]",
101             "[grow 100,fill]"));
102     paramsType.setBorder(new TitledBorder("Select input type"));
103     JScrollPane jlistScroller = new JScrollPane();
104     jlistScroller.setViewportView(typeList);
105     paramsType.add(jlistScroller, "spanx 2,spany 2");
106     dpane.add(paramsType);
107     optionsPanel.setBorder(new TitledBorder("Set options for type"));
108     optionsPanel.add(optionView);
109     dpane.add(optionsPanel, "wrap");
110     okcancel = new JPanel(new MigLayout("", "[center][center]", "[]"));
111     dpane.add(okcancel, "spanx 3,wrap");
112
113   }
114
115   protected void tokChanged_actionPerformed()
116   {
117
118   }
119
120   protected void type_SelectionChangedActionPerformed(ListSelectionEvent e)
121   {
122   }
123
124 }