/** * Created by TonyJiang on 16/8/23. */ import {LayoutSection, LayoutProperty, LayoutSectionKeyEnum} from "./LayoutSection"; import {Layout} from "./Layout"; import {CommonProperty, GraphProperty} from "../properties/define"; export class GraphicItemLayout extends Layout { constructor() { super(); this.sections.push(GraphicItemLayout.actions()); this.sections.push(GraphicItemLayout.appearance()); this.sections.push(GraphicItemLayout.layout()); } private static actions(): LayoutSection { return new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.FUNCTION]); } private static appearance(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.STYLE]); section.properties.push( new LayoutProperty(CommonProperty.backColor), new LayoutProperty(GraphProperty.fill), new LayoutProperty(GraphProperty.lineColor), new LayoutProperty(GraphProperty.lineStyle), new LayoutProperty(GraphProperty.lineWidth) // 'foreColor' ); return section; } private static layout(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.LAYOUT]); section.properties.push( new LayoutProperty(CommonProperty.position), new LayoutProperty(CommonProperty.size) // new LayoutProperty(CommonProperty.x), // new LayoutProperty(CommonProperty.y), // new LayoutProperty(CommonProperty.width), // new LayoutProperty(CommonProperty.height) ); return section; } }