Interface IPLHasHorizontalAlignment<IMPLTYPE extends IPLHasHorizontalAlignment<IMPLTYPE>>

Type Parameters:
IMPLTYPE - Implementation type
All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>, com.helger.commons.id.IHasID<String>, IPLHasOutline, IPLObject<IMPLTYPE>, IPLRenderableObject<IMPLTYPE>, IPLVisitable
All Known Subinterfaces:
IPLBlockElement<IMPLTYPE>
All Known Implementing Classes:
AbstractPLBlockElement, AbstractPLBox, AbstractPLText, PLBox, PLTableCell, PLText

public interface IPLHasHorizontalAlignment<IMPLTYPE extends IPLHasHorizontalAlignment<IMPLTYPE>> extends IPLRenderableObject<IMPLTYPE>
Base interface for objects with a horizontal alignment
Author:
Philip Helger
  • Field Details

    • DEFAULT_HORZ_ALIGNMENT

      static final EHorzAlignment DEFAULT_HORZ_ALIGNMENT
  • Method Details

    • getHorzAlign

      @Nonnull EHorzAlignment getHorzAlign()
      Returns:
      The horizontal alignment of this element. By default it is EHorzAlignment.DEFAULT. Never null. The horizontal alignment may only be applied to contained children!
    • setHorzAlign

      @Nonnull IMPLTYPE setHorzAlign(@Nonnull EHorzAlignment eHorzAlign)
      Set the horizontal alignment of this element. The horizontal alignment may only be applied to contained children!
      Parameters:
      eHorzAlign - The new horizontal alignment. May not be null.
      Returns:
      this
    • getIndentX

      @Nonnegative default float getIndentX(float fAvailableWidth, float fElementWidth)
      Get the indentation for a certain horizontal alignment. This method uses the provided element width as the basis for alignment.
      Parameters:
      fAvailableWidth - The available width of the surrounding element. This is usually larger than fElementWidth.
      fElementWidth - The width of the element to align.
      Returns:
      The indentation offset. Always ≥ 0.