diff options
Diffstat (limited to 'src/graphui/classes/com')
10 files changed, 69 insertions, 193 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Container.java b/src/graphui/classes/com/jogamp/graph/ui/Container.java index 82f2fda4f..106ffcfe9 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Container.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Container.java @@ -147,55 +147,4 @@ public interface Container { * @see Shape#isOutside() */ public boolean isOutside2(final Matrix4f mvCont, final Shape shape, final PMVMatrix4f pmvShape); - - /** - * Traverses through the graph up until {@code shape} of {@link Container#getShapes()} and apply {@code action} on it. - * @param pmv - * @param shape - * @param action - * @return true to signal operation complete, i.e. {@code shape} found, otherwise false - */ - boolean forOne(final PMVMatrix4f pmv, final Shape shape, final Runnable action); - - /** - * Traverses through the graph and apply {@link Visitor1#visit(Shape)} for each {@link Shape} of {@link Container#getShapes()}, - * stops if it returns true. - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor1#visit(Shape)} returned true, otherwise false - */ - boolean forAll(Visitor1 v); - - /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each {@link Shape} of {@link Container#getShapes()}, - * stops if it returns true. - * @param pmv - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false - */ - boolean forAll(final PMVMatrix4f pmv, Visitor2 v); - - /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each {@link Shape} of {@link Container#getShapes()}, - * stops if it returns true. - * - * Each {@link Container} level is sorted using {@code sortComp} - * @param sortComp - * @param pmv - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false - */ - boolean forSortedAll(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v); - - /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each {@link Shape} of {@link Container#getRenderedShapes()}, - * stops if it returns true. - * <p> - * Each {@link Container} level is sorted using {@code sortComp} - * </p> - * @param sortComp - * @param pmv - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false - */ - public boolean forAllRendered(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java index 4e10d071f..c44fbe110 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Group.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java @@ -98,7 +98,7 @@ public class Group extends Shape implements Container { /** * Create a group of {@link Shape}s w/o {@link Group.Layout}. * <p> - * Default is non-interactive, see {@link #setInteractive(boolean)}. + * Default is {@link #setInteractive(boolean) non-interactive}. * </p> */ public Group() { @@ -108,7 +108,7 @@ public class Group extends Shape implements Container { /** * Create a group of {@link Shape}s w/ given {@link Group.Layout}. * <p> - * Default is non-interactive, see {@link #setInteractive(boolean)}. + * Default is {@link #setInteractive(boolean) non-interactive}. * </p> * @param l optional {@link Layout}, maybe {@code null} */ @@ -119,7 +119,7 @@ public class Group extends Shape implements Container { /** * Create a group of {@link Shape}s w/ given {@link Group.Layout} and {@link Shape}. * <p> - * Default is non-interactive, see {@link #setInteractive(boolean)}. + * Default is {@link #setInteractive(boolean) non-interactive}. * </p> * @param name optional name for {@link #setName(String)} * @param l optional {@link Layout}, maybe {@code null} @@ -488,7 +488,7 @@ public class Group extends Shape implements Container { public boolean getRelayoutOnDirtyShapes() { return relayoutOnDirtyShapes; } /** - * Toggles widget behavior for this group and all its elements, default is disabled. + * Toggles widget behavior for this group, default is disabled. * <p> * Enabled widget behavior for a group causes * <ul> @@ -515,8 +515,8 @@ public class Group extends Shape implements Container { protected final void enableUniActivationImpl(final boolean v, final Listener activationListener) { for(final Shape s : shapes ) { if( s.isGroup() ) { - final Group sg = (Group)s; - sg.setWidgetMode(v); + // ((Group)s).enableUniActivationImpl(v, activationListener); + ((Group)s).setWidgetMode(v); } s.addActivationListener(activationListener); } @@ -527,14 +527,14 @@ public class Group extends Shape implements Container { @Override public boolean isActive() { - return super.isActive() || ( widgetMode && forAll((final Shape gs) -> { return gs.isActive(); } ) ); + return super.isActive() || ( widgetMode && TreeTool.forAll(this, (final Shape gs) -> { return gs.isActive(); } ) ); } @Override public float getAdjustedZ() { final float[] v = { getAdjustedZImpl() }; if( widgetMode && !super.isActive() ) { - forAll((final Shape gs) -> { + TreeTool.forAll(this, (final Shape gs) -> { if( gs.isActive() ) { v[0] = gs.getAdjustedZImpl(); return true; @@ -687,7 +687,7 @@ public class Group extends Shape implements Container { if( null == shape ) { return res; } - forOne(pmv, shape, () -> { + TreeTool.forOne(this, pmv, shape, () -> { shape.getBounds().transform(pmv.getMv(), res); }); return res; @@ -697,30 +697,5 @@ public class Group extends Shape implements Container { public String getSubString() { return super.getSubString()+", shapes "+shapes.size(); } - - @Override - public boolean forOne(final PMVMatrix4f pmv, final Shape shape, final Runnable action) { - return TreeTool.forOne(this, pmv, shape, action); - } - - @Override - public boolean forAll(final Visitor1 v) { - return TreeTool.forAll(this, v); - } - - @Override - public boolean forAll(final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forAll(this, pmv, v); - } - - @Override - public boolean forSortedAll(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forSortedAll(this, sortComp, pmv, v); - } - - @Override - public boolean forAllRendered(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forAllRendered(this, pmv, v); - } } diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java index 7f47b2d98..31c45359d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java @@ -378,7 +378,7 @@ public final class Scene implements Container, GLEventListener { public int setAAQuality(final int v) { return renderer.setAAQuality(v); /* markStatesDirty() -> autodetected within GLRegion.draw(..) */ } public void setSharpness(final float sharpness) { - forAll((final Shape s) -> { + TreeTool.forAll(this, (final Shape s) -> { if( s instanceof GraphShape ) { ((GraphShape)s).setSharpness(sharpness); } @@ -386,13 +386,13 @@ public final class Scene implements Container, GLEventListener { }); } public void markShapesDirty() { - forAll((final Shape s) -> { + TreeTool.forAll(this, (final Shape s) -> { s.markShapeDirty(); return false; }); } public void markStatesDirty() { - forAll((final Shape s) -> { + TreeTool.forAll(this, (final Shape s) -> { s.markStateDirty(); return false; }); @@ -783,7 +783,7 @@ public final class Scene implements Container, GLEventListener { } final Recti viewport = getViewport(); setupMatrix(pmv); - forOne(pmv, shape, () -> { + TreeTool.forOne(this, pmv, shape, () -> { if( null != shape.winToShapeCoord(pmv, viewport, glWinX, glWinY, objPos) ) { runnable.run(); } @@ -797,65 +797,13 @@ public final class Scene implements Container, GLEventListener { return res; } setupMatrix(pmv); - forOne(pmv, shape, () -> { + TreeTool.forOne(this, pmv, shape, () -> { shape.getBounds().transform(pmv.getMv(), res); }); return res; } /** - * Traverses through the graph up until {@code shape} and apply {@code action} on it. - * @param pmv {@link PMVMatrix4f}, which shall be properly initialized, e.g. via {@link Scene#setupMatrix(PMVMatrix4f)} - * @param shape - * @param action - * @return true to signal operation complete, i.e. {@code shape} found, otherwise false - */ - @Override - public boolean forOne(final PMVMatrix4f pmv, final Shape shape, final Runnable action) { - return TreeTool.forOne(this, pmv, shape, action); - } - - /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each, stop if it returns true. - * @param pmv {@link PMVMatrix4f}, which shall be properly initialized, e.g. via {@link Scene#setupMatrix(PMVMatrix4f)} - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false - */ - @Override - public boolean forAll(final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forAll(this, pmv, v); - } - - /** - * Traverses through the graph and apply {@link Visitor1#visit(Shape)} for each, stop if it returns true. - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor1#visit(Shape)} returned true, otherwise false - */ - @Override - public boolean forAll(final Visitor1 v) { - return TreeTool.forAll(this, v); - } - - /** - * Traverses through the graph and apply {@link Visitor2#visit(Shape, PMVMatrix4f)} for each, stop if it returns true. - * - * Each {@link Container} level is sorted using {@code sortComp} - * @param sortComp - * @param pmv - * @param v - * @return true to signal operation complete and to stop traversal, i.e. {@link Visitor2#visit(Shape, PMVMatrix4f)} returned true, otherwise false - */ - @Override - public boolean forSortedAll(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forSortedAll(this, sortComp, pmv, v); - } - - @Override - public boolean forAllRendered(final Comparator<Shape> sortComp, final PMVMatrix4f pmv, final Visitor2 v) { - return TreeTool.forAllRendered(this, pmv, v); - } - - /** * Interface providing {@link #set(PMVMatrix4f, Recti) a method} to * setup {@link PMVMatrix4f}'s {@link GLMatrixFunc#GL_PROJECTION} and {@link GLMatrixFunc#GL_MODELVIEW}. * <p> @@ -1272,7 +1220,7 @@ public final class Scene implements Container, GLEventListener { private void activateTooltipImpl(final GLAutoDrawable drawable, final PMVMatrix4f pmv, final Tooltip tt) { if( null == toolTipHUD.get() ) { final Shape[] hud = { null }; - if( tt.tick() && forOne(pmv, tt.getTool(), () -> { + if( tt.tick() && TreeTool.forOne(this, pmv, tt.getTool(), () -> { final AABBox toolMvBounds = tt.getToolMvBounds(pmv); hud[0] = tt.createTip(drawable, Scene.this, pmv, toolMvBounds); }) ) diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index 1527f0fd0..d7c91ed2f 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -124,6 +124,19 @@ public abstract class Shape { } /** + * {@link Shape} pointer listener, e.g. for {@link Shape#onClicked(PointerListener)} + */ + public static interface PointerListener { + /** + * Event callback + * @param s the associated {@link Shape} for this event + * @param pos relative object coordinates to the associated {@link Shape} + * @param e original Newt {@link MouseEvent} + */ + void run(Shape s, final Vec3f pos, MouseEvent e); + } + + /** * General {@link Shape} listener action */ public static interface Listener { @@ -257,12 +270,12 @@ public abstract class Shape { private static final int IO_RESIZABLE = 1 << 5; private static final int IO_RESIZE_FIXED_RATIO = 1 << 6; private static final int IO_ACTIVE = 1 << 7; - private static final int IO_DOWN = 1 << 8; - private static final int IO_TOGGLE = 1 << 9; - private static final int IO_DRAG_FIRST = 1 << 10; - private static final int IO_IN_MOVE = 1 << 11; - private static final int IO_IN_RESIZE_BR = 1 << 12; - private static final int IO_IN_RESIZE_BL = 1 << 13; + private static final int IO_DOWN = 1 << 26; + private static final int IO_TOGGLE = 1 << 27; + private static final int IO_DRAG_FIRST = 1 << 28; + private static final int IO_IN_MOVE = 1 << 29; + private static final int IO_IN_RESIZE_BR = 1 << 30; + private static final int IO_IN_RESIZE_BL = 1 << 31; private volatile int ioState = IO_DRAGGABLE | IO_RESIZABLE | IO_INTERACTIVE | IO_ACTIVABLE | IO_VISIBLE; private final boolean isIO(final int mask) { return mask == ( ioState & mask ); } private final Shape setIO(final int mask, final boolean v) { if( v ) { ioState |= mask; } else { ioState &= ~mask; } return this; } @@ -274,10 +287,11 @@ public abstract class Shape { private ArrayList<KeyListener> keyListeners = new ArrayList<KeyListener>(); private ListenerBool onInitListener = null; + private PointerListener onHoverListener = null; private MoveListener onMoveListener = null; private Listener onToggleListener = null; private ArrayList<Listener> activationListeners = new ArrayList<Listener>(); - private Listener onClickedListener = null; + private PointerListener onClickedListener = null; private final Vec2f objDraggedFirst = new Vec2f(); // b/c its relative to Shape and we stick to it private final int[] winDraggedLast = { 0, 0 }; // b/c its absolute window pos @@ -417,6 +431,7 @@ public abstract class Shape { onToggleListener = null; activationListeners.clear(); onClickedListener = null; + onHoverListener = null; markShapeDirty(); } @@ -442,19 +457,31 @@ public abstract class Shape { */ public final void onInit(final ListenerBool l) { onInitListener = l; } /** + * Set user callback to be notified when a pointer/mouse is moving over this shape + */ + public final void onHover(final PointerListener l) { onHoverListener = l; } + /** * Set user callback to be notified when shape is {@link #move(Vec3f)}'ed. */ public final void onMove(final MoveListener l) { onMoveListener = l; } /** * Set user callback to be notified when shape {@link #toggle()}'ed. * <p> - * This is usually the case when clicked, see {@link #onClicked(Listener)}. + * This is usually the case when clicked, see {@link #onClicked(PointerListener)}. * </p> * <p> * Use {@link #isToggleOn()} to retrieve the state. * </p> */ public final void onToggle(final Listener l) { onToggleListener = l; } + /** + * Set user callback to be notified when shape is clicked. + * <p> + * Usually shape is {@link #toggle()}'ed when clicked, see {@link #onToggle(Listener)}. + * However, in case shape is not {@link #isToggleable()} this is the last resort. + * </p> + */ + public final void onClicked(final PointerListener l) { onClickedListener = l; } /** * Add user callback to be notified when shape is activated (pointer-over and/or click) or de-activated (pointer left). @@ -493,15 +520,6 @@ public abstract class Shape { } } - /** - * Set user callback to be notified when shape is clicked. - * <p> - * Usually shape is {@link #toggle()}'ed when clicked, see {@link #onToggle(Listener)}. - * However, in case shape is not {@link #isToggleable()} this is the last resort. - * </p> - */ - public final void onClicked(final Listener l) { onClickedListener = l; } - /** Move to scaled position. Position ends up in PMVMatrix4f unmodified. No {@link MoveListener} notification will occur. */ public final Shape moveTo(final float tx, final float ty, final float tz) { position.set(tx, ty, tz); @@ -1505,13 +1523,13 @@ public abstract class Shape { } else { rotateS = ""; } - final String activeS = isIO(IO_ACTIVE) ? ", active" : ""; + final String activeS = ", active["+(isIO(IO_ACTIVE) ? "SELF," : "")+(isGroup() && isActive()?"GROUP":"")+"]"; final String ps = hasPadding() ? padding.toString()+", " : ""; final String bs = hasBorder() ? "border[l "+getBorderThickness()+", c "+getBorderColor()+"], " : ""; final String idS = -1 != id ? ", id "+id : ""; final String nameS = "noname" != name ? ", '"+name+"'" : ""; return getDirtyString()+idS+nameS+", visible "+isIO(IO_VISIBLE)+activeS+", toggle "+isIO(IO_TOGGLE)+ - ", able[toggle "+isIO(IO_TOGGLEABLE)+", iactive "+isInteractive()+", resize "+isResizable()+", move "+this.isDraggable()+ + ", able[toggle "+isIO(IO_TOGGLEABLE)+", iactive "+isInteractive()+", resize "+isResizable()+", drag "+this.isDraggable()+ "], pos["+position+"], "+pivotS+scaleS+rotateS+iMatS+ ps+bs+"box"+box; } @@ -1671,7 +1689,7 @@ public abstract class Shape { * @see #isVisible() * @see #setDraggable(boolean) * @see #setResizable(boolean) - * @see #setDragAndResizeable(boolean) + * @see #setDragAndResizable(boolean) */ public final Shape setInteractive(final boolean v) { return setIO(IO_INTERACTIVE, v); } /** @@ -1702,7 +1720,7 @@ public abstract class Shape { * @see #isDraggable() * @see #setInteractive(boolean) * @see #setResizable(boolean) - * @see #setDragAndResizeable(boolean) + * @see #setDragAndResizable(boolean) */ public final Shape setDraggable(final boolean draggable) { return setIO(IO_DRAGGABLE, draggable); } /** @@ -1720,12 +1738,12 @@ public abstract class Shape { * @see #isResizable() * @see #setInteractive(boolean) * @see #setDraggable(boolean) - * @see #setDragAndResizeable(boolean) + * @see #setDragAndResizable(boolean) */ public final Shape setResizable(final boolean resizable) { return setIO(IO_RESIZABLE, resizable); } /** - * Returns if this shape is resiable, a user interaction. + * Returns if this shape is resizable, a user interaction. * @see #setResizable(boolean) */ public final boolean isResizable() { return isIO(IO_RESIZABLE); } @@ -1754,7 +1772,7 @@ public abstract class Shape { * @see #setDraggable(boolean) * @see #setResizable(boolean) */ - public final Shape setDragAndResizeable(final boolean v) { + public final Shape setDragAndResizable(final boolean v) { setDraggable(v); setResizable(v); return this; diff --git a/src/graphui/classes/com/jogamp/graph/ui/TooltipShape.java b/src/graphui/classes/com/jogamp/graph/ui/TooltipShape.java index e627d671f..f8152635d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/TooltipShape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/TooltipShape.java @@ -43,6 +43,8 @@ import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.texture.TextureSequence; +import jogamp.graph.ui.TreeTool; + /** A HUD {@link Shape} {@link Tooltip} for {@link Shape}, see {@link Shape#setToolTip(Tooltip)}. */ public class TooltipShape extends Tooltip { /** @@ -169,7 +171,7 @@ public class TooltipShape extends Tooltip { final Group tipWrapper = (Group)tipGroup.getShapeByIdx(1); if( null == tipWrapper.removeShape(tip) ) { System.err.println("TooltipShape.destroyTip: Warning: Tip "+tip.getName()+" not contained in "+tipWrapper.getName()+"; Internal Group: "); - tipGroup.forAll((final Shape s) -> { + TreeTool.forAll(tipGroup, (final Shape s) -> { System.err.println("- "+s.getName()); return false; }); diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java index 0a501f3db..486ba8067 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java @@ -149,14 +149,11 @@ public class Button extends BaseButton { @Override protected void toggleNotify(final boolean on) { - int i=0; if( null != labelOn ) { if( on ) { labelNow = labelOn; - i = 1; } else { labelNow = labelOff; - i = -1; } markShapeDirty(); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java index 89d598d4e..3ba2a039a 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java @@ -146,7 +146,7 @@ public class MediaButton extends TexSeqButton { setSubtitleColor(DEFAULT_ASS_SUB_COLOR, DEFAULT_ASS_SUB_BLEND); this.subTexImg = new ImageButton(renderModes, width, height, new ImageSequence(mPlayer.getTextureUnit(), true /* useBuildInTexLookup */)); - this.subTexImg.setPerp().setToggleable(false).setDragAndResizeable(false).setInteractive(false); + this.subTexImg.setPerp().setToggleable(false).setDragAndResizable(false).setInteractive(false); // this.subTexImg.setBorder(0.001f).setBorderColor(1, 1, 0, 1); this.subTexImg.getImageSequence().setParams(GL.GL_LINEAR, GL.GL_LINEAR, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE); this.subTexImg.setARatioAdjustment(false); diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java index fd4cd726f..ce810b3ef 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java +++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java @@ -27,6 +27,7 @@ */ package com.jogamp.graph.ui.widgets; +import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.concurrent.atomic.AtomicReference; @@ -52,7 +53,7 @@ import com.jogamp.graph.ui.shapes.Button; import com.jogamp.graph.ui.shapes.Label; import com.jogamp.graph.ui.shapes.MediaButton; import com.jogamp.graph.ui.shapes.Rectangle; -import com.jogamp.graph.ui.widgets.RangeSlider.SliderAdapter; +import com.jogamp.graph.ui.widgets.RangeSlider.SliderListener; import com.jogamp.math.FloatUtil; import com.jogamp.math.Vec2f; import com.jogamp.math.Vec3f; @@ -70,6 +71,8 @@ import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener; import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException; import com.jogamp.opengl.util.texture.TextureSequence; +import jogamp.graph.ui.TreeTool; + /** * Media player {@link Widget}, embedding a {@link MediaButton} and its controls. * @see #MediaPlayer(int, Scene, GLMediaPlayer, Uri, int, float, boolean, float, List) @@ -620,7 +623,7 @@ public class MediaPlayer extends Widget { mButton.setPressedColorMod(1f, 1f, 1f, 0.85f); } } ); - this.forAll((final Shape s) -> { s.setDraggable(false).setResizable(false); return false; }); + TreeTool.forAll(this, (final Shape s) -> { s.setDraggable(false).setResizable(false); return false; }); ctrlSlider.getKnob().setDraggable(true); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java index 0970c6c4e..b2693da3d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java +++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java @@ -62,12 +62,6 @@ public final class RangeSlider extends Widget { * {@link RangeSlider} slider listener */ public static interface SliderListener { - /** Slider clicked by user (after completing pressed + released). */ - void clicked(RangeSlider w, final MouseEvent e); - /** Slider pressed down by user. */ - void pressed(RangeSlider w, final MouseEvent e); - /** Slider released down by user. */ - void released(RangeSlider w, final MouseEvent e); /** * Slide dragged by user (including clicked position) * @param w the {@link RangeSlider} widget owning the slider @@ -78,16 +72,6 @@ public final class RangeSlider extends Widget { */ void dragged(RangeSlider w, float old_val, float val, float old_val_pct, float val_pct); } - public static abstract class SliderAdapter implements SliderListener { - @Override - public void clicked(final RangeSlider w, final MouseEvent e) { } - @Override - public void pressed(final RangeSlider w, final MouseEvent e) { } - @Override - public void released(final RangeSlider w, final MouseEvent e) { } - @Override - public void dragged(final RangeSlider w, final float old_val, final float val, final float old_val_pct, final float val_pct) { } - }; private static interface SliderAction { public void run(SliderListener l); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java index 307b66863..4be829048 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java +++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java @@ -34,7 +34,7 @@ import com.jogamp.graph.ui.Group; import com.jogamp.graph.ui.Shape; import com.jogamp.graph.ui.layout.Alignment; import com.jogamp.graph.ui.layout.GridLayout; -import com.jogamp.graph.ui.widgets.RangeSlider.SliderAdapter; +import com.jogamp.graph.ui.widgets.RangeSlider.SliderListener; import com.jogamp.math.Vec2f; import com.jogamp.math.Vec3f; import com.jogamp.math.Vec4f; @@ -104,7 +104,7 @@ public class RangedGroup extends Widget { horizSlider = new RangeSlider(renderModes, horizSliderParam.size, new Vec2f(0, content.getBounds().getWidth()), horizSliderParam.unitSize, contentSize.x(), 0).setInverted(horizSliderParam.inverted); addShape(horizSlider); - horizSlider.addSliderListener( new SliderAdapter() { + horizSlider.addSliderListener( new SliderListener() { @Override public void dragged(final RangeSlider w, final float old_val, final float val, final float old_val_pct, final float val_pct) { final Vec3f oldPos = content.getPosition(); @@ -122,7 +122,7 @@ public class RangedGroup extends Widget { vertSlider = new RangeSlider(renderModes, vertSliderParam.size, new Vec2f(0, content.getBounds().getHeight()), vertSliderParam.unitSize, contentSize.y(), 0).setInverted(vertSliderParam.inverted); addShape(vertSlider); - vertSlider.addSliderListener( new SliderAdapter() { + vertSlider.addSliderListener( new SliderListener() { @Override public void dragged(final RangeSlider w, final float old_val, final float val, final float old_val_pct, final float val_pct) { final Vec3f oldPos = content.getPosition(); |