X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=6eab36b69fad10ace1c83ae8ff5ebd95a4ffcb3c;hb=0ad0cc7fe1de5c299363b0dc9b4b032d5d199275;hp=ddaf4aa63709ac80bec8f32889b9d809abc3a83f;hpb=eab172160ce8e1f0d3ca95c1c273124a194e13e4;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index ddaf4aa..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); @@ -85,7 +85,7 @@ public class FontChooser extends GFontChooser fontName.addItem(fonts[i]); } - for (int i = 1; i < 31; i++) + for (int i = 1; i < 51; i++) { fontSize.addItem(i + ""); } @@ -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()); + } /**