use of org.talend.designer.gefabstractmap.figures.table.entity.TableEntityFigure in project tdi-studio-se by Talend.
the class RowSelectionEditPolicy method getLocatorFigure.
private IFigure getLocatorFigure(GraphicalEditPart owner) {
IFigure figure = owner.getFigure();
if (owner instanceof TableEntityPart) {
TableEntityFigure treeNodeFigure = (TableEntityFigure) figure;
// table figure to restrict the width
MapperTablePart abstractInOutTreePart = MapperUtils.getMapperTablePart((TableEntityPart) owner);
IFigure parentFigure = ((GraphicalEditPart) abstractInOutTreePart).getFigure();
Rectangle treeBounds = parentFigure.getBounds();
Rectangle rowBounds = treeNodeFigure.getElement().getBounds();
Rectangle treeNodeBounds = figure.getBounds();
figure = new Figure();
if (treeBounds.x + 1 != treeNodeBounds.x || treeNodeBounds.width > treeBounds.width) {
figure.setBounds(new Rectangle(treeBounds.x + 1, treeNodeBounds.y, treeBounds.width - 2, rowBounds.height));
return figure;
} else {
figure.setBounds(owner.getFigure().getBounds().getCopy());
figure.getBounds().height = rowBounds.height;
return figure;
}
} else if (figure instanceof VarEntityFigure) {
Rectangle copy = figure.getBounds().getCopy();
figure = new Figure();
figure.setBounds(copy);
return figure;
}
return owner.getFigure();
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableEntityFigure in project tdi-studio-se by Talend.
the class TreeExpandSupportEditPolicy method activate.
@Override
public void activate() {
super.activate();
TableEntityPart host = (TableEntityPart) getHost();
if (host.getFigure() instanceof TableEntityFigure) {
TableTreeEntityFigure treeNodeFigure = (TableTreeEntityFigure) host.getFigure();
if (treeNodeFigure.getTreeBranch() != null) {
ExpandCollapseFigure ecFigure = treeNodeFigure.getTreeBranch().getExpandCollapseFigure();
if (ecFigure != null) {
ecFigure.addMouseListener(l);
}
}
}
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableEntityFigure in project tdi-studio-se by Talend.
the class LookupColumnAnchor method getReferencePoint.
@Override
public Point getReferencePoint() {
if (connectionPart == null) {
return getOwner().getBounds().getLeft();
}
MapperTablePart mapperTablePart = MapperUtils.getMapperTablePart(entityManager.getEditPart());
Point ref = null;
if (mapperTablePart != null && entityManager.isTableMinimized()) {
ref = mapperTablePart.getFigure().getBounds().getLeft();
} else {
if (getOwner() == null) {
return null;
} else if (getOwner() instanceof TableEntityFigure) {
TableEntityFigure nodeFigure = (TableEntityFigure) getOwner();
if (nodeFigure.getElement() != null) {
ref = nodeFigure.getElement().getBounds().getLeft();
getOwner().translateToAbsolute(ref);
}
} else {
ref = getOwner().getBounds().getCenter();
getOwner().translateToAbsolute(ref);
}
}
if (mapperTablePart != null && ref != null) {
IFigure treeFigure = mapperTablePart.getFigure();
int avialableX = treeFigure.getBounds().x;
if (ref.x < avialableX) {
ref.x = avialableX;
}
}
if (connectionPart instanceof BaseConnectionEditPart && connectionPart.getFigure() instanceof PolylineConnection) {
BaseConnectionEditPart baseConnectionPart = (BaseConnectionEditPart) connectionPart;
PolylineConnection connFigure = (PolylineConnection) connectionPart.getFigure();
org.eclipse.swt.graphics.Point avilableSize = entityManager.getGraphicalViewer().getControl().getSize();
if (ref != null) {
if (ref.y < 0) {
if (!(baseConnectionPart instanceof LookupConnectionPart)) {
ref.y = 0;
}
baseConnectionPart.setTargetContained(false);
if (baseConnectionPart.isDOTStyle()) {
connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
} else {
connFigure.setLineStyle(SWT.LINE_SOLID);
}
} else if (ref.y > avilableSize.y) {
if (!(baseConnectionPart instanceof LookupConnectionPart)) {
ref.y = avilableSize.y;
}
baseConnectionPart.setTargetContained(false);
if (baseConnectionPart.isDOTStyle()) {
connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
} else {
connFigure.setLineStyle(SWT.LINE_SOLID);
}
} else {
baseConnectionPart.setTargetContained(true);
if (!baseConnectionPart.isDOTStyle()) {
connFigure.setLineStyle(SWT.LINE_SOLID);
}
}
}
}
return ref;
}
use of org.talend.designer.gefabstractmap.figures.table.entity.TableEntityFigure in project tdi-studio-se by Talend.
the class SearchZoneMapper method getMatcherNodeFigure.
private Map<Integer, Figure> getMatcherNodeFigure(AbstractNode node) {
Map<Integer, Figure> map = new HashMap<Integer, Figure>();
int i = -1;
TableEntityFigure figure = null;
if (node != null) {
EList<Adapter> adapter = node.eAdapters();
if (adapter.size() > 0) {
if (adapter.get(0) instanceof TableEntityPart) {
TableEntityPart tableEntityPart = (TableEntityPart) adapter.get(0);
if (tableEntityPart != null && tableEntityPart.getFigure() != null && tableEntityPart.getFigure() instanceof TableEntityFigure) {
figure = (TableEntityFigure) tableEntityPart.getFigure();
}
}
}
if (node.getExpression() != null && matcher.matches(node.getExpression())) {
i++;
map.put(i, figure);
} else if (node.getName() != null && matcher.matches(node.getName())) {
i++;
map.put(i, figure);
}
}
return map;
}
Aggregations