X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbappletgui%2FGSliderPanel.java;h=5e333005e88d5627ced78ce0c9e53a73fb40c2cd;hb=f714a7c40a08130e8e239828ecbe4503bb5ebafc;hp=8f7613ad0aeaf3453eef5f30597986a5d6badaf6;hpb=ec955aa655d8320258b91eb079bc57f688cd0a07;p=jalview.git diff --git a/src/jalview/jbappletgui/GSliderPanel.java b/src/jalview/jbappletgui/GSliderPanel.java index 8f7613a..5e33300 100755 --- a/src/jalview/jbappletgui/GSliderPanel.java +++ b/src/jalview/jbappletgui/GSliderPanel.java @@ -1,117 +1,115 @@ +/* +* 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.jbappletgui; import java.awt.*; import java.awt.event.*; -public class GSliderPanel extends Panel -{ - // this is used for conservation colours, PID colours and redundancy threshold - protected Scrollbar slider = new Scrollbar(); - protected TextField valueField = new TextField(); - protected Label label = new Label(); - Panel jPanel1 = new Panel(); - Panel jPanel2 = new Panel(); - protected Button applyButton = new Button(); - protected Button undoButton = new Button(); - FlowLayout flowLayout1 = new FlowLayout(); - protected Checkbox allGroupsCheck = new Checkbox(); - BorderLayout borderLayout1 = new BorderLayout(); - BorderLayout borderLayout2 = new BorderLayout(); - FlowLayout flowLayout2 = new FlowLayout(); - public GSliderPanel() - { - try - { - jbInit(); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - private void jbInit() throws Exception - { - this.setLayout(borderLayout2); - // slider.setMajorTickSpacing(10); - // slider.setMinorTickSpacing(1); - // slider.setPaintTicks(true); - slider.setBackground(Color.white); - slider.setFont(new java.awt.Font("Verdana", 0, 11)); - slider.setOrientation(0); - valueField.setFont(new java.awt.Font("Verdana", 0, 11)); - valueField.setText(" "); - valueField.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - valueField_actionPerformed(e); - } - }); - label.setFont(new java.awt.Font("Verdana", 0, 11)); - label.setText("set this label text"); - jPanel1.setLayout(borderLayout1); - jPanel2.setLayout(flowLayout1); - applyButton.setFont(new java.awt.Font("Verdana", 0, 11)); - applyButton.setLabel("Apply"); - applyButton.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - applyButton_actionPerformed(e); - } - }); - undoButton.setEnabled(false); - undoButton.setFont(new java.awt.Font("Verdana", 0, 11)); - undoButton.setLabel("Undo"); - undoButton.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - undoButton_actionPerformed(e); - } - }); - allGroupsCheck.setEnabled(false); - allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11)); - allGroupsCheck.setLabel("Apply threshold to all groups"); - allGroupsCheck.setName("Apply to all Groups"); - allGroupsCheck.addItemListener(new java.awt.event.ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - allGroupsCheck_actionPerformed(); - } - }); - this.setBackground(Color.white); - this.setForeground(Color.black); - jPanel2.add(label, null); - jPanel2.add(applyButton, null); - jPanel2.add(undoButton, null); - jPanel2.add(allGroupsCheck); - jPanel1.add(valueField, java.awt.BorderLayout.EAST); - jPanel1.add(slider, java.awt.BorderLayout.CENTER); - this.add(jPanel1, java.awt.BorderLayout.SOUTH); - this.add(jPanel2, java.awt.BorderLayout.CENTER); - } - - protected void valueField_actionPerformed(ActionEvent e) - { +public class GSliderPanel extends Panel { + // this is used for conservation colours, PID colours and redundancy threshold + protected Scrollbar slider = new Scrollbar(); + protected TextField valueField = new TextField(); + protected Label label = new Label(); + Panel jPanel1 = new Panel(); + Panel jPanel2 = new Panel(); + protected Button applyButton = new Button(); + protected Button undoButton = new Button(); + FlowLayout flowLayout1 = new FlowLayout(); + protected Checkbox allGroupsCheck = new Checkbox(); + BorderLayout borderLayout1 = new BorderLayout(); + BorderLayout borderLayout2 = new BorderLayout(); + FlowLayout flowLayout2 = new FlowLayout(); - } - - protected void applyButton_actionPerformed(ActionEvent e) - { + public GSliderPanel() { + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } + } - } + private void jbInit() throws Exception { + this.setLayout(borderLayout2); - protected void undoButton_actionPerformed(ActionEvent e) - { + // slider.setMajorTickSpacing(10); + // slider.setMinorTickSpacing(1); + // slider.setPaintTicks(true); + slider.setBackground(Color.white); + slider.setFont(new java.awt.Font("Verdana", 0, 11)); + slider.setOrientation(0); + valueField.setFont(new java.awt.Font("Verdana", 0, 11)); + valueField.setText(" "); + valueField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + valueField_actionPerformed(e); + } + }); + label.setFont(new java.awt.Font("Verdana", 0, 11)); + label.setText("set this label text"); + jPanel1.setLayout(borderLayout1); + jPanel2.setLayout(flowLayout1); + applyButton.setFont(new java.awt.Font("Verdana", 0, 11)); + applyButton.setLabel("Apply"); + applyButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + applyButton_actionPerformed(e); + } + }); + undoButton.setEnabled(false); + undoButton.setFont(new java.awt.Font("Verdana", 0, 11)); + undoButton.setLabel("Undo"); + undoButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + undoButton_actionPerformed(e); + } + }); + allGroupsCheck.setEnabled(false); + allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11)); + allGroupsCheck.setLabel("Apply threshold to all groups"); + allGroupsCheck.setName("Apply to all Groups"); + allGroupsCheck.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(ItemEvent e) { + allGroupsCheck_actionPerformed(); + } + }); + this.setBackground(Color.white); + this.setForeground(Color.black); + jPanel2.add(label, null); + jPanel2.add(applyButton, null); + jPanel2.add(undoButton, null); + jPanel2.add(allGroupsCheck); + jPanel1.add(valueField, java.awt.BorderLayout.EAST); + jPanel1.add(slider, java.awt.BorderLayout.CENTER); + this.add(jPanel1, java.awt.BorderLayout.SOUTH); + this.add(jPanel2, java.awt.BorderLayout.CENTER); + } - } + protected void valueField_actionPerformed(ActionEvent e) { + } - protected void allGroupsCheck_actionPerformed() - { + protected void applyButton_actionPerformed(ActionEvent e) { + } - } + protected void undoButton_actionPerformed(ActionEvent e) { + } + protected void allGroupsCheck_actionPerformed() { + } }