Non-selectable connections? [message #754382] |
Wed, 02 November 2011 11:50 |
Christian B Messages: 68 Registered: August 2011 |
Member |
|
|
Hi,
How can i achieve that connections are not selectable?
I tried the following, but nothing works:
- connection.setActive(false) --> nothing changed
- override getSelection() in ToolBehaviourProvider and return null if connection is selected --> does not work, because method is not called for selecting connections...
- override getClickArea() in ToolBehaviourProvider and return null for connections --> nothing changed
thanks in advance!
[Updated on: Wed, 02 November 2011 11:50] Report message to a moderator
|
|
|
|
Re: Non-selectable connections? [message #755409 is a reply to message #754466] |
Tue, 08 November 2011 11:44 |
Christian B Messages: 68 Registered: August 2011 |
Member |
|
|
thanks!
Problem is getSelection doesn't work on Connections. I tried overwriting getSelection() in ToolBehaviourProvider as you proposed:
@Override
public PictogramElement getSelection(PictogramElement originalPe,
PictogramElement[] oldSelection) {
if(originalPe instanceof Connection)
return Graphiti.getCreateService().createContainerShape(null, false);
// TODO Auto-generated method stub
return super.getSelection(originalPe, oldSelection);
}
originalPE is never a Connection, only Diagram, ContainerShapes etc.
The method getSelectionInfoForConnection(Connection connection) is responsible for Connections.
Any ideas how to get non-selectable Connections with this method?
One further requirement:
Connections should not be directly selectable by the user, but adding an element per drag and drop from the palette to an existing connection has to be possible (and in this context, the connections shall be highlighted in orange and dotted as always.
[Updated on: Tue, 08 November 2011 11:45] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03342 seconds