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.stream.jfreechart;
17
18 import org.jfree.chart.JFreeChart;
19
20 /**
21 * <p>A simple implementation of the {@link JFreeChartResource} where all the data is given in the constructor.</p>
22 * <p>This implementation defines no content-disposition header</p>
23 *
24 * @author Jacob von Eyben - Nordija A/S
25 */
26 public class SimpleJFreeChartResource extends JFreeChartResource {
27 private int height;
28 private int width;
29 private String imageFormat;
30
31 public SimpleJFreeChartResource(JFreeChart chart, int height, int width, String imageFormat) {
32 super(chart);
33 this.height = height;
34 this.width = width;
35 this.imageFormat = imageFormat;
36 }
37
38 public String getImageFormat() {
39 return imageFormat;
40 }
41
42 public int getHeight() {
43 return height;
44 }
45
46 public int getWidth() {
47 return width;
48 }
49
50 public String getContentDisposition() {
51 return null;
52 }
53 }