alignment (and within that, by label).</em></li>
<li><strong>Sort by Label</strong><em><br>Sort
sequence-specific annotations by label (and within that, by
- sequence order). If neither sort order is selected, no
- sorting is applied, allowing you to make a manual ordering
- of the annotations.</em></li>
+ sequence order).</em></li>
<li><strong>Autocalculated Annotation<br>
</strong><em>Settings for the display of autocalculated annotation.</em>
<ul>
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
/**
* DOCUMENT ME!
}
});
- /*
- * ensure By Label/Sequence are not selected if annotations
- * have been reordered manually to CUSTOM order
- */
- annotationsMenu.addMenuListener(new MenuListener()
- {
- @Override
- public void menuSelected(MenuEvent e)
- {
- SequenceAnnotationOrder sortAnnotationsBy = viewport
- .getSortAnnotationsBy();
- sortAnnByLabel.setSelected(
- sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
- sortAnnBySequence.setSelected(
- sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
- }
-
- @Override
- public void menuDeselected(MenuEvent e)
- {
- }
-
- @Override
- public void menuCanceled(MenuEvent e)
- {
- }
- });
-
alignPanel.sortAnnotations();
}
private SplitContainerI splitFrame;
- protected JCheckBoxMenuItem sortAnnBySequence;
+ protected JMenuItem sortAnnBySequence;
- protected JCheckBoxMenuItem sortAnnByLabel;
+ protected JMenuItem sortAnnByLabel;
protected JMenu annotationsMenu;
sortAnnByLabel = new JCheckBoxMenuItem(
MessageManager.getString("label.sort_annotations_by_label"));
- sortAnnBySequence.setSelected(
- sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
sortAnnBySequence.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- boolean newState = sortAnnBySequence.getState();
- sortAnnByLabel.setSelected(false);
- setAnnotationSortOrder(
- newState ? SequenceAnnotationOrder.SEQUENCE_AND_LABEL
- : SequenceAnnotationOrder.NONE);
+ setAnnotationSortOrder(SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
sortAnnotations();
}
});
- sortAnnByLabel.setSelected(
- sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
sortAnnByLabel.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- boolean newState = sortAnnByLabel.getState();
- sortAnnBySequence.setSelected(false);
- setAnnotationSortOrder(
- newState ? SequenceAnnotationOrder.LABEL_AND_SEQUENCE
- : SequenceAnnotationOrder.NONE);
+ setAnnotationSortOrder(SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
sortAnnotations();
}
});