package org.csstudio.opibuilder.adl2boy.translator;

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

public class Display2Model extends AbstractADL2Model {
	DisplayModel displayModel = new DisplayModel();
	
	public Display2Model(ADLWidget adlWidget, RGB[] colorMap, AbstractContainerModel parentModel) {
		super(adlWidget, colorMap, parentModel);
		ADLDisplay adlDisp = new ADLDisplay(adlWidget);
		int displayForeColor = 0;
		int displayBackColor = 0;
	
		if (adlDisp !=null){
			setADLObjectProps(adlDisp, displayModel);
			setADLBasicAttributeProps(adlDisp, displayModel, false);
			displayForeColor = Integer.parseInt(adlDisp.get_clr());
			displayBackColor = Integer.parseInt(adlDisp.get_bclr());
			displayModel.setBackgroundColor(colorMap[displayBackColor]);
			displayModel.setForegroundColor(colorMap[displayForeColor]);
			
		}
		
	}

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

}

@@ -1120,16 +1120,488 @@
 %09%09%09%0A%09%09%7D%0A
+%09%09if ( adlDisp.is_gridOn())%7B%0A%09%09%09displayModel.setPropertyValue(DisplayModel.PROP_SHOW_GRID, true);%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09displayModel.setPropertyValue(DisplayModel.PROP_SHOW_GRID, false);%0A%09%09%7D%0A%09%09if ( adlDisp.is_snapToGrid())%7B%0A%09%09%09displayModel.setPropertyValue(DisplayModel.PROP_SNAP_GEOMETRY, true);%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09displayModel.setPropertyValue(DisplayModel.PROP_SNAP_GEOMETRY, false);%0A%09%09%7D%0A%09%09displayModel.setPropertyValue(DisplayModel.PROP_GRID_SPACE, adlDisp.get_gridSpacing());%0A
 %09%09%0A%09%7D%0A%0A%09

Add gridOn, snapToGrid and gridSpace