public class Label
ImplementsAnimation, Editable, IconHolder, StyleListener, TextHolder
Known subtypesScaleImageLabel, Button, Slider, DefaultListCellRenderer
Allows displaying a single line of text and icon (both optional) with different alignment options. This class is a base class for several components allowing them to declare alignment/icon appearance universally.
Label text can be positioned in one of 4 locations as such:
Form hi = new Form("Test Label", BoxLayout.y());
Image icon = FontImage.createMaterial(FontImage.MATERIAL_INFO, "Label", 3.0f);
Label left = new Label("Left", icon);
left.setTextPosition(Component.LEFT);
Label right = new Label("Right", icon);
right.setTextPosition(Component.RIGHT);
Label bottom = new Label("Bottom", icon);
bottom.setTextPosition(Component.BOTTOM);
Label top = new Label("Top", icon);
top.setTextPosition(Component.TOP);
hi.add(left).add(right).add(bottom).add(top);
hi.show();
Constructors
public Label(String text) | Constructs a new label with the specified string of text, left justified. |
public Label(String text, String uiid) | Constructs a new label with the specified string of text and uiid |
public Label() | Construct an empty label |
public Label(Image icon) | Constructs a new label with the specified icon |
public Label(Image icon, String uiid) | Constructs a new label with the specified icon and UIID |
public Label(String text, Image icon, String uiid) | Constructs a new label with the specified icon text and UIID |
public Label(String text, Image icon) | Constructs a new label with the specified icon and text |
Methods
public static int getDefaultGap() | Returns the default gap in pixels between the icon/text to the Label boundaries |
public static void setDefaultGap(int gap) | Set the default gap in pixels between the icon/text to the Label boundaries |
public static boolean isDefaultTickerEnabled() | Allows disabling/enabling tickers globally |
public static void setDefaultTickerEnabled(boolean aDefaultTickerEnabled) | Allows disabling/enabling tickers globally |
protected void laidOut() | This is a callback method to inform the Component when it’s been laidout on the parent Container This is overriden for auto size mode |
public String getBadgeText() | Gets the text to be used in a badge on this label. |
public void setBadgeText(String badgeText) | Sets the badge text to be used on this label. |
public void setBadgeUIID(String badgeUIID) | Sets the style that should be used for rendering badges. |
public Component getBadgeStyleComponent() | Gets a component that can be used for the style of the badge. |
public Component getIconStyleComponent() | Gets the component that should be used for styling material the material icon. |
public void setFontIcon(Font font, char c) | This method is shorthand for Font, char, float) |
public void setMaterialIcon(char c, float size) | This method is shorthand for char, float) |
public void setFontIcon(Font font, char c, float size) | This method is shorthand for com.codename1.ui.Font, char, float) |
public char getMaterialIcon() | Returns the material icon assigned to this component or 0 if not applicable |
public void setMaterialIcon(char c) | This method is shorthand for char) |
public char getFontIcon() | Returns the font icon assigned to this component or 0 if not applicable |
public void setFontIcon(char c) | Sets an icon font using either the same icon font that was used to set the icon font last, or using the font from the icon UIID. |
public float getMaterialIconSize() | Returns the material icon size assigned to this component or 0/-1 if not applicable |
public float getFontIconSize() | Returns the icon size assigned to this component or 0/-1 if not applicable |
public Font getIconFont() | Returns the font for the icon font or null if not font set |
public int getBaselineResizeBehavior() | Returns a constant indicating how the baseline varies with the size of the component. |
public int getBaseline(int width, int height) | The baseline for the component text according to which it should be aligned with other components for best visual look. |
public void setUIID(String id) | This method sets the Component the Unique identifier. |
public void refreshTheme(boolean merge) | Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME! |
protected void initLaf(UIManager uim) | This method initializes the Component defaults constants |
public String getText() | Returns the label text |
public void setText(String text) | Sets the Label text |
public Image getIcon() | Returns the labels icon |
public void setIcon(Image icon) | Sets the Label icon, if the icon is unmodified a repaint would not be triggered |
public int getVerticalAlignment() | Returns the vertical alignment of the Label, this will only work when the icon is in the side of the text and not above or below it. |
public void setVerticalAlignment(int valign) | Sets the vertical alignment of the Label to one of: CENTER, TOP, BOTTOM, BASELINE The valign property is only relevant relatively to the icon and not the entire label, this will only work when there is an icon |
public int getAlignment() | Deprecated Returns the alignment of the Label |
public void setAlignment(int align) | Deprecated Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT |
public int getTextPosition() | Returns The position of the text relative to the icon |
public void setTextPosition(int textPosition) | Sets the position of the text relative to the icon if exists |
public int getGap() | Returns the gap in pixels between the icon/text to the Label boundaries |
public void setGap(int gap) | Set the gap in pixels between the icon/text to the Label boundaries |
protected String paramString() | Returns a string representing the state of this component. |
public void paint(Graphics g) | This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API’s to let the PLAF perform the rendering. |
public float getMaxAutoSize() | Allows us to limit the maximum size for the autosize mode |
public void setMaxAutoSize(float maxSize) | Allows us to limit the maximum size for the autosize mode |
public float getMinAutoSize() | Allows us to limit the minimum size for the autosize mode |
public void setMinAutoSize(float minSize) | Allows us to limit the minimum size for the autosize mode |
protected Dimension calcPreferredSize() | Calculates the preferred size based on component content. |
public int getShiftText() | Simple getter to return how many pixels to shift the text inside the Label |
public void setShiftText(int shiftText) | This method shifts the text from it’s position in pixels. |
public boolean shouldTickerStart() | Returns true if a ticker should be started since there is no room to show the text in the label. |
public void startTicker() | This method will start the text ticker |
public void startTicker(long delay, boolean rightToLeft) | This method will start the text ticker |
public void stopTicker() | Stops the text ticker |
public boolean isTickerRunning() | Returns true if the ticker is running |
public boolean isTickerEnabled() | This method return true if the ticker is enabled on this Label |
public void setTickerEnabled(boolean tickerEnabled) | Sets the Label to allow ticking of the text. |
public boolean isEndsWith3Points() | If the Label text is too long fit the text to the widget and adds “...” points at the end. |
public void setEndsWith3Points(boolean endsWith3Points) | If the Label text is too long fit the text to the widget and adds “...” points at the end. |
public boolean animate() | Allows the animation to reduce “repaint” calls when it returns false. |
public Object getMask() | Returns the mask matching the given image |
public void setMask(Object mask) | A mask image can be applied to the label (see the image mask method for details) which allows for things like rounded image appearance etc. |
public String getMaskName() | Determines the name of the mask from the image constants thus allowing the mask to be applied from the theme |
public void setMaskName(String maskName) | Determines the name of the mask from the image constants thus allowing the mask to be applied from the theme |
public String[] getPropertyNames() | A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code |
public Class[] getPropertyTypes() | Matches the property names method (see that method for further details). |
public String[] getPropertyTypeNames() | This method is here to workaround an XMLVM array type bug where property types aren’t identified properly, it returns the names of the types using the following type names: String,int,double,long,byte,short,char,String[],String[][],byte[],I… |
public Object getPropertyValue(String name) | Returns the current value of the property name, this method is used by the GUI builder |
public String setPropertyValue(String name, Object value) | Sets a new value to the given property, returns an error message if failed and null if successful. |
public Image getMaskedIcon() | If a mask is applied returns the icon with a mask, otherwise returns the icon |
public String[] getBindablePropertyNames() | Returns the names of the properties within this component that can be bound for persistence, the order of these names mean that the first one will be the first bound |
public Class[] getBindablePropertyTypes() | Returns the types of the properties that are bindable within this component |
public void bindProperty(String prop, BindTarget target) | Deprecated Binds the given property name to the given bind target |
public void unbindProperty(String prop, BindTarget target) | Deprecated Removes a bind target from the given property name |
public Object getBoundPropertyValue(String prop) | Allows the binding code to extract the value of the property |
public void setBoundPropertyValue(String prop, Object value) | Sets the value of a bound property within this component, notice that this method MUST NOT fire the property change event when invoked to prevent recursion! |
public boolean isShouldLocalize() | Indicates if text should be localized when set to the label, by default all text is localized so this allows disabling automatic localization for a specific label. |
public void setShouldLocalize(boolean shouldLocalize) | Indicates if text should be localized when set to the label, by default all text is localized so this allows disabling automatic localization for a specific label. |
public int getShiftMillimeters() | Deprecated Returns the number of millimeters that should be shifted in tickering rounded to nearest int. |
public void setShiftMillimeters(int shiftMillimeters) | Sets the millimeters that should be shifted in tickering |
public void setShiftMillimeters(float shiftMillimeters) | Sets the millimeters that should be shifted in tickering as a float. |
public float getShiftMillimetersF() | Returns the number of millimeters that should be shifted in tickering as a float. |
public boolean isShowEvenIfBlank() | By default labels and subclasses become 0 sized when they are blank even ignoring their padding setting this to true makes the padding take effect even in a blank field. |
public final void setShowEvenIfBlank(boolean showEvenIfBlank) | By default labels and subclasses become 0 sized when they are blank even ignoring their padding setting this to true makes the padding take effect even in a blank field. |
public int getStringWidth(Font fnt) | This method is equivalent to label.getStyle().getFont().stringWidth(label.getText()) but its faster |
public boolean isLegacyRenderer() | Fallback to the old default look and feel renderer for cases where compatibility is essential |
public void setLegacyRenderer(boolean legacyRenderer) | Fallback to the old default look and feel renderer for cases where compatibility is essential |
public void styleChanged(String propertyName, Style source) | Invoked to indicate a change in a propertyName of a Style |
protected void initUnselectedStyle(Style unselectedStyle) | Can be overridden by subclasses to perform initialization when the unselected style is set to a new value. |
public boolean isAutoSizeMode() | Autosize mode automatically shrinks/grows the font of the label to fit in the available width, it carries a noticeable performance penalty and we recommend you avoid using it unless absolutely necessary |
public void setAutoSizeMode(boolean autoSizeMode) | Autosize mode automatically shrinks/grows the font of the label to fit in the available width, it carries a noticeable performance penalty and we recommend you avoid using it unless absolutely necessary |
public boolean isTextSelectionEnabled() | Returns true if text selection is enabled on this label. |
public void setTextSelectionEnabled(boolean enabled) | Enables text selection on this label. |
public TextSelection.TextSelectionSupport getTextSelectionSupport() | Returns text selection support object for this component. |
public String getIconUIID() | Gets the UIID used for styling material icons on this component. |
public void setIconUIID(String uiid) | Sets a UIID to be used for the material icon style. |
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getUIManager, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, clearClientProperties, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, fireClicked, isSelectableInteraction, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, isScrollableX, isScrollableY, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, getBottomGap, getSideGap, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, setShouldCalcPreferredSize, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyPressed, keyReleased, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, dragInitiated, drawDraggedImage, draggingOver, dragEnter, dragExit, drop, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerPressed, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, getGridPosY, getGridPosX, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, setCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, deinitialize, initComponent, isInitialized, setInitialized, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, isEnabled, setEnabled, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, cancelRepaints, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Constructor details
Label
public Label(String text)Parameters
textString- the string that the label presents.
Label
public Label(String text, String uiid)Parameters
textString- the string that the label presents.
uiidString- the uiid for the label
Label
public Label()Label
public Label(Image icon)Parameters
iconImage- the image that the label presents.
Label
public Label(Image icon, String uiid)Parameters
iconImage- the image that the label presents.
uiidString- the uiid for the label
Label
public Label(String text, Image icon, String uiid)Parameters
textString- the text of the label
iconImage- the image that the label presents.
uiidString- the uiid for the label
Label
public Label(String text, Image icon)Parameters
textString- the text of the label
iconImage- the image that the label presents.
Method details
getDefaultGap
public static int getDefaultGap()Returns
setDefaultGap
public static void setDefaultGap(int gap)Parameters
gapint- the gap in pixels
isDefaultTickerEnabled
public static boolean isDefaultTickerEnabled()Returns
setDefaultTickerEnabled
public static void setDefaultTickerEnabled(boolean aDefaultTickerEnabled)Parameters
aDefaultTickerEnabledboolean- the defaultTickerEnabled to set
laidOut
protected void laidOut()getBadgeText
public String getBadgeText()Returns
setBadgeText
public void setBadgeText(String badgeText)#setBadgeUIID(java.lang.String), but the default style uses
the “Badge” UIID, which, by default, uses white text on a red round border background.Parameters
badgeTextString- The text to include in the badge. null or empty strings will result in the badge not being rendered.
setBadgeUIID
public void setBadgeUIID(String badgeUIID)Parameters
badgeUIIDString- The UIID to use for the badge.
getBadgeStyleComponent
public Component getBadgeStyleComponent()Returns
getIconStyleComponent
public Component getIconStyleComponent()#setIconUIID(java.lang.String) has been used
to set a custom UIID for the icon, then this will return a component with that UIID. Otherwise this will just return this component
itself.Returns
setFontIcon
public void setFontIcon(Font font, char c)Font, char, float)Parameters
fontFont- Not documented.
cchar- one of the constants from the font
setMaterialIcon
public void setMaterialIcon(char c, float size)char, float)Parameters
cchar- one of the constants from
com.codename1.ui.FontImage sizefloat- the size of the icon in millimeters
setFontIcon
public void setFontIcon(Font font, char c, float size)com.codename1.ui.Font, char, float)Parameters
fontFont- Not documented.
cchar- one of the constants from the font
sizefloat- the size of the icon in millimeters
getMaterialIcon
public char getMaterialIcon()Returns
setMaterialIcon
public void setMaterialIcon(char c)char)Parameters
cchar- one of the constants from
com.codename1.ui.FontImage
getFontIcon
public char getFontIcon()Returns
setFontIcon
public void setFontIcon(char c)Parameters
cchar- The character to render in the font.
getMaterialIconSize
public float getMaterialIconSize()Returns
getFontIconSize
public float getFontIconSize()Returns
getIconFont
public Font getIconFont()Returns
getBaselineResizeBehavior
public int getBaselineResizeBehavior()Returns
getBaseline
public int getBaseline(int width, int height)Parameters
widthint- the component width
heightint- the component height
Returns
setUIID
public void setUIID(String id)Parameters
idString- UIID unique identifier for component type
refreshTheme
public void refreshTheme(boolean merge)Parameters
mergeboolean- indicates if the current styles should be merged with the new styles
initLaf
protected void initLaf(UIManager uim)getText
public String getText()Returns
setText
public void setText(String text)Parameters
textString- the string that the label presents.
getIcon
public Image getIcon()Returns
setIcon
public void setIcon(Image icon)Parameters
iconImage- the image that the label presents.
getVerticalAlignment
public int getVerticalAlignment()Returns
setVerticalAlignment
public void setVerticalAlignment(int valign)Parameters
valignint- alignment value
getAlignment
public int getAlignment()Returns
setAlignment
public void setAlignment(int align)Parameters
alignint- alignment value
getTextPosition
public int getTextPosition()Returns
setTextPosition
public void setTextPosition(int textPosition)Parameters
textPositionint- alignment value (LEFT, RIGHT, BOTTOM or TOP)
getGap
public int getGap()Returns
setGap
public void setGap(int gap)Parameters
gapint- the gap in pixels
paramString
protected String paramString()null.Returns
paint
public void paint(Graphics g)Parameters
gGraphics- the component graphics
getMaxAutoSize
public float getMaxAutoSize()Returns
setMaxAutoSize
public void setMaxAutoSize(float maxSize)Parameters
maxSizefloat- the maximum font size in millimeters
getMinAutoSize
public float getMinAutoSize()Returns
setMinAutoSize
public void setMinAutoSize(float minSize)Parameters
minSizefloat- the minimum font size in millimeters
calcPreferredSize
protected Dimension calcPreferredSize()Returns
getShiftText
public int getShiftText()Returns
setShiftText
public void setShiftText(int shiftText)Parameters
shiftTextint- The number of pixels to move the text
shouldTickerStart
public boolean shouldTickerStart()Returns
startTicker
public void startTicker()startTicker
public void startTicker(long delay, boolean rightToLeft)Parameters
delaylong- the delay in millisecods between animation intervals
rightToLeftboolean- if true move the text to the left
stopTicker
public void stopTicker()isTickerRunning
public boolean isTickerRunning()Returns
isTickerEnabled
public boolean isTickerEnabled()Returns
setTickerEnabled
public void setTickerEnabled(boolean tickerEnabled)isEndsWith3Points
public boolean isEndsWith3Points()...”
points at the end. By default this is set to false for faster performance.Returns
setEndsWith3Points
public void setEndsWith3Points(boolean endsWith3Points)...”
points at the end. By default this is set to false for faster performance.Parameters
endsWith3Pointsboolean- true if text should add “…” at the end
animate
public boolean animate()com.codename1.ui.Display class.Returns
getMask
public Object getMask()Returns
setMask
public void setMask(Object mask)Parameters
maskObject- the mask returned from the image object
getMaskName
public String getMaskName()Returns
setMaskName
public void setMaskName(String maskName)Parameters
maskNameString- the maskName to set
getPropertyNames
public String[] getPropertyNames()Returns
getPropertyTypes
public Class[] getPropertyTypes()Returns
getPropertyTypeNames
public String[] getPropertyTypeNames()Returns
getPropertyValue
public Object getPropertyValue(String name)Parameters
nameString- the name of the property
Returns
setPropertyValue
public String setPropertyValue(String name, Object value)Parameters
nameString- the name of the property
valueObject- new value for the property
Returns
getMaskedIcon
public Image getMaskedIcon()Returns
getBindablePropertyNames
public String[] getBindablePropertyNames()Returns
getBindablePropertyTypes
public Class[] getBindablePropertyTypes()Returns
bindProperty
public void bindProperty(String prop, BindTarget target)Parameters
propString- the property name
targetBindTarget- the target binder
unbindProperty
public void unbindProperty(String prop, BindTarget target)Parameters
propString- the property names
targetBindTarget- the target binder
getBoundPropertyValue
public Object getBoundPropertyValue(String prop)Parameters
propString- the property
Returns
setBoundPropertyValue
public void setBoundPropertyValue(String prop, Object value)Parameters
propString- the property whose value should be set
valueObject- the value
isShouldLocalize
public boolean isShouldLocalize()Returns
setShouldLocalize
public void setShouldLocalize(boolean shouldLocalize)Parameters
shouldLocalizeboolean- the shouldLocalize to set
getShiftMillimeters
public int getShiftMillimeters()#getShiftMillimetersF()Returns
setShiftMillimeters
public void setShiftMillimeters(int shiftMillimeters)Parameters
shiftMillimetersint- the shiftMillimeters to set
setShiftMillimeters
public void setShiftMillimeters(float shiftMillimeters)Parameters
shiftMillimetersfloat- the shiftMillimeters to set
getShiftMillimetersF
public float getShiftMillimetersF()isShowEvenIfBlank
public boolean isShowEvenIfBlank()Returns
setShowEvenIfBlank
public final void setShowEvenIfBlank(boolean showEvenIfBlank)Parameters
showEvenIfBlankboolean- the showEvenIfBlank to set
getStringWidth
public int getStringWidth(Font fnt)Parameters
fntFont- the font is passed as an optimization to save a call to getStyle
Returns
isLegacyRenderer
public boolean isLegacyRenderer()Returns
setLegacyRenderer
public void setLegacyRenderer(boolean legacyRenderer)Parameters
legacyRendererboolean- the legacyRenderer to set
styleChanged
public void styleChanged(String propertyName, Style source)Invoked to indicate a change in a propertyName of a Style
NOTE By default this will trigger a call to Container#revalidate() on the parent
container, which is expensive. You can disable this behavior by calling CN.setProperty("Component.revalidateOnStyleChange", "false").
The intention is to change this behavior so that the default is to “not” revalidate on style change, so we encourage you to
set this to “false” to ensure for future compatibility.
Parameters
propertyNameString- the property name that was changed
sourceStyle- The changed Style object
initUnselectedStyle
protected void initUnselectedStyle(Style unselectedStyle)Parameters
unselectedStyleStyle- The unselected style.
isAutoSizeMode
public boolean isAutoSizeMode()Returns
setAutoSizeMode
public void setAutoSizeMode(boolean autoSizeMode)Parameters
autoSizeModeboolean- the autoSizeMode to set
isTextSelectionEnabled
public boolean isTextSelectionEnabled()Form#getTextSelection() and TextSelection#setEnabled(boolean),
and also ensure that the label’s text selection is enabled via #setTextSelectionEnabled(boolean).setTextSelectionEnabled
public void setTextSelectionEnabled(boolean enabled)getTextSelectionSupport
public TextSelection.TextSelectionSupport getTextSelectionSupport()Returns
getIconUIID
public String getIconUIID()setIconUIID
public void setIconUIID(String uiid)Parameters
uiidString- The uiid to use for the material icon style.