/// <summary>
        ///
        /// Code for left click selection on joints (toggle structure, foil, motors at joints)
        /// and joint handles for connections (assembly process)
        ///
        /// </summary>
        /// <param name="selected"></param>
        private string leftClickSelected(GameObject selected)
        {
            string typeAction = "NoEvent";

            // check for left click on joint handle
            if (selected.name.StartsWith(JOINT))
            {
                JointInfo.UAVComponentType componentType = JointInfo.getNextComponentType(jointGraph[selected].componentType);
                changeJointToComponent(selected, componentType);
            }
            // check for left click on assembly handle
            else if (selected.name.Equals(POSITIVEZ) ||
                     selected.name.Equals(NEGATIVEZ) ||
                     selected.name.Equals(POSITIVEX) ||
                     selected.name.Equals(NEGATIVEX))
            {
                typeAction = addConnectorAtHandle(selected);
            }

            return(typeAction);
        }
        /// <summary>
        ///
        /// Changes the component at a joint to a specific type
        ///
        /// </summary>
        /// <param name="joint">Unity game object of a joint</param>
        /// <param name="compType">component type</param>
        private string changeJointToComponent(GameObject joint, JointInfo.UAVComponentType compType)
        {
            string typeAction = "";

            // get previous size
            int previousSize = jointGraph[joint].sizedata;

            jointGraph[joint].sizedata = 0;

            // remove component at the joint
            if (jointGraph[joint].gameObj != null)
            {
                Destroy(jointGraph[joint].gameObj);
            }

            // get new position
            Vector3 pos    = joint.transform.position;
            Vector3 newPos = new Vector3(pos.x, pos.y, pos.z);


            // add component at the joint position
            // steps : clone the gameobject in unity, rotate if needed, and update the jointgraph object
            if (compType.Equals(JointInfo.UAVComponentType.Structure))
            {
                GameObject pickedObject = GameObject.Find(STRUCTURE);
                GameObject childObject  = Instantiate(pickedObject.gameObject, newPos, Quaternion.identity) as GameObject;
                childObject.transform.Rotate(new Vector3(0, 1, 0), 45f);
                childObject.tag                 = VEHICLECOMPONENT;
                jointGraph[joint].gameObj       = childObject;
                jointGraph[joint].componentType = JointInfo.UAVComponentType.Structure;
                sizeComponent(joint, previousSize);
                jointGraph[joint].setTextLabel();
                typeAction = "ToggleStructure";
            }
            else if (compType.Equals(JointInfo.UAVComponentType.MotorCCW))
            {
                GameObject pickedObject = GameObject.Find(MOTORCCW);
                GameObject childObject  = Instantiate(pickedObject.gameObject, newPos, Quaternion.identity) as GameObject;
                childObject.tag                 = VEHICLECOMPONENT;
                jointGraph[joint].gameObj       = childObject;
                jointGraph[joint].componentType = JointInfo.UAVComponentType.MotorCCW;
                sizeComponent(joint, previousSize);
                jointGraph[joint].setTextLabel();
                typeAction = "ToggleCCWMotor";
            }
            else if (compType.Equals(JointInfo.UAVComponentType.MotorCW))
            {
                GameObject pickedObject = GameObject.Find(MOTORCW);
                GameObject childObject  = Instantiate(pickedObject.gameObject, newPos, Quaternion.identity) as GameObject;
                childObject.tag                 = VEHICLECOMPONENT;
                jointGraph[joint].gameObj       = childObject;
                jointGraph[joint].componentType = JointInfo.UAVComponentType.MotorCW;
                sizeComponent(joint, previousSize);
                jointGraph[joint].setTextLabel();
                typeAction = "ToggleCWMotor";
            }
            else if (compType.Equals(JointInfo.UAVComponentType.Foil))
            {
                GameObject pickedObject = GameObject.Find(FOIL);
                GameObject childObject  = Instantiate(pickedObject.gameObject, newPos, Quaternion.identity) as GameObject;
                childObject.transform.Rotate(new Vector3(0, 1, 0), 45);
                childObject.transform.Rotate(new Vector3(1, 0, 0), -10);
                childObject.tag                 = VEHICLECOMPONENT;
                jointGraph[joint].gameObj       = childObject;
                jointGraph[joint].componentType = JointInfo.UAVComponentType.Foil;
                sizeComponent(joint, previousSize);
                jointGraph[joint].setTextLabel();
                typeAction = "ToggleFoil";
            }
            else if (compType.Equals(JointInfo.UAVComponentType.None))
            {
                jointGraph[joint].gameObj       = null;
                jointGraph[joint].componentType = JointInfo.UAVComponentType.None;
                jointGraph[joint].sizedata      = previousSize;
                jointGraph[joint].setTextLabel();
                typeAction = "ToggleEmpty";
            }

            return(typeAction);
        }