Enum StretchTypeEnum

  • All Implemented Interfaces:
    Serializable, Comparable<StretchTypeEnum>, NamedEnum

    public enum StretchTypeEnum
    extends Enum<StretchTypeEnum>
    implements NamedEnum
    There are two main reasons for an element to stretch.

    First, there is the natural stretch of the element, which is caused by the element growing naturally in order to display its entire content. This is the case with text fields that have isStretchWithOverflow set to true and thus growing in height in order to display all the rows of text that the value of their text field expression provides at runtime.

    Secondly, there is the forced stretch of an element, which in addition to its natural growth required by its own content, needs to further grow to match the growing height of some other element that it is put in relation with at report design time.

    A forced stretch can be imposed to elements that are part of element groups (JRElementGroup) or element containers (bands, frames, table cells, list cells, etc.). The forced stretch also comes in two flavors.
    There is element group stretch and container stretch.
    Element group stretch is forced upon an element by the natural growth of the other elements in the same group.
    The container stretch is forced upon an element by all types of growth that the container itself suffers, including forced container stretch imposed onto the container by its own parent container.

    Author:
    Sanda Zaharia (shertage@users.sourceforge.net)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CONTAINER_BOTTOM
      Constant used for specifying that the element will adapt its height to match the new height of the container it is placed on, which has been affected by stretch, but also taking into account the fact that the Y position of the element has probably changed and should be compensated for, resulting in the element's distance to container bottom being preserved.
      CONTAINER_HEIGHT
      Constant used for specifying that the element will adapt its height to match the new height of the container it is placed on, which has been affected by stretch, but without taking into account the fact that the Y position of the element within the container has probably changed due to floating and/or collapsing white space above it.
      ELEMENT_GROUP_BOTTOM
      Constant used for specifying that the element will adapt its height to match the changing height of the overall element group it is part of, but also taking into account the fact that the Y position of the element within the group has probably changed due to floating and/or collapsing white space above it and should be compensated for, resulting in the element's distance to the group's initial bottom edge being preserved.
      ELEMENT_GROUP_HEIGHT
      Constant used for specifying that the element will adapt its height to match the changing height of the overall element group it is part of, but without taking into account the fact that the Y position of the element within the group has probably changed due to floating and/or collapsing white space above it.
      NO_STRETCH
      A constant indicating that the element preserves its original specified height.
    • Enum Constant Detail

      • NO_STRETCH

        public static final StretchTypeEnum NO_STRETCH
        A constant indicating that the element preserves its original specified height.
      • ELEMENT_GROUP_HEIGHT

        public static final StretchTypeEnum ELEMENT_GROUP_HEIGHT
        Constant used for specifying that the element will adapt its height to match the changing height of the overall element group it is part of, but without taking into account the fact that the Y position of the element within the group has probably changed due to floating and/or collapsing white space above it. This position change is not compensated for, which might result in the element distance to the group's initial bottom edge increasing or diminishing.
        Like all element group based types of stretch, the amount of stretch forced onto the element comes only from the natural stretch of the sibling elements in the same group.
      • ELEMENT_GROUP_BOTTOM

        public static final StretchTypeEnum ELEMENT_GROUP_BOTTOM
        Constant used for specifying that the element will adapt its height to match the changing height of the overall element group it is part of, but also taking into account the fact that the Y position of the element within the group has probably changed due to floating and/or collapsing white space above it and should be compensated for, resulting in the element's distance to the group's initial bottom edge being preserved.
        Like all element group based types of stretch, the amount of stretch forced onto the element comes only from the natural stretch of the sibling elements in the same group.
      • CONTAINER_HEIGHT

        public static final StretchTypeEnum CONTAINER_HEIGHT
        Constant used for specifying that the element will adapt its height to match the new height of the container it is placed on, which has been affected by stretch, but without taking into account the fact that the Y position of the element within the container has probably changed due to floating and/or collapsing white space above it. This position change is not compensated for, which might result in the element distance to the container's bottom edge increasing or diminishing. It could even happen that the element bottom edge goes beyond container bottom edge and thus the element will no longer render at all.
        Like all container based types of stretch, the amount of stretch forced onto the element can come from both the natural stretch of the sibling elements in the same container, or from the container's own forced stretch imposed onto it by its own parent container.
      • CONTAINER_BOTTOM

        public static final StretchTypeEnum CONTAINER_BOTTOM
        Constant used for specifying that the element will adapt its height to match the new height of the container it is placed on, which has been affected by stretch, but also taking into account the fact that the Y position of the element has probably changed and should be compensated for, resulting in the element's distance to container bottom being preserved.
        Like all container based types of stretch, the amount of stretch forced onto the element can come from both the natural stretch of the sibling elements in the same container, or from the container's own forced stretch imposed onto it by its own parent container.
    • Method Detail

      • values

        public static StretchTypeEnum[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StretchTypeEnum c : StretchTypeEnum.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StretchTypeEnum valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null