private void showSliderMenu() {
    Point location = new Point(getX(), getY() + getHeight());

    SwingUtilities.convertPointToScreen(location, InputVolumeControlButton.this.getParent());

    if (isFullScreen()) {
      location.setLocation(
          location.getX(),
          location.getY() - sliderMenu.getPreferredSize().getHeight() - getHeight());
    }

    sliderMenu.setLocation(location);

    sliderMenu.addPopupMenuListener(
        new PopupMenuListener() {
          public void popupMenuWillBecomeVisible(PopupMenuEvent ev) {
            sliderMenuIsVisible = true;
          }

          public void popupMenuWillBecomeInvisible(PopupMenuEvent ev) {
            sliderMenuIsVisible = false;
          }

          public void popupMenuCanceled(PopupMenuEvent ev) {}
        });

    sliderMenu.setVisible(!sliderMenu.isVisible());
  }
 public void mouseExited(MouseEvent e) {
   // Remove overlay only if the dialog isn't visible
   if (!popupMenu.isVisible()) {
     this.drawOverlay = false;
     this.repaint();
   }
 }
Beispiel #3
0
  public void mouseExited(MouseEvent e) {
    // if the popup menu for is visible, don't register this,
    // because the popup being set visible will fire a mouseExited() event
    if ((popup != null) && popup.isVisible()) return;

    if (state[OPEN] != INACTIVE) {
      setState(OPEN, INACTIVE, true);
    }
    handleMouse(e);
  }
 public void mouseReleased(MouseEvent e) {
   showDialog(e, !popupMenu.isVisible());
 }