<commit_before>package org.csstudio.opibuilder.adl2boy.translator;

import org.csstudio.opibuilder.model.AbstractContainerModel;
import org.csstudio.opibuilder.model.AbstractWidgetModel;
import org.csstudio.opibuilder.util.OPIColor;
import org.csstudio.opibuilder.widgets.model.AbstractShapeModel;
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);
		}
		arcModel.setPropertyValue(ArcModel.PROP_START_ANGLE, (float)arcWidget.get_begin()/64);
		arcModel.setPropertyValue(ArcModel.PROP_TOTAL_ANGLE, (float)arcWidget.get_path()/64);

		//check fill parameters
		if ( arcWidget.hasADLBasicAttribute() ) {
			if (arcWidget.getAdlBasicAttribute().getFill().equals("solid") ) {
				System.out.println("RECTANGLE fill is solid");				
				arcModel.setPropertyValue(ArcModel.PROP_FILL, true);
				
			}
			else if (arcWidget.getAdlBasicAttribute().getFill().equals("outline")) {
				OPIColor fColor = (OPIColor)arcModel.getPropertyValue(AbstractWidgetModel.PROP_COLOR_FOREGROUND);
				arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_COLOR, fColor);
				if ( arcWidget.getAdlBasicAttribute().getStyle().equals("solid") ) {
					arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, "Solid");
				}
				if ( arcWidget.getAdlBasicAttribute().getStyle().equals("dash") ) {
					arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, "Dash");
					
				}
				arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_WIDTH, arcWidget.getAdlBasicAttribute().getWidth());
			}
			
		}

		//TODO Add Dynamic Properties to Arc2Model<commit_msg>Add dynamic properties.  Remove TODO for dynamic properties.<commit_after>package org.csstudio.opibuilder.adl2boy.translator;

import org.csstudio.opibuilder.model.AbstractContainerModel;
import org.csstudio.opibuilder.model.AbstractWidgetModel;
import org.csstudio.opibuilder.util.OPIColor;
import org.csstudio.opibuilder.widgets.model.AbstractShapeModel;
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);
			setADLDynamicAttributeProps(arcWidget, arcModel);
		}
		arcModel.setPropertyValue(ArcModel.PROP_START_ANGLE, (float)arcWidget.get_begin()/64);
		arcModel.setPropertyValue(ArcModel.PROP_TOTAL_ANGLE, (float)arcWidget.get_path()/64);

		//check fill parameters
		if ( arcWidget.hasADLBasicAttribute() ) {
			if (arcWidget.getAdlBasicAttribute().getFill().equals("solid") ) {
				System.out.println("RECTANGLE fill is solid");				
				arcModel.setPropertyValue(ArcModel.PROP_FILL, true);
				
			}
			else if (arcWidget.getAdlBasicAttribute().getFill().equals("outline")) {
				OPIColor fColor = (OPIColor)arcModel.getPropertyValue(AbstractWidgetModel.PROP_COLOR_FOREGROUND);
				arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_COLOR, fColor);
				if ( arcWidget.getAdlBasicAttribute().getStyle().equals("solid") ) {
					arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, "Solid");
				}
				if ( arcWidget.getAdlBasicAttribute().getStyle().equals("dash") ) {
					arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_STYLE, "Dash");
					
				}
				arcModel.setPropertyValue(AbstractShapeModel.PROP_LINE_WIDTH, arcWidget.getAdlBasicAttribute().getWidth());
			}
			
		}

{'fraction_non_alphanumeric': 0.11354719593814909, 'fraction_numerical': 0.003923378721440111, 'mean_word_length': 5.901273885350318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1122585', 'n_tokens_mistral': 1557, 'n_tokens_neox': 1393, 'n_words': 186}