{
if (ap != null)
{
+ ap.av.setScaleProteinAsCdna(oldScaleProtein);
+ if (ap.av.getCodingComplement() != null)
+ {
+ ap.av.getCodingComplement().setScaleProteinAsCdna(oldScaleProtein);
+ ap.alignFrame.getSplitFrame().repaint();
+ }
+
ap.av.setFont(oldFont);
ViewStyleI style = ap.av.getViewStyle();
if (style.getCharWidth() != oldCharWidth)
optionsPanel.add(stylePanel, null);
/*
- * Only show 'scale protein as cDNA' in protein half of a SplitFrame
+ * Only show 'scale protein as cDNA' in a SplitFrame
*/
this.add(optionsPanel, BorderLayout.NORTH);
- if (ap.alignFrame.getSplitFrame() != null
- && !ap.av.getAlignment().isNucleotide())
+ if (ap.alignFrame.getSplitFrame() != null)
{
this.add(scalePanel, BorderLayout.CENTER);
}
protected void scaleAsCdna_actionPerformed()
{
ap.av.setScaleProteinAsCdna(scaleAsCdna.getState());
+ ap.av.getCodingComplement().setScaleProteinAsCdna(
+ scaleAsCdna.getState());
ap.alignFrame.getSplitFrame().adjustLayout();
ap.paintAlignment(true);
+ ap.alignFrame.getSplitFrame().repaint();
}
}
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
}
}