Index: src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py	(revision 3bdbfcc5cdff8a3a11a9bb19c1cc8c3660a9c2e2)
@@ -1,54 +1,60 @@
 """
+Boxsum Class: determine 2 rectangular area to compute
+the sum of pixel of a Data.
+"""
+import numpy
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+from sas.qtgui.GuiUtils import formatNumber
+
+from BaseInteractor import _BaseInteractor
+from sas.sascalc.dataloader.manipulations import Boxavg
+from sas.sascalc.dataloader.manipulations import Boxsum
+
+from sas.qtgui.SlicerModel import SlicerModel
+
+
+class BoxSumCalculator(_BaseInteractor):
+    """
     Boxsum Class: determine 2 rectangular area to compute
     the sum of pixel of a Data.
-"""
-import math
-import wx
-from BaseInteractor import _BaseInteractor
-from sas.sasgui.guiframe.events import SlicerParamUpdateEvent
-from sas.sasgui.guiframe.events import EVT_SLICER_PARS
-from sas.sasgui.guiframe.events import StatusEvent
-
-
-class BoxSum(_BaseInteractor):
+    Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.
+    @param zorder:  Artists with lower zorder values are drawn first.
+    @param x_min: the minimum value of the x coordinate
+    @param x_max: the maximum value of the x coordinate
+    @param y_min: the minimum value of the y coordinate
+    @param y_max: the maximum value of the y coordinate
+
     """
-        Boxsum Class: determine 2 rectangular area to compute
-        the sum of pixel of a Data.
-        Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.
-        @param zorder:  Artists with lower zorder values are drawn first.
-        @param x_min: the minimum value of the x coordinate
-        @param x_max: the maximum value of the x coordinate
-        @param y_min: the minimum value of the y coordinate
-        @param y_max: the maximum value of the y coordinate
-
-    """
-    def __init__(self, base, axes, color='black', zorder=3, x_min=0.008,
-                 x_max=0.008, y_min=0.0025, y_max=0.0025):
-        """
-        """
+    def __init__(self, base, axes, color='black', zorder=3):
         _BaseInteractor.__init__(self, base, axes, color=color)
-        # # class initialization
-        # # list of Boxsmun markers
+
+        # list of Boxsmun markers
         self.markers = []
         self.axes = axes
-        # # connect the artist for the motion
+        self._model = None
+        self.update_model = False
+
+        # connect the artist for the motion
         self.connect = self.base.connect
-        # # when qmax is reached the selected line is reset the its previous value
-        self.qmax = min(self.base.data2D.xmax, self.base.data2D.xmin)
-        # # Define the boxsum limits
-        self.xmin = -1 * 0.5 * min(math.fabs(self.base.data2D.xmax),
-                                   math.fabs(self.base.data2D.xmin))
-        self.ymin = -1 * 0.5 * min(math.fabs(self.base.data2D.xmax),
-                                   math.fabs(self.base.data2D.xmin))
-        self.xmax = 0.5 * min(math.fabs(self.base.data2D.xmax),
-                              math.fabs(self.base.data2D.xmin))
-        self.ymax = 0.5 * min(math.fabs(self.base.data2D.xmax),
-                              math.fabs(self.base.data2D.xmin))
-        # # center of the boxSum
+
+        # when qmax is reached the selected line is reset the its previous value
+        self.qmax = min(self.base.data.xmax, self.base.data.xmin)
+
+        # Define the boxsum limits
+        self.xmin = -1 * 0.5 * min(numpy.fabs(self.base.data.xmax),
+                                   numpy.fabs(self.base.data.xmin))
+        self.ymin = -1 * 0.5 * min(numpy.fabs(self.base.data.xmax),
+                                   numpy.fabs(self.base.data.xmin))
+        self.xmax = 0.5 * min(numpy.fabs(self.base.data.xmax),
+                              numpy.fabs(self.base.data.xmin))
+        self.ymax = 0.5 * min(numpy.fabs(self.base.data.xmax),
+                              numpy.fabs(self.base.data.xmin))
+        # center of the boxSum
         self.center_x = 0.0002
         self.center_y = 0.0003
-        # # Number of points on the plot
+        # Number of points on the plot
         self.nbins = 20
-        # # Define initial result the summation
+        # Define initial result the summation
         self.count = 0
         self.error = 0
@@ -56,10 +62,10 @@
         self.totalerror = 0
         self.points = 0
-        # # Flag to determine if the current figure has moved
-        # # set to False == no motion , set to True== motion
+        # Flag to determine if the current figure has moved
+        # set to False == no motion , set to True== motion
         self.has_move = False
-        # # Create Boxsum edges
+        # Create Boxsum edges
         self.horizontal_lines = HorizontalDoubleLine(self,
-                                                     self.base.subplot,
+                                                     self.axes,
                                                      color='blue',
                                                      zorder=zorder,
@@ -71,5 +77,5 @@
 
         self.vertical_lines = VerticalDoubleLine(self,
-                                                 self.base.subplot,
+                                                 self.axes,
                                                  color='black',
                                                  zorder=zorder,
@@ -81,39 +87,80 @@
 
         self.center = PointInteractor(self,
-                                      self.base.subplot, color='grey',
+                                      self.axes, color='grey',
                                       zorder=zorder,
                                       center_x=self.center_x,
                                       center_y=self.center_y)
-        # # Save the name of the slicer panel associate with this slicer
+        # Save the name of the slicer panel associate with this slicer
         self.panel_name = ""
-        # # Update and post slicer parameters
-        self.update()
-        self._post_data()
-        # # Bind to slice parameter events
-        self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
-
-    def set_panel_name(self, name):
-        """
-            Store the name of the panel associated to this slicer
-            @param name: the name of this panel
+        # Update and post slicer parameters
+        self.update_model = False
+        self.update()
+        self.postData()
+
+        # set up the model
+        self._model = QtGui.QStandardItemModel(1, 9)
+        self.setModelFromParams()
+        self.update_model = True
+        self._model.itemChanged.connect(self.setParamsFromModel)
+
+    def setModelFromParams(self):
+        """
+        Set up the Qt model for data handling between controls
+        """
+        parameters = self.getParams()
+        # Crete/overwrite model items
+        self._model.setData(self._model.index(0, 0),
+                    QtCore.QVariant(formatNumber(parameters['Height'])))
+        self._model.setData(self._model.index(0, 1),
+                    QtCore.QVariant(formatNumber(parameters['Width'])))
+        self._model.setData(self._model.index(0, 2),
+                    QtCore.QVariant(formatNumber(parameters['center_x'])))
+        self._model.setData(self._model.index(0, 3),
+                    QtCore.QVariant(formatNumber(parameters['center_y'])))
+
+        self.setReadOnlyParametersFromModel()
+
+    def model(self):
+        ''' model accessor '''
+        return self._model
+
+    def setReadOnlyParametersFromModel(self):
+        """
+        Cast model content onto "read-only" subset of parameters
+        """
+        parameters = self.getParams()
+        self._model.setData(self._model.index(0, 4),
+                    QtCore.QVariant(formatNumber(parameters['avg'])))
+        self._model.setData(self._model.index(0, 5),
+                    QtCore.QVariant(formatNumber(parameters['avg_error'])))
+        self._model.setData(self._model.index(0, 6),
+                    QtCore.QVariant(formatNumber(parameters['sum'])))
+        self._model.setData(self._model.index(0, 7),
+                    QtCore.QVariant(formatNumber(parameters['sum_error'])))
+        self._model.setData(self._model.index(0, 8),
+                    QtCore.QVariant(formatNumber(parameters['num_points'])))
+
+    def setParamsFromModel(self):
+        """
+        Cast model content onto params dict
+        """
+        params = {}
+        params["Height"] = float(self.model().item(0, 0).text())
+        params["Width"] = float(self.model().item(0, 1).text())
+        params["center_x"] = float(self.model().item(0, 2).text())
+        params["center_y"] = float(self.model().item(0, 3).text())
+        self.update_model = False
+        self.setParams(params)
+        self.setReadOnlyParametersFromModel()
+        self.update_model = True
+
+    def setPanelName(self, name):
+        """
+        Store the name of the panel associated to this slicer
+        @param name: the name of this panel
         """
         self.panel_name = name
 
-    def _onEVT_SLICER_PARS(self, event):
-        """
-            receive an event containing parameters values to reset the slicer
-            @param event: event of type SlicerParameterEvent with params as
-            attribute
-        """
-        # # Post e message to declare what kind of event has being received
-        wx.PostEvent(self.base.parent,
-                     StatusEvent(status="Boxsum._onEVT_SLICER_PARS"))
-        event.Skip()
-        # # reset the slicer with the values contains the event.params dictionary
-        if event.type == self.__class__.__name__:
-            self.set_params(event.params)
-            self.base.update()
-
-    def set_layer(self, n):
+    def setLayer(self, n):
         """
         Allow adding plot to the same panel
@@ -132,5 +179,4 @@
         self.center.clear()
         self.base.connect.clearall()
-        self.base.Unbind(EVT_SLICER_PARS)
 
     def update(self):
@@ -139,10 +185,10 @@
         resetting the widgets.
         """
-        # # check if the center point has moved and update the figure accordingly
+        # check if the center point has moved and update the figure accordingly
         if self.center.has_move:
             self.center.update()
             self.horizontal_lines.update(center=self.center)
             self.vertical_lines.update(center=self.center)
-        # # check if the horizontal lines have moved and
+        # check if the horizontal lines have moved and
         # update the figure accordingly
         if self.horizontal_lines.has_move:
@@ -151,5 +197,5 @@
                                        y2=self.horizontal_lines.y2,
                                        height=self.horizontal_lines.half_height)
-        # # check if the vertical lines have moved and
+        # check if the vertical lines have moved and
         # update the figure accordingly
         if self.vertical_lines.has_move:
@@ -164,44 +210,35 @@
         can restore on Esc.
         """
-        self.base.freeze_axes()
         self.horizontal_lines.save(ev)
         self.vertical_lines.save(ev)
         self.center.save(ev)
 
-    def _post_data(self):
+    def postData(self):
         """
         Get the limits of the boxsum and compute the sum of the pixel
         contained in that region and the error on that sum
         """
-        # # the region of the summation
+        # the region of the summation
         x_min = self.horizontal_lines.x2
         x_max = self.horizontal_lines.x1
         y_min = self.vertical_lines.y2
         y_max = self.vertical_lines.y1
-        # #computation of the sum and its error
-        from sas.sascalc.dataloader.manipulations import Boxavg
+        #computation of the sum and its error
         box = Boxavg(x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
-        self.count, self.error = box(self.base.data2D)
+        self.count, self.error = box(self.base.data)
         # Dig out number of points summed, SMK & PDB, 04/03/2013
-        from sas.sascalc.dataloader.manipulations import Boxsum
         boxtotal = Boxsum(x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
-        self.total, self.totalerror, self.points = boxtotal(self.base.data2D)
+        self.total, self.totalerror, self.points = boxtotal(self.base.data)
+        if self.update_model:
+            self.setModelFromParams()
+        self.draw()
 
     def moveend(self, ev):
         """
-            After a dragging motion this function is called to compute
-            the error and the sum of pixel of a given data 2D
-        """
-        self.base.thaw_axes()
-        # # compute error an d sum of data's pixel
-        self._post_data()
-        # # Create and event ( posted to guiframe)that  set the
-        # #current slicer parameter to a panel of name self.panel_name
-        self.type = self.__class__.__name__
-        params = self.get_params()
-        event = SlicerParamUpdateEvent(type=self.type,
-                                       params=params,
-                                       panel_name=self.panel_name)
-        wx.PostEvent(self.base.parent, event)
+        After a dragging motion this function is called to compute
+        the error and the sum of pixel of a given data 2D
+        """
+        # compute error an d sum of data's pixel
+        self.postData()
 
     def restore(self):
@@ -213,16 +250,5 @@
         self.center.restore()
 
-    def move(self, x, y, ev):
-        """
-        Process move to a new position, making sure that the move is allowed.
-        """
-        pass
-
-    def set_cursor(self, x, y):
-        """
-        """
-        pass
-
-    def get_params(self):
+    def getParams(self):
         """
         Store a copy of values of parameters of the slicer into a dictionary.
@@ -230,6 +256,6 @@
         """
         params = {}
-        params["Width"] = math.fabs(self.vertical_lines.half_width) * 2
-        params["Height"] = math.fabs(self.horizontal_lines.half_height) * 2
+        params["Width"] = numpy.fabs(self.vertical_lines.half_width) * 2
+        params["Height"] = numpy.fabs(self.horizontal_lines.half_height) * 2
         params["center_x"] = self.center.x
         params["center_y"] = self.center.y
@@ -241,7 +267,7 @@
         return params
 
-    def get_result(self):
-        """
-            return the result of box summation
+    def getResult(self):
+        """
+        Return the result of box summation
         """
         result = {}
@@ -253,12 +279,13 @@
         return result
 
-    def set_params(self, params):
+    def setParams(self, params):
         """
         Receive a dictionary and reset the slicer with values contained
         in the values of the dictionary.
-        :param params: a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-        """
-        x_max = math.fabs(params["Width"]) / 2
-        y_max = math.fabs(params["Height"]) / 2
+        :param params: a dictionary containing name of slicer parameters
+        and values the user assigned to the slicer.
+        """
+        x_max = numpy.fabs(params["Width"]) / 2
+        y_max = numpy.fabs(params["Height"]) / 2
 
         self.center_x = params["center_x"]
@@ -271,19 +298,8 @@
                                    width=x_max, height=y_max)
         # compute the new error and sum given values of params
-        self._post_data()
-
-    def freeze_axes(self):
-        """
-        """
-        self.base.freeze_axes()
-
-    def thaw_axes(self):
-        """
-        """
-        self.base.thaw_axes()
+        self.postData()
 
     def draw(self):
-        """
-        """
+        """ Redraw canvas"""
         self.base.draw()
 
@@ -297,8 +313,6 @@
     def __init__(self, base, axes, color='black', zorder=5, center_x=0.0,
                  center_y=0.0):
-        """
-        """
         _BaseInteractor.__init__(self, base, axes, color=color)
-        # # Initialization the class
+        # Initialization the class
         self.markers = []
         self.axes = axes
@@ -306,8 +320,8 @@
         self.x = center_x
         self.y = center_y
-        # # saved value of the center coordinates
+        # saved value of the center coordinates
         self.save_x = center_x
         self.save_y = center_y
-        # # Create a marker
+        # Create a marker
         self.center_marker = self.axes.plot([self.x], [self.y], linestyle='',
                                             marker='s', markersize=10,
@@ -316,20 +330,20 @@
                                             zorder=zorder,
                                             visible=True)[0]
-        # # Draw a point
+        # Draw a point
         self.center = self.axes.plot([self.x], [self.y],
                                      linestyle='-', marker='',
                                      color=self.color,
                                      visible=True)[0]
-        # # Flag to determine the motion this point
+        # Flag to determine the motion this point
         self.has_move = False
-        # # connecting the marker to allow them to move
+        # connecting the marker to allow them to move
         self.connect_markers([self.center_marker])
-        # # Update the figure
-        self.update()
-
-    def set_layer(self, n):
-        """
-            Allow adding plot to the same panel
-            @param n: the number of layer
+        # Update the figure
+        self.update()
+
+    def setLayer(self, n):
+        """
+        Allow adding plot to the same panel
+        @param n: the number of layer
         """
         self.layernum = n
@@ -338,18 +352,13 @@
     def clear(self):
         """
-            Clear this figure and its markers
+        Clear this figure and its markers
         """
         self.clear_markers()
-        try:
-            self.center.remove()
-            self.center_marker.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
+        self.center.remove()
+        self.center_marker.remove()
 
     def update(self, center_x=None, center_y=None):
         """
-            Draw the new roughness on the graph.
+        Draw the new roughness on the graph.
         """
         if center_x != None:
@@ -367,5 +376,4 @@
         self.save_x = self.x
         self.save_y = self.y
-        self.base.freeze_axes()
 
     def moveend(self, ev):
@@ -391,5 +399,5 @@
         self.base.base.update()
 
-    def set_cursor(self, x, y):
+    def setCursor(self, x, y):
         """
         """
@@ -399,19 +407,17 @@
 class VerticalDoubleLine(_BaseInteractor):
     """
-         Draw 2 vertical lines moving in opposite direction and centered on
-         a point (PointInteractor)
+    Draw 2 vertical lines moving in opposite direction and centered on
+    a point (PointInteractor)
     """
     def __init__(self, base, axes, color='black', zorder=5, x=0.5, y=0.5,
                  center_x=0.0, center_y=0.0):
-        """
-        """
         _BaseInteractor.__init__(self, base, axes, color=color)
-        # # Initialization the class
+        # Initialization the class
         self.markers = []
         self.axes = axes
-        # # Center coordinates
+        # Center coordinates
         self.center_x = center_x
         self.center_y = center_y
-        # # defined end points vertical lignes and their saved values
+        # defined end points vertical lignes and their saved values
         self.y1 = y + self.center_y
         self.save_y1 = self.y1
@@ -429,11 +435,11 @@
         # # save the color of the line
         self.color = color
-        # # the height of the rectangle
-        self.half_height = math.fabs(y)
-        self.save_half_height = math.fabs(y)
-        # # the with of the rectangle
-        self.half_width = math.fabs(self.x1 - self.x2) / 2
-        self.save_half_width = math.fabs(self.x1 - self.x2) / 2
-        # # Create marker
+        # the height of the rectangle
+        self.half_height = numpy.fabs(y)
+        self.save_half_height = numpy.fabs(y)
+        # the with of the rectangle
+        self.half_width = numpy.fabs(self.x1 - self.x2) / 2
+        self.save_half_width = numpy.fabs(self.x1 - self.x2) / 2
+        # Create marker
         self.right_marker = self.axes.plot([self.x1], [0], linestyle='',
                                            marker='s', markersize=10,
@@ -442,5 +448,5 @@
                                            zorder=zorder, visible=True)[0]
 
-        # # define the left and right lines of the rectangle
+        # Define the left and right lines of the rectangle
         self.right_line = self.axes.plot([self.x1, self.x1], [self.y1, self.y2],
                                          linestyle='-', marker='',
@@ -449,11 +455,11 @@
                                         linestyle='-', marker='',
                                         color=self.color, visible=True)[0]
-        # # Flag to determine if the lines have moved
+        # Flag to determine if the lines have moved
         self.has_move = False
-        # # connection the marker and draw the pictures
+        # Connection the marker and draw the pictures
         self.connect_markers([self.right_marker])
         self.update()
 
-    def set_layer(self, n):
+    def setLayer(self, n):
         """
         Allow adding plot to the same panel
@@ -468,12 +474,7 @@
         """
         self.clear_markers()
-        try:
-            self.right_marker.remove()
-            self.right_line.remove()
-            self.left_line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
+        self.right_marker.remove()
+        self.right_line.remove()
+        self.left_line.remove()
 
     def update(self, x1=None, x2=None, y1=None, y2=None, width=None,
@@ -489,12 +490,12 @@
         :param center: provided x, y  coordinates of the center point
         """
-        # # save the new height, witdh of the rectangle if given as a param
-        if width != None:
+        # Save the new height, witdh of the rectangle if given as a param
+        if width is not None:
             self.half_width = width
-        if height != None:
+        if height is not None:
             self.half_height = height
-        # # If new  center coordinates are given draw the rectangle
-        # #given these value
-        if center != None:
+        # If new  center coordinates are given draw the rectangle
+        # given these value
+        if center is not None:
             self.center_x = center.x
             self.center_y = center.y
@@ -510,14 +511,14 @@
                                ydata=[self.y1, self.y2])
             return
-        # # if x1, y1, y2, y3 are given draw the rectangle with this value
-        if x1 != None:
+        # if x1, y1, y2, y3 are given draw the rectangle with this value
+        if x1 is not None:
             self.x1 = x1
-        if x2 != None:
+        if x2 is not None:
             self.x2 = x2
-        if y1 != None:
+        if y1 is not None:
             self.y1 = y1
-        if y2 != None:
+        if y2 is not None:
             self.y2 = y2
-        # # Draw 2 vertical lines and a marker
+        # Draw 2 vertical lines and a marker
         self.right_marker.set(xdata=[self.x1], ydata=[self.center_y])
         self.right_line.set(xdata=[self.x1, self.x1], ydata=[self.y1, self.y2])
@@ -535,9 +536,8 @@
         self.save_half_height = self.half_height
         self.save_half_width = self.half_width
-        self.base.freeze_axes()
 
     def moveend(self, ev):
         """
-            After a dragging motion reset the flag self.has_move to False
+        After a dragging motion reset the flag self.has_move to False
         """
         self.has_move = False
@@ -562,11 +562,11 @@
         delta = self.x1 - self.center_x
         self.x2 = self.center_x - delta
-        self.half_width = math.fabs(self.x1 - self.x2) / 2
+        self.half_width = numpy.fabs(self.x1 - self.x2) / 2
         self.has_move = True
         self.base.base.update()
 
-    def set_cursor(self, x, y):
-        """
-            Update the figure given x and y
+    def setCursor(self, x, y):
+        """
+        Update the figure given x and y
         """
         self.move(x, y, None)
@@ -575,5 +575,5 @@
 class HorizontalDoubleLine(_BaseInteractor):
     """
-         Select an annulus through a 2D plot
+    Select an annulus through a 2D plot
     """
     def __init__(self, base, axes, color='black', zorder=5, x=0.5, y=0.5,
@@ -581,8 +581,8 @@
 
         _BaseInteractor.__init__(self, base, axes, color=color)
-        # # Initialization the class
+        # Initialization the class
         self.markers = []
         self.axes = axes
-        # # Center coordinates
+        # Center coordinates
         self.center_x = center_x
         self.center_y = center_y
@@ -598,8 +598,8 @@
         self.save_x2 = self.x2
         self.color = color
-        self.half_height = math.fabs(y)
-        self.save_half_height = math.fabs(y)
-        self.half_width = math.fabs(x)
-        self.save_half_width = math.fabs(x)
+        self.half_height = numpy.fabs(y)
+        self.save_half_height = numpy.fabs(y)
+        self.half_width = numpy.fabs(x)
+        self.save_half_width = numpy.fabs(x)
         self.top_marker = self.axes.plot([0], [self.y1], linestyle='',
                                          marker='s', markersize=10,
@@ -616,14 +616,14 @@
                                           linestyle='-', marker='',
                                           color=self.color, visible=True)[0]
-        # # Flag to determine if the lines have moved
+        # Flag to determine if the lines have moved
         self.has_move = False
-        # # connection the marker and draw the pictures
+        # connection the marker and draw the pictures
         self.connect_markers([self.top_marker])
         self.update()
 
-    def set_layer(self, n):
-        """
-            Allow adding plot to the same panel
-            @param n: the number of layer
+    def setLayer(self, n):
+        """
+        Allow adding plot to the same panel
+        @param n: the number of layer
         """
         self.layernum = n
@@ -632,15 +632,10 @@
     def clear(self):
         """
-            Clear this figure and its markers
+        Clear this figure and its markers
         """
         self.clear_markers()
-        try:
-            self.top_marker.remove()
-            self.bottom_line.remove()
-            self.top_line.remove()
-        except:
-            # Old version of matplotlib
-            for item in range(len(self.axes.lines)):
-                del self.axes.lines[0]
+        self.top_marker.remove()
+        self.bottom_line.remove()
+        self.top_line.remove()
 
     def update(self, x1=None, x2=None, y1=None, y2=None,
@@ -656,12 +651,12 @@
         :param center: provided x, y  coordinates of the center point
         """
-        # # save the new height, witdh of the rectangle if given as a param
-        if width != None:
+        # Save the new height, witdh of the rectangle if given as a param
+        if width is not None:
             self.half_width = width
-        if height != None:
+        if height is not None:
             self.half_height = height
-        # # If new  center coordinates are given draw the rectangle
-        # #given these value
-        if center != None:
+        # If new  center coordinates are given draw the rectangle
+        # given these value
+        if center is not None:
             self.center_x = center.x
             self.center_y = center.y
@@ -678,14 +673,14 @@
                                  ydata=[self.y2, self.y2])
             return
-        # # if x1, y1, y2, y3 are given draw the rectangle with this value
-        if x1 != None:
+        # if x1, y1, y2, y3 are given draw the rectangle with this value
+        if x1 is not None:
             self.x1 = x1
-        if x2 != None:
+        if x2 is not None:
             self.x2 = x2
-        if y1 != None:
+        if y1 is not None:
             self.y1 = y1
-        if y2 != None:
+        if y2 is not None:
             self.y2 = y2
-        # # Draw 2 vertical lines and a marker
+        # Draw 2 vertical lines and a marker
         self.top_marker.set(xdata=[self.center_x], ydata=[self.y1])
         self.top_line.set(xdata=[self.x1, self.x2], ydata=[self.y1, self.y1])
@@ -703,5 +698,4 @@
         self.save_half_height = self.half_height
         self.save_half_width = self.half_width
-        self.base.freeze_axes()
 
     def moveend(self, ev):
@@ -730,11 +724,11 @@
         delta = self.y1 - self.center_y
         self.y2 = self.center_y - delta
-        self.half_height = math.fabs(self.y1) - self.center_y
+        self.half_height = numpy.fabs(self.y1) - self.center_y
         self.has_move = True
         self.base.base.update()
 
-    def set_cursor(self, x, y):
-        """
-            Update the figure given x and y
+    def setCursor(self, x, y):
+        """
+        Update the figure given x and y
         """
         self.move(x, y, None)
