001 /* Copyright 2007,2008,2009 John C. Gunther
002 *
003 * Licensed under the Apache License, Version 2.0 (the
004 * "License"); you may not use this file except in compliance
005 * with the License. You may obtain a copy of the License at:
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an
011 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
012 * either express or implied. See the License for the specific
013 * language governing permissions and limitations under the
014 * License.
015 */
016
017 package com.googlecode.gchart.client;
018 /**
019 *
020 * By implementing this interface, and passing an instance of your
021 * class to <tt>setCanvasFactory</tt>, you can "teach" GChart how to
022 * create the canvas-based widgets it needs to render non-rectangular
023 * aspects of your charts (solid-fill pie slices, continuously
024 * connected lines, solidly filled areas) much
025 * faster and with significantly better quality.
026 *
027 * <p>
028 *
029 * If you use <tt>GWTCanvas</tt> from the GWT incubator project for the vector
030 * graphics library, it's mainly a matter of adding a small chunk of
031 * boilerplate code (which you can find in the
032 * <tt>setCanvasFactory</tt> method's javadocs) to your application,
033 * adding <tt>gwt-incubator.jar</tt> to your build path, and
034 * selecting GChart's "continuously filled" option for your
035 * curves via <tt>getCurve().getSymbol().setFillSpacing(0)</tt>.
036 * See <tt>setCanvasFactory</tt> for full details.
037 *
038 * <p>
039 *
040 * @see GChart#setCanvasFactory setCanvasFactory
041 * @see GChartCanvasLite GChartCanvasLite
042 * @see GChart.Symbol#setFillSpacing setFillSpacing
043 * @see GChart.Symbol#setFillThickness setFillThickness
044 *
045 **/
046 public interface GChartCanvasFactory {
047 /**
048 * A method that returns a GWT <tt>Widget</tt> that implements
049 * the subset of a Mozilla canvas' features that GChart
050 * requires.
051 * <p>
052 *
053 * Note that the returned object must <i>both</i> implement
054 * <tt>GChartCanvasLite</tt> and be a GWT <tt>Widget</tt>.
055 *
056 */
057 public GChartCanvasLite create();
058 }
059