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();
   }
 }
 public static boolean isPopUpVisible() {
   boolean ret = false;
   if (menuPopUp != null) {
     ret = menuPopUp.isVisible();
   }
   return ret;
 }
 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;
 }
示例#5
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);
  }
示例#6
0
  /** Show the status popup menu over this status button */
  private void showStatusMenu() {
    if (statusMenu.isVisible()) {
      return;
    }
    currentParent = StatusButton.this;
    txtStatus.setText(message);

    if (heightInvalid) {
      statusMenu.show(currentParent, 0, 0);
      statusMenu.setVisible(false);
      heightInvalid = false;
    }
    statusMenu.show(currentParent, 0, 0 - statusMenu.getHeight());
  }
  /**
   * Hide/show items depending on whether the user wants the simple view or simple.
   *
   * @param bSimple
   */
  protected void setDisplay(boolean bSimple) {
    if (bSimple) {
      mnuTemplates.setVisible(false);
      separator1.setVisible(false);
      mnuMemetic.setVisible(false);
      separator2.setVisible(false);

    } else {
      mnuTemplates.setVisible(true);
      separator1.setVisible(true);
      mnuMemetic.setVisible(true);
      separator2.setVisible(true);
    }

    setControlItemStatus(bSimple);

    JPopupMenu pop = mnuMainMenu.getPopupMenu();
    if (pop.isVisible()) {
      pop.setVisible(false);
      pop.setVisible(true);
      pop.requestFocus();
    }
  }
示例#8
0
 @Override
 public boolean isPopupMenuVisible() {
   ensurePopupMenuCreated();
   return popupMenu.isVisible();
 }
 public void mouseReleased(MouseEvent e) {
   showDialog(e, !popupMenu.isVisible());
 }