KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > laures > cewolf > ChartImage


1 /* ================================================================
2  * Cewolf : Chart enabling Web Objects Framework
3  * ================================================================
4  *
5  * Project Info: http://cewolf.sourceforge.net
6  * Project Lead: Guido Laures (guido@laures.de);
7  *
8  * (C) Copyright 2002, by Guido Laures
9  *
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 JavaDoc;
26 import java.util.Date JavaDoc;
27
28
29 /**
30  * A special ChartHolder which also holds the image presentation of the chart.
31  * @author Guido Laures
32  */

33 public interface ChartImage {
34     
35     public static final int IMG_TYPE_CHART = 0;
36     public static final int IMG_TYPE_LEGEND = 1;
37     
38     /**
39      * Returns the width of the chart image in pixel.
40      * @return the width of the chart image in pixel
41      */

42     public int getWidth();
43
44     /**
45      * Returns the height of the chart image in pixel.
46      * @return the height of the chart image in pixel
47      */

48     public int getHeight();
49     
50     /**
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
55      */

56     public int getType();
57     
58     /**
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
64      */

65     public byte[] getBytes() throws CewolfException;
66         
67     /**
68      * Returns the MIME type of this image.
69      * @return the MIME type of the image
70      */

71     public String JavaDoc getMimeType();
72         
73     /**
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
77      */

78     public int getSize() throws CewolfException;
79     
80     public Date JavaDoc getTimeoutTime();
81 }
82
Popular Tags