1 /*
2 * Copyright 2004 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.nordija.tapestry.bayeux.chart;
17
18 import org.jfree.chart.JFreeChart;
19
20 /**
21 * @author Jacob von Eyben - Nordija A/S
22 */
23 public interface IJFreeChartProvider {
24 int JPEG = 0;
25 int PNG = 1;
26
27 /**
28 * The actual chart to render
29 *
30 * @return an instance of the JFreeChart you want to render
31 */
32 JFreeChart getChart();
33
34 /**
35 * The height of the chart.
36 *
37 * @return the height in pixels
38 */
39 int getHeight();
40
41 /**
42 * The width of the chart.
43 *
44 * @return the width in pixels
45 */
46 int getWidth();
47
48 /**
49 * Tells how to render the chart.
50 * Possible return values:
51 * <ul>
52 * <li>{@link IJFreeChartProvider#JPEG}</li>
53 * <li>{@link IJFreeChartProvider#PNG}</li>
54 * </ul>
55 *
56 * @return int value indicating how to render the chart
57 */
58 int renderAs();
59 }