import {LayoutSection, LayoutProperty, LayoutSectionKeyEnum} from "./LayoutSection"; import {Layout} from "./Layout"; import {CommonProperty, ImageProperty, BoxProperty} from "../properties/define"; export class ImageItemLayout extends Layout { constructor() { super(); this.sections.push(ImageItemLayout.image()); this.sections.push(ImageItemLayout.preference()); this.sections.push(ImageItemLayout.layout()); } private static preference(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.PREFERENCE]); section.properties.push( new LayoutProperty(BoxProperty.border), new LayoutProperty(CommonProperty.backColor), new LayoutProperty(CommonProperty.foreColor) ); return section; } private static layout(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.LAYOUT]); section.properties.push( new LayoutProperty(CommonProperty.size), // new LayoutProperty(CommonProperty.x), // new LayoutProperty(CommonProperty.y), new LayoutProperty(CommonProperty.position), // new LayoutProperty(CommonProperty.width), // new LayoutProperty(CommonProperty.height), new LayoutProperty(BoxProperty.padding) // new LayoutProperty(BoxProperty.topPadding), // new LayoutProperty(BoxProperty.leftPadding), // new LayoutProperty(BoxProperty.bottomPadding), // new LayoutProperty(BoxProperty.rightPadding) ); return section; } static image(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.IMAGE]); section.properties.push( new LayoutProperty(ImageProperty.src), new LayoutProperty(ImageProperty.align) // new LayoutProperty(ImageProperty.hAlign), // new LayoutProperty(ImageProperty.vAlign), // new LayoutProperty(ImageProperty.scaleImage) ); return section; } }