Connection between two figures [message #1715266] |
Fri, 20 November 2015 16:38 |
Alex Kravets Messages: 561 Registered: November 2009 |
Senior Member |
|
|
In the diagram above I am trying to create connection between two figures so that connection start and end are at ellipse anchors. Using code below I am able to connect to figures, however, the connection start and end are not static, but dynamic depending on where shape is moved. What should I do to make connection start and end be on my ellipse anchors? I think it has to do with line peCreateService.createChopboxAnchor(componentContainer);, when I set ChopBoxAnchor on the whole Shape I can initiate connection on that Shape, but that is also where connection starts. If I omit it, then my custom anchors become starting points of the connection.
ContainerShape invisibleContainer = createService.createContainerShape(container, true);
ContainerShape componentContainer = createService.createContainerShape(invisibleContainer, true);
Rectangle createInvisibleRectangle = createService.createInvisibleRectangle(invisibleContainer);
gaService.setLocationAndSize(createInvisibleRectangle, 0, 30, container.getGraphicsAlgorithm().getWidth(), 50);
RoundedRectangle containerShape = createService.createRoundedRectangle(componentContainer, 10, 10);
containerShape.setBackground(manageColor(IColorConstant.WHITE));
containerShape.setLineWidth(1);
//containerShape.setStyle(StyleUtil.getStyleForChannelComponentContainer(getDiagram()));
layoutService.setLocationAndSize(containerShape, 5, 5, container.getGraphicsAlgorithm().getWidth() - 10, 40);
setColumnIcon(gaService, containerShape, (ColumnType) newObject);
link(invisibleContainer, newObject);
link(componentContainer, newObject);
peCreateService.createChopboxAnchor(componentContainer);
createAnchor(invisibleContainer, containerShape, AnchorType.LEFT);
if(TableType.SOURCE == tableType){
createAnchor(invisibleContainer, containerShape, AnchorType.RIGHT);
}
return invisibleContainer;
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03398 seconds