Author Topic: Automatically associate elements by drag&drop  (Read 2396 times)

Yves C

  • EA User
  • **
  • Posts: 33
  • Karma: +1/-1
  • I love YaBB 1G - SP1!
    • View Profile
Automatically associate elements by drag&drop
« on: October 24, 2013, 02:16:44 am »
Currently in EA when you drag a requirement onto a use case in a diagram, a realisation between the use case and the requirement is automatically created.
I would like to to the same with my own stereotypes.

I think there are 2 ways to do it :
1. In a MDG : I'm looking for a way to specify this kind of behaviour in a stereotype definition but I've found nothing.
2. With an add-in : I'm looking for an event raised when you drag an object on another one in a diagram. I've found OnPreNewDiagramObject or OnPostNewDiagramObject but none tells if the view has been dragged on another object view.

Any ideas ?
Yves

qwerty

  • EA Guru
  • *****
  • Posts: 13551
  • Karma: +395/-300
  • I'm no guru at all
    • View Profile
Re: Automatically associate elements by drag
« Reply #1 on: October 24, 2013, 02:32:17 am »
An MDG does not allow what you need. At least not without an add-in.

I'm not sure whether the coordinates of the newly created DiagramObjects are correct (I have something in my mind that whispers this is buggy). But if so you can retrieve the coordinates of the existing objects on the diagram. And by that and their dimension you can tell if the new objects has been dropped over an existing one.

q.
« Last Edit: October 24, 2013, 02:32:43 am by qwerty »