use of com.cubrid.common.ui.er.model.ERTable in project cubrid-manager by CUBRID.
the class TablePart method revertNameChange.
public void revertNameChange() {
TableFigure tableFigure = (TableFigure) getFigure();
EditableLabel label = tableFigure.getNameLabel();
ERTable erTable = getTable();
label.setText(erTable.getShownName());
label.setVisible(true);
refreshVisuals();
}
use of com.cubrid.common.ui.er.model.ERTable 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.model.ERTable 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.model.ERTable in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method clearNeedPartitionLayoutState.
public void clearNeedPartitionLayoutState() {
List tableParts = getChildren();
for (Iterator iter = tableParts.iterator(); iter.hasNext(); ) {
TablePart tablePart = (TablePart) iter.next();
ERTable erTable = tablePart.getTable();
if (erTable.isNeedPartitionLayout()) {
erTable.setNeedPartitionLayout(false);
}
}
}
use of com.cubrid.common.ui.er.model.ERTable in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method getNeedPartitionLayoutTables.
public List<TablePart> getNeedPartitionLayoutTables() {
List<TablePart> result = new LinkedList<TablePart>();
List tableParts = getChildren();
for (Iterator iter = tableParts.iterator(); iter.hasNext(); ) {
Object obj = iter.next();
if (!(obj instanceof TablePart)) {
continue;
}
TablePart tablePart = (TablePart) obj;
ERTable erTable = tablePart.getTable();
if (erTable.isNeedPartitionLayout()) {
result.add(tablePart);
}
}
return result;
}
Aggregations