X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFontChooser.java;h=92cc4c61529d81f2ad1c691d37d1347e058dfb4e;hb=fa9da54fb97cb2eacb1af7859024d90166bddb8f;hp=f3c8e8fa00426863f2f46b310980cc497ca8e9f8;hpb=4353b5fc310340ece7067b3872235ab7f844c8c2;p=jalview.git diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index f3c8e8f..92cc4c6 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -87,7 +87,7 @@ public class FontChooser extends GFontChooser public FontChooser(TreePanel treePanel) { this.tp = treePanel; - ap = treePanel.treeCanvas.ap; + ap = treePanel.getTreeCanvas().getAssociatedPanel(); oldFont = treePanel.getTreeFont(); defaultButton.setVisible(false); smoothFont.setEnabled(false); @@ -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); }