summaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Shape.java5
1 files changed, 5 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 55dd5fa5c..9b32c0ee0 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java
@@ -140,6 +140,7 @@ public abstract class Shape {
private Listener onMoveListener = null;
private Listener onToggleListener = null;
+ private Listener onClickedListener = null;
public Shape() {
this.box = new AABBox();
@@ -202,6 +203,7 @@ public abstract class Shape {
public final void onMove(final Listener l) { onMoveListener = l; }
public final void onToggle(final Listener l) { onToggleListener = l; }
+ public final void onClicked(final Listener l) { onClickedListener = l; }
/** Move to scaled position. Position ends up in PMVMatrix unmodified. */
public final Shape moveTo(final float tx, final float ty, final float tz) {
@@ -1072,6 +1074,9 @@ public abstract class Shape {
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_CLICKED:
toggle();
+ if( null != onClickedListener ) {
+ onClickedListener.run(this);
+ }
break;
case MouseEvent.EVENT_MOUSE_PRESSED:
dragFirst = true;