diff options
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java | 18 |
1 files changed, 15 insertions, 3 deletions
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 ab57cc5d7..a11700287 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java +++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangeSlider.java @@ -146,7 +146,6 @@ public final class RangeSlider extends Widget { } private RangeSlider(final int renderModes_, final Vec2f size, final float knobScale, final Vec2f minMax, final float unitSize, final float pageSz, final float value) { - // final int renderModes = ( renderModes_ & ~Region.AA_RENDERING_MASK ) | Region.COLORCHANNEL_RENDERING_BIT; final int renderModes = renderModes_ & ~(Region.AA_RENDERING_MASK | Region.COLORCHANNEL_RENDERING_BIT); this.unitSize = unitSize; this.pageSize = pageSz; @@ -179,14 +178,14 @@ public final class RangeSlider extends Widget { barLineWidth = ( size.y() - height ) * pageBarLineScale; knobLength = width; knobHeight = height; - setPaddding(new Padding(size.y(), 0, size.y(), 0)); + setPaddding(new Padding(size.y()/2f, 0, size.y()/2f, 0)); } else { width = size.x() * pageKnobScale; height = pageSizePct * this.size.y(); barLineWidth = ( size.x() - width ) * pageBarLineScale; knobLength = height; knobHeight = width; - setPaddding(new Padding(0, size.x(), 0, size.x())); + setPaddding(new Padding(0, size.x()/2f, 0, size.x()/2f)); // System.err.println("ZZZ minMax "+minMax+", pageSize "+pageSize+" "+(pageSizePct*100f)+"% -> "+knobHeight+"/"+this.size.y()); } bar = new Rectangle(renderModes, this.size.x(), this.size.y(), barLineWidth); @@ -362,6 +361,19 @@ public final class RangeSlider extends Widget { } @Override + public void receiveKeyEvents(final Shape source) { + source.addKeyListener(new Shape.ForwardKeyListener(barAndKnob)); + source.addKeyListener(new Shape.ForwardKeyListener(knob)); + } + @Override + public void receiveMouseEvents(final Shape source) { + source.addMouseListener(new Shape.ForwardMouseListener(barAndKnob) { + @Override + public void mouseClicked(final MouseEvent e) { /* nop */ } + }); + } + + @Override protected void clearImpl0(final GL2ES2 gl, final RegionRenderer renderer) { super.clearImpl0(gl, renderer); sliderListeners.clear(); |