Class AbstractTextAreaWidget

All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension
Direct Known Subclasses:
FittingMultiLineTextWidget, MultiLineEditBox, TelemetryEventWidget

public abstract class AbstractTextAreaWidget extends AbstractScrollArea
  • Field Details

    • BACKGROUND_SPRITES

      private static final WidgetSprites BACKGROUND_SPRITES
    • INNER_PADDING

      private static final int INNER_PADDING
      See Also:
    • DEFAULT_TOTAL_PADDING

      public static final int DEFAULT_TOTAL_PADDING
      See Also:
    • showBackground

      private boolean showBackground
    • showDecorations

      private boolean showDecorations
  • Constructor Details

    • AbstractTextAreaWidget

      public AbstractTextAreaWidget(int pX, int pY, int pWidth, int pHeight, Component pMessage)
    • AbstractTextAreaWidget

      public AbstractTextAreaWidget(int pX, int pY, int pWidth, int pHeight, Component pMessage, boolean pShowBackground, boolean pShowDecorations)
  • Method Details

    • mouseClicked

      public boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      Description copied from class: AbstractWidget
      Called when a mouse button is clicked within the GUI element.

      Specified by:
      mouseClicked in interface GuiEventListener
      Overrides:
      mouseClicked in class AbstractWidget
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • renderWidget

      public void renderWidget(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Specified by:
      renderWidget in class AbstractWidget
    • renderDecorations

      protected void renderDecorations(GuiGraphics pGuiGraphics)
    • innerPadding

      protected int innerPadding()
    • totalInnerPadding

      protected int totalInnerPadding()
    • isMouseOver

      public boolean isMouseOver(double pMouseX, double pMouseY)
      Description copied from class: AbstractWidget
      Checks if the given mouse coordinates are over the GUI element.

      Specified by:
      isMouseOver in interface GuiEventListener
      Overrides:
      isMouseOver in class AbstractWidget
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      Returns:
      true if the mouse is over the GUI element, false otherwise.
    • scrollBarX

      protected int scrollBarX()
      Overrides:
      scrollBarX in class AbstractScrollArea
    • contentHeight

      protected int contentHeight()
      Specified by:
      contentHeight in class AbstractScrollArea
    • renderBackground

      protected void renderBackground(GuiGraphics pGuiGraphics)
    • renderBorder

      protected void renderBorder(GuiGraphics pGuiGraphics, int pX, int pY, int pWidth, int pHeight)
    • withinContentAreaTopBottom

      protected boolean withinContentAreaTopBottom(int pTop, int pBottom)
    • getInnerHeight

      protected abstract int getInnerHeight()
    • renderContents

      protected abstract void renderContents(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
    • getInnerLeft

      protected int getInnerLeft()
    • getInnerTop

      protected int getInnerTop()
    • playDownSound

      public void playDownSound(SoundManager pHandler)
      Overrides:
      playDownSound in class AbstractWidget