code: public void setHonorsVisibility(boolean b) {
          boolean oldHonorsVisibility = getHonorsVisibility();
          if (oldHonorsVisibility == b) {
              return;
          }
          honorsVisibility = b;
          Set componentSet = constraintMap.keySet();
          if (componentSet.isEmpty()) {
              return;
          }
          Component firstComponent = (Component) componentSet.iterator().next();
          Container container = firstComponent.getParent();
          invalidateAndRepaint(container);
      }
docs: Specifies whether invisible components shall be taken into account by this layout for
  computing the layout size and setting component bounds. If set to {@code true} invisible
  components will be ignored by the layout. If set to {@code false} components will be taken
  into account regardless of their visibility. Visible components are always used for sizing
  and positioning.<p>
  
  The default value for this setting is {@code true}. It is useful to set the value to
  {@code false} (in other words to ignore the visibility) if you switch the component
  visibility dynamically and want the container to retain the size and component positions.<p>
  
  This container-wide default setting can be overridden per component using
  {@link #setHonorsVisibility(Component, Boolean)}
  .<p>
  
  Components are taken into account, if<ol>
  <li> they are visible, or
  <li> they have no individual setting and the container-wide settings ignores the visibility
  (honorsVisibility set to {@code false}), or
  <li> the individual component ignores the visibility.
  </ol>
  
  @param b {@code true} to honor the visibility, i.e. to exclude invisible components from the
  sizing and positioning, {@code false} to ignore the visibility, in other words to layout
  visible and invisible components
  
  @since 1.2