Search in sources :

Example 6 with TableFigure

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);
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure)

Example 7 with TableFigure

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();
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) Rectangle(org.eclipse.draw2d.geometry.Rectangle) Point(org.eclipse.draw2d.geometry.Point)

Example 8 with TableFigure

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;
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) Iterator(java.util.Iterator) Rectangle(org.eclipse.draw2d.geometry.Rectangle) ERTable(com.cubrid.common.ui.er.model.ERTable) LinkedList(java.util.LinkedList) List(java.util.List)

Example 9 with TableFigure

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);
    }
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) RelationshipPart(com.cubrid.common.ui.er.part.RelationshipPart) Node(org.eclipse.draw2d.graph.Node) Rectangle(org.eclipse.draw2d.geometry.Rectangle)

Example 10 with TableFigure

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();
    }
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) ConnectionFigure(com.cubrid.common.ui.er.figures.ConnectionFigure) Color(org.eclipse.swt.graphics.Color)

Aggregations

TableFigure (com.cubrid.common.ui.er.figures.TableFigure)18 Rectangle (org.eclipse.draw2d.geometry.Rectangle)8 EditableLabel (com.cubrid.common.ui.er.figures.EditableLabel)6 ERTable (com.cubrid.common.ui.er.model.ERTable)6 Iterator (java.util.Iterator)4 List (java.util.List)4 EventObject (java.util.EventObject)3 LinkedList (java.util.LinkedList)3 TablePart (com.cubrid.common.ui.er.part.TablePart)2 Point (org.eclipse.draw2d.geometry.Point)2 ValidationGraphicalViewer (com.cubrid.common.ui.er.ValidationGraphicalViewer)1 ValidationMessageHandler (com.cubrid.common.ui.er.ValidationMessageHandler)1 MoveTableCommand (com.cubrid.common.ui.er.commands.MoveTableCommand)1 ERDirectEditManager (com.cubrid.common.ui.er.directedit.ERDirectEditManager)1 LabelCellEditorLocator (com.cubrid.common.ui.er.directedit.LabelCellEditorLocator)1 TableNameCellEditorValidator (com.cubrid.common.ui.er.directedit.TableNameCellEditorValidator)1 TableNameCellEditor (com.cubrid.common.ui.er.editor.TableNameCellEditor)1 ConnectionFigure (com.cubrid.common.ui.er.figures.ConnectionFigure)1 RelationshipPart (com.cubrid.common.ui.er.part.RelationshipPart)1 SchemaDiagramPart (com.cubrid.common.ui.er.part.SchemaDiagramPart)1