Record Class ElementLayout.Height
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.ElementLayout.Height
- Enclosing class:
ElementLayout
public static record ElementLayout.Height(ElementLayout.Height.Kind kind, int pixels, float percent)
extends Record
How tall an element's box is:
ElementLayout.Height.Kind.FILL the rest of the page, ElementLayout.Height.Kind.FIT only as tall as what it
holds (up to the rest of the page), ElementLayout.Height.Kind.FIXED that many pixels, or ElementLayout.Height.Kind.PERCENT that share of the
page's content.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHeight(ElementLayout.Height.Kind kind, int pixels) Height(ElementLayout.Height.Kind kind, int pixels, float percent) Creates an instance of aHeightrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.floatpercent()Returns the value of thepercentrecord component.intpixels()Returns the value of thepixelsrecord component.intpixels(int full) How many pixels it is on a page whose content isfullpixels tall.booleansized()Whether it is a size of its own (pixels, or a share of the page), not the rest of the page or its content's.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Height
-
Height
Creates an instance of aHeightrecord class.- Parameters:
kind- the value for thekindrecord componentpixels- the value for thepixelsrecord componentpercent- the value for thepercentrecord component
-
-
Method Details
-
sized
public boolean sized()Whether it is a size of its own (pixels, or a share of the page), not the rest of the page or its content's. -
pixels
public int pixels(int full) How many pixels it is on a page whose content isfullpixels tall. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
pixels
public int pixels()Returns the value of thepixelsrecord component.- Returns:
- the value of the
pixelsrecord component
-
percent
public float percent()Returns the value of thepercentrecord component.- Returns:
- the value of the
percentrecord component
-