diff options
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java index 43d174916..2eecd0862 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Shape.java @@ -69,7 +69,7 @@ public abstract class Shape { public static interface Listener { void run(final Shape shape); } - protected static final boolean DRAW_DEBUG_BOX = false; + protected static final boolean DEBUG_DRAW = false; private static final boolean DEBUG = false; private static final int DIRTY_SHAPE = 1 << 0 ; @@ -102,6 +102,7 @@ public abstract class Shape { private boolean draggable = true; private boolean resizable = true; private boolean enabled = true; + private float dbgbox_thickness = 0f; // fractional thickness of bounds, 0f for no debug box private ArrayList<MouseGestureListener> mouseListeners = new ArrayList<MouseGestureListener>(); private Listener onMoveListener = null; @@ -121,6 +122,18 @@ public abstract class Shape { public final void setEnabled(final boolean v) { enabled = v; } /** + * Sets the {@link #getBounds()} fractional thickness of the debug box ranging [0..1], zero for no debug box (default). + * @param v fractional thickness of {@link #getBounds()} ranging [0..1], zero for no debug box + */ + public final void setDebugBox(final float v) { + dbgbox_thickness = Math.min(1f, Math.max(0f, v)); + } + /** Returns true if a debug box has been enabled via {@link #setDebugBox(float)}. */ + public final boolean hasDebugBox() { return !FloatUtil.isZero(dbgbox_thickness); } + /** Returns the fractional thickness of the debug box ranging [0..1], see {@link #setDebugBox(float)}. */ + public final float getDebugBox() { return dbgbox_thickness; } + + /** * Clears all data and reset all states as if this instance was newly created * @param gl TODO * @param renderer TODO @@ -1164,8 +1177,6 @@ public abstract class Shape { protected abstract void destroyImpl0(final GL2ES2 gl, final RegionRenderer renderer); - protected abstract void addShapeToRegion(); - /** * Returns true if implementation uses an extra color channel or texture * which will be modulated with the passed rgba color {@link #drawImpl0(GL2ES2, RegionRenderer, int[], float[])}. |