Class ScrollPanel

All Implemented Interfaces:
IGuiEventListener, INestedGuiEventHandler, IRenderable
Direct Known Subclasses:
ModListScreen.InfoPanel

public abstract class ScrollPanel extends FocusableGui implements IRenderable
  • Field Details

    • client

      private final Minecraft client
    • width

      protected final int width
    • height

      protected final int height
    • top

      protected final int top
    • bottom

      protected final int bottom
    • left

      protected final int left
    • scrolling

      private boolean scrolling
    • scrollDistance

      protected float scrollDistance
    • captureMouse

      protected boolean captureMouse
    • border

      protected final int border
      See Also:
    • barWidth

      private final int barWidth
      See Also:
    • barLeft

      private final int barLeft
  • Constructor Details

    • ScrollPanel

      public ScrollPanel(Minecraft client, int width, int height, int top, int left)
  • Method Details

    • getContentHeight

      protected abstract int getContentHeight()
    • drawBackground

      protected void drawBackground()
    • drawPanel

      protected abstract void drawPanel(MatrixStack mStack, int entryRight, int relativeY, Tessellator tess, int mouseX, int mouseY)
      Draw anything special on the screen. GL_SCISSOR is enabled for anything that is rendered outside of the view box. Do not mess with SCISSOR unless you support this.
      Parameters:
      mouseY -
      mouseX -
    • clickPanel

      protected boolean clickPanel(double mouseX, double mouseY, int button)
    • getMaxScroll

      private int getMaxScroll()
    • applyScrollLimits

      private void applyScrollLimits()
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scroll)
      Specified by:
      mouseScrolled in interface IGuiEventListener
      Specified by:
      mouseScrolled in interface INestedGuiEventHandler
    • getScrollAmount

      protected int getScrollAmount()
    • isMouseOver

      public boolean isMouseOver(double mouseX, double mouseY)
      Specified by:
      isMouseOver in interface IGuiEventListener
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Specified by:
      mouseClicked in interface IGuiEventListener
      Specified by:
      mouseClicked in interface INestedGuiEventHandler
    • mouseReleased

      public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_)
      Specified by:
      mouseReleased in interface IGuiEventListener
      Specified by:
      mouseReleased in interface INestedGuiEventHandler
    • getBarHeight

      private int getBarHeight()
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
      Specified by:
      mouseDragged in interface IGuiEventListener
      Specified by:
      mouseDragged in interface INestedGuiEventHandler
    • render

      public void render(MatrixStack matrix, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface IRenderable
    • drawGradientRect

      protected void drawGradientRect(MatrixStack mStack, int left, int top, int right, int bottom, int color1, int color2)
    • children

      public List<? extends IGuiEventListener> children()
      Specified by:
      children in interface INestedGuiEventHandler