Beispiel #1
0
    def attach(self, gui):
        """Attach the GUI and create the menus."""
        # Create the menus.
        ds = self.default_shortcuts
        dsp = self.default_snippets
        self.edit_actions = Actions(
            gui, name='Edit', menu='&Edit', insert_menu_before='&View',
            default_shortcuts=ds, default_snippets=dsp)
        self.select_actions = Actions(
            gui, name='Select', menu='Sele&ct', insert_menu_before='&View',
            default_shortcuts=ds, default_snippets=dsp)

        # Create the actions.
        self._create_edit_actions()
        self._create_select_actions()
        self._create_toolbar(gui)
Beispiel #2
0
    def attach(self, gui):
        """Attach the GUI and create the menus."""
        # Create the menus.
        ds = self.default_shortcuts
        dsp = self.default_snippets
        self.edit_actions = Actions(
            gui, menu='&Edit', default_shortcuts=ds, default_snippets=dsp)
        self.select_actions = Actions(
            gui, menu='Sele&ct', default_shortcuts=ds, default_snippets=dsp)
        self.view_actions = Actions(
            gui, menu='&View', default_shortcuts=ds, default_snippets=dsp)

        # Create the actions.
        self._create_edit_actions(gui.state)
        self._create_select_actions(gui.state)
        self._create_view_actions(gui.state)
Beispiel #3
0
    def _create_actions(self, gui):
        self.actions = Actions(gui,
                               name='Clustering',
                               menu='&Clustering',
                               default_shortcuts=self.shortcuts)

        # Selection.
        self.actions.add(self.select, alias='c')
        self.actions.separator()

        self.actions.add(self.undo)
        self.actions.add(self.redo)
        self.actions.separator()

        # Clustering.
        self.actions.add(self.merge, alias='g')
        self.actions.add(self.split, alias='k')
        self.actions.separator()

        # Move.
        self.actions.add(self.move)
        self.actions.separator()

        for group in ('noise', 'mua', 'good'):
            self.actions.add(partial(self.move_best, group),
                             name='move_best_to_' + group,
                             docstring='Move the best clusters to %s.' % group)
            self.actions.add(partial(self.move_similar, group),
                             name='move_similar_to_' + group,
                             docstring='Move the similar clusters to %s.' %
                             group)
            self.actions.add(partial(self.move_all, group),
                             name='move_all_to_' + group,
                             docstring='Move all selected clusters to %s.' %
                             group)
            self.actions.separator()

        # Label.
        self.actions.add(self.label, alias='l')

        # Others.
        self.actions.add(self.save, menu='&File')

        # Wizard.
        self.actions.add(self.reset, menu='&Wizard')
        self.actions.separator(menu='&Wizard')
        self.actions.add(self.next, menu='&Wizard')
        self.actions.add(self.previous, menu='&Wizard')
        self.actions.separator(menu='&Wizard')
        self.actions.add(self.next_best, menu='&Wizard')
        self.actions.add(self.previous_best, menu='&Wizard')
        self.actions.separator(menu='&Wizard')