Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to know the position of an element which placed on the edge of a parent element?(How to know the position of an element placed on the edge of a parent element?)
How to know the position of an element which placed on the edge of a parent element? [message #664508] Sun, 10 April 2011 10:02
Rahma  is currently offline Rahma Friend
Messages: 7
Registered: February 2011
Junior Member
Hi everyone,

I have a DataPort (having the property Affixed Parent Side is NSEW) which placed on the edge of an other element called "systemFeatures" . I want to know the current position of the DataPort, what is the method allows to know the current position of the DataPort?

In the DataPortEditPart, I find the Method in which I try to call my method setPosition that have a parameter represent the current position of the DataPort:

protected void addBorderItem(IFigure borderItemContainer,
IBorderItemEditPart borderItemEditPart) {
if (borderItemEditPart instanceof DataPortNameEditPart) {
BorderItemLocator locator = new
BorderItemLocator(getMainFigure(),
PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-20, -20));
borderItemContainer.add(borderItemEditPart.getFigure(), locator);
// I call the method setPosition of ModelerPortFigure
((DataPortFigure) primaryShape).setPosition(locator.getCurrentSideOfParent());
} else {

super.addBorderItem(borderItemContainer, borderItemEditPart);

}
}


I try to use locator.getCurrentSideOfParent() but it isn't work

Thanks in advance.
Previous Topic:How to get notation by domain model element?
Next Topic:Connections and Expression Labels
Goto Forum:
  


Current Time: Tue Nov 25 02:08:23 GMT 2014

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

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