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: // Rendering hints
21: import java.awt.RenderingHints;
22:
23: /**
24: * Rendering hints for tick's graduation.
25: *
26: * @since 2.0
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/widgets-swing/src/main/java/org/geotools/axis/RenderingHintKey.java $
28: * @version $Id: RenderingHintKey.java 20883 2006-08-07 13:48:09Z jgarnett $
29: * @author Martin Desruisseaux
30: */
31: final class RenderingHintKey extends RenderingHints.Key {
32: /**
33: * The required base class.
34: */
35: private final Class type;
36:
37: /**
38: * Construct a rendering hint key.
39: */
40: protected RenderingHintKey(final Class type, final int key) {
41: super (key);
42: this .type = type;
43: }
44:
45: /**
46: * Returns {@code true} if the specified object is a valid value for this key.
47: */
48: public boolean isCompatibleValue(final Object value) {
49: return value != null && type.isAssignableFrom(value.getClass());
50: }
51: }
|