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;
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- fitToWindow_actionPerformed();
+ getBinding().focusView();
}
});
{
}
+
+ /**
+ * 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);
+ }
}