我正在尝试在 umlet 中制作协作图,但没有调色板元素可以这样做。所以我想我会创建一个。说起来容易做起来难!我能够定义图表的类元素,但无法定义定义协作流程的箭头。
我尝试在代码窗口中添加一个 drawline 语句,但它在 umlet 自定义元素实现中未定义。
//Modify the code below to define the element's behavior.
//
//Example: Change the line
// y += printCenter(textline,y);
//to
// y += 2*printCenter(textline,y);
//and observe the element preview.
int y=textHeight();
drawRectangle(0,0,100,35);
drawRectangle(0,150,100,35);
//drawline(10,35,10,115);
for(String textline : textlines) {
y += printCenter(textline,y);
}
预期的结果应该是两个类元素和两个表示协作流程的箭头。
我已经做到了这一点,但我无法将其保存到自定义元素调色板。