|
Revision 2120, 1.0 kB
(checked in by arj..@yirdis.nl, 1 year ago)
|
Changed diagramitems to use the new notification system.
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
""" |
|---|
| 2 |
ExtensionItem -- Graphical representation of an association. |
|---|
| 3 |
""" |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
from gaphor import UML |
|---|
| 10 |
from gaphor.diagram.diagramline import NamedLine |
|---|
| 11 |
|
|---|
| 12 |
class ExtensionItem(NamedLine): |
|---|
| 13 |
""" |
|---|
| 14 |
ExtensionItem represents associations. |
|---|
| 15 |
An ExtensionItem has two ExtensionEnd items. Each ExtensionEnd item |
|---|
| 16 |
represents a Property (with Property.association == my association). |
|---|
| 17 |
""" |
|---|
| 18 |
|
|---|
| 19 |
__uml__ = UML.Extension |
|---|
| 20 |
|
|---|
| 21 |
def __init__(self, id=None): |
|---|
| 22 |
NamedLine.__init__(self, id) |
|---|
| 23 |
self.add_watch(UML.Extension.ownedEnd) |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
def draw_head(self, context): |
|---|
| 27 |
cr = context.cairo |
|---|
| 28 |
cr.move_to(0, 0) |
|---|
| 29 |
cr.line_to(15, -10) |
|---|
| 30 |
cr.line_to(15, 10) |
|---|
| 31 |
cr.line_to(0, 0) |
|---|
| 32 |
cr.set_source_rgb(0, 0, 0) |
|---|
| 33 |
cr.fill() |
|---|
| 34 |
cr.move_to(15, 0) |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|