Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Border item as a container
Border item as a container [message #70640] Fri, 27 October 2006 09:48 Go to next message
Hao Zhang is currently offline Hao ZhangFriend
Messages: 161
Registered: July 2009
Senior Member
Hi,
If I want my border item to hold children elements in toolbar layout, and
the border item should get bigger as the number of children increases,
what is the key points to deal with?

BTW, I'm still rather confused by the role of BorderItemContainerFigure,
is there any more detailed document on it except for comments in source
code, or could you explain it here, many thanks!

Regards,
Zhang Hao
Re: Border item as a container [message #71868 is a reply to message #70640] Tue, 31 October 2006 10:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stefano.puri.gmail.com

Hello,



I am also trying to have border item as a container: in particular I am
trying to use resizable collapsible compartments in border items of a
bordered node but I am having some problems regarding the refresh of the
entities (e.g. outgoing connections) owned by a "border compartment".



I am trying to investigate the GMF code to discover the reason of this
behaviour, for instance it seems that for a compartment the
ShapeCompartmentEditPart.ConnectionRefreshMgr class doesn't work properly if
a figure is owned by a BorderItemContainerFigure.



Regards,

Stefano


"Hao Zhang" <bjzhanghao@21cn.com> ha scritto nel messaggio
news:7d2c2e205163133efb3a083c3d4cd901$1@www.eclipse.org...
> Hi,
> If I want my border item to hold children elements in toolbar layout, and
> the border item should get bigger as the number of children increases,
> what is the key points to deal with?
>
> BTW, I'm still rather confused by the role of BorderItemContainerFigure,
> is there any more detailed document on it except for comments in source
> code, or could you explain it here, many thanks!
>
> Regards,
> Zhang Hao
>
Re: Border item as a container [message #72017 is a reply to message #70640] Tue, 31 October 2006 13:42 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Hao,

Border Item figures are painted outside of their parent figure. This is
not how figures usually work in GEF and there were problems with finding
the bounds of the parent figure, handling mouse events, etc. You can
think of the BorderItemContainerFigure as an invisible wrapper figure
around the main figure and the border item figures. You should not need
to worry about this figure. It works behind the scenes.

I can't think of a scenario that I know of where border items contain
compartments. There is no reason why this should not work, but if it
hasn't been done before there could be some issues. I will need to
create such an example myself to be able to assist you further. If I
have time, I will try this.

Sorry I'm not of more assistance.

- Cherie

Hao Zhang wrote:
> Hi,
> If I want my border item to hold children elements in toolbar layout,
> and the border item should get bigger as the number of children
> increases, what is the key points to deal with?
>
> BTW, I'm still rather confused by the role of BorderItemContainerFigure,
> is there any more detailed document on it except for comments in source
> code, or could you explain it here, many thanks!
>
> Regards,
> Zhang Hao
>
Re: Border item as a container [message #72408 is a reply to message #72017] Wed, 01 November 2006 06:14 Go to previous messageGo to next message
Hao Zhang is currently offline Hao ZhangFriend
Messages: 161
Registered: July 2009
Senior Member
Cherie,
Thanks for your reply, Here is my scenario:
I have Actor, Port and Gate in my ecore model, an Actor contains several
Ports and a Port can have Gates, Ports have their own attributes, and the
same to Gates.
Here Port is border item which in visual is a rectangle, Gate is kinda of
an ellipse, Actors connect each other through not Ports but Gates. So only
gates is not enough for my model.
I'm looking forward for the solution, and I'm trying to find it myself in
recent days.

Regards,
Zhang Hao

Cherie Revells wrote:

> Hao,

> Border Item figures are painted outside of their parent figure. This is
> not how figures usually work in GEF and there were problems with finding
> the bounds of the parent figure, handling mouse events, etc. You can
> think of the BorderItemContainerFigure as an invisible wrapper figure
> around the main figure and the border item figures. You should not need
> to worry about this figure. It works behind the scenes.

> I can't think of a scenario that I know of where border items contain
> compartments. There is no reason why this should not work, but if it
> hasn't been done before there could be some issues. I will need to
> create such an example myself to be able to assist you further. If I
> have time, I will try this.

> Sorry I'm not of more assistance.

> - Cherie

> Hao Zhang wrote:
>> Hi,
>> If I want my border item to hold children elements in toolbar layout,
>> and the border item should get bigger as the number of children
>> increases, what is the key points to deal with?
>>
>> BTW, I'm still rather confused by the role of BorderItemContainerFigure,
>> is there any more detailed document on it except for comments in source
>> code, or could you explain it here, many thanks!
>>
>> Regards,
>> Zhang Hao
>>
Re: Border item as a container [message #72462 is a reply to message #72408] Wed, 01 November 2006 07:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

I have a working scenario for a similar problem. In my case border items
are themselves bordered edit parts, so they can contain other border
items. I did this by hand without using the generators.

Haven't tried with a compartment, but it's easy on the surface.

On Wed, 01 Nov 2006 06:14:48 +0000, Hao Zhang wrote:

> Cherie,
> Thanks for your reply, Here is my scenario:
> I have Actor, Port and Gate in my ecore model, an Actor contains several
> Ports and a Port can have Gates, Ports have their own attributes, and the
> same to Gates.
> Here Port is border item which in visual is a rectangle, Gate is kinda of
> an ellipse, Actors connect each other through not Ports but Gates. So only
> gates is not enough for my model.
> I'm looking forward for the solution, and I'm trying to find it myself in
> recent days.
>
> Regards,
> Zhang Hao
>
> Cherie Revells wrote:
>
>> Hao,
>
>> Border Item figures are painted outside of their parent figure. This is
>> not how figures usually work in GEF and there were problems with finding
>> the bounds of the parent figure, handling mouse events, etc. You can
>> think of the BorderItemContainerFigure as an invisible wrapper figure
>> around the main figure and the border item figures. You should not need
>> to worry about this figure. It works behind the scenes.
>
>> I can't think of a scenario that I know of where border items contain
>> compartments. There is no reason why this should not work, but if it
>> hasn't been done before there could be some issues. I will need to
>> create such an example myself to be able to assist you further. If I
>> have time, I will try this.
>
>> Sorry I'm not of more assistance.
>
>> - Cherie
>
>> Hao Zhang wrote:
>>> Hi,
>>> If I want my border item to hold children elements in toolbar layout,
>>> and the border item should get bigger as the number of children
>>> increases, what is the key points to deal with?
>>>
>>> BTW, I'm still rather confused by the role of BorderItemContainerFigure,
>>> is there any more detailed document on it except for comments in source
>>> code, or could you explain it here, many thanks!
>>>
>>> Regards,
>>> Zhang Hao
>>>
Re: Border item as a container [message #74193 is a reply to message #72408] Fri, 03 November 2006 18:34 Go to previous message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Hao,

I have been modifying the Logic Diagram Example to use a shape with
compartments as a border item. It is possible to get this working, but
you will need to do some customizations.

Most likely, the first problem you will run into is that the size of
your border item figure may not be the correct size and may not get
updated. There is a bug logged against this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154536
Basically, if you are subclassing the AbstractBorderItemEditPart, then
the refreshBounds() will pass the preferred size of the border item
figure to the border item locator, but BorderItemLocator does nothing
with the size. You could write a subclass of the BorderItemLocator to
set the size of the figure or wait for the bugzilla to be fixed.

The second problem you may run into is that your compartments may not be
layed out properly. A DelegatingLayout is installed on the
BorderItemContainer figure. This DelegatingLayout will call relocate()
on the locator setup for each border item figure. It will not call a
layout on the children of the border item. You may need to handle this
yourself, probably the best place would be in the BorderItemLocator. In
other words, you will want to make your BorderItemLocator handle
locating the border item and also invalidate the figure so that all its
children will be layed out. I haven't tried this myself, just thinking
about how it would need to be done.

I hope this helps a bit. If you let us know what specific problem you
are having, maybe Vlad or I could be of further assistance.

Regards,
Cherie



Hao Zhang wrote:
> Cherie,
> Thanks for your reply, Here is my scenario:
> I have Actor, Port and Gate in my ecore model, an Actor contains several
> Ports and a Port can have Gates, Ports have their own attributes, and
> the same to Gates.
> Here Port is border item which in visual is a rectangle, Gate is kinda
> of an ellipse, Actors connect each other through not Ports but Gates. So
> only gates is not enough for my model.
> I'm looking forward for the solution, and I'm trying to find it myself
> in recent days.
>
> Regards,
> Zhang Hao
>
> Cherie Revells wrote:
>
>> Hao,
>
>> Border Item figures are painted outside of their parent figure. This
>> is not how figures usually work in GEF and there were problems with
>> finding the bounds of the parent figure, handling mouse events, etc.
>> You can think of the BorderItemContainerFigure as an invisible wrapper
>> figure around the main figure and the border item figures. You should
>> not need to worry about this figure. It works behind the scenes.
>
>> I can't think of a scenario that I know of where border items contain
>> compartments. There is no reason why this should not work, but if it
>> hasn't been done before there could be some issues. I will need to
>> create such an example myself to be able to assist you further. If I
>> have time, I will try this.
>
>> Sorry I'm not of more assistance.
>
>> - Cherie
>
>> Hao Zhang wrote:
>>> Hi,
>>> If I want my border item to hold children elements in toolbar layout,
>>> and the border item should get bigger as the number of children
>>> increases, what is the key points to deal with?
>>>
>>> BTW, I'm still rather confused by the role of
>>> BorderItemContainerFigure, is there any more detailed document on it
>>> except for comments in source code, or could you explain it here,
>>> many thanks!
>>>
>>> Regards,
>>> Zhang Hao
>>>
>
Previous Topic:GMF and RCP
Next Topic:headless usage of GMF rendering
Goto Forum:
  


Current Time: Thu Jul 18 19:31:14 GMT 2024

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

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

Back to the top