java/cewolf-1.0/src/main/java/de/laures/cewolf/ChartImage.java
changeset 1 639991d0808a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/cewolf-1.0/src/main/java/de/laures/cewolf/ChartImage.java	Sat Feb 28 21:31:02 2009 +0100
     1.3 @@ -0,0 +1,81 @@
     1.4 +/* ================================================================
     1.5 + * Cewolf : Chart enabling Web Objects Framework
     1.6 + * ================================================================
     1.7 + *
     1.8 + * Project Info:  http://cewolf.sourceforge.net
     1.9 + * Project Lead:  Guido Laures (guido@laures.de);
    1.10 + *
    1.11 + * (C) Copyright 2002, by Guido Laures
    1.12 + *
    1.13 + * This library is free software; you can redistribute it and/or modify it under the terms
    1.14 + * of the GNU Lesser General Public License as published by the Free Software Foundation;
    1.15 + * either version 2.1 of the License, or (at your option) any later version.
    1.16 + *
    1.17 + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    1.18 + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1.19 + * See the GNU Lesser General Public License for more details.
    1.20 + *
    1.21 + * You should have received a copy of the GNU Lesser General Public License along with this
    1.22 + * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
    1.23 + * Boston, MA 02111-1307, USA.
    1.24 + */
    1.25 +
    1.26 +package de.laures.cewolf;
    1.27 +
    1.28 +import java.io.IOException;
    1.29 +import java.util.Date;
    1.30 +
    1.31 +
    1.32 +/**
    1.33 + * A special ChartHolder which also holds the image presentation of the chart.
    1.34 + * @author  Guido Laures
    1.35 + */
    1.36 +public interface ChartImage {
    1.37 +	
    1.38 +	public static final int IMG_TYPE_CHART = 0;
    1.39 +	public static final int IMG_TYPE_LEGEND = 1;
    1.40 +    
    1.41 +	/**
    1.42 +	 * Returns the width of the chart image in pixel.
    1.43 +	 * @return the width of the chart image in pixel
    1.44 +	 */
    1.45 +    public int getWidth();
    1.46 +
    1.47 +	/**
    1.48 +	 * Returns the height of the chart image in pixel.
    1.49 +	 * @return the height of the chart image in pixel
    1.50 +	 */
    1.51 +    public int getHeight();
    1.52 +    
    1.53 +	/**
    1.54 +	 * Returns the type of the chart image.
    1.55 +	 * @return the type of the chart image
    1.56 +	 * @see #IMG_TYPE_CHART
    1.57 +	 * @see #IMG_TYPE_LEGEND
    1.58 +	 */
    1.59 +    public int getType();
    1.60 +    
    1.61 +    /**
    1.62 +     * Writes out a cached image to an outputstream. This method only marks the object
    1.63 +     * as accessed and therfore frees it for cache cleanup.
    1.64 +     * @param key the cache key
    1.65 +     * @param out the stream to write to
    1.66 +     * @throws IOException if an I/O error occured during write
    1.67 +     */
    1.68 +    public byte[] getBytes() throws CewolfException;
    1.69 +        
    1.70 +    /**
    1.71 +     * Returns the MIME type of this image.
    1.72 +     * @return the MIME type of the image
    1.73 +     */
    1.74 +    public String getMimeType();
    1.75 +        
    1.76 +	/**
    1.77 +	 * Returns the size of the image in bytes.
    1.78 +	 * @return size of the image
    1.79 +	 * @throws CewolfException if the size could not be determined
    1.80 +	 */
    1.81 +    public int getSize() throws CewolfException;
    1.82 +    
    1.83 +    public Date getTimeoutTime();
    1.84 +}