+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.gui;
import jalview.datamodel.AlignmentAnnotation;
// currently selected 'annotation type' checkboxes
private Map<String, String> selectedTypes = new HashMap<String, String>();
-
+
/**
* Constructor.
*
* type which are in the application scope (all, selected or unselected
* sequences).
*
- * @param type
+ * @param dataSourceType
*/
protected void changeShowHide_actionPerformed()
{
final boolean wholeAlignment = this.sg == null;
JPanel applyToOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
CheckboxGroup actingOn = new CheckboxGroup();
-
+
String forAll = MessageManager.getString("label.all_sequences");
final Checkbox allSequences = new Checkbox(forAll, actingOn,
wholeAlignment);
@Override
public void itemStateChanged(ItemEvent evt)
{
- if (evt.getStateChange() == ItemEvent.SELECTED) {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
AnnotationChooser.this.setApplyToSelectedSequences(true);
AnnotationChooser.this.setApplyToUnselectedSequences(true);
AnnotationChooser.this.changeApplyTo_actionPerformed();
}
});
applyToOptions.add(allSequences);
-
+
String forSelected = MessageManager
.getString("label.selected_sequences");
final Checkbox selectedSequences = new Checkbox(forSelected, actingOn,
}
});
applyToOptions.add(selectedSequences);
-
+
String exceptSelected = MessageManager
.getString("label.except_selected_sequences");
- final Checkbox unselectedSequences = new Checkbox(exceptSelected, actingOn, false);
+ final Checkbox unselectedSequences = new Checkbox(exceptSelected,
+ actingOn, false);
unselectedSequences.setEnabled(!wholeAlignment);
unselectedSequences.addItemListener(new ItemListener()
{
}
});
applyToOptions.add(unselectedSequences);
-
+
// set member variables to match the initial selection state
this.applyToSelectedSequences = selectedSequences.getState()
|| allSequences.getState();
@Override
public void itemStateChanged(ItemEvent evt)
{
- if (evt.getStateChange() == ItemEvent.SELECTED) {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
AnnotationChooser.this.setShowSelected(true);
AnnotationChooser.this.changeShowHide_actionPerformed();
}
{
JPanel jp = new JPanel();
final Font labelFont = JvSwingUtils.getLabelFont();
-
+
JButton ok = new JButton(MessageManager.getString("action.ok"));
ok.setFont(labelFont);
ok.addActionListener(new ActionListener()
}
});
jp.add(ok);
-
+
JButton cancel = new JButton(MessageManager.getString("action.cancel"));
cancel.setFont(labelFont);
cancel.addActionListener(new ActionListener()