Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » docking feature? (may be with bordered Items or ports?)
docking feature? (may be with bordered Items or ports?) [message #219177] Wed, 18 February 2009 15:15 Go to next message
Michael Buske is currently offline Michael BuskeFriend
Messages: 2
Registered: July 2009
Junior Member
Hallo everyone,

I am a german student developing a gmf-prototyp for an mashup-concept.

What I want to realize:
______[Action1]__
| |
| Widget_A |
|_________________|
[Action2]
^
|
|
______[Event1]__
| |
| Widget_B |
|_________________|
[Action3]

I habe several widgets(normal boxes may be with a picture)
These widgets "own" actions and events. When I choose one of them over the
context-menu (allready established :-) ) a docked, labeled box should
appear.
This docked box has to be hanging on the widget (moving with it).

How can I achieve these "docking boxes" ???

I habe heard a lot about "bordered Items" and "ports". I have tryed to
realize them with the border-layout, but I even could not get an simple
border-layout working. Are they made by "gmf-modeling" or only by coding ?

May be there are some more detailed diskriptions with model-examples in
the web? or some tutorials?

Any help greatly appreciated!!!
Thanks!
Re: docking feature? (may be with bordered Items or ports?) [message #219245 is a reply to message #219177] Thu, 19 February 2009 08:54 Go to previous message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hi Michael,

this is very simple (but not very well documented): In the GMF-Map,
define these ports as child elements to the Widget, but do not assign a
compartment. As a result, the ports will be positioned like external
labels, i.e. movable around the parent figure. I do not know how to
assign them a fixed positon and how to make them not moveable, but I'm
sure you'll figure this out. Some settings can be done in the parent
edit part's addFixedChild method, e.g. [1] for setting the prefferred
positon and for moving the ports a bit inwards of the figure,
overlapping its border. Further, these is (or was?) a bug when deleting
one of the ports, resulting in multiple visual elements being removed.
to fix this, add this [2] to the parent edit part.

Hope this helps,
Tobias

[1]
BorderItemLocator locator = new
BorderItemLocator(getMainFigure(),PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(20, 20));
getBorderedFigure().getBorderItemContainer().add(childEditPa rt.getFigure(),locator);

[2]
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
if (notification.getEventType() == Notification.REMOVE) {
handleMajorSemanticChange();
}
}



Michael Buske schrieb:
> Hallo everyone,
>
> I am a german student developing a gmf-prototyp for an mashup-concept.
>
> What I want to realize:
> ______[Action1]__
> | |
> | Widget_A |
> |_________________|
> [Action2]
> ^
> |
> |
> ______[Event1]__
> | |
> | Widget_B |
> |_________________|
> [Action3]
>
> I habe several widgets(normal boxes may be with a picture)
> These widgets "own" actions and events. When I choose one of them over
> the context-menu (allready established :-) ) a docked, labeled box
> should appear. This docked box has to be hanging on the widget (moving
> with it).
>
> How can I achieve these "docking boxes" ???
>
> I habe heard a lot about "bordered Items" and "ports". I have tryed to
> realize them with the border-layout, but I even could not get an simple
> border-layout working. Are they made by "gmf-modeling" or only by coding ?
>
> May be there are some more detailed diskriptions with model-examples in
> the web? or some tutorials?
> Any help greatly appreciated!!!
> Thanks!
>
>
Previous Topic:Diagram Partitioning - OpenDiagramBehavior of Gen Link doesn't work
Next Topic:GMF Book
Goto Forum:
  


Current Time: Sat Apr 20 01:13:52 GMT 2024

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

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

Back to the top