<@doc alias="layout" hierarchy="GMLDOM"> (c) SAP AG 2003-2006. All rights reserved. // TODO: Implement this via Control's painting logic and remove this class!! Aspect ChartViewLayout for Layout; inherit InteractorLayout; constructor(board, parent) this.supercall(); this.legend = null; this.chart = null; end override virtual method paint(parentElement) this.supercall(); this.legend = this.createHtmlElement('DIV', null, null, this.contents); this.legend.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;"'; this.chart = this.createHtmlElement('DIV', null, null, this.contents); this.chart.style.cssText = 'position:absolute;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)"'; end override virtual method repaintContents(attr) var type = LOWER(base.chartType); var style = LOWER(base.chartStyle.replace('*', '_')); var image = '#URL[~res:skins.neutral.images.chart_.gif]'.replace('.gif', type+'_'+style+'.gif'); // We need try-catch here because chartType comes first (with incorrect style), then chartStyle comes try { this.chart.filters[0].src = image; } catch (e) {} this.layoutContents(); end override virtual method layoutContents(focusWidget, operation) var lg = base.legendPos, st = this.legend.style; var W = this.contents.offsetWidth, H = this.contents.offsetHeight, x1=10, x2=10, y1=10, y2=10; st.backgroundImage = 'url('+('#URL[~res:skins.neutral.images.legend_.gif]'.replace('.gif', lg+'.gif'))+')'; st.backgroundRepeat = 'no-repeat'; switch (lg) { case 'above': y1=20; st.backgroundPosition = 'center top'; break; case 'below': y2=20; st.backgroundPosition = 'center bottom'; break; case 'left': x1=70; st.backgroundPosition = 'left center'; break; case 'right': x2=70; st.backgroundPosition = 'right center'; break; default: st.backgroundImage = 'none'; break; } var st = this.chart.style; st.left = x1; st.top = y1; st.width = MAX(W-x1-x2, 0); st.height = MAX(H-y1-y2, 0); return false; end