Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Hierarchical Layout and Active Status(Algorithms loose hierarchical layout when active)
Hierarchical Layout and Active Status [message #556986] Fri, 03 September 2010 13:59 Go to next message
Rhett Hudson is currently offline Rhett Hudson
Messages: 43
Registered: September 2010
Member
I have an add feature that creates a structure like this:

ContainerShape(Rectangle) -> ContainerShape(Rectangle) -> Shape(Rectangle)

Where '->' indicates that the thing on the right is a child of the thing on the left and the thing in ()'s is the graphical algorithm.

I'd like to make the layout feature of that last shape use coordinates relative to the location of the rectangle of its parent shape. Indeed, when the shape is inactive, that appears to be the behavior I see.

However, that shape is also an anchor for connections. If I don't make it active, it isn't seen by the connection tool. But, when I make it active, it appears that I lose the relative coordinate system of the parent rectangle and it gets laid out using the root container's coordinate system.

Is that the behavior I should expect? That layout changes depending on the active attribute?
Re: Hierarchical Layout and Active Status [message #557373 is a reply to message #556986] Tue, 07 September 2010 07:57 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Yes, this is indeed the exspected behavior. I have to admit that this might
be somewhat confusing and that our documentation is not complete at this
point... :-(

The "active" flag for a pictogram element (PE) does not only control its
selectability but also influences layouting and drawing. Only active PEs are
actually drawn onto a diagram visualization (in GEF terms: an EditPart is
created), inactive ones are not present there. This means that they also do
not exists for layouting and positioning purposes. In fact merely all PEs
should be active (especially outer ones), inactive ones should be used for
structuring purposes only (e.g. for grouping the attributes of an EClass
object).

In your case probably the outer ContainerShapes are also inactive, so all
PEs are not available in the diagram visualization on GEF level. This leads
then to the graphics algorithm (GA) objects being used for layouting. (BTW:
This is also the recommended way how to do visual structuring inside a
graphical representation.)

As soon as you set the inner PE to active, it exists in the graphical
visualization and is used for layouting. It's coordinate system is the one
of the next active PE parent. Inactive ones on the way to the top level
container are ignored. This means in your case that the diagram coordinate
system is used.

Hope this makes the behavior clearer...

-Michael


"Rhett Hudson" <rhett.hudson@gmail.com> wrote in message
news:i5qv04$q20$1@build.eclipse.org...
>I have an add feature that creates a structure like this:
>
> ContainerShape(Rectangle) -> ContainerShape(Rectangle) -> Shape(Rectangle)
>
> Where '->' indicates that the thing on the right is a child of the thing
> on the left and the thing in ()'s is the graphical algorithm.
>
> I'd like to make the layout feature of that last shape use coordinates
> relative to the location of the rectangle of its parent shape. Indeed,
> when the shape is inactive, that appears to be the behavior I see.
>
> However, that shape is also an anchor for connections. If I don't make it
> active, it isn't seen by the connection tool. But, when I make it active,
> it appears that I lose the relative coordinate system of the parent
> rectangle and it gets laid out using the root container's coordinate
> system.
>
> Is that the behavior I should expect? That layout changes depending on the
> active attribute?
>
Previous Topic:Hierarchical Layout and Active Status
Next Topic:Undo/Redo support for non EMF based domain objects
Goto Forum:
  


Current Time: Fri Sep 19 02:05:02 GMT 2014

Powered by FUDForum. Page generated in 0.02141 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software