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