import { ComponentConstructorInfo , ComponentDrawInfo , Coordinate } from '../types' ; import Component from '../common/Component' ; import { SN } from '../common/definitions' ; property property property property interface DrawInfo extends ComponentDrawInfo { length : number ; width : number ; start : Coordinate ; } /**
 * The body of Axis.
 * Draw the axis using this component.
 * */ export default abstract class AxisBody extends Component { constructor ( props ) { super ( props ) ; this . ext . onConstruct ( this ) ; } name = SN . AxisBody ; drawInfo : DrawInfo = { box : { x : 0 , y : 0 , width : 0 , height : 0 , } , length : 0 , width : 0 , start : { x : 0 , y : 0 , } , } ; createBox ( ) { this . drawInfo . box = { x : this . drawInfo . start . x - this . drawInfo . width / 2 , y : this . drawInfo . start . y , width : this . drawInfo . width , height : this . drawInfo . length , } ; } async apply ( ) { this . createBox ( ) ; return super . apply ( ) ; } static is ( comp ) { return comp . name === SN . AxisBody ; } }