Author Topic: Boundaries and contained elements  (Read 5401 times)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Boundaries and contained elements
« on: January 30, 2006, 04:55:26 am »
Anyone have insights on how to handle - thorough the automation interface - the relationship between a boundary (the enclosure, not the UP Boundary Element) and those elements it encloses.

I'm looking to do things like:
  • add a boundary to a diagram, then add elements to the boundary
  • query a boundary to enumerate the elements it encloses
  • create a hierarchy of nested boundaries


It's easy to identify or add a boundary, but from there I'm lost.

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Boundaries and contained elements
« Reply #1 on: January 30, 2006, 02:03:11 pm »
Quote
I'm looking to do things like:
  • add a boundary to a diagram, then add elements to the boundary
  • query a boundary to enumerate the elements it encloses
  • create a hierarchy of nested boundaries

It's easy to identify or add a boundary, but from there I'm lost.


I think you'll need to loop through all of the diagram objects on a diagram and calculate (from the left, right, top and bottom attributes) whether it is fully contained within the boundary.
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Boundaries and contained elements
« Reply #2 on: January 30, 2006, 02:48:12 pm »
Thanks KP,

I was getting resigned to that fate...

Of course boundaries are arbitrary (or whatever) partitionings of a system, so there is really much less of an 'ownership' relation between them and their enclosed elements than in other UML constructs.

I gather I can just line up the elements I want to enclose, calculate the greatest extent of height or width, and then simply plunk down a boundary and size it accordingly.

The other way would sort of be in reverse, as you suggest.
No, you can't have it!