use of org.talend.designer.gefabstractmap.part.VarTablePart in project tdi-studio-se by Talend.
the class VarColumnAnchor method getReferencePoint.
@Override
public Point getReferencePoint() {
Point ref = null;
final VarTablePart varTablePart = (VarTablePart) MapperUtils.getMapperTablePart(entityManager.getEditPart());
if (entityManager.isTableMinimized()) {
if (isSource) {
ref = varTablePart.getFigure().getBounds().getRight();
} else {
ref = varTablePart.getFigure().getBounds().getLeft();
}
} else if (getOwner() instanceof TableTreeEntityFigure) {
TableTreeEntityFigure nodeFigure = (TableTreeEntityFigure) getOwner();
// normal column
if (nodeFigure.getTreeBranch() == null) {
if (isSource) {
ref = getOwner().getBounds().getRight();
} else {
if (nodeFigure.getElement() != null) {
ref = nodeFigure.getElement().getBounds().getLeft();
} else {
ref = getOwner().getBounds().getLeft();
}
}
getOwner().translateToAbsolute(ref);
}
} else if (getOwner() instanceof VarEntityFigure) {
VarEntityFigure varNodeFigure = (VarEntityFigure) getOwner();
if (isSource) {
ref = getOwner().getBounds().getRight();
ref.x = varTablePart.getFigure().getBounds().getRight().x;
} else {
if (varNodeFigure.getExpression() != null) {
ref = varNodeFigure.getExpression().getBounds().getLeft();
} else {
ref = getOwner().getBounds().getLeft();
}
}
getOwner().translateToAbsolute(ref);
} else {
ref = getOwner().getBounds().getCenter();
getOwner().translateToAbsolute(ref);
}
return ref;
}
Aggregations