use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class TablePart method setSelected.
/**
* Sets the width of the line when selected
*/
public void setSelected(int value) {
super.setSelected(value);
TableFigure tableFigure = (TableFigure) getFigure();
if (isSelected()) {
tableFigure.setSelected(true);
setRelationLinesFocus(true);
} else {
tableFigure.setSelected(false);
setRelationLinesFocus(false);
}
boolean checkRelatedSelectedTable = !isSelected();
setRelationLinesSyncColor(checkRelatedSelectedTable);
}
use of com.cubrid.common.ui.er.figures.TableFigure 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();
}
use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method setTableFigureBounds.
public boolean setTableFigureBounds(boolean updateConstraint) {
List tableParts = getChildren();
for (Iterator iter = tableParts.iterator(); iter.hasNext(); ) {
TablePart tablePart = (TablePart) iter.next();
ERTable erTable = tablePart.getTable();
Rectangle bounds = erTable.getBounds();
if (bounds == null) {
return false;
} else {
TableFigure tableFigure = (TableFigure) tablePart.getFigure();
if (tableFigure == null) {
return false;
} else if (updateConstraint) {
delegatingLayoutManager.setXYLayoutConstraint(tableFigure, new Rectangle(bounds.x, bounds.y, -1, -1));
}
}
}
return true;
}
use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class ERGraphLayoutVisitor method setFigureBounds.
private void setFigureBounds(TablePart tablePart, int absStartX, int absStartY) {
Node node = (Node) partNodesMap.get(tablePart);
TableFigure tableFigure = (TableFigure) tablePart.getFigure();
Rectangle bounds = new Rectangle(absStartX + node.x, absStartY + node.y, tableFigure.getPreferredSize().width, tableFigure.getPreferredSize().height);
tableFigure.setBounds(bounds);
for (int i = 0; i < tablePart.getSourceConnections().size(); i++) {
RelationshipPart relationship = (RelationshipPart) tablePart.getSourceConnections().get(i);
setFigureConstraint(relationship);
}
}
use of com.cubrid.common.ui.er.figures.TableFigure in project cubrid-manager by CUBRID.
the class RelationshipPart method setSyncColorWithTable.
/**
* Set the connection color by the table border color,if the table border
* color.
*
* @param tablePart
*/
public void setSyncColorWithTable(TablePart tablePart) {
TableFigure tableFigure = (TableFigure) tablePart.getFigure();
ConnectionFigure line = (ConnectionFigure) this.getFigure();
if (!tableFigure.isNormalState()) {
Color color = tableFigure.getBorderColor();
this.getFigure().setForegroundColor(color);
} else if (this.isSelected()) {
line.setSelected(true);
} else {
line.setDefaultState();
}
}
Aggregations