コード例 #1
0
ファイル: TrackerManipulator.cs プロジェクト: Keyabob/MMG
 /// <summary>
 /// Initializes a new instance of the <see cref="TrackerManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public TrackerManipulator(IPlotView plotView)
     : base(plotView)
 {
     this.Snap = true;
     this.PointsOnly = false;
     this.LockToInitialSeries = true;
 }
コード例 #2
0
        private void HandleZoomByWheelAndCtrl(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1)
        {
            var m = new CustomZoomStepManipulator(view, EAxisDescription.Y)
            {
                Step = args.Delta * 0.001 * factor
            };

            m.Started(args);
        }
コード例 #3
0
        /// <summary>
        /// Zooms the view by the specified factor at the position specified in the <see cref="OxyMouseEventArgs" />.
        /// </summary>
        /// <param name="view">The view.</param>
        /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param>
        /// <param name="delta">The zoom factor.</param>
        private static void HandleZoomAt(IPlotView view, OxyMouseEventArgs args, double delta)
        {
            var m = new ZoomStepManipulator(view)
            {
                Step = delta, FineControl = args.IsControlDown
            };

            m.Started(args);
        }
コード例 #4
0
        /// <summary>
        /// Zooms the view by the mouse wheel delta in the specified <see cref="OxyKeyEventArgs" />.
        /// </summary>
        /// <param name="view">The view.</param>
        /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param>
        /// <param name="factor">The zoom speed factor. Default value is 1.</param>
        private static void HandleZoomByWheel(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1)
        {
            var m = new ZoomStepManipulator(view)
            {
                Step = args.Delta * 0.001 * factor, FineControl = args.IsControlDown
            };

            m.Started(args);
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TouchTrackerManipulator" /> class.
        /// </summary>
        /// <param name="plotView">The plot view.</param>
        public TouchTrackerManipulator(IPlotView plotView)
            : base(plotView)
        {
            this.Snap                = true;
            this.PointsOnly          = false;
            this.LockToInitialSeries = true;

            // Note: the tracker manipulator should not handle pan or zoom
            this.SetHandledForPanOrZoom = false;
        }
コード例 #6
0
ファイル: Chart.cs プロジェクト: fredatgithub/ReoGrid
        /// <summary>
        /// Add chart plot view object.
        /// </summary>
        /// <param name="view">Chart plot view object.</param>
        protected virtual void AddPlotViewLayer(IPlotView view)
        {
            if (this.PlotViewContainer != null)
            {
                view.Bounds = this.PlotViewContainer.ClientBounds;
                this.PlotViewContainer.Children.Add(view);
            }

            this.Invalidate();
        }
コード例 #7
0
        private void CopyChart_OnKeyDown(
            IPlotView view,
            IController controller,
            OxyKeyEventArgs args)
        {
            var chartCopy = new Bitmap(uiPlotView.Width, uiPlotView.Height);

            uiPlotView.DrawToBitmap(chartCopy,
                                    new Rectangle(0, 0, uiPlotView.Width, uiPlotView.Height));
            Clipboard.SetImage(chartCopy);
        }
コード例 #8
0
ファイル: PlotView.cs プロジェクト: Microshaoft/MyOxyPlot
        /// <summary>
        /// Performs the copy operation.
        /// </summary>
        private void DoCopy(IPlotView view, OxyInputEventArgs args)
        {
            var exporter = new PngExporter
            {
                Width  = this.ClientRectangle.Width,
                Height = this.ClientRectangle.Height,
            };

            var bitmap = exporter.ExportToBitmap(this.ActualModel);

            Clipboard.SetImage(bitmap);
        }
コード例 #9
0
            public StayOpenTrackerManipulator(IPlotView plot)
                : base(plot)
            {
                _plotModel = plot != null ? plot.ActualModel : null;
                if (_plotModel == null)
                {
                    throw new ArgumentException("Plot has no model", "plot");
                }

                Snap       = true;
                PointsOnly = false;
            }
コード例 #10
0
        /// <summary>
        /// Attaches this model to the specified plot view.
        /// </summary>
        /// <param name="plotView">The plot view.</param>
        /// <remarks>Only one plot view can be attached to the plot model.
        /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view.</remarks>
        void IPlotModel.AttachPlotView(IPlotView plotView)
        {
            var currentPlotView = this.PlotView;

            if (!object.ReferenceEquals(currentPlotView, null) &&
                !object.ReferenceEquals(plotView, null) &&
                !object.ReferenceEquals(currentPlotView, plotView))
            {
                throw new InvalidOperationException(
                          "This PlotModel is already in use by some other PlotView control.");
            }

            this.plotViewReference = (plotView == null) ? null : new WeakReference(plotView);
        }
コード例 #11
0
 void IPlotModel.AttachPlotView(IPlotView plotView)
 {
     //because of issue https://github.com/oxyplot/oxyplot/issues/497
     //only one view can ever be attached to one plotmodel
     //we have to force detach previous view and then attach new one
     if (plotView != null && PlotView != null && !Equals(plotView, PlotView))
     {
         BaseAttachMethod.Invoke(this, new object[] { null });
         BaseAttachMethod.Invoke(this, new object[] { plotView });
     }
     else
     {
         BaseAttachMethod.Invoke(this, new object[] { plotView });
     }
 }
コード例 #12
0
        /// <summary>
        /// Performs the copy operation.
        /// </summary>
        private void DoCopy(IPlotView view, OxyInputEventArgs args)
        {
            var background = this.ActualModel.Background.IsVisible() ? this.ActualModel.Background : this.ActualModel.Background;

            if (background.IsInvisible())
            {
                background = OxyColors.White;
            }

            var exporter = new PngExporter
            {
                Width      = this.ClientRectangle.Width,
                Height     = this.ClientRectangle.Height,
                Background = background
            };

            var bitmap = exporter.ExportToBitmap(this.ActualModel);

            Clipboard.SetImage(bitmap);
        }
コード例 #13
0
ファイル: OxyPilot.cs プロジェクト: spiked3/pilot_test
        public void Append(IPlotView plot, dynamic j)
        {
            if (j.Flag == 1)
            {
                System.Diagnostics.Debugger.Break();
            }
            // the first message (with data) sets the keys to plot
            if (Series.Count == 0)
            {
                List <string> keys = Util.GetMemberNames(j, true);
                keys.Remove("T");
                keys.Remove("Time");
                keys.Remove("Flag");
                foreach (string k in keys)
                {
                    Series.Add(new LineSeries {
                        Title = k
                    });
                }
            }

            foreach (LineSeries ls in Series)
            {
                while (ls.Points.Count > pointLimit)
                {
                    ls.Points.RemoveAt(0);
                }
                try
                {
                    ls.Points.Add(new DataPoint((double)j.Time, (double)j[ls.Title]));
                }
                catch (Exception)
                {
                    Series.Remove(ls);
                    break;
                }
            }
            plot.InvalidatePlot();
        }
コード例 #14
0
 /// <summary>
 /// Handles the reset event.
 /// </summary>
 /// <param name="view">The view to reset.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param>
 private static void HandleReset(IPlotView view, OxyInputEventArgs args)
 {
     args.Handled = true;
     view.ActualModel.ResetAllAxes();
     view.InvalidatePlot(false);
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomStepManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public ZoomStepManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #16
0
 /// <summary>
 /// Zooms the view by the key in the specified factor.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param>
 private static void HandleZoomCenter(IPlotView view, double delta)
 {
     view.ActualModel.ZoomAllAxes(1 + (delta * 0.12));
     view.InvalidatePlot(false);
 }
コード例 #17
0
 /// <summary>
 /// Zooms the view by the key in the specified factor.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param>
 /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param>
 private static void HandleZoomCenter(IPlotView view, OxyInputEventArgs args, double delta)
 {
     args.Handled = true;
     view.ActualModel.ZoomAllAxes(1 + (delta * 0.12));
     view.InvalidatePlot(false);
 }
コード例 #18
0
 /// <summary>
 /// Zooms the view by the specified factor at the position specified in the <see cref="OxyMouseEventArgs" />.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param>
 /// <param name="delta">The zoom factor.</param>
 private static void HandleZoomAt(IPlotView view, OxyMouseEventArgs args, double delta)
 {
     var m = new ZoomStepManipulator(view) { Step = delta, FineControl = args.IsControlDown };
     m.Started(args);
 }
コード例 #19
0
 /// <summary>
 /// Pans the view by the key in the specified vector.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param>
 /// <param name="dx">The horizontal delta (percentage of plot area width).</param>
 /// <param name="dy">The vertical delta (percentage of plot area height).</param>
 private static void HandlePan(IPlotView view, OxyInputEventArgs args, double dx, double dy)
 {
     args.Handled = true;
     dx *= view.ActualModel.PlotArea.Width;
     dy *= view.ActualModel.PlotArea.Height;
     view.ActualModel.PanAllAxes(dx, dy);
     view.InvalidatePlot(false);
 }
コード例 #20
0
 public void AttachPlotView(IPlotView plotView)
 {
 }
コード例 #21
0
ファイル: PlotCommands.cs プロジェクト: benjaminrupp/oxyplot
 /// <summary>
 /// Pans the view by the key in the specified vector.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="dx">The horizontal delta (percentage of plot area width).</param>
 /// <param name="dy">The vertical delta (percentage of plot area height).</param>
 private static void HandlePan(IPlotView view, double dx, double dy)
 {
     dx *= view.ActualModel.PlotArea.Width;
     dy *= view.ActualModel.PlotArea.Height;
     view.ActualModel.PanAllAxes(dx, dy);
     view.InvalidatePlot(false);
 }
コード例 #22
0
 public virtual bool OnSignalDropped(IPlotView view, ScreenPoint point, ISignalViewModel signal)
 {
     return(true);
 }
コード例 #23
0
ファイル: PlotModel.cs プロジェクト: Cheesebaron/oxyplot
 /// <summary>
 /// Attaches this model to the specified plot view.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 /// <remarks>Only one plot view can be attached to the plot model.
 /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view.</remarks>
 void IPlotModel.AttachPlotView(IPlotView plotView)
 {
     this.plotViewReference = (plotView == null) ? null : new WeakReference(plotView);
 }
コード例 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PanManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public PanManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #25
0
 public TapTouchManipulator(IPlotView plotView, ICommand tapCommand) : base(plotView)
 {
     this.tapCommand = tapCommand;
 }
コード例 #26
0
 /// <summary>
 /// Handles the copy code event.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param>
 private static void HandleCopyCode(IPlotView view, OxyInputEventArgs args)
 {
     args.Handled = true;
     var code = view.ActualModel.ToCode();
     view.SetClipboardText(code);
 }
コード例 #27
0
 /// <summary>
 /// Handles the copy text report event.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param>
 private static void HandleCopyTextReport(IPlotView view, OxyInputEventArgs args)
 {
     args.Handled = true;
     var text = view.ActualModel.CreateTextReport();
     view.SetClipboardText(text);
 }
コード例 #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlotManipulator{T}" /> class.
 /// </summary>
 /// <param name="view">The plot view.</param>
 protected PlotManipulator(IPlotView view)
     : base(view)
 {
     this.PlotView = view;
 }
コード例 #29
0
 /// <summary>
 /// Handles the reset event.
 /// </summary>
 /// <param name="view">The view to reset.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param>
 private static void HandleReset(IPlotView view, OxyInputEventArgs args)
 {
     args.Handled = true;
     view.ActualModel.ResetAllAxes();
     view.InvalidatePlot(false);
 }
コード例 #30
0
ファイル: PlotCommands.cs プロジェクト: benjaminrupp/oxyplot
 /// <summary>
 /// Zooms the view by the key in the specified factor.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param>
 private static void HandleZoomCenter(IPlotView view, double delta)
 {
     view.ActualModel.ZoomAllAxes(1 + (delta * 0.12));
     view.InvalidatePlot(false);
 }
コード例 #31
0
 /// <summary>
 /// Zooms the view by the mouse wheel delta in the specified <see cref="OxyKeyEventArgs" />.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyMouseWheelEventArgs" /> instance containing the event data.</param>
 /// <param name="factor">The zoom speed factor. Default value is 1.</param>
 private static void HandleZoomByWheel(IPlotView view, OxyMouseWheelEventArgs args, double factor = 1)
 {
     var m = new ZoomStepManipulator(view) { Step = args.Delta * 0.001 * factor, FineControl = args.IsControlDown };
     m.Started(args);
 }
コード例 #32
0
ファイル: PlotModel.cs プロジェクト: apmKrauser/RCUModulTest
        /// <summary>
        /// Attaches this model to the specified plot view.
        /// </summary>
        /// <param name="plotView">The plot view.</param>
        /// <remarks>Only one plot view can be attached to the plot model.
        /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view.</remarks>
        void IPlotModel.AttachPlotView(IPlotView plotView)
        {
            var currentPlotView = this.PlotView;
            if (!object.ReferenceEquals(currentPlotView, null) &&
                !object.ReferenceEquals(plotView, null) &&
                !object.ReferenceEquals(currentPlotView, plotView))
            {
                throw new InvalidOperationException(
                    "This PlotModel is already in use by some other PlotView control.");
            }

            this.plotViewReference = (plotView == null) ? null : new WeakReference(plotView);
        }
コード例 #33
0
 /// <summary>
 /// Handles the reset events.
 /// </summary>
 /// <param name="view">The view to reset.</param>
 private static void HandleReset(IPlotView view)
 {
     view.ActualModel.ResetAllAxes();
     view.InvalidatePlot(false);
 }
コード例 #34
0
ファイル: PlotCommands.cs プロジェクト: benjaminrupp/oxyplot
 /// <summary>
 /// Handles the reset events.
 /// </summary>
 /// <param name="view">The view to reset.</param>
 private static void HandleReset(IPlotView view)
 {
     view.ActualModel.ResetAllAxes();
     view.InvalidatePlot(false);
 }
コード例 #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PanManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public PanManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #36
0
 /// <summary>
 /// Handles the copy text report event.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param>
 private static void HandleCopyTextReport(IPlotView view, OxyInputEventArgs args)
 {
     args.Handled = true;
     //    var text = view.ActualModel.CreateTextReport();
     //view.SetClipboardText(text);
 }
コード例 #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TouchManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public TouchManipulator(IPlotView plotView)
     : base(plotView)
 {
     SetHandledForPanOrZoom = true;
 }
コード例 #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TouchManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public TouchManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #39
0
 /// <summary>
 /// Zooms the view by the key in the specified factor.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param>
 /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param>
 private static void HandleZoomCenter(IPlotView view, OxyInputEventArgs args, double delta)
 {
     args.Handled = true;
     view.ActualModel.ZoomAllAxes(1 + (delta * 0.12));
     view.InvalidatePlot(false);
 }
コード例 #40
0
 public StaysOpenTrackerManipulator(IPlotView plotView) : base(plotView)
 {
     Snap       = true;
     PointsOnly = true;
 }
コード例 #41
0
 public CustomPanManipulator(IPlotView plotView, EAxisDescription axisDescription)
     : base(plotView)
 {
     AxisDescription = axisDescription;
 }
コード例 #42
0
 private static void AddStayOpenTrackerManipulator(IPlotView view, IController controller,
                                                   OxyMouseDownEventArgs e)
 {
     controller.AddMouseManipulator(view, new StayOpenTrackerManipulator(view), e);
 }
コード例 #43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 protected MouseManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomRectangleManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public ZoomRectangleManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #45
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomRectangleManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public ZoomRectangleManipulator(IPlotView plotView)
     : base(plotView)
 {
 }
コード例 #46
0
ファイル: ZoomStepManipulator.cs プロジェクト: Keyabob/MMG
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomStepManipulator" /> class.
 /// </summary>
 /// <param name="plotView">The plot view.</param>
 public ZoomStepManipulator(IPlotView plotView)
     : base(plotView)
 {
 }