Ejemplo n.º 1
0
  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());
  }
Ejemplo n.º 2
0
 public void mouseExited(MouseEvent e) {
   // Remove overlay only if the dialog isn't visible
   if (!popupMenu.isVisible()) {
     this.drawOverlay = false;
     this.repaint();
   }
 }
 public void showPopupAbove(Point loc, GraphControllerPopupListener graphControllerPopupListener) {
   if (_popUp.isVisible()) {
     _popUp.setVisible(false);
   } else {
     _popUp.show(_desktopPane, 0, 0);
     _popUp.setLocation(loc.x, loc.y - _popUp.getHeight());
   }
   _currentGraphControllerPopupListener = graphControllerPopupListener;
 }
Ejemplo n.º 4
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);
  }
Ejemplo n.º 5
0
 public void mouseReleased(MouseEvent e) {
   showDialog(e, !popupMenu.isVisible());
 }