use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.
the class ColumnPart method handleLabelChange.
/**
* Handles when successfully applying direct edit
*/
@Override
protected void handleLabelChange(PropertyChangeEvent evt) {
ERTableColumn newColumn = getColumn();
EditableLabel label = (EditableLabel) getFigure();
label.setText(newColumn.getLabelText());
label.setPK(newColumn.isPrimaryKey());
freshIcon();
freshBorder();
label.revalidate();
}
use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.
the class RelationshipPart method handleDeleteConnection.
public void handleDeleteConnection() {
Relationship relations = (Relationship) this.getModel();
TablePart sourceTablePart = (TablePart) this.getSource();
TablePart targetTablePart = (TablePart) this.getTarget();
// set source and target columns
if (sourceTablePart != null) {
List<EditPart> children = sourceTablePart.getChildren();
for (EditPart child : children) {
if (!(child instanceof ColumnPart)) {
continue;
}
ColumnPart columnPart = (ColumnPart) child;
ERTableColumn column = (ERTableColumn) columnPart.getModel();
if (relations.getReferenceColumns().contains(column.getName())) {
EditableLabel columnLable = (EditableLabel) columnPart.getFigure();
columnLable.setFontProtrude(false);
}
}
}
// target
if (targetTablePart != null) {
List<EditPart> children = targetTablePart.getChildren();
for (EditPart child : children) {
if (!(child instanceof ColumnPart)) {
continue;
}
ColumnPart columnPart = (ColumnPart) child;
ERTableColumn column = (ERTableColumn) columnPart.getModel();
if (relations.getReferencedPKs().contains(column.getName())) {
EditableLabel columnLable = (EditableLabel) columnPart.getFigure();
columnLable.setFontProtrude(false);
}
}
}
}
use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.
the class TablePart method handleNameChange.
public void handleNameChange(String value) {
TableFigure tableFigure = (TableFigure) getFigure();
EditableLabel label = tableFigure.getNameLabel();
label.setVisible(false);
refreshVisuals();
}
use of com.cubrid.common.ui.er.figures.EditableLabel 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.figures.EditableLabel in project cubrid-manager by CUBRID.
the class TablePart method directEditHitTest.
private boolean directEditHitTest(Point requestLoc) {
TableFigure figure = (TableFigure) getFigure();
EditableLabel nameLabel = figure.getNameLabel();
nameLabel.translateToRelative(requestLoc);
if (nameLabel.containsPoint(requestLoc)) {
return true;
}
return false;
}
Aggregations