use of org.talend.designer.core.ui.editor.connections.TalendBorderItemRectilinearRouter in project tdi-studio-se by Talend.
the class NodePart method getSourceConnectionAnchor.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
*/
@Override
public ConnectionAnchor getSourceConnectionAnchor(final Request request) {
if (!DesignerPlugin.getDefault().getPreferenceStore().getBoolean(TalendDesignerPrefConstants.EDITOR_LINESTYLE)) {
return new ChopboxAnchor(getFigure());
}
if (!(request instanceof CreateConnectionRequest)) {
if (request instanceof ReconnectRequest) {
IFigure figure = ((ReconnectRequest) request).getConnectionEditPart().getFigure();
if (figure instanceof ConnectionFigure) {
((ConnectionFigure) figure).setConnectionRouter(new TalendBorderItemRectilinearRouter(request));
}
}
return new ChopboxAnchor(getFigure());
}
CreateConnectionRequest connReq = (CreateConnectionRequest) request;
Node source = (Node) ((NodePart) connReq.getSourceEditPart()).getModel();
// Node target = (Node) ((NodePart) connReq.getTargetEditPart()).getModel();
// // System.out.println("getSource=> location:" + connReq.getLocation() + " / source:" + source.getLocation() +
// "
// // / target:"
// // + target.getLocation());
sourceAnchor = new DummyNodeAnchor((NodeFigure) getFigure(), source, false);
return sourceAnchor;
}
use of org.talend.designer.core.ui.editor.connections.TalendBorderItemRectilinearRouter in project tdi-studio-se by Talend.
the class NodePart method getTargetConnectionAnchor.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.Request)
*/
@Override
public ConnectionAnchor getTargetConnectionAnchor(final Request request) {
if (!DesignerPlugin.getDefault().getPreferenceStore().getBoolean(TalendDesignerPrefConstants.EDITOR_LINESTYLE)) {
return new ChopboxAnchor(getFigure());
}
if (!(request instanceof CreateConnectionRequest)) {
if (request instanceof ReconnectRequest) {
IFigure figure = ((ReconnectRequest) request).getConnectionEditPart().getFigure();
if (figure instanceof ConnectionFigure) {
((ConnectionFigure) figure).setConnectionRouter(new TalendBorderItemRectilinearRouter(request));
}
}
return new ChopboxAnchor(getFigure());
}
CreateConnectionRequest connReq = (CreateConnectionRequest) request;
Node source = (Node) ((NodePart) connReq.getSourceEditPart()).getModel();
Node target = (Node) ((NodePart) connReq.getTargetEditPart()).getModel();
// // + target.getLocation());
if (sourceAnchor != null) {
sourceAnchor.setTarget(target);
}
return new DummyNodeAnchor((NodeFigure) getFigure(), source, target, true);
}
Aggregations