-
public class LegendItemDefines the appearance of an item of a Legend.
-
-
Field Summary
Fields Modifier and Type Field Description private final Componenticonprivate final TextComponentlabelprivate final CharSequencelabelText
-
Constructor Summary
Constructors Constructor Description LegendItem(Component icon, TextComponent label, CharSequence labelText)
-
Method Summary
Modifier and Type Method Description ComponentgetIcon()TextComponentgetLabel()CharSequencegetLabelText()final FloatgetLabelHeight(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)Measures the height of the label. final FloatgetLabelWidth(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)Measures the width of the label. final FloatgetWidth(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)Measures the width of this LegendItem. -
-
Constructor Detail
-
LegendItem
LegendItem(Component icon, TextComponent label, CharSequence labelText)
- Parameters:
icon- the Component used as the item’s icon.label- the TextComponent used for the label.labelText- the text content of the label.
-
-
Method Detail
-
getLabel
TextComponent getLabel()
-
getLabelText
CharSequence getLabelText()
-
getLabelHeight
final Float getLabelHeight(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)
Measures the height of the label.
- Parameters:
context- the MeasureContext used to measure the height.availableWidth- the available width for the item.iconPaddingDp- the padding between the icon and the label.iconSizeDp- the size of the icon.
-
getLabelWidth
final Float getLabelWidth(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)
Measures the width of the label.
- Parameters:
context- the MeasureContext used to measure the height.availableWidth- the available width for the item.iconPaddingDp- the padding between the icon and the label.iconSizeDp- the size of the icon.
-
getWidth
final Float getWidth(MeasureContext context, Float availableWidth, Float iconPaddingDp, Float iconSizeDp)
Measures the width of this LegendItem.
- Parameters:
context- the MeasureContext used to measure the height.availableWidth- the available width for the item.iconPaddingDp- the padding between the icon and the label.iconSizeDp- the size of the icon.
-
-
-
-