import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JCheckBoxMenuItem;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
protected JMenuItem alignStructs;
+ protected JCheckBoxMenuItem showAlignmentOnly;
+
+ protected JCheckBoxMenuItem hideHiddenRegions;
+
protected JMenuItem fitToWindow;
protected JRadioButtonMenuItem seqColour;
{
}
+
+ /**
+ * Saves the selected entries in the 'View Chain' menu into a list. Entries are
+ * formatted as "pdbid:chainid". Only the selected chains should be drawn in the
+ * structure display.
+ */
+ protected void setSelectedChains()
+ {
+ List<String> chains = new ArrayList<>();
+ for (int i = 0; i < chainMenu.getItemCount(); i++)
+ {
+ JMenuItem menuItem = chainMenu.getItem(i);
+ if (menuItem instanceof JCheckBoxMenuItem)
+ {
+ JCheckBoxMenuItem item = (JCheckBoxMenuItem) menuItem;
+ if (item.isSelected())
+ {
+ chains.add(item.getText());
+ }
+ }
+ }
+ getBinding().setChainsToShow(chains);
+ }
}