Package de.Keyle.MyPet.api.gui
Record Class PaginatedListSection
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.gui.PaginatedListSection
- Record Components:
id- this section's id within its menutype- the registered type handle this section was decoded ascol- left-hand column of the regionrow- top row of the regionwidth- region width in slotsheight- region height in slotstemplate- appearance applied to each item in turnpreviousPageSectionId- id of the slot section acting as the previous-page button, ornullwhen the list does not paginatenextPageSectionId- id of the slot section acting as the next-page button, ornullwhen the list does not paginatesoundOnPageChange- played when the page changessoundOnTemplateClick- played when an item is clicked
- All Implemented Interfaces:
Section
public record PaginatedListSection(String id, SectionType<PaginatedListSection> type, int col, int row, int width, int height, ItemAppearance template, @Nullable String previousPageSectionId, @Nullable String nextPageSectionId, SoundSpec soundOnPageChange, SoundSpec soundOnTemplateClick)
extends Record
implements Section
Rectangular region populated by a per-item template applied to a stream supplied
by the menu handler.
previousPageSectionId / nextPageSectionId
are optional: when both are null the list does not paginate and any items past
slotCapacity() are dropped (useful for bounded item sets like beacon buffs).-
Constructor Summary
ConstructorsConstructorDescriptionPaginatedListSection(String id, SectionType<PaginatedListSection> type, int col, int row, int width, int height, ItemAppearance template, @Nullable String previousPageSectionId, @Nullable String nextPageSectionId, SoundSpec soundOnPageChange, SoundSpec soundOnTemplateClick) Rejects a non-positive region and substitutes silence for absent sounds. -
Method Summary
Modifier and TypeMethodDescriptionintcol()Returns the value of thecolrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.id()Returns the value of theidrecord component.booleanTrue if both page-button refs are supplied — the list paginates on overflow.@Nullable StringReturns the value of thenextPageSectionIdrecord component.@Nullable StringReturns the value of thepreviousPageSectionIdrecord component.introw()Returns the value of therowrecord component.intReturns how many items fit on one page.Returns the value of thesoundOnPageChangerecord component.Returns the value of thesoundOnTemplateClickrecord component.template()Returns the value of thetemplaterecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
PaginatedListSection
public PaginatedListSection(String id, SectionType<PaginatedListSection> type, int col, int row, int width, int height, ItemAppearance template, @Nullable @Nullable String previousPageSectionId, @Nullable @Nullable String nextPageSectionId, SoundSpec soundOnPageChange, SoundSpec soundOnTemplateClick) Rejects a non-positive region and substitutes silence for absent sounds.
-
-
Method Details
-
slotCapacity
public int slotCapacity()Returns how many items fit on one page.- Returns:
width * height
-
isPaginated
public boolean isPaginated()True if both page-button refs are supplied — the list paginates on overflow.- Returns:
trueif both page-button references are set
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component. -
type
Returns the value of thetyperecord component. -
col
public int col()Returns the value of thecolrecord component.- Returns:
- the value of the
colrecord component
-
row
public int row()Returns the value of therowrecord component.- Returns:
- the value of the
rowrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
template
Returns the value of thetemplaterecord component.- Returns:
- the value of the
templaterecord component
-
previousPageSectionId
Returns the value of thepreviousPageSectionIdrecord component.- Returns:
- the value of the
previousPageSectionIdrecord component
-
nextPageSectionId
Returns the value of thenextPageSectionIdrecord component.- Returns:
- the value of the
nextPageSectionIdrecord component
-
soundOnPageChange
Returns the value of thesoundOnPageChangerecord component.- Returns:
- the value of the
soundOnPageChangerecord component
-
soundOnTemplateClick
Returns the value of thesoundOnTemplateClickrecord component.- Returns:
- the value of the
soundOnTemplateClickrecord component
-