Changeset 1085
- Timestamp:
- 11/21/06 13:24:13 (2 years ago)
- Files:
-
- gaphor/branches/new-canvas/ChangeLog (modified) (1 diff)
- gaphor/branches/new-canvas/gaphor/actions/diagramactions.py (modified) (3 diffs)
- gaphor/branches/new-canvas/gaphor/adapters/connectors.py (modified) (3 diffs)
- gaphor/branches/new-canvas/gaphor/adapters/tests/test_connector.py (modified) (2 diffs)
- gaphor/branches/new-canvas/gaphor/diagram/diagramitem.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/branches/new-canvas/ChangeLog
r1074 r1085 1 2006-11-20 arjan <arjan at yirdis dot nl> 2 3 * gaphor/storage.py: loading/saving works 4 * gaphor/adapters/connector.py: added connector for 5 commentline-diagramline. 6 * gaphor/diaram/diagramitem.py: made delete operation work. 7 1 8 2006-11-14 arjan <arjan at yirdis dot nl> 2 9 gaphor/branches/new-canvas/gaphor/actions/diagramactions.py
r1056 r1085 207 207 items = view.selected_items 208 208 for i in items: 209 s = i.subject 210 if s and len(s.presentation) == 1: 211 s.unlink() 209 212 i.unlink() 210 213 finally: … … 223 226 def is_last_view(self, item): 224 227 ''' Check if the current view is the last view to its object ''' 225 if item.subject and len(item.subject.presentation) ==1:228 if item.subject and len(item.subject.presentation) == 1: 226 229 return True 227 230 return False … … 239 242 value = dialog.run() 240 243 dialog.destroy() 241 if value ==gtk.RESPONSE_YES:244 if value == gtk.RESPONSE_YES: 242 245 return True 243 246 return False gaphor/branches/new-canvas/gaphor/adapters/connectors.py
r1084 r1085 85 85 element it's attached to, by removing the constraints. 86 86 """ 87 solver = self. element.canvas.solver87 solver = self.line.canvas.solver 88 88 try: 89 89 solver.remove_constraint(handle._connect_constraint) … … 153 153 closest to (x, y). 154 154 """ 155 h = self. line.handles()155 h = self.element.handles() 156 156 pos = (x, y) 157 157 min_d = None … … 207 207 connected_to = opposite.connected_to 208 208 if connected_to is element: 209 #print 'item identical', connected_to, element210 209 return None 211 210 gaphor/branches/new-canvas/gaphor/adapters/tests/test_connector.py
r1081 r1085 82 82 assert not actor2.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 83 83 84 84 85 def test_commentline_association(self): 85 86 """ 86 87 Test CommentLineItem with AssociationItem. 88 89 # TODO: check behaviour if: 90 1. comment line is connected to association + comment and after that 91 association is connected to two classes. 92 -> association should be connected to comment.annotatedElement 93 2. association is disconnected while a comment is connected: 94 -> association should be removed from comment.annotatedElement 87 95 """ 88 96 diagram = UML.create(UML.Diagram) 89 97 comment = diagram.create(items.CommentItem, subject=UML.create(UML.Comment)) 90 98 line = diagram.create(items.CommentLineItem) 99 line.head.pos = 100, 100 100 line.tail.pos = 100, 100 91 101 c1 = diagram.create(items.ClassItem, subject=UML.create(UML.Class)) 92 102 c2 = diagram.create(items.ClassItem, subject=UML.create(UML.Class)) … … 111 121 assert type(adapter) is gaphor.adapters.connectors.CommentLineLineConnect 112 122 handle = line.head 123 pos = adapter.glue(handle, handle.x, handle.y) 124 assert pos == (0, 10), pos 113 125 adapter.connect(handle, handle.x, handle.y) 114 126 gaphor/branches/new-canvas/gaphor/diagram/diagramitem.py
r1079 r1085 102 102 self.save_property(save_func, name) 103 103 104 # def set_subject(self, subject=None): 105 # """Set the subject. In addition, if there are no more presentations 106 # on the subject, the subject is unlink()'ed. 107 # Note that this function is different from setting the subject property 108 # directly! 109 # """ 110 # #log.debug('set_subject %s %s' % (self.subject, subject)) 111 # old = self.subject 112 # 113 # # remove the subject if we have one 114 # if self.subject: 115 # del self.subject 116 # 117 # if old and len(old.presentation) == 0: 118 # #log.debug('diagramitem.unlink: No more presentations: unlinking') 119 # old.unlink() 120 # 121 # self.subject = subject 104 def unlink(self): 105 print 'DiagramItem.unlink', self, self.canvas 106 if self.canvas: 107 self.canvas.remove(self) 108 self.subject = None 109 super(DiagramItem, self).unlink() 122 110 123 111 def get_popup_menu(self):
