KickJava   Java API By Example, From Geeks To Geeks.

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


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.BoundedRangeStatistic 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 BoundedRangeStatisticCustomizer 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    /** Description of the Field */
26    protected JLabel JavaDoc lblLowerBound = null;
27    /** Description of the Field */
28    protected JLabel JavaDoc lblUpperBound = null;
29
30
31    /**
32     * Constructor for CountStatisticCustomizer.
33     *
34     * @param statistic Description of the Parameter
35     */

36    public BoundedRangeStatisticCustomizer(Statistic JavaDoc statistic)
37    {
38       super(statistic);
39
40       this.lblUpperBound = new JLabel JavaDoc("");
41       this.addGraphItem(
42          resources.getString("customizer.tab.statistics.text.upper.bound"),
43          resources.getString("customizer.tab.statistics.tooltip.upper.bound"),
44          "UpperBound",
45          this.lblUpperBound);
46       this.lblHighWM = new JLabel JavaDoc("");
47       this.addGraphItem(
48          resources.getString("customizer.tab.statistics.text.highwater.mark"),
49          resources.getString("customizer.tab.statistics.tooltip.highwater.mark"),
50          "HighWaterMark",
51          this.lblHighWM);
52       this.lblCurrent = new JLabel JavaDoc("");
53       this.addGraphItem(
54          resources.getString("customizer.tab.statistics.text.current"),
55          resources.getString("customizer.tab.statistics.tooltip.current"),
56          "Current",
57          this.lblCurrent);
58       this.lblLowWM = new JLabel JavaDoc("");
59       this.addGraphItem(
60          resources.getString("customizer.tab.statistics.text.lowwater.mark"),
61          resources.getString("customizer.tab.statistics.tooltip.lowwater.mark"),
62          "LowWaterMark",
63          this.lblLowWM);
64       this.lblLowerBound = new JLabel JavaDoc("");
65       this.addGraphItem(
66          resources.getString("customizer.tab.statistics.text.lower.bound"),
67          resources.getString("customizer.tab.statistics.tooltip.lower.bound"),
68          "LowerBound",
69          this.lblLowerBound);
70    }
71
72
73    /** Description of the Method */
74    public void refresh()
75    {
76       if (this.statistic != null)
77       {
78          long value;
79          BoundedRangeStatistic JavaDoc brs = (BoundedRangeStatistic JavaDoc) this.statistic;
80
81          value = brs.getUpperBound();
82          this.lblUpperBound.setText("" + value);
83          value = brs.getHighWaterMark();
84          this.lblHighWM.setText("" + value);
85          value = brs.getCurrent();
86          this.lblCurrent.setText("" + value);
87          value = brs.getLowWaterMark();
88          this.lblLowWM.setText("" + value);
89          value = brs.getLowerBound();
90          this.lblLowerBound.setText("" + value);
91
92          super.refresh();
93       }
94    }
95 }
96
Popular Tags