Search in sources :

Example 1 with MoveHandle

use of org.eclipse.gef.handles.MoveHandle in project tdi-studio-se by Talend.

the class BusinessTextNonResizableEditPolicy method createSelectionHandles.

/**
     * @generated
     */
protected List createSelectionHandles() {
    MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
    moveHandle.setBorder(null);
    moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
    return Collections.singletonList(moveHandle);
}
Also used : DragEditPartsTrackerEx(org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx) MoveHandle(org.eclipse.gef.handles.MoveHandle)

Example 2 with MoveHandle

use of org.eclipse.gef.handles.MoveHandle in project whole by wholeplatform.

the class WholeNonResizableEditPolicy method createSelectionHandles.

@Override
protected List<?> createSelectionHandles() {
    final GraphicalEditPart host = (GraphicalEditPart) getHost();
    final DragTracker tracker = new SelectEditPartTracker(host);
    final Cursor cursor = SharedCursors.ARROW;
    final MoveHandle moveHandle = new MoveHandle(host) {

        @Override
        protected void initialize() {
            setOpaque(false);
            setBorder(new LineBorder(ColorConstants.gray, 1));
            setCursor(cursor);
            setDragTracker(tracker);
        }
    };
    final List<Handle> handles = new ArrayList<Handle>(5);
    handles.add(moveHandle);
    if (isDragAllowed()) {
        handles.add(createHandle(host, PositionConstants.SOUTH_EAST, tracker, cursor));
        handles.add(createHandle(host, PositionConstants.SOUTH_WEST, tracker, cursor));
        handles.add(createHandle(host, PositionConstants.NORTH_WEST, tracker, cursor));
        handles.add(createHandle(host, PositionConstants.NORTH_EAST, tracker, cursor));
    }
    return handles;
}
Also used : DragTracker(org.eclipse.gef.DragTracker) MoveHandle(org.eclipse.gef.handles.MoveHandle) LineBorder(org.eclipse.draw2d.LineBorder) ArrayList(java.util.ArrayList) SelectEditPartTracker(org.eclipse.gef.tools.SelectEditPartTracker) Cursor(org.eclipse.swt.graphics.Cursor) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) Handle(org.eclipse.gef.Handle) ResizeHandle(org.eclipse.gef.handles.ResizeHandle) AbstractHandle(org.eclipse.gef.handles.AbstractHandle) MoveHandle(org.eclipse.gef.handles.MoveHandle)

Example 3 with MoveHandle

use of org.eclipse.gef.handles.MoveHandle in project tdi-studio-se by Talend.

the class NodeResizableEditPolicy method moveHandle.

private Handle moveHandle(GraphicalEditPart owner, DragTracker tracker, Cursor cursor) {
    MoveHandle moveHandle = new MoveHandle(owner);
    moveHandle.setForegroundColor(ColorConstants.gray);
    moveHandle.setDragTracker(tracker);
    moveHandle.setCursor(cursor);
    return moveHandle;
}
Also used : MoveHandle(org.eclipse.gef.handles.MoveHandle)

Example 4 with MoveHandle

use of org.eclipse.gef.handles.MoveHandle in project whole by wholeplatform.

the class WholeResizableEditPolicy method createSelectionHandles.

protected List<?> createSelectionHandles() {
    final GraphicalEditPart host = (GraphicalEditPart) getHost();
    final int directions = getResizeDirections() != -1 ? getResizeDirections() : PositionConstants.EAST + PositionConstants.SOUTH + PositionConstants.WEST + PositionConstants.NORTH;
    final MoveHandle moveHandle = new MoveHandle(host) {

        @Override
        protected void initialize() {
            setOpaque(false);
            setBorder(new LineBorder(ColorConstants.gray, 1));
            setCursor(Cursors.SIZEALL);
        }
    };
    final List<Handle> handles = new ArrayList<Handle>(9);
    handles.add(moveHandle);
    handles.add(createHandle(host, PositionConstants.EAST, (directions & PositionConstants.EAST) != 0));
    handles.add(createHandle(host, PositionConstants.SOUTH_EAST, (directions & PositionConstants.SOUTH_EAST) != 0));
    handles.add(createHandle(host, PositionConstants.SOUTH, (directions & PositionConstants.SOUTH) != 0));
    handles.add(createHandle(host, PositionConstants.SOUTH_WEST, (directions & PositionConstants.SOUTH_WEST) != 0));
    handles.add(createHandle(host, PositionConstants.WEST, (directions & PositionConstants.WEST) != 0));
    handles.add(createHandle(host, PositionConstants.NORTH_WEST, (directions & PositionConstants.NORTH_WEST) != 0));
    handles.add(createHandle(host, PositionConstants.NORTH, (directions & PositionConstants.NORTH) != 0));
    handles.add(createHandle(host, PositionConstants.NORTH_EAST, (directions & PositionConstants.NORTH_EAST) != 0));
    return handles;
}
Also used : MoveHandle(org.eclipse.gef.handles.MoveHandle) LineBorder(org.eclipse.draw2d.LineBorder) ArrayList(java.util.ArrayList) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) Handle(org.eclipse.gef.Handle) ResizeHandle(org.eclipse.gef.handles.ResizeHandle) AbstractHandle(org.eclipse.gef.handles.AbstractHandle) MoveHandle(org.eclipse.gef.handles.MoveHandle)

Aggregations

MoveHandle (org.eclipse.gef.handles.MoveHandle)4 ArrayList (java.util.ArrayList)2 LineBorder (org.eclipse.draw2d.LineBorder)2 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)2 Handle (org.eclipse.gef.Handle)2 AbstractHandle (org.eclipse.gef.handles.AbstractHandle)2 ResizeHandle (org.eclipse.gef.handles.ResizeHandle)2 DragTracker (org.eclipse.gef.DragTracker)1 SelectEditPartTracker (org.eclipse.gef.tools.SelectEditPartTracker)1 DragEditPartsTrackerEx (org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx)1 Cursor (org.eclipse.swt.graphics.Cursor)1