本文整理汇总了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);
}
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}