@author Andrew Rambaut @version $Id$ $HeadURL$ $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$
| 47 | * $LastChangedRevision$ |
| 48 | */ |
| 49 | public class FindDialog { |
| 50 | |
| 51 | public enum Target { |
| 52 | TAXON_LABEL("Taxon Label"), |
| 53 | BRANCH_LENGTH("Branch Length"), |
| 54 | NODE_AGE("Node Age"), |
| 55 | ANY_ANNOTATION("Any Annotation"), |
| 56 | ANNOTATION("Annotation"); |
| 57 | |
| 58 | Target(String name) { |
| 59 | this.name = name; |
| 60 | } |
| 61 | |
| 62 | public String toString() { |
| 63 | return name; |
| 64 | } |
| 65 | |
| 66 | private String name; |
| 67 | } |
| 68 | |
| 69 | private JFrame frame; |
| 70 | private JComboBox targetCombo = null; |
| 71 | private JComboBox textSearchCombo = new JComboBox(DefaultTreeViewer.TextSearchType.values()); |
| 72 | private JComboBox numberSearchCombo = new JComboBox(DefaultTreeViewer.NumberSearchType.values()); |
| 73 | |
| 74 | private AnnotationDefinition.Type type = AnnotationDefinition.Type.STRING; |
| 75 | |
| 76 | private JTextField searchText = new JTextField(); |
| 77 | private RealNumberField doubleText = new RealNumberField(); |
| 78 | private WholeNumberField integerText = new WholeNumberField(); |
| 79 | |
| 80 | private JCheckBox caseSensitiveCheck = new JCheckBox("Case sensitive"); |
| 81 | private JCheckBox findAllCheck = new JCheckBox("Find all"); |
| 82 | |
| 83 | private int selectedTargetIndex = 0; |
| 84 | |
| 85 | public FindDialog(JFrame frame) { |
| 86 | this.frame = frame; |
| 87 | |
| 88 | } |
| 89 | |
| 90 | public int showDialog(List<AnnotationDefinition> annotations) { |
| 91 | |
| 92 | OptionsPanel options = new OptionsPanel(12, 12); |
| 93 | |
| 94 | searchText.setColumns(18); |
| 95 | |
| 96 | final JPanel panel = new JPanel(new BorderLayout(6,6)); |
| 97 | targetCombo = new JComboBox(); |
| 98 | targetCombo.addItem(Target.TAXON_LABEL); |
| 99 | targetCombo.addItem(Target.BRANCH_LENGTH); |
| 100 | targetCombo.addItem(Target.NODE_AGE); |
| 101 | targetCombo.addItem(Target.ANY_ANNOTATION); |
| 102 | for (AnnotationDefinition annotation : annotations) { |
| 103 | targetCombo.addItem(annotation); |
| 104 | } |
| 105 | panel.add(targetCombo, BorderLayout.WEST); |
| 106 | panel.add(textSearchCombo, BorderLayout.CENTER); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…