示例#1
0
        //HERZUM END SPRINT 2: TLAB-156

        public static ExperimentCanvasPad CreateExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
        {
            IExperiment       experiment    = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;

            if (scopeMetadata != null)
            {
                experiment = scopeMetadata.ComponentGraph.GetExperiment();
            }
            else
            {
                return(applicationContext.MainWindow.ExperimentCanvasPad);
            }

            ExperimentCanvasPad experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);

            if (!m_mapPadToNodes.ContainsKey(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id))
            //HERZUM SPRINT 2: TLAB-156
            {
                // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                // m_mapPadToNodes.Add(experiment.ExperimentInfo.Id, experimentCanvasPad);
                // m_mapIdToNodes.Add (experiment.ExperimentInfo.Id, basicNodeControl);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
                m_mapIdToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, basicNodeControl);
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            }
            //HERZUM END SPRINT 2: TLAB-156
            return(experimentCanvasPad);
        }
示例#2
0
        // HERZUM SPRINT 2.4 TLAB-157
        public static ExperimentCanvasPad CreateCompositeExperimentCanvasPad(ApplicationContext applicationContext, ExperimentCanvasWidget experimentCanvasWidget, CompositeComponentGraph experiment)
        {
            ExperimentCanvasPad experimentCanvasPad = null;

            if (m_mapPadToNodes.TryGetValue(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, out experimentCanvasPad))
            {
                return(experimentCanvasPad);
            }
            else
            {
                experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
            }

            DockFrame m_dockFrame = new DockFrame();

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = 100;
            attributes.Y          = 100;
            attributes.Width      = 100;
            attributes.Height     = 100;
            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
            m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int)mask);
            experimentCanvasPad.Initialize(m_dockFrame);
            experimentCanvasPad.SetApplicationModel(applicationContext.Application, experimentCanvasWidget, experiment);
            return(experimentCanvasPad);
        }
示例#3
0
        private void AddScopeInDecisionComponent()
        {
            // HERZUM SPRINT 2.0: TLAB-148
            // m_applicationContext.MainWindow.ExperimentCanvasPad.AddScopeInDecisionComponent(this);
            ExperimentCanvasPad experimentCanvasPad = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, this);

            experimentCanvasPad.AddScopeInDecisionComponent(this);
            // END HERZUM SPRINT 2.0: TLAB-148
        }
示例#4
0
 // HERZUM SPRINT 2.0: TLAB-136-2
 public virtual void CompositeComponentNoSelected(BasicNodeControl focusControl)
 {
     if (!this.Equals(focusControl))
     {
         ExperimentCanvasPad pad  = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, this);
         ExperimentCanvasPad pad2 = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, focusControl);
         if (!pad.Equals(pad2))
         {
             pad.ExperimentCanvasWidget.ExperimentCanvas.View.RemoveFromSelection(this);
             this.IsSelected = false;
         }
     }
 }
示例#5
0
        /// <summary>
        /// Creates the dock frame and pads.
        /// </summary>
        /// <param name='container'>
        /// Container.
        /// </param>
        private void CreateDockAndPads(HBox container)
        {
            var componentsLibraryPad = new ComponentsLibraryPad();
            var workspaceWindowPad   = new WorkspaceWindowPad();
            var experimentCanvasPad  = new ExperimentCanvasPad(m_applicationContext);
            var outputWindowPad      = new OutputWindowPad();

            IDockPad[] pads = new IDockPad[]
            {
                componentsLibraryPad,
                workspaceWindowPad,
                experimentCanvasPad,
                outputWindowPad
            };

            foreach (IDockPad pad in pads)
            {
                pad.Initialize(m_dockFrame);
            }

            this.ApplicationPads      = pads;
            this.ComponentsLibraryPad = componentsLibraryPad;
            this.WorkspaceWindowPad   = workspaceWindowPad;
            this.ExperimentCanvasPad  = experimentCanvasPad;
            this.OutputWindowPad      = outputWindowPad;

            container.PackStart(m_dockFrame, true, true, 0);

            //TODO: save last layout - see how Pinta has done it
//            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");
//
//            if (System.IO.File.Exists(layout_file))
//            {
//                try
//                {
//                    dock.LoadLayouts(layout_file);
//                }
//                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
//                catch (Exception e)
//                {
//                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
//                }
//            }

            if (!m_dockFrame.HasLayout("Default"))
            {
                m_dockFrame.CreateLayout("Default", false);
            }

            m_dockFrame.CurrentLayout = "Default";
        }
示例#6
0
        /*
         * private ScopeNodeBase GetScopeUp(ExperimentNode experimentNode, BaseExperiment experiment, double x, double y){
         *  BasicNodeControl componentControl;
         *  ScopeNodeBase scopeUp = null;
         *  ExperimentCanvasPad pad = null;
         *  if (experiment == null)
         *      return null;
         *  foreach (ExperimentNode node in experiment.Vertices)
         *      if (node is ScopeNodeBase && !node.Equals(experimentNode))
         *          if(m_applicationContext.NodeControlFactory.TryGetNodeControl(node, out componentControl)){
         *              ScopeBaseMetadata  scopeBaseMetadata  = node.Data.Metadata as ScopeBaseMetadata;
         *              int xMouse = 0;
         *              int yMouse = 0;
         *              BasicNodeControl internalComponentControl = null;
         *              foreach (ExperimentNode internalNode in scopeBaseMetadata.ComponentGraph.Vertices){
         *                  m_applicationContext.NodeControlFactory.TryGetNodeControl(internalNode, out internalComponentControl) ;
         *                  break;
         *              }
         *              if (internalComponentControl == null)
         *                  return null;
         *                  pad = ExperimentCanvasPadFactory.GetExperimentCanvasPad (m_applicationContext, componentControl);
         *              if (pad == null)
         *                  return null;
         *              pad.ExperimentCanvasWidget.GetPointer(out xMouse, out yMouse);
         *              scopeUp = GetScopeUp(experimentNode, scopeBaseMetadata.ComponentGraph as BaseExperiment, xMouse, yMouse);
         *              if (scopeUp != null)
         *                  return scopeUp;
         *              ScopeNodeControl scopeNodeControl = componentControl as ScopeNodeControl;
         *              if (scopeNodeControl.ContainsPoint (x, y))
         *                  return node as ScopeNodeBase;
         *          }
         *  return null;
         * }
         */
        // END HERZUM SPRINT 2.3 TLAB-60


        public override ITool CreateFigureTool(IPrimaryToolDelegator mainTool, IDrawingEditor editor,
                                               ITool defaultTool, MouseEvent ev)
        {
            DragTool dragTool = defaultTool as DragTool;

            if (dragTool != null)
            {
                //when drag is completed update model data
                dragTool.DragCompleted += (object sender, EventArgs e) =>
                {
                    this.ExperimentNode.Data.X = this.DisplayBox.X;
                    this.ExperimentNode.Data.Y = this.DisplayBox.Y;

                    // HERZUM SPRINT 2.3 TLAB-60
                    int           xMouse    = 0;
                    int           yMouse    = 0;
                    ScopeNodeBase scopeNode = GetScopeUp(ExperimentNode, ExperimentNode.Owner as BaseExperiment, ExperimentNode.Data.X, ExperimentNode.Data.Y);
                    if (scopeNode != null)
                    {
                        ScopeBaseMetadata   scopeBaseMetadata = scopeNode.Data.Metadata as ScopeBaseMetadata;
                        BaseExperiment      experimentTarget  = scopeBaseMetadata.ComponentGraph;
                        BasicNodeControl    componentControl  = null;
                        ExperimentCanvasPad pad = null;
                        foreach (ExperimentNode node in scopeBaseMetadata.ComponentGraph.Vertices)
                        {
                            m_applicationContext.NodeControlFactory.TryGetNodeControl(node, out componentControl);
                            break;
                        }
                        if (componentControl != null)
                        {
                            pad = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, componentControl);
                        }

                        if (pad != null)
                        {
                            pad.ExperimentCanvasWidget.GetPointer(out xMouse, out yMouse);
                            // HERZUM SPRINT 2.4 TLAB-56 TLAB-57 TLAB-58 TLAB-59 CLASS
                            //TraceLab.Core.Experiments.Clipboard.Cut(ExperimentNode.Owner as BaseExperiment);
                            //TraceLab.Core.Experiments.Clipboard.Paste(experimentTarget,xMouse,yMouse);

                            DragClipboard.Cut(m_applicationContext, ExperimentNode.Owner as BaseExperiment);
                            DragClipboard.Paste(m_applicationContext, experimentTarget, xMouse, yMouse);
                            // END HERZUM SPRINT 2.4 TLAB-56 TLAB-57 TLAB-58 TLAB-59 CLASS
                            pad.DisplayAddedSubgraph(experimentTarget);
                        }
                    }
                    // END HERZUM SPRINT 2.3 TLAB-60
                };
            }
            return(base.CreateFigureTool(mainTool, editor, defaultTool, ev));
        }
示例#7
0
        public void MaximizeScope()
        {
            if (stateWidget == "normal")
            {
                paddingLeftOriginal   = PaddingLeft;
                paddingRightOriginal  = PaddingRight;
                paddingBottomOriginal = PaddingBottom;
                xOriginal             = rect.X;
                yOriginal             = rect.Y;
            }

            int    xPosInit = 5;
            int    yPosInit = 5;
            double widthMax;
            double heightMax;

            //HERZUM SPRINT 2.3: TLAB-52
            ExperimentCanvasPad ecp = null;

            ecp = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, this);


            widthMax  = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.VisibleArea.Width - 20;
            heightMax = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.VisibleArea.Height - 40;


            //widthMax = m_applicationContext.MainWindow.ExperimentCanvasPad.ExperimentCanvasWidget.ExperimentCanvas.View.VisibleArea.Width-20;
            //heightMax = m_applicationContext.MainWindow.ExperimentCanvasPad.ExperimentCanvasWidget.ExperimentCanvas.View.VisibleArea.Height-40;
            //HERZUM SPRINT 2.3: TLAB-52

            // HERZUM SPRINT 2.4: TLAB-156
            MoveTo(xPosInit - offsetPanX, yPosInit - offsetPanY);
            // END HERZUM SPRINT 2.4: TLAB-156

            PaddingTop    = 7.0;
            PaddingLeft   = PaddingLeft + (widthMax - (rect.X2 - rect.X)) / 2;
            PaddingRight  = PaddingRight + (widthMax - (rect.X2 - rect.X)) / 2;;
            PaddingBottom = heightMax;

            ResizeCanvasWidget();

            xCur = rect.X;
            yCur = rect.Y;

            stateWidget       = "max";
            info.WidgetStatus = stateWidget;

            ShowWidget();
        }
        //HERZUM END SPRINT 2: TLAB-156

        public static ExperimentCanvasPad CreateExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl) 
        {
            IExperiment experiment = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;
            if (scopeMetadata != null)
                experiment = scopeMetadata.ComponentGraph.GetExperiment ();
            else
                return applicationContext.MainWindow.ExperimentCanvasPad;

            ExperimentCanvasPad   experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
            if (!m_mapPadToNodes.ContainsKey(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id))
                //HERZUM SPRINT 2: TLAB-156
                {
                  // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                  // m_mapPadToNodes.Add(experiment.ExperimentInfo.Id, experimentCanvasPad);
                  // m_mapIdToNodes.Add (experiment.ExperimentInfo.Id, basicNodeControl);
                  m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
                  m_mapIdToNodes.Add (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, basicNodeControl);
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                }
            //HERZUM END SPRINT 2: TLAB-156
            return experimentCanvasPad;
        }
示例#9
0
        // END HERZUM SPRINT 2.4 TLAB-157


        public static ExperimentCanvasPad GetExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
        {
            ExperimentCanvasPad experimentCanvasPad = null;

            // HERZUM SPRINT 2.4: TLAB-156
            if (basicNodeControl is CommentNodeControl && !m_mapIdToNodes.ContainsValue(basicNodeControl))
            {
                m_mapIdToNodes.Add(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.ID, basicNodeControl);
            }
            // END HERZUM SPRINT 2.4: TLAB-156

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            // if (m_mapPadToNodes.TryGetValue (basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            if (m_mapPadToNodes.TryGetValue(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            {
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                return(experimentCanvasPad);
            }
            else
            {
                return(applicationContext.MainWindow.ExperimentCanvasPad);
            }
        }
        // HERZUM SPRINT 2.4 TLAB-157
        public static ExperimentCanvasPad CreateCompositeExperimentCanvasPad(ApplicationContext applicationContext, ExperimentCanvasWidget experimentCanvasWidget, CompositeComponentGraph experiment) 
        {   
            ExperimentCanvasPad experimentCanvasPad = null;
            if (m_mapPadToNodes.TryGetValue (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, out experimentCanvasPad))
                return experimentCanvasPad;
            else
            {
                experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
            } 
 
            DockFrame m_dockFrame = new DockFrame();
            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X = 100;
            attributes.Y = 100;
            attributes.Width = 100;
            attributes.Height = 100;    
            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
            m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int) mask);
            experimentCanvasPad.Initialize (m_dockFrame);
            experimentCanvasPad.SetApplicationModel(applicationContext.Application, experimentCanvasWidget, experiment);
            return experimentCanvasPad;
        }
示例#11
0
        // END HERZUM SPRINT 5.0: TLAB-235

        // HERZUM SPRINT 1.1 LOOP
        protected void DrawScope (String start, String end){

            var metadata = this.ExperimentNode.Data.Metadata;
            ScopeBaseMetadata scopeMetadata = metadata as ScopeBaseMetadata;

            //componentGraph might be null if component metadata definition is not existing in the library 
            if(scopeMetadata.ComponentGraph != null)
            {
                // HERZUM SPRINT 1.1 CANVAS
                // return;
                // END HERZUM SPRINT 1.1 CANVAS

                if (m_scopeCanvasWidget == null)
                {
                    // HERZUM SPRINT 1.0
                    //scopeCanvasPad = new ExperimentCanvasPad(m_applicationContext);
                    //scopeCanvasPad = new  ScopeCanvasPad(m_applicationContext);
                    // END HERZUM SPRINT 1.0

                    //HERZUM SPRINT 2.0 TLAB-136
                    scopeCanvasPad = ExperimentCanvasPadFactory.CreateExperimentCanvasPad (m_applicationContext,this);
                    //END HERZUM SPRINT 2.0 TLAB-136

                    DockFrame m_dockFrame = new DockFrame();
                    Gdk.WindowAttr attributes = new Gdk.WindowAttr();
                    attributes.WindowType = Gdk.WindowType.Child;

                    attributes.X = 100;
                    attributes.Y = 100;
                    attributes.Width = 100;
                    attributes.Height = 100;    

                    Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
                    m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int) mask);
                    scopeCanvasPad.Initialize (m_dockFrame);

                    
                    // HERZUM SPRINT 2.2 TLAB-101 TLAB-102
                    foreach (ExperimentNode node in scopeMetadata.ComponentGraph.GetExperiment().Vertices)
                    {
                        if (node is ExperimentStartNode)
                            // HERZUM SPRINT 5.0: TLAB-235
                            // node.Data.Metadata.Label = "Start";
                            node.Data.Metadata.Label = start;
                        // END HERZUM SPRINT 5.0: TLAB-235

                        if (node is ExperimentEndNode)
                        {
                            // HERZUM SPRINT 5.0: TLAB-235
                            // node.Data.Metadata.Label = "End";
                            node.Data.Metadata.Label = end;
                            // END HERZUM SPRINT 5.0: TLAB-235

                            //HERZUM SPRINT 2.4 TLAB-158
                            // HERZUM SPRINT 5.0: TLAB-235
                            if (scopeMetadata.ComponentGraph.GetExperiment().StartNode.Data.X == 0 && 
                                scopeMetadata.ComponentGraph.GetExperiment().StartNode.Data.Y == 0 &&
                                scopeMetadata.ComponentGraph.GetExperiment().EndNode.Data.X == 0 && 
                                scopeMetadata.ComponentGraph.GetExperiment().EndNode.Data.Y == 0)
                            // END HERZUM SPRINT 5.0: TLAB-235
                                //HERZUM SPRINT 5.3 TLAB-185
                                    node.Data.Y =+ 110;
                               //END HERZUM SPRINT 5.3 TLAB-185
                            //END HERZUM SPRINT 2.4 TLAB-158
                        }
                    }
                    // END HERZUM SPRINT 2.2 TLAB-101 TLAB-102

                    // HERZUM SPRINT 1.0
                    scopeCanvasPad.SetScopeApplicationModel(this, m_applicationContext.Application, scopeMetadata.ComponentGraph);
                    // scopeCanvasPad.SetScopeApplicationModel(m_applicationContext.Application, scopeMetadata.ComponentGraph);
                    // END HERZUM SPRINT 1.0


                    // HERZUM SPRINT 1.0
                    //m_scopeCanvasWidget = scopeCanvasPad.ScopeCanvasWidget;
                    m_scopeCanvasWidget = scopeCanvasPad.ExperimentCanvasWidget;
                    m_scopeCanvasWidget.DestroyVbox1();
                    // END HERZUM SPRINT 1.0

                }

                // HERZUM SPRINT 2.1
                // m_applicationContext.MainWindow.ExperimentCanvasPad.ScopeNodeControlCurrent = this;
                // END HERZUM SPRINT 2.1


                
                //HERZUM SPRINT 2.0 TLAB-136
                ecp = ExperimentCanvasPadFactory.GetExperimentCanvasPad (m_applicationContext, this);
                //END HERZUM SPRINT 2.0 TLAB-136

                valueZoom = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.Scale;

                if (!nodeCreated)
                {

                    xCur=rect.X;
                    yCur=rect.Y;

                    //PRINT 1.2 TLAB-133
                    //HERZUM SPRINT 2.0 TLAB-136
                    // HERZUM SPRINT 2.4: TLAB-156
                    offsetPanX =  ecp.ExperimentCanvasWidget.OffsetPanX;
                    offsetPanY= ecp.ExperimentCanvasWidget.OffsetPanY;

                    // HERZUM SPRINT 5.3: TLAB-185
                    //ecp.DisplayScope (m_scopeCanvasWidget, rect.X+1+offsetPanX, rect2.Y2+1+offsetPanY); 
                    //ecp.DisplayScope (m_scopeCanvasWidget, rect.X+edgeBorder+offsetPanX, rect2.Y2+edgeBorder+offsetPanY); 
                    ecp.DisplayScope (m_scopeCanvasWidget, (int)((rect.X+edgeBorder+offsetPanX)*valueZoom), (int)((rect2.Y2+edgeBorder+offsetPanY)*valueZoom)); 
                    // END HERZUM SPRINT 5.3: TLAB-185

                    // END HERZUM SPRINT 2.4: TLAB-156
                    //END HERZUM SPRINT 2.0 TLAB-136
                    //END HERZUM SPRINT 1.2 TLAB-133

                    m_scopeCanvasWidget.Show();
                    nodeCreated=true;
                } 

                else if (xCur!=rect.X  ||  yCur!=rect.Y) 
                { 
                    //HERZUM SPRINT 1.2 TLAB-133
                    //HERZUM SPRINT 2.0 TLAB-136

                    //HERZUM SPRINT 2: TLAB-156
                    if (valueZoom==zoomPrevious && valueZoom==1)
                        // HERZUM SPRINT 2.4: TLAB-156
                        // HERZUM SPRINT 5.3: TLAB-185
                        //ecp.MoveScope (m_scopeCanvasWidget, rect.X+1+offsetPanX, rect2.Y2+1+offsetPanY);
                        ecp.MoveScope (m_scopeCanvasWidget, rect.X+edgeBorder+offsetPanX, rect2.Y2+edgeBorder+offsetPanY);
                        // END HERZUM SPRINT 5.3: TLAB-185
                        // END HERZUM SPRINT 2.4: TLAB-156
                    //END HERZUM SPRINT 2: TLAB-156

                    //END HERZUM SPRINT 2.0 TLAB-136

                    xCur=rect.X;
                    yCur=rect.Y;

                    //HERZUM SPRINT 2.0 TLAB-135
                    if (IconisationForced)
                    { 
                        NormalizeScope ();
                        IconisationForced = false;
                    } 

                    OverlayScope (m_applicationContext);
                    //END HERZUM SPRINT 2.0 TLAB-135

                } 


                //HERZUM SPRINT 1.2 TLAB-133
                ResizeCanvasWidget ();
                //END HERZUM SPRINT 1.2 TLAB-133

            }

            if (firstDrawScope)
                if (stateWidget=="max")
                { 
                    MaximizeScope();
                    PaddingBottom = PaddingBottom - 20;
                }
                else if (stateWidget=="iconized")
                    IconizeScope();

            if (stateWidget=="iconized")
                m_scopeCanvasWidget.Hide();

            //HERZUM SPRINT 2.0 TLAB-135
            if (firstDrawScope)
            { 
                OverlayScope (m_applicationContext);
                firstDrawScope=false;
            }
            //END HERZUM SPRINT 2.0 TLAB-135


            //HERZUM SPRINT 2.0 TLAB-135
            if (IsResize)
            { 
                OverlayScope (m_applicationContext);
                IsResize=false;
            }
            //END HERZUM SPRINT 2.0 TLAB-135   


            //HERZUM SPRINT 2: TLAB-156
            valueZoom = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.Scale;
            m_scopeCanvasWidget.ExperimentCanvas.View.Scale = valueZoom;   
            SetZoom (valueZoom);
            //HERZUM END SPRINT 2: TLAB-156

            
            // HERZUM SPRINT 2.4: TLAB-156
            //HERZUM SPRINT 5.5 TLAB-216
            point = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.DrawingToView ((int)rect.X / valueZoom, (int)rect2.Y2 / valueZoom);
            offsetPanX = (point.X - rect.X) / valueZoom;
            offsetPanY = (point.Y - rect2.Y - 30) / valueZoom;
            //END HERZUM SPRINT 5.5 TLAB-216 
            if (ecp.ExperimentCanvasWidget.IsPanToolButtonActive ()) {
                //point = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.DrawingToView ((int)rect.X / valueZoom, (int)rect2.Y2 / valueZoom);
                //offsetPanX = (point.X - rect.X) / valueZoom;
                //offsetPanY = (point.Y - rect2.Y - 30) / valueZoom;
                if (valueZoom == 1)
                    // HERZUM SPRINT 5.3: TLAB-185
                    //ecp.MoveScope (m_scopeCanvasWidget, point.X + 1, point.Y);
                    ecp.MoveScope (m_scopeCanvasWidget, point.X + edgeBorder, point.Y + edgeBorder);              
                   // END HERZUM SPRINT 5.3: TLAB-185
            } 
            // END HERZUM SPRINT 2.4: TLAB-156
              

        }
示例#12
0
        /// <summary>
        /// Creates the dock frame and pads.
        /// </summary>
        /// <param name='container'>
        /// Container.
        /// </param>
        private void CreateDockAndPads(HBox container)
        {
            var componentsLibraryPad = new ComponentsLibraryPad();
            var workspaceWindowPad = new WorkspaceWindowPad();
            var experimentCanvasPad = new ExperimentCanvasPad(m_applicationContext);
            var outputWindowPad = new OutputWindowPad();

            IDockPad[] pads = new IDockPad[] 
                {  
                    componentsLibraryPad,
                    workspaceWindowPad,
                    experimentCanvasPad,
                    outputWindowPad
                };

            foreach(IDockPad pad in pads) 
            {
                pad.Initialize(m_dockFrame);
            }

            this.ApplicationPads = pads;
            this.ComponentsLibraryPad = componentsLibraryPad;
            this.WorkspaceWindowPad = workspaceWindowPad;
            this.ExperimentCanvasPad = experimentCanvasPad;
            this.OutputWindowPad = outputWindowPad;

            container.PackStart(m_dockFrame, true, true, 0);

            //TODO: save last layout - see how Pinta has done it
//            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");
//            
//            if (System.IO.File.Exists(layout_file))
//            {
//                try
//                {
//                    dock.LoadLayouts(layout_file);
//                }
//                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
//                catch (Exception e)
//                {
//                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
//                }
//            }
            
            if (!m_dockFrame.HasLayout ("Default"))
                m_dockFrame.CreateLayout ("Default", false);
            
            m_dockFrame.CurrentLayout = "Default";
        }