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 ElementAlign
getAlign()
Returns the alignment of the element.IsFont
getFont()
Returns the font element.FontContainer
getFontContainer()
Returns a font container instance to use in the default methods of this interface.Padding
getPadding()
Returns the padding to apply around labels.Position
getPosition()
Returns the position of element.List<String>
getText()
Returns the title text to display, as a list of strings.boolean
isDisplay()
Returnstrue
if the element is shown.boolean
isFullSize()
Returns if that this box should take the full width/height of the canvas (moving other boxes).void
setAlign(ElementAlign alignment)
Sets the alignment of the element.void
setColor(String color)
Sets the font color.void
setDisplay(boolean display)
Setstrue
if the element is shown.void
setFullSize(boolean fullSize)
Marks that this box should take the full width/height of the canvas (moving other boxes).void
setPosition(Position position)
Sets the position of element.void
setText(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, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, 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, 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:HasFont
Returns a font container instance to use in the default methods of this interface.- Specified by:
getFontContainer
in 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:
getPadding
in interfaceIsDefaultAbstractTitle
- Specified by:
getPadding
in interfaceIsTitle
- Returns:
- padding to apply around labels. Only top and bottom are implemented.
-
setColor
public void setColor(String color)
Description copied from interface:IsTitle
Sets the font color.
-
getFont
public IsFont getFont()
Description copied from interface:IsDefaultFontContainer
Returns 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:
setFullSize
in 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:
isFullSize
in interfaceIsDefaultAbstractTitle
- Returns:
true
if 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)
Setstrue
if the element is shown.- Parameters:
display
- iftrue
the element is shown.
-
isDisplay
public boolean isDisplay()
Returnstrue
if the element is shown.- Specified by:
isDisplay
in interfaceIsDefaultPluginElement
- Returns:
- if
true
the 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:
getPosition
in 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:
getAlign
in interfaceIsDefaultPluginElement
- Returns:
- alignment of the element.
-
-