KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > rangepolicies > RangePolicyUnbounded


1 /*
2  *
3  * RangePolicyUnbounded.java of project jchart2d, a viewport
4  * that always shows every point in every trace of a chart but uses no
5  * more space than necessary.
6  * Copyright (C) Achim Westermann, created on 20.04.2005, 10:30:29
7  *
8  * This library is free software; you can redistribute it and/or
9  * 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  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you modify or optimize the code in a useful way please let me know.
23  * Achim.Westermann@gmx.de
24  *
25  */

26 package info.monitorenter.gui.chart.rangepolicies;
27
28 import info.monitorenter.util.Range;
29
30 /**
31  * A dummy IRangePolicy implementation that reflects the bounds of the connected
32  * Chart2D instance.
33  *
34  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
35  *
36  * @version $Revision: 1.2 $
37  */

38 public final class RangePolicyUnbounded extends ARangePolicy {
39  
40   /**
41    * Creates a range policy with an unconfigured range ({@link Range#RANGE_UNBOUNDED}).
42    * <p>
43    */

44   public RangePolicyUnbounded() {
45     super();
46   }
47
48   /**
49    * Creates a range policy backed by the given range which is not used for
50    * {@link #getMax(double, double)} or {@link #getMin(double, double)} but
51    * stored for later changes of the range policy from outside.
52    * <p>
53    *
54    * @param range
55    * the range that may be used to decide about the policy of
56    * displaying the range.
57    *
58    * @see info.monitorenter.gui.chart.AAxis#setRangePolicy(IRangePolicy)
59    */

60   public RangePolicyUnbounded(final Range range) {
61     super(range);
62   }
63
64   /**
65    * @see info.monitorenter.gui.chart.IRangePolicy#getMax(double,double)
66    */

67   public double getMax(final double chartMin, final double chartMax) {
68     return chartMax;
69   }
70
71   /**
72    * @see info.monitorenter.gui.chart.IRangePolicy#getMin(double, double)
73    */

74   public double getMin(final double chartMin, final double chartMax) {
75     return chartMin;
76   }
77
78 }
79
Popular Tags