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 interfaceRangeSlider.ChangeListenerRangeSliderslider value changed listenerstatic interfaceRangeSlider.PeekListenerRangeSliderslider 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 RangeSlideraddChangeListener(RangeSlider.ChangeListener l)ShapeaddMark(float value, com.jogamp.math.Vec4f color)RangeSlideraddPeekListener(RangeSlider.PeekListener l)RangeSliderclearMarks(GL2ES2 gl, RegionRenderer renderer)RectanglegetBar()StringgetDescription()Return string description of current slider setting.GraphShapegetKnob()floatgetKnobLength()Returns spatial knob length in sliding directionfloatgetKnobThickness()Returns spatial knob thickness orthogonal to sliding directionGroupgetMarks()com.jogamp.math.Vec2fgetMinMax()Returns slider value range, seesetMinMax(Vec2f, float)floatgetPageSize()Returns the page-size if a rectangular knob is being used, i.e.floatgetPageSizePct(float minPct)Returns the page-size percentage if a rectangular knob is being used, i.e.floatgetRange()ReturnsgetMinMax()range.com.jogamp.math.Vec2fgetSize()Returns spatial dimension of this sliderStringgetSubString()floatgetUnitSize()Returns the size of one unit (element) in sliding directionfloatgetValue()Returns current slider valuefloatgetValuePct()Returns current slidervaluein percentage ofgetRange(),booleanisInverted()SeesetInverted(boolean).voidreceiveKeyEvents(Shape source)voidreceiveMouseEvents(Shape source)ForwardShape.MouseGestureListenerevents to thisShapefromsourceusing aShape.ForwardMouseListener.RangeSliderremoveChangeListener(RangeSlider.ChangeListener l)RangeSliderremovePeekListener(RangeSlider.PeekListener l)ShapesetActiveKnobColorMod(com.jogamp.math.Vec4f c)Sets the knob active modulation colorShapesetBackgroundBarColor(float r, float g, float b, float a)Sets the slider background bar color, if this slider comprises only a positional round knob.ShapesetBackgroundBarColor(com.jogamp.math.Vec4f c)Sets the slider background bar color, if this slider comprises only a positional round knob.ShapesetColor(float r, float g, float b, float a)Sets the slider knob color.ShapesetColor(com.jogamp.math.Vec4f c)Sets the slider knob color.RangeSlidersetInverted(boolean v)Sets whether this slider uses an inverted value range, e.g.RangeSlidersetMinMax(com.jogamp.math.Vec2f minMax)Sets slider value range, also updates related pageSize parameter if used.RangeSlidersetMinMax(com.jogamp.math.Vec2f minMax, float value)Sets slider value range and current value, also updates related pageSize parameter if used.RangeSlidersetMinMaxPgSz(com.jogamp.math.Vec2f minMax, float pageSz)CallssetMinMax(Vec2f, float)andsetPageSize(float).RangeSlidersetMinMaxPgSz(com.jogamp.math.Vec2f minMax, float value, float pageSz)CallssetMinMax(Vec2f, float)andsetPageSize(float).RangeSlidersetPageSize(float pageSz)Sets the page-size if a rectangular knob is being used, i.e.ShapesetPressedColorMod(float r, float g, float b, float a)Set pressed color, modulatingShape.getColor()ifShape.isPressed().RangeSlidersetUnitSize(float v)Sets the size of one unit (element) in sliding directionRangeSlidersetValue(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
sizegets automatically updated atShape.validate(GL2ES2)- Parameters:
renderModes- Graph'sRegionrender 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
sizeandpageSizegets automatically updated atShape.validate(GL2ES2)- Parameters:
renderModes- Graph'sRegionrender 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:ShapeForwardKeyListenerevents to thisShapefromsourceusing aShape.ForwardKeyListener.This source
Shapemust beShape.setInteractive(boolean)to receive and forward the events.This receiver
Shapemust beShape.setInteractive(boolean)to have the events forwarded.- Overrides:
receiveKeyEventsin classShape- See Also:
Shape.receiveMouseEvents(Shape)
-
receiveMouseEvents
public void receiveMouseEvents(Shape source)
Description copied from class:ShapeForwardShape.MouseGestureListenerevents to thisShapefromsourceusing aShape.ForwardMouseListener.This source
Shapemust beShape.setInteractive(boolean)to receive and forward the events.This receiver
Shapemust beShape.setInteractive(boolean)to have the events forwarded.- Overrides:
receiveMouseEventsin 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 slidervaluein 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 againstminMaxpageSz- 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:
setColorin 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:
setColorin 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:
setPressedColorModin classShape
-
getDescription
public String getDescription()
Return string description of current slider setting.
-
getSubString
public String getSubString()
- Overrides:
getSubStringin classGroup
-
-