use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.
the class SchemaXYLayoutPolicy method getCurrentConstraintFor.
@Override
public Rectangle getCurrentConstraintFor(GraphicalEditPart child) {
IFigure fig = child.getFigure();
Rectangle rectangle = (Rectangle) fig.getParent().getLayoutManager().getConstraint(fig);
if (rectangle == null) {
rectangle = fig.getBounds();
}
return rectangle;
}
use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.
the class TableEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest request) {
TablePart tablePart = (TablePart) getHost();
Rectangle bounds = tablePart.getFigure().getBounds().getCopy();
ERSchema parent = (ERSchema) (tablePart.getParent().getModel());
DeleteTableCommand deleteCmd = new DeleteTableCommand();
deleteCmd.setSchema(parent);
deleteCmd.setTable((ERTable) (tablePart.getModel()));
deleteCmd.setOriginalBounds(bounds);
return deleteCmd;
}
use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.
the class ERConnectionAnchor method getLocation.
public Point getLocation(Point reference) {
Rectangle rect = getOwner().getBounds().getCopy();
this.getOwner().translateToAbsolute(rect);
if (anchor == UP) {
return rect.getTopLeft().translate(new Double(rect.width * offsetPercent).intValue(), 0);
} else if (anchor == RIGHT) {
return rect.getTopRight().translate(0, new Double(rect.height * offsetPercent).intValue());
} else if (anchor == DOWN) {
return rect.getBottomLeft().translate(new Double(rect.width * offsetPercent).intValue(), 0);
} else if (anchor == LEFT) {
return rect.getTopLeft().translate(0, new Double(rect.height * offsetPercent).intValue());
}
return null;
}
use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.
the class TablePart method createFigure.
protected IFigure createFigure() {
ERTable erTable = getTable();
EditableLabel label = new EditableLabel(erTable.getShownName());
TableFigure tableFigure = new TableFigure(label);
Rectangle rec = erTable.getBounds();
if (rec != null) {
tableFigure.setBounds(rec);
}
return tableFigure;
}
use of org.eclipse.draw2d.geometry.Rectangle in project cubrid-manager by CUBRID.
the class TablePart method refreshVisuals.
public void refreshVisuals() {
TableFigure tableFigure = (TableFigure) getFigure();
Point location = tableFigure.getLocation();
SchemaDiagramPart parent = (SchemaDiagramPart) getParent();
Rectangle constraint = new Rectangle(location.x, location.y, -1, -1);
parent.setLayoutConstraint(this, tableFigure, constraint);
super.refreshVisuals();
}
Aggregations