001    /*--------------------------------------------------------------------------+
002    $Id: ITreeMapRenderer.java 26931 2010-03-17 14:53:13Z besenreu $
003    |                                                                          |
004    | Copyright 2005-2010 Technische Universitaet Muenchen                     |
005    |                                                                          |
006    | Licensed under the Apache License, Version 2.0 (the "License");          |
007    | you may not use this file except in compliance with the License.         |
008    | You may obtain a copy of the License at                                  |
009    |                                                                          |
010    |    http://www.apache.org/licenses/LICENSE-2.0                            |
011    |                                                                          |
012    | Unless required by applicable law or agreed to in writing, software      |
013    | distributed under the License is distributed on an "AS IS" BASIS,        |
014    | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
015    | See the License for the specific language governing permissions and      |
016    | limitations under the License.                                           |
017    +--------------------------------------------------------------------------*/
018    package edu.tum.cs.commons.treemap;
019    
020    import java.awt.Graphics2D;
021    
022    /**
023     * Interface for code rendering treemaps into an image.
024     * 
025     * @author Benjamin Hummel
026     * @author $Author: besenreu $
027     * @version $Rev: 26931 $
028     * @levd.rating GREEN Hash: 064B2D19FD2FCB564B98ED02E74F12D7
029     */
030    public interface ITreeMapRenderer {
031    
032            /**
033             * Renders the given tree into the graphics. The position is determined by
034             * the rectangle of the topmost node of the tree given.
035             * 
036             * @param tree
037             *            the tree to render. The tree must have been layouted and the
038             *            outermost rectangle should be completely included in the
039             *            provided graphics.
040             * @param graphics
041             *            the graphics used for drawing.
042             */
043            public <T> void renderTreeMap(ITreeMapNode<T> tree, Graphics2D graphics);
044    }