3 import jalview.gui.AnnotationColumnChooser;
4 import jalview.gui.JvSwingUtils;
7 import java.awt.event.ActionEvent;
8 import java.awt.event.ActionListener;
10 import javax.swing.ButtonGroup;
11 import javax.swing.JPanel;
12 import javax.swing.JRadioButton;
14 @SuppressWarnings("serial")
15 public class FurtherActionPanel extends JPanel
17 private AnnotationColumnChooser aColChooser;
19 private JRadioButton hideOption = new JRadioButton();
21 private JRadioButton selectOption = new JRadioButton();
23 private ButtonGroup optionsGroup = new ButtonGroup();
25 public FurtherActionPanel(AnnotationColumnChooser aColChooser)
28 this.aColChooser = aColChooser;
31 getSelectOption().setBackground(Color.white);
32 getSelectOption().setFont(JvSwingUtils.getLabelFont());
33 getSelectOption().setText("Select");
34 getSelectOption().addActionListener(new ActionListener()
37 public void actionPerformed(ActionEvent actionEvent)
39 selectRadioAction(actionEvent);
43 getHideOption().setBackground(Color.white);
44 getHideOption().setFont(JvSwingUtils.getLabelFont());
45 getHideOption().setText("Hide");
46 getHideOption().addActionListener(new ActionListener()
49 public void actionPerformed(ActionEvent actionEvent)
51 hideRadioAction(actionEvent);
55 getOptionsGroup().add(getSelectOption());
56 getOptionsGroup().add(getHideOption());
57 getOptionsGroup().setSelected(getSelectOption().getModel(), true);
59 this.setBackground(Color.white);
60 this.setFont(JvSwingUtils.getLabelFont());
63 this.add(getSelectOption());
64 this.add(getHideOption());
67 public void selectRadioAction(ActionEvent actionEvent)
69 aColChooser.setCurrentFutherActionPanel(this);
70 aColChooser.select_action(actionEvent);
73 public void hideRadioAction(ActionEvent actionEvent)
75 aColChooser.setCurrentFutherActionPanel(this);
76 aColChooser.hide_action(actionEvent);
79 // public abstract void selectRadioAction(ActionEvent actionEvent);
81 // public abstract void hideRadioAction(ActionEvent actionEvent);
83 public JRadioButton getHideOption()
88 public void setHideOption(JRadioButton hideOption)
90 this.hideOption = hideOption;
93 public JRadioButton getSelectOption()
98 public void setSelectOption(JRadioButton selectOption)
100 this.selectOption = selectOption;
103 public ButtonGroup getOptionsGroup()
108 public void setOptionsGroup(ButtonGroup optionsGroup)
110 this.optionsGroup = optionsGroup;
113 public void syncState()
115 // FurtherActionPanel fap = aColChooser.getCurrentFutherActionPanel();
119 // // description.setEnabled(sp.getDescription().isEnabled());
120 // // description.setSelected(sp.getDescription().isSelected());
122 // // displayName.setEnabled(sp.getDisplayName().isEnabled());
123 // // displayName.setSelected(sp.getDisplayName().isSelected());
125 // // searchBox.setText(sp.getSearchBox().getText());
128 if (aColChooser.getActionOption() == AnnotationColumnChooser.ACTION_OPTION_HIDE)
130 this.getOptionsGroup().setSelected(this.getHideOption().getModel(),
135 this.getOptionsGroup().setSelected(this.getSelectOption().getModel(),