Package com.helger.pdflayout.spec
Class MarginSpec
- java.lang.Object
-
- com.helger.pdflayout.spec.AbstractRectSpec
-
- com.helger.pdflayout.spec.MarginSpec
-
- All Implemented Interfaces:
Serializable
@Immutable @MustImplementEqualsAndHashcode public class MarginSpec extends AbstractRectSpec
Defines a rectangular margin.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_FLOATstatic MarginSpecMARGIN0A constant representing no margin.-
Fields inherited from class com.helger.pdflayout.spec.AbstractRectSpec
m_fBottom, m_fLeft, m_fRight, m_fTop
-
-
Constructor Summary
Constructors Constructor Description MarginSpec(float f)Constructor with the same value for all axis.MarginSpec(float fY, float fX)Constructor with the same value for X and Y axis.MarginSpec(float fTop, float fRight, float fBottom, float fLeft)Constructor with explicit valuesMarginSpec(AbstractRectSpec aOther)Pseudo copy constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MarginSpecbottom(float fBottom)static MarginSpeccreateMM(float f)static MarginSpeccreateMM(float fY, float fX)static MarginSpeccreateMM(float fTop, float fRight, float fBottom, float fLeft)MarginSpecgetCloneWithBottom(float fBottom)MarginSpecgetCloneWithLeft(float fLeft)MarginSpecgetCloneWithRight(float fRight)MarginSpecgetCloneWithTop(float fTop)static MarginSpecleft(float fLeft)static MarginSpecright(float fRight)static MarginSpectop(float fTop)
-
-
-
Field Detail
-
DEFAULT_FLOAT
public static final float DEFAULT_FLOAT
- See Also:
- Constant Field Values
-
MARGIN0
public static final MarginSpec MARGIN0
A constant representing no margin.
-
-
Constructor Detail
-
MarginSpec
public MarginSpec(@Nonnull AbstractRectSpec aOther)
Pseudo copy constructor.- Parameters:
aOther- Value to copy from. May not benull.
-
MarginSpec
public MarginSpec(float f)
Constructor with the same value for all axis.- Parameters:
f- value for top, right, bottom, left
-
MarginSpec
public MarginSpec(float fY, float fX)Constructor with the same value for X and Y axis.- Parameters:
fY- top and bottom valuefX- left and right value
-
MarginSpec
public MarginSpec(float fTop, float fRight, float fBottom, float fLeft)Constructor with explicit values- Parameters:
fTop- top valuefRight- right valuefBottom- bottom valuefLeft- left value
-
-
Method Detail
-
getCloneWithTop
@Nonnull public MarginSpec getCloneWithTop(float fTop)
-
getCloneWithRight
@Nonnull public MarginSpec getCloneWithRight(float fRight)
-
getCloneWithBottom
@Nonnull public MarginSpec getCloneWithBottom(float fBottom)
-
getCloneWithLeft
@Nonnull public MarginSpec getCloneWithLeft(float fLeft)
-
createMM
@Nonnull public static MarginSpec createMM(float f)
-
createMM
@Nonnull public static MarginSpec createMM(float fY, float fX)
-
createMM
@Nonnull public static MarginSpec createMM(float fTop, float fRight, float fBottom, float fLeft)
-
top
@Nonnull public static MarginSpec top(float fTop)
-
right
@Nonnull public static MarginSpec right(float fRight)
-
bottom
@Nonnull public static MarginSpec bottom(float fBottom)
-
left
@Nonnull public static MarginSpec left(float fLeft)
-
-