Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » [ELK] The port side does not match with the port position value
[ELK] The port side does not match with the port position value [message #1787618] Wed, 30 May 2018 07:47
lee lucky is currently offline lee luckyFriend
Messages: 22
Registered: October 2017
Junior Member
Dear ELK team:
Recently, I was using ELK V 0.2.2 to layout my Sirius diagram. I configured my port side based on its type in my semantic model. I debuged port position, and it is correctly set to the right side. But some ports are not correctly shown according to its position calculated by ELK layout. I found it is caused by the function "refreshDiagram" in GmfDiagramLayoutConnector.java. If I comment this function, all the ports are correctly shown in the diagram.

    /**
     * Refreshes all ports in the diagram. This is necessary in order correctly move ports, which
     * does not work due to GMF bugs. See Eclipse bug #291484.
     * 
     * @param editor
     *            the diagram editor
     * @param rootPart
     *            the root edit part
     * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=291484
     */
    private static void refreshDiagram(final DiagramEditor editor, final IGraphicalEditPart rootPart) {
        EditPart editPart = rootPart;
        if (editPart == null) {
            editPart = editor.getDiagramEditPart();
        }
        for (Object obj : editPart.getViewer().getEditPartRegistry().values()) {
            if (obj instanceof ShapeNodeEditPart) {
                IFigure figure = ((ShapeNodeEditPart) obj).getFigure();
                if (figure instanceof BorderedNodeFigure) {
                    IFigure portContainer = ((BorderedNodeFigure)    figure).getBorderItemContainer();
                    portContainer.invalidate();
                    portContainer.validate();
                }
            }
        }
    }


It seems that this function is to fix the bug in GMF, https://bugs.eclipse.org/bugs/show_bug.cgi?id=291484.

Does it mean that Sirius diagram doesn't have this bug?

If the function is commented, in some diagram, there are several ports are not exactly placed at its position, and the port side they are placed are right, the position differs nearly 20 or 30 pixels. If I close the diagram and reopen it, all the ports positions are exactly right.

How can I fix this problem?
Any idea is ok and hope for your reply.

Thanks very much.

[Updated on: Wed, 30 May 2018 07:49]

Report message to a moderator

Previous Topic:Hierarchy crossing edges with multiple layout runs
Next Topic:[ELK] Layout disjunct graphs
Goto Forum:
  


Current Time: Sat Sep 22 01:35:25 GMT 2018

Powered by FUDForum. Page generated in 0.02451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top