@author Andrew Rambaut @version $Id$ $HeadURL$ $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$
| 44 | * $LastChangedRevision$ |
| 45 | */ |
| 46 | public class AnnotationsController extends AbstractController { |
| 47 | |
| 48 | public AnnotationsController(final TreePane treePane) { |
| 49 | |
| 50 | this.treePane = treePane; |
| 51 | |
| 52 | titleLabel = new JLabel("Annotations"); |
| 53 | |
| 54 | optionsPanel = new ControllerOptionsPanel(2, 2); |
| 55 | |
| 56 | final JComboBox combo2 = new JComboBox(); |
| 57 | combo2.addItem("None"); |
| 58 | // for (AnnotationDefinition annotation : treeViewer.getAnnotationDefinitions()) { |
| 59 | // combo2.addItem(annotation); |
| 60 | // } |
| 61 | combo2.addActionListener(new ActionListener() { |
| 62 | public void actionPerformed(ActionEvent event) { |
| 63 | Object item = combo2.getSelectedItem(); |
| 64 | if (item instanceof AnnotationDefinition) { |
| 65 | // treePane.setBranchDecorator(new AnnotationBranchDecorator((AnnotationDefinition)item)); |
| 66 | } else { |
| 67 | treePane.setBranchDecorator(null, false); |
| 68 | } |
| 69 | } |
| 70 | }); |
| 71 | optionsPanel.addComponentWithLabel("Node Colours:", combo2); |
| 72 | |
| 73 | |
| 74 | } |
| 75 | |
| 76 | public JComponent getTitleComponent() { |
| 77 | return titleLabel; |
| 78 | } |
| 79 | |
| 80 | public JPanel getPanel() { |
| 81 | return optionsPanel; |
| 82 | } |
| 83 | |
| 84 | public boolean isInitiallyVisible() { |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | public void initialize() { |
| 89 | // nothing to do |
| 90 | } |
| 91 | |
| 92 | public void setSettings(Map<String,Object> settings) { |
| 93 | } |
| 94 | |
| 95 | public void getSettings(Map<String, Object> settings) { |
| 96 | } |
| 97 | |
| 98 | private final JLabel titleLabel; |
| 99 | private final OptionsPanel optionsPanel; |
| 100 | |
| 101 | private final TreePane treePane; |
| 102 | |
| 103 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…