Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
     mw.onUpdate();
 }
Beispiel #4
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);
     mw.onUpdate();
 }
Beispiel #5
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);
 }
Beispiel #6
0
 public void Execute(IView view, IController controller, OxyInputEventArgs args)
 {
     foreach (var cmd in commands)
     {
         cmd.Execute(view, controller, args);
         if (args.Handled)
         {
             break;
         }
     }
 }
Beispiel #7
0
        /// <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);
        }
Beispiel #8
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);
        }
Beispiel #9
0
 private void PlotEventHandler(int chartIndex, OxyInputEventArgs e)
 {
     PlotModels[chartIndex].InvalidatePlot(false);
     e.Handled = true;
 }
Beispiel #10
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);
 }
Beispiel #11
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);
 }
Beispiel #12
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);
 }
Beispiel #13
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);
 }
Beispiel #14
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);
 }