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


Java FigureCanvas.scrollTo方法代码示例

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


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

示例1: mouseMove

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
@Override
public void mouseMove(MouseEvent e) {
	if (originMousePosition != null) {
		final FigureCanvas canvas = (FigureCanvas)timelineViewer.getControl();
		canvas.scrollTo(offset.x, offset.y - e.y + originMousePosition.y);
		final int shift = (int)((-e.x + originMousePosition.x)
				/ (PossibleStepEditPart.SIZE + BranchEditPart.SPACING) / rootEditPart
				.getZoomManager().getZoom())
				- doneShift;
		final int multiplier;
		if ((e.stateMask & SWT.MOD1) != 0) {
			multiplier = timelineWindow.getLength();
		} else {
			multiplier = 1;
		}
		if (follow && shift < 0) {
			toggleFollow();
		}
		if (timelineWindow.getStart() + shift * multiplier < 0) {
			timelineWindow.setStart(0);
		} else if (provider != null
				&& timelineWindow.getStart() + timelineWindow.getLength() + shift * multiplier > timelineWindow
						.getMaxTimelineIndex()
						+ nbVirtualChoices) {
			timelineWindow.setStart(Math.max(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices
					- timelineWindow.getLength(), 0));
		} else if (shift != 0) {
			doneShift += shift;
			timelineWindow.setStart(timelineWindow.getStart() + shift * multiplier);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:33,代码来源:AbstractTimelineView.java

示例2: handleDrag

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.tools.AbstractTool#handleDrag()
 */
protected boolean handleDrag() {
	if (isInState(PAN_IN_PROGRESS)
			&& getCurrentViewer().getControl() instanceof FigureCanvas) {
		FigureCanvas canvas = (FigureCanvas) getCurrentViewer()
				.getControl();
		canvas.scrollTo(viewLocation.x - getDragMoveDelta().width,
				viewLocation.y - getDragMoveDelta().height);
		return true;
	} else {
		return super.handleDrag();
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:16,代码来源:PanningSelectionTool.java

示例3: setLocation

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
public void setLocation(final int x, final int y) {
    final FigureCanvas canvas = (FigureCanvas) getGraphicalViewer().getControl();
    canvas.scrollTo(x, y);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:5,代码来源:ERDiagramEditor.java

示例4: setLocation

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
public void setLocation(int x, int y) {
	FigureCanvas canvas = (FigureCanvas) this.getGraphicalViewer()
			.getControl();
	canvas.scrollTo(x, y);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:6,代码来源:ERDiagramEditor.java

示例5: setLocation

import org.eclipse.draw2d.FigureCanvas; //导入方法依赖的package包/类
public void setLocation(int x, int y) {
    final FigureCanvas canvas = (FigureCanvas) getGraphicalViewer().getControl();
    canvas.scrollTo(x, y);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:5,代码来源:MainDiagramEditor.java


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