move ElementDispatcher in Gaphor.UML

This functionality is very model related (used by gaphor.diagram code) and therefore should deserve a place in gaphor.UML.
This commit is contained in:
Arjan Molenaar 2019-05-28 21:20:46 +02:00
parent 89d9c999cd
commit f77d3f8f75
10 changed files with 12 additions and 12 deletions

@ -60,4 +60,4 @@ element_dispatcher
interest and will only signal in case this element changes.
This makes complex dispatching very efficient.
.. autoclass:: gaphor.services.elementdispatcher.ElementDispatcher
.. autoclass:: gaphor.UML.elementdispatcher.ElementDispatcher

@ -5,7 +5,7 @@
from logging import getLogger
from gaphor.core import inject, event_handler
from gaphor.abc import Service
from gaphor import UML
from gaphor.UML import uml2
from gaphor.UML.event import (
ElementChangeEvent,
AssociationSetEvent,
@ -125,7 +125,7 @@ class ElementDispatcher(Service):
prop = getattr(c, attr)
tpath.append(prop)
if cname:
c = getattr(UML, cname)
c = getattr(uml2, cname)
assert issubclass(c, prop.type), "%s should be a subclass of %s" % (
c,
prop.type,

@ -2,8 +2,8 @@ import unittest
from gaphor.tests import TestCase
from gaphor import UML
from gaphor.application import Application
from gaphor.services.elementdispatcher import ElementDispatcher
from gaphor.services.eventmanager import EventManager
from gaphor.UML.elementdispatcher import ElementDispatcher
from gaphor.UML.elementfactory import ElementFactory
@ -203,7 +203,7 @@ class ElementDispatcherTestCase(unittest.TestCase):
from gaphor.UML import Element
from gaphor.UML.properties import association
from gaphor.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
class A(Element):

@ -4,7 +4,7 @@ from gi.repository import Gtk
from gaphas.decorators import AsyncIO
from gaphor import UML
from gaphor.core import _, transactional
from gaphor.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
from gaphor.diagram.propertypages import PropertyPages, PropertyPageBase
from gaphor.diagram.propertypages import (
NamedElementPropertyPage,

@ -7,7 +7,7 @@ from gaphas.state import observed, reversible_property
import logging
from gaphor import UML
from gaphor.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
from gaphor.diagram.textelement import EditableTextSupport
from gaphor.diagram.style import Style, ALIGN_CENTER, ALIGN_TOP
from gaphor.diagram.support import set_diagram_item

@ -2,7 +2,7 @@ from gi.repository import Gtk
from gaphor import UML
from gaphor.core import _, transactional
from gaphor.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
from gaphor.diagram.propertypages import PropertyPages, PropertyPageBase

@ -6,7 +6,7 @@ from gi.repository import Gtk
from gaphor import UML
from gaphor.core import _
from diagram.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
from gaphor.diagram.propertypages import create_hbox_label
from gaphor.diagram.propertypages import PropertyPages, NamedElementPropertyPage
from gaphor.diagram.classes import ClassItem

@ -33,7 +33,7 @@ from gi.repository import Gtk
from gaphor import UML
from gaphor.core import _, transactional
from gaphor.services.elementdispatcher import EventWatcher
from gaphor.UML.elementdispatcher import EventWatcher
class _PropertyPages:

@ -62,7 +62,7 @@ gaphorconvert = 'gaphor.tools.gaphorconvert:main'
"main_window" = "gaphor.ui.mainwindow:MainWindow"
"copy" = "gaphor.services.copyservice:CopyService"
"sanitizer" = "gaphor.services.sanitizerservice:SanitizerService"
"element_dispatcher" = "gaphor.services.elementdispatcher:ElementDispatcher"
"element_dispatcher" = "gaphor.UML.elementdispatcher:ElementDispatcher"
"xmi_export" = "gaphor.plugins.xmiexport:XMIExport"
"diagram_layout" = "gaphor.plugins.diagramlayout:DiagramLayout"
"pynsource" = "gaphor.plugins.pynsource:PyNSource"

@ -113,7 +113,7 @@ setup(
"main_window = gaphor.ui.mainwindow:MainWindow",
"copy = gaphor.services.copyservice:CopyService",
"sanitizer = gaphor.services.sanitizerservice:SanitizerService",
"element_dispatcher = gaphor.services.elementdispatcher:ElementDispatcher",
"element_dispatcher = gaphor.UML.elementdispatcher:ElementDispatcher",
"xmi_export = gaphor.plugins.xmiexport:XMIExport",
"diagram_layout = gaphor.plugins.diagramlayout:DiagramLayout",
"pynsource = gaphor.plugins.pynsource:PyNSource",