javax.swing.JMenu.getHeight()方法的使用及代码示例

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

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

JMenu.getHeight介绍

暂无

代码示例

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = HEIGHT_JSDOC)
@Override
public int getHeight() {
  return super.getHeight();
}

代码示例来源:origin: de.sciss/submin

@Override
  protected void paintBackground(Graphics2D g2d, boolean selected) {
    if (component.getParent() instanceof JPopupMenu) {
//            super.paintBackground ( g2d, selected );
      if (selected) {
        g2d.setPaint(new GradientPaint(0, 0, selectedTopBg, 0, component.getHeight(), selectedBottomBg));
        g2d.fillRect(0, 0, component.getWidth(), component.getHeight());
      }
    } else {
      if (component.isEnabled() && (selected || mouseover)) {
//                LafUtils.drawWebStyle ( g2d, component, shadeColor, shadeWidth, round, component.isEnabled (),
//                        !selected && mouseover, selected ? StyleConstants.averageBorderColor : StyleConstants.borderColor );
        // final Color borderColor = selected ? StyleConstants.averageBorderColor : StyleConstants.borderColor;
//                final float opacity = mouseover ? getHoverOpacity () : 1f;
        final float opacity = selected ? 1f : getHoverOpacity();
        final Paint bgPaint = new GradientPaint(0, 0, selectedTopBg, 0, component.getHeight(), selectedBottomBg);
        drawShape(g2d, component, shadeColor, shadeWidth, round, component.isEnabled(),
            borderColor, borderColor, bgPaint, opacity);
      }
    }
  }

代码示例来源:origin: com.jidesoft/jide-oss

private boolean isClickOnButton(MouseEvent e, JMenu menu) {
  if (((JideSplitButton) menu).isAlwaysDropdown()) {
    return false;
  }
  boolean clickOnDropDown = false;
  int size = ((JMenu) menuItem).isTopLevelMenu() ? _splitButtonMargin : _splitButtonMarginOnMenu;
  if (JideSwingUtilities.getOrientationOf(menuItem) == SwingConstants.HORIZONTAL) {
    if (e.getPoint().getX() < menu.getWidth() - size) {
      clickOnDropDown = true;
    }
  }
  else {
    if (e.getPoint().getY() < menu.getHeight() - size) {
      clickOnDropDown = true;
    }
  }
  return clickOnDropDown;
}

代码示例来源:origin: com.jidesoft/jide-oss

private boolean isClickOnButton(MouseEvent e, JMenu menu) {
  if (((JideSplitButton) menu).isAlwaysDropdown()) {
    return false;
  }
  boolean clickOnDropDown = false;
  int size = ((JMenu) menuItem).isTopLevelMenu() ? _splitButtonMargin : _splitButtonMarginOnMenu;
  if (JideSwingUtilities.getOrientationOf(menuItem) == SwingConstants.HORIZONTAL) {
    if (e.getPoint().getX() < menu.getWidth() - size) {
      clickOnDropDown = true;
    }
  }
  else {
    if (e.getPoint().getY() < menu.getHeight() - size) {
      clickOnDropDown = true;
    }
  }
  return clickOnDropDown;
}

代码示例来源:origin: com.jidesoft/jide-oss

int size = 27;
if (JideSwingUtilities.getOrientationOf(menuItem) == SwingConstants.HORIZONTAL) {
  if (e.getPoint().getY() < menu.getHeight() - size) {
    clickOnDropDown = true;
  if (e.getPoint().getY() < menu.getHeight() - size) {
    clickOnDropDown = true;
  if (e.getPoint().getY() < menu.getHeight() - size) {
    clickOnDropDown = true;

相关文章