Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place UML model and diagram items closer together #300

Merged
merged 6 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions gaphor/UML/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
from gaphor.UML.uml import * # noqa: isort:skip
from gaphor.UML import modelfactory as model # noqa: isort:skip

from gaphor.UML.umlfmt import format
from gaphor.UML.umllex import parse
from gaphor.UML.umlfmt import format # noqa: isort:skip
from gaphor.UML.umllex import parse # noqa: isort:skip

import gaphor.UML.umloverrides # noqa: isort:skip

import gaphor.UML.actions
import gaphor.UML.classes
import gaphor.UML.components
import gaphor.UML.interactions
import gaphor.UML.profiles
import gaphor.UML.states
import gaphor.UML.usecases
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from gaphor.diagram.actions.action import (
from gaphor.UML.actions.action import (
AcceptEventActionItem,
ActionItem,
SendSignalActionItem,
)
from gaphor.diagram.actions.activitynodes import (
from gaphor.UML.actions.activitynodes import (
ActivityFinalNodeItem,
ActivityNodeItem,
DecisionNodeItem,
FlowFinalNodeItem,
ForkNodeItem,
InitialNodeItem,
)
from gaphor.diagram.actions.flow import FlowItem
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.diagram.actions.partition import PartitionItem
from gaphor.UML.actions.flow import FlowItem
from gaphor.UML.actions.objectnode import ObjectNodeItem
from gaphor.UML.actions.partition import PartitionItem


def _load():
from gaphor.diagram.actions import (
from gaphor.UML.actions import (
actionsgrouping,
flowconnect,
partitionpage,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from gaphor.core import transactional
from gaphor.diagram.actions.activitynodes import ForkNodeItem
from gaphor.diagram.inlineeditors import InlineEditor, popup_entry, show_popover
from gaphor.UML.actions.activitynodes import ForkNodeItem


@InlineEditor.register(ForkNodeItem)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from gaphor import UML
from gaphor.diagram.actions.action import ActionItem
from gaphor.diagram.actions.activitynodes import ActivityNodeItem, ForkNodeItem
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.diagram.actions.partition import PartitionItem
from gaphor.diagram.grouping import AbstractGroup, Group
from gaphor.UML.actions.action import ActionItem
from gaphor.UML.actions.activitynodes import ActivityNodeItem, ForkNodeItem
from gaphor.UML.actions.objectnode import ObjectNodeItem
from gaphor.UML.actions.partition import PartitionItem


@Group.register(PartitionItem, PartitionItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from gaphor import UML
from gaphor.core import transactional
from gaphor.diagram.actions.activitynodes import ForkNodeItem
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.diagram.propertypages import PropertyPageBase, PropertyPages, new_builder
from gaphor.UML.actions.activitynodes import ForkNodeItem
from gaphor.UML.actions.objectnode import ObjectNodeItem


@PropertyPages.register(ObjectNodeItem)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
from typing import Type, Union

from gaphor import UML
from gaphor.diagram.actions.action import (
from gaphor.diagram.connectors import Connector, UnaryRelationshipConnect
from gaphor.UML.actions.action import (
AcceptEventActionItem,
ActionItem,
SendSignalActionItem,
)
from gaphor.diagram.actions.activitynodes import (
from gaphor.UML.actions.activitynodes import (
ActivityFinalNodeItem,
ActivityNodeItem,
DecisionNodeItem,
FlowFinalNodeItem,
ForkNodeItem,
InitialNodeItem,
)
from gaphor.diagram.actions.flow import FlowItem
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.diagram.connectors import Connector, UnaryRelationshipConnect
from gaphor.UML.actions.flow import FlowItem
from gaphor.UML.actions.objectnode import ObjectNodeItem


class FlowConnect(UnaryRelationshipConnect):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from gi.repository import Gtk

from gaphor.core import gettext, transactional
from gaphor.diagram.actions.partition import PartitionItem
from gaphor.diagram.propertypages import PropertyPageBase, PropertyPages, new_builder
from gaphor.UML.actions.partition import PartitionItem


@PropertyPages.register(PartitionItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

from gaphor import UML
from gaphor.diagram.actions.action import ActionItem
from gaphor.tests.testcase import TestCase
from gaphor.UML.actions.action import ActionItem


class ActionTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gaphor.UML as UML
from gaphor.diagram.actions.activitynodes import DecisionNodeItem, ForkNodeItem
from gaphor.tests.testcase import TestCase
from gaphor.UML.actions.activitynodes import DecisionNodeItem, ForkNodeItem


class ActivityNodesTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from gaphas.canvas import Context, instant_cairo_context

import gaphor.UML as UML
from gaphor.diagram.actions.flow import FlowItem
from gaphor.tests.testcase import TestCase
from gaphor.UML.actions.flow import FlowItem


class FlowTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

from gaphor import UML
from gaphor.core.modeling import Presentation
from gaphor.diagram.actions.action import ActionItem
from gaphor.diagram.actions.activitynodes import (
from gaphor.tests import TestCase
from gaphor.UML.actions.action import ActionItem
from gaphor.UML.actions.activitynodes import (
ActivityFinalNodeItem,
ActivityNodeItem,
DecisionNodeItem,
FlowFinalNodeItem,
ForkNodeItem,
InitialNodeItem,
)
from gaphor.diagram.actions.flow import FlowItem
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.tests import TestCase
from gaphor.UML.actions.flow import FlowItem
from gaphor.UML.actions.objectnode import ObjectNodeItem


class FlowItemBasicNodesConnectionTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

from gaphor import UML
from gaphor.diagram.actions import ActionItem, PartitionItem
from gaphor.tests import TestCase
from gaphor.UML.actions import ActionItem, PartitionItem


class PartitionGroupTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gaphor.UML as UML
from gaphor.diagram.actions.objectnode import ObjectNodeItem
from gaphor.tests.testcase import TestCase
from gaphor.UML.actions.objectnode import ObjectNodeItem


class ObjectNodeTestCase(TestCase):
Expand Down
19 changes: 19 additions & 0 deletions gaphor/UML/classes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from gaphor.UML.classes.association import AssociationItem
from gaphor.UML.classes.dependency import DependencyItem
from gaphor.UML.classes.generalization import GeneralizationItem
from gaphor.UML.classes.implementation import ImplementationItem
from gaphor.UML.classes.interface import Folded, InterfaceItem
from gaphor.UML.classes.klass import ClassItem
from gaphor.UML.classes.package import PackageItem


def _load():
from gaphor.UML.classes import (
classconnect,
interfaceconnect,
classeseditors,
classespropertypages,
)


_load()
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Classes related (dependency, implementation) adapter connections."""

from gaphor import UML
from gaphor.diagram.classes.association import AssociationItem
from gaphor.diagram.classes.dependency import DependencyItem
from gaphor.diagram.classes.generalization import GeneralizationItem
from gaphor.diagram.classes.implementation import ImplementationItem
from gaphor.diagram.connectors import (
Connector,
RelationshipConnect,
UnaryRelationshipConnect,
)
from gaphor.diagram.presentation import Classified, Named
from gaphor.UML.classes.association import AssociationItem
from gaphor.UML.classes.dependency import DependencyItem
from gaphor.UML.classes.generalization import GeneralizationItem
from gaphor.UML.classes.implementation import ImplementationItem


@Connector.register(Named, DependencyItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

from gaphor import UML
from gaphor.core import transactional
from gaphor.diagram.classes.association import AssociationItem
from gaphor.diagram.inlineeditors import (
InlineEditor,
editable_text_box,
popup_entry,
show_popover,
)
from gaphor.UML.classes.association import AssociationItem


@InlineEditor.register(AssociationItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@

from gaphor import UML
from gaphor.core import gettext, transactional
from gaphor.diagram.classes.association import AssociationItem
from gaphor.diagram.classes.dependency import DependencyItem
from gaphor.diagram.classes.interface import Folded, InterfaceItem
from gaphor.diagram.classes.klass import ClassItem
from gaphor.diagram.components.connector import ConnectorItem
from gaphor.diagram.propertypages import (
ComboModel,
EditableTreeModel,
NamedElementPropertyPage,
PropertyPageBase,
PropertyPages,
UMLComboModel,
new_builder,
on_bool_cell_edited,
on_keypress_event,
on_text_cell_edited,
)
from gaphor.UML.classes.association import AssociationItem
from gaphor.UML.classes.dependency import DependencyItem
from gaphor.UML.classes.interface import Folded, InterfaceItem
from gaphor.UML.classes.klass import ClassItem
from gaphor.UML.components.connector import ConnectorItem

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -318,7 +318,7 @@ def __init__(self, item):

def construct(self):
dependency_combo = self.builder.get_object("dependency-combo")
model = UMLComboModel(self.DEPENDENCY_TYPES)
model = ComboModel(self.DEPENDENCY_TYPES)
dependency_combo.set_model(model)

automatic = self.builder.get_object("automatic")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import gaphas

from gaphor import UML
from gaphor.diagram.classes.interface import Folded, InterfacePort
from gaphor.diagram.presentation import LinePresentation
from gaphor.diagram.shapes import Text
from gaphor.diagram.support import represents
from gaphor.UML.classes.interface import Folded, InterfacePort
from gaphor.UML.modelfactory import stereotypes_str


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import gaphas

from gaphor import UML
from gaphor.diagram.classes.interface import Folded, InterfacePort
from gaphor.diagram.presentation import LinePresentation
from gaphor.diagram.shapes import Text
from gaphor.diagram.support import represents
from gaphor.UML.classes.interface import Folded, InterfacePort
from gaphor.UML.modelfactory import stereotypes_str


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@

from gaphor import UML
from gaphor.core.modeling.properties import attribute
from gaphor.diagram.classes.klass import (
attribute_watches,
attributes_compartment,
operation_watches,
operations_compartment,
)
from gaphor.diagram.classes.stereotype import stereotype_compartments
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
Expand All @@ -94,6 +87,13 @@
from gaphor.diagram.shapes import Box, EditableText, IconBox, Text, draw_border
from gaphor.diagram.support import represents
from gaphor.diagram.text import FontWeight, VerticalAlign
from gaphor.UML.classes.klass import (
attribute_watches,
attributes_compartment,
operation_watches,
operations_compartment,
)
from gaphor.UML.classes.stereotype import stereotype_compartments


class Folded(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"""


from gaphor.diagram.classes.classconnect import DependencyConnect, ImplementationConnect
from gaphor.diagram.classes.dependency import DependencyItem
from gaphor.diagram.classes.implementation import ImplementationItem
from gaphor.diagram.classes.interface import Folded, InterfaceItem
from gaphor.diagram.connectors import Connector
from gaphor.UML.classes.classconnect import DependencyConnect, ImplementationConnect
from gaphor.UML.classes.dependency import DependencyItem
from gaphor.UML.classes.implementation import ImplementationItem
from gaphor.UML.classes.interface import Folded, InterfaceItem


@Connector.register(InterfaceItem, ImplementationItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from gaphor import UML
from gaphor.core.modeling.properties import attribute
from gaphor.diagram.classes.stereotype import stereotype_compartments
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
Expand All @@ -23,6 +22,7 @@
TextDecoration,
VerticalAlign,
)
from gaphor.UML.classes.stereotype import stereotype_compartments

log = logging.getLogger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""

from gaphor import UML
from gaphor.diagram.classes.association import AssociationItem
from gaphor.diagram.classes.klass import ClassItem
from gaphor.tests import TestCase
from gaphor.UML.classes.association import AssociationItem
from gaphor.UML.classes.klass import ClassItem


class AssociationItemTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from gaphas.canvas import instant_cairo_context

from gaphor import UML
from gaphor.diagram.classes.klass import ClassItem
from gaphor.tests.testcase import TestCase
from gaphor.UML.classes.klass import ClassItem


def compartments(item):
Expand Down