Package com.storedobject.chart
Class ComposedPart
java.lang.Object
com.storedobject.chart.AbstractPart
com.storedobject.chart.ComposedPart
- All Implemented Interfaces:
ComponentPart
,ComponentProperty
,HasAnimation
,HasEmphasis
,HasItemStyle
,HasLabel
,HasPadding
,HasPolarProperty
,HasPosition
,VisibleProperty
- Direct Known Subclasses:
SankeyData.Edge
,SankeyData.Node
public class ComposedPart
extends AbstractPart
implements HasPosition, HasPadding, HasPolarProperty, HasAnimation, HasEmphasis, HasLabel, HasItemStyle, VisibleProperty
A part whose properties can be composed of a few configuration variables.
- Author:
- Syam
-
Constructor Summary
ConstructorsConstructorDescriptionComposedPart
(boolean hasVisibility, boolean hasPosition, boolean hasPadding, boolean hasPolarProperty, boolean hasAnimation, boolean hasEmphasis, boolean hasLabel, boolean hasItemStyle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Encode the JSON string with the properties of this.getAnimation
(boolean create) Get the instance of this property.getEmphasis
(boolean create) Get the instance of this property.getItemStyle
(boolean create) Get the item-style for this part.getLabel
(boolean create) Get the label for this part.This is invoked to determine the class of the label to create.getPadding
(boolean create) Get the padding of this on the chart display area.final PolarProperty
getPolarProperty
(boolean create) Get the polar property.final Position
getPosition
(boolean create) Get the position of this on the chart display area.boolean
Checks if this property is currently visible.void
setAnimation
(Animation animation) Set it to this instance.void
setEmphasis
(Emphasis emphasis) Set it to this instance.void
setItemStyle
(ItemStyle itemStyle) Set the item-style of this.void
Set the label of this.void
setPadding
(Padding padding) Set the padding of this.final void
setPolarProperty
(PolarProperty polarProperty) Set the polar property.final void
setPosition
(Position position) Set the position of this.void
setVisible
(boolean visible) Sets the visibility of this property.void
validate()
This method is invoked bySOChart
to check if the component or part is valid or not.Methods inherited from class com.storedobject.chart.AbstractPart
equals, getId, getLabelTag, getName, getSerial, getZ, hashCode, hasId, setSerial, setZ
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setName, setRenderingIndex
Methods inherited from interface com.storedobject.chart.HasPolarProperty
setHoleRadius, setRadius
Methods inherited from interface com.storedobject.chart.VisibleProperty
hide, show
-
Constructor Details
-
ComposedPart
public ComposedPart(boolean hasVisibility, boolean hasPosition, boolean hasPadding, boolean hasPolarProperty, boolean hasAnimation, boolean hasEmphasis, boolean hasLabel, boolean hasItemStyle) Constructor.- Parameters:
hasVisibility
- Whether this part supports visibility or not.hasPosition
- Whether this part supports positioning or not.hasPadding
- Whether this part supports padding or not.hasPolarProperty
- Whether this part supports polar property or not.hasAnimation
- Whether this part supports animation or not.hasEmphasis
- Whether this part supports emphasis or not.hasLabel
- Whether this part supports label or not.hasItemStyle
- Whether this part supports item-style or not.
-
-
Method Details
-
setVisible
public void setVisible(boolean visible) Description copied from interface:VisibleProperty
Sets the visibility of this property.- Specified by:
setVisible
in interfaceVisibleProperty
- Parameters:
visible
- A boolean indicating whether this property should be visible (true) or hidden (false).
-
isVisible
public boolean isVisible()Description copied from interface:VisibleProperty
Checks if this property is currently visible.- Specified by:
isVisible
in interfaceVisibleProperty
- Returns:
- true if the property is visible, false otherwise.
-
validate
Description copied from interface:ComponentPart
This method is invoked bySOChart
to check if the component or part is valid or not.- Specified by:
validate
in interfaceComponentPart
- Throws:
ChartException
- Raises exception if the component or part is not valid.
-
encodeJSON
Description copied from interface:ComponentProperty
Encode the JSON string with the properties of this.- Specified by:
encodeJSON
in interfaceComponentProperty
- Overrides:
encodeJSON
in classAbstractPart
- Parameters:
sb
- Encoded JSON string to be appended to this.
-
getPolarProperty
Description copied from interface:HasPolarProperty
Get the polar property. (Iftrue
is passed as the parameter, a new polar property will be created if not already exists).- Specified by:
getPolarProperty
in interfaceHasPolarProperty
- Parameters:
create
- Whether to create it or not.- Returns:
- Polar property.
-
setPolarProperty
Description copied from interface:HasPolarProperty
Set the polar property.- Specified by:
setPolarProperty
in interfaceHasPolarProperty
- Parameters:
polarProperty
- Polar property to set. It could benull
.
-
getPosition
Description copied from interface:HasPosition
Get the position of this on the chart display area. (Iftrue
is passed as the parameter, a new position will be created if not already exists).- Specified by:
getPosition
in interfaceHasPosition
- Parameters:
create
- Whether to create it or not.- Returns:
- Position.
-
setPosition
Description copied from interface:HasPosition
Set the position of this.- Specified by:
setPosition
in interfaceHasPosition
- Parameters:
position
- Position to set.
-
getPadding
Description copied from interface:HasPadding
Get the padding of this on the chart display area. (Iftrue
is passed as the parameter, a new padding will be created if not already exists).- Specified by:
getPadding
in interfaceHasPadding
- Parameters:
create
- Whether to create it or not.- Returns:
- Padding.
-
setPadding
Description copied from interface:HasPadding
Set the padding of this.- Specified by:
setPadding
in interfaceHasPadding
- Parameters:
padding
- Padding to set.
-
getAnimation
Description copied from interface:HasAnimation
Get the instance of this property. (Iftrue
is passed as the parameter, a new instance will be created if not already exists).- Specified by:
getAnimation
in interfaceHasAnimation
- Parameters:
create
- Whether to create it or not.- Returns:
- Instance.
-
setAnimation
Description copied from interface:HasAnimation
Set it to this instance.- Specified by:
setAnimation
in interfaceHasAnimation
- Parameters:
animation
- Instance to set.
-
getEmphasis
Description copied from interface:HasEmphasis
Get the instance of this property. (Iftrue
is passed as the parameter, a new instance will be created if not already exists).- Specified by:
getEmphasis
in interfaceHasEmphasis
- Parameters:
create
- Whether to create it or not.- Returns:
- Instance.
-
setEmphasis
Description copied from interface:HasEmphasis
Set it to this instance.- Specified by:
setEmphasis
in interfaceHasEmphasis
- Parameters:
emphasis
- Instance to set.
-
getLabel
Description copied from interface:HasLabel
Get the label for this part. (Iftrue
is passed as the parameter, a new label will be created if not already exists). -
setLabel
-
getLabelClass
-
getItemStyle
Description copied from interface:HasItemStyle
Get the item-style for this part. (Iftrue
is passed as the parameter, a new label will be created if not already exists).- Specified by:
getItemStyle
in interfaceHasItemStyle
- Parameters:
create
- Whether to create it or not.- Returns:
- ItemStyle.
-
setItemStyle
Description copied from interface:HasItemStyle
Set the item-style of this.- Specified by:
setItemStyle
in interfaceHasItemStyle
- Parameters:
itemStyle
- ItemStyle to set.
-