我想在连接的开始或结束位置添加标签。但是在这里我没有找到除ManhattanMidpointLocator之外的定位器。那么我该怎么做呢?如何在连接的位置放置标签?
请在下面找到我的代码,
draw2d.LabelConnection = function() {
draw2d.Connection.call(this);
this.sourcePort = null;
this.targetPort = null;
this.lineSegments = [];
this.setColor(new draw2d.Color(0, 255, 0));
this.setLineWidth(2);
var label = new draw2d.Label("Message");
label.setBackgroundColor(new draw2d.Color(230, 230, 250));
label.setBorder(new draw2d.LineBorder(1));
this.addFigure(label, new draw2d.Locator());
};
draw2d.LabelConnection.prototype = new draw2d.Connection();
draw2d.LabelConnection.prototype.type = "draw2d.LabelConnection";
上面的代码在 (0,0) 位置显示标签。请帮帮我。