Skip to main content



      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 13:08 Go to next message
Eclipse UserFriend
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 07:31 Go to previous messageGo to next message
Eclipse UserFriend
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 12:06 Go to previous messageGo to next message
Eclipse UserFriend
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 06:15 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 01:46:05 EDT 2025

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

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

Back to the top