@Override protected EditPolicy createChildEditPolicy(EditPart child) { BControl control = (BControl) child.getModel(); ResizableEditPolicy policy = new ResizableEditPolicy(); BAttributeWidth atrWidth = (BAttributeWidth) control.getAttributes().get(AttributeConstants.ATTRIBUTE_WIDTH); BAttributeHeight atrHeight = (BAttributeHeight) control.getAttributes().get(AttributeConstants.ATTRIBUTE_HEIGHT); if (atrWidth.isEditable() && atrHeight.isEditable()) return policy; if (atrWidth.isEditable()) { policy.setResizeDirections(PositionConstants.EAST_WEST); return policy; } if (atrHeight.isEditable()) { policy.setResizeDirections(PositionConstants.NORTH_SOUTH); return policy; } policy.setResizeDirections(0); return policy; }
/** @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.WEST | PositionConstants.EAST); } return result; }
/** @generated NOT Drag not allowed */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); ep.setDragAllowed(false); } return result; }
/** @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#addSelectionHandles() */ protected void addSelectionHandles() { super.addSelectionHandles(); Iterator iter = handles.iterator(); while (iter.hasNext()) { Handle handle = (Handle) iter.next(); if (handle.getDragTracker().getClass() == DragEditPartsTracker.class) replaceHandleDragEditPartsTracker(handle); } }
/** @see org.eclipse.gef.EditPolicy#showSourceFeedback(org.eclipse.gef.Request) */ public void showSourceFeedback(Request request) { if (RequestConstants.REQ_DROP.equals(request.getType())) showChangeBoundsFeedback((ChangeBoundsRequest) request); else super.showSourceFeedback(request); }
/** @generated */ public EditPolicy getPrimaryDragEditPolicy() { // #265822 Improve appearance of selection feedback ResizableEditPolicy result = new U2TResizableShapeEditPolicy(); result.setResizeDirections(PositionConstants.NONE); return result; }