KickJava   Java API By Example, From Geeks To Geeks.

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


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

28    public CountStatisticCustomizer(Statistic JavaDoc statistic)
29    {
30       super(statistic);
31
32       this.lblCount = new JLabel JavaDoc("");
33       this.addGraphItem(
34          resources.getString("customizer.tab.statistics.text.count"),
35          resources.getString("customizer.tab.statistics.tooltip.count"),
36          "Count",
37          this.lblCount);
38    }
39
40
41    /** Description of the Method */
42    public void refresh()
43    {
44       if (this.statistic != null)
45       {
46          long value;
47          CountStatistic JavaDoc cs = (CountStatistic JavaDoc) this.statistic;
48
49          value = cs.getCount();
50          this.lblCount.setText("" + value);
51
52          super.refresh();
53       }
54    }
55 }
56
Popular Tags