Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » connection decorator rotation on move
connection decorator rotation on move [message #851227] Fri, 20 April 2012 19:36 Go to next message
Josef Pohl is currently offline Josef PohlFriend
Messages: 82
Registered: January 2012
Member
Hi there,
This is just a observation which should probably be piggy-backed onto an current bugzilla. But I was not sure if it is directly related since most of the current ones deal with zoom features.

We noticed that a connection decorator (in this case a triangle representing a arrowhead on a connection) will rotate slightly depending on the relative position of the arrow to the feature. Hence the triangle skews slightly and the polyline connector is no longer orthogonal to the base of the triangle.

Thanks,
Joe
Re: connection decorator rotation on move [message #853630 is a reply to message #851227] Mon, 23 April 2012 07:29 Go to previous messageGo to next message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
Hi Joe,
can you add a screenshot and the code snippet where you create connection and connection decorator?

BR,
Matthias
Re: connection decorator rotation on move [message #855496 is a reply to message #853630] Tue, 24 April 2012 21:54 Go to previous messageGo to next message
Josef Pohl is currently offline Josef PohlFriend
Messages: 82
Registered: January 2012
Member
Hi Matthias,
Sorry it has taken me a bit to get back to this.

Here is the code snippet for creating the arrow head:
   private Polyline createArrow(GraphicsAlgorithmContainer gaContainer) {
       
        IGaService gaService = Graphiti.getGaService();
        Polygon polygon =
            gaService.createPolygon(gaContainer, new int[] { -15, 10, 1, 0, -15,
                -10 });
        polygon.setForeground(manageColor(IColorConstant.BLACK));
        polygon.setBackground(manageColor(IColorConstant.BLACK));
        polygon.setLineWidth(2);
        polygon.setFilled(true);
        return polygon;
    }


It is called from:

    public PictogramElement add(IAddContext context) {
        IAddConnectionContext addConContext = (IAddConnectionContext) context;
        IsSolvedBy addedIsSolvedBy = (IsSolvedBy) context.getNewObject();
        IPeCreateService peCreateService = Graphiti.getPeCreateService();
       
        Connection connection = peCreateService
            .createFreeFormConnection(getDiagram());
        connection.setStart(addConContext.getSourceAnchor());
        connection.setEnd(addConContext.getTargetAnchor());
        
        IGaService gaService = Graphiti.getGaService();
        Polyline polyline = gaService.createPolyline(connection);
        polyline.setLineWidth(2);
        polyline.setForeground(manageColor(IColorConstant.BLACK));
 
        link(connection, addedIsSolvedBy);

        ConnectionDecorator cd;
        cd = peCreateService
              .createConnectionDecorator(connection, false, 1.0, true);
        createArrow(cd);
        return connection;
    }

Here are the images you requested.
The straight instance:
index.php/fa/8075/0/

The crooked version. This was a user reported issue and I still cannot, completely, convince myself that it is not just my eyes playing tricks on me. But I don't drink at work...
index.php/fa/8076/0/


Thanks for all your help,
Joe
  • Attachment: straight.png
    (Size: 10.77KB, Downloaded 877 times)
  • Attachment: crooked.png
    (Size: 9.67KB, Downloaded 849 times)
Re: connection decorator rotation on move [message #1016214 is a reply to message #851227] Tue, 05 March 2013 14:22 Go to previous messageGo to next message
Maria Torrens is currently offline Maria TorrensFriend
Messages: 3
Registered: September 2012
Junior Member
Hi, i have the same problem:

index.php/fa/13689/0/

This would be a task to be open in Bugzilla?
  • Attachment: error.png
    (Size: 14.77KB, Downloaded 737 times)
Re: connection decorator rotation on move [message #1016735 is a reply to message #1016214] Thu, 07 March 2013 13:56 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Yes, please do so.

Thanks,
Michael
Re: connection decorator rotation on move [message #1016803 is a reply to message #851227] Thu, 07 March 2013 18:01 Go to previous messageGo to next message
Maria Torrens is currently offline Maria TorrensFriend
Messages: 3
Registered: September 2012
Junior Member
Done: Bug 402681.
Re: connection decorator rotation on move [message #1064366 is a reply to message #1016803] Tue, 18 June 2013 22:27 Go to previous messageGo to next message
Dwight Naylor is currently offline Dwight NaylorFriend
Messages: 23
Registered: June 2012
Junior Member
Sorry to revive the thread, but I was wondering if there had been any progress on this bug, or if it was still being worked on at all?

It is a problem that my editor has had for a long time, and we were wondering if it would be fixed soon.

Thanks.
Re: connection decorator rotation on move [message #1064428 is a reply to message #1064366] Wed, 19 June 2013 08:43 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Dwight,

sorry, but there is no progress on this due to limited capacity. Let's see
if we can get to this for the upcoming Luna release.

Michael
Re: connection decorator rotation on move [message #1064528 is a reply to message #1064428] Wed, 19 June 2013 16:59 Go to previous message
Dwight Naylor is currently offline Dwight NaylorFriend
Messages: 23
Registered: June 2012
Junior Member
Hi Michael,

Thanks for the update!

-Dwight
Previous Topic:Port element short name
Next Topic:Text rotation on connection
Goto Forum:
  


Current Time: Thu Mar 28 11:31:16 GMT 2024

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

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

Back to the top