X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbappletgui%2FGFontChooser.java;h=794dbbba76de1e47652cb07d6814c69f1dbebafd;hb=d429962a1e4d2413e0c18fd88227cffee8bfa502;hp=d83ed0dfa03712cd708af0c1429b62710c9e9d90;hpb=ec955aa655d8320258b91eb079bc57f688cd0a07;p=jalview.git diff --git a/src/jalview/jbappletgui/GFontChooser.java b/src/jalview/jbappletgui/GFontChooser.java index d83ed0d..794dbbb 100755 --- a/src/jalview/jbappletgui/GFontChooser.java +++ b/src/jalview/jbappletgui/GFontChooser.java @@ -1,142 +1,133 @@ +/* +* 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 GFontChooser extends Panel -{ - Label label1 = new Label(); - protected Choice fontSize = new Choice(); - protected Choice fontStyle = new Choice(); - Label label2 = new Label(); - Label label3 = new Label(); - protected Choice fontName = new Choice(); - Button ok = new Button(); - Button cancel = new Button(); - Panel panel1 = new Panel(); - Panel panel2 = new Panel(); - Panel panel3 = new Panel(); - BorderLayout borderLayout1 = new BorderLayout(); - BorderLayout borderLayout2 = new BorderLayout(); - BorderLayout borderLayout3 = new BorderLayout(); - Panel panel4 = new Panel(); - Panel panel5 = new Panel(); - BorderLayout borderLayout4 = new BorderLayout(); - - public GFontChooser() - { - try - { - jbInit(); - } - catch(Exception e) - { - e.printStackTrace(); +public class GFontChooser extends Panel { + Label label1 = new Label(); + protected Choice fontSize = new Choice(); + protected Choice fontStyle = new Choice(); + Label label2 = new Label(); + Label label3 = new Label(); + protected Choice fontName = new Choice(); + Button ok = new Button(); + Button cancel = new Button(); + Panel panel1 = new Panel(); + Panel panel2 = new Panel(); + Panel panel3 = new Panel(); + BorderLayout borderLayout1 = new BorderLayout(); + BorderLayout borderLayout2 = new BorderLayout(); + BorderLayout borderLayout3 = new BorderLayout(); + Panel panel4 = new Panel(); + Panel panel5 = new Panel(); + BorderLayout borderLayout4 = new BorderLayout(); + + public GFontChooser() { + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } } - } - private void jbInit() throws Exception - { - label1.setFont(new java.awt.Font("Verdana", 0, 11)); - label1.setAlignment(Label.RIGHT); - label1.setText("Font: "); - this.setLayout(borderLayout4); - fontSize.setFont(new java.awt.Font("Verdana", 0, 11)); - fontSize.addItemListener(new java.awt.event.ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - fontSize_actionPerformed(); - } - }); - fontStyle.setFont(new java.awt.Font("Verdana", 0, 11)); - fontStyle.addItemListener(new java.awt.event.ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - fontStyle_actionPerformed(); - } - }); - label2.setAlignment(Label.RIGHT); - label2.setFont(new java.awt.Font("Verdana", 0, 11)); - label2.setText("Size: "); - label3.setAlignment(Label.RIGHT); - label3.setFont(new java.awt.Font("Verdana", 0, 11)); - label3.setText("Style: "); - fontName.setFont(new java.awt.Font("Verdana", 0, 11)); - fontName.addItemListener(new java.awt.event.ItemListener() - { - public void itemStateChanged(ItemEvent e) - { - fontName_actionPerformed(); - } - }); - ok.setFont(new java.awt.Font("Verdana", 0, 11)); - ok.setLabel("OK"); - ok.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - ok_actionPerformed(); - } - }); - cancel.setFont(new java.awt.Font("Verdana", 0, 11)); - cancel.setLabel("Cancel"); - cancel.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - cancel_actionPerformed(); - } - }); - this.setBackground(Color.white); - panel1.setLayout(borderLayout1); - panel2.setLayout(borderLayout3); - panel3.setLayout(borderLayout2); - panel5.setBackground(Color.white); - panel4.setBackground(Color.white); - panel1.setBackground(Color.white); - panel2.setBackground(Color.white); - panel3.setBackground(Color.white); - panel1.add(label1, BorderLayout.WEST); - panel1.add(fontName, BorderLayout.CENTER); - panel5.add(panel1, null); - panel5.add(panel3, null); - panel5.add(panel2, null); - panel2.add(label3, BorderLayout.WEST); - panel2.add(fontStyle, BorderLayout.CENTER); - panel3.add(label2, BorderLayout.WEST); - panel3.add(fontSize, BorderLayout.CENTER); - this.add(panel4, BorderLayout.SOUTH); - panel4.add(ok, null); - panel4.add(cancel, null); - this.add(panel5, BorderLayout.CENTER); - - } - - protected void ok_actionPerformed() - { - - } - - protected void cancel_actionPerformed() - { - - } - protected void fontName_actionPerformed() - { - - } + private void jbInit() throws Exception { + label1.setFont(new java.awt.Font("Verdana", 0, 11)); + label1.setAlignment(Label.RIGHT); + label1.setText("Font: "); + this.setLayout(borderLayout4); + fontSize.setFont(new java.awt.Font("Verdana", 0, 11)); + fontSize.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(ItemEvent e) { + fontSize_actionPerformed(); + } + }); + fontStyle.setFont(new java.awt.Font("Verdana", 0, 11)); + fontStyle.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(ItemEvent e) { + fontStyle_actionPerformed(); + } + }); + label2.setAlignment(Label.RIGHT); + label2.setFont(new java.awt.Font("Verdana", 0, 11)); + label2.setText("Size: "); + label3.setAlignment(Label.RIGHT); + label3.setFont(new java.awt.Font("Verdana", 0, 11)); + label3.setText("Style: "); + fontName.setFont(new java.awt.Font("Verdana", 0, 11)); + fontName.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(ItemEvent e) { + fontName_actionPerformed(); + } + }); + ok.setFont(new java.awt.Font("Verdana", 0, 11)); + ok.setLabel("OK"); + ok.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + ok_actionPerformed(); + } + }); + cancel.setFont(new java.awt.Font("Verdana", 0, 11)); + cancel.setLabel("Cancel"); + cancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + cancel_actionPerformed(); + } + }); + this.setBackground(Color.white); + panel1.setLayout(borderLayout1); + panel2.setLayout(borderLayout3); + panel3.setLayout(borderLayout2); + panel5.setBackground(Color.white); + panel4.setBackground(Color.white); + panel1.setBackground(Color.white); + panel2.setBackground(Color.white); + panel3.setBackground(Color.white); + panel1.add(label1, BorderLayout.WEST); + panel1.add(fontName, BorderLayout.CENTER); + panel5.add(panel1, null); + panel5.add(panel3, null); + panel5.add(panel2, null); + panel2.add(label3, BorderLayout.WEST); + panel2.add(fontStyle, BorderLayout.CENTER); + panel3.add(label2, BorderLayout.WEST); + panel3.add(fontSize, BorderLayout.CENTER); + this.add(panel4, BorderLayout.SOUTH); + panel4.add(ok, null); + panel4.add(cancel, null); + this.add(panel5, BorderLayout.CENTER); + } - protected void fontSize_actionPerformed() - { + protected void ok_actionPerformed() { + } - } + protected void cancel_actionPerformed() { + } - protected void fontStyle_actionPerformed() - { + protected void fontName_actionPerformed() { + } - } + protected void fontSize_actionPerformed() { + } + protected void fontStyle_actionPerformed() { + } }