Skip to content
Snippets Groups Projects
Commit 32f39c68 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

YELLOW

refs 311
parent 87fed4ba
No related branches found
No related tags found
No related merge requests found
......@@ -51,8 +51,10 @@ import org.eclipse.gef.EditPart;
import org.fortiss.tooling.base.layout.LayoutKeyConstants;
import org.fortiss.tooling.base.model.layout.Angle;
import org.fortiss.tooling.base.model.layout.Dimension;
import org.fortiss.tooling.base.model.layout.EOrientation;
import org.fortiss.tooling.base.model.layout.ILayoutData;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.model.layout.LayoutFactory;
import org.fortiss.tooling.base.model.layout.Offset;
import org.fortiss.tooling.base.model.layout.OffsetOrientation;
import org.fortiss.tooling.base.model.layout.Point;
......@@ -75,10 +77,29 @@ import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
* @author hummel
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: BA085FEB69C66332C246D33F24D7D240
* @ConQAT.Rating YELLOW Hash: 777A0B24A644B59F3A954FA349436062
*/
public class LayoutDataUtils {
/** Sets node layout. */
public static void setNodeLayoutData(ILayoutedModelElement layouted,
int xPos, int yPos, int width, int height) {
setNodeBounds(layouted, new Rectangle(xPos, yPos, width, height));
}
/** Sets free port layout data. */
public static void setNodeLayoutData(ILayoutedModelElement layouted,
int xPos, int yPos) {
setNodePosition(layouted, xPos, yPos);
}
/** Sets sticky connector layout data. */
public static void setStickyConnectorLayoutData(
ILayoutedModelElement layouted, EOrientation orientation, int offset) {
setOffsetOrientation(layouted, CONNECTOR_OFFSET_ORIENTATION, offset,
orientation);
}
/** Returns the bounds rectangle of the given layouted element. */
public static Rectangle getNodeBounds(ILayoutedModelElement layouted) {
Rectangle result = new Rectangle();
......@@ -331,6 +352,27 @@ public class LayoutDataUtils {
}
}
/**
* Adds a {@link org.eclipse.draw2d.Bendpoint Bendpoint} defined by the x,y
* parameters to a channel
*
* @param conn
* the connection
* @param bendPointX
* the x coordinate of the Bendpoint
* @param bendPointY
* the y coordinate of the Bendpoint
*/
public static void addBendPointToConnection(ILayoutedModelElement conn,
int bendPointX, int bendPointY) {
// set middle point of transition
Point bendPoint = LayoutFactory.eINSTANCE.createPoint();
bendPoint.setX(bendPointX);
bendPoint.setY(bendPointY);
getConnectionPoints(conn).getPointsList().add(bendPoint);
}
/** Move bend points of self-connections, if theirs parent is resized */
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void bendpointGroupResize(ILayoutedModelElement layouted,
......
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