001 package net.sourceforge.mp3dings.editors.imageeditor;
002 import java.io.IOException;
003 import java.io.File;
004
005 /*
006 Copyright (C) 2007 Moritz Ringler
007 This library is free software; you can redistribute it and/or
008 modify it under the terms of the GNU Lesser General Public
009 License as published by the Free Software Foundation; either
010 version 2.1 of the License, or (at your option) any later version.
011 This library is distributed in the hope that it will be useful,
012 but WITHOUT ANY WARRANTY; without even the implied warranty of
013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 Lesser General Public License for more details.
015 You should have received a copy of the GNU Lesser General Public
016 License along with this library; if not, write to the Free Software
017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018 */
019
020 public interface ImageRenderer{
021 /** Returns a component that renders the image data of the specified
022 mime type
023 or null if this renderer cannot render the image.
024 The ImageRenderer
025 must check the input data in argument order. If imagedata is non-null
026 it must be used as input else if f is non-null it must be used
027 and url may be used only if both imagedata and f are null.
028 The renderer must not modify imagedata.<p> The returned component
029 must fire a mouse event if a popup trigger mouse event
030 occurs anywhere within its area. The
031 renderer yields control over the returned component to the caller
032 and must not modify it afterwards.
033 **/
034 public ImageComponent getImageComponent(String mimetype, byte[] imagedata, File f, String url) throws IOException;
035
036 public boolean isMimeTypeSupported(String mime);
037
038 public String[] getSupportedMimeTypes();
039 }