标签:options 覆盖 etc for 像素 int .so load oms
Endpoint:
jsPlumb提供了四种类型的端点,
Dot,Rectangle,
Blank,使用失败了。
Image,使用失败了。
Connectors
jsPlumb提供了四种类型的连线,
Bezier,StateMachine,Flowchart,Straight
Overlay
jsPlumb提供了3种类型的覆盖物,
Arrow:箭头
Label:标签
Custom:自定义的html元素
ConnectionOverlays: [
["Arrow", {
location: 1,
//foldback: 1,
foldback: 0.618, ///0.618: 普通箭头,1:平底箭头,2:钻石箭头
visible: true,
id: "arrow"
}],
["Label", { location: 0.5,
cssClass: "endpointTargetLabel",
visible: true,
id: "label" }]
]
drawConnectLine: function () {
var sintoonUx = this;
/// 定义锚点的位置
var defaultAnchors = ["Top", "Right", "Bottom", "Left", [0.25, 0, 0, -1], [0.75, 0, 0, -1], [0.25, 1, 0, 1], [0.75, 1, 0, 1]
, [0, 0.25, 0, -1], [0, 0.75, 0, -1], [1, 0.25, 0, 1], [1, 0.75, 0, 1]];
/// 创建实例,配置默认的绘制属性,建立通用绘图方式等
sintoonUx.jsPlumbInstance = jsPlumb.getInstance({
PaintStyle: {
lineWidth: 2,
strokeStyle: "blue",
outlineColor: "blue",
dashstyle: "4 2",
outlineWidth: 1
},
// Connector: ["Bezier", { curviness: 30 }],
// Connector: ["StateMachine"],
// Connector: ["Flowchart", { stub: [40, 60], gap: 10, cornerRadius: 5, alwaysRespectStubs: true }],
Connector: ["Straight", { stub: [20, 50], gap: 0 }],
Endpoint: ["Dot", { radius: 5, cssClass: "displaynone" }],/// 通过样式来隐藏锚点
//Endpoint: ["Image ", { src: "http://rmadyq.sintoon.cn/Content/16Icons/arrow_right.png" }],/// 通过样式来隐藏锚点
// Endpoint: ["Blank", "Blank"], 失败报错了,
EndpointStyle: { fillStyle: "#567567" },
Anchor: [defaultAnchors],
// Anchor: ["Perimeter", { shape: "Triangle" }],
Container: sintoonUx.flowchartContainerId,
DragOptions: { cursor: ‘pointer‘, zIndex: 2000 },
ConnectionOverlays: [
["Arrow", {
location: 1,
//foldback: 1,
foldback: 0.618,
visible: true,
id: "arrow"
}],
["Label", { location: 0.5, label: "zhu", cssClass: "endpointTargetLabel", visible: true, id: "label" }]
]
});
/// 绘制标签
sintoonUx.jsPlumbInstance.bind("connection",
function (connInfo, originalEvent) {
var connection = connInfo.connection;
var labelText = connection.sourceId.substring(0, 15) + "-" + connection.targetId.substring(0, 15);
labelText = Ext.String.format("{0}---{1}", Ext.getCmp(connection.sourceId).flowStage,
Ext.getCmp(connection.targetId).flowStage);
connection.getOverlay("label").setLabel(labelText);
});
/// 批处理绘制
sintoonUx.jsPlumbInstance.setSuspendDrawing(true);
var searchPat = Ext.String.format("#{0} .btnDraggable", sintoonUx.flowchartContainerId);
var btnDoms = sintoonUx.jsPlumbInstance.getSelector(searchPat);
/// 设置dom元素的可拖拽性
sintoonUx.jsPlumbInstance.draggable(btnDoms);
/// 建立dom元素之间的连接,绘制连接线,锚点,覆盖物等
for (var i = 0; i < sintoonUx.btnConfigs.length - 1; i++) {
sintoonUx.jsPlumbInstance.connect({ reattach: true, source: sintoonUx.btnConfigs[i].btnId, target: sintoonUx.btnConfigs[i + 1].btnId });
}
/// 强制绘制整个界面
sintoonUx.jsPlumbInstance.setSuspendDrawing(false, true);
}

标签:options 覆盖 etc for 像素 int .so load oms
原文地址:http://www.cnblogs.com/firesword/p/6093083.html