Class Panel

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
org.moddingx.libx.screen.Panel
All Implemented Interfaces:
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.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier, EditorOps
Direct Known Subclasses:
ColorPicker

public abstract class Panel extends net.minecraft.client.gui.components.AbstractWidget implements net.minecraft.client.gui.components.events.ContainerEventHandler, EditorOps
An AbstractWidget that is composed of multiple other widgets. These widgets are positioned relative to this widget. You can add these widgets in the constructor.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    ACCESSIBILITY_TEXTURE, active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Panel(int x, int y, int width, int height)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected <T extends net.minecraft.client.gui.components.Renderable>
    T
    Adds a component that can be rendered.
    protected <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Renderable>
    T
    Adds a widget that can be rendered.
    protected <T extends net.minecraft.client.gui.components.events.GuiEventListener>
    T
    addWidget(T widget)
    Adds a widget to listen to events.
    boolean
    charTyped(char value, int modifiers)
     
    List<? extends net.minecraft.client.gui.components.events.GuiEventListener>
     
    void
    enabled(boolean enabled)
    Marks a widget as enabled or disabled.
    Optional<net.minecraft.client.gui.components.events.GuiEventListener>
    getChildAt(double mouseX, double mouseY)
     
    net.minecraft.client.gui.ComponentPath
     
    net.minecraft.client.gui.components.events.GuiEventListener
     
    boolean
     
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
     
    boolean
    keyReleased(int keyCode, int scanCode, int modifiers)
     
    boolean
    mouseClicked(double mouseX, double mouseY, int button)
     
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
     
    boolean
    mouseReleased(double mouseX, double mouseY, int button)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double delta)
     
    net.minecraft.client.gui.ComponentPath
    nextFocusPath(net.minecraft.client.gui.navigation.FocusNavigationEvent event)
     
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
     
    void
    setDragging(boolean dragging)
     
    void
    setFocused(boolean focused)
     
    void
    setFocused(net.minecraft.client.gui.components.events.GuiEventListener focused)
     
    void
    updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput output)
     

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, clicked, createNarrationMessage, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderTexture, setAlpha, setFGColor, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    isFocused, magicalSpecialHackyFocus

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    getRectangle, isMouseOver, mouseMoved

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Constructor Details

    • Panel

      public Panel(int x, int y, int width, int height)
  • Method Details

    • addRenderableWidget

      protected <T extends net.minecraft.client.gui.components.events.GuiEventListener & net.minecraft.client.gui.components.Renderable> T addRenderableWidget(T widget)
      Adds a widget that can be rendered.
    • addRenderableOnly

      protected <T extends net.minecraft.client.gui.components.Renderable> T addRenderableOnly(T widget)
      Adds a component that can be rendered.
    • addWidget

      protected <T extends net.minecraft.client.gui.components.events.GuiEventListener> T addWidget(T widget)
      Adds a widget to listen to events.
    • children

      @Nonnull public List<? extends net.minecraft.client.gui.components.events.GuiEventListener> children()
      Specified by:
      children in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • renderWidget

      public void renderWidget(@Nonnull net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Specified by:
      renderWidget in class net.minecraft.client.gui.components.AbstractWidget
    • getChildAt

      @Nonnull public Optional<net.minecraft.client.gui.components.events.GuiEventListener> getChildAt(double mouseX, double mouseY)
      Specified by:
      getChildAt in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • 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 net.minecraft.client.gui.components.AbstractWidget
    • 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 net.minecraft.client.gui.components.AbstractWidget
    • 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 net.minecraft.client.gui.components.AbstractWidget
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double delta)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
    • 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
    • keyReleased

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

      public boolean charTyped(char value, 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
    • updateWidgetNarration

      public void updateWidgetNarration(@Nonnull net.minecraft.client.gui.narration.NarrationElementOutput output)
      Specified by:
      updateWidgetNarration in class net.minecraft.client.gui.components.AbstractWidget
    • setFocused

      public void setFocused(boolean focused)
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      setFocused in class net.minecraft.client.gui.components.AbstractWidget
    • getFocused

      @Nullable public net.minecraft.client.gui.components.events.GuiEventListener getFocused()
      Specified by:
      getFocused in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • setFocused

      public void setFocused(@Nullable net.minecraft.client.gui.components.events.GuiEventListener focused)
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • getCurrentFocusPath

      @Nullable public net.minecraft.client.gui.ComponentPath getCurrentFocusPath()
      Specified by:
      getCurrentFocusPath in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      getCurrentFocusPath in interface net.minecraft.client.gui.components.events.GuiEventListener
    • nextFocusPath

      @Nullable public net.minecraft.client.gui.ComponentPath nextFocusPath(@Nonnull net.minecraft.client.gui.navigation.FocusNavigationEvent event)
      Specified by:
      nextFocusPath in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      nextFocusPath in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      nextFocusPath in class net.minecraft.client.gui.components.AbstractWidget
    • isDragging

      public boolean isDragging()
      Specified by:
      isDragging in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • setDragging

      public void setDragging(boolean dragging)
      Specified by:
      setDragging in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • enabled

      public void enabled(boolean enabled)
      Description copied from interface: EditorOps
      Marks a widget as enabled or disabled.
      Specified by:
      enabled in interface EditorOps