X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;fp=src%2Fjalview%2Fgui%2FFontChooser.java;h=c66f3043acba91ae6037708d510c4a7a67f3aaf7;hb=b83eff8c672cede0305da3c76823dab414749dde;hp=f3c8e8fa00426863f2f46b310980cc497ca8e9f8;hpb=d943fcd0dc04fd4974344eddd13902c89fb595b2;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index f3c8e8f..c66f304 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -134,7 +134,7 @@ public class FontChooser extends GFontChooser fontAsCdna.setSelected(ap.av.isProteinFontAsCdna()); } - if (tp != null) + if (isTreeFont()) { Desktop.addInternalFrame(frame, MessageManager.getString("action.change_font_tree_panel"), @@ -229,7 +229,11 @@ public class FontChooser extends GFontChooser @Override protected void cancel_actionPerformed() { - if (ap != null) + if (isTreeFont()) + { + tp.setTreeFont(oldFont); + } + else if (ap != null) { ap.av.setFont(oldFont, true); ap.av.setScaleProteinAsCdna(oldProteinScale); @@ -250,10 +254,6 @@ public class FontChooser extends GFontChooser splitFrame.repaint(); } } - else if (tp != null) - { - tp.setTreeFont(oldFont); - } try { @@ -263,6 +263,11 @@ public class FontChooser extends GFontChooser } } + private boolean isTreeFont() + { + return tp != null; + } + /** * DOCUMENT ME! */ @@ -317,7 +322,7 @@ public class FontChooser extends GFontChooser } return; } - if (tp != null) + if (isTreeFont()) { tp.setTreeFont(newFont); }