package org.csstudio.opibuilder.adl2boy.translator;

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

public class Meter2Model extends AbstractADL2Model {
	XMeterModel meterModel = new XMeterModel();

	public Meter2Model(ADLWidget adlWidget, RGB[] colorMap, AbstractContainerModel parentModel) {
		super(adlWidget, colorMap, parentModel);
		parentModel.addChild(meterModel, true);
		Meter meterWidget = new Meter(adlWidget);
		if (meterWidget != null) {
			setADLObjectProps(meterWidget, meterModel);
			setADLMonitorProps(meterWidget, meterModel);
		}
		//TODO Add PV Limits to Meter2Model
		//TODO Add Label to Meter2Model
		//TODO Add color mode to Meter2Model
	}

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

}

@@ -161,24 +161,88 @@
 idgetModel;%0A
+import org.csstudio.opibuilder.widgets.model.ActionButtonModel;%0A
 import org.c
@@ -899,16 +899,595 @@
 el);%0A%09%09%7D
+%0A%0A%09%09//set color mode%0A%09%09String color_mode = meterWidget.getColor_mode();%0A%09%09System.out.println(%22Meter Color mode %22 + color_mode);%0A%09%09if ( color_mode.equals(%22static%22) )%7B%0A%09%09%09meterModel.setPropertyValue(XMeterModel.PROP_FORECOLOR_ALARMSENSITIVE, false);%0A%09%09%7D%0A%09%09else if (color_mode.equals(%22alarm%22) )%7B%0A%09%09%09meterModel.setPropertyValue(XMeterModel.PROP_FORECOLOR_ALARMSENSITIVE, true);%0A%09%09%7D%0A%09%09else if (color_mode.equals(%22discrete%22) )%7B%0A%09%09%09meterModel.setPropertyValue(XMeterModel.PROP_FORECOLOR_ALARMSENSITIVE, false);%0A%09%09%09//TODO Meter2Model Figure out what to do if colorMode is discrete%0A%09%09%7D%0A%09%09
 %0A%09%09//TOD
@@ -1555,47 +1555,8 @@
 del%0A
-%09%09//TODO Add color mode to Meter2Model%0A
 %09%7D%0A%0A

Add color mode