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);
}
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);
}
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;
}
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;
}
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;
}
Aggregations