Class AbstractMultiPanelWidget

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.ixdarklord.coolcatcanvas.api.client.gui.components.widgets.AbstractDraggableWidget
net.ixdarklord.coolcatcanvas.api.client.gui.components.widgets.AbstractMultiPanelWidget
All Implemented Interfaces:
MovableElement, net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier

@Experimental public abstract class AbstractMultiPanelWidget extends AbstractDraggableWidget
A (optionally draggable) window whose content area shows a stack of Panels.
  • Panels are drawn bottom to top in the order they were added; hidden panels are skipped.
  • Input goes to the window's own widgets (title bar buttons...) first, then to the panels from the top down. A visible modal panel stops input from reaching the panels below it, and those panels are dimmed with the overlay color.
  • The panel that accepted a mouse press receives the following drag and release events.
  • Only the topmost visible panel receives keyboard input.
Panels are laid out in getPanelRectangle(Panel) (the layout rectangle by default) whenever the window moves or is resized with setBounds(int, int, int, int).
  • Constructor Details

    • AbstractMultiPanelWidget

      public AbstractMultiPanelWidget(net.minecraft.network.chat.Component title, int x, int y, int width, int height, boolean isMovable)
  • Method Details

    • addPanel

      protected <P extends Panel> P addPanel(P panel)
    • removePanel

      protected void removePanel(Panel panel)
    • getPanels

      public List<Panel> getPanels()
    • getTopPanel

      @Nullable public @Nullable Panel getTopPanel()
      The topmost visible panel, if any.
    • getPanelRectangle

      protected net.minecraft.client.gui.navigation.ScreenRectangle getPanelRectangle(Panel panel)
      Where a panel is placed; the layout rectangle unless overridden.
    • setOverlayColor

      public void setOverlayColor(int argb)
      Color drawn over the panels below a visible modal panel.
    • setBounds

      public void setBounds(int x, int y, int width, int height)
      Moves and resizes the window.
    • updateChildren

      protected void updateChildren()
      Overrides:
      updateChildren in class AbstractDraggableWidget
    • isMouseOverOwnWidget

      protected boolean isMouseOverOwnWidget(double mouseX, double mouseY)
      Whether the cursor is over one of the window's own widgets, which sit on top of the panels.
    • renderContents

      protected void renderContents(net.minecraft.client.gui.GuiGraphics graphics, float partialTick, int mouseX, int mouseY)
      Overrides:
      renderContents in class AbstractDraggableWidget
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class AbstractDraggableWidget
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int button)
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseReleased in class AbstractDraggableWidget
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseDragged in class AbstractDraggableWidget
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseScrolled in class AbstractDraggableWidget
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class AbstractDraggableWidget
    • keyReleased

      public boolean keyReleased(int keyCode, int scanCode, int modifiers)
    • charTyped

      public boolean charTyped(char codePoint, int modifiers)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      charTyped in class AbstractDraggableWidget
    • isCaptured

      protected boolean isCaptured(Panel panel)
      Whether the given panel is currently receiving a mouse drag.
    • getDebugInfo

      protected List<net.minecraft.network.chat.Component> getDebugInfo()
      Overrides:
      getDebugInfo in class AbstractDraggableWidget