View Javadoc
1   /*
2    * ObjectLab, http://www.objectlab.co.uk/open is supporting JTreeMap.
3    *
4    * Based in London, we are world leaders in the design and development
5    * of bespoke applications for the securities financing markets.
6    *
7    * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
8    *           ___  _     _           _   _          _
9    *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
10   *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
11   *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
12   *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
13   *                   |__/
14   *
15   *                     www.ObjectLab.co.uk
16   *
17   * $Id$
18   *
19   * Copyright 2006 the original author or authors.
20   *
21   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
22   * use this file except in compliance with the License. You may obtain a copy of
23   * the License at
24   *
25   * http://www.apache.org/licenses/LICENSE-2.0
26   *
27   * Unless required by applicable law or agreed to in writing, software
28   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
29   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
30   * License for the specific language governing permissions and limitations under
31   * the License.
32   */
33  package net.sf.jtreemap.swing.provider;
34  
35  import java.awt.Color;
36  import java.io.Serializable;
37  
38  import javax.swing.JPanel;
39  
40  import net.sf.jtreemap.swing.Value;
41  
42  /**
43   * Abstract class with the methods who attribute color to the elements of
44   * JTreeMap.
45   *
46   * @author Laurent DUTHEIL
47   */
48  
49  public abstract class ColorProvider implements Serializable {
50  
51      /**
52       *
53       */
54      private static final long serialVersionUID = 1L;
55  
56      /**
57       * get the associated color to the value.
58       *
59       * @param value
60       *            double value
61       * @return the associated color to the value
62       */
63      public abstract Color getColor(Value value);
64  
65      /**
66       * get a legend JPanel.
67       *
68       * @return a legend JPanel
69       */
70      public abstract JPanel getLegendPanel();
71  }
72  /*
73   *                 ObjectLab is supporing JTreeMap
74   *
75   * Based in London, we are world leaders in the design and development
76   * of bespoke applications for the securities financing markets.
77   *
78   * <a href="http://www.objectlab.co.uk/open">Click here to learn more about us</a>
79   *           ___  _     _           _   _          _
80   *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
81   *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
82   *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
83   *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
84   *                   |__/
85   *
86   *                     www.ObjectLab.co.uk
87   */