Package com.jogamp.graph.ui.shapes
Class Button
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.GraphShape
-
- com.jogamp.graph.ui.shapes.BaseButton
-
- com.jogamp.graph.ui.shapes.Button
-
public class Button extends BaseButton
A GraphUI text labeledBaseButtonGraphShapeGraphUI is GPU based and resolution independent.
This button is rendered with a round oval shape. To render it rectangular,
BaseButton.setCorner(float)to zero.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.EventInfo, Shape.Listener, Shape.ListenerBool, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_SPACING_X0.11999999731779099fstatic floatDEFAULT_SPACING_Y0.41999998688697815f-
Fields inherited from class com.jogamp.graph.ui.shapes.BaseButton
PERP_CORNER, ROUND_CORNER
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount)Renders the shape.FontgetFont()Vec4fgetLabelColor()floatgetLabelZOffset()StringgetLaben()floatgetSpacingX()floatgetSpacingY()StringgetSubString()ButtonsetFont(Font labelFont)ButtonsetLabel(Font labelFont, String labelText)ButtonsetLabel(String labelText)ButtonsetLabelColor(float r, float g, float b)ButtonsetLabelZOffset(float v)ButtonsetSpacing(float spacingX, float spacingY)In percent of text label-
Methods inherited from class com.jogamp.graph.ui.shapes.BaseButton
getCorner, getHeight, getWidth, setCorner, setSize
-
Methods inherited from class com.jogamp.graph.ui.GraphShape
getQuality, getRenderModes, getSharpness, hasColorChannel, setQuality, setSharpness, setTextureUnit
-
Methods inherited from class com.jogamp.graph.ui.Shape
addMouseListener, clear, destroy, drawToSelect, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getName, getPadding, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getRotation, getRotationPivot, getScale, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, hasBorder, hasPadding, isDraggable, isEnabled, isInteractive, isPressed, isResizable, isToggleable, isToggleOn, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onInit, onMove, onToggle, removeMouseListener, scale, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDragAndResizeable, setDraggable, setEnabled, setInteractive, setName, setPaddding, setPressed, setPressedColorMod, setResizable, setRotationPivot, setRotationPivot, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setTransform, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Field Detail
-
DEFAULT_SPACING_X
public static final float DEFAULT_SPACING_X
0.11999999731779099f- See Also:
- Constant Field Values
-
DEFAULT_SPACING_Y
public static final float DEFAULT_SPACING_Y
0.41999998688697815f- See Also:
- Constant Field Values
-
-
Method Detail
-
getFont
public Font getFont()
-
getLaben
public String getLaben()
-
draw
public void draw(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount)
Description copied from class:ShapeRenders the shape.Shape.setTransform(PMVMatrix)is expected to be completed beforehand.- Overrides:
drawin classShape- Parameters:
gl- the current GL objectrenderer-RegionRendererwhich might be used for Graph Curve Rendering, also source ofRegionRenderer.getMatrix()andRegionRenderer.getViewport().sampleCount- sample count if used by Graph renderModes
-
getLabelZOffset
public float getLabelZOffset()
-
setLabelZOffset
public Button setLabelZOffset(float v)
-
getSpacingX
public final float getSpacingX()
-
getSpacingY
public final float getSpacingY()
-
setSpacing
public final Button setSpacing(float spacingX, float spacingY)
In percent of text label- Parameters:
spacingX- spacing in percent on X, default isDEFAULT_SPACING_XspacingY- spacing in percent on Y, default isDEFAULT_SPACING_Y
-
getLabelColor
public final Vec4f getLabelColor()
-
setLabelColor
public final Button setLabelColor(float r, float g, float b)
-
getSubString
public String getSubString()
- Overrides:
getSubStringin classBaseButton
-
-