Ejemplo n.º 1
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating project explorer widget')
        widget = ProjectExplorerWidget(self)
        widget.setObjectName('project_explorer')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Project Explorer',
                            QtGui.QIcon(':icons/18/ic_storage_black'),
                            self.session)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea)
        widget.setObjectName('project_explorer_dock')
        widget.setWidget(self.widget('project_explorer'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(self.widget('project_explorer_dock').toggleViewAction())

        # CONFIGURE SIGNALS/SLOTS
        self.debug('Connecting to active session')
        connect(self.session.sgnReady, self.onSessionReady)

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.LeftDockWidgetArea,
                                   self.widget('project_explorer_dock'))
Ejemplo n.º 2
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating overview widget')
        widget = OverviewWidget(self)
        widget.setObjectName('overview')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Overview', QtGui.QIcon(':/icons/18/ic_zoom_black'), self.session)
        widget.installEventFilter(self)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea)
        widget.setObjectName('overview_dock')
        widget.setWidget(self.widget('overview'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(self.widget('overview_dock').toggleViewAction())

        # CONFIGURE SIGNALS/SLOTS
        self.debug('Connecting to active session')
        connect(self.session.mdi.subWindowActivated, self.onSubWindowActivated)

        # CREATE DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.widget('overview_dock'))
Ejemplo n.º 3
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating Unsatisfiable_Entity_Explorer widget')
        widget = UnsatisfiableEntityExplorerWidget(self)
        widget.setObjectName('unsatisfiable_entity_explorer')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Unsatisfiable Entity Explorer',
                            QtGui.QIcon(':icons/18/ic_explore_black'),
                            self.session)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea
                               | QtCore.Qt.BottomDockWidgetArea)
        widget.setObjectName('unsatisfiable_entity_explorer_dock')
        widget.setWidget(self.widget('unsatisfiable_entity_explorer'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(
            self.widget(
                'unsatisfiable_entity_explorer_dock').toggleViewAction())

        # CONFIGURE SIGNALS
        self.debug('Configuring session specific signals')
        connect(self.session.sgnReady, self.onSessionReady)
        connect(self.session.sgnConsistencyCheckStarted,
                self.onConsistencyCheckStarted)
        connect(self.session.sgnConsistencyCheckReset,
                self.onConsistencyCheckReset)
        connect(self.session.sgnPerfectOntology, self.onPerfectOntology)
        connect(self.session.sgnInconsistentOntology,
                self.onInconsistentOntology)
        connect(self.session.sgnUnsatisfiableEntities,
                self.onUnsatisfiableEntities)

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(
            QtCore.Qt.LeftDockWidgetArea,
            self.widget('unsatisfiable_entity_explorer_dock'))

        # HIDE THE DOCK WIDGET BY DEFAULT
        if self.widget('unsatisfiable_entity_explorer_dock').toggleViewAction(
        ).isVisible():
            self.widget('unsatisfiable_entity_explorer_dock').toggleViewAction(
            ).trigger()
Ejemplo n.º 4
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating ontology explorer widget')
        widget = OntologyExplorerWidget(self)
        widget.setObjectName('ontology_explorer')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Ontology Explorer',
                            QtGui.QIcon(':icons/18/ic_explore_black'),
                            self.session)
        widget.addTitleBarButton(self.widget('explorer_toggle'))
        widget.installEventFilter(self)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea
                               | QtCore.Qt.BottomDockWidgetArea)
        widget.setObjectName('ontology_explorer_dock')
        widget.setWidget(self.widget('ontology_explorer'))
        self.addWidget(widget)

        # CREATE SHORTCUTS
        action = widget.toggleViewAction()
        action.setParent(self.session)
        action.setShortcut(QtGui.QKeySequence('Alt+4'))

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(
            self.widget('ontology_explorer_dock').toggleViewAction())

        # CONFIGURE SIGNALS
        self.debug('Configuring session specific signals')
        connect(self.session.sgnReady, self.onSessionReady)

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.RightDockWidgetArea,
                                   self.widget('ontology_explorer_dock'))
Ejemplo n.º 5
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating Unsatisfiable_Entity_Explorer widget')
        widget = UnsatisfiableEntityExplorerWidget(self)
        widget.setObjectName('Unsatisfiable_Entity_Explorer')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Unsatisfiable Entity Explorer',
                            QtGui.QIcon(':icons/18/ic_explore_black'),
                            self.session)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea)
        widget.setObjectName('Unsatisfiable_Entity_Explorer_dock')
        widget.setWidget(self.widget('Unsatisfiable_Entity_Explorer'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(
            self.widget(
                'Unsatisfiable_Entity_Explorer_dock').toggleViewAction())

        # CONFIGURE SIGNALS
        self.debug('Configuring session specific signals')

        self.onSessionReady()

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(
            QtCore.Qt.LeftDockWidgetArea,
            self.widget('Unsatisfiable_Entity_Explorer_dock'))
Ejemplo n.º 6
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating iri widget')
        widget = IriWidget(self)
        widget.setObjectName('developers_iri')
        self.addWidget(widget)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('developers_Prefix-Iri Explorer',
                            QtGui.QIcon(':/icons/18/ic_info_outline_black'),
                            self.session)
        widget.installEventFilter(self)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea)
        widget.setObjectName('iri_dock')
        widget.setWidget(self.widget('developers_iri'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(self.widget('iri_dock').toggleViewAction())

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.RightDockWidgetArea,
                                   self.widget('iri_dock'))

        # CONFIGURE SIGNAL/SLOTS
        self.debug('Connecting to active session')
        connect(self.session.sgnReady, self.onSessionReady)
        connect(self.session.mdi.subWindowActivated, self.onSubWindowActivated)
Ejemplo n.º 7
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating palette widget')
        widget = PaletteWidget(self)
        widget.setObjectName('palette')
        self.addWidget(widget)

        # CREATE TOGGLE ACTIONS
        self.debug('Creating palette toggle actions')
        group = QtWidgets.QActionGroup(self, objectName='palette_toggle')
        group.setExclusive(False)
        for item in widget.items:
            action = QtWidgets.QAction(item.realName.title(), group, objectName=item.name, checkable=True)
            action.setChecked(widget.display[item])
            action.setData(item)
            action.setFont(Font('Roboto', 11))
            connect(action.triggered, widget.onMenuButtonClicked)
            connect(action.triggered, self.onMenuButtonClicked)
            group.addAction(action)
        self.addAction(group)

        # CREATE TOGGLE MENU
        self.debug('Creating palette toggle menu')
        menu = QtWidgets.QMenu(objectName='palette_toggle')
        menu.addActions(self.action('palette_toggle').actions())
        self.addMenu(menu)

        # CREATE CONTROL WIDGET
        self.debug('Creating palette toggle control widget')
        button = QtWidgets.QToolButton(objectName='palette_toggle')
        button.setIcon(QtGui.QIcon(':/icons/18/ic_settings_black'))
        button.setContentsMargins(0, 0, 0, 0)
        button.setFixedSize(18, 18)
        button.setMenu(self.menu('palette_toggle'))
        button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
        self.addWidget(button)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Palette', QtGui.QIcon(':/icons/18/ic_palette_black'), self.session)
        widget.addTitleBarButton(self.widget('palette_toggle'))
        widget.installEventFilter(self)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea)
        widget.setObjectName('palette_dock')
        widget.setWidget(self.widget('palette'))
        self.addWidget(widget)

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(self.widget('palette_dock').toggleViewAction())

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.widget('palette_dock'))

        # LISTEN FOR SESSION READY SIGNAL
        self.debug('Connecting to active session')
        connect(self.session.sgnReady, self.onSessionReady)
        connect(self.session.sgnReady, self.doActivatePalette)
Ejemplo n.º 8
0
    def start(self):
        """
        Perform initialization tasks for the plugin.
        """
        # INITIALIZE THE WIDGET
        self.debug('Creating ontology explorer widget')
        widget = OntologyExplorerWidget(self)
        widget.setObjectName('ontology_explorer')
        self.addWidget(widget)

        # CREATE TOGGLE ACTIONS
        self.debug('Creating explorer toggle actions')
        group = QtWidgets.QActionGroup(self, objectName='explorer_item_toggle')
        group.setExclusive(False)
        for item in widget.items:
            action = QtWidgets.QAction(item.realName.title(),
                                       group,
                                       objectName=item.name,
                                       checkable=True)
            action.setChecked(True)
            action.setData(item)
            connect(action.triggered, widget.onMenuButtonClicked)
            group.addAction(action)
        self.addAction(group)

        group = QtWidgets.QActionGroup(self,
                                       objectName='explorer_status_toggle')
        group.setExclusive(False)
        for status in widget.status:
            action = QtWidgets.QAction(
                status.value if status.value else 'Default',
                group,
                objectName=status.name,
                checkable=True)
            action.setChecked(True)
            action.setData(status)
            connect(action.triggered, widget.onMenuButtonClicked)
            group.addAction(action)
        self.addAction(group)

        # CREATE TOGGLE MENU
        self.debug('Creating explorer toggle menu')
        menu = QtWidgets.QMenu(objectName='explorer_toggle')
        menu.addSection('Items')
        menu.addActions(self.action('explorer_item_toggle').actions())
        menu.addSection('Description')
        menu.addActions(self.action('explorer_status_toggle').actions())
        self.addMenu(menu)

        # CREATE CONTROL WIDGET
        self.debug('Creating explorer toggle control widget')
        button = QtWidgets.QToolButton(objectName='explorer_toggle')
        button.setIcon(QtGui.QIcon(':/icons/18/ic_settings_black'))
        button.setContentsMargins(0, 0, 0, 0)
        button.setFixedSize(18, 18)
        button.setFocusPolicy(QtCore.Qt.NoFocus)
        button.setMenu(self.menu('explorer_toggle'))
        button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
        self.addWidget(button)

        # CREATE DOCKING AREA WIDGET
        self.debug('Creating docking area widget')
        widget = DockWidget('Ontology Explorer',
                            QtGui.QIcon(':icons/18/ic_explore_black'),
                            self.session)
        widget.addTitleBarButton(self.widget('explorer_toggle'))
        widget.installEventFilter(self)
        widget.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea
                               | QtCore.Qt.RightDockWidgetArea
                               | QtCore.Qt.BottomDockWidgetArea)
        widget.setObjectName('ontology_explorer_dock')
        widget.setWidget(self.widget('ontology_explorer'))
        self.addWidget(widget)

        # CREATE SHORTCUTS
        action = widget.toggleViewAction()
        action.setParent(self.session)
        action.setShortcut(QtGui.QKeySequence('Alt+4'))

        # CREATE ENTRY IN VIEW MENU
        self.debug('Creating docking area widget toggle in "view" menu')
        menu = self.session.menu('view')
        menu.addAction(
            self.widget('ontology_explorer_dock').toggleViewAction())

        # CONFIGURE SIGNALS
        self.debug('Configuring session specific signals')
        connect(self.session.sgnReady, self.onSessionReady)

        # INSTALL DOCKING AREA WIDGET
        self.debug('Installing docking area widget')
        self.session.addDockWidget(QtCore.Qt.RightDockWidgetArea,
                                   self.widget('ontology_explorer_dock'))