use of org.eclipse.gef.tools.ResizeTracker in project archi by archimatetool.
the class ConstrainedResizableEditPolicy method getResizeTracker.
@Override
protected ResizeTracker getResizeTracker(int direction) {
return new ResizeTracker((GraphicalEditPart) getHost(), direction) {
@Override
protected Request createSourceRequest() {
ChangeBoundsRequest request = new ChangeBoundsRequest(REQ_RESIZE) {
@Override
public boolean isConstrainedResize() {
return super.isConstrainedResize();
// return getCurrentInput().isModKeyDown(SWT.SHIFT) ? false : true;
}
@Override
public boolean isCenteredResize() {
return super.isCenteredResize();
// return false;
}
@Override
public boolean isSnapToEnabled() {
return super.isSnapToEnabled();
// int direction = getResizeDirection();
// if(direction == PositionConstants.EAST) {
// return super.isSnapToEnabled();
// }
// return false;
}
};
request.setResizeDirection(getResizeDirection());
return request;
}
@Override
protected Dimension getMinimumSizeFor(ChangeBoundsRequest request) {
return MIN_DIMENSION;
}
};
}
Aggregations