import {JRStaticText} from "../jasper/JRStaticText"; import {JRVisitor} from "../jasper/JRVisitor"; import {TextItem} from "./TextItem"; export class StaticTextItem extends TextItem implements JRStaticText { constructor(){ super(); this.value = "文本"; } displayName(): string { return '静态文本'; } get text(): string { return this.value; } set text(value: string) { this.value = value; } protected preferredSize():{width:number; height:number} { return {width: 100, height: 30}; } clone(){ const item = super.clone() as StaticTextItem; item.text = this.text; return item; } // -------- JRStaticText implements block begin getText():string { return this.text; } setText(text:string):void { this.text = text; } visit(visitor:JRVisitor) { visitor.visitStaticText(this); } // -------- JRStaticText implements block end }