Ejemplo n.º 1
0
 public int maxHeightTrue() {
   int max = 0;
   if (_popupUtil != null && _popupUtil.getFixedHeight() != 0) {
     max = _popupUtil.getFixedHeight();
     max += _popupUtil.getBorderSize() * 2;
     if (max < PositionablePopupUtil.MIN_SIZE) { // don't let item disappear
       _popupUtil.setFixedHeight(PositionablePopupUtil.MIN_SIZE);
     }
   } else {
     // if(_text) {
     if (_text && getText() != null && getFont() != null) {
       max = getFontMetrics(getFont()).getHeight();
     }
     if (_icon && _namedIcon != null) {
       max = Math.max(_namedIcon.getIconHeight(), max);
     }
     if (_text && _popupUtil != null) {
       max += _popupUtil.getMargin() * 2;
       max += _popupUtil.getBorderSize() * 2;
     }
     if (max < PositionablePopupUtil.MIN_SIZE) { // don't let item disappear
       max = PositionablePopupUtil.MIN_SIZE;
     }
   }
   if (debug) {
     log.trace("maxHeight= " + max + " preferred height= " + getPreferredSize().height);
   }
   return max;
 }