예제 #1
0
            GetStandardValues(ITypeDescriptorContext context)
            {
                TransitionEditor instance = (TransitionEditor)context.Instance;
                StatePanel       panel    = (StatePanel)instance.Control.Panel;

                return(GetValues(panel.Model));
            }
예제 #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);
        }
예제 #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;
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #6
0
 /// <summary>
 /// Selects the current transition
 /// </summary>
 public void SelectTransition()
 {
     StatePanel.Select(this);
 }
예제 #7
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public TransitionControl(StatePanel panel, Transition model)
     : base(panel, model)
 {
 }
예제 #8
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="panel"></param>
 /// <param name="model"></param>
 public StateControl(StatePanel panel, State model)
     : base(panel, model)
 {
 }