smoothFont.setSelected(ap.av.antiAlias);
/*
- * Enable 'scale protein as cDNA' in protein half of a SplitFrame view. The
- * selection is stored in the ViewStyle of the Viewport
+ * Enable 'scale protein as cDNA' in a SplitFrame view. The selection is
+ * stored in the ViewStyle of both dna and protein Viewport
*/
- if (ap.av.getCodingComplement() != null
- && !ap.av.getAlignment().isNucleotide())
+ scaleAsCdna.setEnabled(false);
+ if (ap.av.getCodingComplement() != null)
{
+ scaleAsCdna.setEnabled(true);
scaleAsCdna.setVisible(true);
scaleAsCdna.setSelected(ap.av.isScaleProteinAsCdna());
}
ap.av.setFont(oldFont, true);
ap.av.setScaleProteinAsCdna(oldProteinScale);
ap.paintAlignment(true);
+ if (scaleAsCdna.isEnabled())
+ {
+ ap.av.setScaleProteinAsCdna(oldProteinScale);
+ ap.av.getCodingComplement().setScaleProteinAsCdna(oldProteinScale);
+ }
}
else if (tp != null)
{
.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);
+ /*
+ * 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)
}
/**
- * DOCUMENT ME!
+ * Make selected settings the defaults by storing them (via Cache class) in
+ * the .jalview_properties file (the file is only written when Jalview exits)
*
* @param e
- * DOCUMENT ME!
*/
public void defaultButton_actionPerformed(ActionEvent e)
{
Cache.setProperty("FONT_SIZE", fontSize.getSelectedItem().toString());
Cache.setProperty("ANTI_ALIAS",
Boolean.toString(smoothFont.isSelected()));
+ Cache.setProperty(Preferences.SCALE_PROTEIN_TO_CDNA,
+ Boolean.toString(scaleAsCdna.isSelected()));
}
/**
protected void scaleAsCdna_actionPerformed(ActionEvent e)
{
ap.av.setScaleProteinAsCdna(scaleAsCdna.isSelected());
- ((SplitFrame) ap.alignFrame.getSplitViewContainer()).adjustLayout();
- ap.paintAlignment(true);
+ ap.av.getCodingComplement().setScaleProteinAsCdna(
+ scaleAsCdna.isSelected());
+ final SplitFrame splitFrame = (SplitFrame) ap.alignFrame
+ .getSplitViewContainer();
+ splitFrame.adjustLayout();
+ splitFrame.repaint();
+ // ap.paintAlignment(true);
+ // TODO would like to repaint
}
}