Esempio n. 1
0
        private bool parentSelected(ChartObject obj, bool checkCycles)
        {
            // for arrows check if the objects they are linked to are selected
            if (obj.getType() == ItemType.Arrow)
            {
                Arrow arrow = (Arrow)obj;
                if (arrow.getOrgnLink().getNode().Selected)
                {
                    return(true);
                }
                if (arrow.getDestLink().getNode().Selected)
                {
                    return(true);
                }
            }

            // doesn't have parent at all
            if (!obj.isAttached())
            {
                return(false);
            }

            // has a parent, but it is not selected
            if (!obj.getContainingGroup().MainObject.Selected)
            {
                return(false);
            }

            // is the group master in a cycle
            if (!checkCycles)
            {
                if (obj.getGroupMaster() == obj)
                {
                    return(false);
                }
            }
            else
            {
                if (obj.getGroupMasterCC() == obj)
                {
                    return(false);
                }
            }

            // true in all other cases
            return(true);
        }
Esempio n. 2
0
		private bool parentSelected(ChartObject obj, bool checkCycles)
		{
			// for arrows check if the objects they are linked to are selected
			if (obj.getType() == ItemType.Arrow)
			{
				Arrow arrow = (Arrow)obj;
				if (arrow.getOrgnLink().getNode().Selected) return true;
				if (arrow.getDestLink().getNode().Selected) return true;
			}

			// doesn't have parent at all
			if (!obj.isAttached()) return false;

			// has a parent, but it is not selected
			if (!obj.getContainingGroup().MainObject.Selected)
				return false;

			// is the group master in a cycle
			if (!checkCycles)
			{
				if (obj.getGroupMaster() == obj) return false;
			}
			else
			{
				if (obj.getGroupMasterCC() == obj) return false;
			}

			// true in all other cases
			return true;
		}