use of com.cubrid.common.ui.er.commands.MoveTableCommand in project cubrid-manager by CUBRID.
the class SchemaXYLayoutPolicy method createChangeConstraintCommand.
@Override
protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
if (!(child instanceof TablePart) || !(constraint instanceof Rectangle)) {
return null;
}
TablePart tablePart = (TablePart) child;
ERTable erTable = tablePart.getTable();
TableFigure figure = (TableFigure) tablePart.getFigure();
Rectangle oldBounds = figure.getBounds();
Rectangle newBounds = (Rectangle) constraint;
if (oldBounds.width != newBounds.width && newBounds.width != -1) {
return null;
} else if (oldBounds.height != newBounds.height && newBounds.height != -1) {
return null;
}
return new MoveTableCommand(erTable, oldBounds.getCopy(), newBounds.getCopy());
}
Aggregations