You do not normally need to create an instance of this tool because one already exists as the ToolManager.panningTool.
The Tool.name of this tool is "Panning".
Gets or sets whether panning actions will allow events to bubble instead of panning in the diagram.
Set this to true to allow mobile devices to scroll the page with panning gestures on the diagram. Otherwise, the panning events will be captured and used to pan inside of the diagram.
The default value is false.
This read-only property returns the Point that was the original value of Diagram.position when the panning operation started.
This tool can run when the diagram allows scrolling and the mouse has been dragged with the left button far enough away from the mouse-down point to avoid being a click.
This method may be overridden. Please read the Introduction page on Extensions for how to override methods and how to call this base method.
Capture the mouse, change the diagram cursor to "move", and remember the Diagram.position.
Restore the Diagram.position to what it was when this tool activated.
Release the mouse and restore the default diagram cursor.
Modify the Diagram.position according to how much the mouse has moved.
Modify the Diagram.position according to how much the mouse has moved.
PanningTool支持手动平移画布,用户可以通过拖拽鼠标来改变 Diagram.position
该工具是个标准的鼠标-移动工具, ToolManager.panningTool. 尽管ToolManager.dragSelectingTool 触发优先级比该工具高, DragSelectingTool 只会在mouse-down事件有延迟的情况下起作用. 如果DragSelectingTool没有触发,那么panningTool就有机会工作了
该工具不使用任何的装饰层或者其他工具手柄. 该工具不会修改model或者发起任何事务
如果你想通过代码 "移动" 画布, 你可以修改Diagram.position 或者调用像 Diagram.scroll, Diagram.scrollToRect, or Diagram.centerRect等方法.