Component
, Composite
, Container
, TextGUIElement
protected class AbstractBasePane.ContentHolder extends AbstractComposite<Container>
Modifier | Constructor | Description |
---|---|---|
protected |
ContentHolder() |
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.
|
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.
|
addTo, calculatePreferredSize, draw, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTheme, getThemeDefinition, hasParent, isInside, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, withBorder
containsComponent, getChildCount, getChildren, getChildrenList, getComponent, handleInput, invalidate, isInvalid, nextFocus, previousFocus, updateLookupMap
addTo, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTheme, getThemeDefinition, hasParent, isInside, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, withBorder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw
public 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.