[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: docking feature? (may be with bordered Items or ports?)

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(childEditPart.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!