Package com.pdftools.geometry.units
Class Margin
java.lang.Object
com.pdftools.geometry.units.Margin
The margin defines the space around elements.
The class is based on the respective distances left, bottom, right, and top of type Length.
-
Constructor Summary
ConstructorsConstructorDescriptionMargin(double left, double bottom, double right, double top, Length.Units unit) ConstructMarginobject from values and a common unit.Margin(double margin, Length.Units unit) Construct aMarginobject of equal marginsConstruct aMarginobject of equal marginsConstructMarginobject from individual values -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the bottom margin asLengthobject.getLeft()Gets the left margin asLengthobject.getRight()Gets the right margin asLengthobject.getTop()Gets the top margin asLengthobject.inthashCode()static MarginCreate aMarginobject from a string representation.toString()Creates a string representation as left-bottom-right-top-tuple with associated suitable metric units, "m", "cm" or "mm".toString(Length.Units unit) Creates a string representation as left-bottom-right-top-tuple with the specified unit.
-
Constructor Details
-
Margin
ConstructMarginobject from individual values -
Margin
ConstructMarginobject from values and a common unit.- Parameters:
left- as numerical valuebottom- as numerical valueright- as numerical valuetop- as numerical valueunit- the unit
-
Margin
Construct aMarginobject of equal margins- Parameters:
margin- asLengthtype
-
Margin
Construct aMarginobject of equal margins- Parameters:
margin- as numerical valueunit- the unit
-
-
Method Details
-
parse
Create aMarginobject from a string representation.- Parameters:
value- Allowed are value-unit pairs of the form "<left_value><left_unit> <bottom_value><bottom_unit> <right_value><right_unit> <top_value><top_unit>". Example: "12.3cm 23.4mm 34.5mm 45.6mm"- Returns:
-
toString
Creates a string representation as left-bottom-right-top-tuple with associated suitable metric units, "m", "cm" or "mm". -
toString
Creates a string representation as left-bottom-right-top-tuple with the specified unit. -
getLeft
Gets the left margin asLengthobject. -
getBottom
Gets the bottom margin asLengthobject. -
getRight
Gets the right margin asLengthobject. -
getTop
Gets the top margin asLengthobject. -
equals
-
hashCode
public int hashCode()
-