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: DefaultValue.java 74 2006-10-24 22:19:05Z benoitx $
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;
34  
35  /**
36   * Default Value <BR>
37   * The getLabel() method returns the "" + getValue()
38   * 
39   * @author Laurent DUTHEIL
40   */
41  public class DefaultValue extends Value {
42      /**
43       * 
44       */
45      private static final long serialVersionUID = 367321198951855282L;
46  
47      private double value;
48  
49      /**
50       * Constructor.
51       */
52      public DefaultValue() {
53          // nothing to do
54      }
55  
56      /**
57       * Constructor.
58       * 
59       * @param value
60       *            double value
61       */
62      public DefaultValue(final double value) {
63          this.value = value;
64      }
65  
66      /*
67       * (non-Javadoc)
68       * 
69       * @see net.sf.jtreemap.swing.Value#getValue()
70       */
71      @Override
72      public double getValue() {
73          return this.value;
74      }
75  
76      /*
77       * (non-Javadoc)
78       * 
79       * @see net.sf.jtreemap.swing.Value#getLabel()
80       */
81      @Override
82      public String getLabel() {
83          return "" + this.value;
84      }
85  
86      /*
87       * (non-Javadoc)
88       * 
89       * @see net.sf.jtreemap.swing.Value#setValue(double)
90       */
91      @Override
92      public void setValue(final double value) {
93          this.value = value;
94      }
95  
96      /*
97       * (non-Javadoc)
98       * 
99       * @see net.sf.jtreemap.swing.Value#setLabel(java.lang.String)
100      */
101     @Override
102     public void setLabel(final String newLabel) {
103         // ignore
104 
105     }
106 }
107 /*
108  *                 ObjectLab is supporing JTreeMap
109  * 
110  * Based in London, we are world leaders in the design and development 
111  * of bespoke applications for the securities financing markets.
112  * 
113  * <a href="http://www.objectlab.co.uk/open">Click here to learn more about us</a>
114  *           ___  _     _           _   _          _
115  *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
116  *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
117  *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
118  *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
119  *                   |__/
120  *
121  *                     www.ObjectLab.co.uk
122  */