Control.Constants, Control.ImageMode, Control.Predicate, Control.Predicate1<T>, Control.Predicate2<T,U>, Control.RenderingMethod, Control.Setter<T>| Modifier and Type | Field and Description |
|---|---|
static long |
FONT_SIZE |
static long |
LINE_HEIGHT |
static long |
TEXT_ALIGN |
static long |
TEXT_ALIGN_Y |
static long |
TEXT_COLOR |
ALL, ANCHOR_INACTIVE, AUTOSIZE_BOTH, AUTOSIZE_HEIGHT, AUTOSIZE_NONE, AUTOSIZE_WIDTH, BACKGROUND_COLOR, BACKGROUND_COLORS, BORDER, BORDER_COLOR, BORDER_RADIUS, BORDER_WIDTH, BUFFERED_RENDERING, COLORS, defaultRenderingMethod, FILL, FIT, FIT_INSIDE, FOREGROUND_COLOR, HOVER_COLOR, MARGIN, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, name, OPACITY, PADDING, PADDING_BOTTOM, PADDING_LEFT, PADDING_RIGHT, PADDING_TOP, PERCENTAGE_MODE, PIXEL_MODE, PRESSED_COLOR, SPACING, TEXT_PROPERTIES, UNBUFFERED_RENDERING| Constructor and Description |
|---|
TextBased() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyStyle(Control source,
long attribs)
Enable user of the library to adopt a set of visual style properties from another element.
|
PFont |
getFont() |
float |
getFontSize() |
int |
getLineHeight() |
java.lang.String |
getText() |
int |
getTextAlign() |
int |
getTextAlignY() |
int |
getTextColor() |
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isStrikethrough() |
boolean |
isUnderlined() |
void |
setBold(boolean bold)
Set the text bold attribute.
|
void |
setFont(PFont font)
Set the text font.
|
void |
setFontSize(float fontSize)
Set the font size for the displayed text.
|
void |
setForegroundColor(int clr)
Set the foreground color (usually the text color).
|
void |
setItalic(boolean italic)
Set the text italic attribute.
|
void |
setLineHeight(int lineHeight)
For multiline text, set the line height in pixel.
|
void |
setLineHeightPercent(int lineHeight)
For multiline text, set the line height in literal percent: for 100% pass 100 and not 1.
|
void |
setStrikethrough(boolean strike)
Set the text strike-through attribute.
|
void |
setText(java.lang.String text)
Set the text content.
|
void |
setText(java.lang.String text,
boolean noautosize)
If the second parameter is true, then the element will not be resized to fit the text.
|
void |
setTextAlign(int align)
Set the text align (works for most classes).
|
void |
setTextAlignY(int align)
Vertical align (not implemented in all classes).
|
void |
setTextColor(int clr)
Set the text color.
|
void |
setUnderlined(boolean underline)
Set the text underline attribute.
|
addAutoAnchors, animate, blur, copyStyle, doForAll, fillParent, fillParent, fillParent, fillParentHeight, fillParentHeight, fillParentWidth, fillParentWidth, focus, forceRepaint, getAnchorMode, getAnchorValue, getAvailableHeight, getAvailableWidth, getBackgroundColor, getBorderColor, getBorderRadius, getBorderWidth, getCursor, getForegroundColor, getHeight, getHoverColor, getImage, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOffsetXToParent, getOffsetXToWindow, getOffsetYToParent, getOffsetYToWindow, getOpacity, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getPressedColor, getVersionString, getWidth, getX, getY, getZ, isEnabled, isFocusable, isFocused, isPropagationStopped, isVisible, noAutosize, relativeCoordsAreWithin, removeAnchor, removeBoxShadow, removeFocusListener, removeMouseListener, removeResizeListener, setAnchor, setAnchors, setAutosizing, setBackgroundColor, setBorder, setBorder, setBorderColor, setBorderRadius, setBorderWidth, setBoxShadow, setCursor, setEnabled, setFixedSize, setFocusListener, setFocusListener, setFocusListener, setFocusListener, setGradient, setHeight, setHeight, setHoverColor, setImage, setImageMode, setMargin, setMargin, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setMouseListener, setMouseListener, setMouseListener, setMouseListener, setOpacity, setOpacity, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPercentageAnchor, setPercentageAnchors, setPixelAnchor, setPixelAnchors, setPosition, setPressedColor, setResizeListener, setResizeListener, setResizeListener, setResizeListener, setSize, setVisibility, setVisible, setWidth, setWidth, setX, setY, setZ, stopPropagation, unfocuspublic static final long TEXT_COLOR
public static final long FONT_SIZE
public static final long TEXT_ALIGN
public static final long TEXT_ALIGN_Y
public static final long LINE_HEIGHT
public void setForegroundColor(int clr)
setForegroundColor in class Controlclr - integer rgb colorpublic void setTextColor(int clr)
clr - text colorpublic void setText(java.lang.String text)
text - textpublic void setText(java.lang.String text,
boolean noautosize)
text - textnoautosize - noautosizepublic void setFontSize(float fontSize)
fontSize - font sizepublic void setTextAlign(int align)
align - LEFT, CENTER, RIGHTpublic void setTextAlignY(int align)
align - TOP, MIDDLE, BOTTOMpublic void setLineHeight(int lineHeight)
lineHeight - line height in pixelpublic void setLineHeightPercent(int lineHeight)
lineHeight - line height in percentpublic java.lang.String getText()
public float getFontSize()
public int getTextColor()
public int getTextAlign()
public int getTextAlignY()
public int getLineHeight()
public void setBold(boolean bold)
bold - boldpublic void setItalic(boolean italic)
italic - italicpublic void setUnderlined(boolean underline)
underline - underlinepublic void setStrikethrough(boolean strike)
strike - strikepublic void setFont(PFont font)
font - a PFontpublic boolean isBold()
public boolean isItalic()
public boolean isUnderlined()
public boolean isStrikethrough()
public PFont getFont()
public void copyStyle(Control source, long attribs)
ControlmyElement.copyStyle(otherElement, PADDING_LEFT | MARGIN_BOTTOM, FOREGROUND_COLOR);
Control.PADDING_LEFT, Control.PADDING_RIGHT, Control.PADDING_TOP,
Control.PADDING_BOTTOM, Control.MARGIN_LEFT, Control.MARGIN_RIGHT, Control.MARGIN_TOP,
Control.MARGIN_BOTTOM, Control.BACKGROUND_COLOR, Control.HOVER_COLOR, Control.PRESSED_COLOR,
Control.FOREGROUND_COLOR, Control.BORDER_WIDTH, Control.BORDER_RADIUS, Control.BORDER_COLOR,
Control.OPACITY,
Control.TEXT_COLOR, Control.TEXT_ALIGN,
Control.TEXT_ALIGN_Y, Control.FONT_SIZE, Control.LINE_HEIGHT.
Control.ALL, Control.COLORS,
Control.MARGIN (all margins), Control.PADDING (all paddings), Control.SPACING (all margins and
paddings), Control.BACKGROUND_COLORS (background-, hover-, and pressedColor), Control.BORDER
(border-width, -color and -radius), Control.TEXT_PROPERTIES (all text properties).Processing Library guiSET by Mc Zen. (c) 2021