Ejemplo n.º 1
0
            GetStandardValues(ITypeDescriptorContext context)
            {
                TransitionEditor instance = (TransitionEditor)context.Instance;
                StatePanel       panel    = (StatePanel)instance.Control.Panel;

                return(GetValues(panel.Model));
            }
Ejemplo n.º 2
0
        /// <summary>
        ///     Indicates that the arrow should be displayed in the DEDUCED color
        /// </summary>
        /// <returns></returns>
        public override bool IsDeduced()
        {
            bool retVal = base.IsDeduced();

            if (!retVal)
            {
                if (TypedModel.GraphicalName.CompareTo(Transition.InitialTransitionName) != 0)
                {
                    StateMachine transitionStateMachine = EnclosingFinder <StateMachine> .find(TypedModel.RuleCondition);

                    if (transitionStateMachine == null)
                    {
                        // A deduced case is a arrow that is not defined in any state machine
                        retVal = true;
                    }
                    else
                    {
                        StatePanel panel = (StatePanel)Panel;
                        if (TypedModel.RuleCondition != null &&
                            panel.Model.Rules.Contains(TypedModel.RuleCondition.EnclosingRule))
                        {
                            // A deduced case is a arrow that is defined in the rules of the state machines (not in its states)
                            retVal = true;
                        }
                    }
                }
            }

            return(retVal);
        }
Ejemplo n.º 3
0
        public override void HandleDoubleClick(object sender, MouseEventArgs mouseEventArgs)
        {
            base.HandleDoubleClick(sender, mouseEventArgs);

            StatePanel panel = (StatePanel)Panel;

            if (panel != null)
            {
                StateDiagramWindow window = new StateDiagramWindow();
                GuiUtils.MdiWindow.AddChildWindow(window);
                window.StatePanel.SetStateMachine(panel.StateMachineVariable, TypedModel.StateMachine);
                window.Text = TypedModel.Name + @" " + Resources.StateControl_HandleMouseDoubleClick_state_diagram;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Indicates that the box should be displayed in the ACTIVE color
        /// </summary>
        /// <returns></returns>
        public override bool IsActive()
        {
            bool retVal = base.IsActive();

            if (!retVal)
            {
                StatePanel panel    = (StatePanel)Panel;
                IVariable  variable = panel.StateMachineVariable;
                if (variable != null && panel.Model.Contains(TypedModel, variable.Value))
                {
                    retVal = true;
                }
            }

            return(retVal);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Indicates that the arrow should be displayed in the ACTIVE color
        /// </summary>
        /// <returns></returns>
        public override bool IsActive()
        {
            bool retVal = base.IsActive();

            if (!retVal)
            {
                if (TypedModel.RuleCondition != null)
                {
                    Runner runner = TypedModel.RuleCondition.EFSSystem.Runner;
                    if (runner != null)
                    {
                        StatePanel panel = (StatePanel)Panel;
                        if (runner.RuleActivatedAtTime(TypedModel.RuleCondition, runner.LastActivationTime,
                                                       panel.StateMachineVariable))
                        {
                            retVal = true;
                        }
                    }
                }
            }

            return(retVal);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Selects the current transition
 /// </summary>
 public void SelectTransition()
 {
     StatePanel.Select(this);
 }
Ejemplo n.º 7
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public TransitionControl(StatePanel panel, Transition model)
     : base(panel, model)
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="panel"></param>
 /// <param name="model"></param>
 public StateControl(StatePanel panel, State model)
     : base(panel, model)
 {
 }