Java Code Examples for com.intellij.openapi.ui.DialogWrapper#cleanupRootPane()

The following examples show how to use com.intellij.openapi.ui.DialogWrapper#cleanupRootPane() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DialogWrapperPeerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void dispose() {
  if (isShowing()) {
    hide();
  }

  if (myWindowListener != null) {
    myWindowListener.saveSize();
    removeWindowListener(myWindowListener);
    myWindowListener = null;
  }

  DialogWrapper.cleanupWindowListeners(this);

  final BufferStrategy strategy = getBufferStrategy();
  if (strategy != null) {
    strategy.dispose();
  }
  super.dispose();

  removeAll();
  DialogWrapper.cleanupRootPane(rootPane);
  rootPane = null;

  // http://bugs.sun.com/view_bug.do?bug_id=6614056
  try {
    synchronized (getTreeLock()) {
      List<Dialog> list = DialogHacking.modalDialogs();
      list.remove(this);
    }
  }
  catch (final Exception ignored) {
  }
}
 
Example 2
Source File: GlassPaneDialogWrapperPeer.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void dispose() {
  DialogWrapper.cleanupRootPane(this);
  myDialog = null;
}
 
Example 3
Source File: SheetMessage.java    From consulo with Apache License 2.0 4 votes vote down vote up
void startAnimation(final boolean enlarge) {
  staticImage = myController.getStaticImage();
  JPanel staticPanel = new JPanel() {
    @Override
    public void paint(@Nonnull Graphics g) {
      super.paint(g);
      if (staticImage != null) {
        Graphics2D g2d = (Graphics2D)g.create();


        g2d.setBackground(new JBColor(new Color(255, 255, 255, 0), new Color(110, 110, 110, 0)));
        g2d.clearRect(0, 0, myController.SHEET_NC_WIDTH, myController.SHEET_NC_HEIGHT);


        g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.95f));

        int multiplyFactor = staticImage.getWidth(null) / myController.SHEET_NC_WIDTH;

        g.drawImage(staticImage, 0, 0, myController.SHEET_NC_WIDTH, imageHeight, 0, staticImage.getHeight(null) - imageHeight * multiplyFactor, staticImage.getWidth(null),
                    staticImage.getHeight(null), null);
      }
    }
  };
  staticPanel.setOpaque(false);
  staticPanel.setSize(myController.SHEET_NC_WIDTH, myController.SHEET_NC_HEIGHT);
  myWindow.setContentPane(staticPanel);

  Animator myAnimator = new Animator("Roll Down Sheet Animator", myController.SHEET_NC_HEIGHT, TIME_TO_SHOW_SHEET, false) {
    @Override
    public void paintNow(int frame, int totalFrames, int cycle) {
      setPositionRelativeToParent();
      float percentage = (float)frame / (float)totalFrames;
      imageHeight = enlarge ? (int)(((float)myController.SHEET_NC_HEIGHT) * percentage) : (int)(myController.SHEET_NC_HEIGHT - percentage * myController.SHEET_HEIGHT);
      myWindow.repaint();
    }

    @Override
    protected void paintCycleEnd() {
      setPositionRelativeToParent();
      if (enlarge) {
        imageHeight = myController.SHEET_NC_HEIGHT;
        staticImage = null;
        myWindow.setContentPane(myController.getPanel(myWindow));

        IJSwingUtilities.moveMousePointerOn(myWindow.getRootPane().getDefaultButton());
        myController.requestFocus();
      }
      else {
        if (restoreFullScreenButton) {
          FullScreenUtilities.setWindowCanFullScreen(myParent, true);
        }
        myParent.removeComponentListener(myPositionListener);
        myController.dispose();
        myWindow.dispose();
        DialogWrapper.cleanupRootPane(myWindow.getRootPane());
      }
    }
  };

  myAnimator.resume();

}
 
Example 4
Source File: UiInspectorAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void dispose() {
  super.dispose();
  DialogWrapper.cleanupRootPane(rootPane);
  DialogWrapper.cleanupWindowListeners(this);
}