Record Class EditorContextImpl

java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.client.impl.editor.EditorContextImpl
All Implemented Interfaces:
EditorContext

public record EditorContextImpl(PDLButton createButton, ResearchScreen parentScreen, @Nullable PopupWidget parentPopupWidget, int widgetWidth, int widgetHeight, int innerWidth, int innerHeight, int padding) extends Record implements EditorContext
  • Constructor Details

    • EditorContextImpl

      public EditorContextImpl(PDLButton createButton, ResearchScreen parentScreen, @Nullable @Nullable PopupWidget parentPopupWidget, int widgetWidth, int widgetHeight, int innerWidth, int innerHeight, int padding)
      Creates an instance of a EditorContextImpl record class.
      Parameters:
      createButton - the value for the createButton record component
      parentScreen - the value for the parentScreen record component
      parentPopupWidget - the value for the parentPopupWidget record component
      widgetWidth - the value for the widgetWidth record component
      widgetHeight - the value for the widgetHeight record component
      innerWidth - the value for the innerWidth record component
      innerHeight - the value for the innerHeight record component
      padding - the value for the padding record component
  • Method Details

    • isCreateButtonActive

      public boolean isCreateButtonActive()
      Specified by:
      isCreateButtonActive in interface EditorContext
    • setCreateButtonActive

      public void setCreateButtonActive(boolean active)
      Specified by:
      setCreateButtonActive in interface EditorContext
    • setCreateButtonTooltip

      public void setCreateButtonTooltip(net.minecraft.client.gui.components.Tooltip tooltip)
      Specified by:
      setCreateButtonTooltip in interface EditorContext
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • createButton

      public PDLButton createButton()
      Returns the value of the createButton record component.
      Returns:
      the value of the createButton record component
    • parentScreen

      public ResearchScreen parentScreen()
      Returns the value of the parentScreen record component.
      Specified by:
      parentScreen in interface EditorContext
      Returns:
      the value of the parentScreen record component
    • parentPopupWidget

      @Nullable public @Nullable PopupWidget parentPopupWidget()
      Returns the value of the parentPopupWidget record component.
      Specified by:
      parentPopupWidget in interface EditorContext
      Returns:
      the value of the parentPopupWidget record component
    • widgetWidth

      public int widgetWidth()
      Returns the value of the widgetWidth record component.
      Specified by:
      widgetWidth in interface EditorContext
      Returns:
      the value of the widgetWidth record component
    • widgetHeight

      public int widgetHeight()
      Returns the value of the widgetHeight record component.
      Specified by:
      widgetHeight in interface EditorContext
      Returns:
      the value of the widgetHeight record component
    • innerWidth

      public int innerWidth()
      Returns the value of the innerWidth record component.
      Specified by:
      innerWidth in interface EditorContext
      Returns:
      the value of the innerWidth record component
    • innerHeight

      public int innerHeight()
      Returns the value of the innerHeight record component.
      Specified by:
      innerHeight in interface EditorContext
      Returns:
      the value of the innerHeight record component
    • padding

      public int padding()
      Returns the value of the padding record component.
      Specified by:
      padding in interface EditorContext
      Returns:
      the value of the padding record component