Interface IPLHasMargin<IMPLTYPE extends IPLHasMargin<IMPLTYPE>>

Type Parameters:
IMPLTYPE - Implementation type
All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>, IPLHasOutline
All Known Subinterfaces:
IPLBlockElement<IMPLTYPE>, IPLElement<IMPLTYPE>, IPLHasMarginBorderPadding<IMPLTYPE>, IPLInlineElement<IMPLTYPE>
All Known Implementing Classes:
AbstractPLBlockElement, AbstractPLBox, AbstractPLElement, AbstractPLExternalLink, AbstractPLImage, AbstractPLInlineBox, AbstractPLInlineElement, AbstractPLText, PLBox, PLExternalLink, PLImage, PLMarginBorderPadding, PLPageSet, PLStreamImage, PLTable, PLTableCell, PLText

public interface IPLHasMargin<IMPLTYPE extends IPLHasMargin<IMPLTYPE>> extends IPLHasOutline, com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
Base interface for objects having a margin
Author:
Philip Helger
  • Field Details

    • DEFAULT_MARGIN

      static final MarginSpec DEFAULT_MARGIN
      The default margin is a 0 margin, meaning no margin at all.
  • Method Details

    • setMargin

      @Nonnull default IMPLTYPE setMargin(float fMargin)
      Set all margin values (left, top, right, bottom) to the same value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
    • setMargin

      @Nonnull default IMPLTYPE setMargin(float fMarginY, float fMarginX)
      Set all margin values.
      Parameters:
      fMarginY - The Y-value to use (for top and bottom).
      fMarginX - The X-value to use (for left and right).
      Returns:
      this
    • setMargin

      @Nonnull default IMPLTYPE setMargin(float fMarginTop, float fMarginRight, float fMarginBottom, float fMarginLeft)
      Set all margin values to potentially different values.
      Parameters:
      fMarginTop - Top
      fMarginRight - Right
      fMarginBottom - Bottom
      fMarginLeft - Left
      Returns:
      this
    • setMargin

      @Nonnull IMPLTYPE setMargin(@Nonnull MarginSpec aMargin)
      Set the margin values.
      Parameters:
      aMargin - Margin to use. May not be null.
      Returns:
      this
    • setMarginTop

      @Nonnull default IMPLTYPE setMarginTop(float fMargin)
      Set the top margin value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
    • setMarginRight

      @Nonnull default IMPLTYPE setMarginRight(float fMargin)
      Set the right margin value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
    • setMarginBottom

      @Nonnull default IMPLTYPE setMarginBottom(float fMargin)
      Set the bottom margin value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
    • setMarginLeft

      @Nonnull default IMPLTYPE setMarginLeft(float fMargin)
      Set the left margin value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
    • setMarginX

      @Nonnull default IMPLTYPE setMarginX(float fMargin)
      Set the left margin left AND right value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
      Since:
      5.2.2
    • setMarginY

      @Nonnull default IMPLTYPE setMarginY(float fMargin)
      Set the left margin top AND bottom value.
      Parameters:
      fMargin - The value to use.
      Returns:
      this
      Since:
      5.2.2
    • addMarginTop

      @Nonnull default IMPLTYPE addMarginTop(float fMargin)
      Add to the top margin value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
    • addMarginRight

      @Nonnull default IMPLTYPE addMarginRight(float fMargin)
      Add to the right margin value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
    • addMarginBottom

      @Nonnull default IMPLTYPE addMarginBottom(float fMargin)
      Add to the bottom margin value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
    • addMarginLeft

      @Nonnull default IMPLTYPE addMarginLeft(float fMargin)
      Add to the left margin value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
    • addMarginX

      @Nonnull default IMPLTYPE addMarginX(float fMargin)
      Add to the left margin left AND right value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
      Since:
      5.2.2
    • addMarginY

      @Nonnull default IMPLTYPE addMarginY(float fMargin)
      Add to the left margin top AND bottom value.
      Parameters:
      fMargin - The value to add.
      Returns:
      this
      Since:
      5.2.2
    • getMargin

      @Nonnull MarginSpec getMargin()
      Returns:
      The current margin. Never null.
    • getMarginTop

      default float getMarginTop()
      Returns:
      The current top margin.
    • getMarginRight

      default float getMarginRight()
      Returns:
      The current right margin.
    • getMarginBottom

      default float getMarginBottom()
      Returns:
      The current bottom margin.
    • getMarginLeft

      default float getMarginLeft()
      Returns:
      The current left margin.
    • getMarginXSum

      default float getMarginXSum()
      Returns:
      The sum of left and right margin.
    • getMarginYSum

      default float getMarginYSum()
      Returns:
      The sum of top and bottom margin.
    • getOutlineTop

      default float getOutlineTop()
      Specified by:
      getOutlineTop in interface IPLHasOutline
      Returns:
      margin top + border top + padding top.
    • getOutlineRight

      default float getOutlineRight()
      Specified by:
      getOutlineRight in interface IPLHasOutline
      Returns:
      margin right + border right + padding right.
    • getOutlineBottom

      default float getOutlineBottom()
      Specified by:
      getOutlineBottom in interface IPLHasOutline
      Returns:
      margin bottom + border bottom + padding bottom.
    • getOutlineLeft

      default float getOutlineLeft()
      Specified by:
      getOutlineLeft in interface IPLHasOutline
      Returns:
      margin left + border left + padding left.
    • getOutlineXSum

      default float getOutlineXSum()
      Description copied from interface: IPLHasOutline
      Sum of left and right outline
      Specified by:
      getOutlineXSum in interface IPLHasOutline
      Returns:
      IPLHasOutline.getOutlineLeft() + IPLHasOutline.getOutlineRight()
    • getOutlineYSum

      default float getOutlineYSum()
      Description copied from interface: IPLHasOutline
      Sum of top and bottom outline
      Specified by:
      getOutlineYSum in interface IPLHasOutline
      Returns:
      IPLHasOutline.getOutlineTop() + IPLHasOutline.getOutlineBottom()