01: /* ================================================================
02: * Cewolf : Chart enabling Web Objects Framework
03: * ================================================================
04: *
05: * Project Info: http://cewolf.sourceforge.net
06: * Project Lead: Guido Laures (guido@laures.de);
07: *
08: * (C) Copyright 2002, by Guido Laures
09: *
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.
13: *
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.
17: *
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.
21: */
22:
23: package de.laures.cewolf;
24:
25: import java.io.IOException;
26: import java.util.Date;
27:
28: /**
29: * A special ChartHolder which also holds the image presentation of the chart.
30: * @author Guido Laures
31: */
32: public interface ChartImage {
33:
34: public static final int IMG_TYPE_CHART = 0;
35: public static final int IMG_TYPE_LEGEND = 1;
36:
37: /**
38: * Returns the width of the chart image in pixel.
39: * @return the width of the chart image in pixel
40: */
41: public int getWidth();
42:
43: /**
44: * Returns the height of the chart image in pixel.
45: * @return the height of the chart image in pixel
46: */
47: public int getHeight();
48:
49: /**
50: * Returns the type of the chart image.
51: * @return the type of the chart image
52: * @see #IMG_TYPE_CHART
53: * @see #IMG_TYPE_LEGEND
54: */
55: public int getType();
56:
57: /**
58: * Writes out a cached image to an outputstream. This method only marks the object
59: * as accessed and therfore frees it for cache cleanup.
60: * @param key the cache key
61: * @param out the stream to write to
62: * @throws IOException if an I/O error occured during write
63: */
64: public byte[] getBytes() throws CewolfException;
65:
66: /**
67: * Returns the MIME type of this image.
68: * @return the MIME type of the image
69: */
70: public String getMimeType();
71:
72: /**
73: * Returns the size of the image in bytes.
74: * @return size of the image
75: * @throws CewolfException if the size could not be determined
76: */
77: public int getSize() throws CewolfException;
78:
79: public Date getTimeoutTime();
80: }
|