X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fjbgui%2FGSliderPanel.java;h=d2454422d2daa20764dac29dde28f186dbae9d64;hb=e2d27f21c1655d5707adad16fe174f2c88ba7cd3;hp=341263fc2e2d1b16426984edd3909cd3ced28924;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/jalview/jbgui/GSliderPanel.java b/src/jalview/jbgui/GSliderPanel.java index 341263f..d245442 100755 --- a/src/jalview/jbgui/GSliderPanel.java +++ b/src/jalview/jbgui/GSliderPanel.java @@ -1,20 +1,20 @@ -/* -* Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle -* -* This program 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 2 -* of the License, or (at your option) any later version. -* -* This program 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 this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +/* +* Jalview - A Sequence Alignment Editor and Viewer +* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* +* This program 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 2 +* of the License, or (at your option) any later version. +* +* This program 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 this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package jalview.jbgui; @@ -22,14 +22,21 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; +import java.awt.BorderLayout; - -public class GSliderPanel extends JPanel { +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class GSliderPanel extends JPanel +{ // this is used for conservation colours, PID colours and redundancy threshold protected JSlider slider = new JSlider(); protected JTextField valueField = new JTextField(); protected JLabel label = new JLabel(); - JPanel jPanel1 = new JPanel(); + protected JPanel southPanel = new JPanel(); GridLayout gridLayout1 = new GridLayout(); JPanel jPanel2 = new JPanel(); protected JButton applyButton = new JButton(); @@ -37,16 +44,31 @@ public class GSliderPanel extends JPanel { FlowLayout flowLayout1 = new FlowLayout(); protected JCheckBox allGroupsCheck = new JCheckBox(); BorderLayout borderLayout1 = new BorderLayout(); + JPanel jPanel1 = new JPanel(); + BorderLayout borderLayout2 = new BorderLayout(); - public GSliderPanel() { - try { + /** + * Creates a new GSliderPanel object. + */ + public GSliderPanel() + { + try + { jbInit(); - } catch (Exception e) { + } + catch (Exception e) + { e.printStackTrace(); } } - private void jbInit() throws Exception { + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + private void jbInit() throws Exception + { this.setLayout(gridLayout1); slider.setMajorTickSpacing(10); slider.setMinorTickSpacing(1); @@ -59,8 +81,10 @@ public class GSliderPanel extends JPanel { valueField.setPreferredSize(new Dimension(50, 12)); valueField.setText(""); valueField.setHorizontalAlignment(SwingConstants.CENTER); - valueField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { + valueField.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { valueField_actionPerformed(e); } }); @@ -68,14 +92,16 @@ public class GSliderPanel extends JPanel { label.setOpaque(false); label.setHorizontalAlignment(SwingConstants.CENTER); label.setText("set this label text"); - jPanel1.setLayout(borderLayout1); + southPanel.setLayout(borderLayout1); gridLayout1.setRows(2); jPanel2.setLayout(flowLayout1); applyButton.setFont(new java.awt.Font("Verdana", 0, 11)); applyButton.setOpaque(false); applyButton.setText("Apply"); - applyButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { + applyButton.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { applyButton_actionPerformed(e); } }); @@ -83,8 +109,10 @@ public class GSliderPanel extends JPanel { undoButton.setFont(new java.awt.Font("Verdana", 0, 11)); undoButton.setOpaque(false); undoButton.setText("Undo"); - undoButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { + undoButton.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { undoButton_actionPerformed(e); } }); @@ -92,34 +120,63 @@ public class GSliderPanel extends JPanel { allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11)); allGroupsCheck.setOpaque(false); allGroupsCheck.setText("Apply to all Groups"); - allGroupsCheck.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { + allGroupsCheck.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { allGroupsCheck_actionPerformed(e); } }); this.setBackground(Color.white); this.setPreferredSize(new Dimension(415, 84)); jPanel2.setOpaque(false); - jPanel1.setOpaque(false); - this.add(jPanel2, null); + southPanel.setOpaque(false); + jPanel1.setLayout(borderLayout2); + jPanel1.setOpaque(false); + this.add(jPanel2, null); jPanel2.add(label, null); jPanel2.add(applyButton, null); jPanel2.add(undoButton, null); - this.add(jPanel1, null); - jPanel1.add(slider, BorderLayout.WEST); - jPanel1.add(valueField, BorderLayout.CENTER); - jPanel1.add(allGroupsCheck, BorderLayout.EAST); - } + this.add(southPanel, null); + southPanel.add(jPanel1, java.awt.BorderLayout.EAST); + southPanel.add(slider, java.awt.BorderLayout.CENTER); + jPanel1.add(valueField, java.awt.BorderLayout.CENTER); + jPanel1.add(allGroupsCheck, java.awt.BorderLayout.EAST); + } - protected void valueField_actionPerformed(ActionEvent e) { + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void valueField_actionPerformed(ActionEvent e) + { } - protected void applyButton_actionPerformed(ActionEvent e) { + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void applyButton_actionPerformed(ActionEvent e) + { } - protected void undoButton_actionPerformed(ActionEvent e) { + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void undoButton_actionPerformed(ActionEvent e) + { } - protected void allGroupsCheck_actionPerformed(ActionEvent e) { + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void allGroupsCheck_actionPerformed(ActionEvent e) + { } }