package org.csstudio.opibuilder.adl2boy.translator;

import org.csstudio.opibuilder.model.AbstractWidgetModel;
import org.csstudio.utility.adlparser.fileParser.ADLWidget;
import org.eclipse.swt.graphics.RGB;

public class Composite2Model extends AbstractADL2Model {

	public Composite2Model(ADLWidget adlWidget, RGB[] colorMap) {
		super(adlWidget, colorMap);
		// TODO Auto-generated constructor stub
	}

	@Override
	public	AbstractWidgetModel getWidgetModel() {
		// TODO Auto-generated method stub
		return null;
	}

}

@@ -95,79 +95,402 @@
 ract
-WidgetModel;%0Aimport org.csstudio.utility.adlparser.fileParser.ADLWidget
+ContainerModel;%0Aimport org.csstudio.opibuilder.model.AbstractWidgetModel;%0Aimport org.csstudio.opibuilder.widgets.model.GroupingContainerModel;%0Aimport org.csstudio.opibuilder.widgets.model.LabelModel;%0Aimport org.csstudio.opibuilder.widgets.model.LinkingContainerModel;%0Aimport org.csstudio.utility.adlparser.fileParser.ADLWidget;%0Aimport org.csstudio.utility.adlparser.fileParser.widgets.Composite
 ;%0Aim
@@ -581,16 +581,56 @@
 2Model %7B
+%0A%09AbstractContainerModel containerModel;
 %0A%0A%09publi
@@ -722,164 +722,1107 @@
 ;%0A%09%09
-// TODO Auto-generated constructor stub%0A%09%7D%0A%0A%09@Override%0A%09public%09AbstractWidgetModel getWidgetModel() %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09return null
+Composite compositeWidget = new Composite(adlWidget);%0A%09%09if (!compositeWidget.hasCompositeFile()) %7B%0A%09%09%09containerModel = new LinkingContainerModel();%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09containerModel = new GroupingContainerModel();%0A%09%09%09if (compositeWidget != null) %7B%0A%09%09%09%09setADLObjectProps(compositeWidget, containerModel);%0A%09%09%09%7D%0A%09%09%09TranslatorUtils.ConvertChildren(compositeWidget.getChildren(), containerModel, colorMap);%0A%09%09%09((GroupingContainerModel)(containerModel)).setPropertyValue(GroupingContainerModel.PROP_SHOW_SCROLLBAR, false);%0A%09%09%09FixChildPositions();%0A%09%09%7D%0A%09%09if (compositeWidget != null) %7B%0A%09%09%09setADLObjectProps(compositeWidget, containerModel);%0A%09%09%09if (compositeWidget != null) %7B%0A%09%09%09%09setADLObjectProps(compositeWidget, containerModel);%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%7D%0A%0A%09@Override%0A%09public%09AbstractWidgetModel getWidgetModel() %7B%0A%09%09return containerModel;%0A%09%7D%0A%0A%09private void FixChildPositions() %7B%0A%09%09int compositeX = containerModel.getX();%0A%09%09int compositeY = containerModel.getY();%0A%09%09%0A%09%09for (AbstractWidgetModel model : containerModel.getChildren())%7B%0A%09%09%09model.setX(model.getX() - compositeX);%0A%09%09%09model.setY(model.getY() - compositeY)
 ;%0A
+%09
 %09%7D%0A
+%09%7D
 %0A%7D%0A

Add the first round of handling code.