KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > management > browser > ui > statistics > RangeStatisticCustomizer


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.management.browser.ui.statistics;
8
9 import javax.management.j2ee.statistics.RangeStatistic JavaDoc;
10 import javax.management.j2ee.statistics.Statistic JavaDoc;
11 import javax.swing.JLabel JavaDoc;
12
13 /**
14  * @author letiemble
15  * @version $Revision: 1.3 $
16  */

17 public class RangeStatisticCustomizer extends StatisticCustomizer
18 {
19    /** Description of the Field */
20    protected JLabel JavaDoc lblCurrent = null;
21    /** Description of the Field */
22    protected JLabel JavaDoc lblHighWM = null;
23    /** Description of the Field */
24    protected JLabel JavaDoc lblLowWM = null;
25
26
27    /**
28     * Constructor for CountStatisticCustomizer.
29     *
30     * @param statistic Description of the Parameter
31     */

32    public RangeStatisticCustomizer(Statistic JavaDoc statistic)
33    {
34       super(statistic);
35
36       this.lblHighWM = new JLabel JavaDoc("");
37       this.addGraphItem(
38          resources.getString("customizer.tab.statistics.text.highwater.mark"),
39          resources.getString("customizer.tab.statistics.tooltip.highwater.mark"),
40          "HighWaterMark",
41          this.lblHighWM);
42       this.lblCurrent = new JLabel JavaDoc("");
43       this.addGraphItem(
44          resources.getString("customizer.tab.statistics.text.current"),
45          resources.getString("customizer.tab.statistics.tooltip.current"),
46          "Current",
47          this.lblCurrent);
48       this.lblLowWM = new JLabel JavaDoc("");
49       this.addGraphItem(
50          resources.getString("customizer.tab.statistics.text.lowwater.mark"),
51          resources.getString("customizer.tab.statistics.tooltip.lowwater.mark"),
52          "LowWaterMark",
53          this.lblLowWM);
54    }
55
56
57    /** Description of the Method */
58    public void refresh()
59    {
60       if (this.statistic != null)
61       {
62          long value;
63          RangeStatistic JavaDoc rs = (RangeStatistic JavaDoc) this.statistic;
64
65          value = rs.getHighWaterMark();
66          this.lblHighWM.setText("" + value);
67          value = rs.getLowWaterMark();
68          this.lblLowWM.setText("" + value);
69          value = rs.getCurrent();
70          this.lblCurrent.setText("" + value);
71
72          super.refresh();
73       }
74    }
75 }
76
Popular Tags