/// <summary> /// 注册绘图板的事件 /// </summary> /// <param name="canvas">绘图板对象</param> public void RegistCanvasEvent(Canvas canvas) { canvas.MouseDoubleClick += canvas_MouseDoubleClick; canvas.MouseDown += canvas_MouseDown; canvas.MouseEnter += canvas_MouseEnter; canvas.MouseLeave += canvas_MouseLeave; canvas.MouseMove += canvas_MouseMove; canvas.MouseUp += canvas_MouseUp; canvas.MouseWheel += canvas_MouseWheel; canvas.KeyDown += canvas_KeyDown; canvas.KeyUp += canvas_KeyUp; }
private FlowChartMoveCommand moveCommand; // 移动命令 /// <summary> /// 单例模式的构造函数 /// </summary> /// <param name="mainForm">主窗体</param> /// <param name="canvas">绘图面板</param> /// <param name="propertyGrid">属性面板</param> public GraphManager(FlowChartManager flowChartManager, Canvas canvas) { this.flowChartManager = flowChartManager; this.canvas = canvas; helper = Helper.GetHelper(); documentManager = DocumentManager.GetDocumentManager(); // 初始化背景绘图参数 InitBackground(); // 初始化区域管理器 regionManager.Init(slotContainerList, connectorContainerList, background.BaseSize, background.GridSize.Width); }
/// <summary> /// 创建绘图板对象 /// </summary> /// <return>绘图板对象</return> private Canvas CreateCanvasInstance() { Canvas canvas = new Canvas(); canvas.BackColor = GraphSetting.GetGraphSetting().BackgroundColor; canvas.CurrentAbbreviateCanvas = abbreviateCanvas; abbreviateCanvas.CurrentCanvas = canvas; return canvas; }
/// <summary> /// 初始化数据 /// </summary> /// <param name="canvas">绘图板实例</param> /// <param name="propertyGrid">属性面板实例</param> public void Init(Canvas canvas) { graphManager = new GraphManager(this, canvas); dataManager = new DataManager(this); dataBaseManager = DataBaseManager.GetDataBaseManager(); int i = path.IndexOf('\\'); mapName = path.Substring(0, i); flowChartInteractor = new FlowChartInteractor(); }
/// <summary> /// 创建绘图管理器对象 /// </summary> /// <param name="canvas">绘图板对象</param> /// <param name="tabItem">分页控件对象</param> /// <param name="id">绘图ID</param> /// <param name="panelName">绘图名称</param> /// <param name="path">绘图路径</param> /// <returns>绘图管理器对象</returns> private FlowChartManager CreateFlowChartManagerInstance(Canvas canvas, TabItem tabItem, string id, string panelName, string path) { FlowChartManager newFlowChartManager = new FlowChartManager(chartMode, tabItem, id, panelName, path); newFlowChartManager.Init(canvas); return newFlowChartManager; }