X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=6eab36b69fad10ace1c83ae8ff5ebd95a4ffcb3c;hb=818c66fbbbc2cbe6a412776aa86d2a27e30d6e09;hp=33bb9deef94017c079294225c53b7b00746b8d4f;hpb=26c3004aa398c51cdeee79945d0e0bb8a877f47d;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index 33bb9de..6eab36b 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -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()); + } /**