@author Andrew Rambaut @version $Id$ $HeadURL$ $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$
| 41 | * $LastChangedRevision$ |
| 42 | */ |
| 43 | public class FindPanel extends JPanel { |
| 44 | |
| 45 | public enum Target { |
| 46 | TAXON_LABEL("Taxon Label"), |
| 47 | BRANCH_LENGTH("Branch Length"), |
| 48 | NODE_AGE("Node Age"), |
| 49 | ANY_ANNOTATION("Any Annotation"), |
| 50 | ANNOTATION("Annotation"); |
| 51 | |
| 52 | Target(String name) { |
| 53 | this.name = name; |
| 54 | } |
| 55 | |
| 56 | public String toString() { |
| 57 | return name; |
| 58 | } |
| 59 | |
| 60 | private String name; |
| 61 | } |
| 62 | |
| 63 | private JComboBox targetCombo = null; |
| 64 | private JComboBox textSearchCombo = new JComboBox(DefaultTreeViewer.TextSearchType.values()); |
| 65 | private JComboBox numberSearchCombo = new JComboBox(DefaultTreeViewer.NumberSearchType.values()); |
| 66 | |
| 67 | private AnnotationDefinition.Type type = AnnotationDefinition.Type.STRING; |
| 68 | |
| 69 | private JTextField searchText = new JTextField(); |
| 70 | private RealNumberField doubleText = new RealNumberField(); |
| 71 | private WholeNumberField integerText = new WholeNumberField(); |
| 72 | |
| 73 | private JCheckBox caseSensitiveCheck = new JCheckBox("Case sensitive"); |
| 74 | |
| 75 | private int selectedTargetIndex = 0; |
| 76 | |
| 77 | public FindPanel(Action findAllAction, Action findNextAction) { |
| 78 | setLayout(new BorderLayout(0,0)); |
| 79 | |
| 80 | Font font = UIManager.getFont("SmallSystemFont"); |
| 81 | if (font != null) { |
| 82 | searchText.setFont(font); |
| 83 | } |
| 84 | searchText.setColumns(18); |
| 85 | |
| 86 | final JPanel panel = new JPanel(); |
| 87 | panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS)); |
| 88 | panel.setOpaque(false); |
| 89 | targetCombo = new JComboBox(); |
| 90 | targetCombo.addItem(Target.TAXON_LABEL); |
| 91 | targetCombo.addItem(Target.BRANCH_LENGTH); |
| 92 | targetCombo.addItem(Target.NODE_AGE); |
| 93 | targetCombo.addItem(Target.ANY_ANNOTATION); |
| 94 | |
| 95 | adjustComponent(targetCombo); |
| 96 | adjustComponent(textSearchCombo); |
| 97 | adjustComponent(numberSearchCombo); |
| 98 | adjustComponent(caseSensitiveCheck); |
| 99 | panel.add(targetCombo); |
| 100 | panel.add(textSearchCombo); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…