1 7 package org.ejtools.management.browser.ui.statistics; 8 9 import javax.management.j2ee.statistics.RangeStatistic ; 10 import javax.management.j2ee.statistics.Statistic ; 11 import javax.swing.JLabel ; 12 13 17 public class RangeStatisticCustomizer extends StatisticCustomizer 18 { 19 20 protected JLabel lblCurrent = null; 21 22 protected JLabel lblHighWM = null; 23 24 protected JLabel lblLowWM = null; 25 26 27 32 public RangeStatisticCustomizer(Statistic statistic) 33 { 34 super(statistic); 35 36 this.lblHighWM = new JLabel (""); 37 this.addGraphItem( 38 resources.getString("customizer.tab.statistics.text.highwater.mark"), 39 resources.getString("customizer.tab.statistics.tooltip.highwater.mark"), 40 "HighWaterMark", 41 this.lblHighWM); 42 this.lblCurrent = new JLabel (""); 43 this.addGraphItem( 44 resources.getString("customizer.tab.statistics.text.current"), 45 resources.getString("customizer.tab.statistics.tooltip.current"), 46 "Current", 47 this.lblCurrent); 48 this.lblLowWM = new JLabel (""); 49 this.addGraphItem( 50 resources.getString("customizer.tab.statistics.text.lowwater.mark"), 51 resources.getString("customizer.tab.statistics.tooltip.lowwater.mark"), 52 "LowWaterMark", 53 this.lblLowWM); 54 } 55 56 57 58 public void refresh() 59 { 60 if (this.statistic != null) 61 { 62 long value; 63 RangeStatistic rs = (RangeStatistic ) this.statistic; 64 65 value = rs.getHighWaterMark(); 66 this.lblHighWM.setText("" + value); 67 value = rs.getLowWaterMark(); 68 this.lblLowWM.setText("" + value); 69 value = rs.getCurrent(); 70 this.lblCurrent.setText("" + value); 71 72 super.refresh(); 73 } 74 } 75 } 76 | Popular Tags |