/// <summary> /// Sets the application model on the given pad. /// Pad refreshes its information according to the given application model. /// </summary> /// <param name='applicationViewModel'> /// Application model. /// </param> public void SetApplicationModel(ApplicationViewModel applicationViewModel) { if (m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; if (m_applicationViewModel.Experiment == null) { m_experimentPad.Content = CreateWelcomePageWidget(); } else { CreateExperimentControlToolbar(); m_experimentCanvasWidget = new ExperimentCanvasWidget(); m_experimentPad.Content = m_experimentCanvasWidget; DrawExperiment(); m_applicationViewModel.Experiment.NodeRemoved += OnNodeRemoved; m_applicationViewModel.Experiment.EdgeRemoved += OnEdgeRemoved; //enable drop of components to canvas EnableDrop(m_experimentCanvasWidget); } }
/// <summary> /// Sets the application model on the given pad. /// Pad refreshes its information according to the given application model. /// </summary> /// <param name='applicationViewModel'> /// Application model. /// </param> public void SetApplicationModel(ApplicationViewModel applicationViewModel) { if(m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; if(m_applicationViewModel.Experiment == null) { m_experimentPad.Content = CreateWelcomePageWidget(); } else { CreateExperimentControlToolbar(); m_experimentCanvasWidget = new ExperimentCanvasWidget(); m_experimentPad.Content = m_experimentCanvasWidget; DrawExperiment(); m_applicationViewModel.Experiment.NodeRemoved += OnNodeRemoved; m_applicationViewModel.Experiment.EdgeRemoved += OnEdgeRemoved; //enable drop of components to canvas EnableDrop(m_experimentCanvasWidget); } }
public ExperimentDrawer(ExperimentCanvasWidget experimentCanvasWidget, NodeControlFactory nodeControlFactory, NodeConnectionControlFactory nodeConnectionControlFactory) { m_experimentCanvasWidget = experimentCanvasWidget; m_nodeControlFactory = nodeControlFactory; m_nodeConnectionControlFactory = nodeConnectionControlFactory; }
internal void DisplayScope(ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { // HERZUM SPRINT 1.2 TLAB-133 // scope_experimentCanvasWidget.HeightRequest = (int) height; // scope_experimentCanvasWidget.WidthRequest = (int)width; // END HERZUM SPRINT 1.2 TLAB-133 m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget(scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection(); }
// 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; }
/// <summary> /// Sets the application model on the given pad. /// Pad refreshes its information according to the given application model. /// </summary> /// <param name='applicationViewModel'> /// Application model. /// </param> /// <param name='subExperiment'> /// Scope SubExperiment /// </param> public void SetScopeApplicationModel(ScopeNodeControl scopeNodeControl, ApplicationViewModel applicationViewModel, CompositeComponentGraph subExperiment) { // HERZUM SPRINT 1.0 scopeNodeControlCurrent = scopeNodeControl; // END HERZUM SPRINT 1.0 if (m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; // HERZUM SPRINT 1.0 // Experiment e = new Experiment (); // m_applicationViewModel = ApplicationViewModel.CreateNewApplicationViewModel (applicationViewModel, e); // m_applicationContext = new ApplicationContext (m_applicationViewModel); // END HERZUM SPRINT 1.0 if (m_applicationViewModel.Experiment == null) { m_experimentPad.Content = new WelcomePageWidget(m_applicationContext); } else { // CreateExperimentControlToolbar(); // HERZUM SPRINT 1.0 m_subExperiment = new CompositeComponentEditableGraph(subExperiment); // END HERZUM SPRINT 1.0 // HERZUM SPRINT 1.0 PROGRESS m_subExperiment.OwnerNode = subExperiment.OwnerNode; m_subExperiment.GraphIdPath = subExperiment.GraphIdPath; // END HERZUM SPRINT 1.0 // HERZUM SPRINT 1.1 LOOP // ScopeMetadata scopeMetadata = scopeNodeControlCurrent.ExperimentNode.Data.Metadata as ScopeMetadata; ScopeBaseMetadata scopeMetadata = scopeNodeControlCurrent.ExperimentNode.Data.Metadata as ScopeBaseMetadata; // END HERZUM SPRINT 1.1 LOOP scopeMetadata.SetSubExperiment(m_subExperiment); m_experimentCanvasWidget = new ExperimentCanvasWidget(); m_experimentPad.Content = m_experimentCanvasWidget; bool isExperimentEditable = m_applicationViewModel.Experiment is IEditableExperiment; m_scopeDrawer = new ExperimentDrawer(m_experimentCanvasWidget, m_applicationContext.NodeControlFactory, m_applicationContext.NodeConnectionControlFactory); //m_experimentDrawer.DrawExperiment(m_applicationViewModel.Experiment, isExperimentEditable); m_scopeDrawer.DrawExperiment(m_subExperiment, isExperimentEditable); // HERZUM SPRINT 1.0 m_subExperiment.NodeRemoved += OnNodeRemoved; m_subExperiment.EdgeRemoved += OnEdgeRemoved; // //m_applicationViewModel.Experiment.NodeRemoved += OnNodeRemoved; //m_applicationViewModel.Experiment.EdgeRemoved += OnEdgeRemoved; // END HERZUM SPRINT 1.0 if (isExperimentEditable) { //enable drop of components to canvas EnableDrop(); } } }
// *************************************************** // HERZUM SPRINT 2.4 TLAB-157 public void SetApplicationModel(ApplicationViewModel applicationViewModel, ExperimentCanvasWidget experimentCanvasWidget, CompositeComponentGraph subExperiment) { // HERZUM SPRINT 1.0 // scopeNodeControlCurrent = scopeNodeControl; // END HERZUM SPRINT 1.0 if(m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; if(m_applicationViewModel.Experiment == null) { m_experimentPad.Content = new WelcomePageWidget(m_applicationContext); } else { // CreateExperimentControlToolbar(); m_subExperiment = new CompositeComponentEditableGraph(subExperiment); if (subExperiment.OwnerNode != null) m_subExperiment.OwnerNode = subExperiment.OwnerNode; if (subExperiment.GraphIdPath != null) m_subExperiment.GraphIdPath = subExperiment.GraphIdPath; m_experimentCanvasWidget = experimentCanvasWidget; m_experimentPad.Content = m_experimentCanvasWidget; // bool isExperimentEditable = m_applicationViewModel.Experiment is IEditableExperiment; m_experimentDrawer = new ExperimentDrawer(m_experimentCanvasWidget, new NodeControlFactory(m_applicationContext), new NodeConnectionControlFactory(m_applicationContext)); m_experimentDrawer.DrawExperiment(m_subExperiment, false); } }
// HERZUM SPRINT 2.5 TLAB-157 /* private bool IsInEditableExperiment(CompositeComponentGraph experiment){ if (experiment == null || experiment.OwnerNode == null) return true; CompositeComponentGraph fatherExperiment = experiment.OwnerNode.Owner as CompositeComponentGraph ; if (fatherExperiment != null && fatherExperiment.OwnerNode!= null){ CompositeComponentBaseMetadata meta = fatherExperiment.OwnerNode.Data.Metadata as CompositeComponentBaseMetadata; if (meta != null && meta.ComponentGraph is CompositeComponentEditableGraph) return IsInEditableExperiment (meta.ComponentGraph); else return false; } else return true; } */ // END SPRINT 2.5 TLAB-157 public void SetScopeApplicationModel(ScopeNodeControl scopeNodeControl, ApplicationViewModel applicationViewModel, CompositeComponentGraph subExperiment) { // HERZUM SPRINT 1.0 // scopeNodeControlCurrent = scopeNodeControl; // END HERZUM SPRINT 1.0 if(m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException ("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; // HERZUM SPRINT 1.0 // Experiment e = new Experiment (); // m_applicationViewModel = ApplicationViewModel.CreateNewApplicationViewModel (applicationViewModel, e); // m_applicationContext = new ApplicationContext (m_applicationViewModel); // END HERZUM SPRINT 1.0 if(m_applicationViewModel.Experiment == null) { m_experimentPad.Content = new WelcomePageWidget(m_applicationContext); } else { // CreateExperimentControlToolbar(); // HERZUM SPRINT 1.0 m_subExperiment = new CompositeComponentEditableGraph (subExperiment); // END HERZUM SPRINT 1.0 // HERZUM SPRINT 1.0 PROGRESS // HERZUM SPRINT 2.4 TLAB-157 if (subExperiment.OwnerNode != null) // END HERZUM SPRINT 2.4 TLAB-157 m_subExperiment.OwnerNode = subExperiment.OwnerNode; // HERZUM SPRINT 2.4 TLAB-157 if (subExperiment.GraphIdPath != null) // END HERZUM SPRINT 2.4 TLAB-157 m_subExperiment.GraphIdPath = subExperiment.GraphIdPath; // END HERZUM SPRINT 1.0 // HERZUM SPRINT 4.3: TLAB-238 TLAB-243 if (m_subExperiment.ExperimentInfo != null) m_subExperiment.ExperimentInfo.FilePath = m_applicationContext.Application.Experiment.ExperimentInfo.FilePath; // END HERZUM SPRINT 4.3: TLAB-238 TLAB-243 // HERZUM SPRINT 1.1 LOOP // ScopeMetadata scopeMetadata = scopeNodeControlCurrent.ExperimentNode.Data.Metadata as ScopeMetadata; // HERZUM SPRINT 2.1 // ScopeBaseMetadata scopeMetadata = scopeNodeControlCurrent.ExperimentNode.Data.Metadata as ScopeBaseMetadata; ScopeBaseMetadata scopeMetadata = scopeNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata; // END HERZUM SPRINT 2.1 // END HERZUM SPRINT 1.1 LOOP scopeMetadata.SetSubExperiment (m_subExperiment); m_experimentCanvasWidget = new ExperimentCanvasWidget (); m_experimentPad.Content = m_experimentCanvasWidget; bool isExperimentEditable = m_applicationViewModel.Experiment is IEditableExperiment; // isExperimentEditable = isChallengePasswordBeenUsed (); m_experimentDrawer = new ExperimentDrawer (m_experimentCanvasWidget, m_applicationContext.NodeControlFactory, m_applicationContext.NodeConnectionControlFactory); //m_experimentDrawer.DrawExperiment(m_applicationViewModel.Experiment, isExperimentEditable); // HERZUM SPRINT 2.5 TLAB-157 // isExperimentEditable = isExperimentEditable && IsInEditableExperiment (m_subExperiment); isExperimentEditable = checkEditable (m_subExperiment); // END HERZUM SPRINT 2.5 TLAB-157 if (scopeNodeControl is ChallengeNodeControl) isExperimentEditable = true; // HERZUM SPRINT 3.0: TLAB-172 isExperimentEditable = isExperimentEditable && !isInCompositeCrumb(); // END HERZUM SPRINT 3.0: TLAB-172 m_experimentDrawer.DrawExperiment(m_subExperiment, isExperimentEditable); // HERZUM SPRINT 1.0 m_subExperiment.NodeRemoved += OnNodeRemoved; m_subExperiment.EdgeRemoved += OnEdgeRemoved; // //m_applicationViewModel.Experiment.NodeRemoved += OnNodeRemoved; //m_applicationViewModel.Experiment.EdgeRemoved += OnEdgeRemoved; // END HERZUM SPRINT 1.0 if(isExperimentEditable) { //enable drop of components to canvas EnableDrop (); } } }
/// <summary> /// Sets the application model on the given pad. /// Pad refreshes its information according to the given application model. /// </summary> /// <param name='applicationViewModel'> /// Application model. /// </param> public void SetApplicationModel (ApplicationViewModel applicationViewModel) { if (m_initialized == false || m_dockFrame.GdkWindow == null) { //GdkWindow is for each dock frame is assigned when windowShell calls ShowAll(). See DockContainer.OnRealize method throw new InvalidOperationException ("ExperimentCanvasPad must be first initialized and dockFrame must have assigned GdkWindow before setting application model."); } m_applicationViewModel = applicationViewModel; if(m_applicationViewModel.Experiment == null) { m_experimentPad.Content = new WelcomePageWidget(m_applicationContext); } else { bool isExperimentEditable = m_applicationViewModel.Experiment is IEditableExperiment; //we check whether the challenge is password protected and which password has been used by the user > if challenge password than make the exp not editable string isChallengeString = m_applicationViewModel.Experiment.ExperimentInfo.IsChallenge; if (!string.IsNullOrEmpty (isChallengeString) && isChallengeString.Equals ("True")) { isExperimentEditable = !hasChallengePasswordBeenUsed(); } CreateExperimentControlToolbar(); m_experimentCanvasWidget = new ExperimentCanvasWidget(); m_experimentPad.Content = m_experimentCanvasWidget; m_experimentDrawer = new ExperimentDrawer(m_experimentCanvasWidget, m_applicationContext.NodeControlFactory, m_applicationContext.NodeConnectionControlFactory); m_experimentDrawer.DrawExperiment(m_applicationViewModel.Experiment, isExperimentEditable); m_applicationViewModel.Experiment.NodeRemoved += OnNodeRemoved; m_applicationViewModel.Experiment.EdgeRemoved += OnEdgeRemoved; if(isExperimentEditable) { //enable drop of components to canvas EnableDrop(); } // TLAB-184 (m_experimentCanvasWidget.ExperimentCanvas.View as StandardDrawingView).PanTool += PanToolHandler; (m_experimentCanvasWidget.ExperimentCanvas.View as StandardDrawingView).PanToolButtonReleased += PanToolButtonReleasedHandler; /// TLAB-184 } }
internal void RedrawScope(ExperimentCanvasWidget scopeCanvasWidget, double x, double y) { m_experimentCanvasWidget.ExperimentCanvas.View.RemoveWidget(scopeCanvasWidget); m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget(scopeCanvasWidget, x, y); scopeCanvasWidget.ExperimentCanvas.View.ClearSelection(); }
// 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 }
internal void RedrawScope(ExperimentCanvasWidget scopeCanvasWidget, double x, double y) { m_experimentCanvasWidget.ExperimentCanvas.View.RemoveWidget (scopeCanvasWidget); m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget (scopeCanvasWidget, x, y); scopeCanvasWidget.ExperimentCanvas.View.ClearSelection(); }
internal void MoveScope(ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { m_experimentCanvasWidget.ExperimentCanvas.View.MoveWidget (scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection(); m_experimentCanvasWidget.Show(); }
internal void DisplayScope (ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { // HERZUM SPRINT 1.2 TLAB-133 // scope_experimentCanvasWidget.HeightRequest = (int) height; // scope_experimentCanvasWidget.WidthRequest = (int)width; // END HERZUM SPRINT 1.2 TLAB-133 m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget (scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection(); }
internal void MoveScope(ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { m_experimentCanvasWidget.ExperimentCanvas.View.MoveWidget(scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection(); m_experimentCanvasWidget.Show(); }
// END HERZUM SPRINT 2.4 TLAB-157 // *************************************************** /* // HERZUM SPRINT 1.1 CANVAS internal void PaintScope (CompositeComponentGraph componentGraph) { this.m_experimentDrawer.DrawExperiment (componentGraph, true); } // END HERZUM SPRINT 1.1 CANVAS */ internal void DisplayScope (ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { // HERZUM SPRINT 1.2 TLAB-133 // scope_experimentCanvasWidget.HeightRequest = (int)height; // scope_experimentCanvasWidget.WidthRequest = (int)width; // END HERZUM SPRINT 1.2 TLAB-133 m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget (scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection (); // HERZUM SPRINT 1.0 /* if (scopeNodeControlCurrent!=null){ scopeNodeControlCurrent.maxExperimentButton.Clicked += new EventHandler(OnMaxSCopeNodeButtonClick); scopeNodeControlCurrent.maxExperimentButton.TooltipText = "Massimizzi"; scopeNodeControlCurrent.maxExperimentButton.Show (); } */ // m_experimentCanvasWidget.ExperimentCanvas.View.AddWidget (scopeNodeControlCurrent.maxExperimentButton, x + 300, y-40); // END HERZUM SPRINT 1.0 m_experimentPad.Widget.ShowAll (); }
internal void MoveScope(ExperimentCanvasWidget scope_experimentCanvasWidget, double x, double y) { m_experimentCanvasWidget.ExperimentCanvas.View.MoveWidget (scope_experimentCanvasWidget, x, y); scope_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection (); // HERZUM SPRINT 2.1 /* // HERZUM SPRINT 1.0 if (scopeNodeControlCurrent!=null){ m_experimentCanvasWidget.Show(); } // END HERZUM SPRINT 1.0 */ m_experimentCanvasWidget.Show (); // END HERZUM SPRINT 2.1 }
// 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); }