Java 类org.eclipse.gef.tools.ResizeTracker 实例源码

项目:statecharts    文件:FixedAspectRatioResizableEditPolicy.java   
@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);
                }
            };
        };
    });
}
项目:birt    文件:CrosstavCellDragHandle.java   
protected DragTracker createDragTracker( )
{
    CrosstabHandleAdapter adapter = ((CrosstabTableEditPart)getOwner( ).getParent( )).getCrosstabHandleAdapter( );
    if (cursorDirection == PositionConstants.EAST && 
            (adapter.getColumnOprationCell( start )!=null||adapter.getColumnOprationCell( end )!=null))
    {
        return new CrosstabColumnDragTracker(getOwner( ), start, end);
    }
    if (cursorDirection == PositionConstants.SOUTH && adapter.getRowOprationCell( start ) != null)
    {
        return new CrosstabRowDragTracker(getOwner( ), start, end);
    }
    //return null;
    return new ResizeTracker( getOwner( ), cursorDirection )
    {
        protected void showTargetFeedback() 
        {

        }
        protected void eraseTargetFeedback() 
        {

        }

        protected void showSourceFeedback( )
        {
        }

        protected void eraseSourceFeedback( )
        {
        }

        protected Command getCommand( )
        {
            return UnexecutableCommand.INSTANCE;
        }
    };
}
项目:birt    文件:TableCellDragHandle.java   
protected DragTracker createDragTracker( )
{

    if (cursorDirection == PositionConstants.EAST )
    {
        return new ColumnDragTracker(getOwner( ).getParent( ), start, end);
    }
    if (cursorDirection == PositionConstants.SOUTH)
    {
        return new RowDragTracker(getOwner( ).getParent( ), start, end);
    }
    //return null;
    return new ResizeTracker( getOwner( ), cursorDirection )
    {
        protected void showTargetFeedback() 
        {

        }
        protected void eraseTargetFeedback() 
        {

        }

        protected void showSourceFeedback( )
        {
        }

        protected void eraseSourceFeedback( )
        {
        }

        protected Command getCommand( )
        {
            return UnexecutableCommand.INSTANCE;
        }
    };
}
项目:PDFReporter-Studio    文件:ElementResizableEditPolicy.java   
/**
 * Returns a resize tracker for the given direction to be used by a resize handle.
 * 
 * @param direction
 *          the resize direction for the {@link JSSCompoundResizeTracker}.
 * @return a new {@link JSSCompoundResizeTracker}
 * @since 3.7
 */
protected ResizeTracker getResizeTracker(int direction) {
    return new JSSCompoundResizeTracker((GraphicalEditPart) getHost(), direction);
}
项目:gef-gwt    文件:ResizeHandle.java   
/**
 * Returns <code>null</code> for the DragTracker.
 * 
 * @return returns <code>null</code>
 */
protected DragTracker createDragTracker() {
    return new ResizeTracker(getOwner(), cursorDirection);
}
项目:gef-gwt    文件:ResizableEditPolicy.java   
/**
 * Returns a resize tracker for the given direction to be used by a resize
 * handle.
 * 
 * @param direction
 *            the resize direction for the {@link ResizeTracker}.
 * @return a new {@link ResizeTracker}
 * @since 3.7
 */
protected ResizeTracker getResizeTracker(int direction) {
    return new ResizeTracker((GraphicalEditPart) getHost(), direction);
}