Changeset 1060
- Timestamp:
- 11/02/06 21:31:56 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/branches/new-canvas/gaphor/diagram/activitynodes.py
r1059 r1060 14 14 #from gaphor.diagram.groupable import GroupBase 15 15 from gaphor.diagram.nameditem import NamedItem 16 from gaphor.diagram.style import ALIGN_LEFT, ALIGN_CENTER, ALIGN_TOP, \ 17 ALIGN_RIGHT, ALIGN_BOTTOM 16 18 17 19 … … 20 22 Simple activity node is not resizable. 21 23 """ 24 __style__ = { 25 'name-outside': True, 26 'name-padding': (2, 2, 2, 2), 27 } 22 28 23 29 def __init__(self, id=None, width=0, height=0): … … 34 40 """ 35 41 __uml__ = UML.InitialNode 42 __style__ = { 43 'name-align': (ALIGN_LEFT, ALIGN_TOP), 44 } 36 45 37 46 RADIUS = 10 38 47 39 def __init__(self, id =None, width=20, height=20):48 def __init__(self, id = None, width = 20, height = 20): 40 49 ActivityNodeItem.__init__(self, id, width, height) 41 50 … … 48 57 cr.fill() 49 58 50 cr.move_to(d, r) 51 cr.show_text(self.subject.name or '') 59 super(InitialNodeItem, self).draw(context) 52 60 53 61 … … 58 66 59 67 __uml__ = UML.ActivityFinalNode 68 __style__ = { 69 'name-align': (ALIGN_RIGHT, ALIGN_BOTTOM), 70 } 60 71 61 72 RADIUS_1 = 10 … … 79 90 cr.stroke() 80 91 81 cr.move_to(d, r) 82 cr.show_text(self.subject.name or '') 92 super(ActivityFinalNodeItem, self).draw(context) 83 93 84 94 … … 90 100 91 101 __uml__ = UML.FlowFinalNode 102 __style__ = { 103 'name-align': (ALIGN_RIGHT, ALIGN_BOTTOM), 104 } 92 105 93 106 RADIUS = 10 … … 102 115 path_ellipse(cr, r, r, d, d) 103 116 cr.stroke() 104 105 cr.move_to(d, r)106 cr.show_text(self.subject.name or '')107 117 108 118 dr = (1 - math.sin(math.pi / 4)) * r … … 113 123 cr.stroke() 114 124 125 super(FlowFinalNodeItem, self).draw(context) 126 115 127 116 128 … … 150 162 151 163 __uml__ = UML.DecisionNode 152 #__s_align__ = H_ALIGN_LEFT 164 __style__ = { 165 'name-align': (ALIGN_LEFT, ALIGN_TOP), 166 } 153 167 154 168 RADIUS = 15 … … 180 194 Representation of fork or join node. 181 195 """ 182 __uml__ = UML.ForkNode 183 #__s_valign__ = V_ALIGN_BOTTOM 196 __uml__ = UML.ForkNode 197 __style__ = { 198 'name-align': (ALIGN_CENTER, ALIGN_BOTTOM), 199 } 184 200 185 201 WIDTH = 6.0 gaphor/branches/new-canvas/gaphor/diagram/nameditem.py
r1059 r1060 49 49 cr = context.cairo 50 50 text = self.subject.name 51 if text :51 if text and not self.style.name_outside: 52 52 width, height = text_extents(cr, text) 53 53 self.min_width, self.min_height = get_min_size(width, height,
