本文整理汇总了Java中com.jogamp.newt.event.MouseEvent.getPointerId方法的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.getPointerId方法的具体用法?Java MouseEvent.getPointerId怎么用?Java MouseEvent.getPointerId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.newt.event.MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.getPointerId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mousePressed
import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(final MouseEvent e) {
if( -1 == lId || e.getPointerId(0) == lId ) {
lx = e.getX();
ly = e.getY();
lId = e.getPointerId(0);
}
// flip to GL window coordinates
final int glWinX = e.getX();
final int glWinY = viewport[3] - e.getY() - 1;
dispatchMouseEvent(e, glWinX, glWinY);
}
示例2: mouseDragged
import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseDragged(final MouseEvent e) {
// drag activeShape, if no gesture-activity, only on 1st pointer
if( null != activeShape && !pinchToZoomGesture.isWithinGesture() && e.getPointerId(0) == lId ) {
lx = e.getX();
ly = e.getY();
// dragged .. delegate to active shape!
// flip to GL window coordinates
final int glWinX = lx;
final int glWinY = viewport[3] - ly - 1;
dispatchMouseEventForShape(activeShape, e, glWinX, glWinY);
}
}
示例3: mouseMoved
import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseMoved(final MouseEvent e) {
if( -1 == lId || e.getPointerId(0) == lId ) {
lx = e.getX();
ly = e.getY();
lId = e.getPointerId(0);
}
}