Ejemplo n.º 1
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Height     = Allocation.Height;
            attributes.Width      = Allocation.Width;
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass     = Gdk.WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Events |
                                          Gdk.EventMask.ExposureMask |
                                          Gdk.EventMask.Button1MotionMask |
                                          Gdk.EventMask.ButtonPressMask |
                                          Gdk.EventMask.ButtonReleaseMask);

            Gdk.WindowAttributesType attributes_mask =
                Gdk.WindowAttributesType.X |
                Gdk.WindowAttributesType.Y |
                Gdk.WindowAttributesType.Colormap |
                Gdk.WindowAttributesType.Visual;
            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask);
            GdkWindow.UserData = Handle;

            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, State);
            this.WidgetFlags &= ~WidgetFlags.NoWindow;

            //GdkWindow.SetBackPixmap (null, true);

            ModifyBase(StateType.Normal, Styles.DockFrameBackground.ToGdkColor());
        }
Ejemplo n.º 2
0
        protected override void OnRealized()
        {
            SetFlag(Gtk.WidgetFlags.Realized);

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;

            // This enables all events except PointerMotionHitMask which prevents correct behavior
            // of MotionNotifyEvent
            attributes.EventMask = (int)(Gdk.EventMask.AllEventsMask & (~Gdk.EventMask.PointerMotionHintMask));

            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y
                                            | WindowAttributesType.Visual | WindowAttributesType.Colormap;

            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)mask);
            GdkWindow.UserData = Handle;
            GdkWindow.SetBackPixmap(null, false);

            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, StateType.Normal);

            Color = new Cairo.Color(1.0, 1.0, 1.0);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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
              

        }