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


Java MouseEvent.isControlDown方法代码示例

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


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

示例1: mousePressed

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent pMouseEvent)
{
  if (mRenderer.notifyEyeRayListeners(mRenderer, pMouseEvent))
    return;

  if (!pMouseEvent.isMetaDown() && !pMouseEvent.isShiftDown()
      && !pMouseEvent.isControlDown()
      && pMouseEvent.isButtonDown(1))
  {
    final float lMouseX = pMouseEvent.getX();
    final float lMouseY = pMouseEvent.getY();
    mArcBall.setBounds(mRenderer.getViewportWidth(),
                       mRenderer.getViewportHeight());
    mArcBall.setCurrent(mRenderer.getQuaternion());
    mArcBall.click(lMouseX, lMouseY);
  }

  mRenderer.getAdaptiveLODController()
           .notifyUserInteractionInProgress();

}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:23,代码来源:MouseControl.java

示例2: mouseWheelMoved

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseWheelMoved(final MouseEvent e) {
    final Object attachment = e.getAttachment();
    if( attachment instanceof UIShape.PointerEventInfo ) {
        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
        final boolean isOnscreen = PointerClass.Onscreen == e.getPointerType(0).getPointerClass();
        if( 0 == ( ~InputEvent.BUTTONALL_MASK & e.getModifiers() ) && !isOnscreen ) {
            // offscreen vertical mouse wheel zoom
            final float tz = 8f*e.getRotation()[1]; // vertical: wheel
            System.err.println("Rotate.Zoom.W: "+tz);
            shapeEvent.shape.translate(0f, 0f, tz);
        } else if( isOnscreen || e.isControlDown() ) {
            final float[] rot =  VectorUtil.scaleVec3(e.getRotation(), e.getRotation(), FloatUtil.PI / 180.0f);
            if( isOnscreen ) {
                System.err.println("XXX: "+e);
                // swap axis for onscreen rotation matching natural feel
                final float tmp = rot[0]; rot[0] = rot[1]; rot[1] = tmp;
                VectorUtil.scaleVec3(rot, rot, 2f);
            }
            shapeEvent.shape.getRotation().rotateByEuler( rot );
        }
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:24,代码来源:GPUUISceneGLListener0A.java

示例3: handleMoveLight

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
protected void handleMoveLight(final MouseEvent pMouseEvent)
{

  if (!mMoveLightMode
      && mRenderer.getRenderAlgorithm(mRenderer.getCurrentRenderLayerIndex()) == RenderAlgorithm.IsoSurface
      && !pMouseEvent.isMetaDown()
      && !pMouseEvent.isShiftDown()
      && !pMouseEvent.isControlDown()
      && pMouseEvent.isAltDown()
      && !pMouseEvent.isAltGraphDown()
      && !pMouseEvent.isButtonDown(1))
  {
    moveLight(pMouseEvent);
  }
}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:16,代码来源:MouseControl.java

示例4: handleArcBall

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
protected void handleArcBall(final MouseEvent pMouseEvent)
{
  if (!pMouseEvent.isMetaDown() && !pMouseEvent.isShiftDown()
      && !pMouseEvent.isAltDown()
      && !pMouseEvent.isControlDown()
      && pMouseEvent.isButtonDown(1))
  {
    final float lMouseX = pMouseEvent.getX();
    final float lMouseY = pMouseEvent.getY();
    mArcBall.setBounds(mRenderer.getViewportWidth(),
                       mRenderer.getViewportHeight());
    mRenderer.setQuaternion(mArcBall.drag(lMouseX, lMouseY));

  }
}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:16,代码来源:MouseControl.java

示例5: handleTranslation

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
private void handleTranslation(final MouseEvent pMouseEvent)
{
  final int dx = pMouseEvent.getX() - mSavedMouseX;
  final int dy = pMouseEvent.getY() - mSavedMouseY;

  // If the right button is held down, translate the object
  if (!pMouseEvent.isMetaDown() && !pMouseEvent.isControlDown()
      && (pMouseEvent.isButtonDown(3)))
  {

    mRenderer.addTranslationX(dx / 100.0f);
    mRenderer.addTranslationY(-dy / 100.0f);
  }
  setSavedMousePosition(pMouseEvent);
}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:16,代码来源:MouseControl.java

示例6: handleAlphaBlending

import com.jogamp.newt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * Sets the transfer function range.
 * 
 * @param pMouseEvent
 *          mouse event
 */
public void handleAlphaBlending(final MouseEvent pMouseEvent)
{
  if (mRenderer.getRenderAlgorithm(mRenderer.getCurrentRenderLayerIndex()) == RenderAlgorithm.MaxProjection
      && !pMouseEvent.isMetaDown()
      && !pMouseEvent.isShiftDown()
      && !pMouseEvent.isControlDown()
      && pMouseEvent.isAltDown()
      && !pMouseEvent.isAltGraphDown()
      && pMouseEvent.isButtonDown(1))
  {
    final double lWidth = mRenderer.getViewportWidth();
    final double nx = (pMouseEvent.getX()) / lWidth;

    final double lAlpha = 16 * pow(nx,2);

    mRenderer.setAlphaBlending(mRenderer.getCurrentRenderLayerIndex(),
                               lAlpha);
    // System.out.println(lAlpha);
  }

  /*
  System.out.println("_____________________________________");
  System.out.println("isAltDown=" + pMouseEvent.isAltDown());
  System.out.println("isAltGraphDown="
                     + pMouseEvent.isAltGraphDown());
  System.out.println("isControlDown="
                     + pMouseEvent.isControlDown());
  System.out.println("isMetaDown=" + pMouseEvent.isMetaDown());
  System.out.println("isShiftDown=" + pMouseEvent.isShiftDown());
  /**/

}
 
开发者ID:ClearVolume,项目名称:ClearVolume,代码行数:39,代码来源:MouseControl.java


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