Repository: enthought/chaco

Issue:
SelectableOverlayPlotContainer can be removed
This is an _old_ class that has been superceded by the use of overlays.

It does not appear to be being used and can be safely removed for 5.0.


Discussion:

Resolving patch:
diff --git a/chaco/api.py b/chaco/api.py
--- a/chaco/api.py
+++ b/chaco/api.py
@@ -44,7 +44,6 @@
 from .simple_plot_frame import SimplePlotFrame
 from .plot_component import PlotComponent
 from .plot_graphics_context import PlotGraphicsContext, PlotGraphicsContextMixin
-from .selectable_overlay_container import SelectableOverlayPlotContainer
 from .plot_containers import OverlayPlotContainer, HPlotContainer, VPlotContainer, \
                             GridPlotContainer
 GridContainer = GridPlotContainer
diff --git a/chaco/selectable_overlay_container.py b/chaco/selectable_overlay_container.py
deleted file mode 100644
--- a/chaco/selectable_overlay_container.py
+++ /dev/null
@@ -1,72 +0,0 @@
-""" Defines the SelectableOverlayPlotContainer class.
-"""
-
-
-
-from numpy import array, float64
-
-# Enthought library imports
-from traits.api import Bool, Float, Enum
-from enable.api import ColorTrait
-
-# Local imports
-from .plot_containers import OverlayPlotContainer
-
-class SelectableOverlayPlotContainer(OverlayPlotContainer):
-    """
-    An OverlayPlotContainer that can show a selection region on top of it.
-    """
-
-    #: Screen position of the start of the selection, which can be in the x- or
-    #: y-dimension, depending on **selection_direction**.
-    selection_screen_start = Float(0.0)
-    #: Screen position of the end of the selection, which can be in the x- or
-    #: y-dimension, depending on **selection_direction**.
-    selection_screen_end = Float(0.0)
-    #: Is there an active selection?
-    selection_active = Bool(False)
-    #: The direction of the selection.
-    selection_direction = Enum('v', 'h')
-    #: The color to use to fill the selected region.
-    selection_fill_color = ColorTrait('lightskyblue')
-    #: The color to use to draw the border of the selected region.
-    selection_border_color = ColorTrait('dodgerblue')
-    #: The transparency of the **selection_fill_color**.
-    selection_alpha = Float(0.3)
-
-    def _draw_overlays(self, gc, view_bounds=None, mode='normal'):
-        """ Method for backward compatability with old drawing scheme.
-
-        Overrides BasePlotContainer.
-        """
-        self._draw_selection(gc, view_bounds=view_bounds, mode=mode)
-        return
-
-    def _draw_selection(self, gc, view_bounds=None, mode='normal'):
-        """ Renders a selected subset of a component's data.
-
-        Overrides PlotComponent.
-        """
-        if self.selection_active:
-            if self.selection_direction == 'h':
-                x1 = self.selection_screen_start
-                x2 = self.selection_screen_end
-                y1 = self.y
-                y2 = self.position[1] + self.bounds[1] - 1
-            else:
-                x1 = self.x
-                x2 = self.position[0] + self.bounds[0] - 1
-                y1 = self.selection_screen_start
-                y2 = self.selection_screen_end
-            lowerleft = array((min(x1, x2), min(y1, y2)), float64)
-            upperright = array((max(x1, x2), max(y1, y2)), float64)
-            with gc:
-                gc.translate_ctm(*self.position)
-                gc.set_fill_color(self.selection_fill_color_)
-                gc.set_stroke_color(self.selection_border_color_)
-                gc.set_alpha(self.selection_alpha)
-                gc.rect(lowerleft[0], lowerleft[1], upperright[0], upperright[1])
-                gc.draw_path()
-        return
-
-


Test patch: