Class PageSpec
java.lang.Object
com.codename1.wordprocessing.PageSpec
Immutable page geometry in points: paper size and the four margins.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PageSpecISO A4 with 0.75 inch margins.final floatThe bottom margin.final floatThe space between columns, in points.final intThe number of text columns, 1 to 12.final floatThe paper height.final floatThe left margin.static final PageSpecUS Letter with one inch margins.final floatThe right margin.final floatThe top margin.final floatThe paper width. -
Constructor Summary
ConstructorsConstructorDescriptionPageSpec(float width, float height, float top, float right, float bottom, float left) Creates a page. -
Method Summary
Modifier and TypeMethodDescriptionfloatThe width of one column.floatThe height between the margins.floatThe width between the margins.booleanTwo pages are equal when their size and margins are.inthashCode()A hash consistent withequals.rotated()A copy turned to the other orientation, margins rotating with the paper.withColumns(int count, float gap) A copy with the text set in columns.
-
Field Details
-
A4
ISO A4 with 0.75 inch margins. -
LETTER
US Letter with one inch margins. -
width
public final float widthThe paper width. -
height
public final float heightThe paper height. -
top
public final float topThe top margin. -
right
public final float rightThe right margin. -
bottom
public final float bottomThe bottom margin. -
left
public final float leftThe left margin. -
columns
public final int columnsThe number of text columns, 1 to 12. -
columnGap
public final float columnGapThe space between columns, in points.
-
-
Constructor Details
-
PageSpec
public PageSpec(float width, float height, float top, float right, float bottom, float left) Creates a page.
Parameters
-
width: the paper width, at least one inch -
height: the paper height, at least one inch -
top: the top margin -
right: the right margin -
bottom: the bottom margin -
left: the left margin
-
-
-
Method Details
-
withColumns
A copy with the text set in columns.
Parameters
-
count: 1 to 12; fewer are used when the columns would be narrower than 36 points -
gap: the space between columns, 0 to 144 points
Returns
the copy
-
-
rotated
A copy turned to the other orientation, margins rotating with the paper.
Returns
the copy
-
columnWidth
public float columnWidth()The width of one column.
Returns
the width in points
-
contentWidth
public float contentWidth()The width between the margins.
Returns
the text width
-
contentHeight
public float contentHeight()The height between the margins.
Returns
the text height
-
equals
-
hashCode
-