当前位置: 首页>>代码示例>>C#>>正文


C# ZoomState.ApplyState方法代码示例

本文整理汇总了C#中ZedGraph.ZoomState.ApplyState方法的典型用法代码示例。如果您正苦于以下问题:C# ZoomState.ApplyState方法的具体用法?C# ZoomState.ApplyState怎么用?C# ZoomState.ApplyState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZedGraph.ZoomState的用法示例。


在下文中一共展示了ZoomState.ApplyState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoTest

        protected override void DoTest()
        {
            // IsPauseForScreenShots = true;
            RunUI(() => SkylineWindow.OpenFile(TestFilesDir.GetTestPath("SplitGraphUnitTest.sky")));
            CollectionAssert.AreEqual(new[]{"SplitGraph_rev1.clib"}, SkylineWindow.Document.Settings.PeptideSettings.Libraries.LibrarySpecs
                .Select(spec => Path.GetFileName(spec.FilePath)).ToArray());
            WaitForDocumentLoaded();
            // Test that AutoZoomNone and AutoZoomBestPeak work
            var graphChromatogram = Application.OpenForms.OfType<GraphChromatogram>().First();
            var graphChromatogramGraphControl = AllControls(graphChromatogram).OfType<ZedGraphControl>().First();
            RunUI(() =>
                {
                    // Select the first transition group
                    SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo(2, 0);
                    SkylineWindow.AutoZoomBestPeak();
                    // Make sure that we are zoomed in to approximately the best peak
                    Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Min, 13.0, 1.0);
                    Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Max, 14.0, 1.0);
                    // Remember the zoom state so that we can pretend to manually zoom later
                    var zoomStateAuto = new ZoomState(graphChromatogramGraphControl.GraphPane, ZoomState.StateType.Zoom);
                    SkylineWindow.AutoZoomNone();
                    Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Min, 0.0, 1.0);
                    Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Max, 35.0, 1.0);
                    // Pretend to manually zoom
                    zoomStateAuto.ApplyState(graphChromatogramGraphControl.GraphPane);
                    Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Min, 13.0, 1.0);
                    // Select some other transition group:
                    SkylineWindow.SelectedPath = SkylineWindow.Document.GetPathTo(2, 1);
                    SkylineWindow.ShowPeakAreaReplicateComparison();
                });
            WaitForGraphs();
            // Ensure that we zoomed out when the selected transition group changed
            Assert.AreEqual(graphChromatogramGraphControl.GraphPane.XAxis.Scale.Min, 0.0, 1.0);

            var peakAreaSummary = Application.OpenForms.OfType<GraphSummary>().First();
            var graphLibraryMatch = Application.OpenForms.OfType<GraphSpectrum>().First();
            var libraryMatchGraphControl = AllControls(graphLibraryMatch).OfType<ZedGraphControl>().First();
            RunUI(() =>
                {
                    Assert.IsTrue(Settings.Default.ShowLibraryChromatograms);
                    AssertCurveListsSame(graphChromatogram.CurveList,
                                         libraryMatchGraphControl.GraphPane.CurveList);
                    AssertCurveListsSame(graphChromatogram.CurveList,
                                         peakAreaSummary.GraphControl.GraphPane.CurveList);
                    Assert.AreEqual(9, graphChromatogram.CurveList.Count);
                    Assert.AreEqual(1, graphChromatogramGraphControl.MasterPane.PaneList.Count);
                    Assert.AreEqual(1, peakAreaSummary.GraphControl.MasterPane.PaneList.Count);
                    SkylineWindow.ShowPrecursorTransitions();
                    Assert.AreEqual(3, graphChromatogram.CurveList.Count);
                    // TODO(nicksh): Enable this when libraries filter based on precursor/product
                    //AssertCurveListsSame(graphChromatogram.CurveList, libraryMatchGraphControl.GraphPane.CurveList);
                    AssertCurveListsSame(graphChromatogram.CurveList,
                                         peakAreaSummary.GraphControl.GraphPane.CurveList);
                    SkylineWindow.ShowProductTransitions();
                    Assert.AreEqual(6, graphChromatogram.CurveList.Count);
                    // TODO(nicksh): Enable this when libraries filter based on precursor/product
                    AssertCurveListsSame(graphChromatogram.CurveList,
                      libraryMatchGraphControl.GraphPane.CurveList);
                    AssertCurveListsSame(graphChromatogram.CurveList,
                                         peakAreaSummary.GraphControl.GraphPane.CurveList);
                    SkylineWindow.ShowAllTransitions();
                    SkylineWindow.ShowSplitChromatogramGraph(true);
                });
            WaitForGraphs();
            Assert.AreEqual(2, graphChromatogramGraphControl.MasterPane.PaneList.Count);
            Assert.AreEqual(2, peakAreaSummary.GraphControl.MasterPane.PaneList.Count);
            AssertCurveListsSame(graphChromatogram.GetCurveList(graphChromatogramGraphControl.MasterPane.PaneList[0]),
                peakAreaSummary.GraphControl.MasterPane.PaneList[0].CurveList);
            AssertCurveListsSame(graphChromatogram.GetCurveList(graphChromatogramGraphControl.MasterPane.PaneList[1]),
                peakAreaSummary.GraphControl.MasterPane.PaneList[1].CurveList);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:71,代码来源:SplitGraphTest.cs

示例2: ZoomTo

 public void ZoomTo(ZoomState zoomState)
 {
     zoomState.ApplyState(GraphPanes.First());
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:4,代码来源:GraphChromatogram.cs

示例3: ZoomEvent

 private void ZoomEvent(ZedGraphControl sender, ZoomState oldState, ZoomState newState)
 {
     if (sender == zedGraphControl1)
     {
         newState.ApplyState(zedGraphControl2.GraphPane);
         zedGraphControl2.Invalidate();
         zedGraphControl2.AxisChange();
     } else {
         newState.ApplyState(zedGraphControl1.GraphPane);
         zedGraphControl1.Invalidate();
         zedGraphControl1.AxisChange();
     }
 }
开发者ID:dbaileychess,项目名称:Compass,代码行数:13,代码来源:DtaViewerForm.cs

示例4: InsertMsGraphPane

 private MSGraphPane InsertMsGraphPane(MSGraphControl graphControl, int iInsert)
 {
     var pane = new MSGraphPane
     {
         Border = { IsVisible = false },
         AllowCurveOverlap = true,
     };
     ApplySettingsToGraphPane(pane);
     var primaryPane = graphControl.GraphPane;
     pane.CurrentItemType = primaryPane.CurrentItemType;
     pane.ZoomStack.AddRange(primaryPane.ZoomStack);
     var zoomState = new ZoomState(primaryPane, ZoomState.StateType.Zoom);
     zoomState.ApplyState(pane);
     pane.YAxis.Title.Text = primaryPane.YAxis.Title.Text;
     pane.XAxis.Title.Text = primaryPane.XAxis.Title.Text;
     graphControl.MasterPane.PaneList.Insert(iInsert, pane);
     return pane;
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:18,代码来源:GraphHelper.cs


注:本文中的ZedGraph.ZoomState.ApplyState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。