Skip to content
Snippets Groups Projects
Commit fda28685 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

code improvements to accomodate MSC editors

refs 693
parent 0548d988
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ import org.fortiss.tooling.base.ui.utils.LayoutDataUtils;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: D47CAC361395764DABE025B37FFBF163
* @ConQAT.Rating YELLOW Hash: 23C911F8A8FC42CEF3B3271ED0277B6F
*/
public class RectangleGridLayoutDiagramConfiguration extends
DiagramLayoutConfigurationBase {
......@@ -102,8 +102,7 @@ public class RectangleGridLayoutDiagramConfiguration extends
StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart,
IFigure connectorFigure) {
// get the bounds of the parent
Rectangle containerBounds = getNodeBounds(connectorEditPart
.getParentEditPart().getModel());
Rectangle containerBounds = getContainerBounds(connectorEditPart);
// get the child position relative to the parent
Point childPos = connectorFigure.getBounds().getLocation()
.getTranslated(containerBounds.getLocation().getNegated());
......@@ -141,6 +140,15 @@ public class RectangleGridLayoutDiagramConfiguration extends
request.setMoveDelta(relativePos);
}
/**
* Returns the bounds of the container figure on the edges of which the
* connector will be sticked.
*/
protected Rectangle getContainerBounds(
StickyConnectorEditPartBase<? extends ILayoutedModelElement> connectorEditPart) {
return getNodeBounds(connectorEditPart.getParentEditPart().getModel());
}
/** {@inheritDoc} */
@Override
public void alterElementMoveAndResizeFeedbackRequest(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment