Package com.helger.pdflayout.spec
Class BorderSpec
java.lang.Object
com.helger.pdflayout.spec.BorderSpec
- All Implemented Interfaces:
Serializable
@Immutable
@MustImplementEqualsAndHashcode
public class BorderSpec
extends Object
implements Serializable
This class represents a border around a single element. Each side can be
styled separately.
- Author:
- Philip Helger
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBorderSpec(BorderStyleSpec aBorder) Constructor.BorderSpec(BorderStyleSpec aBorderY, BorderStyleSpec aBorderX) Constructor.BorderSpec(BorderStyleSpec aBorderTop, BorderStyleSpec aBorderRight, BorderStyleSpec aBorderBottom, BorderStyleSpec aBorderLeft) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic BorderSpecbottom(BorderStyleSpec aBottom) booleanfinal BorderStyleSpecfinal floatgetCloneWithBottom(BorderStyleSpec aBottom) getCloneWithLeft(BorderStyleSpec aLeft) getCloneWithRight(BorderStyleSpec aRight) final BorderStyleSpecgetLeft()final floatfinal BorderStyleSpecgetRight()final floatfinal BorderStyleSpecgetTop()final floatfinal floatfinal floatfinal booleanfinal booleaninthashCode()static BorderSpecleft(BorderStyleSpec aLeft) static BorderSpecright(BorderStyleSpec aRight) static BorderSpectop(BorderStyleSpec aTop) toString()
-
Field Details
-
BORDER0
Represents no border at all.
-
-
Constructor Details
-
BorderSpec
Constructor.- Parameters:
aBorder- The border to set for all sides (left, top, right, bottom). Maybenull.
-
BorderSpec
Constructor.- Parameters:
aBorderY- The border to set for top and bottom. Maybenull.aBorderX- The border to set for left and right. Maybenull.
-
BorderSpec
public BorderSpec(@Nullable BorderStyleSpec aBorderTop, @Nullable BorderStyleSpec aBorderRight, @Nullable BorderStyleSpec aBorderBottom, @Nullable BorderStyleSpec aBorderLeft) Constructor.- Parameters:
aBorderTop- The border to set for top. Maybenull.aBorderRight- The border to set for right. Maybenull.aBorderBottom- The border to set for bottom. Maybenull.aBorderLeft- The border to set for left. Maybenull.
-
-
Method Details
-
hasAllBorders
public final boolean hasAllBorders()- Returns:
trueif all borders are defined,falseotherwise.
-
hasAnyBorder
public final boolean hasAnyBorder()- Returns:
trueif at least one border is defined,falseif no border is defined at all.
-
areAllBordersEqual
public boolean areAllBordersEqual()- Returns:
trueif all border sides are equal. This istruefornullborders as well as for defined borders.
-
getTop
- Returns:
- The top border style. May be
null.
-
getRight
- Returns:
- The right border style. May be
null.
-
getBottom
- Returns:
- The bottom border style. May be
null.
-
getLeft
- Returns:
- The left border style. May be
null.
-
getTopWidth
public final float getTopWidth()- Returns:
- The top border width.
-
getRightWidth
public final float getRightWidth()- Returns:
- The right border width.
-
getBottomWidth
public final float getBottomWidth()- Returns:
- The bottom border width.
-
getLeftWidth
public final float getLeftWidth()- Returns:
- The left border width.
-
getXSumWidth
public final float getXSumWidth()- Returns:
- The sum of left and right border width.
-
getYSumWidth
public final float getYSumWidth()- Returns:
- The sum of left and right border width.
-
getCloneWithTop
-
getCloneWithRight
-
getCloneWithBottom
-
getCloneWithLeft
-
equals
-
hashCode
public int hashCode() -
toString
-
top
-
right
-
bottom
-
left
-