Search in sources :

Example 1 with ConnectionFigure

use of com.cubrid.common.ui.er.figures.ConnectionFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method setSelected.

/**
	 * Sets the width of the line when selected
	 */
public void setSelected(int value) {
    super.setSelected(value);
    ConnectionFigure line = (ConnectionFigure) this.getFigure();
    line.setSelected(isSelected());
    setRelationLinesFocus(isSelected());
}
Also used : ConnectionFigure(com.cubrid.common.ui.er.figures.ConnectionFigure)

Example 2 with ConnectionFigure

use of com.cubrid.common.ui.er.figures.ConnectionFigure 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)

Example 3 with ConnectionFigure

use of com.cubrid.common.ui.er.figures.ConnectionFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method setSource.

/**
	 * Sets the <i>source</i> of this connection.
	 * 
	 * @param source the source of this connection
	 */
public void setSource(EditPart source) {
    TablePart tablePart = (TablePart) source;
    ConnectionFigure connFigure = (ConnectionFigure) this.getFigure();
    IFigure figure = tablePart == null ? null : tablePart.getFigure();
    connFigure.setSourceFigure(figure);
    super.setSource(source);
}
Also used : ConnectionFigure(com.cubrid.common.ui.er.figures.ConnectionFigure) IFigure(org.eclipse.draw2d.IFigure)

Example 4 with ConnectionFigure

use of com.cubrid.common.ui.er.figures.ConnectionFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method setTarget.

/**
	 * Sets the<i>target</i> of this connection.
	 * 
	 * @param target the target of this connection
	 */
public void setTarget(EditPart target) {
    TablePart tablePart = (TablePart) target;
    ConnectionFigure connFigure = (ConnectionFigure) this.getFigure();
    IFigure figure = tablePart == null ? null : tablePart.getFigure();
    connFigure.setTargetFigure(figure);
    super.setTarget(target);
}
Also used : ConnectionFigure(com.cubrid.common.ui.er.figures.ConnectionFigure) IFigure(org.eclipse.draw2d.IFigure)

Example 5 with ConnectionFigure

use of com.cubrid.common.ui.er.figures.ConnectionFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method createFigure.

@Override
protected IFigure createFigure() {
    TablePart sourceTablePart = (TablePart) this.getSource();
    TablePart targetTablePart = (TablePart) this.getTarget();
    IFigure source = sourceTablePart == null ? null : sourceTablePart.getFigure();
    IFigure target = targetTablePart == null ? null : targetTablePart.getFigure();
    ConnectionFigure conn = new ConnectionFigure(source, target);
    conn.setConnectionRouter(new ERConnectionRouter());
    conn.setTargetDecoration(new PolygonDecoration());
    return conn;
}
Also used : ERConnectionRouter(com.cubrid.common.ui.er.router.ERConnectionRouter) PolygonDecoration(org.eclipse.draw2d.PolygonDecoration) ConnectionFigure(com.cubrid.common.ui.er.figures.ConnectionFigure) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

ConnectionFigure (com.cubrid.common.ui.er.figures.ConnectionFigure)5 IFigure (org.eclipse.draw2d.IFigure)3 TableFigure (com.cubrid.common.ui.er.figures.TableFigure)1 ERConnectionRouter (com.cubrid.common.ui.er.router.ERConnectionRouter)1 PolygonDecoration (org.eclipse.draw2d.PolygonDecoration)1 Color (org.eclipse.swt.graphics.Color)1