Circle
Class representing a circle, extending the Shape class with a CircleDefinition. Provides functionality for rendering, resizing and moving the circle.
Extends
Constructors
new Circle()
new Circle(
center
,radius
,style
?,options
?):Circle
Creates an instance of the Circle
class.
The Circle
can be created either by passing a Point
object representing the center,
or by providing the individual coordinates for the center.
Parameters
• center: Point
The center Point
of the circle.
• radius: number
The radius of the circle.
• style?: ICircleStyle
Defines the styling of the circle.
• options?: ICircleOptions
The configuration options for the circle.
Returns
Throws
InvalidConstructorArgumentsError if invalid arguments are passed.
Overrides
Defined in
new Circle()
new Circle(
centerX
,centerY
,radius
,style
?,options
?):Circle
Creates an instance of the Circle
class.
The Circle
can be created either by passing a Point
object representing the center,
or by providing the individual coordinates for the center.
Parameters
• centerX: number
The X-coordinate of the starting point.
• centerY: number
The Y-coordinate of the starting point.
• radius: number
The radius of the circle.
• style?: ICircleStyle
Defines the styling of the circle.
• options?: ICircleOptions
The configuration options for the circle.
Returns
Throws
InvalidConstructorArgumentsError if invalid arguments are passed.
Overrides
Shape<CircleDefinition, CircleStyle, CircleOptions>.constructor
Defined in
Properties
_definition
protected
_definition:CircleDefinition
The shape definition, proxied to trigger observer notifications on change.
Inherited from
Defined in
_options
protected
_options:CircleOptions
The options for configuring the shape, proxied to trigger observer notifications on change.
Inherited from
Defined in
_state
protected
_state:ShapeState
=ShapeState.Default
The current state of the shape, representing its visual or interactive status.
Inherited from
Defined in
_style
protected
_style:CircleStyle
The style settings for the shape, proxied to trigger observer notifications on change.
Inherited from
Defined in
observers
protected
observers: () =>void
[] =[]
List of observer functions to be notified on shape changes.
Inherited from
Defined in
Accessors
center
get
center():Point
Gets the center point of the circle.
set
center(center
):void
Sets the center point of the circle.
Parameters
• center: Point
The new center point of the circle.
Returns
The center point of the circle.
Defined in
options
get
options():TOptions
Gets the configuration options of the shape.
set
options(options
):void
Updates the configuration options of the shape and notifies observers.
Parameters
• options: TOptions
The new options to apply.
Returns
TOptions
The current options.
Inherited from
Defined in
radius
get
radius():number
Gets the radius of the circle.
set
radius(radius
):void
Sets the radius of the circle.
Parameters
• radius: number
The new radius of the circle.
Returns
number
The radius of the circle.
Defined in
state
get
state():ShapeState
Gets the current state of the shape.
set
state(state
):void
Sets a new state for the shape.
Parameters
• state: ShapeState
The new state to assign to the shape.
Returns
The current state of the shape.
Inherited from
Defined in
stateStyle
get
stateStyle():TStyle
Retrieves the effective style of the shape based on its current state.
Returns
TStyle
The computed style object for the current shape state, with state-specific overrides merged in as necessary.
Inherited from
Defined in
style
get
style():TStyle
Gets the style settings of the shape.
set
style(style
):void
Updates the style settings of the shape and notifies observers.
Parameters
• style: TStyle
The new style settings to apply.
Returns
TStyle
The current style settings.
Inherited from
Defined in
Methods
addObserver()
addObserver(
observer
):void
Adds an observer function that will be called when the shape's state changes.