JAL-2422 pull-up refactoring of structure commands (continued)
[jalview.git] / src / jalview / gui / StructureViewerBase.java
index c9607c6..d3e6d75 100644 (file)
@@ -560,8 +560,6 @@ public abstract class StructureViewerBase extends GStructureViewer
     }
   }
 
-  abstract void showSelectedChains();
-
   /**
    * Action on selecting one of Jalview's registered colour schemes
    */
@@ -572,7 +570,7 @@ public abstract class StructureViewerBase extends GStructureViewer
     ColourSchemeI cs = ColourSchemes.getInstance()
             .getColourScheme(colourSchemeName, getAlignmentPanel().av, al,
                     null);
-    getBinding().setJalviewColourScheme(cs);
+    getBinding().colourByJalviewColourScheme(cs);
   }
 
   /**
@@ -753,12 +751,6 @@ public abstract class StructureViewerBase extends GStructureViewer
     buildColourMenu();
   }
 
-  @Override
-  public void setJalviewColourScheme(ColourSchemeI cs)
-  {
-    getBinding().setJalviewColourScheme(cs);
-  }
-
   /**
    * Sends commands to the structure viewer to superimpose structures based on
    * currently associated alignments. May optionally return an error message for
@@ -1060,13 +1052,7 @@ public abstract class StructureViewerBase extends GStructureViewer
     return tm;
   }
 
-  /**
-   * End the progress bar with the specified handle, leaving a message (if not
-   * null) on the status bar
-   * 
-   * @param msg
-   * @param handle
-   */
+  @Override
   public void stopProgressBar(String msg, long handle)
   {
     if (progressBar != null)
@@ -1075,11 +1061,6 @@ public abstract class StructureViewerBase extends GStructureViewer
     }
   }
 
-  @Override
-  public void stopProgressBar(Object object, long handle)
-  {
-  }
-
   protected IProgressIndicator getProgressIndicator()
   {
     return progressBar;
@@ -1104,4 +1085,24 @@ public abstract class StructureViewerBase extends GStructureViewer
     // default does nothing
   }
 
+  /**
+   * Show only the selected chain(s) in the viewer
+   */
+  protected void showSelectedChains()
+  {
+    List<String> toshow = new ArrayList<>();
+    for (int i = 0; i < chainMenu.getItemCount(); i++)
+    {
+      if (chainMenu.getItem(i) instanceof JCheckBoxMenuItem)
+      {
+        JCheckBoxMenuItem item = (JCheckBoxMenuItem) chainMenu.getItem(i);
+        if (item.isSelected())
+        {
+          toshow.add(item.getText());
+        }
+      }
+    }
+    getBinding().showChains(toshow);
+  }
+
 }