Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Does container shape have to have a GA?
Does container shape have to have a GA? [message #645160] Wed, 15 December 2010 18:08 Go to next message
Shenxue Zhou is currently offline Shenxue ZhouFriend
Messages: 60
Registered: July 2009
Member
The nodes in my diagram can be represented with an icon and some text. In the Add feature, when I create the top container, do I have to create an invisible rectangle as the GA for the top container shape? If I don't create the GA for the container shape, what would become the selection region for the node?

In Graphiti's PE model, does each shape need to have a Graphics Algorithm associated with it?

Thank you!

Shenxue
Re: Does container shape have to have a GA? [message #645485 is a reply to message #645160] Fri, 17 December 2010 12:31 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
In general that should be possible, practically I haven't tried that yet.
Having such an invisible root GA makes in fact many things easier: grouping,
you get the coordinates relative to that root instead of delaing with
absolute diagram coordinates for both icon and text.

You can define the selection region using the method getSelectionBorder in
the ToolBehaviorProvider.

Michael


"Shenxue Zhou" <shenxue.zhou@oracle.com> wrote in message
news:ieavuc$bci$1@news.eclipse.org...
> The nodes in my diagram can be represented with an icon and some text. In
> the Add feature, when I create the top container, do I have to create an
> invisible rectangle as the GA for the top container shape? If I don't
> create the GA for the container shape, what would become the selection
> region for the node?
>
> In Graphiti's PE model, does each shape need to have a Graphics Algorithm
> associated with it?
>
> Thank you!
>
> Shenxue
Re: Does container shape have to have a GA? [message #645534 is a reply to message #645485] Fri, 17 December 2010 17:06 Go to previous messageGo to next message
Shenxue Zhou is currently offline Shenxue ZhouFriend
Messages: 60
Registered: July 2009
Member
I did try with not creating a GA for the top level container but it resulted in NPE in handling selections. I'm not sure whether the NPE could be helped by defining the selection region like you mentioned.

I do see your point of having an invisible rectangle for the top container.

Thank you!
Re: Does container shape have to have a GA? [message #645747 is a reply to message #645534] Mon, 20 December 2010 11:15 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Could you post the NPE?

Michael


"Shenxue Zhou" <shenxue.zhou@oracle.com> wrote in message
news:ieg51n$ou9$1@news.eclipse.org...
>I did try with not creating a GA for the top level container but it
>resulted in NPE in handling selections. I'm not sure whether the NPE could
>be helped by defining the selection region like you mentioned.
>
> I do see your point of having an invisible rectangle for the top
> container.
>
> Thank you!
Previous Topic:Image provider supporting images from different plugins
Next Topic:Identifying diagram elements?
Goto Forum:
  


Current Time: Fri Apr 19 20:06:31 GMT 2024

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

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

Back to the top