Class TextButtonFactory


  • public class TextButtonFactory
    extends java.lang.Object
    A factory class to create "textbutton" instances.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextButtonFactory​(@NotNull ButtonImages up, @NotNull ButtonImages down, @NotNull java.awt.Font font, @NotNull java.awt.Color color, @NotNull java.awt.Color colorSelected, @NotNull java.awt.Color colorDisabled, @NotNull GuiFactory guiFactory, @NotNull NewCharModel newCharModel)
      Creates a new instance.
    • Constructor Detail

      • TextButtonFactory

        public TextButtonFactory​(@NotNull
                                 @NotNull ButtonImages up,
                                 @NotNull
                                 @NotNull ButtonImages down,
                                 @NotNull
                                 @NotNull java.awt.Font font,
                                 @NotNull
                                 @NotNull java.awt.Color color,
                                 @NotNull
                                 @NotNull java.awt.Color colorSelected,
                                 @NotNull
                                 @NotNull java.awt.Color colorDisabled,
                                 @NotNull
                                 @NotNull GuiFactory guiFactory,
                                 @NotNull
                                 @NotNull NewCharModel newCharModel)
        Creates a new instance.
        Parameters:
        up - the images comprising the "up" button state
        down - the images comprising the "down" button state
        font - the font to use
        color - the text color
        colorSelected - the text color when selected
        colorDisabled - the text color when disabled
        guiFactory - the global GUI factory instance
        newCharModel - the global new char model instance
    • Method Detail

      • newTextButton

        @NotNull
        public @NotNull AbstractGUIElement newTextButton​(@NotNull
                                                         @NotNull TooltipManager tooltipManager,
                                                         @NotNull
                                                         @NotNull GUIElementListener elementListener,
                                                         @NotNull
                                                         @NotNull java.lang.String name,
                                                         @NotNull
                                                         @NotNull java.lang.String text,
                                                         boolean autoRepeat,
                                                         @NotNull
                                                         @NotNull CommandList commandList)
        Creates a new text button.
        Parameters:
        tooltipManager - the tooltip manager to update
        elementListener - the element listener to notify
        name - the name of this element
        text - the button text
        autoRepeat - whether the button should auto-repeat while being pressed
        commandList - the commands to execute when the button is elected
        Returns:
        the new text button