public override void Install(IInputModeContext context, ConcurrencyController concurrencyController) { base.Install(context, concurrencyController); // register the relevant events var canvas = context.CanvasControl; canvas.Mouse2DPressed += CanvasOnMouse2DPressed; canvas.Mouse2DReleased += CanvasOnMouse2DReleased; canvas.Mouse2DDragged += CanvasOnMouse2DDragged; }
/// <summary> /// Installs the <see cref="LensInputMode"/> by adding the <see cref="LensVisualCreator"/> /// to the <see cref="lensGroup"/> and registering the necessary mouse event handlers. /// </summary> public override void Install(IInputModeContext context, ConcurrencyController controller) { base.Install(context, controller); var canvasControl = context.CanvasControl as GraphControl; lensGroup = canvasControl.RootGroup.AddGroup(); lensGroup.Above(canvasControl.InputModeGroup); lensGroup.AddChild(new LensVisualCreator(this)); canvasControl.Mouse2DMoved += UpdateLensLocation; canvasControl.Mouse2DDragged += UpdateLensLocation; canvasControl.Mouse2DEntered += UpdateLensLocation; canvasControl.Mouse2DExited += UpdateLensLocation; }
/// <summary> /// Installs the <see cref="LensInputMode"/> by adding the <see cref="LensVisual"/> /// to the <see cref="lensGroup"/> and registering the necessary mouse event handlers. /// </summary> public override void Install(IInputModeContext context, ConcurrencyController controller) { base.Install(context, controller); var canvasControl = context.CanvasControl as GraphControl; lensGroup = canvasControl.RootGroup.AddGroup(); lensGroup.Above(canvasControl.InputModeGroup); lensVisual = new LensVisual(this); lensGroup.AddChild(lensVisual, CanvasObjectDescriptors.Visual); canvasControl.Mouse2DMoved += UpdateLensLocation; canvasControl.Mouse2DDragged += UpdateLensLocation; canvasControl.Mouse2DEntered += UpdateLensVisibility; canvasControl.Mouse2DExited += UpdateLensVisibility; }
public void Install(IInputModeContext context, ConcurrencyController controller) { InputModeContext = context; var geim = context.ParentInputMode as GraphEditorInputMode; if (geim == null) { throw new InvalidOperationException("NodeGroupResizingInputMode must be installed as child mode of GraphEditorInputMode"); } // create own HandleInputMode for the handles handleInputMode = new HandleInputMode { Priority = 1 }; // notify the GraphSnapContext which nodes are resized and shouldn't provide SnapLines handleInputMode.DragStarted += RegisterReshapedNodes; // forward events to OrthogonalEdgeEditingContext so it can handle keeping edges at reshaped nodes orthogonal handleInputMode.DragStarting += moveHandleOrthogonalHelper.Starting; handleInputMode.DragStarted += moveHandleOrthogonalHelper.Started; handleInputMode.DragFinished += moveHandleOrthogonalHelper.Finished; handleInputMode.DragCanceled += moveHandleOrthogonalHelper.Canceled; handleInputMode.Install(context, controller); handleInputMode.Enabled = false; // update handles depending on the changed node selection geim.MultiSelectionStarted += MultiSelectionStarted; geim.MultiSelectionFinished += MultiSelectionFinished; ((GraphControl)context.CanvasControl).Selection.ItemSelectionChanged += ItemSelectionChanged; // add a NodeLayoutChanged listener so the reshape rect is updated when the nodes are moved (e.g. through // layout animations or MoveInputMode). context.GetGraph().NodeLayoutChanged += NodeLayoutChanged; }
public override void Install(IInputModeContext context, ConcurrencyController controller) { base.Install(context, controller); InputModeContext.CanvasControl.Mouse2DMoved += OnMouseMoved; }
static DatabasesConfiguration() { ActiveChanged += ConcurrencyController.OnActiveConfigChanged; ConcurrencyController.UpdateSemaphores(Active); }