-
public class Scene<T extends ComponentView>
Baseclass for BGW scenes.
-
-
Field Summary
Fields Modifier and Type Field Description private final DynamicComponentView
draggedComponent
private final RootComponent<T>
rootNode
private final Double
width
private final Double
height
private Visual
background
private final List<T>
components
private Double
opacity
-
Method Summary
Modifier and Type Method Description final DynamicComponentView
getDraggedComponent()
final RootComponent<T>
getRootNode()
The root node of this Scene. final Double
getWidth()
The width of this Scene in virtual coordinates. final Double
getHeight()
The height of this Scene in virtual coordinates. final Visual
getBackground()
final Unit
setBackground(Visual background)
final List<T>
getComponents()
final Double
getOpacity()
final Unit
setOpacity(Double opacity)
final Unit
addComponents(T components)
Adds all given ComponentViews to the root node and rootComponents list. final Unit
removeComponents(T components)
Removes all given ComponentViews from the root node and rootComponents list. final Unit
clearComponents()
Removes all ComponentViews from the root node and rootComponents list. final Unit
playAnimation(Animation animation)
Plays given Animation. final List<ComponentView>
findPathToChild(ComponentView node)
Searches node recursively through the visual tree and logs path where the node appears as first component and the rootNode as last. -
-
Method Detail
-
getDraggedComponent
final DynamicComponentView getDraggedComponent()
-
getRootNode
final RootComponent<T> getRootNode()
The root node of this Scene.
Use it to compare the parent Property of any ComponentView to find out whether it was directly added to the Scene.
-
getBackground
final Visual getBackground()
-
setBackground
final Unit setBackground(Visual background)
-
getComponents
final List<T> getComponents()
-
getOpacity
final Double getOpacity()
-
setOpacity
final Unit setOpacity(Double opacity)
-
addComponents
final Unit addComponents(T components)
Adds all given ComponentViews to the root node and rootComponents list.
- Parameters:
components
- Components to add.
-
removeComponents
final Unit removeComponents(T components)
Removes all given ComponentViews from the root node and rootComponents list.
- Parameters:
components
- Components to remove.
-
clearComponents
final Unit clearComponents()
Removes all ComponentViews from the root node and rootComponents list.
-
playAnimation
final Unit playAnimation(Animation animation)
Plays given Animation.
- Parameters:
animation
- Animation to play.
-
findPathToChild
final List<ComponentView> findPathToChild(ComponentView node)
Searches node recursively through the visual tree and logs path where the node appears as first component and the rootNode as last.
- Parameters:
node
- Child to find.
-
-
-
-