本文整理汇总了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);
}
};
};
});
}
示例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);
}
示例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));
}
示例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;
}
};
}
示例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();
}
示例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 ) );
}
示例7: getDragTracker
import org.eclipse.gef.DragTracker; //导入依赖的package包/类
@Override
public DragTracker getDragTracker(Request request) {
return new DragEditPartsTracker(this) {
protected EditPart getTargetEditPart() {
return getParent();
}
};
}
示例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();
}
示例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());
}
示例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;
}
示例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);
}
};
}
示例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);
}
示例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);
}
示例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;
}
};
}
示例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;
}