Record Class TextFragmentWidget
java.lang.Object
java.lang.Record
dev.pfaff.altargui.widgets.TextFragmentWidget
- Record Components:
color
- text colorRgba (ARGB)flags
-StyleFlags
- All Implemented Interfaces:
Widget
,TextWidget
public record TextFragmentWidget(CharProvider characters, @NonNull Font font, int color, int flags, Value<Float> fontSize)
extends Record
implements TextWidget
A widget that displays a segment of uniformly-styled text.
-
Field Summary
Fields inherited from interface dev.pfaff.altargui.widgets.TextWidget
DEFAULT_SCALED_FONT_SIZE, DEFAULT_SCALED_FONT_SIZE_LISTENABLE, EMPTY, EMPTY_ARRAY, MH_ofString
-
Constructor Summary
ConstructorsConstructorDescriptionTextFragmentWidget
(char character, @NonNull Font font) TextFragmentWidget
(CharProvider characters, @NonNull Font font) TextFragmentWidget
(CharProvider characters, @NonNull Font font, int color, int flags, Value<Float> fontSize) Deprecated.TextFragmentWidget
(CharProvider characters, @NonNull Font font, Color color, int flags, Value<Float> fontSize) TextFragmentWidget
(String string, @NonNull Font font) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecharacters
record component.int
color()
Returns the value of thecolor
record component.final boolean
Indicates whether some other object is "equal to" this one.int
flags()
Returns the value of theflags
record component.@NonNull Font
font()
Returns the value of thefont
record component.fontSize()
Returns the value of thefontSize
record component.final int
hashCode()
Returns a hash code value for this object.@NonNull WidgetInstance
<TextFragmentWidget> Instantiates an instance of the widget.mapFlags
(IntUnaryOperator modifier) final String
toString()
Returns a string representation of this record class.withBold
(boolean bold) withFlags
(int flags) withFontSize
(Value<Float> fontSize) withItalic
(boolean italic) withStrike
(boolean strike) withUnderline
(boolean underline) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.pfaff.altargui.widgets.TextWidget
withFontSize, withScaledFontSize
Methods inherited from interface dev.pfaff.altargui.Widget
atAbsolutePosition, atAlignment, atCenter, atRelativePosition, expand, expandHeight, expandWidth, withAbsoluteHeight, withAbsoluteSize, withAbsoluteWidth, withAspectRatio, withAspectRatio, withAspectRatio, withBackground, withBackgroundColor, withBackgroundTexture, withBorder, withHorizontalMargin, withHorizontalMargin, withId, withKey, withMargin, withMargin, withMarginBottom, withMarginEnd, withMarginStart, withMarginTop, withMultiChildAttributes, withSymmetricMargin, withTooltip, withVerticalMargin, withVerticalMargin, wrap
-
Constructor Details
-
TextFragmentWidget
@Deprecated public TextFragmentWidget(CharProvider characters, @NonNull Font font, int color, int flags, Value<Float> fontSize) Deprecated.Creates an instance of aTextFragmentWidget
record class. -
TextFragmentWidget
public TextFragmentWidget(CharProvider characters, @NonNull Font font, Color color, int flags, Value<Float> fontSize) -
TextFragmentWidget
-
TextFragmentWidget
-
TextFragmentWidget
-
-
Method Details
-
withFont
- Specified by:
withFont
in interfaceTextWidget
-
withFontSize
- Specified by:
withFontSize
in interfaceTextWidget
-
withColor
- Specified by:
withColor
in interfaceTextWidget
-
mapFlags
- Specified by:
mapFlags
in interfaceTextWidget
-
withFlags
- Specified by:
withFlags
in interfaceTextWidget
-
withBold
- Specified by:
withBold
in interfaceTextWidget
-
withItalic
- Specified by:
withItalic
in interfaceTextWidget
-
withStrike
- Specified by:
withStrike
in interfaceTextWidget
-
withUnderline
- Specified by:
withUnderline
in interfaceTextWidget
-
instantiate
Description copied from interface:Widget
Instantiates an instance of the widget.- Specified by:
instantiate
in interfaceWidget
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
characters
Returns the value of thecharacters
record component.- Returns:
- the value of the
characters
record component
-
font
Returns the value of thefont
record component.- Returns:
- the value of the
font
record component
-
color
-
flags
-
fontSize
Returns the value of thefontSize
record component.- Specified by:
fontSize
in interfaceTextWidget
- Returns:
- the value of the
fontSize
record component
-