Possible bug with BoxRelativeAnchor [message #1385329] |
Thu, 05 June 2014 12:22  |
Eclipse User |
|
|
|
Hi all,
I think there is a bug within the class CreateConnectionCommand, package org.eclipse.graphiti.ui.internal.command
In particular, having a shape with a BoxRelativeAnchor, every time I click on it in order to drag and drop a connection without using the palette, the connectionContext contains the following info:
CreateConnectionContext sourceAnchor: org.eclipse.graphiti.mm.pictograms.impl.BoxRelativeAnchorImpl@85091a (visible: true, active: true) (useAnchorLocationAsConnectionEndpoint: false) (relativeWidth: 0.5, relativeHeight: 1.0) targetAnchor: null sourcePictogramElement: org.eclipse.graphiti.mm.pictograms.impl.BoxRelativeAnchorImpl@85091a (visible: true, active: true) (useAnchorLocationAsConnectionEndpoint: false) (relativeWidth: 0.5, relativeHeight: 1.0)
in paricular what is wrong is the sourcePictogramElement section. Indeed, it should be the AnchorContainer, and not the anchor itself.
Finally, the method
public boolean canStartConnection() {
// allow connections only from anchor to anchor
CreateConnectionContext connectionContext = createContext();
sourceLocation = connectionContext.getSourceLocation(); // store
// location for
// later usage
for (IFeature feature : features) {
if (feature instanceof ICreateConnectionFeature) {
ICreateConnectionFeature ccf = (ICreateConnectionFeature) feature;
if (ccf.canStartConnection(connectionContext)) {
return true;
}
} else
return true;
}
return false;
}
when it tries to call anStartConnection(connectionContext) always retrun false (correct).
Am I missing something, or is this a bug?
Thanks
Simone
|
|
|
|
Re: Possible bug with BoxRelativeAnchor [message #1385820 is a reply to message #1385329] |
Wed, 11 June 2014 08:02  |
Eclipse User |
|
|
|
Simone,
not sure...
What does the metod createContext() do? It seems to fill the
connectionContext you are using afterwards. And what are the features list
you are looping over?
Usually I would have expected that the create connection context passed to
the canStartConnection method should contain the necessary information, e.g.
the shape you can start to search for the anchor to use.
Michael
|
|
|
Powered by
FUDForum. Page generated in 3.42606 seconds