Possible bug with BoxRelativeAnchor [message #1385329] |
Thu, 05 June 2014 16:22 |
Simone Di Cola Messages: 60 Registered: February 2014 |
Member |
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04877 seconds