Class AbstractBasePane.ContentHolder
java.lang.Object
com.googlecode.lanterna.gui2.AbstractComponent<Container>
com.googlecode.lanterna.gui2.AbstractComposite<Container>
com.googlecode.lanterna.gui2.AbstractBasePane.ContentHolder
- All Implemented Interfaces:
Component, Composite, Container, TextGUIElement
- Enclosing class:
AbstractBasePane<T extends BasePane>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ComponentRenderer<Container> 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).Returns the BasePane that this container belongs to.private MenuBarReturns the TextGUI that this component is currently part of.voidMarks the component as invalid and requiring to be re-drawn at next opportunity.booleanChecks 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.booleanremoveComponent(Component component) Removes the component from the container.voidsetComponent(Component component) Sets the component which is inside this Composite.private voidsetMenuBar(MenuBar menuBar) toBasePane(TerminalPosition position) Translates a position local to the container to the base pane's coordinate space.toGlobal(TerminalPosition position) Translates a position local to the container to global coordinate space.voidupdateLookupMap(InteractableLookupMap interactableLookupMap) Takes a lookup map and updates it with information about where all the interactables inside of this container are located.Methods inherited from class AbstractComposite
containsComponent, getChildCount, getChildren, getChildrenList, getComponent, handleInput, nextFocus, previousFocusMethods inherited from class AbstractComponent
addTo, calculatePreferredSize, draw, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTheme, getThemeDefinition, hasParent, isInside, isVisible, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, setVisible, withBorderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
addTo, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTheme, getThemeDefinition, hasParent, isInside, isVisible, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, setVisible, withBorderMethods inherited from interface TextGUIElement
draw
-
Field Details
-
Constructor Details
-
ContentHolder
ContentHolder()
-
-
Method Details
-
getMenuBar
-
isInvalid
public boolean isInvalid()Description copied from interface:TextGUIElementChecks 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:
isInvalidin interfaceTextGUIElement- Overrides:
isInvalidin classAbstractComposite<Container>- Returns:
trueif the component is invalid and needs redrawing,falseotherwise
-
invalidate
public void invalidate()Description copied from interface:ComponentMarks 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:
invalidatein interfaceComponent- Overrides:
invalidatein classAbstractComposite<Container>
-
updateLookupMap
Description copied from interface:ContainerTakes a lookup map and updates it with information about where all the interactables inside of this container are located.- Specified by:
updateLookupMapin interfaceContainer- Overrides:
updateLookupMapin classAbstractComposite<Container>- Parameters:
interactableLookupMap- Interactable map to update
-
setComponent
Description copied from interface:CompositeSets the component which is inside this Composite. If you call this method with null, it removes the component wrapped by this Composite.- Specified by:
setComponentin interfaceComposite- Overrides:
setComponentin classAbstractComposite<Container>- Parameters:
component- Component to wrap
-
removeComponent
Description copied from interface:ContainerRemoves 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:
removeComponentin interfaceContainer- Overrides:
removeComponentin classAbstractComposite<Container>- Parameters:
component- Component to remove from the Container- Returns:
trueif the component existed inside the container and was removed,falseotherwise
-
getTextGUI
Description copied from interface:ComponentReturns 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:
getTextGUIin interfaceComponent- Overrides:
getTextGUIin classAbstractComponent<Container>- Returns:
- The TextGUI that this component belongs to, or null if none
-
createDefaultRenderer
Description copied from class:AbstractComponentWhen 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:
createDefaultRendererin classAbstractComponent<Container>- Returns:
- Renderer to use when sizing and drawing this component
-
toGlobal
Description copied from interface:ComponentTranslates 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 returnnull.- Specified by:
toGlobalin interfaceComponent- Overrides:
toGlobalin classAbstractComponent<Container>- Parameters:
position- Position to translate (relative to the container's top-left corner)- Returns:
- Position in global (or absolute) coordinates, or
nullif the component is an orphan
-
toBasePane
Description copied from interface:ComponentTranslates 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 returnnull.- Specified by:
toBasePanein interfaceComponent- Overrides:
toBasePanein classAbstractComponent<Container>- Parameters:
position- Position to translate (relative to the container's top-left corner)- Returns:
- Position in base pane space, or
nullif the component is an orphan
-
getBasePane
Description copied from interface:ComponentReturns the BasePane that this container belongs to. In a window-based GUI system, this will be a Window.- Specified by:
getBasePanein interfaceComponent- Overrides:
getBasePanein classAbstractComponent<Container>- Returns:
- The base pane this component is placed on, or
nullif none