KickJava   Java API By Example, From Geeks To Geeks.

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


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.BoundaryStatistic 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 BoundaryStatisticCustomizer extends StatisticCustomizer
18 {
19    /** Description of the Field */
20    protected JLabel JavaDoc lblLowerBound = null;
21    /** Description of the Field */
22    protected JLabel JavaDoc lblUpperBound = null;
23
24
25    /**
26     * Constructor for CountStatisticCustomizer.
27     *
28     * @param statistic Description of the Parameter
29     */

30    public BoundaryStatisticCustomizer(Statistic JavaDoc statistic)
31    {
32       super(statistic);
33
34       this.lblUpperBound = new JLabel JavaDoc("");
35       this.addGraphItem(
36          resources.getString("customizer.tab.statistics.text.lower.bound"),
37          resources.getString("customizer.tab.statistics.tooltip.lower.bound"),
38          "UpperBound",
39          this.lblUpperBound);
40       this.lblLowerBound = 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          "LowerBound",
45          this.lblLowerBound);
46    }
47
48
49    /** Description of the Method */
50    public void refresh()
51    {
52       if (this.statistic != null)
53       {
54          long value;
55          BoundaryStatistic JavaDoc bs = (BoundaryStatistic JavaDoc) this.statistic;
56
57          value = bs.getUpperBound();
58          this.lblUpperBound.setText("" + value);
59          value = bs.getLowerBound();
60          this.lblLowerBound.setText("" + value);
61
62          super.refresh();
63       }
64    }
65 }
66
Popular Tags