1 11 12 package org.eclipse.birt.chart.examples.api.script.java; 13 14 import org.eclipse.birt.chart.model.layout.Block; 15 import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl; 16 import org.eclipse.birt.chart.script.ChartEventHandlerAdapter; 17 import org.eclipse.birt.chart.script.IChartScriptContext; 18 19 public class BlockScript extends ChartEventHandlerAdapter 20 { 21 22 28 public void beforeDrawBlock( Block block, IChartScriptContext icsc ) 29 { 30 if ( block.isLegend( ) ) 31 { 32 block.getOutline( ).setVisible( true ); 33 block.getOutline( ).getColor( ).set( 21, 244, 231 ); 34 } 35 else if ( block.isPlot( ) ) 36 { 37 block.getOutline( ).setVisible( true ); 38 block.getOutline( ).getColor( ).set( 244, 21, 231 ); 39 } 40 else if ( block.isTitle( ) ) 41 { 42 block.getOutline( ).setVisible( true ); 43 block.setBackground( ColorDefinitionImpl.CREAM( ) ); 44 block.getOutline( ).getColor( ).set( 0, 0, 0 ); 45 } 46 } 47 48 } 49 | Popular Tags |