diff options
Diffstat (limited to 'src/graphui/classes/com/jogamp')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Shape.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index fe86f7423..0244b2876 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -1179,12 +1179,17 @@ public abstract class Shape { public final Shape setToggle(final boolean v) { setIO(IO_TOGGLE, v); + toggleNotify(v); + if( null != onToggleListener ) { + onToggleListener.run(this); + } markStateDirty(); return this; } public final Shape toggle() { if( isToggleable() ) { setIO(IO_TOGGLE, !isToggleOn()); + toggleNotify(isToggleOn()); if( null != onToggleListener ) { onToggleListener.run(this); } @@ -1192,6 +1197,8 @@ public abstract class Shape { } return this; } + protected void toggleNotify(final boolean on) {} + /** Returns true this shape's toggle state. */ public final boolean isToggleOn() { return isIO(IO_TOGGLE); } |