Class GridItemRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer

class GridItemRenderer extends BlockRenderer
Wrapper renderer around grid item. It's expected there is always exactly 1 child renderer.
  • Field Details

    • renderer

      A renderer to wrap.
    • heightSet

      private boolean heightSet
      Flag saying that we updated height of the renderer we wrap. It allows to remove that property on split.
  • Constructor Details

    • GridItemRenderer

      GridItemRenderer()
  • Method Details

    • addChild

      public void addChild(IRenderer renderer)
      Adds a child to the current renderer
      Specified by:
      addChild in interface IRenderer
      Overrides:
      addChild in class AbstractRenderer
      Parameters:
      renderer - a child to be added
    • getNextRenderer

      public IRenderer getNextRenderer()
      Gets a new instance of this class to be used as a next renderer, after this renderer is used, if IRenderer.layout(LayoutContext) is called more than once.
      Returns:
      new renderer instance
    • getProperty

      public <T1> T1 getProperty(int key)
      Gets the property from this entity. Compared to IPropertyContainer.getOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
      Specified by:
      getProperty in interface IPropertyContainer
      Overrides:
      getProperty in class AbstractRenderer
      Type Parameters:
      T1 - the return type associated with the property
      Parameters:
      key - the property to be retrieved
      Returns:
      the value of the given property. null will be returned if the property value was not found
    • setProperty

      public void setProperty(int property, Object value)
      Sets a property for this entity.
      Specified by:
      setProperty in interface IPropertyContainer
      Overrides:
      setProperty in class AbstractRenderer
      Parameters:
      property - the property to be set
      value - the value of the property
    • updateHeightsOnSplit

      void updateHeightsOnSplit(float usedHeight, boolean wasHeightClipped, AbstractRenderer splitRenderer, AbstractRenderer overflowRenderer, boolean enlargeOccupiedAreaOnHeightWasClipped)
      Overrides:
      updateHeightsOnSplit in class AbstractRenderer
    • addChildRenderer

      void addChildRenderer(IRenderer child)
      Add the specified renderer to the end of children list and update its parent link to this.
      Overrides:
      addChildRenderer in class AbstractRenderer
      Parameters:
      child - the child renderer to be add
    • calculateHeight

      float calculateHeight(float initialHeight)