Class GUIComponent

java.lang.Object
net.mcreator.element.parts.gui.GUIComponent
All Implemented Interfaces:
Comparable<GUIComponent>
Direct Known Subclasses:
Checkbox, EntityModel, GUIComponent.Unknown, Image, ImageButton, Label, SizedComponent, Slot

public abstract class GUIComponent extends Object implements Comparable<GUIComponent>
  • Field Details

  • Method Details

    • getName

      public abstract String getName()
      Returns the name of the component. Name should be Java and registry name compatible.

      The name should be unique for the components that need it.

      Returns:
      Component name
    • paintComponent

      public abstract void paintComponent(int cx, int cy, WYSIWYGEditor wysiwygEditor, Graphics2D g)
    • getWidth

      public abstract int getWidth(Workspace workspace)
    • getHeight

      public abstract int getHeight(Workspace workspace)
    • getWeight

      public abstract int getWeight()
      Returns the priority for when this component should be drawn in the UI, to represent how Minecraft draws components in the game.
      Returns:
      The priority of the component (lower means it will be rendered closer to the screen and higher means it will "sink" more behind other components)
    • isSizeKnown

      public boolean isSizeKnown()
    • getX

      public final int getX()
    • getY

      public final int getY()
    • gx

      public final int gx(int width)
    • gy

      public final int gy(int height)
    • getAnchorPoint

      @Nullable public GUIComponent.AnchorPoint getAnchorPoint()
    • compareTo

      public final int compareTo(@Nonnull GUIComponent o)
      Specified by:
      compareTo in interface Comparable<GUIComponent>
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object