mxgraph的一些常用的设置
一些常用的设置
graph.setConnectable(true); // 是否允许Cells通过其中部的连接点新建连接,false则通过连接线连接 graph.setDropEnabled(true); // 从工具栏拖动到目标细胞时细胞边界是否产生光圈 graph.setTooltips(true); // 是否显示提示,默认显示Cell的名称 graph.setEnabled(false);//设置启用,就是允不允许你改变CELL的形状内容。 graph.setPanning(true);//移动镜头 graph.setCellsResizable(false);//节点不可改变大小 graph.connectionHandler.setCreateTarget(true);//是否创建目标 mxGraphHandler.prototype.setMoveEnabled(false);//是否可以移动 mxGraphHandler.prototype.guidesEnabled = true;//显示细胞位置标尺 /*禁用节点双击,防止改变数据 */ graph.dblClick = function (evt, cell) { var model = graph.getModel(); if (model.isVertex(cell)) { return false; } }; //重写方法不允许那条线(edge)可以编辑 graph.isCellEditable = function(cell) { return !this.getModel().isEdge(cell)&&!this.getModel().isVertex(cell); };
posted on 2012-06-20 14:49 larryzhang 阅读(3213) 评论(0) 编辑 收藏 举报