Search in sources :

Example 51 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class RelationshipPart method removeHoverListener.

/**
	 * remove hovering listener for the figure
	 */
protected void removeHoverListener() {
    final IFigure figure = this.getFigure();
    figure.removeMouseMotionListener(hoverListener);
}
Also used : IFigure(org.eclipse.draw2d.IFigure)

Example 52 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class TablePart method addHoverListener.

/**
	 * Add hovering listener for the figure
	 */
protected void addHoverListener() {
    final TablePart tablePart = this;
    final IFigure figure = this.getFigure();
    hoverListener = new MouseMotionListener() {

        public void mouseEntered(MouseEvent me) {
            if (hasChildPartSelected(tablePart) || tablePart.isDisableState()) {
                return;
            }
            setHoverState(true);
            setRelationLinesFocus(true);
            setRelationLinesSyncColor(false);
            figure.revalidate();
        }

        public void mouseExited(MouseEvent me) {
            if (hasChildPartSelected(tablePart) || tablePart.isDisableState()) {
                return;
            }
            setHoverState(false);
            setRelationLinesFocus(false);
            setRelationLinesSyncColor(true);
            figure.revalidate();
        }

        public void mouseHover(MouseEvent me) {
        }

        public void mouseDragged(MouseEvent me) {
        }

        public void mouseMoved(MouseEvent me) {
        }
    };
    figure.addMouseMotionListener(hoverListener);
}
Also used : MouseEvent(org.eclipse.draw2d.MouseEvent) MouseMotionListener(org.eclipse.draw2d.MouseMotionListener) IFigure(org.eclipse.draw2d.IFigure)

Example 53 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class SchemaDiagramPart method moveLastTableLocationFocus.

public boolean moveLastTableLocationFocus() {
    TablePart bottomRightT = getBottomRightTable();
    ERSchemaEditor editor = getEditor();
    if (bottomRightT != null && editor != null) {
        IFigure figure = bottomRightT.getFigure();
        Point point = figure.getBounds().getBottomRight();
        editor.setLocatePoint(point.x, point.y + 160);
        // 160 is the distance between ERD canvas top and the CM/CQB app top
        return true;
    }
    return false;
}
Also used : ERSchemaEditor(com.cubrid.common.ui.er.editor.ERSchemaEditor) Point(org.eclipse.draw2d.geometry.Point) IFigure(org.eclipse.draw2d.IFigure)

Example 54 with IFigure

use of org.eclipse.draw2d.IFigure in project cubrid-manager by CUBRID.

the class ColumnPart method directEditHitTest.

private boolean directEditHitTest(Point requestLoc) {
    IFigure figure = getFigure();
    figure.translateToRelative(requestLoc);
    if (figure.containsPoint(requestLoc)) {
        return true;
    }
    return false;
}
Also used : IFigure(org.eclipse.draw2d.IFigure)

Example 55 with IFigure

use of org.eclipse.draw2d.IFigure in project dbeaver by serge-rider.

the class DiagramXYLayoutPolicy method getCurrentConstraintFor.

/**
	 * Returns the current bounds as the constraint if none can be found in the
	 * figures Constraint object
	 */
@Override
public Rectangle getCurrentConstraintFor(GraphicalEditPart child) {
    IFigure fig = child.getFigure();
    Rectangle rectangle = (Rectangle) fig.getParent().getLayoutManager().getConstraint(fig);
    if (rectangle == null) {
        rectangle = fig.getBounds();
    }
    return rectangle;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

IFigure (org.eclipse.draw2d.IFigure)225 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)61 Rectangle (org.eclipse.draw2d.geometry.Rectangle)42 Point (org.eclipse.draw2d.geometry.Point)36 Dimension (org.eclipse.draw2d.geometry.Dimension)30 PropertyChangeEvent (java.beans.PropertyChangeEvent)25 PropertyChangeListener (java.beans.PropertyChangeListener)25 List (java.util.List)20 Figure (org.eclipse.draw2d.Figure)17 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)13 DefaultSizeNodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure)12 NodeFigure (org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure)12 StackLayout (org.eclipse.draw2d.StackLayout)11 Iterator (java.util.Iterator)10 VType (org.diirt.vtype.VType)10 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)9 OPIColor (org.csstudio.opibuilder.util.OPIColor)9 EditPart (org.eclipse.gef.EditPart)9 ArrayList (java.util.ArrayList)7 Label (org.eclipse.draw2d.Label)7