Exemplo n.º 1
0
        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            Impulse imp = (Impulse)newnode;

            imp._duration = (FlexiblePropertyFloat)_duration.Clone();
            imp._delay    = (FlexiblePropertyFloat)_delay.Clone();
        }
Exemplo n.º 2
0
        //protected readonly static Brush __defaultBrushSub= new SolidBrush( Color.FromArgb(200, 104, 102) );

        /*public override void Draw(Graphics graphics, NodeViewData nvd, bool isCurrent, bool isSelected, bool isDragged, PointF graphMousePos)
         * {
         *      Brush defBrush = _defaultStyle.Background;
         *      if(_genericChildren.IsReadOnly)
         *              _defaultStyle.Background= _defaultBrushSub;
         *
         *      base.Draw(graphics, nvd, isCurrent, isSelected, isDragged, graphMousePos);
         *
         *      _defaultStyle.Background = defBrush;
         * }*/

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            Impulse imp = (Impulse)newnode;

            imp._duration = _duration;
            imp._delay    = _delay;
        }
        /// <summary>
        /// Adds nodes to the referenced behaviour which represent sub-referenced behaviours.
        /// </summary>
        /// <param name="rootBehavior">The behaviour this node belongs to. NOT the referenced one.</param>
        /// <param name="parent">The node the sub-referenced behaviours will be added to.</param>
        /// <param name="node">The current node we are checking.</param>
        protected void GenerateReferencedBehaviorsTree(BehaviorNode rootBehavior, Node parent, Node node)
        {
            // check if this is a referenced behaviour
            if (node is ReferencedBehavior)
            {
                ReferencedBehavior rbnode = (ReferencedBehavior)node;

                // create the dummy node and add it without marking the behaviour as being modified as these are no REAL nodes.
                ReferencedBehavior rb = new ReferencedBehavior(rbnode);

                parent.AddChildNotModified(parent.DefaultConnector, rb);

                // we have a circular reference here. Skip the children
                if (rbnode._referencedBehavior == rootBehavior)
                {
                    rb._genericChildren.IsReadOnly = true;
                    return;
                }

                // do the same for all the children
                foreach (Node child in node.Children)
                {
                    GenerateReferencedBehaviorsTree(rootBehavior, rb, child);
                }

                rb._genericChildren.IsReadOnly = true;
            }
            else if (node is Impulse)
            {
                // create the dummy node and add it without marking the behaviour as being modified as these are no REAL nodes.
                Impulse ip = new Impulse((Impulse)node);

                // do the same for all the children
                foreach (Node child in node.Children)
                {
                    GenerateReferencedBehaviorsTree(rootBehavior, ip, child);
                }

                if (ip.Children.Count > 0)
                {
                    parent.AddChildNotModified(parent.DefaultConnector, ip);
                    ip.GenericChildren.IsReadOnly = true;
                }
            }
            else
            {
                // do the same for all the children
                foreach (Node child in node.Children)
                {
                    GenerateReferencedBehaviorsTree(rootBehavior, parent, child);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new instance of an impulse for a sub-reference graph.
        /// </summary>
        /// <param name="impulse">The original non-sub-reference graph impulse node.</param>
        public Impulse(Impulse impulse) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, impulse.BaseLabel, false, impulse.Description)
        {
            _genericChildren = new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);

            impulse.CloneProperties(this);

            OnPropertyValueChanged(false);

            CopyEventHandlers(impulse);

#if DEBUG
            _debugIsSubreferencedGraphNode = true;
#endif
        }
Exemplo n.º 5
0
		/// <summary>
		/// Creates a new instance of an impulse for a sub-reference graph.
		/// </summary>
		/// <param name="impulse">The original non-sub-reference graph impulse node.</param>
		public Impulse(Impulse impulse) : base(null, _theBackgroundBrush, _theDraggedBackgroundBrush, impulse.BaseLabel, false, impulse.Description)
		{
			_genericChildren= new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);

			impulse.CloneProperties(this);

			OnPropertyValueChanged(false);

			CopyEventHandlers(impulse);

#if DEBUG
			_debugIsSubreferencedGraphNode= true;
#endif
		}
Exemplo n.º 6
0
        /// <summary>
        /// Creates a new instance of an impulse for a sub-reference graph.
        /// </summary>
        /// <param name="impulse">The original non-sub-reference graph impulse node.</param>
        public Impulse(Impulse impulse) : base(impulse.Label, impulse.Description)
        {
            _acceptsEvents = false;

            _genericChildren = new ConnectorMultiple(_children, string.Empty, "GenericChildren", 1, int.MaxValue);

            impulse.CloneProperties(this);

            OnPropertyValueChanged(false);

            CopyEventHandlers(impulse);

#if DEBUG
            _debugIsSubreferencedGraphNode = true;
#endif
        }
Exemplo n.º 7
0
		/// <summary>
		/// Adds nodes to the referenced behaviour which represent sub-referenced behaviours.
		/// </summary>
		/// <param name="rootBehavior">The behaviour this node belongs to. NOT the referenced one.</param>
		/// <param name="parent">The node the sub-referenced behaviours will be added to.</param>
		/// <param name="node">The current node we are checking.</param>
		protected void GenerateReferencedBehaviorsTree(BehaviorNode rootBehavior, Node parent, Node node)
		{
			// check if this is a referenced behaviour
			if(node is ReferencedBehavior)
			{
				ReferencedBehavior rbnode= (ReferencedBehavior)node;

				// create the dummy node and add it without marking the behaviour as being modified as these are no REAL nodes.
				ReferencedBehavior rb= new ReferencedBehavior(rbnode);

				parent.AddChildNotModified(parent.DefaultConnector, rb);

				// we have a circular reference here. Skip the children
				if(rbnode._referencedBehavior ==rootBehavior)
				{
					rb._genericChildren.IsReadOnly= true;
					return;
				}

				// do the same for all the children
				foreach(Node child in node.Children)
					GenerateReferencedBehaviorsTree(rootBehavior, rb, child);

				rb._genericChildren.IsReadOnly= true;
			}
			else if(node is Impulse)
			{
				// create the dummy node and add it without marking the behaviour as being modified as these are no REAL nodes.
				Impulse ip= new Impulse( (Impulse)node );

				// do the same for all the children
				foreach(Node child in node.Children)
					GenerateReferencedBehaviorsTree(rootBehavior, ip, child);

				if(ip.Children.Count >0)
				{
					parent.AddChildNotModified(parent.DefaultConnector, ip);
					ip.GenericChildren.IsReadOnly= true;
				}
			}
			else
			{
				// do the same for all the children
				foreach(Node child in node.Children)
					GenerateReferencedBehaviorsTree(rootBehavior, parent, child);
			}
		}