Package com.helger.pdflayout.base
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 Summary
Fields Modifier and Type Field Description static EHorzAlignmentDEFAULT_HORZ_ALIGNMENT
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EHorzAlignmentgetHorzAlign()default floatgetIndentX(float fAvailableWidth, float fElementWidth)Get the indentation for a certain horizontal alignment.IMPLTYPEsetHorzAlign(EHorzAlignment eHorzAlign)Set the horizontal alignment of this element.-
Methods inherited from interface com.helger.pdflayout.base.IPLHasOutline
getOutlineBottom, getOutlineLeft, getOutlineRight, getOutlineTop, getOutlineXSum, getOutlineYSum
-
Methods inherited from interface com.helger.pdflayout.base.IPLObject
getAsSplittable, getDebugID, hasID, isVertSplittable, setBasicDataFrom
-
Methods inherited from interface com.helger.pdflayout.base.IPLRenderableObject
beforeRender, getPreparedHeight, getPreparedSize, getPreparedWidth, getRenderHeight, getRenderSize, getRenderWidth, isPrepared, prepare, render
-
Methods inherited from interface com.helger.pdflayout.base.IPLVisitable
visit
-
-
-
-
Field Detail
-
DEFAULT_HORZ_ALIGNMENT
static final EHorzAlignment DEFAULT_HORZ_ALIGNMENT
-
-
Method Detail
-
getHorzAlign
@Nonnull EHorzAlignment getHorzAlign()
- Returns:
- The horizontal alignment of this element. By default it is
EHorzAlignment.DEFAULT. Nevernull. 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 benull.- 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.
-
-