use of com.cubrid.common.ui.er.figures.TableFigure 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());
}
use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method setTableModelBounds.
public boolean setTableModelBounds() {
List tableParts = getChildren();
for (Iterator iter = tableParts.iterator(); iter.hasNext(); ) {
Object obj = iter.next();
if (!(obj instanceof TablePart)) {
continue;
}
TablePart tablePart = (TablePart) obj;
TableFigure tableFigure = (TableFigure) tablePart.getFigure();
if (tableFigure == null) {
continue;
}
Rectangle bounds = tableFigure.getBounds().getCopy();
ERTable erTable = tablePart.getTable();
erTable.setBounds(bounds);
}
return true;
}
use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method getRectangle.
public Rectangle getRectangle() {
Rectangle rec = new Rectangle(0, 0, 0, 0);
List tableParts = getChildren();
for (Iterator iter = tableParts.iterator(); iter.hasNext(); ) {
Object obj = iter.next();
if (!(obj instanceof TablePart)) {
continue;
}
TablePart tablePart = (TablePart) obj;
TableFigure tableFigure = (TableFigure) tablePart.getFigure();
if (tableFigure == null) {
continue;
}
LayoutUtil.unionAndExpand(rec, tableFigure.getBounds());
}
return rec;
}
Aggregations