Ejemplo n.º 1
0
 def closeEvent(self, event):
     super(DataViewer, self).closeEvent(event)
     Viewer.cleanup(self)
     # We tell the toolbar to do cleanup to make sure we get rid of any
     # circular references
     if self.toolbar:
         self.toolbar.cleanup()
Ejemplo n.º 2
0
    def __init__(self, session, state=None, parent=None):
        """
        :type session: :class:`~glue.core.session.Session`
        """

        BaseQtViewerWidget.__init__(self, parent)
        Viewer.__init__(self, session, state=state)

        self._view = LayerArtistWidget(layer_style_widget_cls=self._layer_style_widget_cls,
                                       hub=session.hub)
        self._view.layer_list.setModel(self._layer_artist_container.model)

        # Set up the options widget, which will include options that control the
        # viewer state
        if self._options_cls is None:
            self.options = QtWidgets.QWidget()
        else:
            self.options = self._options_cls(viewer_state=self.state,
                                             session=session)

        self._tb_vis = {}  # store whether toolbars are enabled
        self.toolbar = None
        self._toolbars = []
        self._warn_close = True

        # close window when last plot layer deleted
        if self._close_on_last_layer_removed:
            self._layer_artist_container.on_empty(self._close_nowarn)
        self._layer_artist_container.on_changed(self.update_window_title)

        self.update_window_title()
Ejemplo n.º 3
0
    def __init__(self, session, state=None, parent=None):
        """
        :type session: :class:`~glue.core.Session`
        """

        BaseQtViewerWidget.__init__(self, parent)
        Viewer.__init__(self, session, state=state)

        self._view = LayerArtistWidget(layer_style_widget_cls=self._layer_style_widget_cls,
                                       hub=session.hub)
        self._view.layer_list.setModel(self._layer_artist_container.model)

        # Set up the options widget, which will include options that control the
        # viewer state
        if self._options_cls is None:
            self.options = QtWidgets.QWidget()
        else:
            self.options = self._options_cls(viewer_state=self.state,
                                             session=session)

        self._tb_vis = {}  # store whether toolbars are enabled
        self.toolbar = None
        self._toolbars = []
        self._warn_close = True

        # close window when last plot layer deleted
        if self._close_on_last_layer_removed:
            self._layer_artist_container.on_empty(self._close_nowarn)
        self._layer_artist_container.on_changed(self.update_window_title)
Ejemplo n.º 4
0
 def closeEvent(self, event):
     super(DataViewer, self).closeEvent(event)
     Viewer.cleanup(self)
     # We tell the toolbar to do cleanup to make sure we get rid of any
     # circular references
     if self.toolbar:
         self.toolbar.cleanup()
Ejemplo n.º 5
0
 def __gluestate__(self, context):
     state = Viewer.__gluestate__(self, context)
     state['size'] = self.viewer_size
     state['pos'] = self.position
     state['_protocol'] = 1
     return state
Ejemplo n.º 6
0
 def __gluestate__(self, context):
     state = Viewer.__gluestate__(self, context)
     state['size'] = self.viewer_size
     state['pos'] = self.position
     state['_protocol'] = 1
     return state
Ejemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     Viewer.__init__(self, *args, **kwargs)
     self.figure = plt.figure(figsize=(12, 6))
     self.axes = self.figure.add_axes([0, 0, 1, 1])
     MatplotlibViewerMixin.setup_callbacks(self)