Interface IconHolder
- All Known Subinterfaces:
SelectableIconHolder
- All Known Implementing Classes:
Button, CheckBox, DefaultListCellRenderer, FloatingActionButton, Label, LikeButton, MultiButton, Picker, RadioButton, ScaleImageButton, ScaleImageLabel, ShareButton, Slider, SliderBridge, SpanButton, SpanLabel, SpanMultiButton
Component classes that can display an icon. E.g. Label, SpanLabel, SpanButton, etc..-
Method Summary
Modifier and TypeMethodDescriptionintgetGap()Returns the gap in pixels between the icon/text to the Label boundariesgetIcon()Returns the labels iconGets the component that should be used for styling material the material icon.Gets the UIID used for styling material icons on this component.intReturns The position of the text relative to the iconvoidsetFontIcon(Font font, char c, float size) This method is shorthand forcom.codename1.ui.Font, char, float)voidsetGap(int gap) Set the gap in pixels between the icon/text to the Label boundariesvoidSets the Label icon, if the icon is unmodified a repaint would not be triggeredvoidsetIconUIID(String uiid) Sets a UIID to be used for the material icon style.voidsetMaterialIcon(char c, float size) This method is shorthand forchar, float)voidsetTextPosition(int textPosition) Sets the position of the text relative to the icon if exists
-
Method Details
-
getIcon
Image getIcon()Returns the labels icon
Returns
the labels icon
-
setIcon
Sets the Label icon, if the icon is unmodified a repaint would not be triggered
Parameters
icon: the image that the label presents.
-
getGap
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
void setGap(int gap) Set the gap in pixels between the icon/text to the Label boundaries
Parameters
gap: the gap in pixels
-
getTextPosition
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
void setTextPosition(int textPosition) Sets the position of the text relative to the icon if exists
Parameters
textPosition: alignment value (LEFT, RIGHT, BOTTOM or TOP)
See also
-
#LEFT
-
#RIGHT
-
#BOTTOM
-
#TOP
-
getIconUIID
String getIconUIID()Gets the UIID used for styling material icons on this component. -
setIconUIID
Sets a UIID to be used for the material icon style.
Parameters
uiid: The uiid to use for the material icon style.
Since
7.0
-
getIconStyleComponent
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.
Since
7.0
-
setMaterialIcon
void setMaterialIcon(char c, float size) This method is shorthand for
char, float)Parameters
-
c: one of the constants fromcom.codename1.ui.FontImage -
size: the size of the icon in millimeters
Since
8.0
-
-
setFontIcon
This method is shorthand for
com.codename1.ui.Font, char, float)Parameters
-
c: one of the constants from the font -
size: the size of the icon in millimeters
Since
8.0
-
-