Container

Represents a View that can have children and Layout.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val children: ObservableList<View>

The list of children within the Container

Link copied to clipboard
open override var insets: Insets

Hint to layout that children within the Container should be inset from the edges

Link copied to clipboard
open override var isFocusCycleRoot: Boolean
Link copied to clipboard
open override var layout: Layout?

Manages the positioning of children within the Container. The framework will call use this to reposition the children whenever the Container's bounds change, or the bounds, visibility of a child changes.

Inherited properties

Link copied to clipboard

Determines whether the View will be affected by Themes set in ThemeManager. Defaults to true

Link copied to clipboard

Indicates the View that contains a more detailed description for assistive technologies. This property overrides accessibilityLabel.

Link copied to clipboard

Provides a recognizable name for assistive technologies.

Link copied to clipboard

Indicates the View that contains a recognizable name for assistive technologies. This property overrides accessibilityLabel.

Link copied to clipboard

indicates the View's role for assistive technologies

Link copied to clipboard

Optional color that the View could use for its background

Link copied to clipboard

Smallest enclosing Rectangle around the View's bounds given it's transform.

Link copied to clipboard
override var bounds: Rectangle

The top, left, width, and height with respect to parent, or the Display if top-level. Unlike boundingBox, this value isn't affected by any applied transform.

Link copied to clipboard
Link copied to clipboard

Camera within the View's parent that affects how it is projected onto the screen.

Link copied to clipboard
Link copied to clipboard

The View's center point in its parent's coordinate system.

Link copied to clipboard

Notifies changes to children

Link copied to clipboard

A Path used to further clip the View's children within its bounds. The View's children cannot extend beyond its bounds, so specifying a value larger than it will not enable that.

Link copied to clipboard

Indicates whether the View's Canvas will be clipped so that nothing rendered shows beyond its bounds. Set this to false to support things like shadows or glows that aren't intended to be included in the normal bounding box.

Link copied to clipboard

The resolved content direction for this View, including any value inherited from its parent if localContentDirection is null. The final fallback value is LeftRight.

Link copied to clipboard
Link copied to clipboard

Cursor that is displayed whenever the pointer is over this View. This falls back to the parent's Cursor if not set.

Link copied to clipboard

Notifies changes to cursor

Link copied to clipboard
val displayChange: BooleanObservers

Notifies changes to displayed

Link copied to clipboard

Is true if the View is currently within the Display. NOTE: this does not mean the View has been rendered yet.

Link copied to clipboard

Current visible Rectangle for this View within it's coordinate space. This accounts for clipping by ancestors, but NOT cousins (siblings, anywhere in the hierarchy)

Link copied to clipboard
val displayRectHandlingChanged: BooleanObservers

Notifies changes to monitorsDisplayRect

Link copied to clipboard

Recognizer used to determine whether a PointerEvent should result in a DragOperation

Link copied to clipboard

Receiver that determines what drop operations are supported by the View

Link copied to clipboard

Whether this View is enabled. The default is true.

Link copied to clipboard
val enabledChanged: BooleanObservers

Notifies changes to enabled

Link copied to clipboard

Notifies on the View's first render

Link copied to clipboard
val focusabilityChanged: BooleanObservers

Notifies changes to focusable

Link copied to clipboard
open var focusable: Boolean

Whether this View is focusable The default is true.

Link copied to clipboard
val focusChanged: BooleanObservers

Notifies changes to hasFocus

Link copied to clipboard
protected val focusCycleRoot: View?
Link copied to clipboard
Link copied to clipboard
var font: Font?

Optional font that the View could use for rendering. This falls back to parent's font if not set.

Link copied to clipboard

Optional color that the View could use for its foreground (i.e. text)

Link copied to clipboard

Whether the View has focus or not. The default is false.

Link copied to clipboard
override var height: Double

Vertical extent of bounds

Link copied to clipboard
override var idealSize: Size?

Size that would best display this View, or null if no preference

Link copied to clipboard

KeyListeners that are notified during the bubbling phase of key event handling.

Link copied to clipboard

KeyListeners that are notified during the sinking phase of key event handling

Link copied to clipboard

Indicates the direction of content within the View; used to support right-to-left locales. Setting this property to null will allow the View to inherit the value from its parent. The resolved value is obtained via contentDirection; and it will never be null.

Link copied to clipboard
override var minimumSize: Size

Minimum size preferred by the View, default is Empty

Link copied to clipboard

true if the View's contentDirection is RightLeft and mirrorWhenRightLeft is true.

Link copied to clipboard

Indicates whether the View should be mirrored (as though transformed using AffineTransform.flipHorizontally), when the contentDirection is RightLeft.

Link copied to clipboard

Indicates whether the framework should notify the View of changes to its visible region as a result of changes to bounds in its ancestor chain. The events for this require monitoring potentially large sets of Views in the hierarchy and the events can be frequent during layout changes. So the default value is false. But it is useful for things like efficient rendering of sub-portions (i.e. long list-like Views) where the cost is outweighed.

Link copied to clipboard

Overrides the next item read by assistive technologies when they move from this View. This is helpful when the display order (i.e. ordering of children in a parent) does not match the order they should be read in.

Link copied to clipboard

Indicates how opaque the View is. A value of 1 means the View should be fully opaque and 0 means fully transparent. Setting this property to 0 does not make a View invisible (i.e. visible might still be true). This property also does not affect how events (i.e. pointer and keyboard) are sent to the View.

Link copied to clipboard
Link copied to clipboard
var parent: View?

View that contains this one as a child, or null. A top-level Views will also return null; but they will also have displayed == true; so parent alone isn't sufficient to determine whether a View is in the display hierarchy.

Link copied to clipboard

Notifies changes to parent

Link copied to clipboard

PointerListeners that are notified during the bubbling phase of pointer event handling.

Link copied to clipboard

PointerListeners that are notified during the sinking phase of pointer event handling.

Link copied to clipboard

PointerMotionListeners that are notified during the sinking phase of pointer-motion event handling.

Link copied to clipboard

PointerMotionListeners that are notified during the sinking phase of pointer-motion event handling.

Link copied to clipboard

PointerMotionListeners that are ONLY notified if a View chooses to pass a pointer event through to Views below it. This allows actions to be taken for events that would otherwise be relayed to other, underlying Views.

Link copied to clipboard

PointerListeners that are ONLY notified if a View chooses to pass a pointer event through to Views below it. This allows actions to be taken for events that would otherwise be relayed to other, underlying Views.

Link copied to clipboard
override var position: Point

Top-left corner of bounds

Link copied to clipboard

Is true if the View has been rendered at least once.

Link copied to clipboard
override var size: Size

Width-height of bounds

Link copied to clipboard
Link copied to clipboard

The current text to display for tool-tips. The default is the empty string.

Link copied to clipboard

Affine transform applied to the View. This transform does not affect the View's bounds or how it is handled by Layout. It does affect the boundingBox, and how the View looks when rendered. Hit-detection is handled correctly such that the pointer intersects with the View as expected after transformation. So no additional handling is necessary in general. The default is Identity

Link copied to clipboard
Link copied to clipboard
val visibilityChanged: BooleanObservers

Notifies changes to visible

Link copied to clipboard
override var visible: Boolean

Whether this View is visible. The default is true.

Link copied to clipboard
override var width: Double

Horizontal extent of bounds

Link copied to clipboard
override var x: Double

Left edge of bounds

Link copied to clipboard
override var y: Double

Top edge of bounds

Link copied to clipboard
var zOrder: Int

Rendering order of this View within it's parent, or Display if top-level. Views with higher values are rendered above those with lower ones. The default is 0.

Functions

Link copied to clipboard
open infix override fun ancestorOf(view: View): Boolean
Link copied to clipboard
open override fun child(at: Point): View?
Link copied to clipboard
open operator override fun iterator(): MutableIterator<View>
Link copied to clipboard
operator fun minusAssign(view: View)

Removes view from the Container.

operator fun minusAssign(views: Collection<View>)

Removes the given views from the Container.

Link copied to clipboard
operator fun plusAssign(view: View)

Adds view to the Container.

operator fun plusAssign(views: Collection<View>)

Adds the given views to the Container.

Link copied to clipboard
open override fun relayout()

Prompts the View to lay out its children if it has a Layout installed.

Inherited functions

Link copied to clipboard
protected open fun addedToDisplay()

This method is invoked by the render system when the View is first added to the Display hierarchy. This happens when the View itself-- or one of it's ancestors--is added to the Display.

Link copied to clipboard

Moves the View's center to the given point.

Link copied to clipboard
protected operator fun contains(child: View): Boolean

Tells whether this View is child's parent. Unlike ancestorOf, this checks only a parent-child relationship.

open operator override fun contains(point: Point): Boolean

Checks whether a point (relative to parent or Display if top-level) is within the View's bounds. This method must account for any transform and camera applied to the View. The default implementation does this and delegates to intersects.

Link copied to clipboard
protected fun contentDirectionChanged()
Link copied to clipboard
protected fun cursorChanged(old: Cursor?, new: Cursor?)
Link copied to clipboard
protected open fun doLayout()

Causes the layout (if any) to re-layout the View's children

Link copied to clipboard
protected fun enabledChanged(old: Boolean, new: Boolean, filter: (View) -> Boolean)
Link copied to clipboard
protected open fun filterKeyEvent(event: KeyEvent)

This is an event invoked on a View in response to a key event triggered in the subsystem.

Link copied to clipboard
protected open fun filterPointerEvent(event: PointerEvent)

This is an event invoked on a View during the filter phase of a pointer event.

Link copied to clipboard
protected open fun filterPointerMotionEvent(event: PointerEvent)

This is an event invoked on a View during the filter phase of a pointer-motion event.

Link copied to clipboard
fun fromAbsolute(point: Point): Point

Maps a Point from absolute coordinate-space: relative to the un-transformed Display, into this View's coordinate-space.

Link copied to clipboard
operator fun get(traversalType: FocusTraversalPolicy.TraversalType): Set<KeyState>?

Gets the set of keys used to trigger this type of focus traversal.

Link copied to clipboard
protected open fun handleDisplayRectEvent(old: Rectangle, new: Rectangle)

This is an event invoked on a View in response to a change in the display rectangle.

Link copied to clipboard
protected open fun handleKeyEvent(event: KeyEvent)

This is an event invoked on a View in response to a key event triggered in the subsystem.

Link copied to clipboard
protected open fun handlePointerEvent(event: PointerEvent)

This is an event invoked on a View in response to a pointer event triggered in the subsystem.

Link copied to clipboard
protected open fun handlePointerMotionEvent(event: PointerEvent)

This is an event invoked on a View in response to a pointer-motion event triggered in the subsystem.

Link copied to clipboard
open infix fun intersects(point: Point): Boolean

Checks whether a point on the View's plane, but relative to its parent, intersects (is "touching") the View. This enables custom hit detection logic for Views that have non-rectangular shapes.

Link copied to clipboard
Link copied to clipboard
protected open fun removedFromDisplay()

This method is invoked by the Render system when the View is no longer included in the Display hierarchy. This happens when the View itself-- or one of it's ancestors--is removed from the Display.

Link copied to clipboard
open override fun render(canvas: Canvas)

Gives the View an opportunity to render itself (excludes any children) to the given Canvas.

Link copied to clipboard
fun rerender()

Request the rendering subsystem to trigger a render call if needed.

Link copied to clipboard

Request the rendering subsystem to trigger a render call with no delay. Only use this method for time-sensitive drawing as is the case for animations.

Link copied to clipboard
protected fun revalidate()
Link copied to clipboard
fun View.scrollTo(rectangle: Rectangle)

Scrolls the View to the given region if it is within a ScrollPanel.

Link copied to clipboard
operator fun set(traversalType: FocusTraversalPolicy.TraversalType, keyStates: Set<KeyState>?)

Sets the keys used to control focus traversals of the given type.

Link copied to clipboard
protected open fun shouldHandlePointerEvent(event: PointerEvent): Boolean

Determines whether the given event should be passed through the View to underlying items. This method is only called when a View would normally be sent an event like the one provided.

Link copied to clipboard

Determines whether the given event should be passed through the View to underlying items. This method is only called when a View would normally be sent an event like the one provided.

Link copied to clipboard

Checked by the focus system before the focus is moved from a View. Returning false will prevent focus from moving. The default is true.

Link copied to clipboard
protected fun styleChanged(filter: (View) -> Boolean)
Link copied to clipboard
fun toAbsolute(point: Point): Point

Maps a Point within the View to absolute coordinate-space.

Link copied to clipboard
fun toLocal(point: Point, from: View?): Point

Maps a Point within from View into this View's coordinate-space.

Link copied to clipboard

Gets the tool-tip text based on the given PointerEvent. Override this method to provide multiple tool-tip text values for a single View.

Link copied to clipboard
fun toParent(point: Point): Point

Maps a Point within the View to its parent's coordinate-space, or the Display's if it is top-level.