Esempio n. 1
0
        public override void OnConnectDeleteOutput(Shadow shadow)
        {
            base.OnConnectDeleteOutput(shadow);
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string data = table.GetData(r, (int)TableColumns.Transitions.Goto);
                string uid  = shadow.GetUniqueId();

                if (data.Equals(uid))
                {
                    // cleanup the connector label
                    ConnectorShadow connectorShadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                    if (connectorShadow != null)
                    {
                        connectorShadow.SetLabelName(String.Empty);
                    }

                    table.DeleteRow(r);
                    SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    // only one per link possible
                    return;
                }
            }
        }
Esempio n. 2
0
        public override void OnConnectorChangeTarget(ConnectorShadow shadow)
        {
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
                {
                    //table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                    table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                    SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    break;
                }
            }
        }
Esempio n. 3
0
        /**
         * Because SetTransitions calls RemoveOutputsForDeletedTransitions, it can result in
         * a shape delete.  When it's being called because of a connector delete, we can end
         * up with an error because we try to delete the same shape twice.  This avoids that.
         **/
        private void SetTransitionsWithoutRemovingOutputsForDeletedTransitions(Table table)
        {
            List <Connect> connects = GetShapeOutputs();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string          uid    = table.GetData(r, (int)TableColumns.Transitions.Goto);
                ConnectorShadow shadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                if (shadow != null)
                {
                    shadow.SetLabelName(table.GetData(r, (int)TableColumns.Transitions.Condition));
                }
            }

            Common.SetCellTable(shape, ShapeProperties.Transitions, table);
        }
Esempio n. 4
0
        public override void OnBeforeShapeDelete()
        {
            base.OnBeforeShapeDelete();
            List <Connect> connects = GetShapeOutputs();

            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string          uid    = table.GetData(r, (int)TableColumns.Transitions.Goto);
                ConnectorShadow shadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
                if (shadow != null)
                {
                    shadow.SetLabelName(string.Empty);
                }
            }
        }
Esempio n. 5
0
        public override void OnConnectAddOutput(Shadow shadow)
        {
            base.OnConnectAddOutput(shadow);
            Table table = GetTransitions();

            // make sure it's not already in there - this can happen with undo/redo
            for (int r = 0; r < table.GetNumRows(); r++)
            {
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
                {
                    return;
                }
            }

            if (table.IsEmpty())
            {
                table = new Table(1, Enum.GetNames(typeof(TableColumns.Transitions)).Length);
            }
            else
            {
                table.AddRow();
            }

            ConnectorShadow connector = shadow as ConnectorShadow;

            if (connector != null)
            {
                string label = connector.GetLabelName();
                if (label.Length > 0)
                {
                    table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Condition, CommonShadow.GetStringWithNewConnectorLabel("", label));
                    //table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
                    table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.ConditionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());
                }
            }

            table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Goto, shadow.GetUniqueId());
            //table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
            table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());
            SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
        }
Esempio n. 6
0
        public override void OnConnectorLabelChange(ConnectorShadow shadow)
        {
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
                {
                    string condition    = table.GetData(r, (int)TableColumns.Transitions.Condition);
                    string newCondition = CommonShadow.GetStringWithNewConnectorLabel(condition, shadow.GetLabelName());

                    if (!condition.Equals(newCondition))
                    {
                        table.SetData(r, (int)TableColumns.Transitions.Condition, newCondition);
                        //table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                        SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    }
                    break;
                }
            }
        }
        public override void OnConnectorLabelChange(ConnectorShadow shadow)
        {
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId())) {

                    string condition = table.GetData(r, (int)TableColumns.Transitions.Condition);
                    string newCondition = CommonShadow.GetStringWithNewConnectorLabel(condition, shadow.GetLabelName());

                    if (!condition.Equals(newCondition)) {
                        table.SetData(r, (int)TableColumns.Transitions.Condition, newCondition);
                        table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    }
                    break;
                }
        }
        public override void OnConnectorChangeTarget(ConnectorShadow shadow)
        {
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId())) {
                    table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                    SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    break;
                }
        }
Esempio n. 9
0
 public virtual void OnConnectorLabelChange(ConnectorShadow shadow)
 {
 }
Esempio n. 10
0
 public virtual void OnConnectorChangeTarget(ConnectorShadow shadow)
 {
 }
Esempio n. 11
0
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow shadow = null;

            switch (shapeType) {
                case ShapeTypes.CallSubDialog:
                    shadow = new CallSubDialogShadow(shape);
                    break;
                case ShapeTypes.ChangeLog:
                    shadow = new ChangeLogShadow(shape);
                    break;
                case ShapeTypes.AppDesc:
                    shadow = new AppDescShadow(shape);
                    break;
                case ShapeTypes.PrefixList:
                    shadow = new PrefixListShadow(shape);
                    break;
                case ShapeTypes.Comment:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Connector:
                    shadow = new ConnectorShadow(shape);
                    break;
                case ShapeTypes.Data:
                    shadow = new DataShadow(shape);
                    break;
                case ShapeTypes.Decision:
                    shadow = new DecisionShadow(shape);
                    break;
                case ShapeTypes.DocTitle:
                    shadow = new DocTitleShadow(shape);
                    break;
                case ShapeTypes.HangUp:
                    shadow = new HangUpShadow(shape);
                    break;
                case ShapeTypes.Interaction:
                    shadow = new InteractionShadow(shape);
                    break;
                case ShapeTypes.None:
                    break;
                case ShapeTypes.OffPageRef:
                    shadow = new OffPageRefShadow(shape);
                    break;
                case ShapeTypes.OnPageRefIn:
                    shadow = new OnPageRefInShadow(shape);
                    break;
                case ShapeTypes.OnPageRefOut:
                    shadow = new OnPageRefOutShadow(shape);
                    break;
                case ShapeTypes.Page:
                    break;
                case ShapeTypes.Placeholder:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Play:
                    shadow = new PlayShadow(shape);
                    break;
                case ShapeTypes.Return:
                    shadow = new ReturnShadow(shape);
                    break;
                case ShapeTypes.Start:
                    shadow = new StartShadow(shape);
                    break;
                case ShapeTypes.SubDialog:
                    shadow = new SubDialogShadow(shape);
                    break;
                case ShapeTypes.Transfer:
                    shadow = new TransferShadow(shape);
                    break;
            }
            return shadow;
        }
        public override void OnConnectorLabelChange(ConnectorShadow shadow)
        {
            Table table = GetCommandTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
                if (table.GetData(r, (int)TableColumns.CommandTransitions.Goto).Equals(shadow.GetUniqueId())) {

                    string option = table.GetData(r, (int)TableColumns.CommandTransitions.Option);
                    string newOption = CommonShadow.GetStringWithNewConnectorLabel(option, shadow.GetLabelName());

                    if (!option.Equals(newOption)) {
                        table.SetData(r, (int)TableColumns.CommandTransitions.Option, newOption);
                        //table.SetData(r, (int)TableColumns.CommandTransitions.OptionDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        table.SetData(r, (int)TableColumns.CommandTransitions.OptionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added
                        SetCommandTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    }
                    break;
                }
        }
        public override void OnConnectorChangeTarget(ConnectorShadow shadow)
        {
            Table table = GetCommandTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
                if (table.GetData(r, (int)TableColumns.CommandTransitions.Goto).Equals(shadow.GetUniqueId())) {
                    //table.SetData(r, (int)TableColumns.CommandTransitions.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                    table.SetData(r, (int)TableColumns.CommandTransitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                    SetCommandTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    break;
                }
        }
Esempio n. 14
0
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow     shadow    = null;

            switch (shapeType)
            {
            case ShapeTypes.CallSubDialog:
                shadow = new CallSubDialogShadow(shape);
                break;

            case ShapeTypes.ChangeLog:
                shadow = new ChangeLogShadow(shape);
                break;

            case ShapeTypes.AppDesc:
                shadow = new AppDescShadow(shape);
                break;

            case ShapeTypes.PrefixList:
                shadow = new PrefixListShadow(shape);
                break;

            case ShapeTypes.Comment:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Connector:
                shadow = new ConnectorShadow(shape);
                break;

            case ShapeTypes.Data:
                shadow = new DataShadow(shape);
                break;

            case ShapeTypes.Decision:
                shadow = new DecisionShadow(shape);
                break;

            case ShapeTypes.DocTitle:
                shadow = new DocTitleShadow(shape);
                break;

            case ShapeTypes.HangUp:
                shadow = new HangUpShadow(shape);
                break;

            case ShapeTypes.Interaction:
                shadow = new InteractionShadow(shape);
                break;

            case ShapeTypes.None:
                break;

            case ShapeTypes.OffPageRef:
                shadow = new OffPageRefShadow(shape);
                break;

            case ShapeTypes.OnPageRefIn:
                shadow = new OnPageRefInShadow(shape);
                break;

            case ShapeTypes.OnPageRefOut:
                shadow = new OnPageRefOutShadow(shape);
                break;

            case ShapeTypes.Page:
                break;

            case ShapeTypes.Placeholder:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Play:
                shadow = new PlayShadow(shape);
                break;

            case ShapeTypes.Return:
                shadow = new ReturnShadow(shape);
                break;

            case ShapeTypes.Start:
                shadow = new StartShadow(shape);
                break;

            case ShapeTypes.SubDialog:
                shadow = new SubDialogShadow(shape);
                break;

            case ShapeTypes.Transfer:
                shadow = new TransferShadow(shape);
                break;
            }
            return(shadow);
        }
Esempio n. 15
0
 virtual public void OnConnectorLabelChange(ConnectorShadow shadow)
 {
 }
Esempio n. 16
0
 virtual public void OnConnectorChangeTarget(ConnectorShadow shadow)
 {
 }