KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.ArrayList JavaDoc;
10
11 import javax.management.j2ee.statistics.Statistic JavaDoc;
12
13 /**
14  * @author letiemble
15  * @version $Revision: 1.2 $
16  */

17 public class CompositeStatisticCustomizer extends StatisticCustomizer
18 {
19    /** Description of the Field */
20    protected ArrayList JavaDoc children = null;
21
22
23    /**
24     * Constructor for CompositeStatisticCustomizer.
25     *
26     * @param statistic Description of the Parameter
27     */

28    public CompositeStatisticCustomizer(Statistic JavaDoc statistic)
29    {
30       super(statistic);
31       this.children = new ArrayList JavaDoc();
32    }
33
34
35    /**
36     * Adds a feature to the Customizer attribute of the CompositeStatisticCustomizer object
37     *
38     * @param customizer The feature to be added to the Customizer attribute
39     */

40    public void addCustomizer(StatisticCustomizer customizer)
41    {
42       this.add(customizer, this.gridbagconstraints);
43       this.children.add(customizer);
44    }
45
46
47    /** Description of the Method */
48    public void refresh()
49    {
50       for (int i = 0; i < children.size(); i++)
51       {
52          StatisticCustomizer sc = (StatisticCustomizer) children.get(i);
53          sc.refresh();
54       }
55
56       super.refresh();
57    }
58
59
60    /**
61     * @param statistic The new statistic value
62     * @see org.ejtools.management.browser.ui.customizer.StatisticCustomizer#setStatistic(javax.management.j2ee.statistics.Statistic)
63     */

64    public void setStatistic(Statistic JavaDoc statistic)
65    {
66       for (int i = 0; i < children.size(); i++)
67       {
68          StatisticCustomizer sc = (StatisticCustomizer) children.get(i);
69          sc.setStatistic(statistic);
70       }
71    }
72 }
73
Popular Tags