<?xml version="1.0" encoding="UTF-8"?>
<rmml>
<!--
$RCSfile: rnmc_labwork_dragging.xml,v $
$Revision: 745 $

last change: $Date: 2008-09-15 14:44:27 +0400 (Пн, 15 сен 2008) $
             $Author: toha $

	Lacerta Project
	version 1.0.0.1
	Copyright (C) 2008 RNMC
-->

<composition name="rnmc_labwork_dragging" class="rnmc_labwork_base">
<script><![CDATA[
//	РЕЖИМ РАБОТЫ ШАБЛОНА
	//	Обычное Перетаксивание
	this.type = "RNMC_LABWORK_DRAGGING";
	//	Классификация
	//this.type = "RNMC_LABWORK_CLASSIFICATION";

	function loadStep(srcNode){
		var dragObject = new Composition();
		dragObject._class = "rnmc_stdDragging";
		dragObject.parent = this;

		if(this.type == "RNMC_LABWORK_DRAGGING")
			dragObject.type = "rnmc_Dragging";
		else if(this.type == "RNMC_LABWORK_CLASSIFICATION")
			dragObject.type = "rnmc_Classification";

		if(!dragObject.initFromNode(srcNode))
			return false;

		dragObject.visibility = OBJECT_VISIBILITY_TRUE;

		this.childObjects = new Array();
		this.childObjects.push(dragObject);

		rnmc_labwork_base_loadStep(srcNode);

		var xmlNode = null;
		var xmlAttributeMap = null;
		var xmlAttribute = null;

		xmlNode = srcNode.firstChild;
		while(xmlNode){
			if(xmlNode.nodeName == "settings"){
			// разбор стандартных настроек
				this.parseSettingsNode(xmlNode);
			} else if(xmlNode.nodeName == "actions"){
				this.parseActionsNode(xmlNode);
			} else if(xmlNode.nodeName == "conditions"){
				var conditionNode = xmlNode.firstChild;
				while(conditionNode){
					if(conditionNode.nodeName == "condition"){
						this.parseConditionNode(conditionNode);
					}
					conditionNode = conditionNode.nextSibling;
				}
				this.parseConditionNode(xmlNode);
			}

			xmlNode = xmlNode.nextSibling;
		}

		return true;
	}

	function doAction(singleAction){
		switch (singleAction[0]) {
			case "setProperty":
			case "goToStep":
			case "goToStepWithId":
			case "goPreviousStep":
			case "goNextStep":
			case "goFirstStep":
			case "goLastStep":
			case "goToSummary":
				rnmc_labwork_base_doAction(singleAction);
				break;
				
			default:
				if (this.childObjects && this.childObjects.length > 0)
					this.childObjects[0].doAction(singleAction);
				break;
		}
	}
]]></script>
</composition>
</rmml>
