X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=9803822ecd1759c9d406af5d052569e90985d006;hb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;hp=b52ca32e15289f2888d41278531b50f887e6b14e;hpb=174230b4233d9ce80f94527768d2cd2f76da11ab;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index b52ca32..9803822 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -50,8 +50,10 @@ public class FontChooser extends GFontChooser public FontChooser(TreePanel tp) { this.tp = tp; + ap = tp.treeCanvas.ap; oldFont = tp.getTreeFont(); defaultButton.setVisible(false); + smoothFont.setEnabled(false); init(); } /** @@ -70,10 +72,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)", 540, 100, false); + Desktop.addInternalFrame(frame, "Change Font (Tree Panel)", 340, 170, false); else - Desktop.addInternalFrame(frame, "Change Font", 540, 100, false); + Desktop.addInternalFrame(frame, "Change Font", 340, 170, false); frame.setLayer(JLayeredPane.PALETTE_LAYER); @@ -106,6 +111,15 @@ public class FontChooser extends GFontChooser init = false; } + public void smoothFont_actionPerformed(ActionEvent e) + { + ap.av.antiAlias = smoothFont.isSelected(); + ap.annotationPanel.image = null; + ap.repaint(); + } + + + /** * DOCUMENT ME! * @@ -167,16 +181,17 @@ public class FontChooser extends GFontChooser Font newFont = new Font(fontName.getSelectedItem().toString(), fontStyle.getSelectedIndex(), Integer.parseInt(fontSize.getSelectedItem().toString())); - if (ap != null) + if(tp != null) { - ap.av.setFont(newFont); - ap.fontChanged(); + tp.setTreeFont(newFont); } - else if(tp != null) + else if(ap != null) { - tp.setTreeFont(newFont); + ap.av.setFont(newFont); + ap.fontChanged(); } + FontMetrics fm = getGraphics().getFontMetrics(newFont); monospaced.setSelected( fm.getStringBounds("M",getGraphics()).getWidth() @@ -239,5 +254,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())); } }