X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FFontChooser.java;h=112e1d44a4382e026920f7560a0b95b4eaa081e1;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=5fb6fb6e59a8324126c914df8ae5e023741f74a6;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/jalview/appletgui/FontChooser.java b/src/jalview/appletgui/FontChooser.java index 5fb6fb6..112e1d4 100755 --- a/src/jalview/appletgui/FontChooser.java +++ b/src/jalview/appletgui/FontChooser.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 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 @@ -20,7 +20,6 @@ package jalview.appletgui; import java.awt.*; - import java.awt.event.*; public class FontChooser @@ -95,23 +94,32 @@ public class FontChooser public void actionPerformed(ActionEvent evt) { - if(evt.getSource()==ok) + if (evt.getSource() == ok) + { ok_actionPerformed(); - else if(evt.getSource()==cancel) + } + else if (evt.getSource() == cancel) + { cancel_actionPerformed(); + } } public void itemStateChanged(ItemEvent evt) { - if(evt.getSource()==fontName) + if (evt.getSource() == fontName) + { fontName_actionPerformed(); - else if(evt.getSource()==fontSize) + } + else if (evt.getSource() == fontSize) + { fontSize_actionPerformed(); - else if(evt.getSource()==fontStyle) + } + else if (evt.getSource() == fontStyle) + { fontStyle_actionPerformed(); + } } - protected void ok_actionPerformed() { frame.setVisible(false); @@ -127,12 +135,12 @@ public class FontChooser protected void cancel_actionPerformed() { - if(ap!=null) + if (ap != null) { ap.av.setFont(oldFont); ap.repaint(); } - else if(tp!=null) + else if (tp != null) { tp.setTreeFont(oldFont); tp.treeCanvas.repaint(); @@ -157,10 +165,10 @@ public class FontChooser ap.av.setFont(newFont); ap.fontChanged(); } - else if(tp != null) + else if (tp != null) { tp.setTreeFont(newFont); - } + } } protected void fontName_actionPerformed() @@ -189,6 +197,7 @@ public class FontChooser } changeFont(); } + Label label1 = new Label(); protected Choice fontSize = new Choice(); protected Choice fontStyle = new Choice(); @@ -207,52 +216,53 @@ public class FontChooser Panel panel5 = new Panel(); BorderLayout borderLayout4 = new BorderLayout(); - - 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(this); - fontStyle.setFont(new java.awt.Font("Verdana", 0, 11)); - fontStyle.addItemListener(this); - 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(this); - ok.setFont(new java.awt.Font("Verdana", 0, 11)); - ok.setLabel("OK"); - ok.addActionListener(this); - cancel.setFont(new java.awt.Font("Verdana", 0, 11)); - cancel.setLabel("Cancel"); - cancel.addActionListener(this); - 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); + 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(this); + fontStyle.setFont(new java.awt.Font("Verdana", 0, 11)); + fontStyle.addItemListener(this); + 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(this); + ok.setFont(new java.awt.Font("Verdana", 0, 11)); + ok.setLabel("OK"); + ok.addActionListener(this); + cancel.setFont(new java.awt.Font("Verdana", 0, 11)); + cancel.setLabel("Cancel"); + cancel.addActionListener(this); + 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); } }