SwingComponentNode

sealed class SwingComponentNode<out C : Component>

The node a Swing composition stores for one declared component, read off a node group of its CompositionData:

val component = (group.node as? SwingComponentNode<*>)?.component

A group whose CompositionGroup.node is not a SwingComponentNode declared no Swing component - it is a control-flow or call group, or a node of some other composition sharing the tree.

org.jetbrains.compose.swing.tooling.findDeclaringGroup answers from the other end, starting at a component and returning the group holding its node.

A node is typed by the component it holds. A SwingComponentNodeListener component types the node it is told with asNodeOf.

Properties

Link copied to clipboard
abstract val component: C

The component this node holds, for as long as the composition holds the node.

Link copied to clipboard
abstract val modifier: SwingModifier

The effective SwingModifier chain currently declared on this node, including any inherited component defaults applicable to this component followed by elements passed directly on the node's own modifier.

Functions

Link copied to clipboard

This node, typed by component, which it holds. A SwingComponentNodeListener component calls it with this to type the node it is told, so the callbacks it records under that node receive the component without a cast.

Link copied to clipboard

Invalidates layout on the Event Dispatch Thread. When the component tree lock is held, invalidation happens immediately and revalidation runs on the next event-queue turn; otherwise revalidation runs immediately. Pending revalidation is canceled when this node detaches: when it is reused, deactivated, released or moved to another composition, or when its composition is disposed. Does nothing while this node is not attached, which includes a root whose composition is disposed.