Package com.storedobject.chart
Class Title
java.lang.Object
com.storedobject.chart.AbstractPart
com.storedobject.chart.VisiblePart
com.storedobject.chart.Title
- All Implemented Interfaces:
Component,ComponentPart,ComponentProperty,HasPosition,VisibleProperty
Title for the chart. If you are adding more than one title, please make sure that you set appropriate
positions to eliminate overlap.
- Author:
- Syam
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEncode the JSON string with the properties of this.final intgetGap()Get the gap between title and sub-title.final PositiongetPosition(boolean create) Get the position of this on the chart display area.Get the sub-text that will be shown as the sub-title in the second line.final TextStylegetSubtextStyle(boolean create) Get the sub-text style.getText()Get the text of the title.final TextStylegetTextStyle(boolean create) Get the text style.voidsetGap(int gap) Set the gap between title and sub-title.final voidsetPosition(Position position) Set the position of this.voidsetSubtext(String subtext) Set the sub-text that will be shown as the sub-title in the second line.voidsetSubtextStyle(TextStyle textStyle) Set the sub-text style.voidSet the text of the title.voidsetTextStyle(TextStyle textStyle) Set the text style.voidvalidate()This method is invoked bySOChartto check if the component or part is valid or not.Methods inherited from class com.storedobject.chart.VisiblePart
isVisible, setVisibleMethods inherited from class com.storedobject.chart.AbstractPart
equals, getId, getLabelTag, getName, getSerial, getZ, hashCode, hasId, setSerial, setZMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.ComponentPart
className, getId, getName, getRenderingIndex, getSerial, setName, setRenderingIndex, setSerialMethods inherited from interface com.storedobject.chart.VisibleProperty
hide, show
-
Constructor Details
-
Title
Create a title with a given text.- Parameters:
text- Text to display as title.
-
-
Method Details
-
getText
-
setText
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Overrides:
encodeJSONin classAbstractPart- Parameters:
sb- Encoded JSON string to be appended to this.
-
validate
public void validate()Description copied from interface:ComponentPartThis method is invoked bySOChartto check if the component or part is valid or not.- Specified by:
validatein interfaceComponentPart- Overrides:
validatein classVisiblePart
-
getSubtext
Get the sub-text that will be shown as the sub-title in the second line.- Returns:
- Text of the sub-title. It could be
null.
-
setSubtext
Set the sub-text that will be shown as the sub-title in the second line.- Parameters:
subtext- Text of the sub-title. It could benull.
-
getPosition
Description copied from interface:HasPositionGet the position of this on the chart display area. (Iftrueis passed as the parameter, a new position will be created if not already exists).- Specified by:
getPositionin interfaceHasPosition- Parameters:
create- Whether to create it or not.- Returns:
- Position.
-
setPosition
Description copied from interface:HasPositionSet the position of this.- Specified by:
setPositionin interfaceHasPosition- Parameters:
position- Position to set.
-
getTextStyle
Get the text style.- Parameters:
create- Whether to create if not exists or not.- Returns:
- Text style.
-
setTextStyle
Set the text style.- Parameters:
textStyle- Text style to set.
-
getSubtextStyle
Get the sub-text style.- Parameters:
create- Whether to create if not exists or not.- Returns:
- Text style.
-
setSubtextStyle
Set the sub-text style.- Parameters:
textStyle- Text style to set.
-
getGap
public final int getGap()Get the gap between title and sub-title.- Returns:
- Gap in pixels.
-
setGap
public void setGap(int gap) Set the gap between title and sub-title.- Parameters:
gap- Gap in pixels.
-