001 //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/graphics/ScaleBar.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; 037 038 import java.awt.Color; 039 import java.awt.Font; 040 import java.awt.Graphics; 041 import java.text.NumberFormat; 042 043 /** 044 * 045 * 046 * @version $Revision: 18195 $ 047 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 048 * @author last edited by: $Author: mschneider $ 049 * 050 * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $ 051 */ 052 public interface ScaleBar { 053 054 /** 055 * A constant signaling no scale 056 */ 057 public static final int L_NONE = -1; 058 059 /** 060 * the scale 061 */ 062 public static final int L_SCALE = 0; 063 064 /** 065 * the default scale denominator 066 */ 067 public static final int L_SCALEDENOMINATOR = 1; 068 069 /** 070 * will paint the scale bar to the passed graphic context 071 * 072 * @param g 073 * graphic context 074 */ 075 void paint( Graphics g ); 076 077 /** 078 * sets the type of the label above the scale bar 079 * 080 * @param labelType 081 * lable type 082 */ 083 void setTopLabel( int labelType ); 084 085 /** 086 * sets the type of the label below the scale bar 087 * 088 * @param labelType 089 * lable type 090 */ 091 void setBottomLabel( int labelType ); 092 093 /** 094 * sets the scale as defined in the OGC WMS 1.1.1 specification. Scale is defined as the 095 * diagonal size of a pixel in the center of a map measured in meter. The setting of the scale 096 * will affect the value of the scale denominator 097 * 098 * @param scale 099 * map scale 100 */ 101 void setScale( double scale ); 102 103 /** 104 * sets the scale denominator for the scale bar. The scale denominator is the scale expression 105 * as we know it for printed maps (e.g. 1:10000 1:5000). The passed value is expressed in 106 * meters. The setting of the scale denominator will affect the value of the scale 107 * 108 * @param scaleDen 109 * scale denominator value 110 */ 111 void setScaleDenominator( double scaleDen ); 112 113 /** 114 * sets the units the scale and the scale denominater will be expressed at. Settings other than 115 * meter will cause that the passed values for scale and scale denominater will be recalculated 116 * for painting. it depends on the implementation what units are supported. 117 * 118 * @param units 119 * name units (meter, miles, feet etc.) 120 */ 121 void setUnits( String units ); 122 123 /** 124 * sets the front color of the scale bar 125 * 126 * @param color 127 */ 128 void setBarColor( Color color ); 129 130 /** 131 * sets the label color of the scale bar 132 * 133 * @param color 134 */ 135 void setLabelColor( Color color ); 136 137 /** 138 * sets the background color of the scale bar 139 * 140 * @param color 141 */ 142 void setBackgroundColor( Color color ); 143 144 /** 145 * sets the style of the scale bar. default style is |--------| the list of known styles depends 146 * on the implementation 147 * 148 * @param style 149 * style name 150 */ 151 void setStyle( String style ); 152 153 /** 154 * sets the font for label rendering 155 * 156 * @param font 157 * awt font object 158 */ 159 void setFont( Font font ); 160 161 /** 162 * sets the format for scale/scaleDen 163 * 164 * @param numberFormat 165 * a NumberFormat object 166 */ 167 void setNumberFormat( NumberFormat numberFormat ); 168 169 }