use of org.eclipse.gef.handles.ResizeHandle in project whole by wholeplatform.
the class WholeNonResizableEditPolicy method createHandle.
public Handle createHandle(GraphicalEditPart owner, int direction, DragTracker tracker, Cursor cursor) {
ResizeHandle handle = new ResizeHandle(owner, direction) {
protected Color getBorderColor() {
return ColorConstants.black;
}
protected Color getFillColor() {
return (isPrimary()) ? FigureConstants.lightBlueColor : ColorConstants.white;
}
public void paintFigure(Graphics g) {
Rectangle r = getBounds();
r.shrink(1, 1);
try {
g.setBackgroundColor(getFillColor());
g.fillOval(r.x, r.y, r.width, r.height);
g.setForegroundColor(getBorderColor());
g.drawOval(r.x, r.y, r.width, r.height);
} finally {
r.expand(1, 1);
}
}
};
handle.setCursor(cursor);
handle.setDragTracker(tracker);
return handle;
}
Aggregations