Java 类com.intellij.ui.components.ZoomableViewport 实例源码

项目:intellij-ce-playground    文件:MacGestureAdapter.java   
@Override
public void gestureBegan(GesturePhaseEvent event) {
  magnification = 0;

  Point mouse = MouseInfo.getPointerInfo().getLocation();
  SwingUtilities.convertPointFromScreen(mouse, myFrame.getComponent());
  Component deepest = SwingUtilities.getDeepestComponentAt(myFrame.getComponent(), mouse.x, mouse.y);
  ZoomableViewport viewport = (ZoomableViewport) SwingUtilities.getAncestorOfClass(ZoomableViewport.class, deepest);
  if (viewport != null) {
    Magnificator magnificator = viewport.getMagnificator();

    if (magnificator != null) {
      Point at = MouseInfo.getPointerInfo().getLocation();
      SwingUtilities.convertPointFromScreen(at, (JComponent)viewport);
      viewport.magnificationStarted(at);
      myMagnifyingViewport = viewport;
    }
  }
}
项目:tools-idea    文件:MacGestureAdapter.java   
@Override
public void gestureBegan(GesturePhaseEvent event) {
  magnification = 0;

  Point mouse = MouseInfo.getPointerInfo().getLocation();
  SwingUtilities.convertPointFromScreen(mouse, myFrame.getComponent());
  Component deepest = SwingUtilities.getDeepestComponentAt(myFrame.getComponent(), mouse.x, mouse.y);
  ZoomableViewport viewport = (ZoomableViewport) SwingUtilities.getAncestorOfClass(ZoomableViewport.class, deepest);
  if (viewport != null) {
    Magnificator magnificator = viewport.getMagnificator();

    if (magnificator != null) {
      Point at = MouseInfo.getPointerInfo().getLocation();
      SwingUtilities.convertPointFromScreen(at, (JComponent)viewport);
      viewport.magnificationStarted(at);
      myMagnifyingViewport = viewport;
    }
  }
}
项目:consulo    文件:MacGestureAdapter.java   
@Override
public void gestureBegan(GesturePhaseEvent event) {
  magnification = 0;

  Point mouse = MouseInfo.getPointerInfo().getLocation();
  SwingUtilities.convertPointFromScreen(mouse, myFrame.getComponent());
  Component deepest = SwingUtilities.getDeepestComponentAt(myFrame.getComponent(), mouse.x, mouse.y);
  ZoomableViewport viewport = (ZoomableViewport) SwingUtilities.getAncestorOfClass(ZoomableViewport.class, deepest);
  if (viewport != null) {
    Magnificator magnificator = viewport.getMagnificator();

    if (magnificator != null) {
      Point at = MouseInfo.getPointerInfo().getLocation();
      SwingUtilities.convertPointFromScreen(at, (JComponent)viewport);
      viewport.magnificationStarted(at);
      myMagnifyingViewport = viewport;
    }
  }
}