| Enlarge click area for connections [message #729556] |
Mon, 26 September 2011 09:40  |
Christian B Messages: 68 Registered: August 2011 |
Member |
|
|
Hi,
In my Editor, you add model objects by placing them on a connection. The problem is the click area for the connection is very small, so you have to aim precisly.
Is there possibility to enlarge the click area for a connection, for example return a rectangle as click area for connections?
I tried the getClickArea() in the BehaviourProvider, but you cannot create a rectangle there, you can only return existing graphic algorithms...
I would also be happy about workaround ideas, if the framework does not provide such a functioniolity.
Thanks!
|
|
|
|
|
|
|
|
|
| Re: Enlarge click area for connections [message #754404 is a reply to message #753961] |
Wed, 02 November 2011 08:58   |
Christian B Messages: 68 Registered: August 2011 |
Member |
|
|
thanks, i will try this.
But i found one other very interesting code snipped in org.eclipse.graphiti.ui.internal.figures.GFPolyline:
/**
* Sets the selection tolerance. This is the minimum line-width, which is
* still considered to be a selection of the polyline, independent from the
* real line-width. For a small line-width this makes it easier to select
* the polyline.
*
* @param minimumSelectionLineWidth
* The new minimum selection line-width to set.
*/
public void setMinimumSelectionLineWidth(int minimumSelectionLineWidth) {
this.minimumSelectionLineWidth = minimumSelectionLineWidth;
}
This looks exactly like what i am looking for! so now i have to overwrite or extend some internal class to use this method!
What would be the appropiate way to use this method?
Which internally class should i extend or overwrite? (i think of org.eclipse.graphiti.ui.internal.figures.GFPolylineConnection)
EDIT:
if the minimumSelectionWidth works, it should definitly be settable by the graphiti user
EDIT2:
org.eclipse.graphiti.ui.internal.figures.GFPolyline.minimumSelectionWidth solves my issue perfectly! But it is only changable by changing internal code...
[Updated on: Wed, 02 November 2011 11:25] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01949 seconds