Skip to content
Snippets Groups Projects
Commit d0a9b2b8 authored by Johannes Eder's avatar Johannes Eder
Browse files

layout

parent 4a5b5576
No related branches found
No related tags found
No related merge requests found
......@@ -17,14 +17,17 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.prototype;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_HEIGHT;
import static org.fortiss.tooling.base.layout.DefaultLayoutConstants.DEFAULT_SHAPE_MINIMUM_WIDTH;
import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.setConnectorPosition;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodeBounds;
import static org.fortiss.tooling.base.utils.LayoutDataUtils.setNodePosition;
import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createRectangle;
import org.fortiss.af3.platform.raspberry.model.CanBus;
import org.fortiss.af3.platform.raspberry.model.CanConnector;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.af3.platform.raspberry.util.RaspberryModelElementFactory;
import org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils;
import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
/**
......@@ -43,11 +46,11 @@ public class ProtoypeProvider extends PrototypeProviderBase {
@Override
protected void registerPrototypes() {
RaspberryPi pi = RaspberryModelElementFactory.createRaspberryPi();
LayoutDataUIUtils.setConnectorPosition(pi, 0, 0);
registerPrimaryPrototype("RaspberryPi", pi, CATEGORY_NAME);
CanBus bus = RaspberryModelElementFactory.createCanBus();
LayoutDataUIUtils.setConnectorPosition(bus, 0, 0);
setNodeBounds(bus,
createRectangle(0, 0, DEFAULT_SHAPE_MINIMUM_WIDTH, DEFAULT_SHAPE_MINIMUM_HEIGHT));
registerPrototype("CanBus", bus, CATEGORY_NAME);
CanConnector con = RaspberryModelElementFactory.createCanConnector();
......
......@@ -23,6 +23,7 @@ import org.fortiss.af3.platform.raspberry.model.CanBus;
import org.fortiss.af3.platform.raspberry.model.CanConnector;
import org.fortiss.af3.platform.raspberry.model.ModelFactory;
import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
/**
* Model Element for RaspberryPi and related models.
......@@ -37,6 +38,7 @@ public class RaspberryModelElementFactory {
/** Creates a {@link RaspberryPi}. */
public static RaspberryPi createRaspberryPi() {
final RaspberryPi pi = ModelFactory.eINSTANCE.createRaspberryPi();
LayoutModelElementFactory.createNodeElementLayout(pi);
pi.setName("RaspberryPI");
return pi;
}
......@@ -44,6 +46,7 @@ public class RaspberryModelElementFactory {
/** Creates a {@link CanBus}. */
public static CanBus createCanBus() {
final CanBus bus = ModelFactory.eINSTANCE.createCanBus();
LayoutModelElementFactory.createNodeElementLayout(bus);
bus.setName("CanBus");
return bus;
}
......
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