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

finished af3.component model element factory

refs 214
parent 71f65789
No related branches found
No related tags found
No related merge requests found
......@@ -210,22 +210,6 @@ public class LayoutDataUtils {
return getConnectorAngle(lobject).getAngle();
}
/** Creates a new connector layout. */
public static void createConnectorLayout(ILayoutedModelElement lo) {
setNodePosition(lo, 0, 0);
setNodeSize(lo, DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH,
DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT);
Point cpos = LayoutModelElementFactory.createPoint(0, 0,
LayoutKeyConstants.CONNECTOR_POSITION);
Dimension cdim = LayoutModelElementFactory.createDimension(0, 0,
LayoutKeyConstants.CONNECTOR_DIMENSION);
lo.getLayoutDataList().add(cpos);
lo.getLayoutDataList().add(cdim);
}
/** Return the absolute position for a given offset, orientation and insets. */
public static Point getAbsolute(OffsetOrientation oo, Dimension parentSize,
int parentInsets) {
......
......@@ -17,6 +17,7 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.utils;
import org.fortiss.tooling.base.layout.DefaultLayoutConstants;
import org.fortiss.tooling.base.layout.LayoutKeyConstants;
import org.fortiss.tooling.base.model.layout.Angle;
import org.fortiss.tooling.base.model.layout.Dimension;
......@@ -36,6 +37,24 @@ import org.fortiss.tooling.base.model.layout.Points;
* @ConQAT.Rating YELLOW Hash: F89151582818B77DAA804D5042AF68F7
*/
public final class LayoutModelElementFactory {
/** Creates a connector layout. */
public static void createConnectorLayout(ILayoutedModelElement lo) {
PointUtils.setPoint(lo, LayoutKeyConstants.NODE_POSITION, 0, 0);
DimensionUtils.setDimension(lo, LayoutKeyConstants.NODE_DIMENSION,
DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH,
DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT);
Point cpos = LayoutModelElementFactory.createPoint(0, 0,
LayoutKeyConstants.CONNECTOR_POSITION);
Dimension cdim = LayoutModelElementFactory.createDimension(0, 0,
LayoutKeyConstants.CONNECTOR_DIMENSION);
lo.getLayoutDataList().add(cpos);
lo.getLayoutDataList().add(cdim);
}
/** Creates a new connection layout. */
public static void createConnectionLayout(ILayoutedModelElement lo) {
Points points = LayoutModelElementFactory
......
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