use of org.eclipse.draw2d.Figure in project tdi-studio-se by Talend.
the class TableEntityFigure method paintLines.
protected void paintLines(TableEntityFigure entity, Graphics graphics) {
graphics.drawLine(entity.getElementBounds().x, entity.getElementBounds().getBottom().y - 1, entity.getElementBounds().getRight().x, entity.getElementBounds().getBottom().y - 1);
List children = entity.getElement().getChildren();
for (int i = 0; i < children.size() - 1; i++) {
Figure child = (Figure) children.get(i);
Rectangle childBounds = child.getBounds();
graphics.drawLine(childBounds.getTopRight(), childBounds.getBottomRight());
}
// final Rectangle expBounds = getElementBounds();
// graphics.drawLine(expBounds.x + expBounds.width, expBounds.y, expBounds.x + expBounds.width, getBounds().y
// + getBounds().height);
// paintChildrenLines(this, graphics);
}
use of org.eclipse.draw2d.Figure 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.eclipse.draw2d.Figure in project tdi-studio-se by Talend.
the class ErDiagramPart method createFigure.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
Figure figure = new FreeformLayer();
figure.setLayoutManager(new FreeformLayout());
fig2 = new FreeformLayer();
getLayer(ErDiagramRootEditPart.PROCESS_BACKGROUND_LAYER).add(fig2);
return figure;
}
use of org.eclipse.draw2d.Figure in project dbeaver by serge-rider.
the class DiagramXYLayoutPolicy method createChangeConstraintCommand.
/**
* Creates command to move table. Does not allow table to be resized
*/
@Override
protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
if (!(child instanceof NodePart))
return null;
if (!(constraint instanceof Rectangle))
return null;
NodePart nodePart = (NodePart) child;
Figure figure = (Figure) nodePart.getFigure();
Rectangle oldBounds = figure.getBounds();
Rectangle newBounds = (Rectangle) constraint;
// Restrict resize for entities
if (nodePart instanceof EntityPart) {
if (oldBounds.width != newBounds.width && newBounds.width != -1)
return null;
if (oldBounds.height != newBounds.height && newBounds.height != -1)
return null;
}
return new NodeMoveCommand(nodePart, oldBounds.getCopy(), newBounds.getCopy());
}
use of org.eclipse.draw2d.Figure in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method createFigure.
protected IFigure createFigure() {
Figure figure = new SchemaFigure();
delegatingLayoutManager = new DelegatingLayoutManager(this);
figure.setLayoutManager(delegatingLayoutManager);
return figure;
}
Aggregations