X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=b52ca32e15289f2888d41278531b50f887e6b14e;hb=df9eac352d5fc1252e6377fec7cfc29fd841c932;hp=33bb9deef94017c079294225c53b7b00746b8d4f;hpb=9c5d69ef1e102b1eac18ec13c362522f40c9000d;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index 33bb9de..b52ca32 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 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 @@ -71,9 +71,9 @@ public class FontChooser extends GFontChooser frame = new JInternalFrame(); frame.setContentPane(this); if(tp!=null) - Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 480, 100, false); + Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 540, 100, false); else - Desktop.addInternalFrame(frame, "Change Font", 480, 100, false); + Desktop.addInternalFrame(frame, "Change Font", 540, 100, false); frame.setLayer(JLayeredPane.PALETTE_LAYER); @@ -98,6 +98,11 @@ public class FontChooser extends GFontChooser fontSize.setSelectedItem(oldFont.getSize() + ""); fontStyle.setSelectedIndex(oldFont.getStyle()); + FontMetrics fm = getGraphics().getFontMetrics(oldFont); + monospaced.setSelected( fm.getStringBounds("M",getGraphics()).getWidth() + ==fm.getStringBounds("|",getGraphics()).getWidth()); + + init = false; } @@ -171,6 +176,12 @@ public class FontChooser extends GFontChooser { tp.setTreeFont(newFont); } + + FontMetrics fm = getGraphics().getFontMetrics(newFont); + + monospaced.setSelected( fm.getStringBounds("M",getGraphics()).getWidth() + ==fm.getStringBounds("|",getGraphics()).getWidth()); + } /**