Component
, TextGUIElement
Border
AbstractBasePane.ContentHolder
, AbstractBorder
, AbstractComposite
, Panel
public interface Container extends Component
Panel
class which uses a layout manager to size and position the children over its area. Note
that there is no method for adding components to the container, since this depends on the implementation. In general,
composites that contains one one (or zero) children, the method for specifying the child is in Composite
.
Multi-child containers are generally using the Panel
implementation which has an addComponent(..)
method.Modifier and Type | Method | Description |
---|---|---|
boolean |
containsComponent(Component component) |
Returns
true if this container contains the supplied component either directly or indirectly through
intermediate containers. |
int |
getChildCount() |
Returns the number of children this container currently has
|
Collection<Component> |
getChildren() |
Returns collection that is to be considered a copy of the list of children contained inside of this object.
|
List<Component> |
getChildrenList() |
Returns list that is to be considered a copy of the list of children inside of this container.
|
boolean |
handleInput(KeyStroke key) |
If an interactable component inside this container received a keyboard event that wasn't handled, the GUI system
will recursively send the event to each parent container to give each of them a chance to consume the event.
|
Interactable |
nextFocus(Interactable fromThis) |
Given an interactable, find the next one in line to receive focus.
|
Interactable |
previousFocus(Interactable fromThis) |
Given an interactable, find the previous one in line to receive focus.
|
boolean |
removeComponent(Component component) |
Removes the component from the container.
|
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, getBasePane, getLayoutData, getParent, getPosition, getPreferredSize, getRenderer, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, toBasePane, toGlobal, withBorder
draw, isInvalid
int getChildCount()
Collection<Component> getChildren()
This method isn't deprecated but it should have originally been defined as returning a List instead of a
Collection. See getChildrenList
for a method with this signature.
getChildrenList()
List<Component> getChildrenList()
getChildren()
boolean containsComponent(Component component)
true
if this container contains the supplied component either directly or indirectly through
intermediate containers.component
- Component to check if it's part of this containertrue
if the component is inside this Container, otherwise false
boolean removeComponent(Component component)
component
- Component to remove from the Containertrue
if the component existed inside the container and was removed, false
otherwiseInteractable nextFocus(Interactable fromThis)
null
.fromThis
- Component from which to get the next interactable, or if
null, pick the first available interactableInteractable previousFocus(Interactable fromThis)
null
.fromThis
- Component from which to get the previous interactable,
or if null, pick the last interactable in the listboolean handleInput(KeyStroke key)
false
if the implementer doesn't care about this particular keystroke and it will be automatically
sent up the hierarchy the to next container. If you return true
, the event will stop here and won't be
reported as unhandled.key
- Keystroke that was ignored by the interactable inside this containertrue
if this event was handled by this container and shouldn't be processed anymore,
false
if the container didn't take any action on the event and want to pass it onvoid updateLookupMap(InteractableLookupMap interactableLookupMap)
interactableLookupMap
- Interactable map to updateCopyright © 2020. All rights reserved.