org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx Java Examples

The following examples show how to use org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TransitionExpressionEditPart.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createDefaultEditPolicies() {
	super.createDefaultEditPolicies();
	installEditPolicy(EditPolicy.COMPONENT_ROLE, new TransitionExpressionComponentEditPolicy());
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(
			HelpContextIds.SC_PROPERTIES_TRANSITION_EXPRESSION));
	// BUGFIX:
	// https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=26
	installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
		@Override
		protected void replaceHandleDragEditPartsTracker(Handle handle) {
			if (handle instanceof AbstractHandle) {
				AbstractHandle h = (AbstractHandle) handle;
				h.setDragTracker(new DragEditPartsTrackerEx(getHost()) {
					protected boolean isMove() {
						return true;
					};
				});
			}
		}
	});
}
 
Example #2
Source File: CustomPoolEditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public DragTracker getDragTracker(final Request request) {
    return new DragEditPartsTrackerEx(this) {

        /**
         * Don't move on the side.
         *
         * @see org.eclipse.gef.tools.AbstractTool#getLocation()
         */
        @Override
        protected Point getLocation() {
            final Point p = super.getLocation();
            p.x = getStartLocation().x;
            return p;
        }
    };
}
 
Example #3
Source File: CrossflowTextNonResizableEditPolicy.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected List createSelectionHandles() {
	MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
	moveHandle.setBorder(null);
	moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
	return Collections.singletonList(moveHandle);
}
 
Example #4
Source File: ExternalXtextLabelEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Performs direct edit on double click
 */
@Override
public DragTracker getDragTracker(final Request request) {
	return new DragEditPartsTrackerEx(this) {
		protected boolean isMove() {
			return true;
		}

		protected boolean handleDoubleClick(int button) {
			performDirectEditRequest(request);
			return super.handleDoubleClick(button);
		}
	};
}
 
Example #5
Source File: ProcessTextNonResizableEditPolicy.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected List createSelectionHandles() {
	MoveHandle moveHandle = new MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());
	moveHandle.setBorder(null);
	moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
	return Collections.singletonList(moveHandle);
}