/** * Created by TonyJiang on 16/8/9. */ import {ReportItem} from "./ReportItem"; import {BoxProperty} from "./properties/define"; import {properties} from "./decorates"; import {Unit} from "../drawing/Unit"; import {JRVisitor} from "../jasper/JRVisitor"; import {Border} from "./properties/classes/Border"; import {Padding} from "./properties/classes/Padding"; import {JRBoxContainer} from "../jasper/JRBoxContainer"; @properties(BoxProperty) export abstract class BoxItem extends ReportItem implements JRBoxContainer{ clone(){ const item = super.clone() as BoxItem; item.setPropertyValue(BoxProperty.border, this.border.clone()); item.setPropertyValue(BoxProperty.padding, this.padding.clone()); // item.setTopPadding(this.topPadding.clone()); // item.setLeftPadding(this.leftPadding.clone()); // item.setBottomPadding(this.bottomPadding.clone()); // item.setRightPadding(this.rightPadding.clone()); return item; } get border():Border { return this.getBorder(); } get padding(): Padding { return this.getPadding(); } // get leftPadding():Unit { // return this.getPropertyValue(BoxProperty.leftPadding); // } // // get topPadding():Unit { // return this.getPropertyValue(BoxProperty.topPadding); // } // // get rightPadding():Unit { // return this.getPropertyValue(BoxProperty.rightPadding); // } // // get bottomPadding():Unit { // return this.getPropertyValue(BoxProperty.bottomPadding); // } //------- JRBoxContainer getBorder():Border { return this.getPropertyValue(BoxProperty.border); } getPadding(): Padding { return this.getPropertyValue(BoxProperty.padding); } setPadding(padding: Padding) { this.setPropertyValue(BoxProperty.padding, padding.clone()); } // getTopPadding(): Unit { // return this.topPadding; // } // // setTopPadding(padding: Unit) { // this.setPropertyValue(BoxProperty.topPadding, padding); // } // // getLeftPadding(): Unit { // return this.leftPadding; // } // // setLeftPadding(padding: Unit) { // this.setPropertyValue(BoxProperty.leftPadding, padding); // } // // getBottomPadding(): Unit { // return this.bottomPadding; // } // // setBottomPadding(padding: Unit) { // this.setPropertyValue(BoxProperty.bottomPadding, padding); // } // // getRightPadding(): Unit { // return this.rightPadding; // } // // setRightPadding(padding: Unit) { // this.setPropertyValue(BoxProperty.rightPadding, padding); // } visit(visitor:JRVisitor){} }