From 92f2bdf5a7a89ceefe2bff76ca75414cf0fb633c Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 7 Apr 2006 11:27:55 +0000 Subject: [PATCH] Autocalculate consensus set in preferences --- src/jalview/gui/AlignViewport.java | 2 ++ src/jalview/gui/Preferences.java | 4 ++++ src/jalview/jbgui/GAlignFrame.java | 2 +- src/jalview/jbgui/GPreferences.java | 7 +++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 2c8172b..15c10e7 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -136,6 +136,8 @@ public class AlignViewport showQuality = Cache.getDefault("SHOW_QUALITY", true); showIdentity = Cache.getDefault("SHOW_IDENTITY", true); + autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true); + String fontName = Cache.getDefault("FONT_NAME", "SansSerif"); String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + "") ; String fontSize = Cache.getDefault("FONT_SIZE", "10"); diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index f322daa..8cbe03f 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -150,6 +150,8 @@ public class Preferences extends GPreferences pileupjv.setSelected( Cache.getDefault("PILEUP_JVSUFFIX", true) ); pirjv.setSelected( Cache.getDefault("PIR_JVSUFFIX", true) ); + autoCalculateConsCheck.setSelected( Cache.getDefault("AUTO_CALC_CONSENSUS", true)); + /**************************************************** * Set up Connections */ @@ -277,6 +279,8 @@ public class Preferences extends GPreferences Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX", Boolean.toString(pileupjv.isSelected()) ); Cache.applicationProperties.setProperty("PIR_JVSUFFIX", Boolean.toString(pirjv.isSelected()) ); + Cache.applicationProperties.setProperty("AUTO_CALC_CONSENSUS", + Boolean.toString(autoCalculateConsCheck.isSelected())); Cache.saveProperties(); try diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 1cbe15c..422f9a7 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -979,7 +979,7 @@ public class GAlignFrame } }); autoCalculate.setText("Autocalculate Consensus"); - autoCalculate.setState(true); + autoCalculate.setState( jalview.bin.Cache.getDefault("AUTO_CALC_CONSENSUS", true)); autoCalculate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 8b10c5f..58c7743 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -104,6 +104,8 @@ public class GPreferences extends JPanel protected JCheckBox seqLimit = new JCheckBox(); GridLayout gridLayout3 = new GridLayout(); protected JCheckBox smoothFont = new JCheckBox(); + JPanel calcTab = new JPanel(); + protected JCheckBox autoCalculateConsCheck = new JCheckBox(); /** * Creates a new GPreferences object. */ @@ -357,6 +359,9 @@ public class GPreferences extends JPanel smoothFont.setHorizontalAlignment(SwingConstants.RIGHT); smoothFont.setHorizontalTextPosition(SwingConstants.LEADING); smoothFont.setText("Smooth Font"); + calcTab.setLayout(null); + autoCalculateConsCheck.setText("AutoCalculate Consensus"); + autoCalculateConsCheck.setBounds(new Rectangle(16, 29, 209, 23)); jPanel2.add(fullScreen); jPanel2.add(annotations); @@ -439,6 +444,8 @@ public class GPreferences extends JPanel jPanel11.add(pfamjv); jPanel11.add(pileupjv); jPanel11.add(pirjv); + tabbedPane.add(calcTab, "Calculations"); + calcTab.add(autoCalculateConsCheck); exportTab.add(epsLabel); exportTab.add(epsRendering); -- 1.7.10.2