Class RangeSlider
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
- com.jogamp.graph.ui.widgets.Widget
-
- com.jogamp.graph.ui.widgets.RangeSlider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RangeSlider.ChangeListener
RangeSlider
slider value changed listenerstatic interface
RangeSlider.PeekListener
RangeSlider
slider value peek listener-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Group
Group.Layout
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description RangeSlider(int renderModes, com.jogamp.math.Vec2f size, float knobScale, com.jogamp.math.Vec2f minMax, float unitSize, float value)
Constructs aRangeSlider
, i.e.RangeSlider(int renderModes, com.jogamp.math.Vec2f size, com.jogamp.math.Vec2f minMax, float unitSize, float pageSize, float value)
Constructs aRangeSlider
, i.e.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RangeSlider
addChangeListener(RangeSlider.ChangeListener l)
Shape
addMark(float value, com.jogamp.math.Vec4f color)
RangeSlider
addPeekListener(RangeSlider.PeekListener l)
RangeSlider
clearMarks(GL2ES2 gl, RegionRenderer renderer)
Rectangle
getBar()
String
getDescription()
Return string description of current slider setting.GraphShape
getKnob()
float
getKnobLength()
Returns spatial knob length in sliding directionfloat
getKnobThickness()
Returns spatial knob thickness orthogonal to sliding directionGroup
getMarks()
com.jogamp.math.Vec2f
getMinMax()
Returns slider value range, seesetMinMax(Vec2f, float)
float
getPageSize()
Returns the page-size if a rectangular knob is being used, i.e.float
getPageSizePct(float minPct)
Returns the page-size percentage if a rectangular knob is being used, i.e.float
getRange()
ReturnsgetMinMax()
range.com.jogamp.math.Vec2f
getSize()
Returns spatial dimension of this sliderString
getSubString()
float
getUnitSize()
Returns the size of one unit (element) in sliding directionfloat
getValue()
Returns current slider valuefloat
getValuePct()
Returns current slidervalue
in percentage ofgetRange()
,boolean
isInverted()
SeesetInverted(boolean)
.void
receiveKeyEvents(Shape source)
void
receiveMouseEvents(Shape source)
ForwardShape.MouseGestureListener
events to thisShape
fromsource
using aShape.ForwardMouseListener
.RangeSlider
removeChangeListener(RangeSlider.ChangeListener l)
RangeSlider
removePeekListener(RangeSlider.PeekListener l)
Shape
setActiveKnobColorMod(com.jogamp.math.Vec4f c)
Sets the knob active modulation colorShape
setBackgroundBarColor(float r, float g, float b, float a)
Sets the slider background bar color, if this slider comprises only a positional round knob.Shape
setBackgroundBarColor(com.jogamp.math.Vec4f c)
Sets the slider background bar color, if this slider comprises only a positional round knob.Shape
setColor(float r, float g, float b, float a)
Sets the slider knob color.Shape
setColor(com.jogamp.math.Vec4f c)
Sets the slider knob color.RangeSlider
setInverted(boolean v)
Sets whether this slider uses an inverted value range, e.g.RangeSlider
setMinMax(com.jogamp.math.Vec2f minMax)
Sets slider value range, also updates related pageSize parameter if used.RangeSlider
setMinMax(com.jogamp.math.Vec2f minMax, float value)
Sets slider value range and current value, also updates related pageSize parameter if used.RangeSlider
setMinMaxPgSz(com.jogamp.math.Vec2f minMax, float pageSz)
CallssetMinMax(Vec2f, float)
andsetPageSize(float)
.RangeSlider
setMinMaxPgSz(com.jogamp.math.Vec2f minMax, float value, float pageSz)
CallssetMinMax(Vec2f, float)
andsetPageSize(float)
.RangeSlider
setPageSize(float pageSz)
Sets the page-size if a rectangular knob is being used, i.e.Shape
setPressedColorMod(float r, float g, float b, float a)
Set pressed color, modulatingShape.getColor()
ifShape.isPressed()
.RangeSlider
setUnitSize(float v)
Sets the size of one unit (element) in sliding directionRangeSlider
setValue(float v)
Sets slider value-
Methods inherited from class com.jogamp.graph.ui.Group
addShape, addShapes, contains, disableTopLevelWidget, enableTopLevelWidget, getBounds, getClipMvFrustum, getClipOnBounds, getFixedSize, getFixedSize, getLayout, getRelayoutOnDirtyShapes, getRenderedShapes, getShapeByID, getShapeByIdx, getShapeByName, getShapeCount, getShapes, hasColorChannel, isCullingEnabled, isGroup, isOutside, isOutside2, isPMvCullingEnabled, isTopLevelWidget, removeAllShapes, removeShape, removeShape, removeShapes, removeShapes, replaceShape, setClipMvFrustum, setClipOnBounds, setFixedSize, setFixedSize, setLayout, setPMvCullingEnabled, setRelayoutOnDirtyShapes
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Constructor Detail
-
RangeSlider
public RangeSlider(int renderModes, com.jogamp.math.Vec2f size, float knobScale, com.jogamp.math.Vec2f minMax, float unitSize, float value)
Constructs aRangeSlider
, i.e. its shapes and controls.This slider comprises a background bar and a positional round knob, with
getValue()
at center position.The spatial
size
gets automatically updated atShape.validate(GL2ES2)
- Parameters:
renderModes
- Graph'sRegion
render modes, seecreate(..)
.size
- spatial dimension of this slider box. A horizontal slider has width >= height.knobScale
- multiple of slider-bar height forgetKnobThickness()
minMax
- minimum- and maximum-value of sliderunitSize
- size of one unit (element) in sliding directionvalue
- current value of slider
-
RangeSlider
public RangeSlider(int renderModes, com.jogamp.math.Vec2f size, com.jogamp.math.Vec2f minMax, float unitSize, float pageSize, float value)
Constructs aRangeSlider
, i.e. its shapes and controls.This slider comprises a framing bar and a rectangular page-sized knob, with
getValue()
at page-start position.The spatial
size
andpageSize
gets automatically updated atShape.validate(GL2ES2)
- Parameters:
renderModes
- Graph'sRegion
render modes, seecreate(..)
.size
- spatial dimension of this slider box. A horizontal slider has width >= height.minMax
- minimum- and maximum-value of sliderunitSize
- size of one unit (element) in sliding directionpageSize
- size of one virtual-page, triggers rendering mode from knob to rectanglevalue
- current value of slider
-
-
Method Detail
-
receiveKeyEvents
public void receiveKeyEvents(Shape source)
Description copied from class:Shape
ForwardKeyListener
events to thisShape
fromsource
using aShape.ForwardKeyListener
.This source
Shape
must beShape.setInteractive(boolean)
to receive and forward the events.This receiver
Shape
must beShape.setInteractive(boolean)
to have the events forwarded.- Overrides:
receiveKeyEvents
in classShape
- See Also:
Shape.receiveMouseEvents(Shape)
-
receiveMouseEvents
public void receiveMouseEvents(Shape source)
Description copied from class:Shape
ForwardShape.MouseGestureListener
events to thisShape
fromsource
using aShape.ForwardMouseListener
.This source
Shape
must beShape.setInteractive(boolean)
to receive and forward the events.This receiver
Shape
must beShape.setInteractive(boolean)
to have the events forwarded.- Overrides:
receiveMouseEvents
in classShape
- See Also:
Shape.receiveKeyEvents(Shape)
-
addChangeListener
public final RangeSlider addChangeListener(RangeSlider.ChangeListener l)
-
removeChangeListener
public final RangeSlider removeChangeListener(RangeSlider.ChangeListener l)
-
addPeekListener
public final RangeSlider addPeekListener(RangeSlider.PeekListener l)
-
removePeekListener
public final RangeSlider removePeekListener(RangeSlider.PeekListener l)
-
getBar
public Rectangle getBar()
-
getKnob
public GraphShape getKnob()
-
getMarks
public Group getMarks()
-
clearMarks
public RangeSlider clearMarks(GL2ES2 gl, RegionRenderer renderer)
-
addMark
public Shape addMark(float value, com.jogamp.math.Vec4f color)
-
getSize
public final com.jogamp.math.Vec2f getSize()
Returns spatial dimension of this slider
-
getKnobThickness
public final float getKnobThickness()
Returns spatial knob thickness orthogonal to sliding direction
-
getKnobLength
public final float getKnobLength()
Returns spatial knob length in sliding direction
-
getMinMax
public com.jogamp.math.Vec2f getMinMax()
Returns slider value range, seesetMinMax(Vec2f, float)
-
getRange
public float getRange()
ReturnsgetMinMax()
range.
-
getValue
public float getValue()
Returns current slider value
-
getValuePct
public float getValuePct()
Returns current slidervalue
in percentage ofgetRange()
,
-
setPageSize
public RangeSlider setPageSize(float pageSz)
Sets the page-size if a rectangular knob is being used, i.e.RangeSlider(int, Vec2f, Vec2f, float, float, float)
, otherwise does nothing.- Parameters:
pageSz
- the page-size, which will be clipped togetMinMax()
.- Returns:
- this instance of chaining
- See Also:
getPageSize()
,RangeSlider(int, Vec2f, Vec2f, float, float, float)
-
getPageSize
public float getPageSize()
Returns the page-size if a rectangular knob is being used, i.e.RangeSlider(int, Vec2f, Vec2f, float, float, float)
, otherwise returnsFloat.NaN
.
-
getPageSizePct
public float getPageSizePct(float minPct)
Returns the page-size percentage if a rectangular knob is being used, i.e.RangeSlider(int, Vec2f, Vec2f, float, float, float)
, otherwise returnsFloat.NaN
.- Parameters:
minPct
- minimum percentage to be returned, should be >= 0- See Also:
setPageSize(float)
,RangeSlider(int, Vec2f, Vec2f, float, float, float)
-
setUnitSize
public RangeSlider setUnitSize(float v)
Sets the size of one unit (element) in sliding direction
-
getUnitSize
public float getUnitSize()
Returns the size of one unit (element) in sliding direction
-
setInverted
public RangeSlider setInverted(boolean v)
Sets whether this slider uses an inverted value range, e.g. top 0% and bottom 100% for an vertical inverted slider instead of bottom 0% and top 100% for a vertical non-inverted slider.
-
isInverted
public boolean isInverted()
SeesetInverted(boolean)
.
-
setMinMax
public RangeSlider setMinMax(com.jogamp.math.Vec2f minMax, float value)
Sets slider value range and current value, also updates related pageSize parameter if used.- Parameters:
minMax
- minimum- and maximum-value of slidervalue
- new value of slider, clipped againstgetMinMax()
- Returns:
- this instance of chaining
-
setMinMax
public RangeSlider setMinMax(com.jogamp.math.Vec2f minMax)
Sets slider value range, also updates related pageSize parameter if used.- Parameters:
minMax
- minimum- and maximum-value of slider- Returns:
- this instance of chaining
-
setMinMaxPgSz
public RangeSlider setMinMaxPgSz(com.jogamp.math.Vec2f minMax, float value, float pageSz)
CallssetMinMax(Vec2f, float)
andsetPageSize(float)
.- Parameters:
minMax
- minimum- and maximum-value of slidervalue
- new value of slider, clipped againstminMax
pageSz
- the page-size, which will be clipped tominMax
- Returns:
- this instance of chaining
-
setMinMaxPgSz
public RangeSlider setMinMaxPgSz(com.jogamp.math.Vec2f minMax, float pageSz)
CallssetMinMax(Vec2f, float)
andsetPageSize(float)
.- Parameters:
minMax
- minimum- and maximum-value of sliderpageSz
- the page-size, which will be clipped tominMax
- Returns:
- this instance of chaining
-
setValue
public RangeSlider setValue(float v)
Sets slider value- Parameters:
v
- new value of slider, clipped againstgetMinMax()
- Returns:
- this instance of chaining
-
setColor
public final Shape setColor(float r, float g, float b, float a)
Sets the slider knob color.If this slider comprises a rectangular page-sized knob, its rectangular frame also shares the same color with alpha 1.0f.
Base color w/o color channel, will be modulated w/ pressed- and toggle color
Default RGBA value is 0.80f, 0.80f, 0.80f, 0.7f
- Overrides:
setColor
in classShape
- See Also:
Shape.markShapeDirty()
-
setColor
public Shape setColor(com.jogamp.math.Vec4f c)
Sets the slider knob color.If this slider comprises a rectangular page-sized knob, its rectangular frame also shares the same color with alpha 1.0f.
Base color w/o color channel, will be modulated w/ pressed- and toggle color
Default RGBA value is 0.80f, 0.80f, 0.80f, 0.7f
- Overrides:
setColor
in classShape
- See Also:
Shape.markShapeDirty()
-
setActiveKnobColorMod
public Shape setActiveKnobColorMod(com.jogamp.math.Vec4f c)
Sets the knob active modulation colorDefault RGBA value is 0.1f, 0.1f, 0.1f, 1f
-
setBackgroundBarColor
public Shape setBackgroundBarColor(float r, float g, float b, float a)
Sets the slider background bar color, if this slider comprises only a positional round knob.Default RGBA value is 0.60f, 0.60f, 0.60f, 0.5f
-
setBackgroundBarColor
public Shape setBackgroundBarColor(com.jogamp.math.Vec4f c)
Sets the slider background bar color, if this slider comprises only a positional round knob.Default RGBA value is 0.60f, 0.60f, 0.60f, 0.5f
-
setPressedColorMod
public final Shape setPressedColorMod(float r, float g, float b, float a)
Set pressed color, modulatingShape.getColor()
ifShape.isPressed()
.Default pressed color, modulation -factor w/o color channel, modulated base-color. ~0.65 (due to alpha)
Default RGBA value is 0.70f, 0.70f, 0.70f, 0.8f
Sets the slider bar and knob pressed color modulation.
- Overrides:
setPressedColorMod
in classShape
-
getDescription
public String getDescription()
Return string description of current slider setting.
-
getSubString
public String getSubString()
- Overrides:
getSubString
in classGroup
-
-