KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > IRangePolicy


1 /*
2  *
3  * IRangePolicy.java jchart2d
4  * Copyright (C) Achim Westermann, created on 20.04.2005, 10:23:32
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  * If you modify or optimize the code in a useful way please let me know.
21  * Achim.Westermann@gmx.de
22  *
23  */

24 package info.monitorenter.gui.chart;
25
26 import info.monitorenter.util.Range;
27
28 import java.beans.PropertyChangeListener JavaDoc;
29
30
31 /**
32  * <p>
33  * An interface that allows an axis to be plugged with a range policy.
34  * </p>
35  * <p>
36  * Implementations may limit the range of the underlying Chart2D's data
37  * (clipping / zooming), increase it (void space offset), guarantee a minimum
38  * viewport... .
39  * </p>
40  *
41  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
42  *
43  * @version $Revision: 1.1 $
44  *
45  * @see info.monitorenter.gui.chart.AAxis
46  */

47 public interface IRangePolicy {
48   /**
49    * <p>
50    * Registers a property change listener that will be informed about changes of
51    * the property identified by the given <code>propertyName</code>.
52    * </p>
53    *
54    * @param propertyName
55    * the name of the property the listener is interested in
56    *
57    * @param listener
58    * a listener that will only be informed if the property identified
59    * by the argument <code>propertyName</code> changes
60    *
61    *
62    */

63   public void addPropertyChangeListener(String JavaDoc propertyName, PropertyChangeListener JavaDoc listener);
64
65   /**
66    * Define the upper bound of the Chart2D's value range. Depends on the
67    * {@link AAxis} this instance is bound to.
68    *
69    * @param chartMin
70    * the minimum value of the connected Chart2D that may / should be
71    * taken into account.
72    *
73    * @param chartMax
74    * the maximum value of the connected Chart2D that may / should be
75    * taken into account.
76    *
77    * @return the maximum value (upper bound) for the Chart2D to display.
78    *
79    */

80   public double getMax(double chartMin, double chartMax);
81
82   /**
83    * Define the lower bound of the Chart2D's value range. Depends on the
84    * {@link AAxis} this instance is bound to.
85    *
86    * @param chartMin
87    * the minimum value of the connected Chart2D that may / should be
88    * taken into account.
89    *
90    * @param chartMax
91    * the maximum value of the connected Chart2D that may / should be
92    * taken into account.
93    *
94    * @return the minimum value (lower bound) for the Chart2D to display.
95    *
96    */

97   public double getMin(double chartMin, double chartMax);
98
99   /**
100    * <p>
101    * Returns all property change listeners for the given property.
102    * </p>
103    *
104    * @param property
105    * one of the constants with teh <code>PROPERTY_</code> prefix
106    * defined in this class or subclasses.
107    *
108    * @return the property change listeners for the given property.
109    */

110   public PropertyChangeListener JavaDoc[] getPropertyChangeListeners(String JavaDoc property);
111
112   /**
113    * Get the range of this range policy.
114    * <p>
115    *
116    * @return he range of this range policy
117    */

118   public Range getRange();
119
120   /**
121    * <p>
122    * Deregisters a property change listener that has been registerd for
123    * listening on all properties.
124    * </p>
125    *
126    * @param listener
127    * a listener that will only be informed if the property identified
128    * by the argument <code>propertyName</code> changes
129    *
130    *
131    */

132   public void removePropertyChangeListener(PropertyChangeListener JavaDoc listener);
133
134   /**
135    * <p>
136    * Removes a property change listener for listening on the given property.
137    * </p>
138    *
139    * @param property
140    * one of the constants with teh <code>PROPERTY_</code> prefix
141    * defined in this class or subclasses.
142    *
143    * @param listener
144    * the listener for this property change.
145    */

146   public void removePropertyChangeListener(String JavaDoc property, PropertyChangeListener JavaDoc listener);
147
148   /**
149    * Set the range of this RangePolicy.
150    * <p>
151    *
152    * @param range
153    * the Range for the range policy.
154    */

155   public void setRange(Range range);
156 }
157
Popular Tags