SGraphView.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { SCanvasView, SPainter, SPoint } from "@persagy-web/draw/lib";
  2. import { SGraphScene } from "./SGraphScene";
  3. import { SGraphItem } from "./SGraphItem";
  4. import { SColor } from "@persagy-web/draw";
  5. export declare class SGraphView extends SCanvasView {
  6. private _scene;
  7. get scene(): SGraphScene | null;
  8. set scene(v: SGraphScene | null);
  9. backgroundColor: SColor;
  10. rotate: number;
  11. constructor(id: string);
  12. saveSceneSvg(name: string, width: number, height: number): void;
  13. sceneSvgData(width: number, height: number): string;
  14. fitSceneToView(): void;
  15. fitSelectedToView(): void;
  16. fitItemToView(itemList: SGraphItem[]): void;
  17. mapFromScene(x: number, y: number): SPoint;
  18. mapFromScene(pos: SPoint): SPoint;
  19. mapToScene(x: number, y: number): SPoint;
  20. mapToScene(pos: SPoint): SPoint;
  21. saveImageSize(name: string, type: string, width: number, height: number): void;
  22. protected onDraw(painter: SPainter): void;
  23. protected drawBackground(painter: SPainter): void;
  24. protected drawForeground(painter: SPainter): void;
  25. protected onDoubleClick(event: MouseEvent): void;
  26. protected onMouseDown(event: MouseEvent): void;
  27. protected onMouseMove(event: MouseEvent): void;
  28. protected onMouseUp(event: MouseEvent): void;
  29. protected onContextMenu(event: MouseEvent): void;
  30. protected onKeyDown(event: KeyboardEvent): void;
  31. protected onKeyUp(event: KeyboardEvent): void;
  32. private fitRectToSize;
  33. private toSceneMotionEvent;
  34. }