package org.csstudio.opibuilder.adl2boy.translator;

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

public class Arc2Model extends AbstractADL2Model {
	ArcModel arcModel = new ArcModel();

	public Arc2Model(ADLWidget adlWidget, RGB[] colorMap, AbstractContainerModel parentModel) {
		super(adlWidget, colorMap, parentModel);
		Arc arcWidget = new Arc(adlWidget);
		parentModel.addChild(arcModel, true);
		if (arcWidget != null) {
			setADLObjectProps(arcWidget, arcModel);
			setADLBasicAttributeProps(arcWidget, arcModel, false);
		}
		//TODO Add Dynamic Properties to Arc2Model
		//TODO Add Basic Properties to Arc2Model
		//TODO Add Begin and Path Angle to Arc2Model
	}

	@Override
	public AbstractWidgetModel getWidgetModel() {
		return arcModel;
	}

}

@@ -161,24 +161,135 @@
 idgetModel;%0A
+import org.csstudio.opibuilder.util.OPIColor;%0Aimport org.csstudio.opibuilder.widgets.model.AbstractShapeModel;%0A
 import org.c
@@ -327,24 +327,24 @@
 l.ArcModel;%0A
-
 import org.c
@@ -932,127 +932,1172 @@
 %7D%0A%09%09
-//TODO Add Dynamic Properties to Arc2Model%0A%09%09//TODO Add Basic Properties to Arc2Model%0A%09%09//TODO Add Begin and Path Angle
+arcModel.setPropertyValue(ArcModel.PROP_START_ANGLE, (float)arcWidget.get_begin()/64);%0A%09%09arcModel.setPropertyValue(ArcModel.PROP_TOTAL_ANGLE, (float)arcWidget.get_path()/64);%0A%0A%09%09//check fill parameters%0A%09%09if ( arcWidget.hasADLBasicAttribute() ) %7B%0A%09%09%09if (arcWidget.getAdlBasicAttribute().getFill().equals(%22solid%22) ) %7B%0A%09%09%09%09System.out.println(%22RECTANGLE fill is solid%22);%09%09%09%09%0A%09%09%09%09arcModel.setPropertyValue(ArcModel.PROP_FILL, true);%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%09else if (arcWidget.getAdlBasicAttribute().getFill().equals(%22outline%22)) %7B%0A%09%09%09%09OPIColor fColor = (OPIColor)arcModel.getPropertyValue(AbstractWidgetModel.PROP_COLOR_FOREGROUND);%0A%09%09%09%09arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_COLOR, fColor);%0A%09%09%09%09if ( arcWidget.getAdlBasicAttribute().getStyle().equals(%22solid%22) ) %7B%0A%09%09%09%09%09arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, %22Solid%22);%0A%09%09%09%09%7D%0A%09%09%09%09if ( arcWidget.getAdlBasicAttribute().getStyle().equals(%22dash%22) ) %7B%0A%09%09%09%09%09arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, %22Dash%22);%0A%09%09%09%09%09%0A%09%09%09%09%7D%0A%09%09%09%09arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_WIDTH, arcWidget.getAdlBasicAttribute().getWidth());%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D%0A%0A%09%09//TODO Add Dynamic Properties
  to 

Add Begin & End path Add Basic attributes (i.e. fill & line style/width)