Record Class ElementLayout
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.ElementLayout
- Record Components:
minHeight- the least room worth setting a box in, below which the element starts on the next page
public record ElementLayout(@Nullable ElementLayout.Overflow overflow, @Nullable ElementLayout.Height height, @Nullable ElementLayout.Height minHeight, @Nullable FoliosAlign alignment, @Nullable FoliosAlign titleAlignment, @Nullable ElementLayout.Anchor anchor)
extends Record
How an element is set on its page, beside what it shows: what happens when it doesn't fit (
"overflow"),
where its parts sit across the page ("alignment", "title_alignment") and down a box taller than they
are ("anchor"). Written on an element, on a page (for its elements) or in book.json (for the whole book): the
nearest that says wins, and what none says keeps how pages have always been set. Each field is null where the JSON
doesn't say.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhere an element's parts sit down a box taller than they are.static final recordHow tall an element's box is:ElementLayout.Height.Kind.FILLthe rest of the page,ElementLayout.Height.Kind.FITonly as tall as what it holds (up to the rest of the page),ElementLayout.Height.Kind.FIXEDthat many pixels, orElementLayout.Height.Kind.PERCENTthat share of the page's content.static enumWhat an element does when it doesn't fit in what is left of its page. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe least room a box is set in when nothing says: about three lines of text.static final ElementLayout -
Constructor Summary
ConstructorsConstructorDescriptionElementLayout(@Nullable ElementLayout.Overflow overflow, @Nullable ElementLayout.Height height, @Nullable ElementLayout.Height minHeight, @Nullable FoliosAlign alignment, @Nullable FoliosAlign titleAlignment, @Nullable ElementLayout.Anchor anchor) Creates an instance of aElementLayoutrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable FoliosAlignReturns the value of thealignmentrecord component.@Nullable ElementLayout.Anchoranchor()Returns the value of theanchorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable ElementLayout.Heightheight()Returns the value of theheightrecord component.intleastHeight(int full) The least room worth setting a box in, on a page whose content isfullpixels tall.@Nullable ElementLayout.HeightReturns the value of theminHeightrecord component.or(ElementLayout outer) This, with what it leaves unsaid taken fromouter(the page's for an element, the book's for a page).@Nullable ElementLayout.Overflowoverflow()Returns the value of theoverflowrecord component.The overflow to use:ElementLayout.Overflow.FLOWwhen none is said.static ElementLayoutWhat an object of JSON (an element, a page or a book) says, warning of what it says that can't be read.@Nullable FoliosAlignHow the title is aligned: its own, else the body's (justified text keeps a left title).@Nullable FoliosAlignReturns the value of thetitleAlignmentrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
MIN_HEIGHT
public static final int MIN_HEIGHTThe least room a box is set in when nothing says: about three lines of text.- See Also:
-
-
Constructor Details
-
ElementLayout
public ElementLayout(@Nullable ElementLayout.Overflow overflow, @Nullable ElementLayout.Height height, @Nullable ElementLayout.Height minHeight, @Nullable FoliosAlign alignment, @Nullable FoliosAlign titleAlignment, @Nullable ElementLayout.Anchor anchor) Creates an instance of aElementLayoutrecord class.- Parameters:
overflow- the value for theoverflowrecord componentheight- the value for theheightrecord componentminHeight- the value for theminHeightrecord componentalignment- the value for thealignmentrecord componenttitleAlignment- the value for thetitleAlignmentrecord componentanchor- the value for theanchorrecord component
-
-
Method Details
-
read
What an object of JSON (an element, a page or a book) says, warning of what it says that can't be read. -
or
This, with what it leaves unsaid taken fromouter(the page's for an element, the book's for a page). -
leastHeight
public int leastHeight(int full) The least room worth setting a box in, on a page whose content isfullpixels tall. -
overflowOrFlow
The overflow to use:ElementLayout.Overflow.FLOWwhen none is said. -
titleAlign
How the title is aligned: its own, else the body's (justified text keeps a left title). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
overflow
Returns the value of theoverflowrecord component.- Returns:
- the value of the
overflowrecord component
-
height
Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
minHeight
-
alignment
Returns the value of thealignmentrecord component.- Returns:
- the value of the
alignmentrecord component
-
titleAlignment
Returns the value of thetitleAlignmentrecord component.- Returns:
- the value of the
titleAlignmentrecord component
-
anchor
Returns the value of theanchorrecord component.- Returns:
- the value of the
anchorrecord component
-