X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGRestInputParamEditDialog.java;h=31657f0fdfe2ce5dc45c7550e92d19518148ae12;hb=59d682209891099d46b960509907c79e3fb276fe;hp=a27775935d8312cd5c026151466ad21e7c848ba4;hpb=a789f790fbb3ab13f1967b42781b837b58bf9bbc;p=jalview.git diff --git a/src/jalview/jbgui/GRestInputParamEditDialog.java b/src/jalview/jbgui/GRestInputParamEditDialog.java index a277759..31657f0 100644 --- a/src/jalview/jbgui/GRestInputParamEditDialog.java +++ b/src/jalview/jbgui/GRestInputParamEditDialog.java @@ -1,3 +1,20 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + */ package jalview.jbgui; import java.awt.Dimension; @@ -14,80 +31,93 @@ import javax.swing.event.ListSelectionListener; import net.miginfocom.swing.MigLayout; - public class GRestInputParamEditDialog { protected JPanel dpane; + protected JPanel okcancel; + protected JList typeList; + protected JTextField tok; + protected JPanel options; + protected JPanel optionsPanel; - public GRestInputParamEditDialog() + + public GRestInputParamEditDialog() { jbInit(); } - protected void jbInit() { - dpane = new JPanel(new MigLayout("","[][][fill]","[][fill][]")); - dpane.setPreferredSize(new Dimension(110+100+OptsAndParamsPage.PARAM_WIDTH,400)); + + protected void jbInit() + { + dpane = new JPanel(new MigLayout("", "[][][fill]", "[][fill][]")); + dpane.setPreferredSize(new Dimension( + 110 + 100 + OptsAndParamsPage.PARAM_WIDTH, 400)); typeList = new JList(); typeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - typeList.getSelectionModel().addListSelectionListener(new ListSelectionListener() - { - - @Override - public void valueChanged(ListSelectionEvent e) - { - type_SelectionChangedActionPerformed(e); - }; - }); - + typeList.getSelectionModel().addListSelectionListener( + new ListSelectionListener() + { + + @Override + public void valueChanged(ListSelectionEvent e) + { + type_SelectionChangedActionPerformed(e); + }; + }); + tok = new JTextField(); tok.addKeyListener(new KeyListener() { - + @Override public void keyTyped(KeyEvent e) { } - + @Override public void keyReleased(KeyEvent e) { tokChanged_actionPerformed(); } - + @Override public void keyPressed(KeyEvent e) { - + } }); - options = new JPanel(new MigLayout("","[grow 100,fill]","")); - optionsPanel = new JPanel(new MigLayout("","[fill]","[fill]")); + options = new JPanel(new MigLayout("", "[grow 100,fill]", "")); + optionsPanel = new JPanel(new MigLayout("", "[fill]", "[fill]")); JScrollPane optionView = new JScrollPane(); optionView.setViewportView(options); - JvSwingUtils.mgAddtoLayout(dpane, "Input Parameter name", new JLabel("Name"), tok, "grow,spanx 3,wrap"); - JPanel paramsType = new JPanel(new MigLayout("","[grow 100,fill]","[grow 100,fill]")); + JvSwingUtils.mgAddtoLayout(dpane, "Input Parameter name", new JLabel( + "Name"), tok, "grow,spanx 3,wrap"); + JPanel paramsType = new JPanel(new MigLayout("", "[grow 100,fill]", + "[grow 100,fill]")); paramsType.setBorder(new TitledBorder("Select input type")); - JScrollPane jlistScroller=new JScrollPane(); + JScrollPane jlistScroller = new JScrollPane(); jlistScroller.setViewportView(typeList); - paramsType.add(jlistScroller,"spanx 2,spany 2"); + paramsType.add(jlistScroller, "spanx 2,spany 2"); dpane.add(paramsType); optionsPanel.setBorder(new TitledBorder("Set options for type")); optionsPanel.add(optionView); - dpane.add(optionsPanel,"wrap"); - okcancel = new JPanel(new MigLayout("","[center][center]","[]")); - dpane.add(okcancel,"spanx 3,wrap"); + dpane.add(optionsPanel, "wrap"); + okcancel = new JPanel(new MigLayout("", "[center][center]", "[]")); + dpane.add(okcancel, "spanx 3,wrap"); } + protected void tokChanged_actionPerformed() { - + } + protected void type_SelectionChangedActionPerformed(ListSelectionEvent e) { } - + }