Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to modify the default behavior of draw connection?
How to modify the default behavior of draw connection? [message #1779058] Sun, 31 December 2017 13:33 Go to next message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
When I add a connection, I wish the start point and end point of connection will be the location of mouse click. But the default start point is the center of shape.
Re: How to modify the default behavior of draw connection? [message #1779467 is a reply to message #1779058] Mon, 08 January 2018 10:51 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Xi,

the start and end points of connections are always anchors, in case you specify nothing a ChopboxAnchor will be used that is located at the centre of the shape. To change that you will need to define another type of anchor (BoxRelativeAnchor or FixPointAnchor) for your shape, which you can place at a location your define. For details see http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Fanchors.htm&cp=27_1_3_8_1.

Michael
Re: How to modify the default behavior of draw connection? [message #1779514 is a reply to message #1779467] Tue, 09 January 2018 01:10 Go to previous messageGo to next message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
Thanks. That is to say, I have to define the anchors before I can establish a connection. I can define the FixPointAnchor beforehand. In this way, the establishment of the connection is divided into two steps. First define the anchor, and then create the connection. I can't merge these two steps into one step. That is to say, add anchors( in the location of mouse click) while creating a connection.
Re: How to modify the default behavior of draw connection? [message #1779523 is a reply to message #1779514] Tue, 09 January 2018 08:00 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Usually, the anchors are part of the shape and thus created together with the shape in the create feature for that shape. But in some cases (e.g. you need an anchor for each new connection) you might also create them together with the connection in the create connection feature. Having the anchor creation as a separate step for the user sounds awkward to me from a usability point of view.

So it would be a single step for the user, but 2 steps that are done inside the create or create connection feature, right.

Michael
Re: How to modify the default behavior of draw connection? [message #1779556 is a reply to message #1779523] Tue, 09 January 2018 15:15 Go to previous messageGo to next message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
I can create the FixPointAnchor in the create connection feature. But the dashline starts at the center of shape( there hasn't any anchor). I wish the dashline start at the location of mouse click. Can i control the dashline?
Re: How to modify the default behavior of draw connection? [message #1779597 is a reply to message #1779556] Wed, 10 January 2018 08:26 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
In the create connection feature you can get the source location (which should correspond to the mouose click position), create a FixPointAnchor at that location and set the start anchor of the connecting to that.

Michael
Re: How to modify the default behavior of draw connection? [message #1779626 is a reply to message #1779597] Wed, 10 January 2018 11:47 Go to previous messageGo to next message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
Yes, I can create a FixPointAnchor at that location. Before the connection is added, there is a dashline(it appear when select the source and target shape ). But the dashline starts at the center of the shape. The real connection start at the location, but the dashline start at the center of shape. I wish the dashline starts at the location of mouse click. Can I control the dashline?
Re: How to modify the default behavior of draw connection? [message #1779753 is a reply to message #1779626] Fri, 12 January 2018 09:23 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Sorry, but as far as I know this cannot be changed.

Michael
Re: How to modify the default behavior of draw connection? [message #1779766 is a reply to message #1779753] Fri, 12 January 2018 10:30 Go to previous message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
Thanks.
Previous Topic:Set selection to a connection decorator
Next Topic:Drag & Drop IFile object from Project Explorer into Graphiti Editor
Goto Forum:
  


Current Time: Wed Oct 09 07:03:21 GMT 2024

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

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

Back to the top