示例#1
0
 @Override
 public void cancel(InputEvent e) {
   super.cancel(e);
   disposeChildren();
   Disposer.dispose(this);
   getStep().canceled();
 }
示例#2
0
  @Override
  public void show(
      final Component owner,
      final int aScreenX,
      final int aScreenY,
      final boolean considerForcedXY) {
    LOG.assertTrue(!isDisposed());

    Rectangle targetBounds =
        new Rectangle(new Point(aScreenX, aScreenY), getContent().getPreferredSize());
    ScreenUtil.moveRectangleToFitTheScreen(targetBounds);

    if (getParent() != null) {
      final Rectangle parentBounds = getParent().getBounds();
      parentBounds.x += STEP_X_PADDING;
      parentBounds.width -= STEP_X_PADDING * 2;
      if (parentBounds.intersects(targetBounds)) {
        targetBounds.x = getParent().getBounds().x - targetBounds.width - STEP_X_PADDING;
      }
    }

    if (getParent() == null) {
      PopupDispatcher.setActiveRoot(this);
    } else {
      PopupDispatcher.setShowing(this);
    }

    LOG.assertTrue(!isDisposed(), "Disposed popup, parent=" + getParent());
    super.show(owner, targetBounds.x, targetBounds.y, true);
  }
示例#3
0
 @Override
 public void setOk(boolean ok) {
   if (getParent() == null) {
     super.setOk(ok);
   } else {
     getParent().setOk(ok);
   }
 }
示例#4
0
 @Override
 public final void setFinalRunnable(Runnable runnable) {
   if (getParent() == null) {
     super.setFinalRunnable(runnable);
   } else {
     getParent().setFinalRunnable(runnable);
   }
 }
示例#5
0
  @Override
  protected void afterShow() {
    super.afterShow();
    registerAutoMove();

    if (!myFocusTrackback.isMustBeShown()) {
      cancel();
    }
  }
示例#6
0
  @Override
  public void dispose() {
    super.dispose();

    myAutoSelectionTimer.stop();

    PopupDispatcher.unsetShowing(this);
    PopupDispatcher.clearRootIfNeeded(this);

    if (myOwnerWindow != null && myOwnerListener != null) {
      myOwnerWindow.removeComponentListener(myOwnerListener);
    }
  }
 @Override
 public Point getCenterOf(JComponent container, JComponent content) {
   return AbstractPopup.getCenterOf(container, content);
 }