File

src/lib/myScript/input/generic/components/abstractComponent.ts

Description

Represent an abstract input component

Constructor

constructor()

Methods

getType
getType()

Get the type of the input component

Returns: string
setType
setType(type: string)

Set the type of the input component

Parameters :
  • type : String
Returns: void
getBoundingBox
getBoundingBox()

Get input component bounding-box

Returns: Rectangle
setBoundingBox
setBoundingBox(boundingBox: Rectangle)

Set input component bounding-box

Parameters :
Returns: void

Properties

boundingBox
boundingBox: Rectangle
scratchedStroke
scratchedStroke: boolean
type
type: string
import { Rectangle } from '../../../common/generic/rectangle';

/**
 * Represent an abstract input component
 * 
 * @abstract
 * @class AbstractComponent
 */
export abstract class AbstractComponent {
	type: string;
	boundingBox: Rectangle;
	scratchedStroke: boolean;

	constructor() { }
	/**
	 * Get the type of the input component
	 *
	 * @method getType
	 * @returns {String}
	 */
	getType(): string {
		return this.type;
	};

	/**
	 * Set the type of the input component
	 *
	 * @method setType
	 * @param {String} type
	 */
	setType(type: string) {
		this.type = type;
	};

	/**
	 * Get input component bounding-box
	 *
	 * @method getBoundingBox
	 * @returns {Rectangle}
	 */
	abstract getBoundingBox(): Rectangle;

	/**
	 * Set input component bounding-box
	 *
	 * @method setBoundingBox
	 * @param {Rectangle} boundingBox
	 */
	abstract setBoundingBox(boundingBox: Rectangle);
}

results matching ""

    No results matching ""