Class AbstractTitle<T extends IsDefaultAbstractTitle>
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractModel<Plugins,T>
-
- org.pepstock.charba.client.options.AbstractTitle<T>
-
- Type Parameters:
T- type of defaults for title or subtitle
- All Implemented Interfaces:
IsDefaultAbstractTitle,IsDefaultFontContainer,IsDefaultPluginElement,HasFont,IsTitle
public abstract class AbstractTitle<T extends IsDefaultAbstractTitle> extends AbstractModel<Plugins,T> implements IsTitle, HasFont
Configures the default chart title and subtitle which defines texts to draw at the top of the chart.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementAligngetAlign()Returns the alignment of the element.IsFontgetFont()Returns the font element.FontContainergetFontContainer()Returns a font container instance to use in the default methods of this interface.PaddinggetPadding()Returns the padding to apply around labels.PositiongetPosition()Returns the position of element.List<String>getText()Returns the title text to display, as a list of strings.booleanisDisplay()Returnstrueif the element is shown.booleanisFullSize()Returns if that this box should take the full width/height of the canvas (moving other boxes).voidsetAlign(ElementAlign alignment)Sets the alignment of the element.voidsetColor(String color)Sets the font color.voidsetDisplay(boolean display)Setstrueif the element is shown.voidsetFullSize(boolean fullSize)Marks that this box should take the full width/height of the canvas (moving other boxes).voidsetPosition(Position position)Sets the position of element.voidsetText(String... text)Sets the title text to display.
If specified as an array, text is rendered on multiple lines.-
Methods inherited from class org.pepstock.charba.client.options.AbstractModel
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasFont
getColor, getColorAsString, setColor
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultPluginElement
getAlign, getPosition, isDisplay
-
Methods inherited from interface org.pepstock.charba.client.options.IsTitle
setAlign, setDisplay, setPosition
-
-
-
-
Method Detail
-
getFontContainer
public final FontContainer getFontContainer()
Description copied from interface:HasFontReturns a font container instance to use in the default methods of this interface.- Specified by:
getFontContainerin interfaceHasFont- Returns:
- a font container instance
-
getPadding
public final Padding getPadding()
Returns the padding to apply around labels. Only top and bottom are implemented.- Specified by:
getPaddingin interfaceIsDefaultAbstractTitle- Specified by:
getPaddingin interfaceIsTitle- Returns:
- padding to apply around labels. Only top and bottom are implemented.
-
setColor
public void setColor(String color)
Description copied from interface:IsTitleSets the font color.
-
getFont
public IsFont getFont()
Description copied from interface:IsDefaultFontContainerReturns the font element.
-
setFullSize
public final void setFullSize(boolean fullSize)
Marks that this box should take the full width/height of the canvas (moving other boxes).- Specified by:
setFullSizein interfaceIsTitle- Parameters:
fullSize- Marks that this box should take the full width/height of the canvas (moving other boxes)
-
isFullSize
public final boolean isFullSize()
Returns if that this box should take the full width/height of the canvas (moving other boxes).- Specified by:
isFullSizein interfaceIsDefaultAbstractTitle- Returns:
trueif that this box should take the full width/height of the canvas (moving other boxes).
-
setText
public final void setText(String... text)
Sets the title text to display.
If specified as an array, text is rendered on multiple lines.
-
getText
public final List<String> getText()
Returns the title text to display, as a list of strings.
-
setDisplay
public void setDisplay(boolean display)
Setstrueif the element is shown.- Parameters:
display- iftruethe element is shown.
-
isDisplay
public boolean isDisplay()
Returnstrueif the element is shown.- Specified by:
isDisplayin interfaceIsDefaultPluginElement- Returns:
- if
truethe element is shown.
-
setPosition
public void setPosition(Position position)
Sets the position of element.- Parameters:
position- the position of element.
-
getPosition
public Position getPosition()
Returns the position of element.- Specified by:
getPositionin interfaceIsDefaultPluginElement- Returns:
- the position of element.
-
setAlign
public void setAlign(ElementAlign alignment)
Sets the alignment of the element.- Parameters:
alignment- alignment of the element.
-
getAlign
public ElementAlign getAlign()
Returns the alignment of the element.- Specified by:
getAlignin interfaceIsDefaultPluginElement- Returns:
- alignment of the element.
-
-