KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > birt > chart > examples > api > script > java > MarkerScript


1 /*******************************************************************************
2  * Copyright (c) 2004 Actuate Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Actuate Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.birt.chart.examples.api.script.java;
13
14 import org.eclipse.birt.chart.model.component.Axis;
15 import org.eclipse.birt.chart.model.component.MarkerLine;
16 import org.eclipse.birt.chart.model.component.MarkerRange;
17 import org.eclipse.birt.chart.script.ChartEventHandlerAdapter;
18 import org.eclipse.birt.chart.script.IChartScriptContext;
19
20 import com.ibm.icu.util.ULocale;
21
22 /**
23  *
24  */

25
26 public class MarkerScript extends ChartEventHandlerAdapter
27 {
28
29     /*
30      * (non-Javadoc)
31      *
32      * @see org.eclipse.birt.chart.script.IChartItemScriptHandler#beforeDrawMarkerLine(org.eclipse.birt.chart.model.component.Axis,
33      * org.eclipse.birt.chart.model.component.MarkerLine,
34      * org.eclipse.birt.chart.script.IChartScriptContext)
35      */

36     public void beforeDrawMarkerLine( Axis axis, MarkerLine mLine,
37             IChartScriptContext icsc )
38     {
39         ULocale.setDefault( ULocale.US );
40         if ( icsc.getULocale( ).equals( ULocale.US ) )
41         {
42             mLine.getLabel( ).getCaption( ).getColor( ).set( 165, 184, 55 );
43             mLine.getLineAttributes( ).getColor( ).set( 165, 184, 55 );
44         }
45     }
46
47     /*
48      * (non-Javadoc)
49      *
50      * @see org.eclipse.birt.chart.script.IChartItemScriptHandler#beforeDrawMarkerRange(org.eclipse.birt.chart.model.component.Axis,
51      * org.eclipse.birt.chart.model.component.MarkerRange,
52      * org.eclipse.birt.chart.script.IChartScriptContext)
53      */

54     public void beforeDrawMarkerRange( Axis axis, MarkerRange mRange,
55             IChartScriptContext icsc )
56     {
57         mRange.getLabel( ).getCaption( ).getColor( ).set( 225, 104, 105 );
58     }
59
60 }
61
Popular Tags