Package com.storedobject.chart
Class RichTextStyle
java.lang.Object
com.storedobject.chart.RichTextStyle
When styling any text using
TextStyle, parts of the text can be separately styled. This class represents
those parts with additional style details. Each part has a TextStyle of its own.
This is mainly used when you set "formatter" strings such as
Axis.Label.setFormatter(String),
Chart.Label.setFormatter(String) etc. If you want to style parts of the
formatted value in a different way, you can define a "style part" in using this class instance and specified in
the formatter string like {part|...} where "part" is the part name. For example, in the case of
Chart.Label, if you have a formatter "{1} {chart} (in kg)" and if you want
to show the portion "{chart} (in kg)" in another style, you can modify the formatter like this:
"{1} {name|{chart} (in kg)}" where name is the "part name" you created using RichTextStyle.
- Author:
- Syam
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RichTextStyle
public RichTextStyle()
-
-
Method Details
-
get
-
add
Add a part. If the part name already exists, it will be overwritten.- Parameters:
partName- Part name.textStyle- Text style to add. It must have been created from thisRichTextStyleor from some otherRichTextStyle. You can freely mix/share text styles across multipleRichTextStyleinstances.
-
remove
Remove a part.- Parameters:
partName- Name of the part to remove.
-