use of org.whole.lang.ui.editpolicies.WholeNonResizableEditPolicy.FeedbackImageFigure in project whole by wholeplatform.
the class WholeResizableEditPolicy method createDragSourceFeedbackFigure.
@Override
protected IFigure createDragSourceFeedbackFigure() {
IFigure figure = new FeedbackImageFigure(WholeNonResizableEditPolicy.createFeedbackImage((IGraphicalEntityPart) getHost(), FeedbackImageFigure.ALPHA, true, FitToScreenStrategy.instance())) {
@Override
protected void paintFigure(Graphics graphics) {
Rectangle area = getClientArea();
org.eclipse.swt.graphics.Rectangle imageBounds = getImage().getBounds();
// graphics.drawImage(getImage(), area.x + ix, area.y + iy);
graphics.drawImage(getImage(), 0, 0, imageBounds.width, imageBounds.height, area.x, area.y, Math.max(0, area.width), Math.max(0, area.height));
}
};
figure.setBounds(getInitialFeedbackBounds());
addFeedback(figure);
return figure;
}
Aggregations