use of org.knime.workbench.editor2.editparts.NodeAnnotationEditPart in project knime-core by knime.
the class SnapIconToGrid method getReferencePart.
/**
* Returns the part the request started on (the part that was dragged to move all selected nodes).
* @param parts
* @param mouseLoc
* @param moveDelta
* @return
*/
private EditPart getReferencePart(@SuppressWarnings("rawtypes") final List parts, final Point mouseLoc, final Point moveDelta) {
int i = 0;
Point loc = mouseLoc.getCopy().translate(moveDelta.getCopy().negate());
makeRelative(m_container.getContentPane(), loc);
while (i < parts.size()) {
GraphicalEditPart result = (GraphicalEditPart) parts.get(i);
if (result.getFigure().containsPoint(loc)) {
return result;
}
if (result instanceof NodeContainerEditPart) {
NodeAnnotationEditPart annoPart = ((NodeContainerEditPart) result).getNodeAnnotationEditPart();
if (annoPart.getFigure().containsPoint(loc)) {
return annoPart;
}
}
i++;
}
return null;
}
Aggregations