From 7fd51917b0cc85c3dc3d07592093a62b213d1ea5 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Mon, 28 Aug 2023 22:59:57 +0200
Subject: GraphUI Shape: Show dirty-state in getSubString()

---
 src/graphui/classes/com/jogamp/graph/ui/Shape.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'src/graphui/classes/com/jogamp/graph/ui/Shape.java')

diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java
index eaf38ffb0..1890ccf14 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java
@@ -391,6 +391,18 @@ public abstract class Shape {
         return 0 != ( dirty & DIRTY_STATE ) ;
     }
 
+    protected final String getDirtyString() {
+        if( isShapeDirty() && isShapeDirty() ) {
+            return "dirty[shape, state]";
+        } else if( isShapeDirty() ) {
+            return "dirty[shape]";
+        } else if( isStateDirty() ) {
+            return "dirty[state]";
+        } else {
+            return "clean";
+        }
+    }
+
     /**
      * Returns the unscaled bounding {@link AABBox} for this shape, borrowing internal instance.
      *
@@ -1028,7 +1040,7 @@ public abstract class Shape {
         }
         final String ps = hasPadding() ? padding.toString()+", " : "";
         final String bs = hasBorder() ? "Border "+getBorderThickness()+", " : "";
-        return "enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+
+        return getDirtyString()+", enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+
                "], able[iactive "+isInteractive()+", resize "+isResizable()+", move "+this.isDraggable()+
                "], pos["+position+"], "+pivotS+scaleS+rotateS+
                 ps+bs+"box"+box;
-- 
cgit v1.2.3