Example #1
0
        internal virtual void onDelete()
        {
            if (mainObj != null)
            {
                mainObj.setGroup(null);
            }
            mainObj = null;

            foreach (Attachment attc in attachments)
            {
                attc.node.putInGroup(null);
            }
            attachments.Clear();

            attachedObjects.Clear();
        }
Example #2
0
        internal void destroySelf(bool redo)
        {
            flowChart.fireGroupDestroyed(this);

            // let the master object know that it no longer has a subordinate group
            if (mainObj != null)
            {
                mainObj.setGroup(null);
            }
            mainObj = null;

            // if called for redo, there are already GroupDetachCmd
            // commands attached to this one, so do not create them again
            if (!redo)
            {
                ChartObjectCollection delItems = autoDeleteItems ?
                                                 attachedObjects.Clone() : null;

                // GroupDetachCmd always removes an attachment from
                // the array, so that cycle will end for sure
                while (attachments.Count > 0)
                {
                    GroupDetachCmd cmd = new GroupDetachCmd(
                        this, (Attachment)attachments[attachments.Count - 1]);
                    cmd.Execute();
                }

                // if autoDeleteItems is enabled, delete all subordinate items
                if (delItems != null)
                {
                    foreach (ChartObject item in delItems)
                    {
                        flowChart.deleteItem(item);
                    }
                    delItems.Clear();
                    delItems = null;
                }
            }

            // remove from flowchart's list of groups
            flowChart.deleteGroup(this);
        }
Example #3
0
        internal override void completeCreate(PointF end)
        {
            base.completeCreate(end);

            clear();

            ChartObjectCollection newSel = new ChartObjectCollection();

            flowChart.getIntersectingObjects(rect,
                                             newSel, allowMultiSel, includeItemsIfIntersect);
            foreach (ChartObject obj in newSel)
            {
                addObjToSelection(obj);
            }
            newSel.Clear();

            if (selectedItems.Count == 0)
            {
                if (flowChart.ActiveObject != null)
                {
                    flowChart.fireDeactivationEvent();
                }
                flowChart.ActiveObject = null;
            }
            else if (flowChart.ActiveObject == null ||
                     !flowChart.ActiveObject.Selected)
            {
                if (flowChart.ActiveObject != null)
                {
                    flowChart.fireDeactivationEvent();
                }
                flowChart.ActiveObject = selectedItems[0];
                flowChart.fireActivationEvent();
            }

            flowChart.fireSelectionChanged();

            recalcRect();
        }
Example #4
0
		internal override void completeCreate(PointF end)
		{
			base.completeCreate(end);

			clear();

			ChartObjectCollection newSel = new ChartObjectCollection();
			flowChart.getIntersectingObjects(rect,
				newSel, allowMultiSel, includeItemsIfIntersect);
			foreach (ChartObject obj in newSel)
				addObjToSelection(obj);
			newSel.Clear();

			if (selectedItems.Count == 0)
			{
				if (flowChart.ActiveObject != null)
					flowChart.fireDeactivationEvent();
				flowChart.ActiveObject = null;
			}
			else if (flowChart.ActiveObject == null ||
				!flowChart.ActiveObject.Selected)
			{
				if (flowChart.ActiveObject != null)
					flowChart.fireDeactivationEvent();
				flowChart.ActiveObject = selectedItems[0];
				flowChart.fireActivationEvent();
			}

			flowChart.fireSelectionChanged();

			recalcRect();
		}