JAL-3390 JAL-3400 revised commands to show structure / hide chains
[jalview.git] / src / jalview / jbgui / GStructureViewer.java
index a7a970f..11cbfd7 100644 (file)
@@ -161,7 +161,7 @@ public abstract class GStructureViewer extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent actionEvent)
       {
-        fitToWindow_actionPerformed();
+        getBinding().focusView();
       }
     });
 
@@ -215,10 +215,6 @@ public abstract class GStructureViewer extends JInternalFrame
     statusPanel.add(statusBar, null);
   }
 
-  protected void fitToWindow_actionPerformed()
-  {
-  }
-
   protected void highlightSelection_actionPerformed()
   {
   }
@@ -276,11 +272,11 @@ public abstract class GStructureViewer extends JInternalFrame
   }
 
   /**
-   * 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
+   * 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 setSelectedChains()
+  protected void setChainsToHide()
   {
     List<String> chains = new ArrayList<>();
     for (int i = 0; i < chainMenu.getItemCount(); i++)
@@ -289,12 +285,12 @@ public abstract class GStructureViewer extends JInternalFrame
       if (menuItem instanceof JCheckBoxMenuItem)
       {
         JCheckBoxMenuItem item = (JCheckBoxMenuItem) menuItem;
-        if (item.isSelected())
+        if (!item.isSelected())
         {
           chains.add(item.getText().split(" ")[0]);
         }
       }
     }
-    getBinding().setChainsToShow(chains);
+    getBinding().setChainsToHide(chains);
   }
 }