当前位置: 首页>>代码示例>>Java>>正文


Java DragTracker类代码示例

本文整理汇总了Java中org.eclipse.gef.DragTracker的典型用法代码示例。如果您正苦于以下问题:Java DragTracker类的具体用法?Java DragTracker怎么用?Java DragTracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DragTracker类属于org.eclipse.gef包,在下文中一共展示了DragTracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createResizeHandle

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void createResizeHandle(List handles, final int direction) {
	handles.add(new ResizeHandle(getHost(), direction) {
		@Override
		protected DragTracker createDragTracker() {
			return new ResizeTracker(getHost(), direction) {
				@Override
				public void mouseDrag(MouseEvent event, EditPartViewer viewer) {
					event.stateMask |= SWT.SHIFT;
					super.mouseDrag(event, viewer);
				}
			};
		};
	});
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:FixedAspectRatioResizableEditPolicy.java

示例2: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Performs direct edit on double click
 */
@Override
public DragTracker getDragTracker(final Request request) {
	if (request instanceof SelectionRequest
			&& ((SelectionRequest) request).getLastButtonPressed() == 3)
		return null;
	IDoubleClickCallback callback = new IDoubleClickCallback() {

		@Override
		public void handleDoubleClick(int btn) {
			performDirectEditRequest(request);
		}
	};
	return new DoubleClickDirectEditDragTracker(this,
			getTopGraphicEditPart(), callback);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:TextAwareLabelEditPart.java

示例3: addCornerAndSideHandles

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Fills the given List with handles at each corner and side of a figure.
 * 
 * @param part
 *            the handles' GraphicalEditPart
 * @param handles
 *            the List to add the four corner handles to
 * @param tracker
 *            the handles' DragTracker
 * @param cursor
 *            the handles' Cursor
 * @since 3.7
 */
public static void addCornerAndSideHandles(GraphicalEditPart part,
		List handles, DragTracker tracker, Cursor cursor) {
	handles.add(createHandle(part, PositionConstants.EAST, tracker, cursor));
	handles.add(createHandle(part, PositionConstants.SOUTH_EAST, tracker,
			cursor));
	handles.add(createHandle(part, PositionConstants.SOUTH, tracker, cursor));
	handles.add(createHandle(part, PositionConstants.SOUTH_WEST, tracker,
			cursor));
	handles.add(createHandle(part, PositionConstants.WEST, tracker, cursor));
	handles.add(createHandle(part, PositionConstants.NORTH_WEST, tracker,
			cursor));
	handles.add(createHandle(part, PositionConstants.NORTH, tracker, cursor));
	handles.add(createHandle(part, PositionConstants.NORTH_EAST, tracker,
			cursor));
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:29,代码来源:ResizableHandleKit.java

示例4: findHandleAt

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
 */
public Handle findHandleAt(org.eclipse.draw2d.geometry.Point p) {
	final GraphicalEditPart gep = (GraphicalEditPart) findObjectAtExcluding(
			p, new ArrayList());
	if (gep == null || !(gep instanceof GuideEditPart))
		return null;
	return new Handle() {
		public DragTracker getDragTracker() {
			return ((GuideEditPart) gep).getDragTracker(null);
		}

		public org.eclipse.draw2d.geometry.Point getAccessibleLocation() {
			return null;
		}
	};
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:RulerComposite.java

示例5: setDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Sets the drag tracker for this SelectionTool. If the current drag tracker
 * is not <code>null</code>, this method deactivates it. If the new drag
 * tracker is not <code>null</code>, this method will activate it and set
 * the {@link EditDomain} and {@link EditPartViewer}.
 * 
 * @param newDragTracker
 *            the new drag tracker
 */
public void setDragTracker(DragTracker newDragTracker) {
	if (newDragTracker == dragTracker)
		return;
	if (dragTracker != null)
		dragTracker.deactivate();
	dragTracker = newDragTracker;

	// if (!getCurrentInput().isMouseButtonDown(3))
	// setMouseCapture(dragTracker != null);
	if (newDragTracker != null) {
		newDragTracker.setEditDomain(getDomain());
		newDragTracker.activate();
		newDragTracker.setViewer(getCurrentViewer());
	}

	refreshCursor();
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:27,代码来源:SelectionTool.java

示例6: addCornerHandles

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Fills the given List with handles at each corner of a figure.
 * 
 * @param part
 *            the handles' GraphicalEditPart
 * @param handles
 *            the List to add the four corner handles to
 * @param tracker
 *            the handles' DragTracker
 * @param cursor
 *            the handles' Cursor
 */
public static void addCornerHandles( GraphicalEditPart part, List handles,
		DragTracker tracker, Cursor cursor )
{
	handles.add( createHandle( part,
			PositionConstants.SOUTH_EAST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.SOUTH_WEST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.NORTH_WEST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.NORTH_EAST,
			tracker,
			cursor ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:33,代码来源:ReportNonResizableHandleKit.java

示例7: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
@Override
public DragTracker getDragTracker(Request request) {
	return new DragEditPartsTracker(this) {
		protected EditPart getTargetEditPart() {
			return getParent();
		}
	};
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:9,代码来源:TransitionLabelEditPart.java

示例8: handleDragStarted

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.tools.AbstractTool#handleDragStarted()
 */
protected boolean handleDragStarted() {
    DragTracker tracker = delegateEditPart.getDragTracker(getTargetRequest());
    if (tracker != null) {
        setDragTracker(tracker);
        lockTargetEditPart(delegateEditPart);
        tracker.mouseDown(initialME, getCurrentViewer());
    }
    return super.handleDragStarted();
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:13,代码来源:DelegatingDragEditPartsTracker.java

示例9: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getDragTracker(org.eclipse.gef.Request)
 */
@Override
public DragTracker getDragTracker(Request request) {
    if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3)
        return null;
    return new SequenceDelegatingDragEditPartsTracker(this, getParent());
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:10,代码来源:LifeLineBehaviorEditPart.java

示例10: createDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Creates and returns a new {@link ConnectionBendpointTracker}.
 * @return the new ConnectionBendpointTracker
 */
protected DragTracker createDragTracker() {
    ConnectionBendpointTracker tracker;
    tracker = new ConnectionBendpointTracker(
        (ConnectionEditPart)getOwner(),
        getIndex());
    tracker.setType(RequestConstants.REQ_CREATE_BENDPOINT);
    tracker.setDefaultCursor(getCursor());
    //DisabledCursor를 설정해준다.
    tracker.setDisabledCursor(SharedCursors.NO);
    return tracker;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:SequenceBendpointCreationHandle.java

示例11: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * 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);
		}
	};
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:ExternalXtextLabelEditPart.java

示例12: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Performs direct edit on double click
 */
@Override
public DragTracker getDragTracker(final Request request) {
	if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3)
		return null;
	IDoubleClickCallback callback = new IDoubleClickCallback() {

		@Override
		public void handleDoubleClick(int btn) {
			performDirectEditRequest(request);
		}
	};
	return new DoubleClickDirectEditDragTracker(this, getTopGraphicEditPart(), callback);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:XtextLabelEditPart.java

示例13: getDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
@Override
public DragTracker getDragTracker(final Request request) {
	if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3)
		return null;
	IDoubleClickCallback callback = new IDoubleClickCallback() {
		public void handleDoubleClick(int btn) {
			performDirectEditRequest(request);
		}
	};
	return new DoubleClickDirectEditDragTracker(this, getTopGraphicEditPart(), callback);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:12,代码来源:StatechartDescriptionCompartmentEditPart.java

示例14: createDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
protected DragTracker createDragTracker() {
	return new JSSCompoundResizeTracker(getOwner(), cursorDirection) {
		@SuppressWarnings({ "rawtypes", "unchecked" })
		@Override
		protected List createOperationSet() {
			ArrayList res = new ArrayList();
			res.add(getOwner());
			return res;
		}
	};
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:CellResizeHandle.java

示例15: createDragTracker

import org.eclipse.gef.DragTracker; //导入依赖的package包/类
/**
 * Create the tracker if there isn't one, the the tracker will
 * be returned
 */
protected DragTracker createDragTracker() {
	if (tracker == null)
	{
		tracker = new BandResizeTracker(getOwner());
	}
	return tracker;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:BandResizeHandle.java


注:本文中的org.eclipse.gef.DragTracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。