{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
// pin down annotation sort order for test
- Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
+ Cache.setPropertyNoSave(Preferences.SORT_ANNOTATIONS,
SequenceAnnotationOrder.NONE.name());
final String TRUE = Boolean.TRUE.toString();
- Cache.applicationProperties.setProperty(Preferences.SHOW_AUTOCALC_ABOVE,
- TRUE);
- Cache.applicationProperties.setProperty("SHOW_QUALITY", TRUE);
- Cache.applicationProperties.setProperty("SHOW_CONSERVATION", TRUE);
- Cache.applicationProperties.setProperty("SHOW_IDENTITY", TRUE);
+ Cache.setPropertyNoSave(
+ Preferences.SHOW_AUTOCALC_ABOVE, TRUE);
+ Cache.setPropertyNoSave("SHOW_QUALITY", TRUE);
+ Cache.setPropertyNoSave("SHOW_CONSERVATION", TRUE);
+ Cache.setPropertyNoSave("SHOW_IDENTITY", TRUE);
AlignmentI al = new FormatAdapter().readFile(TEST_DATA,
DataSourceType.PASTE, FileFormat.Fasta);
* Add 4 annotations, 3 of them sequence-specific.
*
* <PRE>
- * ann1 - for sequence 0 - label 'IUPRED' ann2 - not sequence related - label
- * 'Beauty' ann3 - for sequence 3 - label 'JMol' ann4 - for sequence 2 - label
- * 'IUPRED' ann5 - for sequence 1 - label 'JMol'
+ * ann1 - for sequence 0 - label 'IUPRED'
+ * ann2 - not sequence related - label 'Beauty'
+ * ann3 - for sequence 3 - label 'JMol'
+ * ann4 - for sequence 2 - label 'IUPRED'
+ * ann5 - for sequence 1 - label 'JMol'
*/
private void addAnnotations()
{
assertTrue("Not enabled", cb1.isEnabled());
assertTrue("Not enabled", cb2.isEnabled());
assertTrue("Not enabled", cb3.isEnabled());
- assertEquals("Option not selected", cb2,
- cb2.getCheckboxGroup().getSelectedCheckbox());
+ assertEquals("Option not selected", cb2, cb2.getCheckboxGroup()
+ .getSelectedCheckbox());
// check state variables match checkbox selection
assertTrue(testee.isApplyToSelectedSequences());
assertTrue("Not enabled", cb1.isEnabled());
assertFalse("Enabled", cb2.isEnabled());
assertFalse("Enabled", cb3.isEnabled());
- assertEquals("Not selected", cb1,
- cb1.getCheckboxGroup().getSelectedCheckbox());
+ assertEquals("Not selected", cb1, cb1.getCheckboxGroup()
+ .getSelectedCheckbox());
// check state variables match checkbox selection
assertTrue(testee.isApplyToSelectedSequences());
assertTrue(testee.isApplyToUnselectedSequences());
assertEquals("Wrong text",
- MessageManager.getString("label.all_sequences"),
- cb1.getLabel());
+ MessageManager.getString("label.all_sequences"), cb1.getLabel());
assertEquals("Wrong text",
MessageManager.getString("label.selected_sequences"),
cb2.getLabel());
assertTrue("Hide not enabled", cb2.isEnabled());
// Hide (button 2) selected; note this may change to none (null)
- assertEquals("Not selected", cb2,
- cb2.getCheckboxGroup().getSelectedCheckbox());
+ assertEquals("Not selected", cb2, cb2.getCheckboxGroup()
+ .getSelectedCheckbox());
assertTrue("Show is flagged", !testee.isShowSelected());
// selection group should make no difference to the result
// as all annotation types for the alignment are considered
- List<String> types = AnnotationChooser
- .getAnnotationTypes(parentPanel.getAlignment(), true);
+ List<String> types = AnnotationChooser.getAnnotationTypes(
+ parentPanel.getAlignment(), true);
assertEquals("Not two annotation types", 2, types.size());
assertTrue("IUPRED missing", types.contains("IUPRED"));
assertTrue("JMol missing", types.contains("JMol"));
- types = AnnotationChooser.getAnnotationTypes(parentPanel.getAlignment(),
- false);
+ types = AnnotationChooser.getAnnotationTypes(
+ parentPanel.getAlignment(), false);
assertEquals("Not six annotation types", 7, types.size());
assertTrue("IUPRED missing", types.contains("IUPRED"));
assertTrue("JMol missing", types.contains("JMol"));
final Checkbox hideCheckbox = (Checkbox) getComponent(testee, 1, 0, 1);
setSelected(hideCheckbox, true);
- final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee, 1,
- 1, 0);
+ final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee,
+ 1, 1, 0);
setSelected(allSequencesCheckbox, true);
AlignmentAnnotation[] anns = parentPanel.getAlignment()
final Checkbox hideCheckbox = (Checkbox) getComponent(testee, 1, 0, 1);
setSelected(hideCheckbox, true);
- final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee, 1,
- 1, 0);
+ final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee,
+ 1, 1, 0);
setSelected(allSequencesCheckbox, true);
AlignmentAnnotation[] anns = parentPanel.getAlignment()
final Checkbox showCheckbox = (Checkbox) getComponent(testee, 1, 0, 0);
final Checkbox hideCheckbox = (Checkbox) getComponent(testee, 1, 0, 1);
- final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee, 1,
- 1, 0);
+ final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee,
+ 1, 1, 0);
AlignmentAnnotation[] anns = parentPanel.getAlignment()
.getAlignmentAnnotation();
final Checkbox showCheckbox = (Checkbox) getComponent(testee, 1, 0, 0);
setSelected(showCheckbox, true);
- final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee, 1,
- 1, 0);
+ final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee,
+ 1, 1, 0);
setSelected(allSequencesCheckbox, true);
AlignmentAnnotation[] anns = parentPanel.getAlignment()
// TODO refactor to a test utility class
cb.setState(select);
// have to manually fire the action listener
- cb.getItemListeners()[0].itemStateChanged(
- new ItemEvent(cb, ItemEvent.ITEM_STATE_CHANGED, cb,
- select ? ItemEvent.SELECTED : ItemEvent.DESELECTED));
+ cb.getItemListeners()[0].itemStateChanged(new ItemEvent(cb,
+ ItemEvent.ITEM_STATE_CHANGED, cb, select ? ItemEvent.SELECTED
+ : ItemEvent.DESELECTED));
}
/**
final Checkbox hideCheckbox = (Checkbox) getComponent(testee, 1, 0, 1);
setSelected(hideCheckbox, true);
- final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee, 1,
- 1, 0);
+ final Checkbox allSequencesCheckbox = (Checkbox) getComponent(testee,
+ 1, 1, 0);
setSelected(allSequencesCheckbox, true);
setSelected(getTypeCheckbox("JMol"), true);