1 7 package org.ejtools.management.browser.ui.statistics; 8 9 import javax.management.j2ee.statistics.BoundedRangeStatistic ; 10 import javax.management.j2ee.statistics.Statistic ; 11 import javax.swing.JLabel ; 12 13 17 public class BoundedRangeStatisticCustomizer extends StatisticCustomizer 18 { 19 20 protected JLabel lblCurrent = null; 21 22 protected JLabel lblHighWM = null; 23 24 protected JLabel lblLowWM = null; 25 26 protected JLabel lblLowerBound = null; 27 28 protected JLabel lblUpperBound = null; 29 30 31 36 public BoundedRangeStatisticCustomizer(Statistic statistic) 37 { 38 super(statistic); 39 40 this.lblUpperBound = new JLabel (""); 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 (""); 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 (""); 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 (""); 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 (""); 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 74 public void refresh() 75 { 76 if (this.statistic != null) 77 { 78 long value; 79 BoundedRangeStatistic brs = (BoundedRangeStatistic ) 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 |