-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.component.dimension.Margins
public class ShapeComponent extends Component
ShapeComponent is a Component that draws a shape.
-
-
Field Summary
Fields Modifier and Type Field Description private Integercolorprivate IntegerstrokeColorprivate final Shapeshapeprivate final DynamicShaderdynamicShaderprivate final FloatstrokeWidthDpprivate final MutableDimensionsmargins
-
Constructor Summary
Constructors Constructor Description ShapeComponent(Shape shape, Integer color, DynamicShader dynamicShader, Dimensions margins, Float strokeWidthDp, Integer strokeColor)
-
Method Summary
Modifier and Type Method Description final IntegergetColor()The color of the shape. final UnitsetColor(Integer color)The color of the shape. final IntegergetStrokeColor()The color of the stroke. final UnitsetStrokeColor(Integer strokeColor)The color of the stroke. final ShapegetShape()final DynamicShadergetDynamicShader()final FloatgetStrokeWidthDp()MutableDimensionsgetMargins()The current margins. Unitdraw(DrawContext context, Float left, Float top, Float right, Float bottom)Instructs the Component to draw itself at the given coordinates. final ShapeComponentsetShadow(Float radius, Float dx, Float dy, Integer color, Boolean applyElevationOverlay)Applies a drop shadow. final ShapeComponentclearShadow()Removes this ShapeComponent’s drop shadow. -
-
Constructor Detail
-
ShapeComponent
ShapeComponent(Shape shape, Integer color, DynamicShader dynamicShader, Dimensions margins, Float strokeWidthDp, Integer strokeColor)
-
-
Method Detail
-
getStrokeColor
final Integer getStrokeColor()
The color of the stroke.
-
setStrokeColor
final Unit setStrokeColor(Integer strokeColor)
The color of the stroke.
-
getDynamicShader
final DynamicShader getDynamicShader()
-
getStrokeWidthDp
final Float getStrokeWidthDp()
-
getMargins
MutableDimensions getMargins()
The current margins.
-
draw
Unit draw(DrawContext context, Float left, Float top, Float right, Float bottom)
Instructs the Component to draw itself at the given coordinates.
-
setShadow
final ShapeComponent setShadow(Float radius, Float dx, Float dy, Integer color, Boolean applyElevationOverlay)
Applies a drop shadow.
- Parameters:
radius- the blur radius.dx- the horizontal offset.dy- the vertical offset.color- the shadow color.applyElevationOverlay- whether to apply an elevation overlay to the shape.
-
clearShadow
final ShapeComponent clearShadow()
Removes this ShapeComponent’s drop shadow.
-
-
-
-