From: gmungoc Date: Tue, 14 Aug 2018 15:55:13 +0000 (+0100) Subject: JAL-3078 reset Tree font (only!) on Cancel X-Git-Tag: Release_2_11_0~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=68de2395c5eff963b717e41ef0230084336522a6;p=jalview.git JAL-3078 reset Tree font (only!) on Cancel --- 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); }