File

src/lib/myScript/common/penParameters.ts

Description

Parameters used for both input and output canvas draw.

Constructor

constructor(obj: PenParametersInput)

Methods

getColor
getColor()

Get the color renderer parameter

Returns: string

The color of the ink

setColor
setColor(color: string)

Set the color renderer parameter

Parameters :
  • color : String
Returns: void
getRectColor
getRectColor()

Get the rect renderer parameter

Returns: string

the rectangle color

setRectColor
setRectColor(rectColor: string)

Set the rect renderer parameter

Parameters :
  • rectColor : String
Returns: void
getFont
getFont()

Get the font renderer parameter

Returns: string

The font

setFont
setFont(font: string)

Set the font renderer parameter

Parameters :
  • font : String
Returns: void
getDecoration
getDecoration()

Get the decoration renderer parameter

Returns: string

The decoration

setDecoration
setDecoration(decoration: string)

Set the decoration renderer parameter

Parameters :
  • decoration : String
Returns: void
getWidth
getWidth()

Get the width renderer parameter

Returns: number

The ink width

setWidth
setWidth(width: number)

Set the width renderer parameter

Parameters :
  • width : Number
Returns: void

Properties

alpha
alpha: string
color
color: string
decoration
decoration: string
font
font: string
pressureType
pressureType: string
rectColor
rectColor: string
width
width: number
export interface PenParametersInput {
	color?: string,
	rectColor?: string,
	font?: string,
	decoration?: string,
	width?: number,
	pressureType?: string,
	alpha?: string,
}

/**
 * Parameters used for both input and output canvas draw.
 * 
 * @export
 * @class PenParameters
 */
export class PenParameters {
	color: string;
	rectColor: string;
	font: string;
	decoration: string;
	width: number;
	pressureType: string;
	alpha: string;

	constructor(obj?: PenParametersInput) {
		this.color = obj && obj.color || '#1580CD';
		this.rectColor = obj && obj.rectColor || 'rgba(0, 0, 0, 0.2)';
		this.font = obj && obj.font || 'Times New Roman';
		this.decoration = obj && obj.decoration || 'normal';
		this.width = obj && obj.width || 3;
		this.pressureType = obj && obj.pressureType || 'SIMULATED';
		this.alpha = obj && obj.alpha || '1.0';
	}

	/**
	 * Get the color renderer parameter
	 *
	 * @method getColor
	 * @returns {String} The color of the ink
	 */
	getColor(): string{
		return this.color;
	};

	/**
	 * Set the color renderer parameter
	 *
	 * @method setColor
	 * @param {String} color
	 */
	setColor(color: string) {
		this.color = color;
	};

	/**
	 * Get the rect renderer parameter
	 *
	 * @method getRectColor
	 * @returns {String} the rectangle color
	 */
	getRectColor(): string{
		return this.rectColor;
	};

	/**
	 * Set the rect renderer parameter
	 *
	 * @method setRectColor
	 * @param {String} rectColor
	 */
	setRectColor(rectColor: string) {
		this.rectColor = rectColor;
	};

	/**
	 * Get the font renderer parameter
	 *
	 * @method getFont
	 * @returns {String} The font
	 */
	getFont(): string{
		return this.font;
	};

	/**
	 * Set the font renderer parameter
	 *
	 * @method setFont
	 * @param {String} font
	 */
	setFont(font: string) {
		this.font = font;
	};

	/**
	 * Get the decoration renderer parameter
	 *
	 * @method getDecoration
	 * @returns {String} The decoration
	 */
	getDecoration(): string{
		return this.decoration;
	};

	/**
	 * Set the decoration renderer parameter
	 *
	 * @method setDecoration
	 * @param {String} decoration
	 */
	setDecoration(decoration: string) {
		this.decoration = decoration;
	};

	/**
	 * Get the width renderer parameter
	 *
	 * @method getWidth
	 * @returns {Number} The ink width
	 */
	getWidth(): number{
		return this.width;
	};

	/**
	 * Set the width renderer parameter
	 *
	 * @method setWidth
	 * @param {Number} width
	 */
	setWidth(width: number) {
		this.width = width;
	};

}

results matching ""

    No results matching ""