Java 类com.intellij.openapi.actionSystem.impl.MouseGestureManager 实例源码

项目:intellij-ce-playground    文件:IdeFrameImpl.java   
public void disposeImpl() {
  if (isTemporaryDisposed()) {
    super.dispose();
    return;
  }
  MouseGestureManager.getInstance().remove(this);

  // clear both our and swing hard refs
  if (myRootPane != null) {
    myRootPane = null;
    setRootPane(new JRootPane());
  }
  if (myFrameDecorator != null) {
    Disposer.dispose(myFrameDecorator);
    myFrameDecorator = null;
  }
  if (myWindowsBorderUpdater != null) {
    Toolkit.getDefaultToolkit().removePropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater);
    myWindowsBorderUpdater = null;
  }

  FocusTrackback.release(this);

  super.dispose();
}
项目:intellij-ce-playground    文件:FrameWrapper.java   
public void dispose() {
  if (myDisposing) return;
  myDisposing = true;

  MouseGestureManager.getInstance().remove(this);

  if (myShown && myDimensionKey != null) {
    WindowStateService.getInstance().saveStateFor(myProject, myDimensionKey, this);
  }

  Disposer.dispose(FrameWrapper.this);
  myDatas.clear();
  myProject = null;
  myPreferedFocus = null;

  if (myFocusTrackback != null) {
    myFocusTrackback.restoreFocus();
  }
  if (myComponent != null && myFocusWatcher != null) {
    myFocusWatcher.deinstall(myComponent);
  }
  myFocusWatcher = null;
  myFocusedCallback = null;

  super.dispose();
}
项目:intellij-ce-playground    文件:FrameWrapper.java   
public void dispose() {
  if (myDisposing) return;
  myDisposing = true;

  MouseGestureManager.getInstance().remove(this);

  if (myShown && myDimensionKey != null) {
    WindowStateService.getInstance().saveStateFor(myProject, myDimensionKey, this);
  }

  Disposer.dispose(FrameWrapper.this);
  myDatas.clear();
  myProject = null;
  myPreferedFocus = null;

  if (myFocusTrackback != null) {
    myFocusTrackback.restoreFocus();
  }
  if (myComponent != null && myFocusWatcher != null) {
    myFocusWatcher.deinstall(myComponent);
  }
  myFocusWatcher = null;
  myFocusedCallback = null;

  super.dispose();
}
项目:tools-idea    文件:IdeFrameImpl.java   
public void dispose() {
  if (isTemporaryDisposed()) {
    super.dispose();
    return;
  }
  MouseGestureManager.getInstance().remove(this);
  WelcomeFrame.notifyFrameClosed(this);

  if (myRootPane != null) {
    myRootPane = null;
  }

  if (myFrameDecorator != null) {
    Disposer.dispose(myFrameDecorator);
    myFrameDecorator = null;
  }

  FocusTrackback.release(this);

  super.dispose();
}
项目:tools-idea    文件:FrameWrapper.java   
public void dispose() {
  if (myDisposing) return;
  myDisposing = true;

  MouseGestureManager.getInstance().remove(this);

  if (myShown) {
    saveFrameState(myDimensionKey, this);
  }

  Disposer.dispose(FrameWrapper.this);
  myDatas.clear();
  myProject = null;
  myPreferedFocus = null;

  if (myFocusTrackback != null) {
    myFocusTrackback.restoreFocus();
  }
  if (myComponent != null && myFocusWatcher != null) {
    myFocusWatcher.deinstall(myComponent);
  }
  myFocusWatcher = null;
  myFocusedCallback = null;

  super.dispose();
}
项目:tools-idea    文件:FrameWrapper.java   
public void dispose() {
  if (myDisposing) return;
  myDisposing = true;

  MouseGestureManager.getInstance().remove(this);

  if (myShown) {
    saveFrameState(myDimensionKey, this);
  }

  Disposer.dispose(FrameWrapper.this);
  myDatas.clear();
  myProject = null;
  myPreferedFocus = null;

  if (myFocusTrackback != null) {
    myFocusTrackback.restoreFocus();
  }
  if (myComponent != null && myFocusWatcher != null) {
    myFocusWatcher.deinstall(myComponent);
  }
  myFocusWatcher = null;
  myFocusedCallback = null;

  super.dispose();
}
项目:intellij-ce-playground    文件:bigFile.java   
@Override
protected void processMouseWheelEvent(@NotNull MouseWheelEvent e) {
  if (mySettings.isWheelFontChangeEnabled() && !MouseGestureManager.getInstance().hasTrackpad()) {
    if (EditorUtil.isChangeFontSize(e)) {
      int size = myScheme.getEditorFontSize() - e.getWheelRotation();
      if (size >= MIN_FONT_SIZE) {
        setFontSize(size, SwingUtilities.convertPoint(this, e.getPoint(), getViewport()));
      }
      return;
    }
  }

  super.processMouseWheelEvent(e);
}
项目:intellij-ce-playground    文件:bigFile.java   
@Override
protected void processMouseWheelEvent(@NotNull MouseWheelEvent e) {
  if (mySettings.isWheelFontChangeEnabled() && !MouseGestureManager.getInstance().hasTrackpad()) {
    if (EditorUtil.isChangeFontSize(e)) {
      int size = myScheme.getEditorFontSize() - e.getWheelRotation();
      if (size >= MIN_FONT_SIZE) {
        setFontSize(size, SwingUtilities.convertPoint(this, e.getPoint(), getViewport()));
      }
      return;
    }
  }

  super.processMouseWheelEvent(e);
}
项目:intellij-ce-playground    文件:FrameWrapper.java   
private MyJFrame(IdeFrame parent) throws HeadlessException {
  FrameState.setFrameStateListener(this);
  myParent = parent;
  setGlassPane(new IdeGlassPaneImpl(getRootPane()));

  if (SystemInfo.isMac) {
    setJMenuBar(new IdeMenuBar(ActionManagerEx.getInstanceEx(), DataManager.getInstance()));
  }

  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
项目:intellij-ce-playground    文件:FrameWrapper.java   
private MyJDialog(IdeFrame parent) throws HeadlessException {
  super((JFrame)parent);
  myParent = parent;
  setGlassPane(new IdeGlassPaneImpl(getRootPane()));
  getRootPane().putClientProperty("Window.style", "small");
  setBackground(UIUtil.getPanelBackground());
  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
项目:intellij-ce-playground    文件:EditorImpl.java   
@Override
protected void processMouseWheelEvent(@NotNull MouseWheelEvent e) {
  if (mySettings.isWheelFontChangeEnabled() && !MouseGestureManager.getInstance().hasTrackpad()) {
    if (EditorUtil.isChangeFontSize(e)) {
      int size = myScheme.getEditorFontSize() - e.getWheelRotation();
      if (size >= MIN_FONT_SIZE) {
        setFontSize(size, SwingUtilities.convertPoint(this, e.getPoint(), getViewport()));
      }
      return;
    }
  }

  super.processMouseWheelEvent(e);
}
项目:tools-idea    文件:FrameWrapper.java   
private MyJFrame(IdeFrame parent) throws HeadlessException {
  myParent = parent;
  setGlassPane(new IdeGlassPaneImpl(getRootPane()));

  if (SystemInfo.isMac) {
    setJMenuBar(new IdeMenuBar(ActionManagerEx.getInstanceEx(), DataManager.getInstance()));
  }

  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
}
项目:tools-idea    文件:FrameWrapper.java   
private MyJDialog(IdeFrame parent) throws HeadlessException {
  super((JFrame)parent);
  myParent = parent;
  setGlassPane(new IdeGlassPaneImpl(getRootPane()));
  getRootPane().putClientProperty("Window.style", "small");
  setBackground(UIUtil.getPanelBackground());
  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
}
项目:tools-idea    文件:EditorImpl.java   
@Override
protected void processMouseWheelEvent(@NotNull MouseWheelEvent e) {
  if (mySettings.isWheelFontChangeEnabled() && !MouseGestureManager.getInstance().hasTrackpad()) {
    if (EditorUtil.isChangeFontSize(e)) {
      int size = myScheme.getEditorFontSize() - e.getWheelRotation();
      if (size >= MIN_FONT_SIZE) {
        setFontSize(size);
      }
      return;
    }
  }

  super.processMouseWheelEvent(e);
}
项目:consulo    文件:IdeFrameImpl.java   
@Override
public void dispose() {
  if (SystemInfo.isMac && isInFullScreen()) {
    ((MacMainFrameDecorator)myFrameDecorator).toggleFullScreenNow();
  }
  if (isTemporaryDisposed()) {
    super.dispose();
    return;
  }
  MouseGestureManager.getInstance().remove(this);

  if (myBalloonLayout != null) {
    ((DesktopBalloonLayoutImpl)myBalloonLayout).dispose();
    myBalloonLayout = null;
  }

  // clear both our and swing hard refs
  if (myRootPane != null) {
    if (ApplicationManager.getApplication().isUnitTestMode()) {
      myRootPane.removeNotify();
    }
    myRootPane = null;
    setRootPane(new JRootPane());
  }
  if (myFrameDecorator != null) {
    Disposer.dispose(myFrameDecorator);
    myFrameDecorator = null;
  }
  if (myWindowsBorderUpdater != null) {
    Toolkit.getDefaultToolkit().removePropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater);
    myWindowsBorderUpdater = null;
  }

  super.dispose();
}
项目:consulo    文件:FrameWrapper.java   
private MyJFrame(FrameWrapper owner, IdeFrame parent) throws HeadlessException {
  myOwner = owner;
  myParent = parent;
  FrameState.setFrameStateListener(this);
  setGlassPane(new IdeGlassPaneImpl(getRootPane(), true));

  boolean setMenuOnFrame = SystemInfo.isMac;

  if (SystemInfo.isLinux) {
    final String desktop = System.getenv("XDG_CURRENT_DESKTOP");
    if ("Unity".equals(desktop) || "Unity:Unity7".equals(desktop)) {
      try {
        Class.forName("com.jarego.jayatana.Agent");
        setMenuOnFrame = true;
      }
      catch (ClassNotFoundException e) {
        // ignore
      }
    }
  }

  if (setMenuOnFrame) {
    setJMenuBar(new IdeMenuBar(ActionManagerEx.getInstanceEx(), DataManager.getInstance()));
  }

  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
项目:consulo    文件:FrameWrapper.java   
private MyJDialog(FrameWrapper owner, IdeFrame parent) throws HeadlessException {
  super((JFrame)parent);
  myOwner = owner;
  myParent = parent;
  setGlassPane(new IdeGlassPaneImpl(getRootPane()));
  getRootPane().putClientProperty("Window.style", "small");
  setBackground(UIUtil.getPanelBackground());
  MouseGestureManager.getInstance().add(this);
  setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt());
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
项目:intellij-ce-playground    文件:IdeFrameImpl.java   
public IdeFrameImpl(ApplicationInfoEx applicationInfoEx,
                    ActionManagerEx actionManager,
                    DataManager dataManager,
                    Application application) {
  super(applicationInfoEx.getFullApplicationName());
  myRootPane = createRootPane(actionManager, UISettings.getInstance(), dataManager, application);
  setRootPane(myRootPane);
  setBackground(UIUtil.getPanelBackground());
  AppUIUtil.updateWindowIcon(this);
  final Dimension size = ScreenUtil.getMainScreenBounds().getSize();

  size.width = Math.min(1400, size.width - 20);
  size.height= Math.min(1000, size.height - 40);

  setSize(size);
  setLocationRelativeTo(null);

  LayoutFocusTraversalPolicyExt layoutFocusTraversalPolicy = new LayoutFocusTraversalPolicyExt();
  setFocusTraversalPolicy(layoutFocusTraversalPolicy);

  setupCloseAction();
  MnemonicHelper.init(this);

  myBalloonLayout = new BalloonLayoutImpl(myRootPane, new Insets(8, 8, 8, 8));

  // to show window thumbnail under Macs
  // http://lists.apple.com/archives/java-dev/2009/Dec/msg00240.html
  if (SystemInfo.isMac) setIconImage(null);

  MouseGestureManager.getInstance().add(this);

  myFrameDecorator = IdeFrameDecorator.decorate(this);

  addWindowStateListener(new WindowAdapter() {
    @Override
    public void windowStateChanged(WindowEvent e) {
      updateBorder();
    }
  });
  if (SystemInfo.isWindows) {
    myWindowsBorderUpdater = new PropertyChangeListener() {
      @Override
      public void propertyChange(@NotNull PropertyChangeEvent evt) {
        updateBorder();
      }
    };
    Toolkit.getDefaultToolkit().addPropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater);
    if (!SystemInfo.isJavaVersionAtLeast("1.8")) {
      final Ref<Dimension> myDimensionRef = new Ref<Dimension>(new Dimension());
      final Alarm alarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
      final Runnable runnable = new Runnable() {
        @Override
        public void run() {
          if (isDisplayable() && !getSize().equals(myDimensionRef.get())) {
            Rectangle bounds = getBounds();
            bounds.width--;
            setBounds(bounds);
            bounds.width++;
            setBounds(bounds);
            myDimensionRef.set(getSize());
          }
          alarm.addRequest(this, 50);
        }
      };
      alarm.addRequest(runnable, 50);
    }
  }

  IdeMenuBar.installAppMenuIfNeeded(this);

  // UIUtil.suppressFocusStealing();

}
项目:tools-idea    文件:IdeFrameImpl.java   
public IdeFrameImpl(ApplicationInfoEx applicationInfoEx,
                    ActionManagerEx actionManager,
                    UISettings uiSettings,
                    DataManager dataManager,
                    Application application) {
  super(applicationInfoEx.getFullApplicationName());
  myRootPane = createRootPane(actionManager, uiSettings, dataManager, application);
  setRootPane(myRootPane);
  setBackground(UIUtil.getPanelBackground());
  AppUIUtil.updateWindowIcon(this);
  final Dimension size = ScreenUtil.getMainScreenBounds().getSize();
  size.width-=20;
  size.height -=40;
  setSize(size);
  setLocationRelativeTo(null);

  LayoutFocusTraversalPolicyExt layoutFocusTraversalPolicy = new LayoutFocusTraversalPolicyExt();
  setFocusTraversalPolicy(layoutFocusTraversalPolicy);

  setupCloseAction();
  new MnemonicHelper().register(this);

  myBalloonLayout = new BalloonLayoutImpl(myRootPane.getLayeredPane(), new Insets(8, 8, 8, 8));

  if (!Registry.is("ide.windowSystem.focusAppOnStartup") && !isThereActiveFrame()) {
    setFocusableWindowState(false);
  }

  // to show window thumbnail under Macs
  // http://lists.apple.com/archives/java-dev/2009/Dec/msg00240.html
  if (SystemInfo.isMac) setIconImage(null);

  MouseGestureManager.getInstance().add(this);

  myFrameDecorator = IdeFrameDecorator.decorate(this);
  addWindowStateListener(new WindowAdapter() {
    @Override
    public void windowStateChanged(WindowEvent e) {
      updateBorder();
    }
  });
  Toolkit.getDefaultToolkit().addPropertyChangeListener("win.xpstyle.themeActive", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      updateBorder();
    }
  });
  if (SystemInfo.isLinux && Registry.is("linux.native.menu")) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        ApplicationMenu.tryInstall(IdeFrameImpl.this);
      }
    });
  }
}
项目:consulo    文件:IdeFrameImpl.java   
public IdeFrameImpl(ApplicationInfoEx applicationInfoEx,
                    ActionManagerEx actionManager,
                    DataManager dataManager,
                    Application application) {
  super(FrameTitleUtil.buildTitle());
  myRootPane = createRootPane(actionManager, dataManager, application);
  setRootPane(myRootPane);
  setBackground(UIUtil.getPanelBackground());
  AppUIUtil.updateWindowIcon(this);
  final Dimension size = ScreenUtil.getMainScreenBounds().getSize();

  size.width = Math.min(1400, size.width - 20);
  size.height= Math.min(1000, size.height - 40);

  setSize(size);
  setLocationRelativeTo(null);

  LayoutFocusTraversalPolicyExt layoutFocusTraversalPolicy = new LayoutFocusTraversalPolicyExt();
  setFocusTraversalPolicy(layoutFocusTraversalPolicy);

  setupCloseAction();
  MnemonicHelper.init(this);

  myBalloonLayout = new DesktopBalloonLayoutImpl(myRootPane, new Insets(8, 8, 8, 8));

  // to show window thumbnail under Macs
  // http://lists.apple.com/archives/java-dev/2009/Dec/msg00240.html
  if (SystemInfo.isMac) setIconImage(null);

  MouseGestureManager.getInstance().add(this);

  myFrameDecorator = IdeFrameDecorator.decorate(this);

  addWindowStateListener(new WindowAdapter() {
    @Override
    public void windowStateChanged(WindowEvent e) {
      updateBorder();
    }
  });
  if (SystemInfo.isWindows) {
    myWindowsBorderUpdater = __ -> updateBorder();
    Toolkit.getDefaultToolkit().addPropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater);
    if (!SystemInfo.isJavaVersionAtLeast("1.8")) {
      final Ref<Dimension> myDimensionRef = new Ref<>(new Dimension());
      final Alarm alarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
      final Runnable runnable = new Runnable() {
        @Override
        public void run() {
          if (isDisplayable() && !getSize().equals(myDimensionRef.get())) {
            Rectangle bounds = getBounds();
            bounds.width--;
            setBounds(bounds);
            bounds.width++;
            setBounds(bounds);
            myDimensionRef.set(getSize());
          }
          alarm.addRequest(this, 50);
        }
      };
      alarm.addRequest(runnable, 50);
    }
  }
  // UIUtil.suppressFocusStealing();
}
项目:consulo    文件:FrameWrapper.java   
@Override
public void dispose() {
  if (isDisposed()) return;

  Window frame = myFrame;
  StatusBar statusBar = myStatusBar;

  if (myShown && myDimensionKey != null) {
    WindowStateService.getInstance().saveStateFor(myProject, myDimensionKey, frame);
  }

  myFrame = null;
  myPreferredFocus = null;
  myProject = null;
  myDataMap.clear();

  if (myComponent != null && myFocusWatcher != null) {
    myFocusWatcher.deinstall(myComponent);
  }
  myFocusWatcher = null;
  myFocusedCallback = null;
  myComponent = null;
  myImages = null;
  myDisposed = true;

  if (statusBar != null) {
    Disposer.dispose(statusBar);
  }

  if (frame != null) {
    frame.setVisible(false);

    JRootPane rootPane = ((RootPaneContainer)frame).getRootPane();
    frame.removeAll();
    DialogWrapper.cleanupRootPane(rootPane);

    if (frame instanceof IdeFrame) {
      MouseGestureManager.getInstance().remove((IdeFrame)frame);
    }

    frame.dispose();

    DialogWrapper.cleanupWindowListeners(frame);
  }
}