Component
, Composite
, Container
, TextGUIElement
protected class AbstractBasePane.ContentHolder extends AbstractComposite<Container>
Modifier and Type | Method | Description |
---|---|---|
protected ComponentRenderer<Container> |
createDefaultRenderer() |
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).
|
BasePane |
getBasePane() |
Returns the BasePane that this container belongs to.
|
TextGUI |
getTextGUI() |
Returns the TextGUI that this component is currently part of.
|
void |
invalidate() |
Marks the component as invalid and requiring to be re-drawn at next opportunity.
|
boolean |
isInvalid() |
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.
|
boolean |
removeComponent(Component component) |
Removes the component from the container.
|
void |
setComponent(Component component) |
Sets the component which is inside this Composite.
|
TerminalPosition |
toBasePane(TerminalPosition position) |
Translates a position local to the container to the base pane's coordinate space.
|
TerminalPosition |
toGlobal(TerminalPosition position) |
Translates a position local to the container to global coordinate space.
|
void |
updateLookupMap(InteractableLookupMap interactableLookupMap) |
Takes a lookup map and updates it with information about where all the interactables inside of this container
are located.
|
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, withBorder
containsComponent, getChildCount, getChildren, getChildrenList, getComponent, handleInput, nextFocus, previousFocus
addTo, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTheme, getThemeDefinition, hasParent, isInside, isVisible, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, setVisible, withBorder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw
public boolean isInvalid()
TextGUIElement
isInvalid
in interface TextGUIElement
isInvalid
in class AbstractComposite<Container>
true
if the component is invalid and needs redrawing, false
otherwisepublic void invalidate()
Component
invalidate
in interface Component
invalidate
in class AbstractComposite<Container>
public void updateLookupMap(InteractableLookupMap interactableLookupMap)
Container
updateLookupMap
in interface Container
updateLookupMap
in class AbstractComposite<Container>
interactableLookupMap
- Interactable map to updatepublic void setComponent(Component component)
Composite
setComponent
in interface Composite
setComponent
in class AbstractComposite<Container>
component
- Component to wrappublic boolean removeComponent(Component component)
Container
removeComponent
in interface Container
removeComponent
in class AbstractComposite<Container>
component
- Component to remove from the Containertrue
if the component existed inside the container and was removed, false
otherwisepublic TextGUI getTextGUI()
Component
getTextGUI
in interface Component
getTextGUI
in class AbstractComponent<Container>
protected ComponentRenderer<Container> createDefaultRenderer()
AbstractComponent
createDefaultRenderer
in class AbstractComponent<Container>
public TerminalPosition toGlobal(TerminalPosition position)
Component
null
.toGlobal
in interface Component
toGlobal
in class AbstractComponent<Container>
position
- Position to translate (relative to the container's top-left corner)null
if the component is an orphanpublic TerminalPosition toBasePane(TerminalPosition position)
Component
null
.toBasePane
in interface Component
toBasePane
in class AbstractComponent<Container>
position
- Position to translate (relative to the container's top-left corner)null
if the component is an orphanpublic BasePane getBasePane()
Component
getBasePane
in interface Component
getBasePane
in class AbstractComponent<Container>
null
if noneCopyright © 2020. All rights reserved.