git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3066 Fix NullPointerException thrown when showing HMMER run dialog
[jalview.git]
/
src
/
jalview
/
gui
/
FontChooser.java
diff --git
a/src/jalview/gui/FontChooser.java
b/src/jalview/gui/FontChooser.java
index
80ac189
..
2d9682b
100755
(executable)
--- 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;
public FontChooser(TreePanel treePanel)
{
this.tp = treePanel;
- ap = treePanel.treeCanvas.ap;
+ ap = treePanel.getTreeCanvas().getAssociatedPanel();
oldFont = treePanel.getTreeFont();
defaultButton.setVisible(false);
smoothFont.setEnabled(false);
oldFont = treePanel.getTreeFont();
defaultButton.setVisible(false);
smoothFont.setEnabled(false);
@@
-134,17
+134,17
@@
public class FontChooser extends GFontChooser
fontAsCdna.setSelected(ap.av.isProteinFontAsCdna());
}
fontAsCdna.setSelected(ap.av.isProteinFontAsCdna());
}
- if (tp != null)
+ if (isTreeFont())
{
Desktop.addInternalFrame(frame,
{
Desktop.addInternalFrame(frame,
- MessageManager.getString("action.change_font_tree_panel"),
- 400, 200, false);
+ MessageManager.getString("action.change_font_tree_panel"), Desktop.FRAME_MAKE_VISIBLE,
+ 400, 200, Desktop.FRAME_NOT_RESIZABLE, Desktop.FRAME_SET_MIN_SIZE_300);
}
else
{
Desktop.addInternalFrame(frame,
}
else
{
Desktop.addInternalFrame(frame,
- MessageManager.getString("action.change_font"), 380, 220,
- false);
+ MessageManager.getString("action.change_font"), Desktop.FRAME_MAKE_VISIBLE, 380, 220,
+ Desktop.FRAME_NOT_RESIZABLE, Desktop.FRAME_SET_MIN_SIZE_300);
}
frame.setLayer(JLayeredPane.PALETTE_LAYER);
}
frame.setLayer(JLayeredPane.PALETTE_LAYER);
@@
-229,13
+229,17
@@
public class FontChooser extends GFontChooser
@Override
protected void cancel_actionPerformed()
{
@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);
ap.av.setProteinFontAsCdna(oldMirrorFont);
ap.av.antiAlias = oldSmoothFont;
{
ap.av.setFont(oldFont, true);
ap.av.setScaleProteinAsCdna(oldProteinScale);
ap.av.setProteinFontAsCdna(oldMirrorFont);
ap.av.antiAlias = oldSmoothFont;
- ap.paintAlignment(true, false);
+ ap.fontChanged();
if (scaleAsCdna.isVisible() && scaleAsCdna.isEnabled())
{
if (scaleAsCdna.isVisible() && scaleAsCdna.isEnabled())
{
@@
-250,10
+254,6
@@
public class FontChooser extends GFontChooser
splitFrame.repaint();
}
}
splitFrame.repaint();
}
}
- else if (tp != null)
- {
- tp.setTreeFont(oldFont);
- }
try
{
try
{
@@
-263,6
+263,11
@@
public class FontChooser extends GFontChooser
}
}
}
}
+ private boolean isTreeFont()
+ {
+ return tp != null;
+ }
+
/**
* DOCUMENT ME!
*/
/**
* DOCUMENT ME!
*/
@@
-317,7
+322,7
@@
public class FontChooser extends GFontChooser
}
return;
}
}
return;
}
- if (tp != null)
+ if (isTreeFont())
{
tp.setTreeFont(newFont);
}
{
tp.setTreeFont(newFont);
}