Enum StretchTypeEnum

java.lang.Object
java.lang.Enum<StretchTypeEnum>
net.sf.jasperreports.engine.type.StretchTypeEnum
All Implemented Interfaces:
Serializable, Comparable<StretchTypeEnum>, java.lang.constant.Constable, 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)
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    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.
    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.
    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.
    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.
    A constant indicating that the element preserves its original specified height.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.sf.jasperreports.engine.type.NamedEnum

    getDefault
  • Enum Constant Details

    • 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.
  • Field Details

  • Method Details

    • values

      public static StretchTypeEnum[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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
    • getName

      public String getName()
      Specified by:
      getName in interface NamedEnum
    • getByName

      public static StretchTypeEnum getByName(String name)
    • getValueOrDefault

      public static StretchTypeEnum getValueOrDefault(StretchTypeEnum value)