예제 #1
0
 public void TestConstructorHandleModeZoomingRate()
 {
     Ecell.IDE.Plugins.PathwayWindow.Mode mode = Mode.Select;
     float zoomingRate = 0;
     Handle testHandle = new Handle(mode, zoomingRate);
     Assert.IsNotNull(testHandle, "Constructor of type, Handle failed to create instance.");
     Assert.Fail("Create or modify test(s).");
 }
예제 #2
0
 public void TestConstructorHandleModeHandler()
 {
     Ecell.IDE.Plugins.PathwayWindow.Mode mode = Mode.Select;
     UMD.HCIL.Piccolo.Event.PBasicInputEventHandler handler = null;
     Handle testHandle = new Handle(mode, handler);
     Assert.IsNotNull(testHandle, "Constructor of type, Handle failed to create instance.");
     Assert.Fail("Create or modify test(s).");
 }
예제 #3
0
        /// <summary>
        /// Create ToolStripItems.
        /// </summary>
        /// <returns>the list of ToolStripItems.</returns>
        private void CreateToolButtons()
        {
            // Used for ID of handle
            toolButtonHand.Handle = new Handle(Mode.Pan, new PPathwayPanEventHandler(m_con));
            toolButtonSelect.Handle = new Handle(Mode.Select, new DefaultMouseHandler(m_con));
            toolButtonArrow.Handle = new Handle(Mode.CreateOneWayReaction, new CreateReactionMouseHandler(m_con));
            toolButtonBidirArrow.Handle = new Handle(Mode.CreateMutualReaction, new CreateReactionMouseHandler(m_con));
            toolButtonConst.Handle = new Handle(Mode.CreateConstant, new CreateReactionMouseHandler(m_con));

            foreach (ComponentSetting cs in m_con.ComponentManager.DefaultComponentSettings)
            {
                PathwayToolStripButton button = new PathwayToolStripButton();
                button.ImageTransparentColor = Color.Magenta;
                button.ComponentSetting = cs;
                button.Name = cs.Name;
                button.Image = cs.Icon;
                button.Size = new System.Drawing.Size(32, 32);
                button.CheckOnClick = true;
                if (cs.Type == EcellObject.SYSTEM)
                {
                    button.Handle = new Handle(Mode.CreateSystem, new CreateSystemMouseHandler(m_con));
                    button.ToolTipText = MessageResources.ButtonToolTipCreateSystem;
                }
                else
                {
                    button.Handle = new Handle(Mode.CreateNode, new CreateNodeMouseHandler(m_con, cs));
                    if (cs.Type == EcellObject.PROCESS)
                        button.ToolTipText = MessageResources.ButtonToolTipCreateProcess;
                    else if (cs.Type == EcellObject.VARIABLE)
                        button.ToolTipText = MessageResources.ButtonToolTipCreateVariable;
                    else if (cs.Type == EcellObject.TEXT)
                        button.ToolTipText = MessageResources.ButtonToolTipCreateText;
                    else if (cs.Type == EcellObject.STEPPER)
                        button.ToolTipText = MessageResources.ButtonToolTipCreateStepper;
                }

                button.Click += new EventHandler(ButtonStateChanged);
                toolButton.Items.Add(button);
                m_buttons.Add(button);
            }

            // SelectMode is default.
            toolButtonSelect.Checked = true;
            m_handle = toolButtonSelect.Handle;
        }
예제 #4
0
        /// <summary>
        /// Set EventHandler.
        /// </summary>
        /// <param name="handle"></param>
        internal void SetEventHandler(Handle handle)
        {
            // Remove old EventHandler
            PBasicInputEventHandler handler = m_handle.EventHandler;
            ((IPathwayEventHandler)handler).Reset();
            RemoveInputEventListener(handler);

            // Set new EventHandler
            m_handle = handle;
            handler = handle.EventHandler;
            foreach (ToolStripItem item in toolButton.Items)
            {
                if (!(item is PathwayToolStripButton))
                    continue;
                PathwayToolStripButton button = (PathwayToolStripButton)item;
                if (button.Handle == handle)
                    button.Checked = true;
                else
                    button.Checked = false;
            }

            if (m_con.Canvas == null)
                return;

            ((IPathwayEventHandler)handler).Initialize();
            AddInputEventListener(handler);
            m_con.Canvas.LineHandler.SetLineVisibility(false);
        }
예제 #5
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
예제 #6
0
 public void SetUp()
 {
     Ecell.IDE.Plugins.PathwayWindow.Mode mode = Mode.Select;
     UMD.HCIL.Piccolo.Event.PBasicInputEventHandler handler = null;
     _unitUnderTest = new Handle(mode, handler);
 }