Package limn.scene
Record Class Insets
java.lang.Object
java.lang.Record
limn.scene.Insets
Edge insets in logical points (padding/margins), by the reading direction:
start is
the side a line of text starts from and end the side it ends at, the left and the
right in a layout that reads left to right and the right and the left in one that reads right
to left. Every layout and component that takes insets mirrors them that way, so a padding of
40 at the start is on the right of an Arabic form without a second set of insets.
Each side is a finite distance of zero or more. A side that is negative, NaN or
infinite is refused where the insets are made, by the side's name, because nothing downstream
would refuse it: layout subtracts the insets from its constraints and floors the result at
zero, and a NaN survives that floor, so a padding around a NaN side measured
NaN by NaN with no error anywhere, and an infinite side left the child no room
at all while the padding took all of its parent's.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsets(float top, float end, float bottom, float start) Insets of these four sides, in logical points. -
Method Summary
Modifier and TypeMethodDescriptionstatic Insetsall(float value) The same inset on all four sides.floatbottom()Returns the value of thebottomrecord component.floatend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatstart()Returns the value of thestartrecord component.static Insetssymmetric(float vertical, float horizontal) One inset for top and bottom, another for start and end.floattop()Returns the value of thetoprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
-
Constructor Details
-
Insets
public Insets(float top, float end, float bottom, float start) Insets of these four sides, in logical points.- Throws:
IllegalArgumentException- when a side is negative,NaNor infinite, naming the side and its value
-
-
Method Details
-
all
The same inset on all four sides. -
symmetric
One inset for top and bottom, another for start and end. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
top
public float top()Returns the value of thetoprecord component.- Returns:
- the value of the
toprecord component
-
end
public float end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
bottom
public float bottom()Returns the value of thebottomrecord component.- Returns:
- the value of the
bottomrecord component
-
start
public float start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-