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


Java FigureCanvas.scrollToY方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.FigureCanvas.scrollToY方法的典型用法代码示例。如果您正苦于以下问题:Java FigureCanvas.scrollToY方法的具体用法?Java FigureCanvas.scrollToY怎么用?Java FigureCanvas.scrollToY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.FigureCanvas的用法示例。


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

示例1: scrollPageIncrement

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
private boolean scrollPageIncrement( GraphicalEditPart part, int code )
{
	if ( !( part.getViewer( ) instanceof DeferredGraphicalViewer ) )
	{
		return false;
	}
	DeferredGraphicalViewer viewer = (DeferredGraphicalViewer) part.getViewer( );
	FigureCanvas canvas = viewer.getFigureCanvas( );

	int increment = 0;
	if ( code == SWT.PAGE_DOWN )
	{
		increment = canvas.getVerticalBar( ).getSelection( )
				+ canvas.getVerticalBar( ).getPageIncrement( );
	}
	else if ( code == SWT.PAGE_UP )
	{
		increment = canvas.getVerticalBar( ).getSelection( )
				- canvas.getVerticalBar( ).getPageIncrement( );
	}
	canvas.scrollToY( increment );
	return true;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:ReportViewerKeyHandler.java

示例2: scrollViewer

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
void scrollViewer( KeyEvent event )
{
	if ( !( getViewer( ).getControl( ) instanceof FigureCanvas ) )
		return;
	FigureCanvas figCanvas = (FigureCanvas) getViewer( ).getControl( );
	Point loc = figCanvas.getViewport( ).getViewLocation( );
	Rectangle area = figCanvas.getViewport( )
			.getClientArea( Rectangle.SINGLETON )
			.scale( .1 );
	switch ( event.keyCode )
	{
		case SWT.ARROW_DOWN :
			figCanvas.scrollToY( loc.y + area.height );
			break;
		case SWT.ARROW_UP :
			figCanvas.scrollToY( loc.y - area.height );
			break;
		case SWT.ARROW_LEFT :
			figCanvas.scrollToX( loc.x - area.width );
			break;
		case SWT.ARROW_RIGHT :
			figCanvas.scrollToX( loc.x + area.width );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:TableCellKeyDelegate.java

示例3: scrollViewer

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
void scrollViewer(KeyEvent event) {
	if (!(getViewer().getControl() instanceof FigureCanvas))
		return;
	FigureCanvas figCanvas = (FigureCanvas) getViewer().getControl();
	Point loc = figCanvas.getViewport().getViewLocation();
	Rectangle area = figCanvas.getViewport()
			.getClientArea(Rectangle.SINGLETON).scale(.1);
	switch (event.keyCode) {
	case SWT.ARROW_DOWN:
		figCanvas.scrollToY(loc.y + area.height);
		break;
	case SWT.ARROW_UP:
		figCanvas.scrollToY(loc.y - area.height);
		break;
	case SWT.ARROW_LEFT:
		if (isViewerMirrored())
			figCanvas.scrollToX(loc.x + area.width);
		else
			figCanvas.scrollToX(loc.x - area.width);
		break;
	case SWT.ARROW_RIGHT:
		if (isViewerMirrored())
			figCanvas.scrollToX(loc.x - area.width);
		else
			figCanvas.scrollToX(loc.x + area.width);
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:28,代码来源:GraphicalViewerKeyHandler.java

示例4: scrollIncrement

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
private boolean scrollIncrement( GraphicalEditPart part, KeyEvent event )
{
	if ( ( event.stateMask & SWT.CONTROL ) == 0 )
	{
		return false;
	}
	if ( !( part.getViewer( ) instanceof DeferredGraphicalViewer ) )
	{
		return false;
	}
	DeferredGraphicalViewer viewer = (DeferredGraphicalViewer) part.getViewer( );
	FigureCanvas canvas = viewer.getFigureCanvas( );
	int code = event.keyCode;
	int increment = 0;
	if ( code == SWT.ARROW_RIGHT )
	{
		increment = canvas.getHorizontalBar( ).getSelection( )
				+ canvas.getHorizontalBar( ).getIncrement( );
	}
	else if ( code == SWT.ARROW_LEFT )
	{
		increment = canvas.getHorizontalBar( ).getSelection( )
				- canvas.getHorizontalBar( ).getIncrement( );
	}
	else if ( code == SWT.ARROW_DOWN )
	{
		increment = canvas.getVerticalBar( ).getSelection( )
				+ canvas.getVerticalBar( ).getIncrement( );
	}
	else if ( code == SWT.ARROW_UP )
	{
		increment = canvas.getVerticalBar( ).getSelection( )
				- canvas.getVerticalBar( ).getIncrement( );
	}

	if ( code == SWT.ARROW_RIGHT || code == SWT.ARROW_LEFT )
	{
		canvas.scrollToX( increment );
	}
	if ( code == SWT.ARROW_UP || code == SWT.ARROW_DOWN )
	{
		canvas.scrollToY( increment );
	}
	return true;

}
 
开发者ID:eclipse,项目名称:birt,代码行数:47,代码来源:ReportViewerKeyHandler.java


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