Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Connection decorator for Zest - Some review needed

Hi,

recently we had a need for a feature request for Zest to define alternative arrowheads for edges (I have also opened a ticket for it https://bugs.eclipse.org/bugs/show_bug.cgi?id=419736). Currently, this was not supported in Zest.

However, I played a bit with the code base, and I have not a seemingly working implementation (and have already pushed this to master).

The basic idea is similar to ConnectionDecorator support:
 * A Graph may define a decorator for both directed and undirected edges
 * A GraphConnection may define a custom decorator, or rely on either the graph's default directed or undirected decorator (as defined by the style bit)
 * This can also be set up in the JFace label provider

Example snippets are also created:
 * Graph API: http://git.eclipse.org/c/gef/org.eclipse.gef4.git/diff/org.eclipse.gef4.zest.examples/src/org/eclipse/gef4/zest/examples/swt/ConnectionDecorationGraphSnippet.java?id=51d070e68a226cae98b0a51c867979ac5cbca014
 * JFace: http://git.eclipse.org/c/gef/org.eclipse.gef4.git/diff/org.eclipse.gef4.zest.examples/src/org/eclipse/gef4/zest/examples/jface/ConnectionDecorationJFaceSnippet.java?id=51d070e68a226cae98b0a51c867979ac5cbca014

However, I would like to have some feedback:
 1. The current implementation modified the IConnectionStyleProvider interface from the JFace API that would break its users. As we have already broken the API Zest 1.0 users, this might not be that serious, but if its a problem, I am open to change it in a compatible way.

 2. The proposed implementation might replace entirely the DIRECTED style bit (the same functionality can be implemented with the new API by providing different default decorations). Is it worth to keep that as well?
 3. This implementation could be extended to also support other special arrow styles, such as dotted, etc.

Points 2. and 3. might simplify the API that would be nice when considering a future port to the new Graphics4 API as well, but I am not sure whether its the best direction.

I welcome any feedback, and of course I am open to change any part of the implementation, it is for now only a short experiment whether it works or not.

Cheers,
Zoltán
-- Zoltán Ujhelyi
https://www.inf.mit.bme.hu/en/members/ujhelyiz

Fault Tolerant Systems Research Group
Budapest University of Technology and Economics



Back to the top