Package heronarts.glx.ui.component
Class UILabel
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.component.UILabel
- All Implemented Interfaces:
LXLoopTask
- Direct Known Subclasses:
UIComponentLabel
,UILabel.Control
,UILabel.Copyable
,UIParameterLabel
A simple text label object. Draws a string aligned top-left to its x-y
position.
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder
-
Field Summary
Fields inherited from class heronarts.glx.ui.UI2dComponent
debug, debugName, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionObjects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.getLabel()
protected void
Subclasses should override this method to perform their drawing functions.setBreakLines
(boolean breakLines) Sets the label to render text multi-linesetBreakLines
(boolean breakLines, boolean autoHeight) Sets the label to render text multi-linesetPadding
(int padding) Sets padding on all 4 sidessetPadding
(int topBottom, int leftRight) Sets padding on top and sides, CSS stylesetPadding
(int topPadding, int rightPadding, int bottomPadding, int leftPadding) Sets padding on all 4 sidesMethods inherited from class heronarts.glx.ui.UI2dComponent
addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getMappableParameter, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, removeFromContainer, setBackground, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBorderColor, setBorderRounding, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setContainerPosition, setDebug, setDebug, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusBackgroundColor, setFocusColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY, vgRoundedRect, vgRoundedRect, vgRoundedRect
Methods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, blur, bringToFront, dispose, focus, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, toggleVisible, toString
Methods inherited from class heronarts.glx.ui.UIEventHandler
onKeyPressed, onKeyReleased, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleased, onMouseScroll
-
Field Details
-
DEFAULT_HEIGHT
public static final float DEFAULT_HEIGHT- See Also:
-
-
Constructor Details
-
UILabel
public UILabel() -
UILabel
-
UILabel
-
UILabel
-
UILabel
public UILabel(float x, float y, float w, float h) -
UILabel
-
-
Method Details
-
setBreakLines
Sets the label to render text multi-line- Parameters:
breakLines
- Whether to break lines- Returns:
- this
-
setBreakLines
Sets the label to render text multi-line- Parameters:
breakLines
- Whether to break linesautoHeight
- Whether to automatically set height- Returns:
- this
-
setPadding
Sets padding on all 4 sides- Parameters:
padding
- Padding- Returns:
- this
-
setPadding
Sets padding on top and sides, CSS style- Parameters:
topBottom
- Top bottom paddingleftRight
- Left right padding- Returns:
- this
-
setPadding
Sets padding on all 4 sides- Parameters:
topPadding
- Top paddingrightPadding
- Right paddingbottomPadding
- Bottom paddingleftPadding
- Left padding- Returns:
- this
-
onDraw
Description copied from class:UI2dComponent
Subclasses should override this method to perform their drawing functions.- Overrides:
onDraw
in classUI2dComponent
- Parameters:
ui
- UI contextvg
- Graphics context
-
getLabel
-
setLabel
-
getDescription
Description copied from class:UIObject
Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component. If no help is available, return null rather than an empty String.- Overrides:
getDescription
in classUIObject
- Returns:
- Helpful contextual string explaining function of this element
-