javax.swing.JPopupMenu.isShowing()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中javax.swing.JPopupMenu.isShowing()方法的一些代码示例,展示了JPopupMenu.isShowing()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPopupMenu.isShowing()方法的具体详情如下:
包路径:javax.swing.JPopupMenu
类名称:JPopupMenu
方法名:isShowing

JPopupMenu.isShowing介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void mouseClicked(MouseEvent e) {
  if(popup.isShowing()) {
    popup.setVisible(false);
  } else {
    displayOverflow();
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

public static boolean isPopupContained(JPopupMenu popup) {
  if (!popup.isShowing()) {
    return false;
  }
  return willPopupBeContained(popup, popup.getLocationOnScreen());
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

private static boolean willPopupBeContained(JPopupMenu popup, Point origin) {
  if (!popup.isShowing()) {
    return false;
  }
  Window w = SwingUtilities.windowForComponent(popup.getInvoker());
  Rectangle r = new Rectangle(origin, popup.getSize());
  return (w != null) && w.getBounds().contains(r);
}

代码示例来源:origin: mucommander/mucommander

/** 
 * Returns true if the auto-completion popup window is visible.
 */
protected boolean isPopupListShowing() {
  return popup.isShowing();
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public boolean isCompletionPopupShowing()
{
 return _completionPopup != null && _completionPopup.isShowing();
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

public boolean isContextMenuShowing()
{
 return _contextMenu != null && _contextMenu.isShowing();
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

if (!popup.isShowing()) {
  return;

代码示例来源:origin: org.netbeans.api/org-openide-awt

public static void dynamicChange(final JPopupMenu popup, boolean usedToBeContained) {
  if (!popup.isShowing()) {
    return;

代码示例来源:origin: mucommander/mucommander

/** 
 * Returns true if there is a selected item at the auto-completion popup window.
 */
protected boolean isItemSelectedAtPopupList() {
  return popup.isShowing() && list.getSelectedIndex() >= 0;
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void eventDispatched(AWTEvent event) {
  MouseEvent e = (MouseEvent) event;
  if(isVisible() && !isShowing() && popup.isShowing()) {
    popup.setVisible(false);
    return;
    if (popup.isShowing() && e.getID() == MouseEvent.MOUSE_EXITED) {
      int minX = popup.getLocationOnScreen().x;
      int maxX = popup.getLocationOnScreen().x + popup.getWidth();
    if (popup.isShowing() && overflowButton.isShowing() && (e.getID() == MouseEvent.MOUSE_MOVED || e.getID() == MouseEvent.MOUSE_EXITED)) {
      int minX = overflowButton.getLocationOnScreen().x;
      int maxX_ob = minX + overflowButton.getWidth();

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

public boolean isIntellisensePopupShowing()
{
 return (_beanInfoPopup != null && _beanInfoPopup.isShowing()) ||
     (_valuePopup != null && _valuePopup.isShowing());
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

private void removeListItem(TmmTaskHandle handle) {
 taskMap.remove(handle);
 pane.removeListComponent(handle);
 if (popup.isShowing() && taskMap.isEmpty()) {
  hidePopup();
 }
 else if (popup.isShowing()) {
  resizePopup();
 }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public static boolean isPopupContained(JPopupMenu popup) {
  if (!popup.isShowing()) {
    return false;
  }
  return willPopupBeContained(popup, popup.getLocationOnScreen());
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

@Override
public void mouseClicked(MouseEvent e) {
 if (popup.isShowing()) {
  hidePopup();
 }
 else {
  showPopup();
 }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public static boolean isPopupContained(JPopupMenu popup) {
  if (!popup.isShowing()) {
    return false;
  }
  return willPopupBeContained(popup, popup.getLocationOnScreen());
}

代码示例来源:origin: GoldenGnu/jeveassets

@Override
public void mouseExited(final MouseEvent e) {
  mouseOverThis = false;
  if (jPopupMenu.isShowing()) {
    getModel().setRollover(true);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

private static boolean willPopupBeContained(JPopupMenu popup, Point origin) {
  if (!popup.isShowing()) {
    return false;
  }
  Window w = SwingUtilities.windowForComponent (popup.getInvoker());
  Rectangle r = new Rectangle (origin, popup.getSize ());
  return w != null && w.getBounds ().contains (r);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

private static boolean willPopupBeContained(JPopupMenu popup, Point origin) {
  if (!popup.isShowing()) {
    return false;
  }
  Window w = SwingUtilities.windowForComponent (popup.getInvoker());
  Rectangle r = new Rectangle (origin, popup.getSize ());
  return w != null && w.getBounds ().contains (r);
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

protected void togglePopup(java.awt.event.MouseEvent evt) {
  if (popupMenu != null && popupMenu.isShowing() || popupBecameInvisible >= evt.getWhen()) {
    popupMenu.setVisible(false);
  } else {
    showPopup(evt);
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
  if (popupMenuUI.screenImage != null) {
    JPopupMenu popup = (JPopupMenu) e.getSource();
    JRootPane root = popup.getRootPane();
    if (popup.isShowing() && root.isShowing()) {
      Point ptPopup = popup.getLocationOnScreen();
      Point ptRoot = root.getLocationOnScreen();
      Graphics g = popup.getRootPane().getGraphics();
      g.drawImage(popupMenuUI.screenImage, ptPopup.x - ptRoot.x, ptPopup.y - ptRoot.y, null);
      popupMenuUI.resetScreenImage();
    }
  }
}

相关文章

JPopupMenu类方法