Class ComboBox.DefaultComboBoxRenderer<V>

  • Type Parameters:
    V - Type of items in the combo box
    All Implemented Interfaces:
    ComponentRenderer<ComboBox<V>>, InteractableRenderer<ComboBox<V>>
    Enclosing class:
    ComboBox<V>

    public static class ComboBox.DefaultComboBoxRenderer<V>
    extends ComboBox.ComboBoxRenderer<V>
    This class is the default renderer implementation which will be used unless overridden. The combo box is rendered like a text box with an arrow point down to the right of it, which can receive focus and triggers the popup.
    • Field Detail

      • textVisibleLeftPosition

        private int textVisibleLeftPosition
    • Constructor Detail

      • DefaultComboBoxRenderer

        public DefaultComboBoxRenderer()
        Default constructor
    • Method Detail

      • getPreferredSize

        public TerminalSize getPreferredSize​(ComboBox<V> comboBox)
        Description copied from interface: ComponentRenderer
        Given the supplied component, how large does this renderer want the component to be? Notice that this is the responsibility of the renderer and not the component itself, since the component has no idea what its visual representation looks like.
        Parameters:
        comboBox - Component to calculate the preferred size of
        Returns:
        The size this renderer would like the component to take up
      • drawComponent

        public void drawComponent​(TextGUIGraphics graphics,
                                  ComboBox<V> comboBox)
        Description copied from interface: ComponentRenderer
        Using the supplied graphics object, draws the component passed in.
        Parameters:
        graphics - Graphics object to use for drawing
        comboBox - Component to draw