Package limn.backend
Record Class SizeLimits
java.lang.Object
java.lang.Record
limn.backend.SizeLimits
- Record Components:
minWidth- the narrowest the user may make the window, or0minHeight- the shortest, or0maxWidth- the widest, or0maxHeight- the tallest, or0
The bounds a window's size is kept within while the user resizes it, in logical points. A bound
of
0 is open: NONE lets the window be any size, and new SizeLimits(480,
360, 0, 0) only stops it shrinking below 480×360.
A negative bound is taken as open, as NativeWindow.setSizeLimits(int, int, int, int) has always taken it.
A maximum below its minimum is refused: the desktop would have to break one of the two.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight) Creates an instance of aSizeLimitsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatclampHeight(float height) floatclampWidth(float width) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxHeightrecord component.intmaxWidth()Returns the value of themaxWidthrecord component.intReturns the value of theminHeightrecord component.intminWidth()Returns the value of theminWidthrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No bound on either axis.
-
-
Constructor Details
-
SizeLimits
public SizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeight) Creates an instance of aSizeLimitsrecord class.
-
-
Method Details
-
clampWidth
public float clampWidth(float width) - Parameters:
width- a width in logical points- Returns:
- it, brought within the width bounds
-
clampHeight
public float clampHeight(float height) - Parameters:
height- a height in logical points- Returns:
- it, brought within the height bounds
-
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 '=='. -
minWidth
public int minWidth()Returns the value of theminWidthrecord component.- Returns:
- the value of the
minWidthrecord component
-
minHeight
public int minHeight()Returns the value of theminHeightrecord component.- Returns:
- the value of the
minHeightrecord component
-
maxWidth
public int maxWidth()Returns the value of themaxWidthrecord component.- Returns:
- the value of the
maxWidthrecord component
-
maxHeight
public int maxHeight()Returns the value of themaxHeightrecord component.- Returns:
- the value of the
maxHeightrecord component
-