001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/graphics/displayelements/Label.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.graphics.displayelements;
037    
038    import java.awt.Graphics2D;
039    
040    /**
041     * This is a label with style information and screen coordinates, ready to be rendered to a view.
042     * <p>
043     *
044     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
045     * @version $Revision: 18195 $ $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
046     */
047    public interface Label {
048    
049        /**
050         * Renders the label (including halo and other style information) to the submitted
051         * <tt>Graphics2D</tt> context.
052         * <p>
053         *
054         * @param g
055         *            <tt>Graphics2D</tt> context to be used
056         */
057        public void paint( Graphics2D g );
058    
059        /**
060         * Renders the label's boundaries to the submitted <tt>Graphics2D</tt> context. Immensely
061         * useful for testing.
062         * <p>
063         *
064         * @param g
065         *            <tt>Graphics2D</tt> context to be used
066         */
067        public void paintBoundaries( Graphics2D g );
068    
069        /**
070         * Determines if the label intersects with another label.
071         * <p>
072         *
073         * @param that
074         *            label to test
075         * @return true if the labels intersect
076         */
077        public boolean intersects( Label that );
078    
079        /**
080         * Returns the x-coordinate of the label.
081         * <p>
082         *
083         * @return the x-coordinate of the label.
084         */
085        public int getX();
086    
087        /**
088         * Returns the y-coordinate of the label.
089         * <p>
090         *
091         * @return the y-coordinate of the label.
092         */
093        public int getY();
094    
095        /**
096         * Returns the rightmost x-coordinate of the label's bounding box.
097         * <p>
098         *
099         * @return the rightmost x-coordinate of the label's bounding box.
100         */
101        public int getMaxX();
102    
103        /**
104         * Returns the lowermost y-coordinate of the label's bounding box.
105         * <p>
106         *
107         * @return the lowermost y-coordinate of the label's bounding box.
108         */
109        public int getMaxY();
110    
111        /**
112         * Returns the leftmost x-coordinate of the label's bounding box.
113         * <p>
114         *
115         * @return the leftmost x-coordinate of the label's bounding box.
116         */
117        public int getMinX();
118    
119        /**
120         * Returns the uppermost x-coordinate of the label's bounding box.
121         * <p>
122         *
123         * @return the uppermost x-coordinate of the label's bounding box.
124         */
125        public int getMinY();
126    }