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())
+ if (ap.av.getCodingComplement() != null)
{
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)
{
}
/**
- * 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
}
}