+
+ /**
+ * Saves the unselected entries in the 'View Chain' menu into a list. Entries
+ * are formatted as "pdbid:chainid". Unselected chains should be hidden in the
+ * structure display.
+ */
+ protected void setChainsToHide()
+ {
+ 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().split(" ")[0]);
+ }
+ }
+ }
+ getBinding().setChainsToHide(chains);
+ }