Package tripleplay.ui
Class Box
- Direct Known Subclasses:
Box.Clipped
A container that holds zero or one widget. The box delegates everything to its current contents
(its preferred size is its content's preferred size, it sizes its contents to its size).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ABox
which draws its children clipped to their preferred size.static class
A transition that fades from the old contents to the new.static class
static class
Manages transitions fortransition(tripleplay.ui.Element<?>, tripleplay.ui.Box.Trans)
.Nested classes/interfaces inherited from class tripleplay.ui.Container
Container.Mutable<T extends Container.Mutable<T>>
Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionElement<?>
childAt
(int index) Returns the child at the specified index.int
Returns the number of children contained by this container.clear()
Clears out the box's current contents.Element<?>
contents()
Returns the box's current contents.void
Removes and destroys the specified child.void
Removes and destroys all children from this container.void
destroyAt
(int index) Removes and destroys the child at the specified index.Clears out the box's current contents and destroys it immediately.iterator()
Returns an unmodifiable iterator over the children of this Container.void
Removes the specified child from this container.void
Removes all children from this container.void
removeAt
(int index) Removes the child at the specified index from this container.Updates the box's contents.Returns the stylesheet associated with this container, or null.transition
(Element<?> contents, Box.Trans trans) Performs an animated transition from the box's current contents tocontents
.Methods inherited from class tripleplay.ui.Container
removeFromParent
Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isShowing, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, setVisible, size, styles, visibleSlot, x, y
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Box
public Box()Creates an empty box. -
Box
Creates a box with the specified starting contents.
-
-
Method Details
-
contents
Returns the box's current contents. -
set
Updates the box's contents. The previous contents, if any, is removed but not destroyed. To destroy the old contents and set the new, usedestroyContents().set(contents)
. -
transition
Performs an animated transition from the box's current contents tocontents
.- Parameters:
trans
- describes and manages the transition (duration, style, etc.).
-
clear
Clears out the box's current contents. -
destroyContents
Clears out the box's current contents and destroys it immediately. -
stylesheet
Description copied from class:Container
Returns the stylesheet associated with this container, or null. Styles are resolved by searching up the container hierarchy. OnlyContainer
actually provides styles to its children.- Specified by:
stylesheet
in classContainer<Box>
-
childCount
public int childCount()Description copied from class:Container
Returns the number of children contained by this container.- Specified by:
childCount
in classContainer<Box>
-
childAt
Description copied from class:Container
Returns the child at the specified index. -
iterator
Description copied from class:Container
Returns an unmodifiable iterator over the children of this Container. -
remove
Description copied from class:Container.Mutable
Removes the specified child from this container.- Specified by:
remove
in classContainer.Mutable<Box>
-
removeAt
public void removeAt(int index) Description copied from class:Container.Mutable
Removes the child at the specified index from this container.- Specified by:
removeAt
in classContainer.Mutable<Box>
-
removeAll
public void removeAll()Description copied from class:Container.Mutable
Removes all children from this container.- Specified by:
removeAll
in classContainer.Mutable<Box>
-
destroy
Description copied from class:Container.Mutable
Removes and destroys the specified child.- Specified by:
destroy
in classContainer.Mutable<Box>
-
destroyAt
public void destroyAt(int index) Description copied from class:Container.Mutable
Removes and destroys the child at the specified index.- Specified by:
destroyAt
in classContainer.Mutable<Box>
-
destroyAll
public void destroyAll()Description copied from class:Container.Mutable
Removes and destroys all children from this container.- Specified by:
destroyAll
in classContainer.Mutable<Box>
-