event-contoller.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @fileoverview 事件处理器
  3. * @author dxq613@gmail.com
  4. */
  5. import GraphEvent from './graph-event';
  6. import { IShape } from '../interfaces';
  7. declare class EventController {
  8. private canvas;
  9. private draggingShape;
  10. private dragging;
  11. private currentShape;
  12. private mousedownShape;
  13. private mousedownPoint;
  14. private mousedownTimeStamp;
  15. constructor(cfg: any);
  16. init(): void;
  17. _bindEvents(): void;
  18. _clearEvents(): void;
  19. _getEventObj(type: any, event: any, point: any, target: any, fromShape: any, toShape: any): GraphEvent;
  20. _eventCallback: (ev: any) => void;
  21. _getShape(point: any, ev: Event): IShape;
  22. _getPointInfo(ev: any): {
  23. x: number;
  24. y: number;
  25. clientX: number;
  26. clientY: number;
  27. };
  28. _triggerEvent(type: any, ev: any): void;
  29. _onDocumentMove: (ev: Event) => void;
  30. _onDocumentMouseUp: (ev: any) => void;
  31. _onmousedown(pointInfo: any, shape: any, event: any): void;
  32. _emitMouseoverEvents(event: any, pointInfo: any, fromShape: any, toShape: any): void;
  33. _emitDragoverEvents(event: any, pointInfo: any, fromShape: any, toShape: any, isCanvasEmit: any): void;
  34. _afterDrag(draggingShape: any, pointInfo: any, event: any): void;
  35. _onmouseup(pointInfo: any, shape: any, event: any): void;
  36. _ondragover(pointInfo: any, shape: any, event: any): void;
  37. _onmousemove(pointInfo: any, shape: any, event: any): void;
  38. _emitEvent(type: any, event: any, pointInfo: any, shape: any, fromShape?: any, toShape?: any): void;
  39. destroy(): void;
  40. }
  41. export default EventController;