observeReads

Runs block, recording its reads under this node; after one of them changes, calls ObserverModifierNode.onObservedReadsChanged once, while the node is attached.

Throws

if this node is not attached or the call is off the Event Dispatch Thread.


fun <T : SwingModifier.Node> T.observeReads(onChanged: (T) -> Unit, block: () -> Unit)

Runs block, recording its reads under this node and onChanged; after one of them changes, calls onChanged with this node once, while it is attached. Reads are grouped by the onChanged instance, as SnapshotStateObserver.observeReads groups them: pass the same instance on every call, and use one instance per set of reads that must not drop another's.

Throws

if this node is not attached or the call is off the Event Dispatch Thread.


fun <N : SwingComponentNode<*>> N.observeReads(onChanged: (N) -> Unit, block: () -> Unit)

Runs block, recording its reads under this node, as SwingModifier.Node.observeReads does for a modifier node; onChanged receives this node, on the Event Dispatch Thread.

Throws

if this node is not attached or the call is off the Event Dispatch Thread.