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


Java NativePreviewEvent.getTypeInt方法代码示例

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


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

示例1: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
	if (this.resizable) {
		// We need to preventDefault() on mouseDown events (outside of the
		// DialogBox content) to keep text from being selected when it
		// is dragged.
		NativeEvent nativeEvent = event.getNativeEvent();

		if (!event.isCanceled()
				&& (event.getTypeInt() == Event.ONMOUSEDOWN)
				&& calcDragMode(nativeEvent.getClientX(),nativeEvent.getClientY()) >= 0) {
			nativeEvent.preventDefault();
		}
	}
	
	super.onPreviewNativeEvent(event);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:18,代码来源:WindowBox.java

示例2: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( p_event.getTypeInt() == Event.ONKEYDOWN )
  {
    // start scrolling ?
    onKeyDown( p_event.getNativeEvent().getKeyCode() );
    return;
  }
  if( p_event.getTypeInt() == Event.ONKEYUP )
  {
    // stop scrolling ?
    onKeyUp( p_event.getNativeEvent().getKeyCode() );
    return;
  }
  if( (p_event.getTypeInt() == Event.ONMOUSEUP) && (m_cancelMouseUpEvent) )
  {
    // cancel event
    return;
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:22,代码来源:WgtScroll.java

示例3: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
    EventTarget target = event.getNativeEvent().getEventTarget();
    Element targetElement = null;
    if (Element.is(target)) {
        targetElement = Element.as(target);
    }

    if (getWidget().getModalityCurtain().isOrHasChild(targetElement)
            && getWidget().isClosable()
            && (event.getTypeInt() & ACCEPTEDEVENTS) == 0) {
        /*
         * Close on events outside window. Special handling for mousemove
         * etc to aid compatibility with desktop (testing purposes).
         */
        rpc.close();
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:19,代码来源:PopoverConnector.java

示例4: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
/**
 * Processes a native event so that we can track mouse movements in and
 * out of this widget.
 * @param event
 */
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (event.getTypeInt() == Event.ONMOUSEMOVE) {
        int x = event.getNativeEvent().getClientX();
        int y = event.getNativeEvent().getClientY();
        handleMouseMove(x, y);
    }
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:13,代码来源:NotificationWidget.java

示例5: isEscKey

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
/**
 * Checks if the origin of the given event is a pressed ESC key.
 *
 * @param event
 *            the event to analyze
 * @return <code>true</code> if the origin of the event is a pressed ESC
 *         key, otherwise <code>false</code>.
 */
private static boolean isEscKey(final NativePreviewEvent event) {
    int typeInt = event.getTypeInt();
    if (typeInt == Event.ONKEYDOWN) {
        int keyCode = event.getNativeEvent().getKeyCode();
        if (KeyCodes.KEY_ESCAPE == keyCode) {
            return true;
        }
    }
    return false;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:ViewClientCriterion.java

示例6: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
/**
 * pressing ESC closes the dialogbox
 */
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
	super.onPreviewNativeEvent(event);
	if (event.getTypeInt() == Event.ONKEYDOWN &&
		event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
		hide();
	}
}
 
开发者ID:umlet,项目名称:umlet,代码行数:12,代码来源:MyPopupPanel.java

示例7: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( (p_event.getTypeInt() == Event.ONKEYPRESS) && (p_event.getNativeEvent().getCtrlKey()) )
  {
    if( p_event.getNativeEvent().getKeyCode() == 'm'
        || p_event.getNativeEvent().getKeyCode() == 'M' )
    {
      // cancel event
      return;
    }
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:14,代码来源:MAppTabMenu.java

示例8: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
public void onPreviewNativeEvent(NativePreviewEvent event) {
    NativeEvent nativeEvent = event.getNativeEvent();
    int button = nativeEvent.getButton();
    int x = nativeEvent.getClientX();
    int y = nativeEvent.getClientY();            
    int keyCode = nativeEvent.getKeyCode();
    int mouseWheelVelocity = nativeEvent.getMouseWheelVelocityY();            
    int screenX = nativeEvent.getScreenX();
    int screenY = nativeEvent.getScreenY();
    int keyModifiers =
        ((nativeEvent.getAltKey() ? 8 : 0) |
        (nativeEvent.getCtrlKey() ? 4 : 0) | 
        (nativeEvent.getMetaKey() ? 2 : 0) |
        (nativeEvent.getShiftKey() ? 1 : 0));
    byte[] compressedData;
    long currentTime = System.currentTimeMillis();
    byte timeDiff = (byte) ((currentTime - previousSystemTime) & 0xff);
    byte eventType = (byte) (event.getTypeInt() & 0xff);
    if (keyCode != 0) {
        compressedData = new byte[] {
                timeDiff, eventType,
                (byte) (keyCode & 0xff),
                (byte) keyModifiers };                
    } else {
        compressedData = new byte[] {
                timeDiff,
                eventType,
                (byte) ((screenX - previousScreenX) & 0xff),
                (byte) ((screenY - previousScreenY) & 0xff),
                (byte) (button << 4 | keyModifiers),
                (byte) mouseWheelVelocity };
    }
    previousScreenX = screenX;
    previousScreenY = screenY;
    previousSystemTime = currentTime;
    addEntropy(ENTROPY_ID, ENTROPY_ESTMATE, compressedData);
}
 
开发者ID:ivanceras,项目名称:crypto-gwt,代码行数:38,代码来源:EventEntropySource.java

示例9: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    NativeEvent nativeEvent = event.getNativeEvent();

    if (!event.isCanceled() && (event.getTypeInt() == Event.ONMOUSEDOWN)
            && isCaptionEvent(nativeEvent)) {
        nativeEvent.preventDefault();
    }

    super.onPreviewNativeEvent(event);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:12,代码来源:FormPopup.java

示例10: previewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
private void previewNativeEvent(NativePreviewEvent event) {
	if (event.isCanceled() || event.isConsumed()) {
		event.cancel();
		return;
	}

	boolean eventTargetsContainerOrPartner = this.eventTargetsContainerOrPartner(event);

	int type = event.getTypeInt();
	switch (type) {
		case Event.ONMOUSEDOWN:
		case Event.ONTOUCHSTART:
			if (!eventTargetsContainerOrPartner) {
				this.blur();
				return;
			}
			break;
		case Event.ONFOCUS:
			// Not used because focus events are not previewed yet
			if (!eventTargetsContainerOrPartner) {
				this.blur();
			} else {
				this.focus();
			}
			break;
		default:
			break;
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:30,代码来源:CompositeFocusHelper.java

示例11: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public final void onPreviewNativeEvent(NativePreviewEvent event) {
	if (event.getTypeInt() != Event.ONKEYPRESS) {
		return;
	}
	char ch = getCharCode(event.getNativeEvent());
	onKeyPress(ch);
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:9,代码来源:GlobalKeyEventHandler.java

示例12: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent e) {
	if (e.getTypeInt() == Event.getTypeInt(KeyDownEvent.getType().getName())) {
		NativeEvent nativeEvent = e.getNativeEvent();
		if (nativeEvent.getKeyCode() == KeyCodes.KEY_ESCAPE) {
			nativeEvent.preventDefault();
		}
	}
}
 
开发者ID:rzschech,项目名称:gwt-comet,代码行数:10,代码来源:HTTPRequestCometTransport.java

示例13: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
    if (!event.isCanceled()) {
        EventTarget target = event.getNativeEvent().getEventTarget();
        Element parent_element = parent_button.getElement();

        switch (event.getTypeInt()) {

        // OnScroll events are not previewable! The popup panel cannot
        // move with scroll events using this method.
        
        case Event.ONMOUSEDOWN:
            // Check to see if the target is the current popup
            if (parent_element.isOrHasChild(Element.as(target))) {
                event.cancel();
                hide();
                return;
            }
            super.onPreviewNativeEvent(event);
            return;

        case Event.ONTOUCHSTART:
            if (parent_element.isOrHasChild(Element.as(target))) {
                event.cancel();
                hide();
                return;
            }
            super.onPreviewNativeEvent(event);
            return;
        }
        super.onPreviewNativeEvent(event);
    }
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:34,代码来源:BasePanelView.java

示例14: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
public void onPreviewNativeEvent(NativePreviewEvent event) {
	if (event.getTypeInt() == Event.ONKEYPRESS) {
		futurama.evaluateKey((char) event.getNativeEvent().getKeyCode());
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:6,代码来源:AboutPopup.java

示例15: onPreviewNativeEvent

import com.google.gwt.user.client.Event.NativePreviewEvent; //导入方法依赖的package包/类
@Override
public void onPreviewNativeEvent(NativePreviewEvent p_event)
{
  if( p_event.getTypeInt() == Event.ONKEYPRESS )
  {
    if( DlgChatInput.isChatMode() )
    {
      // don't catch any key if chat dialog is visible
      return;
    }
    if( p_event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER )
    {
      if( GameEngine.model().getGame().getGameType() == GameType.MultiPlayer
          || GameEngine.model().getGame().getGameType() == GameType.Initiation )
      {
        DlgChatInput.showDialog();
      }
      return;
    }
    else if( p_event.getNativeEvent().getKeyCode() == 'f'
        || p_event.getNativeEvent().getKeyCode() == 'F' )
    {
      if( GameEngine.model().isFireCoverDisplayed() )
      {
        GameEngine.model().setFireCoverDisplayed( false );
      }
      else
      {
        GameEngine.model().setFireCoverDisplayed( true );
      }
      // cancel event
      return;
    }
    else if( p_event.getNativeEvent().getKeyCode() == '+' )
    {
      GameEngine.model().setZoomDisplayed( EnuZoom.Medium );
      // cancel event
      return;
    }
    else if( p_event.getNativeEvent().getKeyCode() == '-' )
    {
      GameEngine.model().setZoomDisplayed( EnuZoom.Small );
      // cancel event
      return;
    }
    else if( p_event.getNativeEvent().getKeyCode() == 'g'
        || p_event.getNativeEvent().getKeyCode() == 'G' )
    {
      GameEngine.model().setGridDisplayed( !GameEngine.model().isGridDisplayed() );
      // cancel event
      p_event.cancel();
      return;
    }
    else if( p_event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE )
    {
      try
      {
        GameEngine.model().getActionBuilder().userCancel();
        AppRoot.getEventBus().fireEvent( new ModelUpdateEvent(GameEngine.model()) );
      } catch( RpcFmpException e )
      {
        MAppMessagesStack.s_instance.showWarning( e.getLocalizedMessage() );
      }
      // cancel action
      return;
    }
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:69,代码来源:MAppContext.java


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