Class Button

All Implemented Interfaces:
Comparable<GUIComponent>

public class Button extends SizedComponent
  • Field Details

    • name

      public String name
    • text

      public final String text
    • isUndecorated

      public final boolean isUndecorated
    • onClick

      public final Procedure onClick
    • displayCondition

      public final Procedure displayCondition
  • Constructor Details

    • Button

      public Button(String name, int x, int y, String text, int width, int height, boolean isUndecorated, Procedure onClick, Procedure displayCondition)
  • Method Details

    • getWeight

      public int getWeight()
      Description copied from class: GUIComponent
      Returns the priority for when this component should be drawn in the UI, to represent how Minecraft draws components in the game.
      Specified by:
      getWeight in class GUIComponent
      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)
    • getName

      public String getName()
      Description copied from class: GUIComponent
      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.

      Specified by:
      getName in class GUIComponent
      Returns:
      Component name
    • paintComponent

      public void paintComponent(int cx, int cy, WYSIWYGEditor wysiwygEditor, Graphics2D g)
      Specified by:
      paintComponent in class GUIComponent