diff options
author | Sven Göthel <[email protected]> | 2024-02-05 16:50:15 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-02-05 16:50:15 +0100 |
commit | 0ac7b2e59d5b41302f8e0ec7596d8f44447cf0a1 (patch) | |
tree | 3c361927fd3b8ff8d6dd91f40050af3a01de4715 /src/graphui/classes/com/jogamp/graph/ui/Shape.java | |
parent | 80f226fffcab51f8e46caa48e9dd3a134ca87dd0 (diff) |
Bug 1498: Refine Top-Level Widget Mode: Handle active-state by Scene, simplify and reduce runtime costs
Refines commit 43a7899fedf2a570d20b03848bf15710f30b7f26
Scene handles top-level active state via releaseActiveShape() and setActive(),
now calling into setActiveTopLevel() -> dispatchActivationEvent().
Drop child's addActivationListener(forwardActivation) and isActive() override.
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/Shape.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Shape.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index face8fc8f..183f8901e 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -1610,14 +1610,13 @@ public abstract class Shape { } } /** Returns true of this shape is active */ - public boolean isActive() { return isIO(IO_ACTIVE); } + public final boolean isActive() { return isIO(IO_ACTIVE); } - protected final Listener forwardActivation = new Listener() { - @Override - public void run(final Shape shape) { - dispatchActivationEvent(shape); - } - }; + /* pp */ void setActiveTopLevel(final boolean v, final float zOffset) { + setZOffset(zOffset); + setIO(IO_ACTIVE, v); + dispatchActivationEvent(this); + } public final float getAdjustedZ() { return position.z() * getScale().z() + zOffset; |