422
423 private void cacheChildSizes() {
424 if (getComponentCount() > 0) {
425 Component child = getComponent(0);
426 min = child.getMinimumSize();
427 pref = child.getPreferredSize();
428 max = child.getMaximumSize();
429 yalign = child.getAlignmentY();
430 xalign = child.getAlignmentX();
431 } else {
432 min = pref = max = new Dimension(0, 0);
433 }
434 }
435
436 /**
437 * Shows or hides this component depending on the value of parameter
438 * <code>b</code>.
439 * @param b If <code>true</code>, shows this component;
440 * otherwise, hides this component.
441 * @see #isVisible
442 * @since JDK1.1
443 */
444 public void setVisible(boolean b) {
445 super.setVisible(b);
446 if (getComponentCount() > 0) {
447 getComponent(0).setVisible(b);
448 }
449 }
450
451 /**
452 * Overridden to fix 4759054. Must return true so that content
453 * is painted when inside a CellRendererPane which is normally
454 * invisible.
455 */
456 public boolean isShowing() {
457 return true;
458 }
459
460 public Dimension getMinimumSize() {
461 validateIfNecessary();
462 return min;
|
422
423 private void cacheChildSizes() {
424 if (getComponentCount() > 0) {
425 Component child = getComponent(0);
426 min = child.getMinimumSize();
427 pref = child.getPreferredSize();
428 max = child.getMaximumSize();
429 yalign = child.getAlignmentY();
430 xalign = child.getAlignmentX();
431 } else {
432 min = pref = max = new Dimension(0, 0);
433 }
434 }
435
436 /**
437 * Shows or hides this component depending on the value of parameter
438 * <code>b</code>.
439 * @param b If <code>true</code>, shows this component;
440 * otherwise, hides this component.
441 * @see #isVisible
442 * @since 1.1
443 */
444 public void setVisible(boolean b) {
445 super.setVisible(b);
446 if (getComponentCount() > 0) {
447 getComponent(0).setVisible(b);
448 }
449 }
450
451 /**
452 * Overridden to fix 4759054. Must return true so that content
453 * is painted when inside a CellRendererPane which is normally
454 * invisible.
455 */
456 public boolean isShowing() {
457 return true;
458 }
459
460 public Dimension getMinimumSize() {
461 validateIfNecessary();
462 return min;
|