接続の開始位置または終了位置にラベルを追加したい。しかし、ここでは 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) の位置にラベルを表示します。助けてください。