public interface IconHolder

Known subtypesFloatingActionButton, MultiButton, ScaleImageButton, ScaleImageLabel, ShareButton, SliderBridge, SpanButton, SpanLabel, SpanMultiButton, LikeButton, Button, CheckBox, Label, RadioButton, SelectableIconHolder, Slider, DefaultListCellRenderer, Picker

An interface implemented by Component classes that can display an icon. E.g. Label, SpanLabel, SpanButton, etc..

Methods

public abstract Image getIcon()Returns the labels icon
public abstract void setIcon(Image icon)Sets the Label icon, if the icon is unmodified a repaint would not be triggered
public abstract int getGap()Returns the gap in pixels between the icon/text to the Label boundaries
public abstract void setGap(int gap)Set the gap in pixels between the icon/text to the Label boundaries
public abstract int getTextPosition()Returns The position of the text relative to the icon
public abstract void setTextPosition(int textPosition)Sets the position of the text relative to the icon if exists
public abstract String getIconUIID()Gets the UIID used for styling material icons on this component.
public abstract void setIconUIID(String uiid)Sets a UIID to be used for the material icon style.
public abstract Component getIconStyleComponent()Gets the component that should be used for styling material the material icon.
public abstract void setMaterialIcon(char c, float size)This method is shorthand for char, float)
public abstract void setFontIcon(Font font, char c, float size)This method is shorthand for com.codename1.ui.Font, char, float)

Method details

getIcon

public abstract Image getIcon()
Returns the labels icon

Returns

the labels icon

setIcon

public abstract void setIcon(Image icon)
Sets the Label icon, if the icon is unmodified a repaint would not be triggered

Parameters

icon Image
the image that the label presents.

getGap

public abstract int getGap()
Returns the gap in pixels between the icon/text to the Label boundaries

Returns

the gap in pixels between the icon/text to the Label boundaries

setGap

public abstract void setGap(int gap)
Set the gap in pixels between the icon/text to the Label boundaries

Parameters

gap int
the gap in pixels

getTextPosition

public abstract int getTextPosition()
Returns The position of the text relative to the icon

Returns

The position of the text relative to the icon, one of: LEFT, RIGHT, BOTTOM, TOP

See also

  • #LEFT
  • #RIGHT
  • #BOTTOM
  • #TOP

setTextPosition

public abstract void setTextPosition(int textPosition)
Sets the position of the text relative to the icon if exists

Parameters

textPosition int
alignment value (LEFT, RIGHT, BOTTOM or TOP)

See also

  • #LEFT
  • #RIGHT
  • #BOTTOM
  • #TOP

getIconUIID

public abstract String getIconUIID()
Gets the UIID used for styling material icons on this component.

setIconUIID

public abstract void setIconUIID(String uiid)
Sets a UIID to be used for the material icon style.

Parameters

uiid String
The uiid to use for the material icon style.

getIconStyleComponent

public abstract Component getIconStyleComponent()
Gets the component that should be used for styling material the material icon. If #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

The component to use for styling the material icon.

setMaterialIcon

public abstract void setMaterialIcon(char c, float size)
This method is shorthand for char, float)

Parameters

c char
one of the constants from com.codename1.ui.FontImage
size float
the size of the icon in millimeters

setFontIcon

public abstract void setFontIcon(Font font, char c, float size)
This method is shorthand for com.codename1.ui.Font, char, float)

Parameters

font Font
Not documented.
c char
one of the constants from the font
size float
the size of the icon in millimeters