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 TypeMethodDescriptionvoidEncode 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 PolarPropertygetPolarProperty(boolean create) Get the polar property.final PositiongetPosition(boolean create) Get the position of this on the chart display area.booleanChecks if this property is currently visible.voidsetAnimation(Animation animation) Set it to this instance.voidsetEmphasis(Emphasis emphasis) Set it to this instance.voidsetItemStyle(ItemStyle itemStyle) Set the item-style of this.voidSet the label of this.voidsetPadding(Padding padding) Set the padding of this.final voidsetPolarProperty(PolarProperty polarProperty) Set the polar property.final voidsetPosition(Position position) Set the position of this.voidsetVisible(boolean visible) Sets the visibility of this property.voidvalidate()This method is invoked bySOChartto 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, setZMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setName, setRenderingIndexMethods inherited from interface com.storedobject.chart.HasPolarProperty
setHoleRadius, setRadiusMethods 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:VisiblePropertySets the visibility of this property.- Specified by:
setVisiblein interfaceVisibleProperty- Parameters:
visible- A boolean indicating whether this property should be visible (true) or hidden (false).
-
isVisible
public boolean isVisible()Description copied from interface:VisiblePropertyChecks if this property is currently visible.- Specified by:
isVisiblein interfaceVisibleProperty- Returns:
- true if the property is visible, false otherwise.
-
validate
Description copied from interface:ComponentPartThis method is invoked bySOChartto check if the component or part is valid or not.- Specified by:
validatein interfaceComponentPart- Throws:
ChartException- Raises exception if the component or part is not valid.
-
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.
-
getPolarProperty
Description copied from interface:HasPolarPropertyGet the polar property. (Iftrueis passed as the parameter, a new polar property will be created if not already exists).- Specified by:
getPolarPropertyin interfaceHasPolarProperty- Parameters:
create- Whether to create it or not.- Returns:
- Polar property.
-
setPolarProperty
Description copied from interface:HasPolarPropertySet the polar property.- Specified by:
setPolarPropertyin interfaceHasPolarProperty- Parameters:
polarProperty- Polar property to set. 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.
-
getPadding
Description copied from interface:HasPaddingGet the padding of this on the chart display area. (Iftrueis passed as the parameter, a new padding will be created if not already exists).- Specified by:
getPaddingin interfaceHasPadding- Parameters:
create- Whether to create it or not.- Returns:
- Padding.
-
setPadding
Description copied from interface:HasPaddingSet the padding of this.- Specified by:
setPaddingin interfaceHasPadding- Parameters:
padding- Padding to set.
-
getAnimation
Description copied from interface:HasAnimationGet the instance of this property. (Iftrueis passed as the parameter, a new instance will be created if not already exists).- Specified by:
getAnimationin interfaceHasAnimation- Parameters:
create- Whether to create it or not.- Returns:
- Instance.
-
setAnimation
Description copied from interface:HasAnimationSet it to this instance.- Specified by:
setAnimationin interfaceHasAnimation- Parameters:
animation- Instance to set.
-
getEmphasis
Description copied from interface:HasEmphasisGet the instance of this property. (Iftrueis passed as the parameter, a new instance will be created if not already exists).- Specified by:
getEmphasisin interfaceHasEmphasis- Parameters:
create- Whether to create it or not.- Returns:
- Instance.
-
setEmphasis
Description copied from interface:HasEmphasisSet it to this instance.- Specified by:
setEmphasisin interfaceHasEmphasis- Parameters:
emphasis- Instance to set.
-
getLabel
Description copied from interface:HasLabelGet the label for this part. (Iftrueis passed as the parameter, a new label will be created if not already exists). -
setLabel
-
getLabelClass
-
getItemStyle
Description copied from interface:HasItemStyleGet the item-style for this part. (Iftrueis passed as the parameter, a new label will be created if not already exists).- Specified by:
getItemStylein interfaceHasItemStyle- Parameters:
create- Whether to create it or not.- Returns:
- ItemStyle.
-
setItemStyle
Description copied from interface:HasItemStyleSet the item-style of this.- Specified by:
setItemStylein interfaceHasItemStyle- Parameters:
itemStyle- ItemStyle to set.
-