X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=87edfecdae4739310e0861e22ddc7d19ec202d62;hb=38a10817438b42f7cba2ee95d4d65cb9672926ab;hp=ddaf4aa63709ac80bec8f32889b9d809abc3a83f;hpb=eab172160ce8e1f0d3ca95c1c273124a194e13e4;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index ddaf4aa..87edfec 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 @@ -70,10 +70,13 @@ public class FontChooser extends GFontChooser { frame = new JInternalFrame(); frame.setContentPane(this); + + smoothFont.setSelected(ap.av.antiAlias); + if(tp!=null) - Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 480, 100, false); + Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 340, 170, false); else - Desktop.addInternalFrame(frame, "Change Font", 480, 100, false); + Desktop.addInternalFrame(frame, "Change Font", 340, 170, false); frame.setLayer(JLayeredPane.PALETTE_LAYER); @@ -85,7 +88,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,9 +101,23 @@ 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; } + public void smoothFont_actionPerformed(ActionEvent e) + { + ap.av.antiAlias = smoothFont.isSelected(); + ap.annotationPanel.image = null; + ap.repaint(); + } + + + /** * DOCUMENT ME! * @@ -171,6 +188,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()); + } /** @@ -228,5 +251,6 @@ public class FontChooser extends GFontChooser Cache.setProperty("FONT_NAME", fontName.getSelectedItem().toString()); Cache.setProperty("FONT_STYLE", fontStyle.getSelectedIndex() + ""); Cache.setProperty("FONT_SIZE", fontSize.getSelectedItem().toString()); + Cache.setProperty("ANTI_ALIAS", Boolean.toString(smoothFont.isSelected())); } }