/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Handles a command triggered by an input gesture. /// </summary> /// <param name="command">The command.</param> /// <param name="view">The plot view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the command was handled.</returns> protected virtual bool HandleCommand(IViewCommand command, IView view, OxyInputEventArgs args) { if (command == null) { return(false); } command.Execute(view, this, args); return(args.Handled); }
/// <summary> /// Handles a command triggered by an input gesture. /// </summary> /// <param name="command">The command.</param> /// <param name="view">The plot view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the command was handled.</returns> protected virtual bool HandleCommand(IViewCommand command, IView view, OxyInputEventArgs args) { if (command == null) { return false; } command.Execute(view, this, args); return args.Handled; }
/// <summary> /// Handles the specified gesture. /// </summary> /// <param name="view">The plot view.</param> /// <param name="gesture">The gesture.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the event was handled.</returns> public bool HandleGesture(IView view, OxyInputGesture gesture, OxyInputEventArgs args) { var command = this.GetCommand(gesture); return this.HandleCommand(command, view, args); }
/// <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); }
/// <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); }
/// <summary> /// Executes the command on the specified plot. /// </summary> /// <param name="view">The plot view.</param> /// <param name="controller">The plot controller.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> public void Execute(IView view, IController controller, OxyInputEventArgs args) { this.handler(view, controller, (T)args); }
/// <summary> /// Handles the specified gesture. /// </summary> /// <param name="view">The plot view.</param> /// <param name="gesture">The gesture.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the event was handled.</returns> public virtual bool HandleGesture(IView view, OxyInputGesture gesture, OxyInputEventArgs args) { var command = this.GetCommand(gesture); return(this.HandleCommand(command, view, args)); }