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
iconImage- 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
gapint- 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
textPositionint- 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
uiidString- 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
cchar- one of the constants from
com.codename1.ui.FontImage sizefloat- 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
fontFont- Not documented.
cchar- one of the constants from the font
sizefloat- the size of the icon in millimeters