Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Custom connection decoration
Custom connection decoration [message #516147] Mon, 22 February 2010 21:06 Go to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi all,

I have two Figures and a PolylineConnection between them. I use the ChopboxAnchor. I would like to have my custom target decoration like this:

Source---------------( O---Target

I probably have to implement my Figure that implements RotatableDecoration, right? But I have absolute no idea what it should do Sad

Can anybody help me please?
Re: Custom connection decoration [message #516460 is a reply to message #516147] Wed, 24 February 2010 05:08 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
In your connectionEditPart class createFigure method
protected IFigure createFigure() {
	PolylineConnection connection = (PolylineConnection) super.createFigure();
	connection.setTargetDecoration(new PolygonDecoration()); // arrow at target endpoint
	connection.setLineStyle(getCastedModel().getLineStyle());  // line drawing style
	return connection;
}


just change the connection.setTargetDecoration(*)

to your own implimentaion...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Custom connection decoration [message #516511 is a reply to message #516460] Wed, 24 February 2010 10:02 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Thanks for advice...but this is what I know. My question is, how can I write my implementation of RotatableDecoration.

I don't know how to make my decoration rotatable. In the RotatableDecoration interface, there are two methods (setLocation() and setReferencePoint()) and I don't know what they should to do
Previous Topic:GEF Editor with Palette and Toolbar
Next Topic:Double-click on an editpart that is partially hidden causes editpart to be revealed but misses doubl
Goto Forum:
  


Current Time: Fri Apr 19 10:09:26 GMT 2024

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

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

Back to the top