1 /* ================================================================
2 * Cewolf : Chart enabling Web Objects Framework
3 * ================================================================
5 * Project Info: http://cewolf.sourceforge.net
6 * Project Lead: Guido Laures (guido@laures.de);
8 * (C) Copyright 2002, by Guido Laures
10 * This library is free software; you can redistribute it and/or modify it under the terms
11 * of the GNU Lesser General Public License as published by the Free Software Foundation;
12 * either version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License along with this
19 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307, USA.
23 package de.laures.cewolf;
25 import java.io.IOException;
26 import java.util.Date;
30 * A special ChartHolder which also holds the image presentation of the chart.
31 * @author Guido Laures
33 public interface ChartImage {
35 public static final int IMG_TYPE_CHART = 0;
36 public static final int IMG_TYPE_LEGEND = 1;
39 * Returns the width of the chart image in pixel.
40 * @return the width of the chart image in pixel
42 public int getWidth();
45 * Returns the height of the chart image in pixel.
46 * @return the height of the chart image in pixel
48 public int getHeight();
51 * Returns the type of the chart image.
52 * @return the type of the chart image
53 * @see #IMG_TYPE_CHART
54 * @see #IMG_TYPE_LEGEND
59 * Writes out a cached image to an outputstream. This method only marks the object
60 * as accessed and therfore frees it for cache cleanup.
61 * @param key the cache key
62 * @param out the stream to write to
63 * @throws IOException if an I/O error occured during write
65 public byte[] getBytes() throws CewolfException;
68 * Returns the MIME type of this image.
69 * @return the MIME type of the image
71 public String getMimeType();
74 * Returns the size of the image in bytes.
75 * @return size of the image
76 * @throws CewolfException if the size could not be determined
78 public int getSize() throws CewolfException;
80 public Date getTimeoutTime();