Class AbstractBasePane.ContentHolder

    • Field Detail

    • Constructor Detail

      • ContentHolder

        ContentHolder()
    • Method Detail

      • setMenuBar

        private void setMenuBar​(MenuBar menuBar)
      • getMenuBar

        private MenuBar getMenuBar()
      • isInvalid

        public boolean isInvalid()
        Description copied from interface: TextGUIElement
        Checks if this element (or any of its child components, if any) has signaled that what it's currently displaying is out of date and needs re-drawing.
        Specified by:
        isInvalid in interface TextGUIElement
        Overrides:
        isInvalid in class AbstractComposite<Container>
        Returns:
        true if the component is invalid and needs redrawing, false otherwise
      • invalidate

        public void invalidate()
        Description copied from interface: Component
        Marks the component as invalid and requiring to be re-drawn at next opportunity. Container components should take this as a hint to layout the child components again.
        Specified by:
        invalidate in interface Component
        Overrides:
        invalidate in class AbstractComposite<Container>
      • setComponent

        public void setComponent​(Component component)
        Description copied from interface: Composite
        Sets the component which is inside this Composite. If you call this method with null, it removes the component wrapped by this Composite.
        Specified by:
        setComponent in interface Composite
        Overrides:
        setComponent in class AbstractComposite<Container>
        Parameters:
        component - Component to wrap
      • removeComponent

        public boolean removeComponent​(Component component)
        Description copied from interface: Container
        Removes the component from the container. This should remove the component from the Container's internal data structure as well as call the onRemoved(..) method on the component itself if it was found inside the container.
        Specified by:
        removeComponent in interface Container
        Overrides:
        removeComponent in class AbstractComposite<Container>
        Parameters:
        component - Component to remove from the Container
        Returns:
        true if the component existed inside the container and was removed, false otherwise
      • getTextGUI

        public TextGUI getTextGUI()
        Description copied from interface: Component
        Returns the TextGUI that this component is currently part of. If the component hasn't been added to any container or in any other way placed into a GUI system, this method will return null.
        Specified by:
        getTextGUI in interface Component
        Overrides:
        getTextGUI in class AbstractComponent<Container>
        Returns:
        The TextGUI that this component belongs to, or null if none
      • createDefaultRenderer

        protected ComponentRenderer<Container> createDefaultRenderer()
        Description copied from class: AbstractComponent
        When you create a custom component, you need to implement this method and return a Renderer which is responsible for taking care of sizing the component, rendering it and choosing where to place the cursor (if Interactable). This value is intended to be overridden by custom themes.
        Specified by:
        createDefaultRenderer in class AbstractComponent<Container>
        Returns:
        Renderer to use when sizing and drawing this component
      • toGlobal

        public TerminalPosition toGlobal​(TerminalPosition position)
        Description copied from interface: Component
        Translates a position local to the container to global coordinate space. This should be the absolute coordinate in the terminal screen, taking no windows or containers into account. If the component belongs to no base pane, it will return null.
        Specified by:
        toGlobal in interface Component
        Overrides:
        toGlobal in class AbstractComponent<Container>
        Parameters:
        position - Position to translate (relative to the container's top-left corner)
        Returns:
        Position in global (or absolute) coordinates, or null if the component is an orphan
      • toBasePane

        public TerminalPosition toBasePane​(TerminalPosition position)
        Description copied from interface: Component
        Translates a position local to the container to the base pane's coordinate space. For a window-based GUI, this be a coordinate in the window's coordinate space. If the component belongs to no base pane, it will return null.
        Specified by:
        toBasePane in interface Component
        Overrides:
        toBasePane in class AbstractComponent<Container>
        Parameters:
        position - Position to translate (relative to the container's top-left corner)
        Returns:
        Position in base pane space, or null if the component is an orphan
      • getBasePane

        public BasePane getBasePane()
        Description copied from interface: Component
        Returns the BasePane that this container belongs to. In a window-based GUI system, this will be a Window.
        Specified by:
        getBasePane in interface Component
        Overrides:
        getBasePane in class AbstractComponent<Container>
        Returns:
        The base pane this component is placed on, or null if none