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


Java GestureUtilities类代码示例

本文整理汇总了Java中com.apple.eawt.event.GestureUtilities的典型用法代码示例。如果您正苦于以下问题:Java GestureUtilities类的具体用法?Java GestureUtilities怎么用?Java GestureUtilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: MacGestureSupportForMouseShortcutPanel

import com.apple.eawt.event.GestureUtilities; //导入依赖的package包/类
public MacGestureSupportForMouseShortcutPanel(MouseShortcutPanel panel, Runnable runnable) {
  GestureListener pressureListener = new PressureListener() {
    @Override
    public void pressure(PressureEvent e) {
      if (e.getStage() == 2) {
        panel.setShortcut(new PressureShortcut(e.getStage()));
        runnable.run();
      }
    }
  };
  GestureUtilities.addGestureListenerTo(panel, pressureListener);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:MacGestureSupportForMouseShortcutPanel.java

示例2: MacGestureSupportForEditor

import com.apple.eawt.event.GestureUtilities; //导入依赖的package包/类
public MacGestureSupportForEditor(JComponent component) {
  GestureUtilities.addGestureListenerTo(component, new PressureListener() {
    @Override
    public void pressure(PressureEvent e) {
      if (IdeMouseEventDispatcher.isForceTouchAllowed() && e.getStage() == 2) {
        MouseShortcut shortcut = new PressureShortcut(e.getStage());
        fillActionsList(shortcut, IdeKeyEventDispatcher.isModalContext(component));
        ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
        if (actionManager != null) {
          AnAction[] actions = myActions.toArray(new AnAction[myActions.size()]);
          for (AnAction action : actions) {
            DataContext dataContext = DataManager.getInstance().getDataContext(component);
            Presentation presentation = myPresentationFactory.getPresentation(action);
            AnActionEvent actionEvent = new AnActionEvent(null, dataContext, ActionPlaces.MAIN_MENU, presentation,
                                                          ActionManager.getInstance(),
                                                          0);
            action.beforeActionPerformedUpdate(actionEvent);

            if (presentation.isEnabled()) {
              actionManager.fireBeforeActionPerformed(action, dataContext, actionEvent);
              final Component context = dataContext.getData(PlatformDataKeys.CONTEXT_COMPONENT);

              if (context != null && !context.isShowing()) continue;

              action.actionPerformed(actionEvent);

            }
          }
        }
        e.consume();
        IdeMouseEventDispatcher.forbidForceTouch();
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:36,代码来源:MacGestureSupportForEditor.java


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