01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2000, Institut de Recherche pour le Développement
06: * (C) 1999, Pêches et Océans Canada
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation; either
11: * version 2.1 of the License, or (at your option) any later version.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: */
18: package org.geotools.axis;
19:
20: // Dependencies
21: import java.util.Locale;
22: import javax.units.Unit;
23:
24: /**
25: * A graduation using numbers on a logarithmic axis.
26: *
27: * @since 2.0
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/widgets-swing/src/main/java/org/geotools/axis/LogarithmicNumberGraduation.java $
29: * @version $Id: LogarithmicNumberGraduation.java 20883 2006-08-07 13:48:09Z jgarnett $
30: * @author Martin Desruisseaux
31: */
32: public class LogarithmicNumberGraduation extends NumberGraduation {
33: /**
34: * Serial number for interoperability with different versions.
35: */
36: private static final long serialVersionUID = -8514854171546232887L;
37:
38: /**
39: * Contructs a new logarithmic graduation with the supplied units.
40: */
41: public LogarithmicNumberGraduation(final Unit unit) {
42: super (unit);
43: }
44:
45: /**
46: * Constructs or reuses an iterator. This method override
47: * the default {@link NumberGraduation} implementation.
48: */
49: NumberIterator getTickIterator(final TickIterator reuse,
50: final Locale locale) {
51: if (reuse instanceof LogarithmicNumberIterator) {
52: final NumberIterator it = (NumberIterator) reuse;
53: it.setLocale(locale);
54: return it;
55: } else {
56: return new LogarithmicNumberIterator(locale);
57: }
58: }
59: }
|