git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5088f3a
)
JAL-1690 fix NPE on Cancel when not in split frame
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 22 Apr 2015 12:21:59 +0000
(13:21 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Wed, 22 Apr 2015 12:21:59 +0000
(13:21 +0100)
src/jalview/gui/FontChooser.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/FontChooser.java
b/src/jalview/gui/FontChooser.java
index
5e13781
..
381fbe3
100755
(executable)
--- a/
src/jalview/gui/FontChooser.java
+++ b/
src/jalview/gui/FontChooser.java
@@
-94,8
+94,10
@@
public class FontChooser extends GFontChooser
* Enable 'scale protein as cDNA' in a SplitFrame view. The selection is
* stored in the ViewStyle of both dna and protein Viewport
*/
* Enable 'scale protein as cDNA' in a SplitFrame view. The selection is
* stored in the ViewStyle of both dna and protein Viewport
*/
+ scaleAsCdna.setEnabled(false);
if (ap.av.getCodingComplement() != null)
{
if (ap.av.getCodingComplement() != null)
{
+ scaleAsCdna.setEnabled(true);
scaleAsCdna.setVisible(true);
scaleAsCdna.setSelected(ap.av.isScaleProteinAsCdna());
}
scaleAsCdna.setVisible(true);
scaleAsCdna.setSelected(ap.av.isScaleProteinAsCdna());
}
@@
-243,15
+245,19
@@
public class FontChooser extends GFontChooser
.getStringBounds("I", getGraphics()).getWidth();
if (mw < 1 || iw < 1)
{
.getStringBounds("I", getGraphics()).getWidth();
if (mw < 1 || iw < 1)
{
- fontName.setSelectedItem(lastSelected.getName());
- fontStyle.setSelectedIndex(lastSelStyle);
- fontSize.setSelectedItem(lastSelSize);
- monospaced.setSelected(lastSelMono);
JOptionPane
.showInternalMessageDialog(
this,
MessageManager.getString("label.font_doesnt_have_letters_defined"),
MessageManager.getString("label.invalid_font"), JOptionPane.WARNING_MESSAGE);
JOptionPane
.showInternalMessageDialog(
this,
MessageManager.getString("label.font_doesnt_have_letters_defined"),
MessageManager.getString("label.invalid_font"), JOptionPane.WARNING_MESSAGE);
+ /*
+ * Restore previous values - size first to avoid recursive calls to this
+ * point!
+ */
+ fontSize.setSelectedItem(lastSelSize);
+ fontName.setSelectedItem(lastSelected.getName());
+ fontStyle.setSelectedIndex(lastSelStyle);
+ monospaced.setSelected(lastSelMono);
return;
}
if (tp != null)
return;
}
if (tp != null)